Skip to main content
createHarnessWithScheduling<State>(spec): Readonly<{ harness: Harness<ToolSet>; scheduling: HarnessScheduling; }>
Construct one persistent harness with the bounded scheduling tools in its visible tool set. Type Parameters Parameters Returns Readonly<{ harness: Harness<ToolSet>; scheduling: HarnessScheduling; }>

createHarnessScheduling()

createHarnessScheduling(ports, ledger): HarnessScheduling
Creates the bounded v0 model-facing schedule tools and the matching proactive task handler. Schedule definitions and occurrence-to-run correlation are private persistent state; only active harness-owned schedules are projected. Parameters Returns HarnessScheduling

schedule()

schedule(input): Promise<Pick<HarnessSchedule, "id" | "mode" | "nextFireAt">>
Parameters Returns Promise<Pick<HarnessSchedule, "id" | "mode" | "nextFireAt">>

listSchedules()

listSchedules(): Promise<readonly HarnessSchedule[]>
Returns Promise<readonly HarnessSchedule[]>

cancelSchedule()

cancelSchedule(id): Promise<HarnessScheduleCancellation>
Parameters Returns Promise<HarnessScheduleCancellation>

dispatch()

dispatch(task): Promise<HarnessRun | undefined>
Dispatch a scheduler or harness admission task through persistent ownership checks. Parameters Returns Promise<HarnessRun | undefined>

recover()

recover(): Promise<number>
Reconcile persistent schedule state with namespaced pending tasks after restart. Returns Promise<number>

tools

readonly tools: ToolSet

HarnessSchedule

HarnessSchedule = Readonly<{ id: string; mode: "delay" | "interval"; nextFireAt: number; status: "active"; } & (Readonly<{ intervalSeconds?: never; }> | Readonly<{ intervalSeconds: number; }>)>

HarnessScheduleRequest

HarnessScheduleRequest = Readonly<{ delaySeconds?: number; intervalSeconds?: number; prompt: string; }>

HarnessScheduleCancellation

Properties canceled
readonly canceled: boolean
id
readonly id: string