import type { CodexOpenRootRolloutInventory } from "./agent-session-provider.js"; import type { ActiveTerminalProcess, TerminalAgentAdapter, TerminalNativeInspectionCapabilities, TerminalThreadLifecycleCapabilities } from "./terminal-agent-adapter.js"; import type { TerminalActivityState, TerminalBridgeStatus, TerminalDurableActivityState, TerminalNativeIdentityState } from "./terminal-agent-bridge.js"; import type { TerminalControlRef } from "./terminal-control-ref.js"; import { type TerminalModelControlCapabilities, type TerminalModelControlProfile, type TerminalModelControlResidualObservation } from "./terminal-model-control.js"; import type { TerminalNativeIdentity, TerminalNativeIdentityObservation } from "./terminal-binding-authority.js"; import type { TerminalDispatchLedgerDocument } from "./terminal-dispatch-ledger-codec.js"; export interface TerminalListState { readonly approval_state: TerminalBridgeStatus["approval_state"] & { readonly screen_excerpt?: string; readonly error?: string; }; readonly activity_state: TerminalBridgeStatus["activity_state"]; readonly activity_reason: string; readonly screen_state: TerminalActivityState; readonly screen_reason: string; readonly capability_limitation?: string; readonly screen_excerpt?: string; readonly _terminal_status_snapshot?: TerminalBridgeStatus; } export interface EffectiveTerminalListState extends TerminalListState { readonly native_identity_state: TerminalNativeIdentityState; readonly durable_activity_state: TerminalDurableActivityState; readonly durable_activity_reason: string; } export interface TerminalNativeListIdentityFacts { readonly orphanedDispatch?: TerminalDispatchLedgerDocument; readonly nativeIdentityObservation: TerminalNativeIdentityObservation; readonly nativeAgentIdentity?: TerminalNativeIdentity; readonly authorityNativeIdentityObservation: TerminalNativeIdentityObservation; readonly authorityNativeAgentIdentity?: TerminalNativeIdentity; readonly codexOpenRootRolloutInventory?: CodexOpenRootRolloutInventory; readonly nativeProcessUuid?: string; readonly nativeProcessBirth?: string; readonly nativeProcessEvidence?: string; } export interface TerminalListComposerFacts { readonly automatedInputComposerReady: boolean; readonly userExplicitComposerReady: boolean; /** Positive evidence that a non-Composer UI surface owns terminal input. */ readonly inputOwnerBlocked: boolean; } export interface TerminalListPhysicalProcessIncarnation { readonly processUuid: string; readonly processBirth: string; readonly evidence?: string; } export interface TerminalListLatentClearResumeFacts { readonly sourceNativeThreadId: string; readonly fingerprint: string; } export interface TerminalListTerminalFacts { readonly physical: { readonly terminalId: string; readonly childPids: readonly number[]; readonly processIncarnation?: TerminalListPhysicalProcessIncarnation; }; readonly status: { /** One status observation supplies screen, activity, and approval facts. */ readonly observed: TerminalListState; readonly effective: EffectiveTerminalListState; readonly projected: EffectiveTerminalListState; readonly snapshot?: TerminalBridgeStatus; readonly statusCardNativeThreadId?: string; readonly hasInteraction: boolean; }; readonly native: TerminalNativeListIdentityFacts; readonly runtime: { readonly agentVersion?: string; readonly lifecycleCapability: TerminalThreadLifecycleCapabilities; readonly nativeInspectionCapability: TerminalNativeInspectionCapabilities; readonly modelControlCapability: TerminalModelControlCapabilities; readonly modelControlProfile?: TerminalModelControlProfile; readonly compatibilityWarnings: readonly string[]; }; readonly composer: TerminalListComposerFacts; readonly store: { readonly terminalHasBlockingTurn: boolean; readonly hasOrphanedDispatch: boolean; }; readonly codex: { readonly latentClearResume?: TerminalListLatentClearResumeFacts; readonly zeroRolloutModelControlVerified: boolean; }; readonly modelControlResidual?: TerminalModelControlResidualObservation; } export interface TerminalListTerminalFactPorts { observeStatus(agentVersion?: string): Promise; observeNativeIdentity(terminalId: string): Promise; projectEffectiveState(input: { terminalState: TerminalListState; native: TerminalNativeListIdentityFacts; }): EffectiveTerminalListState; observeAgentVersion(): string | undefined; observeTerminalHasBlockingTurn(): boolean; observeComposer(terminalState: EffectiveTerminalListState): Promise; observePhysicalProcessIncarnation(): TerminalListPhysicalProcessIncarnation | undefined; observeLatentClearResume(input: { screen?: string; agentVersion?: string; }): TerminalListLatentClearResumeFacts | undefined; observeModelControlResidual(input: { agentVersion?: string; modelControlCapability: TerminalModelControlCapabilities; modelControlProfile?: TerminalModelControlProfile; native: TerminalNativeListIdentityFacts; zeroRolloutVerified: boolean; effectiveTerminalState: EffectiveTerminalListState; terminalHasInteraction: boolean; terminalHasBlockingTurn: boolean; hasOrphanedDispatch: boolean; }): Promise; projectStatusSnapshot(status: TerminalBridgeStatus, projection: EffectiveTerminalListState): TerminalBridgeStatus; } /** * Collect the immutable observation facts for one already-discovered terminal. * * This boundary does not create action authority, generate tokens, render * public JSON, write Store state, or send terminal input. Each observation port * is invoked at most once. The status result is the single source for screen, * activity, approval, and interaction facts; later styled-Composer and native * model-control observations remain explicitly separate fail-closed captures. */ export declare function collectTerminalListTerminalFacts(input: { session: ActiveTerminalProcess; terminalControl: TerminalControlRef; terminalId: string; childPids: readonly number[]; adapter: TerminalAgentAdapter; ports: TerminalListTerminalFactPorts; }): Promise;