Skip to content
Français

DispatchOptions

import type { DispatchOptions } from "@elie-laloum/outpost";
  • observationOptional
    ObservationHub | undefined
    Parent observation hub. The dispatch opens a child hub with its own dispatchId and drains it before returning or throwing.
  • agentOptional
    DispatchAgent | undefined
    Agent that runs the brief: one from createAgent() or createReplayAgent(), or a createFallbackAgent() that moves to its next candidate on a listed quota or unavailable fault. A fallback agent cannot take continuation.
  • loggingOptional
    Logging | undefined
    Journal settings: transport, verbose event retention and commit recording for replay.
  • labelOptional
    string | undefined
    Name shown for this dispatch in progress reports.
  • briefRequired
    Brief
    Task given to the agent: literal text or a file brief.
  • passesOptional
    number | undefined
    Maximum passes, default 1. Each pass reruns the brief in a new conversation and the dispatch stops at the first pass whose text contains a completion marker. Must be 1 with response or continuation.
  • untilOptional
    string | readonly string[] | undefined
    Completion marker or markers searched in the last turn’s text, default <outpost>done</outpost>. An empty list disables matching, so every pass runs; empty strings are rejected.
  • idleMsOptional
    number | undefined
    Longest silence allowed from the agent, default 600000 (10 minutes). Past it the turn stops with code timeout.
  • idleWarningMsOptional
    number | undefined
    Silence after which a warning event is emitted, then repeated at the same interval; default 60000.
  • settleMsOptional
    number | undefined
    Wait after a completion marker before stopping an agent that is still running, default 60000. The turn still succeeds.
  • deadlineMsOptional
    number | undefined
    Maximum duration of each agent process, default 3600000 (one hour). Past it the turn fails with code timeout.
  • expansionMsOptional
    number | undefined
    Deadline for each shell expansion in a file brief, default 30000. Past it the dispatch fails with code timeout.
  • signalOptional
    AbortSignal | undefined
    Aborting it stops the agent process and rejects the dispatch with the signal’s reason.
  • steeringOptional
    Steering | undefined
    Controller from createSteering(), attached for the whole dispatch and released when it ends. resume() and fork() do not reuse it.
  • continuationOptional
    { readonly id: string; readonly fork?: boolean; } | undefined
    Native conversation to continue, by id; fork: true continues a copy and leaves the original unchanged. Requires one pass and an agent that supports resume.
  • responseOptional
    ResponseSpec<T> | undefined
    Typed response contract: the tagged answer is parsed and validated, and an invalid answer gets up to repairs correction turns. Requires one pass.
  • telemetryOptional
    DispatchTelemetry | undefined
    Instrumentation spanning the whole dispatch, including preparation, synchronization and cleanup. Its failures do not change the outcome.
  • observeOptional
    ((event: AgentObservation) => void) | undefined
    Receives each normalized agent event with its pass number and timestamp. An exception thrown here is collected in observerErrors and does not change the outcome.
  • warnOptional
    ((message: string) => void) | undefined
    Receives nonfatal warnings, such as an idle agent or a conversation storage problem.
  • diagnosticOptional
    ((message: string) => void) | undefined
    Receives diagnostic messages, such as the estimated token size of each expanded brief command.
export interface DispatchOptions<T = undefined> {
  readonly observation?: ObservationHub;
  readonly agent?: DispatchAgent;
  readonly logging?: Logging;
  readonly label?: string;
  readonly brief: Brief;
  readonly passes?: number;
  readonly until?: string | readonly string[];
  readonly idleMs?: number;
  readonly idleWarningMs?: number;
  readonly settleMs?: number;
  readonly deadlineMs?: number;
  readonly expansionMs?: number;
  readonly signal?: AbortSignal;
  /** Controller from createSteering() that sends instructions while the agent runs. */
  readonly steering?: Steering;
  readonly continuation?: {
    readonly id: string;
    readonly fork?: boolean;
  };
  readonly response?: ResponseSpec<T>;
  readonly telemetry?: DispatchTelemetry;
  readonly observe?: (event: AgentObservation) => void;
  readonly warn?: (message: string) => void;
  readonly diagnostic?: (message: string) => void;
}