Skip to content
Français

TaskCacheOptions

import type { TaskCacheOptions } from "@elie-laloum/outpost";
  • storeRequired
    TaskCacheStore
    Caller-owned store that reads and writes cache entries, such as createTaskCacheStore over a Transport.
  • versionRequired
    string
    Non-empty version included in the fingerprint; change it when the task implementation, agent, prompt or output contract changes.
  • keyRequired
    (context: TaskContext) => WorkflowJson | Promise<WorkflowJson>
    Return the lossless JSON inputs that determine the result, such as a repository fingerprint, brief and model. Runs before each execution with attempt 0 and may read declared dependencies; an error fails the task.
  • maxAgeMsOptional
    number | undefined
    Positive age limit in milliseconds; an older entry is a miss and is replaced after the task succeeds.
  • modeOptional
    TaskCacheMode | undefined
    reuse (default) reads the store first; refresh ignores existing entries, executes the task and replaces the entry.
export interface TaskCacheOptions {
  readonly store: TaskCacheStore;
  /** Change when the task implementation, agent or output contract changes. */
  readonly version: string;
  readonly key: (context: TaskContext) => WorkflowJson | Promise<WorkflowJson>;
  readonly maxAgeMs?: number;
  readonly mode?: TaskCacheMode;
}