import type { TerminalControlRef } from "./terminal-agent-adapter.js"; import type { TerminalControlSendResult } from "./terminal-command-dispatch-transport.js"; import type { TerminalControlSendRequest } from "./terminal-dispatch-composition.js"; import type { CodexForegroundProofAuthority } from "./terminal-command-foreground-proof.js"; import { type TerminalCommandPortView, type TerminalCommandTarget } from "./terminal-command-cli-ports.js"; export type TerminalManagedSendCliPorts = TerminalCommandPortView<"assertExpectedHandoffTokenUsesExactTerminalSelector" | "assertManagedSessionCanStartTurn" | "assertNativeThreadHasExclusiveOwnership" | "bindingMatchesLiveTerminal" | "codexAllowedCompanionSetForManagedSession" | "codexPreMaterializationIdentityForManagedSession" | "createBoundManagedSession" | "createManagedTerminalTurn" | "createTerminalAgentBridge" | "deferredForegroundApplication" | "identifyCodexForegroundWhileLocked" | "inspectCodexOpenRootRolloutInventory" | "isDiscoverableTmuxConversation" | "logicalIdentityForManagedSession" | "managedTurnsForSession" | "materializeCurrentManagedSession" | "maybeAdoptObservedExternalThread" | "maybeDetachVerifiedEmptyCodexSource" | "mutationDispatchLedger" | "observeCurrentNativeAgentSessionIdentity" | "prepareDeferredCodexForegroundBinding" | "reattachManagedSessionForNativeIdentity" | "refineManagedSessionNativeIdentity" | "required" | "resolveCurrentNativeAgentSessionIdentity" | "soleBoundManagedSessionClaimForTerminal" | "storeDirFromOptions" | "terminalBridgeRuntimeKey" | "terminalControlFromTakeover" | "terminalList" | "terminalWriterMutationLocks" | "verifyCodexPendingManagedSendStatus" | "withTerminalDispatchStateScope">; interface ManagedReplayRequest { options: Record; terminalControl: TerminalControlRef; requestText: string; expectedStoreDir: string; expectedSessionId?: string; expectedTurnId?: string; expectedMessageType: "task" | "answer"; expectedStatePath?: string; userExplicitTerminalId?: string; } export interface TerminalManagedSendDependencies { ports: TerminalManagedSendCliPorts; foregroundIdentificationAuthority: CodexForegroundProofAuthority; replayExactActiveTerminalSubmission(input: ManagedReplayRequest): boolean; runTerminalControlSend(request: TerminalControlSendRequest): Promise; runtime: { now(): Date; }; } export interface TerminalManagedRawSendAttempt { terminalControlSendInvoked: boolean; result?: TerminalControlSendResult; } export declare function runManagedRawTerminalSendAttempt(dependencies: TerminalManagedSendDependencies, options: Record, messageBody: string, terminalConversation: TerminalCommandTarget, deferZeroInputFailurePresentation: boolean, attempt: TerminalManagedRawSendAttempt): Promise; export declare function runManagedSessionSend(dependencies: TerminalManagedSendDependencies, options: Record, messageBody: string): Promise; export {};