@bastani/atomic 0.8.23 → 0.8.24-alpha.1
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/CHANGELOG.md +15 -0
- package/dist/builtin/intercom/CHANGELOG.md +7 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/CHANGELOG.md +7 -0
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +22 -0
- package/dist/builtin/subagents/README.md +16 -0
- package/dist/builtin/subagents/agents/code-simplifier.md +2 -3
- package/dist/builtin/subagents/agents/codebase-analyzer.md +2 -3
- package/dist/builtin/subagents/agents/codebase-locator.md +2 -3
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +2 -3
- package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -3
- package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -3
- package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -3
- package/dist/builtin/subagents/agents/debugger.md +2 -3
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/subagent/SKILL.md +6 -0
- package/dist/builtin/subagents/src/agents/agent-serializer.ts +3 -0
- package/dist/builtin/subagents/src/agents/agents.ts +20 -1
- package/dist/builtin/subagents/src/runs/background/async-execution.ts +1 -1
- package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +3 -1
- package/dist/builtin/subagents/src/runs/foreground/chain-clarify.ts +7 -7
- package/dist/builtin/subagents/src/runs/foreground/execution.ts +5 -1
- package/dist/builtin/subagents/src/runs/shared/model-fallback.ts +9 -10
- package/dist/builtin/subagents/src/shared/types.ts +1 -0
- package/dist/builtin/web-access/CHANGELOG.md +7 -0
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +25 -0
- package/dist/builtin/workflows/README.md +38 -41
- package/dist/builtin/workflows/builtin/deep-research-codebase.d.ts +35 -0
- package/dist/builtin/workflows/builtin/deep-research-codebase.ts +11 -14
- package/dist/builtin/workflows/builtin/goal.d.ts +46 -0
- package/dist/builtin/workflows/builtin/goal.ts +10 -12
- package/dist/builtin/workflows/builtin/index.d.ts +136 -0
- package/dist/builtin/workflows/builtin/open-claude-design.d.ts +44 -0
- package/dist/builtin/workflows/builtin/open-claude-design.ts +19 -20
- package/dist/builtin/workflows/builtin/ralph.d.ts +36 -0
- package/dist/builtin/workflows/builtin/ralph.ts +20 -24
- package/dist/builtin/workflows/package.json +15 -5
- package/dist/builtin/workflows/src/authoring.ts +410 -0
- package/dist/builtin/workflows/src/extension/workflow-module-loader.ts +6 -12
- package/dist/builtin/workflows/src/extension/workflow-schema.ts +3 -2
- package/dist/builtin/workflows/src/index.ts +0 -5
- package/dist/builtin/workflows/src/runs/foreground/executor.ts +23 -9
- package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +33 -5
- package/dist/builtin/workflows/src/runs/shared/model-fallback.ts +61 -10
- package/dist/builtin/workflows/src/sdk-surface.ts +12 -2
- package/dist/builtin/workflows/src/shared/authoring-contract.ts +660 -0
- package/dist/builtin/workflows/src/shared/render-inputs-schema.ts +1 -1
- package/dist/builtin/workflows/src/shared/types.ts +65 -350
- package/dist/builtin/workflows/src/workflows/define-workflow.ts +59 -44
- package/dist/core/atomic-guide-command.d.ts.map +1 -1
- package/dist/core/atomic-guide-command.js +1 -1
- package/dist/core/atomic-guide-command.js.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.d.ts +1 -0
- package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/chat-message-renderer.js +13 -1
- package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +1 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +23 -16
- package/dist/utils/changelog.js.map +1 -1
- package/docs/extensions.md +2 -2
- package/docs/packages.md +8 -4
- package/docs/subagents.md +30 -0
- package/docs/workflows.md +39 -21
- package/package.json +1 -1
- package/dist/builtin/workflows/src/runs/shared/workflow-runner.ts +0 -335
|
@@ -432,50 +432,46 @@ async function runRalphWorkflow(
|
|
|
432
432
|
let iterationsCompleted = 0;
|
|
433
433
|
|
|
434
434
|
const plannerModelConfig = {
|
|
435
|
-
model: "openai/gpt-5.5",
|
|
435
|
+
model: "openai/gpt-5.5:xhigh",
|
|
436
436
|
fallbackModels: [
|
|
437
|
-
"openai-codex/gpt-5.5",
|
|
438
|
-
"github-copilot/gpt-5.5",
|
|
439
|
-
"anthropic/claude-opus-4-8",
|
|
440
|
-
"github-copilot/claude-opus-4.
|
|
437
|
+
"openai-codex/gpt-5.5:xhigh",
|
|
438
|
+
"github-copilot/gpt-5.5:xhigh",
|
|
439
|
+
"anthropic/claude-opus-4-8:xhigh",
|
|
440
|
+
"github-copilot/claude-opus-4.8:medium",
|
|
441
441
|
],
|
|
442
|
-
thinkingLevel: "high" as const,
|
|
443
442
|
excludedTools: ["ask_user_question"],
|
|
444
443
|
};
|
|
445
444
|
|
|
446
445
|
const orchestratorModelConfig = {
|
|
447
|
-
model: "openai/gpt-5.5",
|
|
446
|
+
model: "openai/gpt-5.5:medium",
|
|
448
447
|
fallbackModels: [
|
|
449
|
-
"openai-codex/gpt-5.5",
|
|
450
|
-
"github-copilot/gpt-5.5",
|
|
451
|
-
"anthropic/claude-sonnet-4-6",
|
|
452
|
-
"github-copilot/claude-sonnet-4.6",
|
|
448
|
+
"openai-codex/gpt-5.5:medium",
|
|
449
|
+
"github-copilot/gpt-5.5:medium",
|
|
450
|
+
"anthropic/claude-sonnet-4-6:medium",
|
|
451
|
+
"github-copilot/claude-sonnet-4.6:medium",
|
|
453
452
|
],
|
|
454
|
-
thinkingLevel: "medium" as const,
|
|
455
453
|
excludedTools: ["ask_user_question"],
|
|
456
454
|
};
|
|
457
455
|
|
|
458
456
|
const simplifierModelConfig = {
|
|
459
|
-
model: "openai/gpt-5.5",
|
|
457
|
+
model: "openai/gpt-5.5:medium",
|
|
460
458
|
fallbackModels: [
|
|
461
|
-
"openai-codex/gpt-5.5",
|
|
462
|
-
"github-copilot/gpt-5.5",
|
|
463
|
-
"anthropic/claude-sonnet-4-6",
|
|
464
|
-
"github-copilot/claude-sonnet-4.6",
|
|
459
|
+
"openai-codex/gpt-5.5:medium",
|
|
460
|
+
"github-copilot/gpt-5.5:medium",
|
|
461
|
+
"anthropic/claude-sonnet-4-6:medium",
|
|
462
|
+
"github-copilot/claude-sonnet-4.6:medium",
|
|
465
463
|
],
|
|
466
|
-
thinkingLevel: "medium" as const,
|
|
467
464
|
excludedTools: ["ask_user_question"],
|
|
468
465
|
};
|
|
469
466
|
|
|
470
467
|
const reviewerModelConfig = {
|
|
471
|
-
model: "openai/gpt-5.5",
|
|
468
|
+
model: "openai/gpt-5.5:xhigh",
|
|
472
469
|
fallbackModels: [
|
|
473
|
-
"openai-codex/gpt-5.5",
|
|
474
|
-
"github-copilot/gpt-5.5",
|
|
475
|
-
"anthropic/claude-opus-4-8",
|
|
476
|
-
"github-copilot/claude-opus-4.
|
|
470
|
+
"openai-codex/gpt-5.5:xhigh",
|
|
471
|
+
"github-copilot/gpt-5.5:xhigh",
|
|
472
|
+
"anthropic/claude-opus-4-8:xhigh",
|
|
473
|
+
"github-copilot/claude-opus-4.8:medium",
|
|
477
474
|
],
|
|
478
|
-
thinkingLevel: "high" as const,
|
|
479
475
|
excludedTools: ["ask_user_question"],
|
|
480
476
|
customTools: [reviewDecisionTool],
|
|
481
477
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/workflows",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.24-alpha.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for multi-stage workflow authoring and execution.",
|
|
6
6
|
"contributors": [
|
|
@@ -13,11 +13,20 @@
|
|
|
13
13
|
"bun": ">=1.3.14"
|
|
14
14
|
},
|
|
15
15
|
"main": "./src/index.ts",
|
|
16
|
-
"types": "./src/
|
|
16
|
+
"types": "./src/authoring.ts",
|
|
17
17
|
"exports": {
|
|
18
|
-
".":
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./src/authoring.ts",
|
|
20
|
+
"default": "./src/index.ts"
|
|
21
|
+
},
|
|
22
|
+
"./builtin": {
|
|
23
|
+
"types": "./builtin/index.d.ts",
|
|
24
|
+
"default": "./builtin/index.ts"
|
|
25
|
+
},
|
|
26
|
+
"./builtin/*": {
|
|
27
|
+
"types": "./builtin/*.d.ts",
|
|
28
|
+
"default": "./builtin/*.ts"
|
|
29
|
+
}
|
|
21
30
|
},
|
|
22
31
|
"repository": {
|
|
23
32
|
"type": "git",
|
|
@@ -39,6 +48,7 @@
|
|
|
39
48
|
"files": [
|
|
40
49
|
"src/**/*.ts",
|
|
41
50
|
"builtin/**/*.ts",
|
|
51
|
+
"builtin/**/*.d.ts",
|
|
42
52
|
"skills/**/*",
|
|
43
53
|
"prompts/**/*",
|
|
44
54
|
"themes/*.json",
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Type-only package authoring surface for standalone workflow packages.
|
|
3
|
+
*
|
|
4
|
+
* package.json points the root "types" condition here so authors can import
|
|
5
|
+
* defineWorkflow and Type without pulling the Atomic runtime/extension graph into
|
|
6
|
+
* their TypeScript program. Runtime loading still uses src/index.ts.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type {
|
|
10
|
+
TAny,
|
|
11
|
+
TArray,
|
|
12
|
+
TArrayOptions,
|
|
13
|
+
TBigInt,
|
|
14
|
+
TBoolean,
|
|
15
|
+
TEnum,
|
|
16
|
+
TEnumValue,
|
|
17
|
+
TInteger,
|
|
18
|
+
TIntersect,
|
|
19
|
+
TIntersectOptions,
|
|
20
|
+
TLiteral,
|
|
21
|
+
TLiteralValue,
|
|
22
|
+
TNever,
|
|
23
|
+
TNull,
|
|
24
|
+
TNumber,
|
|
25
|
+
TNumberOptions,
|
|
26
|
+
TOmit,
|
|
27
|
+
TObject,
|
|
28
|
+
TObjectOptions,
|
|
29
|
+
TPartial,
|
|
30
|
+
TPick,
|
|
31
|
+
TRecordAction,
|
|
32
|
+
TRequired,
|
|
33
|
+
TSchema,
|
|
34
|
+
TSchemaOptions,
|
|
35
|
+
TString,
|
|
36
|
+
TStringOptions,
|
|
37
|
+
TTuple,
|
|
38
|
+
TTupleOptions,
|
|
39
|
+
TUndefined,
|
|
40
|
+
TUnion,
|
|
41
|
+
TUnknown,
|
|
42
|
+
TVoid,
|
|
43
|
+
Type as TypeboxType,
|
|
44
|
+
TKeysToIndexer,
|
|
45
|
+
} from "typebox";
|
|
46
|
+
|
|
47
|
+
type PreserveOptions<T extends TSchema, O extends TSchemaOptions> = T & O;
|
|
48
|
+
type TypeScriptEnumLike = Record<string, string | number>;
|
|
49
|
+
type TypeScriptEnumValues<T extends TypeScriptEnumLike> = Extract<T[keyof T], TEnumValue>[];
|
|
50
|
+
|
|
51
|
+
export declare const Type: Omit<
|
|
52
|
+
typeof TypeboxType,
|
|
53
|
+
| "Any"
|
|
54
|
+
| "Array"
|
|
55
|
+
| "BigInt"
|
|
56
|
+
| "Boolean"
|
|
57
|
+
| "Enum"
|
|
58
|
+
| "Integer"
|
|
59
|
+
| "Intersect"
|
|
60
|
+
| "Literal"
|
|
61
|
+
| "Never"
|
|
62
|
+
| "Null"
|
|
63
|
+
| "Number"
|
|
64
|
+
| "Omit"
|
|
65
|
+
| "Partial"
|
|
66
|
+
| "Pick"
|
|
67
|
+
| "Object"
|
|
68
|
+
| "Record"
|
|
69
|
+
| "Required"
|
|
70
|
+
| "String"
|
|
71
|
+
| "Tuple"
|
|
72
|
+
| "Undefined"
|
|
73
|
+
| "Union"
|
|
74
|
+
| "Unknown"
|
|
75
|
+
| "Void"
|
|
76
|
+
> & {
|
|
77
|
+
Any<const O extends TSchemaOptions>(options: O): PreserveOptions<TAny, O>;
|
|
78
|
+
Any(): TAny;
|
|
79
|
+
Array<Type extends TSchema, const O extends TArrayOptions>(items: Type, options: O): PreserveOptions<TArray<Type>, O>;
|
|
80
|
+
Array<Type extends TSchema>(items: Type): TArray<Type>;
|
|
81
|
+
BigInt<const O extends TSchemaOptions>(options: O): PreserveOptions<TBigInt, O>;
|
|
82
|
+
BigInt(): TBigInt;
|
|
83
|
+
Boolean<const O extends TSchemaOptions>(options: O): PreserveOptions<TBoolean, O>;
|
|
84
|
+
Boolean(): TBoolean;
|
|
85
|
+
Enum<Values extends TEnumValue[], const O extends TSchemaOptions>(values: readonly [...Values], options: O): PreserveOptions<TEnum<Values>, O>;
|
|
86
|
+
Enum<Values extends TEnumValue[]>(values: readonly [...Values]): TEnum<Values>;
|
|
87
|
+
Enum<Enum extends TypeScriptEnumLike, const O extends TSchemaOptions>(value: Enum, options: O): PreserveOptions<TEnum<TypeScriptEnumValues<Enum>>, O>;
|
|
88
|
+
Enum<Enum extends TypeScriptEnumLike>(value: Enum): TEnum<TypeScriptEnumValues<Enum>>;
|
|
89
|
+
Integer<const O extends TNumberOptions>(options: O): PreserveOptions<TInteger, O>;
|
|
90
|
+
Integer(): TInteger;
|
|
91
|
+
Intersect<Types extends TSchema[], const O extends TIntersectOptions>(types: [...Types], options: O): PreserveOptions<TIntersect<Types>, O>;
|
|
92
|
+
Intersect<Types extends TSchema[]>(types: [...Types]): TIntersect<Types>;
|
|
93
|
+
Literal<const Value extends TLiteralValue, const O extends TSchemaOptions>(value: Value, options: O): PreserveOptions<TLiteral<Value>, O>;
|
|
94
|
+
Literal<const Value extends TLiteralValue>(value: Value): TLiteral<Value>;
|
|
95
|
+
Never<const O extends TSchemaOptions>(options: O): PreserveOptions<TNever, O>;
|
|
96
|
+
Never(): TNever;
|
|
97
|
+
Null<const O extends TSchemaOptions>(options: O): PreserveOptions<TNull, O>;
|
|
98
|
+
Null(): TNull;
|
|
99
|
+
Number<const O extends TNumberOptions>(options: O): PreserveOptions<TNumber, O>;
|
|
100
|
+
Number(): TNumber;
|
|
101
|
+
Omit<Type extends TSchema, Indexer extends PropertyKey[], const O extends TSchemaOptions>(type: Type, indexer: readonly [...Indexer], options: O): PreserveOptions<TOmit<Type, TKeysToIndexer<Indexer>>, O>;
|
|
102
|
+
Omit<Type extends TSchema, Indexer extends PropertyKey[]>(type: Type, indexer: readonly [...Indexer]): TOmit<Type, TKeysToIndexer<Indexer>>;
|
|
103
|
+
Omit<Type extends TSchema, Indexer extends TSchema, const O extends TSchemaOptions>(type: Type, indexer: Indexer, options: O): PreserveOptions<TOmit<Type, Indexer>, O>;
|
|
104
|
+
Omit<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer): TOmit<Type, Indexer>;
|
|
105
|
+
Partial<Type extends TSchema, const O extends TSchemaOptions>(type: Type, options: O): PreserveOptions<TPartial<Type>, O>;
|
|
106
|
+
Partial<Type extends TSchema>(type: Type): TPartial<Type>;
|
|
107
|
+
Pick<Type extends TSchema, Indexer extends PropertyKey[], const O extends TSchemaOptions>(type: Type, indexer: readonly [...Indexer], options: O): PreserveOptions<TPick<Type, TKeysToIndexer<Indexer>>, O>;
|
|
108
|
+
Pick<Type extends TSchema, Indexer extends PropertyKey[]>(type: Type, indexer: readonly [...Indexer]): TPick<Type, TKeysToIndexer<Indexer>>;
|
|
109
|
+
Pick<Type extends TSchema, Indexer extends TSchema, const O extends TSchemaOptions>(type: Type, indexer: Indexer, options: O): PreserveOptions<TPick<Type, Indexer>, O>;
|
|
110
|
+
Pick<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer): TPick<Type, Indexer>;
|
|
111
|
+
Object<Properties extends Record<PropertyKey, TSchema>, const O extends TObjectOptions>(properties: Properties, options: O): PreserveOptions<TObject<Properties>, O>;
|
|
112
|
+
Object<Properties extends Record<PropertyKey, TSchema>>(properties: Properties): TObject<Properties>;
|
|
113
|
+
Record<Key extends TSchema, Value extends TSchema, const O extends TObjectOptions>(key: Key, value: Value, options: O): PreserveOptions<TRecordAction<Key, Value>, O>;
|
|
114
|
+
Record<Key extends TSchema, Value extends TSchema>(key: Key, value: Value): TRecordAction<Key, Value>;
|
|
115
|
+
Required<Type extends TSchema, const O extends TSchemaOptions>(type: Type, options: O): PreserveOptions<TRequired<Type>, O>;
|
|
116
|
+
Required<Type extends TSchema>(type: Type): TRequired<Type>;
|
|
117
|
+
String<const O extends TStringOptions>(options: O): PreserveOptions<TString, O>;
|
|
118
|
+
String(): TString;
|
|
119
|
+
Tuple<Types extends TSchema[], const O extends TTupleOptions>(types: [...Types], options: O): PreserveOptions<TTuple<Types>, O>;
|
|
120
|
+
Tuple<Types extends TSchema[]>(types: [...Types]): TTuple<Types>;
|
|
121
|
+
Undefined<const O extends TSchemaOptions>(options: O): PreserveOptions<TUndefined, O>;
|
|
122
|
+
Undefined(): TUndefined;
|
|
123
|
+
Union<Types extends TSchema[], const O extends TSchemaOptions>(anyOf: [...Types], options: O): PreserveOptions<TUnion<Types>, O>;
|
|
124
|
+
Union<Types extends TSchema[]>(anyOf: [...Types]): TUnion<Types>;
|
|
125
|
+
Unknown<const O extends TSchemaOptions>(options: O): PreserveOptions<TUnknown, O>;
|
|
126
|
+
Unknown(): TUnknown;
|
|
127
|
+
Void<const O extends TSchemaOptions>(options: O): PreserveOptions<TVoid, O>;
|
|
128
|
+
Void(): TVoid;
|
|
129
|
+
};
|
|
130
|
+
export type { Static, TSchema } from "typebox";
|
|
131
|
+
|
|
132
|
+
export type {
|
|
133
|
+
AgentSessionAdapter,
|
|
134
|
+
CompleteAdapter,
|
|
135
|
+
CompleteStageOpts,
|
|
136
|
+
GitWorktreeSetupOptions,
|
|
137
|
+
GitWorktreeSetupResult,
|
|
138
|
+
PromptAdapter,
|
|
139
|
+
PromptOptions,
|
|
140
|
+
ResolvedInputs,
|
|
141
|
+
RunResult,
|
|
142
|
+
RunStatus,
|
|
143
|
+
StageAdapters,
|
|
144
|
+
StageStatus,
|
|
145
|
+
StageOptions,
|
|
146
|
+
StageContext,
|
|
147
|
+
StageSnapshot,
|
|
148
|
+
StageExecutionMeta,
|
|
149
|
+
StageMcpOptions,
|
|
150
|
+
StageOutputOptions,
|
|
151
|
+
StagePromptOptions,
|
|
152
|
+
StageSessionCreateOptions,
|
|
153
|
+
StageSessionCreateResult,
|
|
154
|
+
StageSessionRuntime,
|
|
155
|
+
WorkflowAction,
|
|
156
|
+
WorkflowArtifact,
|
|
157
|
+
WorkflowChainOptions,
|
|
158
|
+
WorkflowChainStep,
|
|
159
|
+
WorkflowChildResult,
|
|
160
|
+
WorkflowContextMode,
|
|
161
|
+
WorkflowControlEvent,
|
|
162
|
+
WorkflowCustomToolDefinition,
|
|
163
|
+
WorkflowDetails,
|
|
164
|
+
WorkflowDetailsMode,
|
|
165
|
+
WorkflowDetailsStatus,
|
|
166
|
+
WorkflowDirectOptions,
|
|
167
|
+
WorkflowDirectTaskItem,
|
|
168
|
+
WorkflowExecutionMode,
|
|
169
|
+
WorkflowExecutionPolicy,
|
|
170
|
+
WorkflowInputBindings,
|
|
171
|
+
WorkflowInputSchema,
|
|
172
|
+
WorkflowInputSchemaMap,
|
|
173
|
+
WorkflowInputValues,
|
|
174
|
+
WorkflowIntercomSummary,
|
|
175
|
+
WorkflowMaxOutput,
|
|
176
|
+
WorkflowMcpPort,
|
|
177
|
+
WorkflowModelAttempt,
|
|
178
|
+
WorkflowModelCatalogPort,
|
|
179
|
+
WorkflowModelFallbackFields,
|
|
180
|
+
WorkflowModelInfo,
|
|
181
|
+
WorkflowModelUsage,
|
|
182
|
+
WorkflowModelValue,
|
|
183
|
+
WorkflowOutputMode,
|
|
184
|
+
WorkflowOutputSchema,
|
|
185
|
+
WorkflowOutputSchemaMap,
|
|
186
|
+
WorkflowOutputValues,
|
|
187
|
+
WorkflowParallelChainStep,
|
|
188
|
+
WorkflowParallelOptions,
|
|
189
|
+
WorkflowPersistencePort,
|
|
190
|
+
WorkflowProgressSummary,
|
|
191
|
+
WorkflowRunChildOptions,
|
|
192
|
+
WorkflowRunOutput,
|
|
193
|
+
WorkflowRuntimeConfig,
|
|
194
|
+
WorkflowSerializableObject,
|
|
195
|
+
WorkflowSerializablePrimitive,
|
|
196
|
+
WorkflowSerializableValue,
|
|
197
|
+
WorkflowSharedTaskDefaults,
|
|
198
|
+
WorkflowTaskContext,
|
|
199
|
+
WorkflowTaskContextInput,
|
|
200
|
+
WorkflowTaskOptions,
|
|
201
|
+
WorkflowTaskResult,
|
|
202
|
+
WorkflowTaskSessionFields,
|
|
203
|
+
WorkflowTaskSessionOptions,
|
|
204
|
+
WorkflowTaskStep,
|
|
205
|
+
WorkflowThinkingLevel,
|
|
206
|
+
WorkflowUIAdapter,
|
|
207
|
+
WorkflowUIContext,
|
|
208
|
+
WorkflowWorktreeInputBinding,
|
|
209
|
+
} from "./shared/authoring-contract.js";
|
|
210
|
+
|
|
211
|
+
import type * as AuthoringContract from "./shared/authoring-contract.js";
|
|
212
|
+
|
|
213
|
+
import type {
|
|
214
|
+
GitWorktreeSetupOptions,
|
|
215
|
+
GitWorktreeSetupResult,
|
|
216
|
+
ResolvedInputs,
|
|
217
|
+
RunResult,
|
|
218
|
+
RunStatus,
|
|
219
|
+
StageSnapshot,
|
|
220
|
+
WorkflowDefinition as WorkflowContractDefinition,
|
|
221
|
+
WorkflowDetails,
|
|
222
|
+
WorkflowDirectOptions,
|
|
223
|
+
WorkflowDirectTaskItem,
|
|
224
|
+
WorkflowExecutionPolicy,
|
|
225
|
+
WorkflowInputValues,
|
|
226
|
+
WorkflowOutputValues,
|
|
227
|
+
WorkflowSerializableObject,
|
|
228
|
+
WorkflowChainStep,
|
|
229
|
+
} from "./shared/authoring-contract.js";
|
|
230
|
+
|
|
231
|
+
// Type-only nominal brand for standalone package typings. Runtime discovery uses
|
|
232
|
+
// the package-internal WeakSet in define-workflow.ts rather than a symbol field.
|
|
233
|
+
declare const workflowDefinitionBrand: unique symbol;
|
|
234
|
+
type WorkflowDefinitionBrand = { readonly [workflowDefinitionBrand]: true };
|
|
235
|
+
|
|
236
|
+
export interface WorkflowDefinition<
|
|
237
|
+
TInputs extends WorkflowInputValues = WorkflowInputValues,
|
|
238
|
+
TOutputs extends WorkflowOutputValues = WorkflowOutputValues,
|
|
239
|
+
TRunInputs extends WorkflowInputValues = TInputs,
|
|
240
|
+
TDefinitionBrand extends object = WorkflowDefinitionBrand,
|
|
241
|
+
> extends WorkflowContractDefinition<TInputs, TOutputs, TRunInputs, TDefinitionBrand>, WorkflowDefinitionBrand {}
|
|
242
|
+
|
|
243
|
+
export type WorkflowRunContext<TInputs extends WorkflowInputValues = WorkflowInputValues> = AuthoringContract.WorkflowRunContext<TInputs, WorkflowDefinitionBrand>;
|
|
244
|
+
export type WorkflowRunFn<
|
|
245
|
+
TInputs extends WorkflowInputValues = WorkflowInputValues,
|
|
246
|
+
TOutputs extends WorkflowOutputValues = WorkflowOutputValues,
|
|
247
|
+
> = AuthoringContract.WorkflowRunFn<TInputs, TOutputs, WorkflowDefinitionBrand>;
|
|
248
|
+
|
|
249
|
+
export type AnyWorkflowDefinition = WorkflowDefinition<WorkflowInputValues, WorkflowOutputValues, WorkflowInputValues>;
|
|
250
|
+
|
|
251
|
+
export type WorkflowBuilder<
|
|
252
|
+
TInputs extends WorkflowInputValues = {},
|
|
253
|
+
TOutputs extends WorkflowOutputValues = {},
|
|
254
|
+
TRunInputs extends WorkflowInputValues = TInputs,
|
|
255
|
+
> = AuthoringContract.WorkflowBuilder<TInputs, TOutputs, TRunInputs, WorkflowDefinitionBrand, WorkflowDefinition<TInputs, TOutputs, TRunInputs>>;
|
|
256
|
+
|
|
257
|
+
export type CompletedWorkflowBuilder<
|
|
258
|
+
TInputs extends WorkflowInputValues = {},
|
|
259
|
+
TOutputs extends WorkflowOutputValues = {},
|
|
260
|
+
TRunInputs extends WorkflowInputValues = TInputs,
|
|
261
|
+
> = AuthoringContract.CompletedWorkflowBuilder<TInputs, TOutputs, TRunInputs, WorkflowDefinitionBrand, WorkflowDefinition<TInputs, TOutputs, TRunInputs>>;
|
|
262
|
+
|
|
263
|
+
export type RunContinuationOpts = AuthoringContract.RunContinuationOpts;
|
|
264
|
+
export type WorkflowParentRunLink = AuthoringContract.WorkflowParentRunLink;
|
|
265
|
+
export type RunOpts = Omit<AuthoringContract.RunOpts, "registry"> & { readonly registry?: WorkflowRegistry };
|
|
266
|
+
|
|
267
|
+
export declare const INTERACTIVE_WORKFLOW_POLICY: WorkflowExecutionPolicy;
|
|
268
|
+
export declare const NON_INTERACTIVE_WORKFLOW_POLICY: WorkflowExecutionPolicy;
|
|
269
|
+
export declare function run<TInputs extends WorkflowInputValues, TOutputs extends WorkflowOutputValues, TRunInputs extends WorkflowInputValues = TInputs>(
|
|
270
|
+
definition: WorkflowDefinition<TInputs, TOutputs, TRunInputs>,
|
|
271
|
+
inputs: Readonly<NoInfer<TRunInputs>>,
|
|
272
|
+
opts?: RunOpts,
|
|
273
|
+
): Promise<RunResult<TOutputs>>;
|
|
274
|
+
export declare function runTask(task: WorkflowDirectTaskItem, runOptions?: RunOpts): Promise<WorkflowDetails>;
|
|
275
|
+
export declare function runTask(task: WorkflowDirectTaskItem, options?: WorkflowDirectOptions, runOptions?: RunOpts): Promise<WorkflowDetails>;
|
|
276
|
+
export declare function runParallel(tasks: readonly WorkflowDirectTaskItem[], options?: WorkflowDirectOptions, runOptions?: RunOpts): Promise<WorkflowDetails>;
|
|
277
|
+
export declare function runChain(steps: readonly WorkflowChainStep[], options?: WorkflowDirectOptions, runOptions?: RunOpts): Promise<WorkflowDetails>;
|
|
278
|
+
export declare function resolveInputs<TInputs extends WorkflowInputValues>(
|
|
279
|
+
schema: Readonly<Record<keyof TInputs & string, TSchema>>,
|
|
280
|
+
provided: Partial<TInputs>,
|
|
281
|
+
): ResolvedInputs<TInputs>;
|
|
282
|
+
export declare function setupGitWorktree(options: GitWorktreeSetupOptions): GitWorktreeSetupResult;
|
|
283
|
+
|
|
284
|
+
export interface WorkflowRegistry {
|
|
285
|
+
register<TInputs extends WorkflowInputValues, TOutputs extends WorkflowOutputValues>(
|
|
286
|
+
definition: WorkflowDefinition<TInputs, TOutputs>,
|
|
287
|
+
): WorkflowRegistry;
|
|
288
|
+
merge(other: WorkflowRegistry): WorkflowRegistry;
|
|
289
|
+
get(name: string): AnyWorkflowDefinition | undefined;
|
|
290
|
+
has(name: string): boolean;
|
|
291
|
+
remove(name: string): WorkflowRegistry;
|
|
292
|
+
names(): string[];
|
|
293
|
+
all(): AnyWorkflowDefinition[];
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* @deprecated Removed imperative workflow API. This runtime value only throws
|
|
298
|
+
* a migration error; author workflows with defineWorkflow(...).compile().
|
|
299
|
+
*/
|
|
300
|
+
export declare const runWorkflow: never;
|
|
301
|
+
export declare function defineWorkflow(name: string): WorkflowBuilder;
|
|
302
|
+
export declare function createRegistry<TDefinitions extends readonly AnyWorkflowDefinition[] = readonly AnyWorkflowDefinition[]>(
|
|
303
|
+
initial?: TDefinitions,
|
|
304
|
+
): WorkflowRegistry;
|
|
305
|
+
export declare function normalizeWorkflowName(name: string): string;
|
|
306
|
+
export declare function workflowNamesEqual(a: string, b: string): boolean;
|
|
307
|
+
|
|
308
|
+
export declare class GraphFrontierTracker {
|
|
309
|
+
onSpawn(stageId: string, stageName: string): string[];
|
|
310
|
+
currentParents(): string[];
|
|
311
|
+
replaceParents(stageId: string, parentIds: readonly string[]): void;
|
|
312
|
+
onSettle(stageId: string): void;
|
|
313
|
+
getNodes(): StageNode[];
|
|
314
|
+
getParents(stageId: string): string[];
|
|
315
|
+
reset(): void;
|
|
316
|
+
}
|
|
317
|
+
export interface StageNode extends WorkflowSerializableObject {
|
|
318
|
+
readonly id: string;
|
|
319
|
+
readonly name: string;
|
|
320
|
+
readonly parentIds: readonly string[];
|
|
321
|
+
}
|
|
322
|
+
export type NoticeLevel = "info" | "warning" | "error";
|
|
323
|
+
export type PromptKind = "input" | "confirm" | "select" | "editor";
|
|
324
|
+
|
|
325
|
+
export interface PendingPrompt extends WorkflowSerializableObject {
|
|
326
|
+
readonly id: string;
|
|
327
|
+
readonly kind: PromptKind;
|
|
328
|
+
readonly message: string;
|
|
329
|
+
readonly choices?: readonly string[];
|
|
330
|
+
readonly initial?: string;
|
|
331
|
+
readonly createdAt: number;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface ToolEvent {
|
|
335
|
+
readonly name: string;
|
|
336
|
+
readonly input?: Record<string, unknown>;
|
|
337
|
+
readonly output?: string;
|
|
338
|
+
readonly startedAt?: number;
|
|
339
|
+
readonly endedAt?: number;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export interface WorkflowNotice extends WorkflowSerializableObject {
|
|
343
|
+
readonly id: string;
|
|
344
|
+
readonly runId?: string;
|
|
345
|
+
readonly stageId?: string;
|
|
346
|
+
readonly level: NoticeLevel;
|
|
347
|
+
readonly message: string;
|
|
348
|
+
readonly createdAt: number;
|
|
349
|
+
readonly requiresAck?: boolean;
|
|
350
|
+
readonly ackedAt?: number;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export interface WorkflowOverlayAdapter {
|
|
354
|
+
show(notice: WorkflowNotice): void;
|
|
355
|
+
hide(): void;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export interface RunSnapshot {
|
|
359
|
+
readonly id: string;
|
|
360
|
+
readonly name: string;
|
|
361
|
+
readonly status: RunStatus;
|
|
362
|
+
readonly stages: readonly StageSnapshot[];
|
|
363
|
+
readonly startedAt: number;
|
|
364
|
+
readonly endedAt?: number;
|
|
365
|
+
readonly durationMs?: number;
|
|
366
|
+
readonly result?: WorkflowOutputValues;
|
|
367
|
+
readonly error?: string;
|
|
368
|
+
readonly pendingPrompt?: PendingPrompt;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export interface StoreSnapshot {
|
|
372
|
+
readonly runs: readonly RunSnapshot[];
|
|
373
|
+
readonly notices: readonly WorkflowNotice[];
|
|
374
|
+
readonly version: number;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export interface Store {
|
|
378
|
+
runs(): readonly RunSnapshot[];
|
|
379
|
+
notices(): readonly WorkflowNotice[];
|
|
380
|
+
activeRunId(): string | null;
|
|
381
|
+
recordRunStart(run: RunSnapshot): void;
|
|
382
|
+
recordStageStart(runId: string, stage: StageSnapshot): void;
|
|
383
|
+
recordToolStart(runId: string, stageId: string, evt: ToolEvent): void;
|
|
384
|
+
recordToolEnd(runId: string, stageId: string, evt: ToolEvent): void;
|
|
385
|
+
recordStageEnd(runId: string, stage: StageSnapshot): void;
|
|
386
|
+
recordRunEnd(runId: string, status: RunStatus, result?: WorkflowOutputValues, error?: string): boolean;
|
|
387
|
+
removeRun(runId: string): boolean;
|
|
388
|
+
recordNotice(notice: WorkflowNotice): void;
|
|
389
|
+
ackNotice(id: string): boolean;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export declare function createStore(): Store;
|
|
393
|
+
export declare const store: Store;
|
|
394
|
+
|
|
395
|
+
export interface ActiveRunEntry {
|
|
396
|
+
readonly controller: AbortController;
|
|
397
|
+
readonly children: readonly AbortController[];
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export interface CancellationRegistry {
|
|
401
|
+
register(runId: string, controller: AbortController): void;
|
|
402
|
+
registerChild(runId: string, controller: AbortController): void;
|
|
403
|
+
abort(runId: string, reason?: unknown): boolean;
|
|
404
|
+
abortAll(reason?: unknown): number;
|
|
405
|
+
unregister(runId: string): void;
|
|
406
|
+
isAborted(runId: string): boolean;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export declare function createCancellationRegistry(): CancellationRegistry;
|
|
410
|
+
export declare const cancellationRegistry: CancellationRegistry;
|
|
@@ -8,26 +8,17 @@
|
|
|
8
8
|
|
|
9
9
|
import { createJiti } from "jiti/static";
|
|
10
10
|
import * as workflowsSdkSurface from "../sdk-surface.js";
|
|
11
|
+
import { isBrandedWorkflowDefinition } from "../workflows/define-workflow.js";
|
|
11
12
|
import deepResearchCodebase from "../../builtin/deep-research-codebase.js";
|
|
12
13
|
import goal from "../../builtin/goal.js";
|
|
13
14
|
import openClaudeDesign from "../../builtin/open-claude-design.js";
|
|
14
15
|
import ralph from "../../builtin/ralph.js";
|
|
15
16
|
|
|
16
|
-
type RunWorkflowFunction = typeof import("../runs/shared/workflow-runner.js").runWorkflow;
|
|
17
|
-
|
|
18
|
-
const runWorkflow: RunWorkflowFunction = async (...args) => {
|
|
19
|
-
const { runWorkflow: actualRunWorkflow } = await import("../runs/shared/workflow-runner.js");
|
|
20
|
-
return actualRunWorkflow(...args);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
17
|
const WORKFLOWS_MODULE_SPECIFIER = "@bastani/workflows";
|
|
24
18
|
const WORKFLOWS_BUILTIN_MODULE_SPECIFIER = `${WORKFLOWS_MODULE_SPECIFIER}/builtin`;
|
|
25
|
-
// Keep this in sync with index.ts through sdk-surface.ts.
|
|
26
|
-
// a lazy wrapper because the public re-export comes from workflow-runner.ts,
|
|
27
|
-
// which imports discovery.ts and would otherwise reintroduce a cycle.
|
|
19
|
+
// Keep this in sync with index.ts through sdk-surface.ts.
|
|
28
20
|
const WORKFLOWS_SDK_MODULE: Record<string, unknown> = {
|
|
29
21
|
...workflowsSdkSurface,
|
|
30
|
-
runWorkflow,
|
|
31
22
|
};
|
|
32
23
|
const WORKFLOWS_BUILTIN_MODULE: Record<string, unknown> = {
|
|
33
24
|
deepResearchCodebase,
|
|
@@ -104,7 +95,10 @@ export function validateWorkflowDefinitionShape(value: unknown): string | null {
|
|
|
104
95
|
const d = value as Record<string, unknown>;
|
|
105
96
|
|
|
106
97
|
if (d["__piWorkflow"] !== true) {
|
|
107
|
-
return "missing or incorrect __piWorkflow sentinel (expected true)";
|
|
98
|
+
return "missing or incorrect __piWorkflow sentinel (expected true); export a workflow from defineWorkflow(...).compile()";
|
|
99
|
+
}
|
|
100
|
+
if (!isBrandedWorkflowDefinition(value)) {
|
|
101
|
+
return "workflow definition is not produced by defineWorkflow(...).compile(); hand-rolled __piWorkflow objects are not supported";
|
|
108
102
|
}
|
|
109
103
|
if (typeof d["name"] !== "string" || (d["name"] as string).trim().length === 0) {
|
|
110
104
|
return "name must be a non-empty string";
|
|
@@ -42,7 +42,7 @@ const StageSessionOptionProperties = {
|
|
|
42
42
|
agentDir: Type.Optional(Type.String()),
|
|
43
43
|
authStorage: Type.Optional(SdkSessionOptionSchema("authStorage")),
|
|
44
44
|
modelRegistry: Type.Optional(SdkSessionOptionSchema("modelRegistry")),
|
|
45
|
-
model: Type.Optional(Type.Unsafe<WorkflowModelValue>({})),
|
|
45
|
+
model: Type.Optional(Type.Unsafe<WorkflowModelValue>({ description: "Primary model id or SDK model object. String ids may include a reasoning suffix, e.g. openai/gpt-5:high; valid levels: off|minimal|low|medium|high|xhigh." })),
|
|
46
46
|
thinkingLevel: Type.Optional(SdkSessionOptionSchema("thinkingLevel")),
|
|
47
47
|
scopedModels: Type.Optional(Type.Array(SdkSessionOptionArrayElementSchema("scopedModels"))),
|
|
48
48
|
noTools: Type.Optional(Type.Unsafe<NonNullable<CreateAgentSessionOptions["noTools"]>>({
|
|
@@ -54,7 +54,8 @@ const StageSessionOptionProperties = {
|
|
|
54
54
|
sessionManager: Type.Optional(SdkSessionOptionSchema("sessionManager")),
|
|
55
55
|
settingsManager: Type.Optional(SdkSessionOptionSchema("settingsManager")),
|
|
56
56
|
sessionStartEvent: Type.Optional(SdkSessionOptionSchema("sessionStartEvent")),
|
|
57
|
-
fallbackModels: Type.Optional(Type.Array(Type.String())),
|
|
57
|
+
fallbackModels: Type.Optional(Type.Array(Type.String({ description: "Fallback model id; may include a reasoning suffix like :low or :off." }))),
|
|
58
|
+
fallbackThinkingLevels: Type.Optional(Type.Array(Type.String({ description: "Deprecated compatibility helper aligned to fallbackModels; ignored when the fallback model has a :level suffix." }))),
|
|
58
59
|
mcp: Type.Optional(McpOptionsSchema),
|
|
59
60
|
sessionDir: Type.Optional(Type.String()),
|
|
60
61
|
context: Type.Optional(Type.Union([Type.Literal("fresh"), Type.Literal("fork")])),
|
|
@@ -7,9 +7,4 @@
|
|
|
7
7
|
// virtual SDK used by workflow discovery stays in lockstep with this entry.
|
|
8
8
|
export * from "./sdk-surface.js";
|
|
9
9
|
|
|
10
|
-
// runWorkflow is exported here only: workflow-runner imports discovery.ts, so
|
|
11
|
-
// discovery provides a lazy wrapper instead of importing this entry eagerly.
|
|
12
|
-
export { runWorkflow } from "./runs/shared/workflow-runner.js";
|
|
13
|
-
export type { WorkflowOptions, WorkflowRunOptions } from "./runs/shared/workflow-runner.js";
|
|
14
|
-
|
|
15
10
|
// Note: `Type` / `Static` / `TSchema` are re-exported via ./sdk-surface.js.
|