/** * ActivateTool — meta-capability that lets the agent pull on-demand tools * into the active toolset per session. * * Pattern borrowed from OpenBB MCP server's per-session tool visibility: * a weak model confronted with 25+ tool definitions starts inventing names * or emits role-play "[TOOLCALL]" fragments. Register only the core file/ * shell tools by default and let the model explicitly opt in to the rest. * * Contract: * - `ActivateTool()` with no args → lists every inactive tool with a * one-line description so the model knows what's available. * - `ActivateTool({ names: ["ExaSearch", "ExaReadUrls"] })` → adds the * named tools to the session's active set; subsequent turns include * their full schemas. Returns a concise confirmation. * * The factory captures the shared `activeTools` Set that the loop filters * against and the full `allTools` map used for name resolution. Both live * in the session — activation is not durable across restarts on purpose, * since the model can always re-activate on the next turn if it needs to. */ import type { CapabilityHandler } from '../agent/types.js'; export interface ActivateToolDeps { /** Mutable set of tool names currently visible to the model. */ activeTools: Set; /** Map of every registered capability, keyed by name. */ allTools: Map; } export declare function createActivateToolCapability(deps: ActivateToolDeps): CapabilityHandler;