/** * Shared context types for the wait-tool subsystem. */ import type { initMemoryDb } from "../../data/memory/index.js"; import type { TelegramClient } from "../../services/telegram.js"; import type { AppConfig, ToolResult } from "../../lib/types.js"; import type { ThreadLifecycleService } from "../../services/thread-lifecycle.service.js"; export interface WaitToolContext { /** Mutable per-session state — the handler reads and writes directly. */ state: { currentThreadId: number | undefined; sessionStartedAt: number; waitCallCount: number; lastToolCallAt: number; toolCallsSinceLastDelivery: number; operatorSendsThisTurn: number; lastOperatorMessageAt: number; lastOperatorMessageText: string; lastConsolidationAt: number; previewedUpdateIds: Set; lastDriveAttemptAt: number; drivePhase2Fired: boolean; }; addPreviewedId: (id: number) => void; generateDmnReflection: (threadId: number) => string; resolveThreadId: (args: Record | undefined) => number | undefined; telegram: TelegramClient; telegramChatId: string; getMemoryDb: () => ReturnType; config: AppConfig; threadLifecycle: ThreadLifecycleService; getMcpSessionId?: () => string | undefined; errorResult: (msg: string) => ToolResult & { isError: true; }; } export interface WaitToolExtra { sendNotification: (notification: { method: string; params: Record; }) => Promise; signal: AbortSignal; requestId?: string | number; /** * `_meta` from the originating JSON-RPC request. Carries the client-supplied * `progressToken` that keepalive `notifications/progress` MUST echo so the * client can associate them with the in-flight call and reset its request * timeout (`resetTimeoutOnProgress`). The token is client-defined and is NOT * guaranteed to equal `requestId` — the Copilot CLI's native MCP client uses * a distinct token, so echoing `requestId` silently mismatches and the call * times out (~60s) despite keepalives. */ _meta?: { progressToken?: string | number; [key: string]: unknown; }; } //# sourceMappingURL=context.d.ts.map