import type { Conversation } from "./protocol.js"; import type { CodexPreMaterializationIdentity } from "./terminal-authority-policy.js"; import type { TerminalControlRef } from "./terminal-agent-adapter.js"; import type { TerminalCommandCliPorts } from "./terminal-command-cli-ports.js"; type RetryPort = Pick; interface TerminalSubmissionRetryLocalPorts { durableTerminalInputDispatched(conversation: Conversation): boolean; terminalAcceptanceCompanionFences(conversation: Conversation, terminalControl: TerminalControlRef): { allowedCompanionIdentity?: CodexPreMaterializationIdentity; allowedAdditionalIdentities?: CodexPreMaterializationIdentity[]; }; validateStoredTerminalSubmissionMatch(input: { owner: Conversation; receipt: Record; options: Record; terminalControl: TerminalControlRef; requestText: string; requestHash: string; expectedStoreDir: string; expectedSessionId?: string; expectedTurnId?: string; expectedMessageType: "task" | "answer"; expectedStatePath?: string; }): Record | undefined; } export type TerminalSubmissionRetryReconciliationPorts = RetryPort<"deferredForegroundApplication" | "deferredForegroundRecoveryAdapterPorts" | "required" | "startTerminalBridgeMonitorForConversation" | "terminalBridgeRequestFingerprint" | "terminalBridgeRuntimeKey" | "terminalControlFromTakeover" | "terminalDispatchRecordMatchesControl" | "withTerminalBridgeSubmission" | "mutationDispatchLedger"> & TerminalSubmissionRetryLocalPorts; export type TerminalSubmissionRetryApplicationPorts = RetryPort<"assertDeferredCodexForegroundBindingBoundary" | "createTerminalAgentBridge" | "deferredForegroundRecoveryAdapterPorts" | "loadConversationFromOptions" | "required" | "startTerminalBridgeMonitorForConversation" | "terminalControlFromTakeover" | "terminalDispatchExecution" | "terminalRuntimeIdentityForConversation" | "terminalWriterMutationLocks" | "withTerminalDispatchStateScope"> & Pick; export type TerminalSubmissionRetryTransportPorts = RetryPort<"deferredForegroundApplication" | "deferredForegroundRecoveryAdapterPorts" | "required" | "startTerminalBridgeMonitorForConversation" | "terminalRuntimeIdentityForConversation" | "withTerminalBridgeSubmission" | "mutationDispatchLedger"> & Pick; export type TerminalSubmissionRetryPorts = TerminalSubmissionRetryReconciliationPorts & TerminalSubmissionRetryApplicationPorts & TerminalSubmissionRetryTransportPorts; export {};