Skip to content

Latest commit

 

History

History
41 lines (36 loc) · 5.45 KB

File metadata and controls

41 lines (36 loc) · 5.45 KB

Workflow authoring

Workflows are JavaScript orchestration programs executed by the workflow tool. The table below is generated from the extension's executable capability contract, so its names, signatures, options, and defaults match the installed runtime.

Use the packaged workflow-authoring skill for pattern selection, lifecycle rules, review and debugging guidance, and adaptable examples. Those explanations remain hand-written. Configured model routes and agent types are dynamic references; obtain their names and purposes from the active user or project context rather than this static page.

See Workflow prompt guidance rationale for the decision-by-decision record of prompt insertions, removals, and compactions. See Workflow authoring evidence for context measurements and the non-gating model-comprehension comparison.

Supported capabilities

Name Classification Signature Options and defaults
agent runtime-global agent(prompt, options?) => Promise<string | structured value | null> label: string (optional; default: derived from phase and call count)
phase: string (optional; default: current phase)
schema: plain JSON Schema (optional)
model: string (optional)
tier: string (optional)
isolation: "worktree" (optional)
agentType: string (optional)
timeoutMs: number | null (optional; default: run timeout; null disables)
retries: number (optional; default: run retry count)
parallel runtime-global parallel(thunks) => Promise<Array<unknown | null>>
pipeline runtime-global pipeline(items, ...stages) => Promise<Array<unknown | null>>
workflow runtime-global workflow(savedName, childArgs?) => Promise<unknown>
verify runtime-global verify(item: unknown, options?: { reviewers?: number; threshold?: number; lens?: string | string[] }) => Promise<{ real: boolean; realCount: number; total: number; votes: Array<{ real: boolean; reason?: string }> }> reviewers: number (optional; default: 2)
threshold: number (optional; default: 0.5)
lens: string | string[] (optional)
judgePanel runtime-global judgePanel(attempts: unknown[], options?: { judges?: number; rubric?: string }) => Promise<{ index: number; attempt: unknown; score: number; judgments: Array<{ score: number; reason?: string }> } | undefined> judges: number (optional; default: 3)
rubric: string (optional; default: "overall quality and correctness")
loopUntilDry runtime-global loopUntilDry(options: { round: (roundIndex: number) => unknown[] | Promise<unknown[]>; key?: (item: unknown) => string; consecutiveEmpty?: number; maxRounds?: number }) => Promise<unknown[]> round: (roundIndex: number) => unknown[] | Promise<unknown[]> (required)
key: (item: unknown) => string (optional; default: JSON.stringify)
consecutiveEmpty: number (optional; default: 2)
maxRounds: number (optional; default: 50)
completenessCheck runtime-global completenessCheck(taskArgs: unknown, results: unknown) => Promise<{ complete: boolean; missing?: string[] } | null>
retry runtime-global retry(thunk: (attempt: number) => unknown | Promise<unknown>, options?: { attempts?: number; until?: (result: unknown) => boolean }) => Promise<unknown> attempts: number (optional; default: 3)
until: (result: unknown) => boolean (optional; default: accept first result when omitted)
gate runtime-global gate(thunk: (feedback: string | undefined, attempt: number) => unknown | Promise<unknown>, validator: (value: unknown) => { ok: boolean; feedback?: string } | Promise<{ ok: boolean; feedback?: string }>, options?: { attempts?: number }) => Promise<{ ok: boolean; value: unknown; attempts: number }> attempts: number (optional; default: 3)
checkpoint runtime-global checkpoint(prompt, options?) => Promise<unknown> default: unknown (optional; default: true when no UI and omitted)
headless: "default" | "abort" (optional; default: "default")
kind: "confirm" | "input" | "select" (optional; default: "confirm")
choices: string[] (optional)
timeoutMs: number (optional)
log runtime-global log(message) => void
phase runtime-global phase(title, options?) => void budget: number (optional)
args runtime-global args: unknown
cwd runtime-global cwd: string
process runtime-global process: { cwd(): string }
budget runtime-global budget: { total, spent(), remaining() }
script workflow-tool-input script?: string
name workflow-tool-input name?: string
args workflow-tool-input args?: unknown
background workflow-tool-input background?: boolean = true
maxAgents workflow-tool-input maxAgents?: number = 1000
concurrency workflow-tool-input concurrency?: number
agentRetries workflow-tool-input agentRetries?: number = configured value or 0
agentTimeoutMs workflow-tool-input agentTimeoutMs?: number = configured default or unbounded
tokenBudget workflow-tool-input tokenBudget?: number = configured default or unlimited
resumeFromRunId workflow-tool-input resumeFromRunId?: string