/** Durable lifecycle states shared by process-job hosts and operator clients. */ export declare const PROCESS_JOB_STATES: readonly ["queued", "starting", "running", "succeeded", "failed", "timed_out", "cancelled", "spawn_failed", "queue_expired", "interrupted"]; /** * Maximum process-job lifecycle identities a channel adapter must retain at * once. Hosts may keep fewer, but must not expose a larger simultaneously * outstanding population through the shared projection contract. */ export declare const MAX_PROCESS_JOB_OUTSTANDING_LIFECYCLES = 10096; export type ProcessJobState = (typeof PROCESS_JOB_STATES)[number]; /** Stable machine-readable failures exposed at the runtime/operator boundary. */ export declare const PROCESS_JOB_ERROR_CODES: readonly ["background_unsupported", "background_unsupported_channel", "process_job_disabled", "process_job_controller_unavailable", "process_job_platform_unsupported", "process_job_not_found", "process_job_conflict", "process_job_capacity", "process_job_conversation_capacity", "process_job_queue_full", "process_job_queue_expired", "process_job_chain_depth_exceeded", "process_job_spawn_failed", "process_job_failed", "process_job_timeout", "process_job_cancelled", "process_job_agent_restarted", "process_job_cleanup_incomplete", "process_job_store_error", "process_job_wake_failed", "process_job_response_too_large", "process_job_invalid"]; export type ProcessJobErrorCode = (typeof PROCESS_JOB_ERROR_CODES)[number]; /** Stable secret-free messages paired with public process-job error codes. */ export declare const PROCESS_JOB_PUBLIC_ERROR_MESSAGES: Readonly>; /** Construct one stable public failure without retaining ambient exception text. */ export declare function processJobPublicError(code: ProcessJobErrorCode): ProcessJobProjectionError; export type ProcessJobWakeState = "pending" | "delivered" | "failed"; export interface ProcessJobProjectionOrigin { /** Exact conversation identity, including any host-owned rollover bucket. */ readonly conversationId: string; readonly channel: string; readonly runId: string; readonly historyBoundary: string; readonly bucket: string | null; } export interface ProcessJobProjectionTimestamps { readonly admittedAt: string; readonly queueDeadlineAt: string; readonly startedAt: string | null; readonly runtimeDeadlineAt: string | null; readonly completedAt: string | null; } export interface ProcessJobProjectionLimits { readonly maxRuntimeMs: number; readonly maxOutputBytes: number; readonly previewChars: number; readonly chainDepth: number; } export interface ProcessJobProjectionOutput { readonly stdoutBytes: number; readonly stderrBytes: number; readonly truncated: boolean; /** Bounded, redacted, untrusted preview suitable for an operator UI. */ readonly preview: string; /** Agent-root-relative artifact references; never arbitrary filesystem paths. */ readonly stdoutRef: string | null; readonly stderrRef: string | null; } export interface ProcessJobProjectionWake { readonly state: ProcessJobWakeState; readonly attempts: number; readonly deliveryKey: string; readonly lastAttemptAt: string | null; } export interface ProcessJobProjectionError { readonly code: ProcessJobErrorCode; readonly message: string; } /** * Secret-free operator projection of one durable process job. * * This intentionally excludes argv, environment values, sandbox settings * paths, the separate owner-private normalized reply-target fields, PIDs, and * process-incarnation evidence. `origin.conversationId` deliberately remains: * it is the exact bound originating conversation and therefore the operator * projection's reply route, including any host-owned rollover bucket. */ export interface ProcessJobProjection { readonly schema: "mono-agent.process-job-projection.v1"; readonly jobId: string; readonly tool: "Exec" | "Bash"; readonly state: ProcessJobState; readonly summary: string; readonly origin: ProcessJobProjectionOrigin; readonly timestamps: ProcessJobProjectionTimestamps; readonly limits: ProcessJobProjectionLimits; readonly output: ProcessJobProjectionOutput; readonly wake: ProcessJobProjectionWake; readonly exitCode: number | null; readonly signal: string | null; readonly durationMs: number | null; readonly cancelRequested: boolean; readonly lastError: ProcessJobProjectionError | null; } /** Neutral owner-authorized operator surface used by app, TUI, CLI, and web proxy. */ export interface ProcessJobOperator { /** Owner-only bearer used by local operator routes. Never expose to a model. */ readonly operatorToken: string; list(): Promise; get(jobId: string): Promise; cancel(jobId: string): Promise; } /** Strictly parse one projection, rejecting unknown keys at every depth. */ export declare function parseProcessJobProjection(value: unknown): ProcessJobProjection; /** Strictly parse a bounded operator list response. */ export declare function parseProcessJobProjections(value: unknown): readonly ProcessJobProjection[]; export declare function isProcessJobState(value: unknown): value is ProcessJobState; export declare function isProcessJobErrorCode(value: unknown): value is ProcessJobErrorCode; //# sourceMappingURL=process-jobs.d.ts.map