@bastani/atomic 0.5.29 → 0.5.30-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk/components/workflow-picker-panel.d.ts.map +1 -1
- package/dist/sdk/define-workflow.d.ts +8 -6
- package/dist/sdk/define-workflow.d.ts.map +1 -1
- package/dist/sdk/runtime/executor.d.ts +11 -1
- package/dist/sdk/runtime/executor.d.ts.map +1 -1
- package/dist/sdk/types.d.ts +44 -22
- package/dist/sdk/types.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts +6 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/claude/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts +6 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/copilot/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts +6 -1
- package/dist/sdk/workflows/builtin/deep-research-codebase/opencode/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/open-claude-design/claude/index.d.ts +23 -1
- package/dist/sdk/workflows/builtin/open-claude-design/claude/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/open-claude-design/copilot/index.d.ts +23 -1
- package/dist/sdk/workflows/builtin/open-claude-design/copilot/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts +23 -1
- package/dist/sdk/workflows/builtin/open-claude-design/opencode/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts +12 -2
- package/dist/sdk/workflows/builtin/ralph/claude/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts +12 -2
- package/dist/sdk/workflows/builtin/ralph/copilot/index.d.ts.map +1 -1
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts +12 -2
- package/dist/sdk/workflows/builtin/ralph/opencode/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/commands/cli/workflow-inputs.ts +3 -1
- package/src/commands/cli/workflow.ts +17 -2
- package/src/sdk/components/workflow-picker-panel.tsx +20 -4
- package/src/sdk/define-workflow.ts +39 -14
- package/src/sdk/runtime/executor.ts +40 -5
- package/src/sdk/types.ts +64 -18
- package/src/sdk/workflows/builtin/ralph/claude/index.ts +11 -4
- package/src/sdk/workflows/builtin/ralph/copilot/index.ts +11 -4
- package/src/sdk/workflows/builtin/ralph/opencode/index.ts +11 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-picker-panel.d.ts","sourceRoot":"","sources":["../../../src/sdk/components/workflow-picker-panel.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAEL,KAAK,WAAW,EAIjB,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EACV,oBAAoB,EAErB,MAAM,yBAAyB,CAAC;AASjC,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,g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AM,CACjB,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,mBAAmB,CAAC;IAgB/B,0EAA0E;IAC1E,MAAM,CAAC,kBAAkB,CACvB,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,0BAA0B,GAClC,mBAAmB;IAItB;;;;OAIG;IACH,gBAAgB,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAIxD,8CAA8C;IAC9C,OAAO,IAAI,IAAI;IAef,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,YAAY;CAMrB"}
|
|
@@ -11,16 +11,17 @@
|
|
|
11
11
|
* .compile()
|
|
12
12
|
*/
|
|
13
13
|
import type { AgentType, WorkflowOptions, WorkflowContext, WorkflowDefinition, WorkflowInput } from "./types.ts";
|
|
14
|
+
type AnyInputs = readonly WorkflowInput[];
|
|
14
15
|
/**
|
|
15
16
|
* Chainable workflow builder. Records the run callback,
|
|
16
17
|
* then .compile() seals it into a WorkflowDefinition.
|
|
17
18
|
*/
|
|
18
|
-
export declare class WorkflowBuilder<A extends AgentType = AgentType,
|
|
19
|
+
export declare class WorkflowBuilder<A extends AgentType = AgentType, I extends AnyInputs = AnyInputs> {
|
|
19
20
|
/** @internal Brand for detection across package boundaries */
|
|
20
21
|
readonly __brand: "WorkflowBuilder";
|
|
21
22
|
private readonly options;
|
|
22
23
|
private runFn;
|
|
23
|
-
constructor(options: WorkflowOptions);
|
|
24
|
+
constructor(options: WorkflowOptions<I>);
|
|
24
25
|
/**
|
|
25
26
|
* Narrow the agent type for this workflow while preserving typed inputs.
|
|
26
27
|
*
|
|
@@ -43,7 +44,7 @@ export declare class WorkflowBuilder<A extends AgentType = AgentType, N extends
|
|
|
43
44
|
* .compile();
|
|
44
45
|
* ```
|
|
45
46
|
*/
|
|
46
|
-
for<B extends AgentType>(): WorkflowBuilder<B,
|
|
47
|
+
for<B extends AgentType>(): WorkflowBuilder<B, I>;
|
|
47
48
|
/**
|
|
48
49
|
* Set the workflow's entry point.
|
|
49
50
|
*
|
|
@@ -52,14 +53,14 @@ export declare class WorkflowBuilder<A extends AgentType = AgentType, N extends
|
|
|
52
53
|
* reading completed session outputs. Use native TypeScript control flow
|
|
53
54
|
* (loops, conditionals, `Promise.all()`) for orchestration.
|
|
54
55
|
*/
|
|
55
|
-
run(fn: (ctx: WorkflowContext<A,
|
|
56
|
+
run(fn: (ctx: WorkflowContext<A, I>) => Promise<void>): this;
|
|
56
57
|
/**
|
|
57
58
|
* Compile the workflow into a sealed WorkflowDefinition.
|
|
58
59
|
*
|
|
59
60
|
* After calling compile(), the returned object is consumed by the
|
|
60
61
|
* Atomic CLI runtime.
|
|
61
62
|
*/
|
|
62
|
-
compile(): WorkflowDefinition<A,
|
|
63
|
+
compile(): WorkflowDefinition<A, I>;
|
|
63
64
|
}
|
|
64
65
|
/**
|
|
65
66
|
* Entry point for defining a workflow.
|
|
@@ -87,5 +88,6 @@ export declare class WorkflowBuilder<A extends AgentType = AgentType, N extends
|
|
|
87
88
|
* .compile();
|
|
88
89
|
* ```
|
|
89
90
|
*/
|
|
90
|
-
export declare function defineWorkflow<const I extends readonly WorkflowInput[] = readonly WorkflowInput[]>(options: WorkflowOptions<I>): WorkflowBuilder<AgentType, I
|
|
91
|
+
export declare function defineWorkflow<const I extends readonly WorkflowInput[] = readonly WorkflowInput[]>(options: WorkflowOptions<I>): WorkflowBuilder<AgentType, I>;
|
|
92
|
+
export {};
|
|
91
93
|
//# sourceMappingURL=define-workflow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-workflow.d.ts","sourceRoot":"","sources":["../../src/sdk/define-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,aAAa,EACd,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"define-workflow.d.ts","sourceRoot":"","sources":["../../src/sdk/define-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB,KAAK,SAAS,GAAG,SAAS,aAAa,EAAE,CAAC;AA0D1C;;;GAGG;AACH,qBAAa,eAAe,CAC1B,CAAC,SAAS,SAAS,GAAG,SAAS,EAC/B,CAAC,SAAS,SAAS,GAAG,SAAS;IAE/B,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAG,iBAAiB,CAAU;IAC9C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,KAAK,CAAgE;gBAEjE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IAIvC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,GAAG,CAAC,CAAC,SAAS,SAAS,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;IAIjD;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAW5D;;;;;OAKG;IACH,OAAO,IAAI,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC;CAoCpC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAC5B,KAAK,CAAC,CAAC,SAAS,SAAS,aAAa,EAAE,GAAG,SAAS,aAAa,EAAE,EAEnE,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,eAAe,CAAC,SAAS,EAAE,CAAC,CAAC,CAK/B"}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* dual-module-identity issue: Bun evaluates a file twice when it is both
|
|
14
14
|
* the entry point and reached through package.json `exports` self-referencing.
|
|
15
15
|
*/
|
|
16
|
-
import type { WorkflowDefinition, AgentType, SavedMessage } from "../types.ts";
|
|
16
|
+
import type { WorkflowDefinition, WorkflowInput, AgentType, SavedMessage } from "../types.ts";
|
|
17
17
|
export { errorMessage } from "../errors.ts";
|
|
18
18
|
export interface WorkflowRunOptions {
|
|
19
19
|
/** The compiled workflow definition */
|
|
@@ -92,6 +92,16 @@ export declare function escPwsh(s: string): string;
|
|
|
92
92
|
* prevent free-form workflows from running.
|
|
93
93
|
*/
|
|
94
94
|
export declare function parseInputsEnv(raw: string | undefined): Record<string, string>;
|
|
95
|
+
/**
|
|
96
|
+
* Coerce raw string inputs to their declared runtime types. Integer inputs
|
|
97
|
+
* become `number`; every other declared type passes through as `string`.
|
|
98
|
+
* Unknown keys (not in the schema) are preserved as strings.
|
|
99
|
+
*
|
|
100
|
+
* Invalid integer strings fall back to the key being dropped — validation
|
|
101
|
+
* already runs upstream (in `validateInputsAgainstSchema`), so reaching
|
|
102
|
+
* this path with garbage means the executor was invoked out-of-band.
|
|
103
|
+
*/
|
|
104
|
+
export declare function coerceInputsBySchema(inputs: Record<string, string>, schema: readonly WorkflowInput[]): Record<string, string | number>;
|
|
95
105
|
/**
|
|
96
106
|
* Called by `atomic workflow -n <name> -a <agent> <prompt>`.
|
|
97
107
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,KAAK,EACV,kBAAkB,
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/sdk/runtime/executor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,KAAK,EACV,kBAAkB,EAElB,aAAa,EAKb,SAAS,EAET,YAAY,EAMb,MAAM,aAAa,CAAC;AA0ErB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAa5C,MAAM,WAAW,kBAAkB;IACjC,uCAAuC;IACvC,UAAU,EAAE,kBAAkB,CAA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;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,wBAAwB,EACjC,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,GAChC,MAAM,IAAI,CAwBZ;AAsFD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,EAC9B,MAAM,EAAE,MAAM,EAAE,GACf,MAAM,EAAE,CAMV;AAslBD,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CA0MrD"}
|
package/dist/sdk/types.d.ts
CHANGED
|
@@ -86,11 +86,12 @@ export declare function createProviderValidator(rules: readonly ValidationRule[]
|
|
|
86
86
|
/**
|
|
87
87
|
* Supported field types for a workflow's declared inputs.
|
|
88
88
|
*
|
|
89
|
-
* - `"string"`
|
|
90
|
-
* - `"text"`
|
|
91
|
-
* - `"enum"`
|
|
89
|
+
* - `"string"` — single-line free-form input (short values, identifiers, paths)
|
|
90
|
+
* - `"text"` — multi-line free-form input (long prose, prompts, specs)
|
|
91
|
+
* - `"enum"` — one of a fixed list of allowed `values`
|
|
92
|
+
* - `"integer"` — whole number; parsed to `number` in `ctx.inputs`
|
|
92
93
|
*/
|
|
93
|
-
export type WorkflowInputType = "string" | "text" | "enum";
|
|
94
|
+
export type WorkflowInputType = "string" | "text" | "enum" | "integer";
|
|
94
95
|
/**
|
|
95
96
|
* A declared input for a workflow. When a workflow provides an `inputs`
|
|
96
97
|
* array, the CLI materialises one `--<name>` flag per input (and the
|
|
@@ -112,11 +113,34 @@ export interface WorkflowInput {
|
|
|
112
113
|
description?: string;
|
|
113
114
|
/** Placeholder text shown when the field is empty. */
|
|
114
115
|
placeholder?: string;
|
|
115
|
-
/**
|
|
116
|
-
|
|
116
|
+
/**
|
|
117
|
+
* Default value pre-filled into the field. Enums use this to pick
|
|
118
|
+
* their initial value. Integer inputs accept either a `number` or its
|
|
119
|
+
* decimal string representation.
|
|
120
|
+
*/
|
|
121
|
+
default?: string | number;
|
|
117
122
|
/** Allowed values — required when `type` is `"enum"`. */
|
|
118
123
|
values?: readonly string[];
|
|
119
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Map a {@link WorkflowInputType} to the runtime value type observed in
|
|
127
|
+
* `ctx.inputs`. Integer inputs are parsed to `number` at the executor
|
|
128
|
+
* boundary; everything else stays a `string`.
|
|
129
|
+
*/
|
|
130
|
+
export type WorkflowInputValue<T extends WorkflowInputType> = T extends "integer" ? number : string;
|
|
131
|
+
/**
|
|
132
|
+
* Compute the typed `ctx.inputs` shape from a workflow's declared input
|
|
133
|
+
* schema. Each declared field becomes an optional key whose value type
|
|
134
|
+
* is determined by {@link WorkflowInputValue}.
|
|
135
|
+
*
|
|
136
|
+
* Free-form workflows (no declared schema) fall back to a loose
|
|
137
|
+
* string-keyed record so authors can still read `ctx.inputs.prompt`.
|
|
138
|
+
*/
|
|
139
|
+
export type InputsOf<I extends readonly WorkflowInput[]> = WorkflowInput extends I[number] ? Record<string, string | undefined> : I[number] extends never ? Record<string, string | undefined> : {
|
|
140
|
+
[K in I[number]["name"]]?: WorkflowInputValue<Extract<I[number], {
|
|
141
|
+
name: K;
|
|
142
|
+
}>["type"]>;
|
|
143
|
+
};
|
|
120
144
|
/**
|
|
121
145
|
* A transcript from a completed session.
|
|
122
146
|
* Provides both the file path and rendered text content.
|
|
@@ -191,7 +215,7 @@ export interface SessionRunOptions {
|
|
|
191
215
|
* Created by `ctx.stage(opts, clientOpts, sessionOpts, fn)` — the callback
|
|
192
216
|
* receives this as its argument with pre-initialized `client` and `session`.
|
|
193
217
|
*/
|
|
194
|
-
export interface SessionContext<A extends AgentType = AgentType,
|
|
218
|
+
export interface SessionContext<A extends AgentType = AgentType, I extends readonly WorkflowInput[] = readonly WorkflowInput[]> {
|
|
195
219
|
/** Provider-specific SDK client (auto-created by runtime) */
|
|
196
220
|
client: ProviderClient<A>;
|
|
197
221
|
/** Provider-specific session (auto-created by runtime) */
|
|
@@ -202,12 +226,11 @@ export interface SessionContext<A extends AgentType = AgentType, N extends strin
|
|
|
202
226
|
*
|
|
203
227
|
* When the workflow declares an `inputs` schema, only the declared
|
|
204
228
|
* field names are valid keys — accessing undeclared fields is a
|
|
205
|
-
* compile-time error.
|
|
206
|
-
*
|
|
229
|
+
* compile-time error. Each field's value type is determined by its
|
|
230
|
+
* declared `type` (integer inputs surface as `number`). Free-form
|
|
231
|
+
* workflows (no declared schema) allow any key.
|
|
207
232
|
*/
|
|
208
|
-
inputs:
|
|
209
|
-
[K in N]?: string;
|
|
210
|
-
};
|
|
233
|
+
inputs: InputsOf<I>;
|
|
211
234
|
/** Which agent is running */
|
|
212
235
|
agent: A;
|
|
213
236
|
/**
|
|
@@ -236,25 +259,24 @@ export interface SessionContext<A extends AgentType = AgentType, N extends strin
|
|
|
236
259
|
* The sub-session is a child of this session in the graph.
|
|
237
260
|
* The callback's return value is available as `handle.result`.
|
|
238
261
|
*/
|
|
239
|
-
stage<T = void>(options: SessionRunOptions, clientOpts: StageClientOptions<A>, sessionOpts: StageSessionOptions<A>, run: (ctx: SessionContext<A,
|
|
262
|
+
stage<T = void>(options: SessionRunOptions, clientOpts: StageClientOptions<A>, sessionOpts: StageSessionOptions<A>, run: (ctx: SessionContext<A, I>) => Promise<T>): Promise<SessionHandle<T>>;
|
|
240
263
|
}
|
|
241
264
|
/**
|
|
242
265
|
* Top-level context provided to the workflow's `.run()` callback.
|
|
243
266
|
* Does not have session-specific fields (paneId, save, etc.).
|
|
244
267
|
*/
|
|
245
|
-
export interface WorkflowContext<A extends AgentType = AgentType,
|
|
268
|
+
export interface WorkflowContext<A extends AgentType = AgentType, I extends readonly WorkflowInput[] = readonly WorkflowInput[]> {
|
|
246
269
|
/**
|
|
247
270
|
* Structured inputs for this workflow run. Populated from CLI flags
|
|
248
271
|
* (`--<name>=<value>`) or the interactive picker.
|
|
249
272
|
*
|
|
250
273
|
* When the workflow declares an `inputs` schema, only the declared
|
|
251
274
|
* field names are valid keys — accessing undeclared fields is a
|
|
252
|
-
* compile-time error.
|
|
253
|
-
*
|
|
275
|
+
* compile-time error. Each field's value type is determined by its
|
|
276
|
+
* declared `type` (integer inputs surface as `number`). Free-form
|
|
277
|
+
* workflows (no declared schema) allow any key.
|
|
254
278
|
*/
|
|
255
|
-
inputs:
|
|
256
|
-
[K in N]?: string;
|
|
257
|
-
};
|
|
279
|
+
inputs: InputsOf<I>;
|
|
258
280
|
/** Which agent is running */
|
|
259
281
|
agent: A;
|
|
260
282
|
/**
|
|
@@ -263,7 +285,7 @@ export interface WorkflowContext<A extends AgentType = AgentType, N extends stri
|
|
|
263
285
|
* run callback → cleanup. The callback's return value is available as
|
|
264
286
|
* `handle.result`.
|
|
265
287
|
*/
|
|
266
|
-
stage<T = void>(options: SessionRunOptions, clientOpts: StageClientOptions<A>, sessionOpts: StageSessionOptions<A>, run: (ctx: SessionContext<A,
|
|
288
|
+
stage<T = void>(options: SessionRunOptions, clientOpts: StageClientOptions<A>, sessionOpts: StageSessionOptions<A>, run: (ctx: SessionContext<A, I>) => Promise<T>): Promise<SessionHandle<T>>;
|
|
267
289
|
/**
|
|
268
290
|
* Get a completed session's transcript as rendered text.
|
|
269
291
|
* Accepts a SessionHandle (recommended) or session name string.
|
|
@@ -313,7 +335,7 @@ export interface WorkflowOptions<I extends readonly WorkflowInput[] = readonly W
|
|
|
313
335
|
/**
|
|
314
336
|
* A compiled workflow definition — the sealed output of defineWorkflow().compile().
|
|
315
337
|
*/
|
|
316
|
-
export interface WorkflowDefinition<A extends AgentType = AgentType,
|
|
338
|
+
export interface WorkflowDefinition<A extends AgentType = AgentType, I extends readonly WorkflowInput[] = readonly WorkflowInput[]> {
|
|
317
339
|
readonly __brand: "WorkflowDefinition";
|
|
318
340
|
readonly name: string;
|
|
319
341
|
readonly description: string;
|
|
@@ -325,6 +347,6 @@ export interface WorkflowDefinition<A extends AgentType = AgentType, N extends s
|
|
|
325
347
|
*/
|
|
326
348
|
readonly minSDKVersion: string | null;
|
|
327
349
|
/** The workflow's entry point. Called by the executor with a WorkflowContext. */
|
|
328
|
-
readonly run: (ctx: WorkflowContext<A,
|
|
350
|
+
readonly run: (ctx: WorkflowContext<A, I>) => Promise<void>;
|
|
329
351
|
}
|
|
330
352
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/sdk/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sdk/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,aAAa,IAAI,oBAAoB,EACtC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,cAAc,EACd,OAAO,IAAI,eAAe,EAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAE/B,4BAA4B;AAC5B,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAI1D;;;GAGG;AACH,KAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,wBAAwB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpE,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;IAC9C,MAAM,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3D,CAAC;AAEF;;;;;GAKG;AACH,KAAK,iBAAiB,GAAG;IACvB,Q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AM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CACjC,CAAC,SAAS,SAAS,GAAG,SAAS,EAC/B,CAAC,SAAS,SAAS,aAAa,EAAE,GAAG,SAAS,aAAa,EAAE;IAE7D,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,iFAAiF;IACjF,QAAQ,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D"}
|
|
@@ -56,6 +56,11 @@
|
|
|
56
56
|
* so they are transparent to the workflow graph. The visible nodes are just:
|
|
57
57
|
* parent → [codebase-scout] → aggregator
|
|
58
58
|
*/
|
|
59
|
-
declare const _default: import("../../../index.ts").WorkflowDefinition<"claude",
|
|
59
|
+
declare const _default: import("../../../index.ts").WorkflowDefinition<"claude", readonly [{
|
|
60
|
+
readonly name: "prompt";
|
|
61
|
+
readonly type: "text";
|
|
62
|
+
readonly required: true;
|
|
63
|
+
readonly description: "research question";
|
|
64
|
+
}]>;
|
|
60
65
|
export default _default;
|
|
61
66
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/claude/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;;;;;;;AAsCH,wBAwTa"}
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
*
|
|
26
26
|
* See claude/index.ts for the full design rationale and topology diagram.
|
|
27
27
|
*/
|
|
28
|
-
declare const _default: import("../../../index.ts").WorkflowDefinition<"copilot",
|
|
28
|
+
declare const _default: import("../../../index.ts").WorkflowDefinition<"copilot", readonly [{
|
|
29
|
+
readonly name: "prompt";
|
|
30
|
+
readonly type: "text";
|
|
31
|
+
readonly required: true;
|
|
32
|
+
readonly description: "research question";
|
|
33
|
+
}]>;
|
|
29
34
|
export default _default;
|
|
30
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;AA6CH,wBA4Ra"}
|
|
@@ -25,6 +25,11 @@
|
|
|
25
25
|
*
|
|
26
26
|
* See claude/index.ts for the full design rationale and topology diagram.
|
|
27
27
|
*/
|
|
28
|
-
declare const _default: import("../../../index.ts").WorkflowDefinition<"opencode",
|
|
28
|
+
declare const _default: import("../../../index.ts").WorkflowDefinition<"opencode", readonly [{
|
|
29
|
+
readonly name: "prompt";
|
|
30
|
+
readonly type: "text";
|
|
31
|
+
readonly required: true;
|
|
32
|
+
readonly description: "research question";
|
|
33
|
+
}]>;
|
|
29
34
|
export default _default;
|
|
30
35
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/deep-research-codebase/opencode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;;AAsCH,wBA8Ua"}
|
|
@@ -41,6 +41,28 @@
|
|
|
41
41
|
*
|
|
42
42
|
* Run: atomic workflow -n open-claude-design -a claude "design a dashboard"
|
|
43
43
|
*/
|
|
44
|
-
declare const _default: import("../../../index.ts").WorkflowDefinition<"claude",
|
|
44
|
+
declare const _default: import("../../../index.ts").WorkflowDefinition<"claude", readonly [{
|
|
45
|
+
readonly name: "prompt";
|
|
46
|
+
readonly type: "text";
|
|
47
|
+
readonly required: true;
|
|
48
|
+
readonly description: "What to design (e.g., 'a dashboard for monitoring API latency')";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "reference";
|
|
51
|
+
readonly type: "text";
|
|
52
|
+
readonly required: false;
|
|
53
|
+
readonly description: "URL, file path, or codebase path to import as design reference";
|
|
54
|
+
}, {
|
|
55
|
+
readonly name: "output-type";
|
|
56
|
+
readonly type: "enum";
|
|
57
|
+
readonly required: false;
|
|
58
|
+
readonly values: readonly ["prototype", "wireframe", "page", "component"];
|
|
59
|
+
readonly default: "prototype";
|
|
60
|
+
readonly description: "Type of design output to generate";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "design-system";
|
|
63
|
+
readonly type: "text";
|
|
64
|
+
readonly required: false;
|
|
65
|
+
readonly description: "Path to existing Design.md (skips onboarding if provided)";
|
|
66
|
+
}]>;
|
|
45
67
|
export default _default;
|
|
46
68
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/open-claude-design/claude/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/open-claude-design/claude/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;;;;;;;;;;;;;;;;;;;;;;;;AA8CH,wBA0Za"}
|
|
@@ -29,6 +29,28 @@
|
|
|
29
29
|
*
|
|
30
30
|
* Run: atomic workflow -n open-claude-design -a copilot "design a dashboard"
|
|
31
31
|
*/
|
|
32
|
-
declare const _default: import("../../../index.ts").WorkflowDefinition<"copilot",
|
|
32
|
+
declare const _default: import("../../../index.ts").WorkflowDefinition<"copilot", readonly [{
|
|
33
|
+
readonly name: "prompt";
|
|
34
|
+
readonly type: "text";
|
|
35
|
+
readonly required: true;
|
|
36
|
+
readonly description: "What to design (e.g., 'a dashboard for monitoring API latency')";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "reference";
|
|
39
|
+
readonly type: "text";
|
|
40
|
+
readonly required: false;
|
|
41
|
+
readonly description: "URL, file path, or codebase path to import as design reference";
|
|
42
|
+
}, {
|
|
43
|
+
readonly name: "output-type";
|
|
44
|
+
readonly type: "enum";
|
|
45
|
+
readonly required: false;
|
|
46
|
+
readonly values: readonly ["prototype", "wireframe", "page", "component"];
|
|
47
|
+
readonly default: "prototype";
|
|
48
|
+
readonly description: "Type of design output to generate";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "design-system";
|
|
51
|
+
readonly type: "text";
|
|
52
|
+
readonly required: false;
|
|
53
|
+
readonly description: "Path to existing Design.md (skips onboarding if provided)";
|
|
54
|
+
}]>;
|
|
33
55
|
export default _default;
|
|
34
56
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/open-claude-design/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/open-claude-design/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;;;;;;;;;;;;;;;;;;;;;;;;AA2DH,wBAiaa"}
|
|
@@ -31,6 +31,28 @@
|
|
|
31
31
|
*
|
|
32
32
|
* Run: atomic workflow -n open-claude-design -a opencode "design a dashboard"
|
|
33
33
|
*/
|
|
34
|
-
declare const _default: import("../../../index.ts").WorkflowDefinition<"opencode",
|
|
34
|
+
declare const _default: import("../../../index.ts").WorkflowDefinition<"opencode", readonly [{
|
|
35
|
+
readonly name: "prompt";
|
|
36
|
+
readonly type: "text";
|
|
37
|
+
readonly required: true;
|
|
38
|
+
readonly description: "What to design (e.g., 'a dashboard for monitoring API latency')";
|
|
39
|
+
}, {
|
|
40
|
+
readonly name: "reference";
|
|
41
|
+
readonly type: "text";
|
|
42
|
+
readonly required: false;
|
|
43
|
+
readonly description: "URL, file path, or codebase path to import as design reference";
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "output-type";
|
|
46
|
+
readonly type: "enum";
|
|
47
|
+
readonly required: false;
|
|
48
|
+
readonly values: readonly ["prototype", "wireframe", "page", "component"];
|
|
49
|
+
readonly default: "prototype";
|
|
50
|
+
readonly description: "Type of design output to generate";
|
|
51
|
+
}, {
|
|
52
|
+
readonly name: "design-system";
|
|
53
|
+
readonly type: "text";
|
|
54
|
+
readonly required: false;
|
|
55
|
+
readonly description: "Path to existing Design.md (skips onboarding if provided)";
|
|
56
|
+
}]>;
|
|
35
57
|
export default _default;
|
|
36
58
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/open-claude-design/opencode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/open-claude-design/opencode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;;;;;;;;;;;;;;;;;;;;;;;;AAoDH,wBAqea"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Each sub-agent invocation spawns its own visible session in the graph,
|
|
5
5
|
* so users can see each iteration's progress in real time. The loop
|
|
6
6
|
* terminates when:
|
|
7
|
-
* -
|
|
7
|
+
* - `max_loops` iterations have completed (defaults to {@link DEFAULT_MAX_LOOPS}), OR
|
|
8
8
|
* - Two parallel reviewer passes both return zero findings.
|
|
9
9
|
*
|
|
10
10
|
* The reviewer stages run the `reviewer` sub-agent in a visible TUI via the
|
|
@@ -17,6 +17,16 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Run: atomic workflow -n ralph -a claude "<your spec>"
|
|
19
19
|
*/
|
|
20
|
-
declare const _default: import("../../../index.ts").WorkflowDefinition<"claude",
|
|
20
|
+
declare const _default: import("../../../index.ts").WorkflowDefinition<"claude", readonly [{
|
|
21
|
+
readonly name: "prompt";
|
|
22
|
+
readonly type: "text";
|
|
23
|
+
readonly required: true;
|
|
24
|
+
readonly description: "task prompt";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "max_loops";
|
|
27
|
+
readonly type: "integer";
|
|
28
|
+
readonly description: "maximum number of plan/orchestrate/review iterations";
|
|
29
|
+
readonly default: 10;
|
|
30
|
+
}]>;
|
|
21
31
|
export default _default;
|
|
22
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/ralph/claude/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/ralph/claude/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;AAmCH,wBAyMa"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Each sub-agent invocation spawns its own visible session in the graph,
|
|
5
5
|
* so users can see each iteration's progress in real time. The loop
|
|
6
6
|
* terminates when:
|
|
7
|
-
* -
|
|
7
|
+
* - `max_loops` iterations have completed (defaults to {@link DEFAULT_MAX_LOOPS}), OR
|
|
8
8
|
* - Two parallel reviewer passes both return zero findings.
|
|
9
9
|
*
|
|
10
10
|
* The reviewer stages use a `submit_review` custom tool (defined via
|
|
@@ -14,6 +14,16 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Run: atomic workflow -n ralph -a copilot "<your spec>"
|
|
16
16
|
*/
|
|
17
|
-
declare const _default: import("../../../index.ts").WorkflowDefinition<"copilot",
|
|
17
|
+
declare const _default: import("../../../index.ts").WorkflowDefinition<"copilot", readonly [{
|
|
18
|
+
readonly name: "prompt";
|
|
19
|
+
readonly type: "text";
|
|
20
|
+
readonly required: true;
|
|
21
|
+
readonly description: "task prompt";
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "max_loops";
|
|
24
|
+
readonly type: "integer";
|
|
25
|
+
readonly description: "maximum number of plan/orchestrate/review iterations";
|
|
26
|
+
readonly default: 10;
|
|
27
|
+
}]>;
|
|
18
28
|
export default _default;
|
|
19
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/ralph/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/ralph/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;AA6DH,wBA0Ma"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Each sub-agent invocation spawns its own visible session in the graph,
|
|
5
5
|
* so users can see each iteration's progress in real time. The loop
|
|
6
6
|
* terminates when:
|
|
7
|
-
* -
|
|
7
|
+
* - `max_loops` iterations have completed (defaults to {@link DEFAULT_MAX_LOOPS}), OR
|
|
8
8
|
* - Two parallel reviewer passes both return zero findings.
|
|
9
9
|
*
|
|
10
10
|
* The reviewer stages use the OpenCode SDK's structured output
|
|
@@ -13,6 +13,16 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Run: atomic workflow -n ralph -a opencode "<your spec>"
|
|
15
15
|
*/
|
|
16
|
-
declare const _default: import("../../../index.ts").WorkflowDefinition<"opencode",
|
|
16
|
+
declare const _default: import("../../../index.ts").WorkflowDefinition<"opencode", readonly [{
|
|
17
|
+
readonly name: "prompt";
|
|
18
|
+
readonly type: "text";
|
|
19
|
+
readonly required: true;
|
|
20
|
+
readonly description: "task prompt";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "max_loops";
|
|
23
|
+
readonly type: "integer";
|
|
24
|
+
readonly description: "maximum number of plan/orchestrate/review iterations";
|
|
25
|
+
readonly default: 10;
|
|
26
|
+
}]>;
|
|
17
27
|
export default _default;
|
|
18
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/ralph/opencode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/sdk/workflows/builtin/ralph/opencode/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;AAqDH,wBAmMa"}
|
package/package.json
CHANGED
|
@@ -114,7 +114,9 @@ export function renderInputsText(payload: WorkflowInputsResult): string {
|
|
|
114
114
|
}
|
|
115
115
|
if (field.default !== undefined) {
|
|
116
116
|
lines.push(
|
|
117
|
-
" " +
|
|
117
|
+
" " +
|
|
118
|
+
paint("dim", "default: ") +
|
|
119
|
+
paint("text", String(field.default)),
|
|
118
120
|
);
|
|
119
121
|
}
|
|
120
122
|
if (field.placeholder) {
|
|
@@ -110,9 +110,11 @@ export function validateInputsAgainstSchema(
|
|
|
110
110
|
|
|
111
111
|
for (const field of schema) {
|
|
112
112
|
const raw = inputs[field.name];
|
|
113
|
+
const defaultStr =
|
|
114
|
+
field.default !== undefined ? String(field.default) : undefined;
|
|
113
115
|
const value =
|
|
114
116
|
raw === undefined || raw === ""
|
|
115
|
-
?
|
|
117
|
+
? defaultStr ?? (field.type === "enum" ? field.values?.[0] ?? "" : "")
|
|
116
118
|
: raw;
|
|
117
119
|
|
|
118
120
|
if (field.required) {
|
|
@@ -136,6 +138,19 @@ export function validateInputsAgainstSchema(
|
|
|
136
138
|
);
|
|
137
139
|
}
|
|
138
140
|
}
|
|
141
|
+
|
|
142
|
+
if (field.type === "integer" && value !== "") {
|
|
143
|
+
const parsed = Number.parseInt(value, 10);
|
|
144
|
+
if (
|
|
145
|
+
!Number.isFinite(parsed) ||
|
|
146
|
+
!Number.isInteger(parsed) ||
|
|
147
|
+
String(parsed) !== value.trim()
|
|
148
|
+
) {
|
|
149
|
+
errors.push(
|
|
150
|
+
`Invalid value for --${field.name}: "${value}". Expected an integer.`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
139
154
|
}
|
|
140
155
|
|
|
141
156
|
for (const name of Object.keys(inputs)) {
|
|
@@ -166,7 +181,7 @@ export function resolveInputs(
|
|
|
166
181
|
if (raw !== undefined && raw !== "") {
|
|
167
182
|
out[field.name] = raw;
|
|
168
183
|
} else if (field.default !== undefined) {
|
|
169
|
-
out[field.name] = field.default;
|
|
184
|
+
out[field.name] = String(field.default);
|
|
170
185
|
} else if (field.type === "enum" && field.values && field.values.length > 0) {
|
|
171
186
|
out[field.name] = field.values[0]!;
|
|
172
187
|
}
|
|
@@ -296,6 +296,16 @@ function isRunnable(wf: WorkflowWithMetadata): boolean {
|
|
|
296
296
|
// ─── Validation ─────────────────────────────────
|
|
297
297
|
|
|
298
298
|
export function isFieldValid(field: WorkflowInput, value: string): boolean {
|
|
299
|
+
if (field.type === "integer") {
|
|
300
|
+
const trimmed = value.trim();
|
|
301
|
+
if (trimmed === "") return !field.required;
|
|
302
|
+
const parsed = Number.parseInt(trimmed, 10);
|
|
303
|
+
return (
|
|
304
|
+
Number.isFinite(parsed) &&
|
|
305
|
+
Number.isInteger(parsed) &&
|
|
306
|
+
String(parsed) === trimmed
|
|
307
|
+
);
|
|
308
|
+
}
|
|
299
309
|
if (!field.required) return true;
|
|
300
310
|
if (field.type === "enum") return value !== "";
|
|
301
311
|
return value.trim() !== "";
|
|
@@ -864,7 +874,7 @@ const Field = memo(function Field({
|
|
|
864
874
|
focused={focused}
|
|
865
875
|
onInput={onInput}
|
|
866
876
|
/>
|
|
867
|
-
) : field.type === "string" ? (
|
|
877
|
+
) : field.type === "string" || field.type === "integer" ? (
|
|
868
878
|
<StringContent
|
|
869
879
|
value={value}
|
|
870
880
|
placeholder={field.placeholder ?? ""}
|
|
@@ -1397,8 +1407,11 @@ function usePickerKeyboard(state: PickerKeyboardState): void {
|
|
|
1397
1407
|
const initial: Record<string, string> = {};
|
|
1398
1408
|
for (const f of wf.inputs) {
|
|
1399
1409
|
initial[f.name] =
|
|
1400
|
-
f.default
|
|
1401
|
-
|
|
1410
|
+
f.default !== undefined
|
|
1411
|
+
? String(f.default)
|
|
1412
|
+
: f.type === "enum"
|
|
1413
|
+
? (f.values?.[0] ?? "")
|
|
1414
|
+
: "";
|
|
1402
1415
|
}
|
|
1403
1416
|
setFieldValues(initial);
|
|
1404
1417
|
setFocusedFieldIdx(0);
|
|
@@ -1453,7 +1466,10 @@ function usePickerKeyboard(state: PickerKeyboardState): void {
|
|
|
1453
1466
|
return;
|
|
1454
1467
|
}
|
|
1455
1468
|
|
|
1456
|
-
if (
|
|
1469
|
+
if (
|
|
1470
|
+
(field.type === "string" || field.type === "integer") &&
|
|
1471
|
+
key.name === "return"
|
|
1472
|
+
) {
|
|
1457
1473
|
key.stopPropagation();
|
|
1458
1474
|
setFocusedFieldIdx((i: number) =>
|
|
1459
1475
|
Math.min(currentFieldsRef.current.length - 1, i + 1),
|
|
@@ -19,6 +19,8 @@ import type {
|
|
|
19
19
|
WorkflowInput,
|
|
20
20
|
} from "./types.ts";
|
|
21
21
|
|
|
22
|
+
type AnyInputs = readonly WorkflowInput[];
|
|
23
|
+
|
|
22
24
|
/**
|
|
23
25
|
* Validate a single declared workflow input, throwing on authoring
|
|
24
26
|
* mistakes that would otherwise surface as confusing runtime errors
|
|
@@ -45,11 +47,31 @@ function validateWorkflowInput(input: WorkflowInput, workflowName: string): void
|
|
|
45
47
|
`declares no \`values\`.`,
|
|
46
48
|
);
|
|
47
49
|
}
|
|
48
|
-
if (input.default !== undefined
|
|
50
|
+
if (input.default !== undefined) {
|
|
51
|
+
if (typeof input.default !== "string") {
|
|
52
|
+
throw new Error(
|
|
53
|
+
`Workflow "${workflowName}" input "${input.name}" (enum) has a ` +
|
|
54
|
+
`non-string default ${JSON.stringify(input.default)}.`,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
if (!input.values.includes(input.default)) {
|
|
58
|
+
throw new Error(
|
|
59
|
+
`Workflow "${workflowName}" input "${input.name}" has a default ` +
|
|
60
|
+
`"${input.default}" that is not one of its declared values: ` +
|
|
61
|
+
`${input.values.join(", ")}.`,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (input.type === "integer" && input.default !== undefined) {
|
|
67
|
+
const n =
|
|
68
|
+
typeof input.default === "number"
|
|
69
|
+
? input.default
|
|
70
|
+
: Number.parseInt(input.default, 10);
|
|
71
|
+
if (!Number.isFinite(n) || !Number.isInteger(n)) {
|
|
49
72
|
throw new Error(
|
|
50
|
-
`Workflow "${workflowName}" input "${input.name}" has a
|
|
51
|
-
`
|
|
52
|
-
`${input.values.join(", ")}.`,
|
|
73
|
+
`Workflow "${workflowName}" input "${input.name}" (integer) has a ` +
|
|
74
|
+
`non-integer default ${JSON.stringify(input.default)}.`,
|
|
53
75
|
);
|
|
54
76
|
}
|
|
55
77
|
}
|
|
@@ -59,13 +81,16 @@ function validateWorkflowInput(input: WorkflowInput, workflowName: string): void
|
|
|
59
81
|
* Chainable workflow builder. Records the run callback,
|
|
60
82
|
* then .compile() seals it into a WorkflowDefinition.
|
|
61
83
|
*/
|
|
62
|
-
export class WorkflowBuilder<
|
|
84
|
+
export class WorkflowBuilder<
|
|
85
|
+
A extends AgentType = AgentType,
|
|
86
|
+
I extends AnyInputs = AnyInputs,
|
|
87
|
+
> {
|
|
63
88
|
/** @internal Brand for detection across package boundaries */
|
|
64
89
|
readonly __brand = "WorkflowBuilder" as const;
|
|
65
|
-
private readonly options: WorkflowOptions
|
|
66
|
-
private runFn: ((ctx: WorkflowContext<A,
|
|
90
|
+
private readonly options: WorkflowOptions<I>;
|
|
91
|
+
private runFn: ((ctx: WorkflowContext<A, I>) => Promise<void>) | null = null;
|
|
67
92
|
|
|
68
|
-
constructor(options: WorkflowOptions) {
|
|
93
|
+
constructor(options: WorkflowOptions<I>) {
|
|
69
94
|
this.options = options;
|
|
70
95
|
}
|
|
71
96
|
|
|
@@ -91,8 +116,8 @@ export class WorkflowBuilder<A extends AgentType = AgentType, N extends string =
|
|
|
91
116
|
* .compile();
|
|
92
117
|
* ```
|
|
93
118
|
*/
|
|
94
|
-
for<B extends AgentType>(): WorkflowBuilder<B,
|
|
95
|
-
return this as unknown as WorkflowBuilder<B,
|
|
119
|
+
for<B extends AgentType>(): WorkflowBuilder<B, I> {
|
|
120
|
+
return this as unknown as WorkflowBuilder<B, I>;
|
|
96
121
|
}
|
|
97
122
|
|
|
98
123
|
/**
|
|
@@ -103,7 +128,7 @@ export class WorkflowBuilder<A extends AgentType = AgentType, N extends string =
|
|
|
103
128
|
* reading completed session outputs. Use native TypeScript control flow
|
|
104
129
|
* (loops, conditionals, `Promise.all()`) for orchestration.
|
|
105
130
|
*/
|
|
106
|
-
run(fn: (ctx: WorkflowContext<A,
|
|
131
|
+
run(fn: (ctx: WorkflowContext<A, I>) => Promise<void>): this {
|
|
107
132
|
if (this.runFn) {
|
|
108
133
|
throw new Error("run() can only be called once per workflow.");
|
|
109
134
|
}
|
|
@@ -120,7 +145,7 @@ export class WorkflowBuilder<A extends AgentType = AgentType, N extends string =
|
|
|
120
145
|
* After calling compile(), the returned object is consumed by the
|
|
121
146
|
* Atomic CLI runtime.
|
|
122
147
|
*/
|
|
123
|
-
compile(): WorkflowDefinition<A,
|
|
148
|
+
compile(): WorkflowDefinition<A, I> {
|
|
124
149
|
if (!this.runFn) {
|
|
125
150
|
throw new Error(
|
|
126
151
|
`Workflow "${this.options.name}" has no run callback. ` +
|
|
@@ -188,9 +213,9 @@ export function defineWorkflow<
|
|
|
188
213
|
const I extends readonly WorkflowInput[] = readonly WorkflowInput[],
|
|
189
214
|
>(
|
|
190
215
|
options: WorkflowOptions<I>,
|
|
191
|
-
): WorkflowBuilder<AgentType, I
|
|
216
|
+
): WorkflowBuilder<AgentType, I> {
|
|
192
217
|
if (!options.name || options.name.trim() === "") {
|
|
193
218
|
throw new Error("Workflow name is required.");
|
|
194
219
|
}
|
|
195
|
-
return new WorkflowBuilder<AgentType, I
|
|
220
|
+
return new WorkflowBuilder<AgentType, I>(options);
|
|
196
221
|
}
|
|
@@ -21,6 +21,7 @@ import { statSync, accessSync, constants as fsConstants } from "node:fs";
|
|
|
21
21
|
import type {
|
|
22
22
|
WorkflowDefinition,
|
|
23
23
|
WorkflowContext,
|
|
24
|
+
WorkflowInput,
|
|
24
25
|
SessionContext,
|
|
25
26
|
SessionRunOptions,
|
|
26
27
|
SessionHandle,
|
|
@@ -418,6 +419,35 @@ export function parseInputsEnv(
|
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
|
|
422
|
+
/**
|
|
423
|
+
* Coerce raw string inputs to their declared runtime types. Integer inputs
|
|
424
|
+
* become `number`; every other declared type passes through as `string`.
|
|
425
|
+
* Unknown keys (not in the schema) are preserved as strings.
|
|
426
|
+
*
|
|
427
|
+
* Invalid integer strings fall back to the key being dropped — validation
|
|
428
|
+
* already runs upstream (in `validateInputsAgainstSchema`), so reaching
|
|
429
|
+
* this path with garbage means the executor was invoked out-of-band.
|
|
430
|
+
*/
|
|
431
|
+
export function coerceInputsBySchema(
|
|
432
|
+
inputs: Record<string, string>,
|
|
433
|
+
schema: readonly WorkflowInput[],
|
|
434
|
+
): Record<string, string | number> {
|
|
435
|
+
const byName = new Map(schema.map((f) => [f.name, f]));
|
|
436
|
+
const out: Record<string, string | number> = {};
|
|
437
|
+
for (const [k, v] of Object.entries(inputs)) {
|
|
438
|
+
const field = byName.get(k);
|
|
439
|
+
if (field?.type === "integer") {
|
|
440
|
+
const parsed = Number.parseInt(v, 10);
|
|
441
|
+
if (Number.isFinite(parsed) && Number.isInteger(parsed)) {
|
|
442
|
+
out[k] = parsed;
|
|
443
|
+
}
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
out[k] = v;
|
|
447
|
+
}
|
|
448
|
+
return out;
|
|
449
|
+
}
|
|
450
|
+
|
|
421
451
|
// ============================================================================
|
|
422
452
|
// Entry point called by the CLI command
|
|
423
453
|
// ============================================================================
|
|
@@ -1138,10 +1168,10 @@ interface SharedRunnerState {
|
|
|
1138
1168
|
/**
|
|
1139
1169
|
* Structured inputs for this workflow run. Free-form workflows use
|
|
1140
1170
|
* `{ prompt: "..." }`; structured workflows use their declared field
|
|
1141
|
-
* names. Workflow authors read both shapes via `ctx.inputs` —
|
|
1142
|
-
*
|
|
1171
|
+
* names. Workflow authors read both shapes via `ctx.inputs` — integer
|
|
1172
|
+
* inputs are parsed to `number`, everything else stays a `string`.
|
|
1143
1173
|
*/
|
|
1144
|
-
inputs: Record<string, string>;
|
|
1174
|
+
inputs: Record<string, string | number>;
|
|
1145
1175
|
/** User-configured provider overrides (global + local merged). */
|
|
1146
1176
|
providerOverrides: ProviderOverrides;
|
|
1147
1177
|
/**
|
|
@@ -1662,7 +1692,7 @@ function createSessionRunner(
|
|
|
1662
1692
|
const ctx: SessionContext = {
|
|
1663
1693
|
client: providerClient,
|
|
1664
1694
|
session: providerSession,
|
|
1665
|
-
inputs: shared.inputs,
|
|
1695
|
+
inputs: shared.inputs as SessionContext["inputs"],
|
|
1666
1696
|
agent: shared.agent,
|
|
1667
1697
|
sessionDir,
|
|
1668
1698
|
paneId,
|
|
@@ -1904,6 +1934,11 @@ export async function runOrchestrator(): Promise<void> {
|
|
|
1904
1934
|
}
|
|
1905
1935
|
const definition = loaded.value.definition;
|
|
1906
1936
|
|
|
1937
|
+
// Parse integer inputs to numbers so `ctx.inputs.<name>` matches the
|
|
1938
|
+
// declared type. Do this after loading (when the schema is known) and
|
|
1939
|
+
// mutate shared.inputs so per-stage SessionContexts see the same shape.
|
|
1940
|
+
shared.inputs = coerceInputsBySchema(inputs, definition.inputs);
|
|
1941
|
+
|
|
1907
1942
|
await Bun.write(
|
|
1908
1943
|
join(sessionsBaseDir, "metadata.json"),
|
|
1909
1944
|
JSON.stringify(
|
|
@@ -1926,7 +1961,7 @@ export async function runOrchestrator(): Promise<void> {
|
|
|
1926
1961
|
const sessionRunner = createSessionRunner(shared, "orchestrator");
|
|
1927
1962
|
|
|
1928
1963
|
const workflowCtx: WorkflowContext = {
|
|
1929
|
-
inputs,
|
|
1964
|
+
inputs: shared.inputs as WorkflowContext["inputs"],
|
|
1930
1965
|
agent,
|
|
1931
1966
|
stage: sessionRunner as WorkflowContext["stage"],
|
|
1932
1967
|
transcript: createTranscriptReader(shared.completedRegistry),
|
package/src/sdk/types.ts
CHANGED
|
@@ -143,11 +143,12 @@ export function createProviderValidator(
|
|
|
143
143
|
/**
|
|
144
144
|
* Supported field types for a workflow's declared inputs.
|
|
145
145
|
*
|
|
146
|
-
* - `"string"`
|
|
147
|
-
* - `"text"`
|
|
148
|
-
* - `"enum"`
|
|
146
|
+
* - `"string"` — single-line free-form input (short values, identifiers, paths)
|
|
147
|
+
* - `"text"` — multi-line free-form input (long prose, prompts, specs)
|
|
148
|
+
* - `"enum"` — one of a fixed list of allowed `values`
|
|
149
|
+
* - `"integer"` — whole number; parsed to `number` in `ctx.inputs`
|
|
149
150
|
*/
|
|
150
|
-
export type WorkflowInputType = "string" | "text" | "enum";
|
|
151
|
+
export type WorkflowInputType = "string" | "text" | "enum" | "integer";
|
|
151
152
|
|
|
152
153
|
/**
|
|
153
154
|
* A declared input for a workflow. When a workflow provides an `inputs`
|
|
@@ -170,12 +171,46 @@ export interface WorkflowInput {
|
|
|
170
171
|
description?: string;
|
|
171
172
|
/** Placeholder text shown when the field is empty. */
|
|
172
173
|
placeholder?: string;
|
|
173
|
-
/**
|
|
174
|
-
|
|
174
|
+
/**
|
|
175
|
+
* Default value pre-filled into the field. Enums use this to pick
|
|
176
|
+
* their initial value. Integer inputs accept either a `number` or its
|
|
177
|
+
* decimal string representation.
|
|
178
|
+
*/
|
|
179
|
+
default?: string | number;
|
|
175
180
|
/** Allowed values — required when `type` is `"enum"`. */
|
|
176
181
|
values?: readonly string[];
|
|
177
182
|
}
|
|
178
183
|
|
|
184
|
+
/**
|
|
185
|
+
* Map a {@link WorkflowInputType} to the runtime value type observed in
|
|
186
|
+
* `ctx.inputs`. Integer inputs are parsed to `number` at the executor
|
|
187
|
+
* boundary; everything else stays a `string`.
|
|
188
|
+
*/
|
|
189
|
+
export type WorkflowInputValue<T extends WorkflowInputType> =
|
|
190
|
+
T extends "integer" ? number : string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Compute the typed `ctx.inputs` shape from a workflow's declared input
|
|
194
|
+
* schema. Each declared field becomes an optional key whose value type
|
|
195
|
+
* is determined by {@link WorkflowInputValue}.
|
|
196
|
+
*
|
|
197
|
+
* Free-form workflows (no declared schema) fall back to a loose
|
|
198
|
+
* string-keyed record so authors can still read `ctx.inputs.prompt`.
|
|
199
|
+
*/
|
|
200
|
+
export type InputsOf<I extends readonly WorkflowInput[]> =
|
|
201
|
+
// Non-literal schema (default `I = readonly WorkflowInput[]`) or empty
|
|
202
|
+
// tuple — no type-level info about individual fields, so fall back to a
|
|
203
|
+
// loose string record that preserves the prior free-form behaviour.
|
|
204
|
+
WorkflowInput extends I[number]
|
|
205
|
+
? Record<string, string | undefined>
|
|
206
|
+
: I[number] extends never
|
|
207
|
+
? Record<string, string | undefined>
|
|
208
|
+
: {
|
|
209
|
+
[K in I[number]["name"]]?: WorkflowInputValue<
|
|
210
|
+
Extract<I[number], { name: K }>["type"]
|
|
211
|
+
>;
|
|
212
|
+
};
|
|
213
|
+
|
|
179
214
|
// ─── Core types ─────────────────────────────────────────────────────────────
|
|
180
215
|
|
|
181
216
|
/**
|
|
@@ -252,7 +287,10 @@ export interface SessionRunOptions {
|
|
|
252
287
|
* Created by `ctx.stage(opts, clientOpts, sessionOpts, fn)` — the callback
|
|
253
288
|
* receives this as its argument with pre-initialized `client` and `session`.
|
|
254
289
|
*/
|
|
255
|
-
export interface SessionContext<
|
|
290
|
+
export interface SessionContext<
|
|
291
|
+
A extends AgentType = AgentType,
|
|
292
|
+
I extends readonly WorkflowInput[] = readonly WorkflowInput[],
|
|
293
|
+
> {
|
|
256
294
|
/** Provider-specific SDK client (auto-created by runtime) */
|
|
257
295
|
client: ProviderClient<A>;
|
|
258
296
|
/** Provider-specific session (auto-created by runtime) */
|
|
@@ -263,10 +301,11 @@ export interface SessionContext<A extends AgentType = AgentType, N extends strin
|
|
|
263
301
|
*
|
|
264
302
|
* When the workflow declares an `inputs` schema, only the declared
|
|
265
303
|
* field names are valid keys — accessing undeclared fields is a
|
|
266
|
-
* compile-time error.
|
|
267
|
-
*
|
|
304
|
+
* compile-time error. Each field's value type is determined by its
|
|
305
|
+
* declared `type` (integer inputs surface as `number`). Free-form
|
|
306
|
+
* workflows (no declared schema) allow any key.
|
|
268
307
|
*/
|
|
269
|
-
inputs:
|
|
308
|
+
inputs: InputsOf<I>;
|
|
270
309
|
/** Which agent is running */
|
|
271
310
|
agent: A;
|
|
272
311
|
/**
|
|
@@ -299,7 +338,7 @@ export interface SessionContext<A extends AgentType = AgentType, N extends strin
|
|
|
299
338
|
options: SessionRunOptions,
|
|
300
339
|
clientOpts: StageClientOptions<A>,
|
|
301
340
|
sessionOpts: StageSessionOptions<A>,
|
|
302
|
-
run: (ctx: SessionContext<A,
|
|
341
|
+
run: (ctx: SessionContext<A, I>) => Promise<T>,
|
|
303
342
|
): Promise<SessionHandle<T>>;
|
|
304
343
|
}
|
|
305
344
|
|
|
@@ -307,17 +346,21 @@ export interface SessionContext<A extends AgentType = AgentType, N extends strin
|
|
|
307
346
|
* Top-level context provided to the workflow's `.run()` callback.
|
|
308
347
|
* Does not have session-specific fields (paneId, save, etc.).
|
|
309
348
|
*/
|
|
310
|
-
export interface WorkflowContext<
|
|
349
|
+
export interface WorkflowContext<
|
|
350
|
+
A extends AgentType = AgentType,
|
|
351
|
+
I extends readonly WorkflowInput[] = readonly WorkflowInput[],
|
|
352
|
+
> {
|
|
311
353
|
/**
|
|
312
354
|
* Structured inputs for this workflow run. Populated from CLI flags
|
|
313
355
|
* (`--<name>=<value>`) or the interactive picker.
|
|
314
356
|
*
|
|
315
357
|
* When the workflow declares an `inputs` schema, only the declared
|
|
316
358
|
* field names are valid keys — accessing undeclared fields is a
|
|
317
|
-
* compile-time error.
|
|
318
|
-
*
|
|
359
|
+
* compile-time error. Each field's value type is determined by its
|
|
360
|
+
* declared `type` (integer inputs surface as `number`). Free-form
|
|
361
|
+
* workflows (no declared schema) allow any key.
|
|
319
362
|
*/
|
|
320
|
-
inputs:
|
|
363
|
+
inputs: InputsOf<I>;
|
|
321
364
|
/** Which agent is running */
|
|
322
365
|
agent: A;
|
|
323
366
|
/**
|
|
@@ -330,7 +373,7 @@ export interface WorkflowContext<A extends AgentType = AgentType, N extends stri
|
|
|
330
373
|
options: SessionRunOptions,
|
|
331
374
|
clientOpts: StageClientOptions<A>,
|
|
332
375
|
sessionOpts: StageSessionOptions<A>,
|
|
333
|
-
run: (ctx: SessionContext<A,
|
|
376
|
+
run: (ctx: SessionContext<A, I>) => Promise<T>,
|
|
334
377
|
): Promise<SessionHandle<T>>;
|
|
335
378
|
/**
|
|
336
379
|
* Get a completed session's transcript as rendered text.
|
|
@@ -385,7 +428,10 @@ export interface WorkflowOptions<
|
|
|
385
428
|
/**
|
|
386
429
|
* A compiled workflow definition — the sealed output of defineWorkflow().compile().
|
|
387
430
|
*/
|
|
388
|
-
export interface WorkflowDefinition<
|
|
431
|
+
export interface WorkflowDefinition<
|
|
432
|
+
A extends AgentType = AgentType,
|
|
433
|
+
I extends readonly WorkflowInput[] = readonly WorkflowInput[],
|
|
434
|
+
> {
|
|
389
435
|
readonly __brand: "WorkflowDefinition";
|
|
390
436
|
readonly name: string;
|
|
391
437
|
readonly description: string;
|
|
@@ -397,5 +443,5 @@ export interface WorkflowDefinition<A extends AgentType = AgentType, N extends s
|
|
|
397
443
|
*/
|
|
398
444
|
readonly minSDKVersion: string | null;
|
|
399
445
|
/** The workflow's entry point. Called by the executor with a WorkflowContext. */
|
|
400
|
-
readonly run: (ctx: WorkflowContext<A,
|
|
446
|
+
readonly run: (ctx: WorkflowContext<A, I>) => Promise<void>;
|
|
401
447
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Each sub-agent invocation spawns its own visible session in the graph,
|
|
5
5
|
* so users can see each iteration's progress in real time. The loop
|
|
6
6
|
* terminates when:
|
|
7
|
-
* -
|
|
7
|
+
* - `max_loops` iterations have completed (defaults to {@link DEFAULT_MAX_LOOPS}), OR
|
|
8
8
|
* - Two parallel reviewer passes both return zero findings.
|
|
9
9
|
*
|
|
10
10
|
* The reviewer stages run the `reviewer` sub-agent in a visible TUI via the
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
import { hasActionableFindings } from "../helpers/review.ts";
|
|
35
35
|
import { captureBranchChangeset } from "../helpers/git.ts";
|
|
36
36
|
|
|
37
|
-
const
|
|
37
|
+
const DEFAULT_MAX_LOOPS = 10;
|
|
38
38
|
|
|
39
39
|
// The orchestrator stage implements the actual code changes and can run for
|
|
40
40
|
// a very long time on large tasks. Completion is detected via session file
|
|
@@ -62,14 +62,21 @@ export default defineWorkflow({
|
|
|
62
62
|
required: true,
|
|
63
63
|
description: "task prompt",
|
|
64
64
|
},
|
|
65
|
+
{
|
|
66
|
+
name: "max_loops",
|
|
67
|
+
type: "integer",
|
|
68
|
+
description: "maximum number of plan/orchestrate/review iterations",
|
|
69
|
+
default: DEFAULT_MAX_LOOPS,
|
|
70
|
+
},
|
|
65
71
|
],
|
|
66
72
|
})
|
|
67
73
|
.for<"claude">()
|
|
68
74
|
.run(async (ctx) => {
|
|
69
75
|
const prompt = ctx.inputs.prompt ?? "";
|
|
76
|
+
const maxLoops = ctx.inputs.max_loops ?? DEFAULT_MAX_LOOPS;
|
|
70
77
|
let debuggerReport = "";
|
|
71
78
|
|
|
72
|
-
for (let iteration = 1; iteration <=
|
|
79
|
+
for (let iteration = 1; iteration <= maxLoops; iteration++) {
|
|
73
80
|
// ── Plan ────────────────────────────────────────────────────────────
|
|
74
81
|
await ctx.stage(
|
|
75
82
|
{ name: `planner-${iteration}` },
|
|
@@ -217,7 +224,7 @@ export default defineWorkflow({
|
|
|
217
224
|
if (!hasActionableFindings(parsed, reviewRaw)) break;
|
|
218
225
|
|
|
219
226
|
// ── Debug (only if another iteration is allowed) ────────────────────
|
|
220
|
-
if (iteration <
|
|
227
|
+
if (iteration < maxLoops) {
|
|
221
228
|
const debugger_ = await ctx.stage(
|
|
222
229
|
{ name: `debugger-${iteration}` },
|
|
223
230
|
{
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Each sub-agent invocation spawns its own visible session in the graph,
|
|
5
5
|
* so users can see each iteration's progress in real time. The loop
|
|
6
6
|
* terminates when:
|
|
7
|
-
* -
|
|
7
|
+
* - `max_loops` iterations have completed (defaults to {@link DEFAULT_MAX_LOOPS}), OR
|
|
8
8
|
* - Two parallel reviewer passes both return zero findings.
|
|
9
9
|
*
|
|
10
10
|
* The reviewer stages use a `submit_review` custom tool (defined via
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
import { hasActionableFindings } from "../helpers/review.ts";
|
|
36
36
|
import { captureBranchChangeset } from "../helpers/git.ts";
|
|
37
37
|
|
|
38
|
-
const
|
|
38
|
+
const DEFAULT_MAX_LOOPS = 10;
|
|
39
39
|
|
|
40
40
|
const SUBMIT_REVIEW_DESCRIPTION =
|
|
41
41
|
"Submit the structured code review result. You MUST call this tool " +
|
|
@@ -85,14 +85,21 @@ export default defineWorkflow({
|
|
|
85
85
|
required: true,
|
|
86
86
|
description: "task prompt",
|
|
87
87
|
},
|
|
88
|
+
{
|
|
89
|
+
name: "max_loops",
|
|
90
|
+
type: "integer",
|
|
91
|
+
description: "maximum number of plan/orchestrate/review iterations",
|
|
92
|
+
default: DEFAULT_MAX_LOOPS,
|
|
93
|
+
},
|
|
88
94
|
],
|
|
89
95
|
})
|
|
90
96
|
.for<"copilot">()
|
|
91
97
|
.run(async (ctx) => {
|
|
92
98
|
const userPromptText = ctx.inputs.prompt ?? "";
|
|
99
|
+
const maxLoops = ctx.inputs.max_loops ?? DEFAULT_MAX_LOOPS;
|
|
93
100
|
let debuggerReport = "";
|
|
94
101
|
|
|
95
|
-
for (let iteration = 1; iteration <=
|
|
102
|
+
for (let iteration = 1; iteration <= maxLoops; iteration++) {
|
|
96
103
|
// ── Plan ──────────────────────────────────────────────────────────
|
|
97
104
|
const planner = await ctx.stage(
|
|
98
105
|
{ name: `planner-${iteration}` },
|
|
@@ -247,7 +254,7 @@ export default defineWorkflow({
|
|
|
247
254
|
if (!hasActionableFindings(parsed, reviewRaw)) break;
|
|
248
255
|
|
|
249
256
|
// ── Debug (only if another iteration is allowed) ──────────────────
|
|
250
|
-
if (iteration <
|
|
257
|
+
if (iteration < maxLoops) {
|
|
251
258
|
const debugger_ = await ctx.stage(
|
|
252
259
|
{ name: `debugger-${iteration}` },
|
|
253
260
|
{},
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Each sub-agent invocation spawns its own visible session in the graph,
|
|
5
5
|
* so users can see each iteration's progress in real time. The loop
|
|
6
6
|
* terminates when:
|
|
7
|
-
* -
|
|
7
|
+
* - `max_loops` iterations have completed (defaults to {@link DEFAULT_MAX_LOOPS}), OR
|
|
8
8
|
* - Two parallel reviewer passes both return zero findings.
|
|
9
9
|
*
|
|
10
10
|
* The reviewer stages use the OpenCode SDK's structured output
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
import { hasActionableFindings } from "../helpers/review.ts";
|
|
33
33
|
import { captureBranchChangeset } from "../helpers/git.ts";
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const DEFAULT_MAX_LOOPS = 10;
|
|
36
36
|
|
|
37
37
|
/** Concatenate the text-typed parts of an OpenCode response. */
|
|
38
38
|
function extractResponseText(
|
|
@@ -71,14 +71,21 @@ export default defineWorkflow({
|
|
|
71
71
|
"Plan → orchestrate → review → debug loop with bounded iteration",
|
|
72
72
|
inputs: [
|
|
73
73
|
{ name: "prompt", type: "text", required: true, description: "task prompt" },
|
|
74
|
+
{
|
|
75
|
+
name: "max_loops",
|
|
76
|
+
type: "integer",
|
|
77
|
+
description: "maximum number of plan/orchestrate/review iterations",
|
|
78
|
+
default: DEFAULT_MAX_LOOPS,
|
|
79
|
+
},
|
|
74
80
|
],
|
|
75
81
|
})
|
|
76
82
|
.for<"opencode">()
|
|
77
83
|
.run(async (ctx) => {
|
|
78
84
|
const prompt = ctx.inputs.prompt ?? "";
|
|
85
|
+
const maxLoops = ctx.inputs.max_loops ?? DEFAULT_MAX_LOOPS;
|
|
79
86
|
let debuggerReport = "";
|
|
80
87
|
|
|
81
|
-
for (let iteration = 1; iteration <=
|
|
88
|
+
for (let iteration = 1; iteration <= maxLoops; iteration++) {
|
|
82
89
|
// ── Plan ────────────────────────────────────────────────────────────
|
|
83
90
|
const planner = await ctx.stage(
|
|
84
91
|
{ name: `planner-${iteration}` },
|
|
@@ -225,7 +232,7 @@ export default defineWorkflow({
|
|
|
225
232
|
if (!hasActionableFindings(parsed, reviewRaw)) break;
|
|
226
233
|
|
|
227
234
|
// ── Debug (only if another iteration is allowed) ────────────────────
|
|
228
|
-
if (iteration <
|
|
235
|
+
if (iteration < maxLoops) {
|
|
229
236
|
const debugger_ = await ctx.stage(
|
|
230
237
|
{ name: `debugger-${iteration}` },
|
|
231
238
|
{},
|