import { type CodexReleaseInspection } from "./release-processes.js"; import { closeCodexReleaseProcesses } from "./release-process-shutdown.js"; export { inspectCodexReleaseProcesses } from "./release-processes.js"; export type { CodexReleaseProcess, CodexReleaseInspection } from "./release-processes.js"; import { z } from "zod"; import type { CodexServiceClient } from "./client.js"; import type { CodexV6DeviceBinding, CodexV6ReconcileDeviceAccessResponse } from "./protocol.js"; declare const JournalSchema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; tenantId: z.ZodString; subject: z.ZodString; bindingId: z.ZodString; installationId: z.ZodString; credentialLineageId: z.ZodString; generationVersion: z.ZodNumber; operationId: z.ZodString; releaseId: z.ZodNullable; phase: z.ZodEnum<{ CLEANED: "CLEANED"; PREPARED: "PREPARED"; PREPARE_PENDING: "PREPARE_PENDING"; RELEASED: "RELEASED"; REPLACING_RETIRED: "REPLACING_RETIRED"; REPORT_PENDING: "REPORT_PENDING"; RETIRED_CLEANED: "RETIRED_CLEANED"; }>; replacementBindingId: z.ZodOptional; unboundLocalState: z.ZodOptional>; artifacts: z.ZodRecord; createdAt: z.ZodString; updatedAt: z.ZodString; }, z.core.$strict>; export type CodexV6ReleaseJournal = z.infer; export type CodexReleaseDecision = boolean | "CLOSE_PROCESSES"; export type CodexReleasePrompt = { stage: "REPLACE_RETIRED"; bindingId: string; targetBindingId: string; } | { stage: "REPLACE_UNBOUND"; bindingId: string; targetBindingId: string; } | { stage: "PROCESSES"; inspection: CodexReleaseInspection; } | { stage: "FORCE_PROCESSES"; inspection: CodexReleaseInspection; } | { stage: "CLEANUP"; bindingId: string; providerAccountId: string; paths: string[]; accountLabel?: string; targetLabel?: string; deviceLabel?: string; }; export interface CodexReleaseInteraction { interactive?: boolean; inspect?: () => Promise; prompt?: (input: CodexReleasePrompt) => Promise; output?: NodeJS.WritableStream; stop?: Parameters[0]["stop"]; wait?: (ms: number) => Promise; } export declare function readCodexV6ReleaseJournal(env?: NodeJS.ProcessEnv): Promise<{ schemaVersion: 1; tenantId: string; subject: string; bindingId: string; installationId: string; credentialLineageId: string; generationVersion: number; operationId: string; releaseId: string | null; phase: "CLEANED" | "PREPARED" | "PREPARE_PENDING" | "RELEASED" | "REPLACING_RETIRED" | "REPORT_PENDING" | "RETIRED_CLEANED"; replacementBindingId?: string | undefined; unboundLocalState?: { requestId: string; localAssignmentId: string; managedAccountId: string; providerAccountId: string; } | undefined; artifacts: Record; createdAt: string; updatedAt: string; } | undefined>; export declare function assertNoPendingCodexV6Release(env?: NodeJS.ProcessEnv, operationId?: string): Promise; export declare function codexReleaseProcessPrompt(inspection: CodexReleaseInspection): { message: string; options: ({ value: boolean; label: string; } | { value: "CLOSE_PROCESSES"; label: string; })[]; }; export declare function promptCodexRelease(input: CodexReleasePrompt): Promise; /** Missing or retired bindings cannot be released. Replace unknown local credentials only * after explicit consent; this records local cleanup, never a server release. */ export declare function replaceRetiredCodexV6Credentials(input: { client: CodexServiceClient; tenantId: string; env?: NodeJS.ProcessEnv; interaction?: CodexReleaseInteraction; target: { request: NonNullable; binding: CodexV6DeviceBinding; }; }): Promise; export declare function releaseCodexV6DeviceCredentials(input: { client: CodexServiceClient; tenantId: string; env?: NodeJS.ProcessEnv; capabilityEnabled?: boolean; interaction?: CodexReleaseInteraction; target?: { bindingId: string; managedAccountId: string; providerAccountId: string; }; }): Promise; export declare function clearCompletedCodexV6Release(env?: NodeJS.ProcessEnv): Promise; /** Register before spawning under the same lock used by release. The marker covers * process startup, including the gap before a new child appears in the OS table. */ export declare function withCodexV6ManagedLaunch(env: NodeJS.ProcessEnv, launch: () => Promise): Promise;