import { type BackendRecoveryFields, type BackendRetryFields } from "./backend-task-recovery.js"; import { type CallbackAttemptOutcome, type CallbackEnvelopeV1, type CallbackRouteV1 } from "./callback-transport.js"; export { isCodexNativeWatchId } from "./codex-native-identity.js"; import { type NativeRecordRepository } from "./codex-native-record-store.js"; import type { CodexNativeIdentity, NativeInteraction } from "./codex-native-types.js"; export type CodexNativeTaskStatus = "awaiting_acceptance" | "watching" | "completed" | "failed" | "interrupted" | "timed_out" | "cancelled"; export interface CodexNativeSendIntent { message_id: string; client_user_message_id: string; text: string; baseline_turn_ids: string[]; state: "reserved" | "uncertain" | "accepted" | "not_sent"; dispatched_at: string; receipt_turn_id?: string; error_code?: string; } export interface CodexNativeNotification extends BackendRetryFields { id: string; envelope: CallbackEnvelopeV1; status: "ready" | "leased" | "retry_wait" | "accepted" | "failed" | "uncertain"; attempts: number; attempt_id?: string; lease_expires_at?: string; retry_at?: string; outcome?: CallbackAttemptOutcome; } /** Connection-local request IDs are deliberately absent from persisted interaction authority. */ export type PersistedNativeInteraction = Omit; export interface CodexNativeTaskRecord extends BackendRecoveryFields { schema: "agent-knock-knock/codex-native-task"; version: 1; revision: number; id: string; watch_id: string; native_id: string; target: CodexNativeIdentity; controller_session: string; kind: "send" | "watch"; status: CodexNativeTaskStatus; created_at: string; updated_at: string; deadline_at: string; native_turn_id?: string; send_intent?: CodexNativeSendIntent; callback_route?: CallbackRouteV1; observed_at?: string; observation_error?: string; pending_interactions: PersistedNativeInteraction[]; final_text?: string; notifications: CodexNativeNotification[]; } export type CodexNativeStateRepository = NativeRecordRepository; export declare const nonblank: (value: unknown) => value is string; export declare const validTime: (value: unknown) => value is string; export declare function assertNativeIdentity(nativeId: string, target: CodexNativeIdentity): void; export declare function persistNativeInteraction(value: NativeInteraction): PersistedNativeInteraction; export declare function assertPersistedNativeInteraction(value: PersistedNativeInteraction, target: CodexNativeIdentity, turnId?: string): void; export declare function assertCodexNativeTaskRecord(value: unknown): asserts value is CodexNativeTaskRecord; export declare function createCodexNativeStateStore(storeDir: string, locks: { acquire(lockPath: string): () => void; }): CodexNativeStateRepository;