@renseiai/agentfactory 0.8.11 → 0.8.13
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/src/config/repository-config.d.ts +24 -0
- package/dist/src/config/repository-config.d.ts.map +1 -1
- package/dist/src/config/repository-config.js +21 -0
- package/dist/src/config/repository-config.test.js +202 -0
- package/dist/src/governor/decision-engine.d.ts +2 -0
- package/dist/src/governor/decision-engine.d.ts.map +1 -1
- package/dist/src/governor/decision-engine.js +7 -0
- package/dist/src/governor/decision-engine.test.js +63 -0
- package/dist/src/governor/governor-types.d.ts +2 -1
- package/dist/src/governor/governor-types.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/merge-queue/conflict-resolver.d.ts +62 -0
- package/dist/src/merge-queue/conflict-resolver.d.ts.map +1 -0
- package/dist/src/merge-queue/conflict-resolver.js +168 -0
- package/dist/src/merge-queue/conflict-resolver.test.d.ts +2 -0
- package/dist/src/merge-queue/conflict-resolver.test.d.ts.map +1 -0
- package/dist/src/merge-queue/conflict-resolver.test.js +405 -0
- package/dist/src/merge-queue/lock-file-regeneration.d.ts +14 -0
- package/dist/src/merge-queue/lock-file-regeneration.d.ts.map +1 -0
- package/dist/src/merge-queue/lock-file-regeneration.js +82 -0
- package/dist/src/merge-queue/lock-file-regeneration.test.d.ts +2 -0
- package/dist/src/merge-queue/lock-file-regeneration.test.d.ts.map +1 -0
- package/dist/src/merge-queue/lock-file-regeneration.test.js +236 -0
- package/dist/src/merge-queue/merge-worker.d.ts +79 -0
- package/dist/src/merge-queue/merge-worker.d.ts.map +1 -0
- package/dist/src/merge-queue/merge-worker.js +221 -0
- package/dist/src/merge-queue/merge-worker.test.d.ts +2 -0
- package/dist/src/merge-queue/merge-worker.test.d.ts.map +1 -0
- package/dist/src/merge-queue/merge-worker.test.js +883 -0
- package/dist/src/merge-queue/strategies/index.d.ts +19 -0
- package/dist/src/merge-queue/strategies/index.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/index.js +30 -0
- package/dist/src/merge-queue/strategies/merge-commit-strategy.d.ts +14 -0
- package/dist/src/merge-queue/strategies/merge-commit-strategy.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/merge-commit-strategy.js +58 -0
- package/dist/src/merge-queue/strategies/rebase-strategy.d.ts +14 -0
- package/dist/src/merge-queue/strategies/rebase-strategy.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/rebase-strategy.js +62 -0
- package/dist/src/merge-queue/strategies/squash-strategy.d.ts +14 -0
- package/dist/src/merge-queue/strategies/squash-strategy.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/squash-strategy.js +59 -0
- package/dist/src/merge-queue/strategies/strategies.test.d.ts +2 -0
- package/dist/src/merge-queue/strategies/strategies.test.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/strategies.test.js +354 -0
- package/dist/src/merge-queue/strategies/types.d.ts +62 -0
- package/dist/src/merge-queue/strategies/types.d.ts.map +1 -0
- package/dist/src/merge-queue/strategies/types.js +7 -0
- package/dist/src/orchestrator/parse-work-result.d.ts.map +1 -1
- package/dist/src/orchestrator/parse-work-result.js +22 -0
- package/dist/src/orchestrator/parse-work-result.test.js +49 -0
- package/dist/src/providers/index.d.ts +1 -0
- package/dist/src/providers/index.d.ts.map +1 -1
- package/dist/src/providers/plugin-types.d.ts +177 -0
- package/dist/src/providers/plugin-types.d.ts.map +1 -0
- package/dist/src/providers/plugin-types.js +10 -0
- package/dist/src/providers/plugin-types.test.d.ts +2 -0
- package/dist/src/providers/plugin-types.test.d.ts.map +1 -0
- package/dist/src/providers/plugin-types.test.js +810 -0
- package/dist/src/registry/index.d.ts +4 -0
- package/dist/src/registry/index.d.ts.map +1 -0
- package/dist/src/registry/index.js +2 -0
- package/dist/src/registry/loader.d.ts +25 -0
- package/dist/src/registry/loader.d.ts.map +1 -0
- package/dist/src/registry/loader.js +88 -0
- package/dist/src/registry/node-type-registry.d.ts +52 -0
- package/dist/src/registry/node-type-registry.d.ts.map +1 -0
- package/dist/src/registry/node-type-registry.js +130 -0
- package/dist/src/registry/types.d.ts +65 -0
- package/dist/src/registry/types.d.ts.map +1 -0
- package/dist/src/registry/types.js +10 -0
- package/dist/src/workflow/expression/ast.d.ts +1 -1
- package/dist/src/workflow/expression/ast.d.ts.map +1 -1
- package/dist/src/workflow/expression/context.d.ts +4 -0
- package/dist/src/workflow/expression/context.d.ts.map +1 -1
- package/dist/src/workflow/expression/context.js +5 -1
- package/dist/src/workflow/expression/evaluator.d.ts.map +1 -1
- package/dist/src/workflow/expression/evaluator.js +24 -1
- package/dist/src/workflow/expression/evaluator.test.js +174 -0
- package/dist/src/workflow/expression/expression.test.js +140 -1
- package/dist/src/workflow/expression/helpers.d.ts +4 -0
- package/dist/src/workflow/expression/helpers.d.ts.map +1 -1
- package/dist/src/workflow/expression/helpers.js +51 -0
- package/dist/src/workflow/expression/index.d.ts +14 -0
- package/dist/src/workflow/expression/index.d.ts.map +1 -1
- package/dist/src/workflow/expression/index.js +28 -1
- package/dist/src/workflow/expression/lexer.d.ts.map +1 -1
- package/dist/src/workflow/expression/lexer.js +43 -0
- package/dist/src/workflow/expression/parser.js +1 -1
- package/dist/src/workflow/index.d.ts +3 -3
- package/dist/src/workflow/index.d.ts.map +1 -1
- package/dist/src/workflow/index.js +4 -2
- package/dist/src/workflow/workflow-loader.d.ts +8 -2
- package/dist/src/workflow/workflow-loader.d.ts.map +1 -1
- package/dist/src/workflow/workflow-loader.js +21 -2
- package/dist/src/workflow/workflow-types.d.ts +781 -12
- package/dist/src/workflow/workflow-types.d.ts.map +1 -1
- package/dist/src/workflow/workflow-types.js +248 -3
- package/dist/src/workflow/workflow-types.test.js +621 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-types.d.ts","sourceRoot":"","sources":["../../../src/workflow/workflow-types.ts"],"names":[],"mappings":"AAAA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IG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAiBrG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CA2G/F"}
|
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
* escalation ladder, gates, and parallelism — in YAML rather than hard-coded
|
|
7
7
|
* TypeScript.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Supports two schema versions:
|
|
10
|
+
* - **v1.1**: Phase-based workflow with template bindings, transitions, escalation
|
|
11
|
+
* - **v2**: Event-driven workflow with triggers, providers, config, and multi-step nodes
|
|
12
|
+
*
|
|
13
|
+
* Use {@link AnyWorkflowDefinition} for consumers that handle both versions.
|
|
11
14
|
*/
|
|
12
15
|
import { z } from 'zod';
|
|
13
16
|
// ---------------------------------------------------------------------------
|
|
@@ -105,10 +108,74 @@ export const WorkflowDefinitionSchema = z.object({
|
|
|
105
108
|
branching: z.array(BranchingDefinitionSchema).optional(),
|
|
106
109
|
});
|
|
107
110
|
// ---------------------------------------------------------------------------
|
|
111
|
+
// v2 Zod Schemas
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
export const WorkflowTriggerDefinitionSchema = z.object({
|
|
114
|
+
name: z.string().min(1),
|
|
115
|
+
type: z.enum(['webhook', 'schedule', 'manual']),
|
|
116
|
+
source: z.string().optional(),
|
|
117
|
+
event: z.string().optional(),
|
|
118
|
+
filter: z.record(z.string(), z.unknown()).optional(),
|
|
119
|
+
schedule: z.string().optional(),
|
|
120
|
+
});
|
|
121
|
+
export const ProviderRequirementSchema = z.object({
|
|
122
|
+
name: z.string().min(1),
|
|
123
|
+
type: z.string().min(1),
|
|
124
|
+
config: z.record(z.string(), z.unknown()).optional(),
|
|
125
|
+
});
|
|
126
|
+
export const WorkflowConfigSchema = z.object({
|
|
127
|
+
projectMapping: z.record(z.string(), z.string()).optional(),
|
|
128
|
+
}).passthrough();
|
|
129
|
+
export const StepDefinitionSchema = z.object({
|
|
130
|
+
id: z.string().min(1),
|
|
131
|
+
action: z.string().min(1),
|
|
132
|
+
with: z.record(z.string(), z.unknown()).optional(),
|
|
133
|
+
when: z.string().optional(),
|
|
134
|
+
output: z.record(z.string(), PhaseOutputDeclarationSchema).optional(),
|
|
135
|
+
});
|
|
136
|
+
export const NodeDefinitionSchema = z.object({
|
|
137
|
+
name: z.string().min(1),
|
|
138
|
+
description: z.string().optional(),
|
|
139
|
+
provider: z.string().optional(),
|
|
140
|
+
template: z.string().optional(),
|
|
141
|
+
steps: z.array(StepDefinitionSchema).optional(),
|
|
142
|
+
when: z.string().optional(),
|
|
143
|
+
retry: TemplateRetryConfigSchema.optional(),
|
|
144
|
+
timeout: TemplateTimeoutConfigSchema.optional(),
|
|
145
|
+
inputs: z.record(z.string(), PhaseInputDeclarationSchema).optional(),
|
|
146
|
+
outputs: z.record(z.string(), PhaseOutputDeclarationSchema).optional(),
|
|
147
|
+
});
|
|
148
|
+
export const WorkflowDefinitionV2Schema = z.object({
|
|
149
|
+
apiVersion: z.literal('v2'),
|
|
150
|
+
kind: z.literal('WorkflowDefinition'),
|
|
151
|
+
metadata: z.object({
|
|
152
|
+
name: z.string().min(1),
|
|
153
|
+
description: z.string().optional(),
|
|
154
|
+
}),
|
|
155
|
+
triggers: z.array(WorkflowTriggerDefinitionSchema).optional(),
|
|
156
|
+
providers: z.array(ProviderRequirementSchema).optional(),
|
|
157
|
+
config: WorkflowConfigSchema.optional(),
|
|
158
|
+
nodes: z.array(NodeDefinitionSchema).optional(),
|
|
159
|
+
phases: z.array(PhaseDefinitionSchema).optional(),
|
|
160
|
+
transitions: z.array(TransitionDefinitionSchema).optional(),
|
|
161
|
+
escalation: EscalationConfigSchema.optional(),
|
|
162
|
+
gates: z.array(GateDefinitionSchema).optional(),
|
|
163
|
+
parallelism: z.array(ParallelismGroupDefinitionSchema).optional(),
|
|
164
|
+
branching: z.array(BranchingDefinitionSchema).optional(),
|
|
165
|
+
});
|
|
166
|
+
/**
|
|
167
|
+
* Discriminated union schema that accepts both v1.1 and v2 workflow definitions.
|
|
168
|
+
* Dispatches to the correct schema based on the `apiVersion` field.
|
|
169
|
+
*/
|
|
170
|
+
export const AnyWorkflowDefinitionSchema = z.discriminatedUnion('apiVersion', [
|
|
171
|
+
WorkflowDefinitionSchema,
|
|
172
|
+
WorkflowDefinitionV2Schema,
|
|
173
|
+
]);
|
|
174
|
+
// ---------------------------------------------------------------------------
|
|
108
175
|
// Validation Helpers
|
|
109
176
|
// ---------------------------------------------------------------------------
|
|
110
177
|
/**
|
|
111
|
-
* Validate a parsed YAML object as a WorkflowDefinition.
|
|
178
|
+
* Validate a parsed YAML object as a WorkflowDefinition (v1.1).
|
|
112
179
|
* Throws ZodError with detailed messages on failure.
|
|
113
180
|
*
|
|
114
181
|
* After Zod schema validation succeeds, performs cross-validation to ensure:
|
|
@@ -130,6 +197,184 @@ export function validateWorkflowDefinition(data, filePath) {
|
|
|
130
197
|
throw error;
|
|
131
198
|
}
|
|
132
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Validate a parsed YAML object as either a v1.1 or v2 WorkflowDefinition.
|
|
202
|
+
* Uses the `apiVersion` field to dispatch to the correct schema.
|
|
203
|
+
* Throws on invalid schema or cross-validation failure.
|
|
204
|
+
*/
|
|
205
|
+
export function validateAnyWorkflowDefinition(data, filePath) {
|
|
206
|
+
try {
|
|
207
|
+
const workflow = AnyWorkflowDefinitionSchema.parse(data);
|
|
208
|
+
if (workflow.apiVersion === 'v1.1') {
|
|
209
|
+
crossValidateWorkflow(workflow, filePath);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
crossValidateWorkflowV2(workflow, filePath);
|
|
213
|
+
}
|
|
214
|
+
return workflow;
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
if (filePath && error instanceof z.ZodError) {
|
|
218
|
+
throw new Error(`Invalid workflow definition at ${filePath}: ${error.message}`, { cause: error });
|
|
219
|
+
}
|
|
220
|
+
throw error;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Perform cross-validation for v2 workflow definitions.
|
|
225
|
+
* Validates referential integrity for triggers, providers, nodes, and steps.
|
|
226
|
+
*
|
|
227
|
+
* Checks:
|
|
228
|
+
* - Node names must be unique
|
|
229
|
+
* - node.provider must reference a declared provider name
|
|
230
|
+
* - Step IDs must be unique within a node
|
|
231
|
+
* - {{ steps.<id>.output.<key> }} references must point to valid step IDs within the same node
|
|
232
|
+
* - {{ trigger.* }} references require at least one trigger to be declared
|
|
233
|
+
* - config.projectMapping values must be non-empty strings
|
|
234
|
+
* - when expressions must have balanced {{ }} brackets
|
|
235
|
+
*/
|
|
236
|
+
export function crossValidateWorkflowV2(workflow, filePath) {
|
|
237
|
+
const loc = filePath ? ` in ${filePath}` : '';
|
|
238
|
+
const providerNames = new Set((workflow.providers ?? []).map(p => p.name));
|
|
239
|
+
const hasTriggers = (workflow.triggers ?? []).length > 0;
|
|
240
|
+
// --- Node name uniqueness ---
|
|
241
|
+
const nodeNames = new Set();
|
|
242
|
+
for (const node of workflow.nodes ?? []) {
|
|
243
|
+
if (nodeNames.has(node.name)) {
|
|
244
|
+
throw new Error(`Duplicate node name "${node.name}"${loc}`);
|
|
245
|
+
}
|
|
246
|
+
nodeNames.add(node.name);
|
|
247
|
+
}
|
|
248
|
+
// --- Per-node validation ---
|
|
249
|
+
for (const node of workflow.nodes ?? []) {
|
|
250
|
+
// Provider reference validation
|
|
251
|
+
if (node.provider && !providerNames.has(node.provider)) {
|
|
252
|
+
throw new Error(`Node "${node.name}" references undefined provider "${node.provider}"${loc}`);
|
|
253
|
+
}
|
|
254
|
+
// Step ID uniqueness within node
|
|
255
|
+
const stepIds = new Set();
|
|
256
|
+
for (const step of node.steps ?? []) {
|
|
257
|
+
if (stepIds.has(step.id)) {
|
|
258
|
+
throw new Error(`Node "${node.name}" has duplicate step ID "${step.id}"${loc}`);
|
|
259
|
+
}
|
|
260
|
+
stepIds.add(step.id);
|
|
261
|
+
}
|
|
262
|
+
// Step output reference validation: {{ steps.<id>.output.<key> }} in with params
|
|
263
|
+
for (const step of node.steps ?? []) {
|
|
264
|
+
const refs = extractStepReferences(step.with);
|
|
265
|
+
for (const refId of refs) {
|
|
266
|
+
if (!stepIds.has(refId)) {
|
|
267
|
+
throw new Error(`Node "${node.name}" step "${step.id}" references undefined step "${refId}"${loc}`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
// Check when condition for step references too
|
|
271
|
+
if (step.when) {
|
|
272
|
+
const whenRefs = extractStepReferencesFromString(step.when);
|
|
273
|
+
for (const refId of whenRefs) {
|
|
274
|
+
if (!stepIds.has(refId)) {
|
|
275
|
+
throw new Error(`Node "${node.name}" step "${step.id}" references undefined step "${refId}"${loc}`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
// Trigger reference validation: {{ trigger.* }} requires at least one trigger
|
|
281
|
+
if (!hasTriggers) {
|
|
282
|
+
const usesTriggerRef = nodeUsesTriggerReferences(node);
|
|
283
|
+
if (usesTriggerRef) {
|
|
284
|
+
throw new Error(`Node "${node.name}" uses trigger references but no triggers are declared${loc}`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
// When condition syntax check (basic {{ }} bracket matching)
|
|
288
|
+
if (node.when) {
|
|
289
|
+
validateBracketSyntax(node.when, `Node "${node.name}" when condition`, loc);
|
|
290
|
+
}
|
|
291
|
+
for (const step of node.steps ?? []) {
|
|
292
|
+
if (step.when) {
|
|
293
|
+
validateBracketSyntax(step.when, `Node "${node.name}" step "${step.id}" when condition`, loc);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
// --- Config validation ---
|
|
298
|
+
if (workflow.config?.projectMapping) {
|
|
299
|
+
for (const [key, value] of Object.entries(workflow.config.projectMapping)) {
|
|
300
|
+
if (!value || value.trim() === '') {
|
|
301
|
+
throw new Error(`config.projectMapping["${key}"] has empty value${loc}`);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
// --- v1.1 compat: validate phases/parallelism if present ---
|
|
306
|
+
if (workflow.phases && workflow.parallelism) {
|
|
307
|
+
const phaseNames = new Set(workflow.phases.map(p => p.name));
|
|
308
|
+
for (const group of workflow.parallelism) {
|
|
309
|
+
for (const phaseName of group.phases) {
|
|
310
|
+
if (!phaseNames.has(phaseName)) {
|
|
311
|
+
throw new Error(`Parallelism group "${group.name}" references undefined phase "${phaseName}"${loc}`);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (group.maxConcurrent && group.maxConcurrent > 10) {
|
|
315
|
+
console.warn(`[workflow] Parallelism group "${group.name}" has maxConcurrent=${group.maxConcurrent} which may be excessive`);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Extract step ID references from {{ steps.<id>.output.<key> }} patterns
|
|
322
|
+
* in a record of parameters (the `with` block).
|
|
323
|
+
*/
|
|
324
|
+
function extractStepReferences(params) {
|
|
325
|
+
const refs = new Set();
|
|
326
|
+
if (!params)
|
|
327
|
+
return refs;
|
|
328
|
+
for (const value of Object.values(params)) {
|
|
329
|
+
if (typeof value === 'string') {
|
|
330
|
+
for (const ref of extractStepReferencesFromString(value)) {
|
|
331
|
+
refs.add(ref);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return refs;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Extract step ID references from {{ steps.<id>.* }} patterns in a string.
|
|
339
|
+
*/
|
|
340
|
+
function extractStepReferencesFromString(str) {
|
|
341
|
+
const refs = new Set();
|
|
342
|
+
const pattern = /\{\{\s*steps\.([a-zA-Z0-9_-]+)\./g;
|
|
343
|
+
let match;
|
|
344
|
+
while ((match = pattern.exec(str)) !== null) {
|
|
345
|
+
refs.add(match[1]);
|
|
346
|
+
}
|
|
347
|
+
return refs;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Check if a node uses {{ trigger.* }} references in when conditions or step with params.
|
|
351
|
+
*/
|
|
352
|
+
function nodeUsesTriggerReferences(node) {
|
|
353
|
+
const triggerPattern = /\{\{\s*trigger\./;
|
|
354
|
+
if (node.when && triggerPattern.test(node.when))
|
|
355
|
+
return true;
|
|
356
|
+
for (const step of node.steps ?? []) {
|
|
357
|
+
if (step.when && triggerPattern.test(step.when))
|
|
358
|
+
return true;
|
|
359
|
+
if (step.with) {
|
|
360
|
+
for (const value of Object.values(step.with)) {
|
|
361
|
+
if (typeof value === 'string' && triggerPattern.test(value))
|
|
362
|
+
return true;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Validate that {{ }} brackets are balanced in an expression string.
|
|
370
|
+
*/
|
|
371
|
+
function validateBracketSyntax(expr, context, loc) {
|
|
372
|
+
const opens = (expr.match(/\{\{/g) ?? []).length;
|
|
373
|
+
const closes = (expr.match(/\}\}/g) ?? []).length;
|
|
374
|
+
if (opens !== closes) {
|
|
375
|
+
throw new Error(`${context} has unbalanced brackets: ${opens} opening vs ${closes} closing${loc}`);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
133
378
|
/**
|
|
134
379
|
* Perform cross-validation checks that go beyond what Zod schema can enforce.
|
|
135
380
|
* Validates referential integrity between phases, parallelism groups, and input/output declarations.
|