import type { EventBus } from '../../events/index.js'; import type { ChatNoticeLevel } from '../../core/types/agent-types.js'; export declare const TTL_MS: number; /** Called once from app.ts during startup, before startWebhookServer(). */ declare function initHookBridge(bus: EventBus): void; type QuestionNotify = (requestId: string, channel: string, sessionId: string, questions: any[]) => void; type PlanNotify = (requestId: string, channel: string, sessionId: string, planContent: string, toolInput: any) => void; /** @deprecated no-op since S5; replaced by bus.subscribe('ask-user.requested') in app.ts */ declare function setQuestionNotify(_cb: QuestionNotify): void; /** @deprecated no-op since S5; replaced by bus.subscribe('plan.submitted') in app.ts */ declare function setPlanNotify(_cb: PlanNotify): void; declare function registerAskQuestion(requestId: string, channel: string, sessionId: string, questions: any[], dryRun?: boolean, threadId?: string | null, level?: ChatNoticeLevel | null): Promise; declare function registerPlanApproval(requestId: string, channel: string, sessionId: string, planContent: string, toolInput: any, dryRun?: boolean, threadId?: string | null): Promise; declare function resolveRequest(requestId: string, data: any): boolean; type OnStale = (requestId: string, channel: string, sessionId: string) => void; /** Register a callback fired when a pending request times out (wired by app.ts to mark the * interaction entity expired + clean the group/plan maps). Pass null to clear (tests). */ declare function setOnStale(cb: OnStale | null): void; declare function cleanupStale(now?: number): void; /** Register the active onAssistantMessage callback for a channel (called by app.ts before runAgent). */ declare function setStreamingCallback(channel: string, cb: (text: string) => void): void; /** Clear the streaming callback when the turn ends (called by app.ts after runAgent). */ declare function clearStreamingCallback(channel: string): void; /** Get the active streaming callback for a channel, if any. */ declare function getStreamingCallback(channel: string): ((text: string) => void) | null; /** * Publish plan.submitted directly (non-blocking, no pendingRequest). * Used by PI backend: the resolution goes through sendExtensionUiResponse, not resolveRequest. */ declare function publishPlanSubmitted(requestId: string, channel: string, sessionId: string, planContent: string, planFilePath: string | null, extensionUiId: string, threadId?: string | null): void; /** * Publish ask-user.requested directly (non-blocking, no pendingRequest). * Used by PI backend: the resolution goes through sendExtensionUiResponse, not resolveRequest. * @param extensionUiId — original PI extension_ui_request id; required for sendExtensionUiResponse to unblock the PI subprocess. */ declare function publishAskUserRequested(requestId: string, channel: string, sessionId: string, questions: any[], extensionUiId?: string, threadId?: string | null): void; export { initHookBridge, setQuestionNotify, setPlanNotify, registerAskQuestion, registerPlanApproval, resolveRequest, setOnStale, cleanupStale, setStreamingCallback, clearStreamingCallback, getStreamingCallback, publishPlanSubmitted, publishAskUserRequested };