Skip to content

Commit 1a24eb3

Browse files
pranavraja99claude
andcommitted
feat(tools): mission tool family (engine v2)
Exposes the engine-v2 mission framework to the LLM via seven built-in tools: mission_create, mission_list, mission_update, mission_delete, mission_fire, mission_pause, mission_resume. - src/tools/builtin/mission.rs (new, +705): the seven Tool impls. Each holds an Arc<MissionManager>; cadence strings parse into MissionCadence (cron / event: / webhook: / manual). - src/tools/builtin/mod.rs: module + Tool re-exports. - src/tools/registry.rs: - PROTECTED_TOOL_NAMES gains the seven mission_* entries. - New pub type MissionSlot — Arc<RwLock<Option<(Arc<MissionManager>, ProjectId)>>> — for tools whose registration pre-dates the engine's MissionManager construction. - mission_slot field on ToolRegistry + public accessor. - set_mission_slot(manager, project_id) to populate the slot. - register_mission_tools(manager, project_id): instantiates all seven tools against the supplied manager and fills the slot. - src/bridge/router.rs init_engine(): calls agent.tools().register_mission_tools(...) once MissionManager is constructed, immediately before the bootstrap/resume calls. Motivating use case: downstream integration tools (e.g. Abound's send-wire wait-action in nearai/ironclaw-abound) need to create missions via the generic engine-v2 surface. With this PR, a downstream fork can register additional mission-using tools through `ExternalToolRegistrar` (see #2871) and read the MissionManager through the shared MissionSlot at execute time. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d33fecb commit 1a24eb3

4 files changed

Lines changed: 815 additions & 0 deletions

File tree

src/bridge/router.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,15 @@ pub async fn init_engine(agent: &Agent) -> Result<(), Error> {
18261826
mission_manager_inner =
18271827
mission_manager_inner.with_insights_interval(missions_config.insights_interval);
18281828
let mission_manager = Arc::new(mission_manager_inner);
1829+
// Register the engine-v2 mission tool family now that the manager
1830+
// exists. Tools constructed here capture `Arc::clone(&mission_manager)`
1831+
// directly; the call also fills `ToolRegistry::mission_slot` so any
1832+
// downstream integration tool registered through the plugin seam
1833+
// (see `ExternalToolRegistrar`) sees the same manager.
1834+
agent
1835+
.tools()
1836+
.register_mission_tools(Arc::clone(&mission_manager), project_id)
1837+
.await;
18291838
if let Err(e) = thread_manager.recover_project_threads(project_id).await {
18301839
debug!("engine v2: recover_project_threads failed: {e}");
18311840
}

0 commit comments

Comments
 (0)