Skip to content

Commit 1c9dd95

Browse files
committed
Merge branch 'cli-core-0.6.0'
2 parents 8a9a3c6 + b63dca7 commit 1c9dd95

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

core/src/agent_api.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,21 @@ impl AgentSession {
13391339
&self.tool_executor
13401340
}
13411341

1342+
/// Register a host-provided dynamic tool into the live session. Enables an
1343+
/// embedding app (e.g. the a3s-code CLI's login-gated `runtime` A3S Runtime
1344+
/// offload tool) to add a native tool at runtime; it enters the LLM's toolset
1345+
/// on the next run (`build_agent_loop` re-snapshots `definitions()` per run),
1346+
/// the same way MCP tools surface after `add_mcp_server`. Idempotent by name.
1347+
pub fn register_dynamic_tool(&self, tool: Arc<dyn crate::tools::Tool>) {
1348+
self.tool_executor.register_dynamic_tool(tool);
1349+
}
1350+
1351+
/// Remove a previously host-registered dynamic tool by name (e.g. on logout).
1352+
/// No-op if no tool of that name is registered.
1353+
pub fn unregister_dynamic_tool(&self, name: &str) {
1354+
self.tool_executor.unregister_dynamic_tool(name);
1355+
}
1356+
13421357
/// Remove an MCP server from this session.
13431358
///
13441359
/// Disconnects the server and unregisters all its tools from the executor.

0 commit comments

Comments
 (0)