Input type accepted by the job executor.
Output type returned by the job executor.
Constructs a new GenericJob instance.
Input type accepted by the job executor.
Output type returned by the job executor.
The job input payload.
OptionalstreamingEnabled: boolean = falseWhether the executor emits streaming chunks.
The function that performs the capability execution.
Optionalhooks: JobLifecycleHooks<TOutput>Optional lifecycle hooks invoked during execution.
OptionalmaxStoredResponseChunks: numberMaximum number of streamed chunks retained in memory.
OptionalexecutionMetadata: {Optional execution metadata persisted with snapshots.
ReadonlyinputThe job input payload.
OptionalonOptional streaming callback
OptionalonCalled whenever status changes
Internal diagnostic view of final orchestration response (read-only).
Internal diagnostic view of orchestration chunks (read-only snapshot copy).
Returns a promise that settles when the job reaches a terminal state.
A promise that resolves with the final job output or rejects with the terminal error.
Marks the job as aborted without invoking the executor.
Optionalreason: ErrorOptional abort reason to retain as the terminal error.
Nothing.
Resets transient state so the job can be executed again from its original input.
Nothing.
Hydrate this job from a persisted snapshot. Internal response envelopes/chunks are intentionally not restored because rerun semantics are deterministic replay from input + executor, not raw resume.
The persisted snapshot to restore from.
Nothing.
Run the job. NOTE: Consumers should typically call JobManager.runJob() instead of invoking this directly, to ensure proper concurrency management, hooks, and persistence.
The execution context supplied by the caller or job manager.
Optionalsignal: AbortSignalOptional abort signal for cancellation.
OptionalonChunk: (chunk: JobChunk<TOutput>) => voidOptional chunk callback that overrides the job-level handler.
Resolves when the run attempt finishes and terminal state has been recorded.
Serializes the current in-memory job state into a persistence-friendly snapshot.
A snapshot representing the current job state.
Manages execution state for a single queued or running AI job.