import { type SessionStartOptions, type SessionState } from "../hooks/session.js"; import { type SkillActiveState } from "../hooks/keyword-detector.js"; import { reconcileHudForPromptSubmit } from "../hud/reconcile.js"; type CodexHookEventName = "SessionStart" | "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "PreCompact" | "PostCompact" | "Stop"; type CodexHookPayload = Record; interface NativeHookDispatchOptions { cwd?: string; sessionOwnerPid?: number; /** @internal Scoped deterministic SessionStart durability seam for native-hook tests. */ sessionStartOptions?: Pick; reconcileHudForPromptSubmitFn?: typeof reconcileHudForPromptSubmit; } export interface NativeHookDispatchResult { hookEventName: CodexHookEventName | null; omxEventName: string | null; skillState: SkillActiveState | null; outputJson: Record | null; } export declare function mapCodexHookEventToOmxEvent(hookEventName: CodexHookEventName | null): string | null; interface ProcessLineageEntry { pid: number; command: string; name?: string; } export declare function resolveSessionOwnerPidFromAncestry(startPid: number, options?: { readParentPid?: (pid: number) => number | null; readProcessCommand?: (pid: number) => string; readProcessLineage?: (pid: number) => ProcessLineageEntry[] | null; platform?: NodeJS.Platform; }): number | null; export declare function isSloppyFallbackTranscriptStartUsable(birthtimeMs: number, ctimeMs: number): boolean; type RawSessionStartNativeId = { ok: true; value: string; } | { ok: false; reason: "missing" | "malformed" | "conflict"; }; export declare function readUnambiguousSessionStartNativeId(payload: CodexHookPayload | undefined): RawSessionStartNativeId; export type PersistedReopenRootContextResult = { ok: true; sessionId: string; rootNativeSessionId: string; } | { ok: false; reason: "pointer_not_usable" | "pointer_cwd_missing" | "pointer_session_missing" | "pointer_native_root_missing" | "pointer_cwd_mismatch" | "selected_canonical_missing" | "canonical_mismatch" | "event_native_missing" | "event_native_malformed" | "event_native_conflict" | "native_root_mismatch"; }; export declare function resolvePersistedReopenRootContext(cwd: string, selectedCanonicalSessionId: string, payload: CodexHookPayload | undefined, state: SessionState | null): PersistedReopenRootContextResult; export declare function looksLikeGoalCompletionPrompt(text: string): boolean; export type HookCancelTransactionFailureReason = "invalid_target" | "lock_held" | "recovery_required" | "preflight_failed" | "state_mismatch" | "journal_failed" | "write_failed" | "rollback_failed" | "verification_failed" | "cleanup_failed"; export interface HookCancelTransactionResult { ok: boolean; reason?: HookCancelTransactionFailureReason; } export declare function readHookCancelTransactionRecoveryState(input: { stateDir: string; canonicalSessionId: string; }): Promise; type HookCancelWorkflowInput = { stateDir: string; canonicalSessionId: string; cwd: string; nowIso: string; }; export declare function terminalizeExactAutopilotSessionForHookCancel(input: HookCancelWorkflowInput): Promise; export declare function terminalizeExactUltragoalSessionForHookCancel(input: HookCancelWorkflowInput): Promise; export type DeepInterviewHandoffRejectReason = "session_id_missing" | "session_id_mismatch" | "session_alias_conflict" | "working_directory_missing" | "working_directory_mismatch" | "gate_incomplete" | "durable_evidence_missing" | "artifact_target_not_allowed" | "unsafe_transport"; export declare const DEEP_INTERVIEW_HANDOFF_REJECT_DETAILS: Record; export type DeepInterviewRalplanHandoffEvaluation = { allowed: boolean; reason?: DeepInterviewHandoffRejectReason; }; export declare function evaluateDeepInterviewRalplanHandoffCommand(cwd: string, command: string, authoritativeSessionId: string): DeepInterviewRalplanHandoffEvaluation; export declare function buildConductorPreToolUseWriteGuardOutput(payload: CodexHookPayload, cwd: string, stateDir: string, resolvedSessionId?: string, policyCwd?: string): Promise | null>; export declare function dispatchCodexNativeHook(payload: CodexHookPayload, options?: NativeHookDispatchOptions): Promise; export declare function isCodexNativeHookMainModule(moduleUrl: string, argv1: string | undefined): boolean; export declare function runCodexNativeHookCli(): Promise; export {}; //# sourceMappingURL=codex-native-hook.d.ts.map