import { type ToolDef } from "./types.js"; /** * Lean context strategy. * * Full mode advertises every action inline: each category tool's description * carries an "Actions:\n- ..." catalog and SERVER_INSTRUCTIONS lists all 600+ * actions. That is great for discoverability but expensive on the MCP * initialize handshake for token-constrained clients. * * Lean mode keeps the exact same 24 typed category tools and their validated * `action` enums, but: * - trims each tool description to its one-line summary + a discovery pointer, * - trims the server instructions (see SERVER_INSTRUCTIONS_LEAN), * - adds a per-category `describe` action that returns that category's action * list on demand, * - prepends a `catalog` discovery tool (search / describe / list_categories) * so an agent can find any action across every category by keyword. * * The typed enum is deliberately retained (unlike a free-form string surface) * so unknown actions are still rejected up front. Silent param drift is the * failure mode this repo works hardest to avoid. */ export type ContextStrategy = "full" | "lean" | "micro"; /** * Resolve the active strategy. Env var wins over config so a user can flip it * per-session without editing ue-mcp.yml. Anything other than "lean"/"micro" * (case insensitive) resolves to "full", the safe, unchanged default. */ export declare function resolveContextStrategy(configStrategy?: string): ContextStrategy; /** Split a categoryTool() description into its summary and the generated catalog. */ export declare function splitDescription(description: string): { summary: string; catalog: string; }; /** * Build the `catalog` discovery tool from the pre-lean tools, so its search * index and describe output carry the full action descriptions even though the * leaned tools hide them. */ export declare function buildCatalogTool(tools: ToolDef[]): ToolDef; /** * Apply the lean strategy to a set of category tools. Returns a new array * (catalog tool first); the input tools are not mutated. When two categories * already contain a `catalog` tool (they never do today) the caller-supplied * one wins; we skip prepending a duplicate. */ export declare function applyLeanContext(tools: ToolDef[]): ToolDef[]; /** * Micro strategy: collapse the entire surface behind a single gateway tool, * mirroring the native MCP toolset gateway (list_toolsets / describe_toolset / * call_tool). The 23 category tools are NOT advertised; the agent enumerates * with list_categories, learns a category with describe, and invokes anything * with call. This is the smallest possible seed. * * `call` dispatches straight to the target ActionSpec (handler or bridge) using * the same logic categoryTool() uses, so no registry round-trip is needed. */ /** * The one tool micro mode advertises. Named here rather than inline because * dispatch has to recognise it: a call through the gateway carries its real * category and action as parameters, so anything classifying the call (the * multi-editor write gate, #817) has to look past the gateway to find them. */ export declare const MICRO_GATEWAY_TOOL = "tools"; /** The gateway action that invokes something. `category` + `method` name it. */ export declare const MICRO_GATEWAY_CALL = "call"; export declare function buildMicroGateway(tools: ToolDef[]): ToolDef;