import type { ExecutorKind } from "./executors.js"; import type { TerminalAgentAdapter, TerminalControlRef, TerminalRuntimeIdentity } from "./terminal-agent-adapter.js"; import { type TerminalModelControlPlan, type TerminalModelControlPorts } from "./terminal-model-control.js"; type CodexComposerCapture = { state: "exact_draft" | "exact_empty" | "different_draft"; digest: string; profiledSlashPopup?: true; bareCommand?: true; }; export interface TerminalModelControlBridgeRuntimePorts { verifyTerminalIdentity(agent: ExecutorKind, terminalControl: TerminalControlRef, runtime: TerminalRuntimeIdentity | undefined): Promise; captureStyled(terminalControl: TerminalControlRef): Promise; sendText(terminalControl: TerminalControlRef, text: string): Promise; sendKeys(terminalControl: TerminalControlRef, keys: readonly string[]): Promise; sleep(milliseconds: number): Promise; } export interface TerminalModelControlClassifierPorts { stripEscapes(value: string): string; sameIdentity(left: TerminalControlRef, right: TerminalControlRef): boolean; currentCodexComposer(styledScreen: string, expectedText: string, allowOpaqueLargePastePlaceholder: boolean, classifyOpaqueLargePasteAsDifferent: boolean, exactSlashPopupRows?: readonly string[], allowStyledSlashPopupWithoutViewportPaint?: boolean): CodexComposerCapture | undefined; inspectCodexAsyncQuestionInputMode(styledScreen: string): "absent" | "collapsed" | "expanded" | "ambiguous"; codexActiveWriterViewerVisible(styledScreen: string): boolean; isExactClaudeIdleComposer(screen: string): boolean; exactClaudeModelControlComposer(screen: string, plan: TerminalModelControlPlan, expectedText: string): { digest: string; } | undefined; exactTerminalComposer(agent: ExecutorKind, screen: string, expectedText: string): { digest: string; } | undefined; } export interface CreateTerminalModelControlPortsInput { adapter: TerminalAgentAdapter; plan: TerminalModelControlPlan; runtime?: TerminalRuntimeIdentity; beforeInput: () => void | Promise; loadCodexCatalog?: TerminalModelControlPorts["loadCodexCatalog"]; runtimePorts: TerminalModelControlBridgeRuntimePorts; classifiers: TerminalModelControlClassifierPorts; } /** * Bind model-control's semantic transaction to the terminal transport. * * Every input permit below is deliberately operation-local and one-shot. The * factory neither owns terminal locks nor writes Store state: callers retain * those boundaries and the domain state machine retains `beforeInput` timing. */ export declare function createTerminalModelControlPorts(input: CreateTerminalModelControlPortsInput): TerminalModelControlPorts; export {};