import { type DecisionJobItem } from './job-contract.js'; import { DecisionJobRuntime } from './job-runtime.js'; import { type JobScope, type JobSnapshot } from './job-store.js'; /** Explicitly offline fixture executor. No provider endpoint or implicit dispatch is enabled. */ export interface OfflineJobResult { state: 'succeeded' | 'abstained' | 'review' | 'unsupported' | 'retryable-failed' | 'permanent-failed'; /** For authoritative result states, both references must identify governed validated evidence. */ receiptDigest?: `sha256:${string}`; resultDigest?: `sha256:${string}`; errorCode?: string; } export type OfflineItemExecutor = ((item: Readonly, signal: AbortSignal) => Promise) & { requiresReservation?: boolean; }; export interface JobReservation { tokens: number; costMicros: number; } /** * Optional D16 effect recording (#2722): called once an admitted item has a validated D03 receipt, * before the job record is updated, so a crash between the two leaves a verifiable effect behind. * It records digests only and must never dispatch. Failures are ignored: the job record stays authoritative. */ export interface JobItemEffectRecorder { recordReceipt(input: { scope: JobScope; jobId: string; itemId: string; attemptId: string; requestDigest: `sha256:${string}`; receiptDigest: `sha256:${string}`; }): Promise; } export declare class OfflineJobWorker { private readonly runtime; private readonly effects?; private readonly active; constructor(runtime: DecisionJobRuntime, effects?: JobItemEffectRecorder | undefined); /** Persist a dispatch fence before invoking the fixture; ambiguous failures never replay. */ run(actor: JobScope, jobId: string, itemId: string, executor: OfflineItemExecutor, reservation?: JobReservation): Promise; cancel(actor: JobScope, jobId: string): Promise; } //# sourceMappingURL=job-worker.d.ts.map