Skip to content

RunOptions

The options runSource builds a ctx from. The CLI passes the source’s stored config and the feed’s current cursor; tests inject fetch, log, and now for determinism.

Type ParameterDefault typeDescription
CRecord<string, unknown>The shape of the source’s typed ctx.config preferences.
PropertyTypeDescription
config?CThe source’s preference values (no credentials). Defaults to {}.
cursor?CursorThe feed’s current cursor. Defaults to { type: 'none' }.
deadline?numberWhen this run must finish, epoch ms. Omitted means no budget.
fetchImpl?FetchLikeThe fetch implementation to expose as ctx.fetch. Defaults to global fetch.
logSink?(args: unknown[]) => voidA sink for ctx.log(...) calls. Defaults to collecting into the returned logs.
now?() => DateThe clock backing ctx.now(). Defaults to () => new Date().
onProgress?(done: number, message?: string) => voidReceives ctx.progress(...). Omitted means the calls are dropped.
secrets?Readonly<Record<string, string>>Credentials to hand the source, keyed by the names its manifest declares. Absent in an ordinary local run, which is why ctx.secret rejects by name rather than returning undefined: a source that needs a key cannot proceed without one, and the name is what tells the developer which to supply.