import type { AgentSession } from "../../core/agent-session.js"; import type { AgentSessionRuntime } from "../../core/agent-session-runtime.ts"; import type { ResourceOverlap } from "../../core/diagnostics.ts"; import type { UIPromptEndEvent, UIPromptStartEvent } from "../../core/extensions/agent-events.ts"; import type { ExtensionUIContext } from "../../core/extensions/index.js"; import type { WorkflowActivityFrame } from "../../core/extensions/workflow-events.js"; import type { KeybindingsManager } from "../../core/keybindings.ts"; import type { RpcAutocompleteItem, RpcResourceExtension, RpcSlashCommand } from "../rpc/rpc-types.ts"; import type { ActivityWatchdogDiagnostic } from "./activity-watchdog.ts"; import type { EngineKeybindingState, InteractiveEngineMessage } from "./protocol.ts"; import { type TuiRendererLifecycle } from "./remote-component.ts"; interface EngineMessageSource { onEngineMessage(listener: (message: InteractiveEngineMessage) => void): () => void; onKeybindingState?(listener: (state: EngineKeybindingState) => void): () => void; } export declare function attachInteractiveEngineKeybindingSync(runtime: EngineMessageSource, keybindings: KeybindingsManager, onState?: (state: EngineKeybindingState) => void): () => void; export declare function attachInteractiveEngineHost(runtime: AgentSessionRuntime, ui: ExtensionUIContext, onDiagnostic: (diagnostic: ActivityWatchdogDiagnostic) => void, tuiRendererLifecycle: TuiRendererLifecycle, setShortcutHandler?: (handler: (data: string) => boolean) => undefined | (() => void), keybindings?: KeybindingsManager, onWorkflowActivity?: (frame: WorkflowActivityFrame) => void, onUIPrompt?: (event: UIPromptStartEvent | UIPromptEndEvent | undefined) => void): () => void; /** * Observe workflow activity of a session whose extensions run in this process. An isolated host * receives it from its engine child instead (see `attachInteractiveEngineHost`). */ export declare function observeLocalWorkflowActivity(runtime: AgentSessionRuntime, session: AgentSession, observer: (frame: WorkflowActivityFrame) => void): () => void; /** Route host-owned trust waits to the runner that actually owns the subscribers. */ export declare function withHostProjectTrustPrompt(runtime: AgentSessionRuntime, kind: "select" | "confirm" | "input", title: string, run: () => Promise): Promise; export declare function waitForInteractiveEngineBound(runtime: AgentSessionRuntime): Promise; export declare function waitForInteractiveEngineProjectTrust(runtime: AgentSessionRuntime): Promise; export declare function interruptBlockedInteractiveEngine(runtime: AgentSessionRuntime): boolean; /** * True when the interactive engine still owes a cooperative abort or the * heartbeat watchdog has declared it unresponsive, i.e. when the explicit * Ctrl+C escape hatch promised by the watchdog copy applies. */ export declare function interactiveEngineNeedsExplicitTermination(runtime: AgentSessionRuntime): boolean; /** * Explicitly terminate an unresponsive interactive engine and start recovery. * Only ever reached from a deliberate user action (Ctrl+C) — never from Escape. */ export declare function terminateInteractiveEngine(runtime: AgentSessionRuntime): boolean; /** * Command catalog the engine child exposes to the isolated host. Returns an * empty list for non-isolated runtimes so callers can merge unconditionally. */ export declare function getInteractiveEngineRemoteCommands(runtime: AgentSessionRuntime): readonly RpcSlashCommand[]; export declare function getInteractiveEngineResourceOverlaps(runtime: AgentSessionRuntime): readonly ResourceOverlap[]; export declare function getInteractiveEngineResourceExtensions(runtime: AgentSessionRuntime): readonly RpcResourceExtension[]; export declare function onInteractiveEngineResourceExtensionsChanged(runtime: AgentSessionRuntime, listener: (extensions: readonly RpcResourceExtension[]) => void): () => void; /** Evaluate an engine-child command's live argument completions. */ export declare function getInteractiveEngineRemoteCommandCompletions(runtime: AgentSessionRuntime, commandName: string, argumentPrefix: string): Promise; /** Subscribe to engine-child command catalog changes. No-op when not isolated. */ export declare function onInteractiveEngineRemoteCommandsChanged(runtime: AgentSessionRuntime, listener: (commands: readonly RpcSlashCommand[]) => void): () => void; /** Subscribe to fresh engine session stats, so the footer can repaint. No-op when not isolated. */ export declare function onInteractiveEngineSessionStatsChanged(runtime: AgentSessionRuntime, listener: () => void): () => void; export {}; //# sourceMappingURL=extension-ui-bridge.d.ts.map