/** * Context Management MCP Tools * * Provides tools that let the agent programmatically manage its own * conversation context — clearing or compacting it. This is essential for * loop/scheduled tasks that need a clean context between iterations. * * Uses an EventEmitter pattern (same as loop.ts) so the tool execution * can signal the React hook (useAgentStream) to reset conversationId. */ import { type Tool } from '@modelcontextprotocol/sdk/types.js'; export interface ContextActionEvent { action: 'clear' | 'compact'; /** Agent-provided summary of what was accomplished (used by compact) */ summary?: string; /** Reason the agent is performing this action */ reason?: string; } /** * Register a callback that fires when the agent requests a context action. * Returns an unsubscribe function. */ export declare function onContextAction(callback: (event: ContextActionEvent) => void): () => void; /** * Consume the pending compact summary (if any). Returns the summary string * and clears it so it's only used once. */ export declare function consumeCompactSummary(): string | null; export declare function getContextToolDefinitions(): Tool[]; export declare const CONTEXT_TOOL_NAMES: Set; export declare function executeContextTool(toolName: string, args: Record): Promise; //# sourceMappingURL=context-tools.d.ts.map