@bratsos/workflow-engine 0.0.11 → 0.2.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/README.md +270 -513
- package/dist/chunk-D7RVRRM2.js +3 -0
- package/dist/chunk-D7RVRRM2.js.map +1 -0
- package/dist/chunk-HL3OJG7W.js +1033 -0
- package/dist/chunk-HL3OJG7W.js.map +1 -0
- package/dist/chunk-MUWP5SF2.js +33 -0
- package/dist/chunk-MUWP5SF2.js.map +1 -0
- package/dist/chunk-NYKMT46J.js +1143 -0
- package/dist/chunk-NYKMT46J.js.map +1 -0
- package/dist/chunk-P4KMGCT3.js +2292 -0
- package/dist/chunk-P4KMGCT3.js.map +1 -0
- package/dist/chunk-SPXBCZLB.js +17 -0
- package/dist/chunk-SPXBCZLB.js.map +1 -0
- package/dist/cli/sync-models.d.ts +1 -0
- package/dist/cli/sync-models.js +210 -0
- package/dist/cli/sync-models.js.map +1 -0
- package/dist/client-D4PoxADF.d.ts +798 -0
- package/dist/client.d.ts +5 -0
- package/dist/client.js +4 -0
- package/dist/client.js.map +1 -0
- package/dist/index-DAzCfO1R.d.ts +217 -0
- package/dist/index.d.ts +569 -0
- package/dist/index.js +399 -0
- package/dist/index.js.map +1 -0
- package/dist/interface-MMqhfQQK.d.ts +411 -0
- package/dist/kernel/index.d.ts +26 -0
- package/dist/kernel/index.js +3 -0
- package/dist/kernel/index.js.map +1 -0
- package/dist/kernel/testing/index.d.ts +44 -0
- package/dist/kernel/testing/index.js +85 -0
- package/dist/kernel/testing/index.js.map +1 -0
- package/dist/persistence/index.d.ts +2 -0
- package/dist/persistence/index.js +6 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/prisma/index.d.ts +37 -0
- package/dist/persistence/prisma/index.js +5 -0
- package/dist/persistence/prisma/index.js.map +1 -0
- package/dist/plugins-BCnDUwIc.d.ts +415 -0
- package/dist/ports-tU3rzPXJ.d.ts +245 -0
- package/dist/stage-BPw7m9Wx.d.ts +144 -0
- package/dist/testing/index.d.ts +264 -0
- package/dist/testing/index.js +920 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +11 -1
- package/skills/workflow-engine/SKILL.md +234 -348
- package/skills/workflow-engine/references/03-runtime-setup.md +111 -426
- package/skills/workflow-engine/references/05-persistence-setup.md +32 -0
- package/skills/workflow-engine/references/07-testing-patterns.md +141 -474
- package/skills/workflow-engine/references/08-common-patterns.md +118 -431
package/dist/index.js
ADDED
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { ModelKey } from './chunk-P4KMGCT3.js';
|
|
2
|
+
export { AVAILABLE_MODELS, AnthropicBatchProvider, DEFAULT_MODEL_KEY, GoogleBatchProvider, ModelKey, ModelStatsTracker, NoInputSchema, OpenAIBatchProvider, calculateCost, createAIHelper, defineAsyncBatchStage, defineStage, getBestProviderForModel, getDefaultModel, getModel, getModelById, getRegisteredModel, listModels, listRegisteredModels, modelSupportsBatch, printAvailableModels, registerModels, requireStageOutput, resolveModelForProvider } from './chunk-P4KMGCT3.js';
|
|
3
|
+
import './chunk-D7RVRRM2.js';
|
|
4
|
+
export { PrismaAICallLogger, PrismaJobQueue, PrismaWorkflowPersistence, createPrismaAICallLogger, createPrismaJobQueue, createPrismaWorkflowPersistence } from './chunk-NYKMT46J.js';
|
|
5
|
+
import './chunk-MUWP5SF2.js';
|
|
6
|
+
export { StaleVersionError } from './chunk-SPXBCZLB.js';
|
|
7
|
+
export { IdempotencyInProgressError, createKernel, createPluginRunner, definePlugin } from './chunk-HL3OJG7W.js';
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
|
|
10
|
+
var Workflow = class {
|
|
11
|
+
constructor(id, name, description, inputSchema, outputSchema, stages, contextType) {
|
|
12
|
+
this.id = id;
|
|
13
|
+
this.name = name;
|
|
14
|
+
this.description = description;
|
|
15
|
+
this.inputSchema = inputSchema;
|
|
16
|
+
this.outputSchema = outputSchema;
|
|
17
|
+
this.stages = stages;
|
|
18
|
+
this.contextType = contextType;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get execution plan as groups of stages
|
|
22
|
+
* Stages in the same group can be executed in parallel
|
|
23
|
+
*/
|
|
24
|
+
getExecutionPlan() {
|
|
25
|
+
const groups = /* @__PURE__ */ new Map();
|
|
26
|
+
for (const node of this.stages) {
|
|
27
|
+
const group = groups.get(node.executionGroup) || [];
|
|
28
|
+
group.push(node);
|
|
29
|
+
groups.set(node.executionGroup, group);
|
|
30
|
+
}
|
|
31
|
+
const sortedGroups = Array.from(groups.keys()).sort((a, b) => a - b);
|
|
32
|
+
return sortedGroups.map((groupNum) => {
|
|
33
|
+
const group = groups.get(groupNum);
|
|
34
|
+
if (!group) throw new Error(`Group ${groupNum} not found`);
|
|
35
|
+
return group;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get a specific stage by ID
|
|
40
|
+
*/
|
|
41
|
+
getStage(stageId) {
|
|
42
|
+
const node = this.stages.find((n) => n.stage.id === stageId);
|
|
43
|
+
return node?.stage;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get all stages in order
|
|
47
|
+
*/
|
|
48
|
+
getAllStages() {
|
|
49
|
+
return [...this.stages];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get a visual representation of the workflow execution order
|
|
53
|
+
*/
|
|
54
|
+
getExecutionOrder() {
|
|
55
|
+
const executionPlan = this.getExecutionPlan();
|
|
56
|
+
const lines = [];
|
|
57
|
+
lines.push(`Workflow: ${this.name} (${this.id})`);
|
|
58
|
+
lines.push(`Total stages: ${this.stages.length}`);
|
|
59
|
+
lines.push(`Execution groups: ${executionPlan.length}`);
|
|
60
|
+
lines.push("");
|
|
61
|
+
lines.push("Execution Order:");
|
|
62
|
+
lines.push("================");
|
|
63
|
+
for (let i = 0; i < executionPlan.length; i++) {
|
|
64
|
+
const group = executionPlan[i];
|
|
65
|
+
const groupNumber = i + 1;
|
|
66
|
+
if (group.length === 1) {
|
|
67
|
+
const stage = group[0].stage;
|
|
68
|
+
lines.push(`${groupNumber}. ${stage.name} (${stage.id})`);
|
|
69
|
+
if (stage.description) {
|
|
70
|
+
lines.push(` ${stage.description}`);
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
lines.push(`${groupNumber}. [PARALLEL]`);
|
|
74
|
+
for (const node of group) {
|
|
75
|
+
const stage = node.stage;
|
|
76
|
+
lines.push(` - ${stage.name} (${stage.id})`);
|
|
77
|
+
if (stage.description) {
|
|
78
|
+
lines.push(` ${stage.description}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
lines.push("");
|
|
83
|
+
}
|
|
84
|
+
return lines.join("\n");
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Get all stage IDs in execution order
|
|
88
|
+
*
|
|
89
|
+
* @returns Array of stage IDs
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```typescript
|
|
93
|
+
* const ids = workflow.getStageIds();
|
|
94
|
+
* // ["data-extraction", "guidelines", "generator"]
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
getStageIds() {
|
|
98
|
+
return this.stages.map((node) => node.stage.id);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Check if a stage ID exists in this workflow
|
|
102
|
+
*
|
|
103
|
+
* @param stageId - The stage ID to check
|
|
104
|
+
* @returns true if the stage exists
|
|
105
|
+
*/
|
|
106
|
+
hasStage(stageId) {
|
|
107
|
+
return this.stages.some((node) => node.stage.id === stageId);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Validate workflow configuration before execution
|
|
111
|
+
* Checks that all stage configs match their schemas
|
|
112
|
+
*
|
|
113
|
+
* @param config - Configuration object with keys matching stage IDs
|
|
114
|
+
* @returns Validation result with any errors
|
|
115
|
+
*/
|
|
116
|
+
validateConfig(config) {
|
|
117
|
+
const errors = [];
|
|
118
|
+
for (const node of this.stages) {
|
|
119
|
+
const stage = node.stage;
|
|
120
|
+
const stageConfig = config[stage.id] || {};
|
|
121
|
+
try {
|
|
122
|
+
stage.configSchema.parse(stageConfig);
|
|
123
|
+
} catch (error) {
|
|
124
|
+
if (error instanceof z.ZodError) {
|
|
125
|
+
const errorMessages = error.issues.map((e) => `${e.path.join(".")}: ${e.message}`).join("; ");
|
|
126
|
+
errors.push({
|
|
127
|
+
stageId: stage.id,
|
|
128
|
+
error: `Config validation failed: ${errorMessages}`
|
|
129
|
+
});
|
|
130
|
+
} else {
|
|
131
|
+
errors.push({
|
|
132
|
+
stageId: stage.id,
|
|
133
|
+
error: String(error)
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
valid: errors.length === 0,
|
|
140
|
+
errors
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Estimate total cost for the workflow
|
|
145
|
+
*/
|
|
146
|
+
estimateCost(input, config) {
|
|
147
|
+
let totalCost = 0;
|
|
148
|
+
const currentInput = input;
|
|
149
|
+
for (const node of this.stages) {
|
|
150
|
+
if (node.stage.estimateCost) {
|
|
151
|
+
const stageConfig = config[node.stage.id] || {};
|
|
152
|
+
totalCost += node.stage.estimateCost(currentInput, stageConfig);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return totalCost;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Get configuration schemas for all stages in this workflow
|
|
159
|
+
* Returns a map of stageId → { schema, defaults, name, description }
|
|
160
|
+
*/
|
|
161
|
+
getStageConfigs() {
|
|
162
|
+
const configs = {};
|
|
163
|
+
for (const node of this.stages) {
|
|
164
|
+
const stage = node.stage;
|
|
165
|
+
const defaults = {};
|
|
166
|
+
if (stage.configSchema instanceof z.ZodObject) {
|
|
167
|
+
const shape = stage.configSchema.shape;
|
|
168
|
+
for (const [key, fieldSchema] of Object.entries(shape)) {
|
|
169
|
+
let unwrapped = fieldSchema;
|
|
170
|
+
if (unwrapped instanceof z.ZodOptional) {
|
|
171
|
+
unwrapped = unwrapped._def.innerType;
|
|
172
|
+
}
|
|
173
|
+
if (unwrapped instanceof z.ZodDefault) {
|
|
174
|
+
const defaultValueFn = unwrapped._def.defaultValue;
|
|
175
|
+
defaults[key] = typeof defaultValueFn === "function" ? defaultValueFn() : defaultValueFn;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
configs[stage.id] = {
|
|
180
|
+
schema: stage.configSchema,
|
|
181
|
+
defaults,
|
|
182
|
+
name: stage.name,
|
|
183
|
+
description: stage.description
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return configs;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Generate default configuration object for all stages
|
|
190
|
+
* Automatically discovers all stage configs - add/remove stages and this updates automatically
|
|
191
|
+
*/
|
|
192
|
+
getDefaultConfig() {
|
|
193
|
+
const stageConfigs = this.getStageConfigs();
|
|
194
|
+
const config = {};
|
|
195
|
+
for (const [stageId, meta] of Object.entries(stageConfigs)) {
|
|
196
|
+
config[stageId] = meta.defaults;
|
|
197
|
+
}
|
|
198
|
+
return config;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Get all stages in a specific execution group
|
|
202
|
+
*/
|
|
203
|
+
getStagesInExecutionGroup(groupIndex) {
|
|
204
|
+
return this.stages.filter((node) => node.executionGroup === groupIndex).map((node) => node.stage);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Get the sequential index of a stage (0-based)
|
|
208
|
+
*/
|
|
209
|
+
getStageIndex(stageId) {
|
|
210
|
+
return this.stages.findIndex((node) => node.stage.id === stageId);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Get the execution group index for a stage
|
|
214
|
+
*/
|
|
215
|
+
getExecutionGroupIndex(stageId) {
|
|
216
|
+
const node = this.stages.find((node2) => node2.stage.id === stageId);
|
|
217
|
+
if (!node) throw new Error(`Stage ${stageId} not found in workflow`);
|
|
218
|
+
return node.executionGroup;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Get the ID of the stage immediately preceding the given stage
|
|
222
|
+
*/
|
|
223
|
+
getPreviousStageId(stageId) {
|
|
224
|
+
const index = this.getStageIndex(stageId);
|
|
225
|
+
if (index <= 0) return void 0;
|
|
226
|
+
return this.stages[index - 1].stage.id;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
var WorkflowBuilder = class {
|
|
230
|
+
constructor(id, name, description, inputSchema, currentOutputSchema) {
|
|
231
|
+
this.id = id;
|
|
232
|
+
this.name = name;
|
|
233
|
+
this.description = description;
|
|
234
|
+
this.inputSchema = inputSchema;
|
|
235
|
+
this.currentOutputSchema = currentOutputSchema;
|
|
236
|
+
}
|
|
237
|
+
stages = [];
|
|
238
|
+
currentExecutionGroup = 0;
|
|
239
|
+
/**
|
|
240
|
+
* Add a stage to the workflow (sequential execution)
|
|
241
|
+
*
|
|
242
|
+
* Automatically accumulates the stage's output in the context under its stage ID.
|
|
243
|
+
* This provides type-safe access to all previous stage outputs.
|
|
244
|
+
*
|
|
245
|
+
* Note: This accepts any stage regardless of strict input type matching.
|
|
246
|
+
* This is necessary because stages using passthrough() can accept objects
|
|
247
|
+
* with additional fields beyond what's declared in their input schema.
|
|
248
|
+
* Runtime validation via Zod ensures type safety at execution time.
|
|
249
|
+
*
|
|
250
|
+
* Validates that all declared dependencies exist in the workflow.
|
|
251
|
+
*/
|
|
252
|
+
pipe(stage) {
|
|
253
|
+
if (stage.dependencies) {
|
|
254
|
+
const existingStageIds = this.stages.map((s) => s.stage.id);
|
|
255
|
+
const missingDeps = stage.dependencies.filter(
|
|
256
|
+
(dep) => !existingStageIds.includes(dep)
|
|
257
|
+
);
|
|
258
|
+
if (missingDeps.length > 0) {
|
|
259
|
+
throw new Error(
|
|
260
|
+
`Stage "${stage.id}" has missing dependencies: ${missingDeps.join(", ")}. These stages must be added to the workflow before "${stage.id}". Current stages: ${existingStageIds.length === 0 ? "(none)" : existingStageIds.join(", ")}`
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
this.currentExecutionGroup++;
|
|
265
|
+
this.stages.push({
|
|
266
|
+
stage,
|
|
267
|
+
executionGroup: this.currentExecutionGroup
|
|
268
|
+
});
|
|
269
|
+
const builder = this;
|
|
270
|
+
builder.currentOutputSchema = stage.outputSchema;
|
|
271
|
+
return builder;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Add a stage with strict input type checking
|
|
275
|
+
*
|
|
276
|
+
* Note: pipeStrict() and pipeLoose() have been removed as they were
|
|
277
|
+
* just aliases for pipe(). Use pipe() for all stage chaining.
|
|
278
|
+
*/
|
|
279
|
+
/**
|
|
280
|
+
* Add multiple stages that execute in parallel
|
|
281
|
+
*
|
|
282
|
+
* All stages receive the same input (current output)
|
|
283
|
+
* Their outputs are merged into an object by index AND accumulated in context by stage ID.
|
|
284
|
+
*
|
|
285
|
+
* Note: This accepts stages regardless of strict input type matching.
|
|
286
|
+
* This is necessary because stages using passthrough() can accept objects
|
|
287
|
+
* with additional fields. Runtime validation via Zod ensures type safety.
|
|
288
|
+
*
|
|
289
|
+
* Validates that all declared dependencies exist in the workflow.
|
|
290
|
+
*/
|
|
291
|
+
parallel(stages) {
|
|
292
|
+
const existingStageIds = this.stages.map((s) => s.stage.id);
|
|
293
|
+
for (const stage of stages) {
|
|
294
|
+
if (stage.dependencies) {
|
|
295
|
+
const missingDeps = stage.dependencies.filter(
|
|
296
|
+
(dep) => !existingStageIds.includes(dep)
|
|
297
|
+
);
|
|
298
|
+
if (missingDeps.length > 0) {
|
|
299
|
+
throw new Error(
|
|
300
|
+
`Stage "${stage.id}" (in parallel group) has missing dependencies: ${missingDeps.join(
|
|
301
|
+
", "
|
|
302
|
+
)}. These stages must be added to the workflow before this parallel group. Current stages: ${existingStageIds.length === 0 ? "(none)" : existingStageIds.join(", ")}`
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
this.currentExecutionGroup++;
|
|
308
|
+
for (const stage of stages) {
|
|
309
|
+
this.stages.push({
|
|
310
|
+
stage,
|
|
311
|
+
executionGroup: this.currentExecutionGroup
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
const mergedSchema = z.object(
|
|
315
|
+
stages.reduce(
|
|
316
|
+
(acc, stage, index) => {
|
|
317
|
+
acc[index] = stage.outputSchema;
|
|
318
|
+
return acc;
|
|
319
|
+
},
|
|
320
|
+
{}
|
|
321
|
+
)
|
|
322
|
+
);
|
|
323
|
+
const builder = this;
|
|
324
|
+
builder.currentOutputSchema = mergedSchema;
|
|
325
|
+
return builder;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Build the final workflow
|
|
329
|
+
*/
|
|
330
|
+
build() {
|
|
331
|
+
return new Workflow(
|
|
332
|
+
this.id,
|
|
333
|
+
this.name,
|
|
334
|
+
this.description,
|
|
335
|
+
this.inputSchema,
|
|
336
|
+
this.currentOutputSchema,
|
|
337
|
+
this.stages
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Get current stage count
|
|
342
|
+
*/
|
|
343
|
+
getStageCount() {
|
|
344
|
+
return this.stages.length;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Get execution group count
|
|
348
|
+
*/
|
|
349
|
+
getExecutionGroupCount() {
|
|
350
|
+
return this.currentExecutionGroup;
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
var AIConfigSchema = z.object({
|
|
354
|
+
/** The model to use for AI operations */
|
|
355
|
+
model: ModelKey.default("gemini-2.5-flash"),
|
|
356
|
+
/** Temperature for AI generations (0-2) */
|
|
357
|
+
temperature: z.number().min(0).max(2).default(0.7),
|
|
358
|
+
/** Maximum tokens to generate (undefined = model default) */
|
|
359
|
+
maxTokens: z.number().positive().optional()
|
|
360
|
+
});
|
|
361
|
+
var ConcurrencyConfigSchema = z.object({
|
|
362
|
+
/** Maximum concurrent operations (for parallel processing) */
|
|
363
|
+
concurrency: z.number().positive().default(5),
|
|
364
|
+
/** Delay between operations in milliseconds (rate limiting) */
|
|
365
|
+
delayMs: z.number().nonnegative().default(0),
|
|
366
|
+
/** Maximum retries on failure */
|
|
367
|
+
maxRetries: z.number().nonnegative().default(3)
|
|
368
|
+
});
|
|
369
|
+
var FeatureFlagsConfigSchema = z.object({
|
|
370
|
+
/** Feature flags for conditional stage behavior */
|
|
371
|
+
featureFlags: z.record(z.string(), z.boolean()).default({})
|
|
372
|
+
});
|
|
373
|
+
var DebugConfigSchema = z.object({
|
|
374
|
+
/** Enable verbose logging */
|
|
375
|
+
verbose: z.boolean().default(false),
|
|
376
|
+
/** Dry run mode (no side effects) */
|
|
377
|
+
dryRun: z.boolean().default(false)
|
|
378
|
+
});
|
|
379
|
+
function withAIConfig(schema) {
|
|
380
|
+
return schema.merge(AIConfigSchema);
|
|
381
|
+
}
|
|
382
|
+
function withConcurrency(schema) {
|
|
383
|
+
return schema.merge(ConcurrencyConfigSchema);
|
|
384
|
+
}
|
|
385
|
+
function withFeatureFlags(schema) {
|
|
386
|
+
return schema.merge(FeatureFlagsConfigSchema);
|
|
387
|
+
}
|
|
388
|
+
function withStandardConfig(schema) {
|
|
389
|
+
return schema.merge(AIConfigSchema).merge(ConcurrencyConfigSchema).merge(FeatureFlagsConfigSchema);
|
|
390
|
+
}
|
|
391
|
+
z.object({});
|
|
392
|
+
z.object({
|
|
393
|
+
model: ModelKey.default("gemini-2.5-flash"),
|
|
394
|
+
temperature: z.number().min(0).max(2).default(0.7)
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
export { AIConfigSchema, ConcurrencyConfigSchema, DebugConfigSchema, FeatureFlagsConfigSchema, Workflow, WorkflowBuilder, withAIConfig, withConcurrency, withFeatureFlags, withStandardConfig };
|
|
398
|
+
//# sourceMappingURL=index.js.map
|
|
399
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AM,uBAAuB,CAAA,CAC7B,MAAM,wBAAwB,CAAA;AACnC;AAiDiCA,CAAAA,CAAE,MAAA,CAAO,EAAE;AAKPA,EAAE,MAAA,CAAO;AAAA,EAC5C,KAAA,EAAO,QAAA,CAAS,OAAA,CAAQ,kBAAkB,CAAA;AAAA,EAC1C,WAAA,EAAaA,CAAAA,CAAE,MAAA,EAAO,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,CAAA,CAAE,OAAA,CAAQ,GAAG;AACnD,CAAC","file":"index.js","sourcesContent":["/**\n * Workflow Builder - Fluent API for composing type-safe workflows\n *\n * Workflows are composed of stages that are executed sequentially or in parallel.\n * The builder ensures type safety: output of one stage matches input of next stage.\n *\n * ## Type System Features\n *\n * ### Automatic Context Inference\n * The workflow context type is automatically accumulated as you pipe stages.\n * Use `InferWorkflowContext<typeof workflow>` to extract the context type.\n *\n * ```typescript\n * const workflow = new WorkflowBuilder(...)\n * .pipe(stage1)\n * .pipe(stage2)\n * .build();\n *\n * // Auto-generated type\n * type MyContext = InferWorkflowContext<typeof workflow>;\n * // = { \"stage-1\": Stage1Output, \"stage-2\": Stage2Output }\n * ```\n *\n * ### Stage ID Constants\n * Use `workflow.stageIds` for type-safe stage ID references.\n */\n\nimport { z } from \"zod\";\nimport type { Stage } from \"./stage\";\n\n// ============================================================================\n// Stage Node - Represents a stage in the execution plan\n// ============================================================================\n\nexport interface StageNode {\n stage: Stage<any, any, any>;\n executionGroup: number; // For parallel execution grouping\n}\n\n// ============================================================================\n// Workflow - Complete workflow definition\n// ============================================================================\n\nexport class Workflow<\n TInput extends z.ZodTypeAny,\n TOutput extends z.ZodTypeAny,\n TContext extends Record<string, unknown> = {},\n> {\n constructor(\n public readonly id: string,\n public readonly name: string,\n public readonly description: string,\n public readonly inputSchema: TInput,\n public readonly outputSchema: TOutput,\n private readonly stages: StageNode[],\n public readonly contextType?: TContext, // Type-only, for inference\n ) {}\n\n /**\n * Get execution plan as groups of stages\n * Stages in the same group can be executed in parallel\n */\n getExecutionPlan(): StageNode[][] {\n const groups = new Map<number, StageNode[]>();\n\n for (const node of this.stages) {\n const group = groups.get(node.executionGroup) || [];\n group.push(node);\n groups.set(node.executionGroup, group);\n }\n\n // Return groups in order\n const sortedGroups = Array.from(groups.keys()).sort((a, b) => a - b);\n return sortedGroups.map((groupNum) => {\n const group = groups.get(groupNum);\n if (!group) throw new Error(`Group ${groupNum} not found`);\n return group;\n });\n }\n\n /**\n * Get a specific stage by ID\n */\n getStage(stageId: string): Stage<any, any, any> | undefined {\n const node = this.stages.find((n) => n.stage.id === stageId);\n return node?.stage;\n }\n\n /**\n * Get all stages in order\n */\n getAllStages(): StageNode[] {\n return [...this.stages];\n }\n\n /**\n * Get a visual representation of the workflow execution order\n */\n getExecutionOrder(): string {\n const executionPlan = this.getExecutionPlan();\n const lines: string[] = [];\n\n lines.push(`Workflow: ${this.name} (${this.id})`);\n lines.push(`Total stages: ${this.stages.length}`);\n lines.push(`Execution groups: ${executionPlan.length}`);\n lines.push(\"\");\n lines.push(\"Execution Order:\");\n lines.push(\"================\");\n\n for (let i = 0; i < executionPlan.length; i++) {\n const group = executionPlan[i];\n const groupNumber = i + 1;\n\n if (group.length === 1) {\n // Sequential stage\n const stage = group[0].stage;\n lines.push(`${groupNumber}. ${stage.name} (${stage.id})`);\n if (stage.description) {\n lines.push(` ${stage.description}`);\n }\n } else {\n // Parallel stages\n lines.push(`${groupNumber}. [PARALLEL]`);\n for (const node of group) {\n const stage = node.stage;\n lines.push(` - ${stage.name} (${stage.id})`);\n if (stage.description) {\n lines.push(` ${stage.description}`);\n }\n }\n }\n lines.push(\"\");\n }\n\n return lines.join(\"\\n\");\n }\n\n /**\n * Get all stage IDs in execution order\n *\n * @returns Array of stage IDs\n *\n * @example\n * ```typescript\n * const ids = workflow.getStageIds();\n * // [\"data-extraction\", \"guidelines\", \"generator\"]\n * ```\n */\n getStageIds(): string[] {\n return this.stages.map((node) => node.stage.id);\n }\n\n /**\n * Check if a stage ID exists in this workflow\n *\n * @param stageId - The stage ID to check\n * @returns true if the stage exists\n */\n hasStage(stageId: string): boolean {\n return this.stages.some((node) => node.stage.id === stageId);\n }\n\n /**\n * Validate workflow configuration before execution\n * Checks that all stage configs match their schemas\n *\n * @param config - Configuration object with keys matching stage IDs\n * @returns Validation result with any errors\n */\n validateConfig(config: Record<string, unknown>): {\n valid: boolean;\n errors: Array<{ stageId: string; error: string }>;\n } {\n const errors: Array<{ stageId: string; error: string }> = [];\n\n for (const node of this.stages) {\n const stage = node.stage;\n const stageConfig = config[stage.id] || {};\n\n try {\n stage.configSchema.parse(stageConfig);\n } catch (error) {\n if (error instanceof z.ZodError) {\n const errorMessages = error.issues\n .map((e: z.ZodIssue) => `${e.path.join(\".\")}: ${e.message}`)\n .join(\"; \");\n errors.push({\n stageId: stage.id,\n error: `Config validation failed: ${errorMessages}`,\n });\n } else {\n errors.push({\n stageId: stage.id,\n error: String(error),\n });\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n };\n }\n\n /**\n * Estimate total cost for the workflow\n */\n estimateCost(\n input: z.infer<TInput>,\n config: Record<string, unknown>,\n ): number {\n let totalCost = 0;\n const currentInput = input;\n\n for (const node of this.stages) {\n if (node.stage.estimateCost) {\n const stageConfig = config[node.stage.id] || {};\n totalCost += node.stage.estimateCost(currentInput, stageConfig);\n }\n // Note: We can't accurately propagate input for estimation without execution\n // This is a rough estimate only\n }\n\n return totalCost;\n }\n\n /**\n * Get configuration schemas for all stages in this workflow\n * Returns a map of stageId → { schema, defaults, name, description }\n */\n getStageConfigs(): Record<\n string,\n {\n schema: z.ZodTypeAny;\n defaults: Record<string, unknown>;\n name: string;\n description?: string;\n }\n > {\n const configs: Record<\n string,\n {\n schema: z.ZodTypeAny;\n defaults: Record<string, unknown>;\n name: string;\n description?: string;\n }\n > = {};\n\n for (const node of this.stages) {\n const stage = node.stage;\n\n // Extract defaults from schema\n const defaults: Record<string, unknown> = {};\n\n if (stage.configSchema instanceof z.ZodObject) {\n const shape = stage.configSchema.shape as Record<string, z.ZodTypeAny>;\n for (const [key, fieldSchema] of Object.entries(shape)) {\n let unwrapped = fieldSchema;\n\n // Unwrap ZodOptional if present\n if (unwrapped instanceof z.ZodOptional) {\n unwrapped = (unwrapped._def as any).innerType;\n }\n\n // Check for ZodDefault\n if (unwrapped instanceof z.ZodDefault) {\n const defaultValueFn = (unwrapped._def as any).defaultValue;\n defaults[key] =\n typeof defaultValueFn === \"function\"\n ? defaultValueFn()\n : defaultValueFn;\n }\n }\n }\n\n configs[stage.id] = {\n schema: stage.configSchema,\n defaults,\n name: stage.name,\n description: stage.description,\n };\n }\n\n return configs;\n }\n\n /**\n * Generate default configuration object for all stages\n * Automatically discovers all stage configs - add/remove stages and this updates automatically\n */\n getDefaultConfig(): Record<string, Record<string, unknown>> {\n const stageConfigs = this.getStageConfigs();\n const config: Record<string, Record<string, unknown>> = {};\n\n for (const [stageId, meta] of Object.entries(stageConfigs)) {\n config[stageId] = meta.defaults;\n }\n\n return config;\n }\n /**\n * Get all stages in a specific execution group\n */\n getStagesInExecutionGroup(groupIndex: number): Stage<any, any, any>[] {\n return this.stages\n .filter((node) => node.executionGroup === groupIndex)\n .map((node) => node.stage);\n }\n\n /**\n * Get the sequential index of a stage (0-based)\n */\n getStageIndex(stageId: string): number {\n return this.stages.findIndex((node) => node.stage.id === stageId);\n }\n\n /**\n * Get the execution group index for a stage\n */\n getExecutionGroupIndex(stageId: string): number {\n const node = this.stages.find((node) => node.stage.id === stageId);\n if (!node) throw new Error(`Stage ${stageId} not found in workflow`);\n return node.executionGroup;\n }\n\n /**\n * Get the ID of the stage immediately preceding the given stage\n */\n getPreviousStageId(stageId: string): string | undefined {\n const index = this.getStageIndex(stageId);\n if (index <= 0) return undefined;\n return this.stages[index - 1].stage.id;\n }\n}\n\n// ============================================================================\n// Workflow Builder - Fluent API with Context Accumulation\n// ============================================================================\n\nexport class WorkflowBuilder<\n TInput extends z.ZodTypeAny,\n TCurrentOutput extends z.ZodTypeAny,\n TContext extends Record<string, unknown> = {},\n> {\n private stages: StageNode[] = [];\n private currentExecutionGroup = 0;\n\n constructor(\n private id: string,\n private name: string,\n private description: string,\n private inputSchema: TInput,\n private currentOutputSchema: TCurrentOutput,\n ) {}\n\n /**\n * Add a stage to the workflow (sequential execution)\n *\n * Automatically accumulates the stage's output in the context under its stage ID.\n * This provides type-safe access to all previous stage outputs.\n *\n * Note: This accepts any stage regardless of strict input type matching.\n * This is necessary because stages using passthrough() can accept objects\n * with additional fields beyond what's declared in their input schema.\n * Runtime validation via Zod ensures type safety at execution time.\n *\n * Validates that all declared dependencies exist in the workflow.\n */\n pipe<\n TStageInput extends z.ZodTypeAny,\n TStageOutput extends z.ZodTypeAny,\n TStageConfig extends z.ZodTypeAny,\n TStageContext extends Record<string, unknown>,\n >(\n stage: Stage<TStageInput, TStageOutput, TStageConfig, TStageContext>,\n ): WorkflowBuilder<\n TInput,\n TStageOutput,\n TContext & { [x: string]: z.infer<TStageOutput> }\n > {\n // Validate stage dependencies\n if (stage.dependencies) {\n const existingStageIds = this.stages.map((s) => s.stage.id);\n const missingDeps = stage.dependencies.filter(\n (dep) => !existingStageIds.includes(dep),\n );\n\n if (missingDeps.length > 0) {\n throw new Error(\n `Stage \"${stage.id}\" has missing dependencies: ${missingDeps.join(\", \")}. ` +\n `These stages must be added to the workflow before \"${stage.id}\". ` +\n `Current stages: ${\n existingStageIds.length === 0\n ? \"(none)\"\n : existingStageIds.join(\", \")\n }`,\n );\n }\n }\n\n this.currentExecutionGroup++;\n\n this.stages.push({\n stage: stage as Stage<any, any, any, any>,\n executionGroup: this.currentExecutionGroup,\n });\n\n // Return builder with new output type and accumulated context\n const builder = this as unknown as WorkflowBuilder<\n TInput,\n TStageOutput,\n TContext & { [x: string]: z.infer<TStageOutput> }\n >;\n (builder as any).currentOutputSchema = stage.outputSchema;\n\n return builder;\n }\n\n /**\n * Add a stage with strict input type checking\n *\n * Note: pipeStrict() and pipeLoose() have been removed as they were\n * just aliases for pipe(). Use pipe() for all stage chaining.\n */\n\n /**\n * Add multiple stages that execute in parallel\n *\n * All stages receive the same input (current output)\n * Their outputs are merged into an object by index AND accumulated in context by stage ID.\n *\n * Note: This accepts stages regardless of strict input type matching.\n * This is necessary because stages using passthrough() can accept objects\n * with additional fields. Runtime validation via Zod ensures type safety.\n *\n * Validates that all declared dependencies exist in the workflow.\n */\n parallel<\n TStages extends {\n id: string;\n outputSchema: z.ZodTypeAny;\n dependencies?: string[];\n }[],\n >(\n stages: [...TStages],\n ): WorkflowBuilder<\n TInput,\n z.ZodTypeAny,\n TContext & {\n [K in TStages[number][\"id\"]]: TStages[number] extends {\n outputSchema: infer O;\n }\n ? O extends z.ZodTypeAny\n ? z.infer<O>\n : never\n : never;\n }\n > {\n // Validate dependencies for all parallel stages\n const existingStageIds = this.stages.map((s) => s.stage.id);\n\n for (const stage of stages) {\n if (stage.dependencies) {\n const missingDeps = stage.dependencies.filter(\n (dep) => !existingStageIds.includes(dep),\n );\n\n if (missingDeps.length > 0) {\n throw new Error(\n `Stage \"${stage.id}\" (in parallel group) has missing dependencies: ${missingDeps.join(\n \", \",\n )}. ` +\n `These stages must be added to the workflow before this parallel group. ` +\n `Current stages: ${\n existingStageIds.length === 0\n ? \"(none)\"\n : existingStageIds.join(\", \")\n }`,\n );\n }\n }\n }\n\n this.currentExecutionGroup++;\n\n // Add all stages to same execution group\n for (const stage of stages) {\n this.stages.push({\n stage: stage as Stage<any, any, any, any>,\n executionGroup: this.currentExecutionGroup,\n });\n }\n\n // Create merged output schema\n const mergedSchema = z.object(\n stages.reduce(\n (acc, stage, index) => {\n acc[index] = stage.outputSchema;\n return acc;\n },\n {} as Record<number, z.ZodTypeAny>,\n ),\n ) as any;\n\n const builder = this as unknown as WorkflowBuilder<\n TInput,\n any,\n TContext & {\n [K in TStages[number][\"id\"]]: TStages[number] extends Stage<\n any,\n infer O,\n any\n >\n ? z.infer<O>\n : never;\n }\n >;\n builder.currentOutputSchema = mergedSchema;\n\n return builder as any;\n }\n\n /**\n * Build the final workflow\n */\n build(): Workflow<TInput, TCurrentOutput, TContext> {\n return new Workflow(\n this.id,\n this.name,\n this.description,\n this.inputSchema,\n this.currentOutputSchema,\n this.stages,\n );\n }\n\n /**\n * Get current stage count\n */\n getStageCount(): number {\n return this.stages.length;\n }\n\n /**\n * Get execution group count\n */\n getExecutionGroupCount(): number {\n return this.currentExecutionGroup;\n }\n}\n\n// ============================================================================\n// Type Inference Utilities (Supplementary to Code Generator)\n// ============================================================================\n\n/**\n * NOTE: For most use cases, prefer using the generated types from `__generated__.ts`\n * which are created by running `pnpm generate:workflow-types`.\n *\n * These inference utilities are useful for:\n * - Quick prototyping before running the generator\n * - Dynamic workflows not covered by the generator\n * - Type assertions in tests\n */\n\n/**\n * Extract the workflow context type from a Workflow instance\n *\n * The workflow context type is automatically accumulated as stages are piped.\n * Each stage's output is added to the context under its stage ID.\n *\n * @example\n * ```typescript\n * const workflow = new WorkflowBuilder(...)\n * .pipe(dataExtractionStage) // id: \"data-extraction\"\n * .pipe(guidelinesStage) // id: \"guidelines\"\n * .build();\n *\n * // Extract context type automatically\n * type MyWorkflowContext = InferWorkflowContext<typeof workflow>;\n * // = {\n * // \"data-extraction\": DataExtractionOutput;\n * // \"guidelines\": GuidelinesOutput;\n * // }\n *\n * // Use in stage definitions\n * export const myStage = defineStage<\n * \"none\",\n * typeof OutputSchema,\n * typeof ConfigSchema,\n * MyWorkflowContext\n * >({ ... });\n * ```\n */\nexport type InferWorkflowContext<W> = W extends Workflow<any, any, infer C>\n ? C\n : never;\n\n/**\n * Extract the input type from a Workflow instance\n *\n * @example\n * ```typescript\n * type Input = InferWorkflowInput<typeof myWorkflow>;\n * ```\n */\nexport type InferWorkflowInput<W> = W extends Workflow<infer I, any, any>\n ? z.infer<I>\n : never;\n\n/**\n * Extract the output type from a Workflow instance\n *\n * @example\n * ```typescript\n * type Output = InferWorkflowOutput<typeof myWorkflow>;\n * ```\n */\nexport type InferWorkflowOutput<W> = W extends Workflow<any, infer O, any>\n ? z.infer<O>\n : never;\n\n/**\n * Extract stage IDs as a union type from a Workflow instance\n *\n * Useful for creating type-safe stage ID references.\n *\n * @example\n * ```typescript\n * type StageId = InferWorkflowStageIds<typeof myWorkflow>;\n * // = \"data-extraction\" | \"guidelines\" | \"generator\"\n *\n * function getStageOutput(stageId: StageId) { ... }\n * ```\n */\nexport type InferWorkflowStageIds<W> = W extends Workflow<any, any, infer C>\n ? keyof C & string\n : never;\n\n/**\n * Get the output type for a specific stage ID from a Workflow\n *\n * @example\n * ```typescript\n * type DataOutput = InferStageOutputById<typeof workflow, \"data-extraction\">;\n * ```\n */\nexport type InferStageOutputById<W, K extends string> = W extends Workflow<\n any,\n any,\n infer C\n>\n ? K extends keyof C\n ? C[K]\n : never\n : never;\n","/**\n * Config Presets - Common configuration patterns for workflow stages\n *\n * These presets provide standardized schemas for common stage configurations,\n * reducing boilerplate and ensuring consistency across stages.\n *\n * @example\n * ```typescript\n * import { defineStage } from \"./stage-factory\";\n * import { withAIConfig, withStandardConfig } from \"./config-presets\";\n *\n * // Use AI-focused config preset\n * const myStage = defineStage({\n * id: \"my-stage\",\n * name: \"My Stage\",\n * schemas: {\n * input: z.object({ data: z.string() }),\n * output: z.object({ result: z.string() }),\n * config: withAIConfig(z.object({\n * customField: z.string(),\n * })),\n * },\n * async execute(ctx) {\n * // ctx.config.model, ctx.config.temperature available\n * // plus ctx.config.customField\n * },\n * });\n *\n * // Use standard config preset (includes AI + concurrency + feature flags)\n * const fullStage = defineStage({\n * id: \"full-stage\",\n * name: \"Full Stage\",\n * schemas: {\n * input: \"none\",\n * output: z.object({ result: z.string() }),\n * config: withStandardConfig(z.object({\n * specificOption: z.boolean().default(true),\n * })),\n * },\n * async execute(ctx) {\n * // All standard config + custom fields available\n * },\n * });\n * ```\n */\n\nimport { z } from \"zod\";\nimport { ModelKey } from \"../ai/model-helper\";\n\n// ============================================================================\n// Base Config Schemas\n// ============================================================================\n\n/**\n * AI/LLM configuration options\n */\nexport const AIConfigSchema = z.object({\n /** The model to use for AI operations */\n model: ModelKey.default(\"gemini-2.5-flash\"),\n /** Temperature for AI generations (0-2) */\n temperature: z.number().min(0).max(2).default(0.7),\n /** Maximum tokens to generate (undefined = model default) */\n maxTokens: z.number().positive().optional(),\n});\n\nexport type AIConfig = z.infer<typeof AIConfigSchema>;\n\n/**\n * Concurrency and rate limiting configuration\n */\nexport const ConcurrencyConfigSchema = z.object({\n /** Maximum concurrent operations (for parallel processing) */\n concurrency: z.number().positive().default(5),\n /** Delay between operations in milliseconds (rate limiting) */\n delayMs: z.number().nonnegative().default(0),\n /** Maximum retries on failure */\n maxRetries: z.number().nonnegative().default(3),\n});\n\nexport type ConcurrencyConfig = z.infer<typeof ConcurrencyConfigSchema>;\n\n/**\n * Feature flag configuration for conditional behavior\n */\nexport const FeatureFlagsConfigSchema = z.object({\n /** Feature flags for conditional stage behavior */\n featureFlags: z.record(z.string(), z.boolean()).default({}),\n});\n\nexport type FeatureFlagsConfig = z.infer<typeof FeatureFlagsConfigSchema>;\n\n/**\n * Logging and debugging configuration\n */\nexport const DebugConfigSchema = z.object({\n /** Enable verbose logging */\n verbose: z.boolean().default(false),\n /** Dry run mode (no side effects) */\n dryRun: z.boolean().default(false),\n});\n\nexport type DebugConfig = z.infer<typeof DebugConfigSchema>;\n\n// ============================================================================\n// Preset Combinators\n// ============================================================================\n\n/**\n * Add AI configuration to any schema\n *\n * @example\n * ```typescript\n * const myConfig = withAIConfig(z.object({\n * customField: z.string(),\n * }));\n * // Result has: model, temperature, maxTokens, customField\n * ```\n */\nexport function withAIConfig<T extends z.ZodRawShape>(schema: z.ZodObject<T>) {\n return schema.merge(AIConfigSchema);\n}\n\n/**\n * Add concurrency configuration to any schema\n *\n * @example\n * ```typescript\n * const myConfig = withConcurrency(z.object({\n * items: z.array(z.string()),\n * }));\n * // Result has: concurrency, delayMs, maxRetries, items\n * ```\n */\nexport function withConcurrency<T extends z.ZodRawShape>(\n schema: z.ZodObject<T>,\n) {\n return schema.merge(ConcurrencyConfigSchema);\n}\n\n/**\n * Add feature flags configuration to any schema\n *\n * @example\n * ```typescript\n * const myConfig = withFeatureFlags(z.object({\n * setting: z.boolean(),\n * }));\n * // Result has: featureFlags, setting\n * ```\n */\nexport function withFeatureFlags<T extends z.ZodRawShape>(\n schema: z.ZodObject<T>,\n) {\n return schema.merge(FeatureFlagsConfigSchema);\n}\n\n/**\n * Add debug configuration to any schema\n *\n * @example\n * ```typescript\n * const myConfig = withDebug(z.object({\n * processType: z.string(),\n * }));\n * // Result has: verbose, dryRun, processType\n * ```\n */\nexport function withDebug<T extends z.ZodRawShape>(schema: z.ZodObject<T>) {\n return schema.merge(DebugConfigSchema);\n}\n\n/**\n * Standard config preset combining AI + Concurrency + Feature Flags\n *\n * This is the recommended preset for most stages that need:\n * - AI/LLM operations\n * - Parallel processing\n * - Feature flagging\n *\n * @example\n * ```typescript\n * const myConfig = withStandardConfig(z.object({\n * customOption: z.boolean().default(true),\n * }));\n * // Result has all standard fields plus customOption\n * ```\n */\nexport function withStandardConfig<T extends z.ZodRawShape>(\n schema: z.ZodObject<T>,\n) {\n return schema\n .merge(AIConfigSchema)\n .merge(ConcurrencyConfigSchema)\n .merge(FeatureFlagsConfigSchema);\n}\n\n/**\n * Full config preset with all available options including debug\n *\n * @example\n * ```typescript\n * const myConfig = withFullConfig(z.object({\n * specificField: z.number(),\n * }));\n * // Result has AI + Concurrency + FeatureFlags + Debug + specificField\n * ```\n */\nexport function withFullConfig<T extends z.ZodRawShape>(\n schema: z.ZodObject<T>,\n) {\n return schema\n .merge(AIConfigSchema)\n .merge(ConcurrencyConfigSchema)\n .merge(FeatureFlagsConfigSchema)\n .merge(DebugConfigSchema);\n}\n\n// ============================================================================\n// Preset Type Helpers\n// ============================================================================\n\n/**\n * Extract the inferred type from a config created with presets\n */\nexport type InferConfig<T extends z.ZodTypeAny> = z.infer<T>;\n\n/**\n * Standard config type (AI + Concurrency + FeatureFlags)\n */\nexport type StandardConfig = AIConfig & ConcurrencyConfig & FeatureFlagsConfig;\n\n/**\n * Full config type (Standard + Debug)\n */\nexport type FullConfig = StandardConfig & DebugConfig;\n\n// ============================================================================\n// Utility Schemas\n// ============================================================================\n\n/**\n * Empty config schema - for stages that don't need configuration\n */\nexport const EmptyConfigSchema = z.object({});\n\n/**\n * Minimal AI config - just model and temperature\n */\nexport const MinimalAIConfigSchema = z.object({\n model: ModelKey.default(\"gemini-2.5-flash\"),\n temperature: z.number().min(0).max(2).default(0.7),\n});\n\nexport type MinimalAIConfig = z.infer<typeof MinimalAIConfigSchema>;\n"]}
|