@xemahq/dsl 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/deliverable-spec/lib/schema.d.ts +2 -0
- package/dist/deliverable-spec/lib/schema.d.ts.map +1 -1
- package/dist/deliverable-spec/lib/schema.js +10 -1
- package/dist/deliverable-spec/lib/schema.js.map +1 -1
- package/dist/schema/reusable-workflow.schema.json +9 -1
- package/dist/schema/workflow.schema.json +39 -13
- package/dist/workflow/index.d.ts +3 -0
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +7 -1
- package/dist/workflow/index.js.map +1 -1
- package/dist/workflow/lib/compiler/compile.d.ts.map +1 -1
- package/dist/workflow/lib/compiler/compile.js +105 -20
- package/dist/workflow/lib/compiler/compile.js.map +1 -1
- package/dist/workflow/lib/compiler/concurrency.js +1 -1
- package/dist/workflow/lib/compiler/concurrency.js.map +1 -1
- package/dist/workflow/lib/compiler/manifest-source.d.ts +2 -1
- package/dist/workflow/lib/compiler/manifest-source.d.ts.map +1 -1
- package/dist/workflow/lib/compiler/manifest-source.js +13 -4
- package/dist/workflow/lib/compiler/manifest-source.js.map +1 -1
- package/dist/workflow/lib/compiler/review-step.d.ts +2 -1
- package/dist/workflow/lib/compiler/review-step.d.ts.map +1 -1
- package/dist/workflow/lib/compiler/review-step.js +13 -1
- package/dist/workflow/lib/compiler/review-step.js.map +1 -1
- package/dist/workflow/lib/compiler/types.d.ts +3 -2
- package/dist/workflow/lib/compiler/types.d.ts.map +1 -1
- package/dist/workflow/lib/deliverable-spec-introspection-error.d.ts +12 -0
- package/dist/workflow/lib/deliverable-spec-introspection-error.d.ts.map +1 -0
- package/dist/workflow/lib/deliverable-spec-introspection-error.js +33 -0
- package/dist/workflow/lib/deliverable-spec-introspection-error.js.map +1 -0
- package/dist/workflow/lib/deliverable-spec-keys.d.ts +1 -1
- package/dist/workflow/lib/deliverable-spec-keys.d.ts.map +1 -1
- package/dist/workflow/lib/deliverable-spec-keys.js +27 -52
- package/dist/workflow/lib/deliverable-spec-keys.js.map +1 -1
- package/dist/workflow/lib/deliverable-spec-source-scan.d.ts +6 -0
- package/dist/workflow/lib/deliverable-spec-source-scan.d.ts.map +1 -0
- package/dist/workflow/lib/deliverable-spec-source-scan.js +189 -0
- package/dist/workflow/lib/deliverable-spec-source-scan.js.map +1 -0
- package/dist/workflow/lib/expression/context.d.ts +1 -1
- package/dist/workflow/lib/expression/context.d.ts.map +1 -1
- package/dist/workflow/lib/expression/context.js +1 -1
- package/dist/workflow/lib/expression/context.js.map +1 -1
- package/dist/workflow/lib/types.d.ts +1 -1
- package/dist/workflow/lib/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/schema/reusable-workflow.schema.json +9 -1
- package/schema/workflow.schema.json +39 -13
- package/src/deliverable-spec/lib/schema.ts +23 -0
- package/src/workflow/index.ts +7 -0
- package/src/workflow/lib/compiler/compile.ts +302 -149
- package/src/workflow/lib/compiler/concurrency.ts +1 -1
- package/src/workflow/lib/compiler/manifest-source.ts +23 -8
- package/src/workflow/lib/compiler/review-step.ts +33 -2
- package/src/workflow/lib/compiler/types.ts +9 -9
- package/src/workflow/lib/deliverable-spec-introspection-error.ts +63 -0
- package/src/workflow/lib/deliverable-spec-keys.ts +88 -50
- package/src/workflow/lib/deliverable-spec-source-scan.ts +280 -0
- package/src/workflow/lib/expression/context.ts +2 -2
- package/src/workflow/lib/types.ts +38 -8
|
@@ -57,6 +57,7 @@ export declare const DeliverableSpecSpecSchema: z.ZodObject<{
|
|
|
57
57
|
standards: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
58
58
|
zodSchemaSource: z.ZodOptional<z.ZodString>;
|
|
59
59
|
zodSchemaSourceFile: z.ZodOptional<z.ZodString>;
|
|
60
|
+
zodSchemaExport: z.ZodOptional<z.ZodString>;
|
|
60
61
|
fetchSpec: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
61
62
|
assets: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
62
63
|
rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -109,6 +110,7 @@ export declare const DeliverableSpecManifestSchema: z.ZodObject<{
|
|
|
109
110
|
standards: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
110
111
|
zodSchemaSource: z.ZodOptional<z.ZodString>;
|
|
111
112
|
zodSchemaSourceFile: z.ZodOptional<z.ZodString>;
|
|
113
|
+
zodSchemaExport: z.ZodOptional<z.ZodString>;
|
|
112
114
|
fetchSpec: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
113
115
|
assets: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
114
116
|
rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/deliverable-spec/lib/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsCxB,eAAO,MAAM,sBAAsB,6HAQzB,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAOjF,eAAO,MAAM,gBAAgB,uCAAwC,CAAC;AAEtE,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAOtE,eAAO,MAAM,sBAAsB;;;;iBAQjC,CAAC;AAOH,eAAO,MAAM,oBAAoB;;iBAE/B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;mBAG3B,CAAC;AAMH,eAAO,MAAM,6BAA6B;;;;;iBAcxC,CAAC;AAEH,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/deliverable-spec/lib/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsCxB,eAAO,MAAM,sBAAsB,6HAQzB,CAAC;AAEX,MAAM,MAAM,0BAA0B,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAOjF,eAAO,MAAM,gBAAgB,uCAAwC,CAAC;AAEtE,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAOtE,eAAO,MAAM,sBAAsB;;;;iBAQjC,CAAC;AAOH,eAAO,MAAM,oBAAoB;;iBAE/B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;mBAG3B,CAAC;AAMH,eAAO,MAAM,6BAA6B;;;;;iBAcxC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2FnC,CAAC;AAEJ,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYtC,CAAC;AAIL,eAAO,MAAM,oCAAoC;;;iBAU/C,CAAC;AAEH,eAAO,MAAM,gCAAgC;;;;;;;iBA0B1C,CAAC;AAEJ,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;iBAY7C,CAAC"}
|
|
@@ -69,6 +69,10 @@ exports.DeliverableSpecSpecSchema = zod_1.z
|
|
|
69
69
|
standards: zod_1.z.array(zod_1.z.unknown()).optional(),
|
|
70
70
|
zodSchemaSource: zod_1.z.string().max(200_000).optional(),
|
|
71
71
|
zodSchemaSourceFile: zod_1.z.string().min(1).optional(),
|
|
72
|
+
zodSchemaExport: zod_1.z
|
|
73
|
+
.string()
|
|
74
|
+
.regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/, 'zodSchemaExport must be a JavaScript identifier (the exported const name)')
|
|
75
|
+
.optional(),
|
|
72
76
|
fetchSpec: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
73
77
|
assets: zod_1.z.array(zod_1.z.unknown()).optional(),
|
|
74
78
|
rules: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
@@ -82,7 +86,12 @@ exports.DeliverableSpecSpecSchema = zod_1.z
|
|
|
82
86
|
.refine((s) => !(s.zodSchemaSource !== undefined && s.zodSchemaSourceFile !== undefined), {
|
|
83
87
|
message: 'spec cannot declare both `zodSchemaSource` and `zodSchemaSourceFile`',
|
|
84
88
|
})
|
|
85
|
-
.refine((s) => !(s.multiPage === true && (s.pages === undefined || s.pages.length === 0)), { message: 'multiPage=true requires non-empty `pages[]`' })
|
|
89
|
+
.refine((s) => !(s.multiPage === true && (s.pages === undefined || s.pages.length === 0)), { message: 'multiPage=true requires non-empty `pages[]`' })
|
|
90
|
+
.refine((s) => s.zodSchemaExport === undefined ||
|
|
91
|
+
s.zodSchemaSource !== undefined ||
|
|
92
|
+
s.zodSchemaSourceFile !== undefined, {
|
|
93
|
+
message: '`zodSchemaExport` names an export in the Zod source, so it requires `zodSchemaSource` or `zodSchemaSourceFile`',
|
|
94
|
+
});
|
|
86
95
|
exports.DeliverableSpecManifestSchema = zod_1.z
|
|
87
96
|
.object({
|
|
88
97
|
apiVersion: zod_1.z.literal('xema.dev/deliverable/v1'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/deliverable-spec/lib/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAoBxB,MAAM,SAAS,GAAG,yCAAyC,CAAC;AAC5D,MAAM,YAAY,GAAG,iBAAiB,CAAC;AACvC,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAIvC,MAAM,gBAAgB,GAAG,yCAAyC,CAAC;AAGnE,MAAM,YAAY,GAAG,wBAAwB,CAAC;AASjC,QAAA,sBAAsB,GAAG;IACpC,mBAAmB;IACnB,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,i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AW,KAAK,SAAS,CAAC,EAChE,EAAE,OAAO,EAAE,sDAAsD,EAAE,CACpE,CAAC;AAES,QAAA,oCAAoC,GAAG,OAAC;KAClD,MAAM,CAAC;IACN,UAAU,EAAE,OAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC;IAChD,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC;IACzC,QAAQ,EAAE,4CAAoC;IAC9C,IAAI,EAAE,wCAAgC;CACvC,CAAC;KACD,IAAI,CAAC;IACJ,EAAE,EAAE,qEAAqE;IACzE,KAAK,EAAE,6BAA6B;IACpC,WAAW,EACT,gHAAgH;CACnH,CAAC,CAAC"}
|
|
@@ -10,7 +10,15 @@
|
|
|
10
10
|
"apiVersion": { "type": "string", "const": "xema.dev/workflow/v1alpha1" },
|
|
11
11
|
"kind": { "type": "string", "const": "Workflow" },
|
|
12
12
|
"metadata": {
|
|
13
|
-
"
|
|
13
|
+
"allOf": [
|
|
14
|
+
{
|
|
15
|
+
"$ref": "https://xema.dev/schemas/workflow/v1alpha1/Workflow.json#/$defs/Metadata"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "object",
|
|
19
|
+
"required": ["contractVersion"]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
14
22
|
},
|
|
15
23
|
"on": {
|
|
16
24
|
"type": "object",
|
|
@@ -36,17 +36,24 @@
|
|
|
36
36
|
"type": "object",
|
|
37
37
|
"description": "Workflow-level named outputs. Each key references a (job, outputName) pair via fromJob/fromOutput and declares the kind of value surfaced.",
|
|
38
38
|
"additionalProperties": { "$ref": "#/$defs/WorkflowOutput" },
|
|
39
|
-
"propertyNames": {
|
|
39
|
+
"propertyNames": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"pattern": "^[a-z][a-z0-9_-]{0,62}$"
|
|
42
|
+
}
|
|
40
43
|
}
|
|
41
44
|
},
|
|
42
45
|
"$defs": {
|
|
43
46
|
"Metadata": {
|
|
44
47
|
"type": "object",
|
|
45
|
-
"required": ["name"
|
|
48
|
+
"required": ["name"],
|
|
46
49
|
"additionalProperties": false,
|
|
47
50
|
"properties": {
|
|
48
51
|
"name": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,62}$" },
|
|
49
|
-
"
|
|
52
|
+
"contractVersion": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(-[A-Za-z0-9.-]+)?$",
|
|
55
|
+
"description": "Compatibility version for an explicitly reusable public workflow contract. Ordinary workflows omit this field."
|
|
56
|
+
},
|
|
50
57
|
"title": { "type": "string", "maxLength": 120 },
|
|
51
58
|
"description": { "type": "string", "maxLength": 4000 },
|
|
52
59
|
"category": { "type": "string", "minLength": 1, "maxLength": 120 },
|
|
@@ -150,7 +157,10 @@
|
|
|
150
157
|
"description": "Standard 5-field cron expression.",
|
|
151
158
|
"pattern": "^[^\\s]+\\s+[^\\s]+\\s+[^\\s]+\\s+[^\\s]+\\s+[^\\s]+$"
|
|
152
159
|
},
|
|
153
|
-
"timezone": {
|
|
160
|
+
"timezone": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"pattern": "^[A-Za-z][A-Za-z0-9+_/-]+$"
|
|
163
|
+
},
|
|
154
164
|
"inputs": {
|
|
155
165
|
"type": "object",
|
|
156
166
|
"description": "Pre-bound inputs for every fire.",
|
|
@@ -260,7 +270,11 @@
|
|
|
260
270
|
"properties": {
|
|
261
271
|
"maxAttempts": { "type": "integer", "minimum": 1, "maximum": 20 },
|
|
262
272
|
"initialInterval": { "$ref": "#/$defs/Timeout" },
|
|
263
|
-
"backoffCoefficient": {
|
|
273
|
+
"backoffCoefficient": {
|
|
274
|
+
"type": "number",
|
|
275
|
+
"minimum": 1.0,
|
|
276
|
+
"maximum": 10.0
|
|
277
|
+
},
|
|
264
278
|
"maximumInterval": { "$ref": "#/$defs/Timeout" },
|
|
265
279
|
"nonRetryableErrorTypes": {
|
|
266
280
|
"type": "array",
|
|
@@ -350,10 +364,7 @@
|
|
|
350
364
|
},
|
|
351
365
|
"maxParallel": { "type": "integer", "minimum": 1, "maximum": 64 }
|
|
352
366
|
},
|
|
353
|
-
"oneOf": [
|
|
354
|
-
{ "required": ["matrix"] },
|
|
355
|
-
{ "required": ["dynamic"] }
|
|
356
|
-
]
|
|
367
|
+
"oneOf": [{ "required": ["matrix"] }, { "required": ["dynamic"] }]
|
|
357
368
|
},
|
|
358
369
|
"WorkflowOutput": {
|
|
359
370
|
"type": "object",
|
|
@@ -364,19 +375,31 @@
|
|
|
364
375
|
"properties": {
|
|
365
376
|
"kind": { "const": "deliverable" },
|
|
366
377
|
"slug": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,62}$" },
|
|
367
|
-
"fromJob": {
|
|
378
|
+
"fromJob": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"pattern": "^[a-z][a-z0-9_-]{0,62}$"
|
|
381
|
+
},
|
|
368
382
|
"fromOutput": { "type": "string", "minLength": 1 },
|
|
369
383
|
"description": { "type": "string", "maxLength": 4000 },
|
|
370
384
|
"deliverableSpecRef": { "type": "string", "minLength": 1 }
|
|
371
385
|
},
|
|
372
|
-
"required": [
|
|
386
|
+
"required": [
|
|
387
|
+
"kind",
|
|
388
|
+
"slug",
|
|
389
|
+
"fromJob",
|
|
390
|
+
"fromOutput",
|
|
391
|
+
"deliverableSpecRef"
|
|
392
|
+
]
|
|
373
393
|
},
|
|
374
394
|
{
|
|
375
395
|
"additionalProperties": false,
|
|
376
396
|
"properties": {
|
|
377
397
|
"kind": { "const": "structured" },
|
|
378
398
|
"slug": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,62}$" },
|
|
379
|
-
"fromJob": {
|
|
399
|
+
"fromJob": {
|
|
400
|
+
"type": "string",
|
|
401
|
+
"pattern": "^[a-z][a-z0-9_-]{0,62}$"
|
|
402
|
+
},
|
|
380
403
|
"fromOutput": { "type": "string", "minLength": 1 },
|
|
381
404
|
"description": { "type": "string", "maxLength": 4000 },
|
|
382
405
|
"schemaRef": { "type": "string", "minLength": 1 }
|
|
@@ -388,7 +411,10 @@
|
|
|
388
411
|
"properties": {
|
|
389
412
|
"kind": { "const": "text" },
|
|
390
413
|
"slug": { "type": "string", "pattern": "^[a-z][a-z0-9-]{0,62}$" },
|
|
391
|
-
"fromJob": {
|
|
414
|
+
"fromJob": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"pattern": "^[a-z][a-z0-9_-]{0,62}$"
|
|
417
|
+
},
|
|
392
418
|
"fromOutput": { "type": "string", "minLength": 1 },
|
|
393
419
|
"description": { "type": "string", "maxLength": 4000 }
|
|
394
420
|
},
|
package/dist/workflow/index.d.ts
CHANGED
|
@@ -10,5 +10,8 @@ export { dispatchInputsToJsonSchema } from './lib/dispatch-inputs/to-json-schema
|
|
|
10
10
|
export { serializeWorkflowDocument } from './lib/serializer';
|
|
11
11
|
export { DECISION_GATE_ACTION_ID, applyGateDefaults, canonicalJsonSha256, canonicalJsonStringify, compileManifestSource, compileWorkflow, getWorkspaceManifestContract, isAgentShapedAction, type CompileInput, type ResolvedAgentMeta, type ResolvedDeliverableSpec, type ResolvedRef, } from './lib/compiler';
|
|
12
12
|
export { extractZodTopLevelObjectKeys, extractJsonSchemaTopLevelKeys, } from './lib/deliverable-spec-keys';
|
|
13
|
+
export { DeliverableSpecIntrospectionError, DeliverableSpecIntrospectionFailure, isDeliverableSpecIntrospectionError, } from './lib/deliverable-spec-introspection-error';
|
|
14
|
+
export { scanTopLevelZodObjectDeclarations } from './lib/deliverable-spec-source-scan';
|
|
15
|
+
export type { TopLevelZodObjectDeclaration } from './lib/deliverable-spec-source-scan';
|
|
13
16
|
export type { ActionContract, ActionManifest, ActionManifestMetadata, ActionManifestRetryDefaults, ActionManifestSpec, ActionManifestTimeoutDefaults, WorkspaceManifestActionContract, ScheduleDeclaration, WebhookDeclaration, WorkflowCallDeclaration, WorkflowConcurrencyDeclaration, WorkflowDefaults, WorkflowGateDefaults, WorkflowDispatchDeclaration, WorkflowDocument, WorkflowDynamicStrategyDeclaration, WorkflowInputDeclaration, WorkflowJobDeclaration, WorkflowMetadata, WorkflowPermissions, WorkflowRetryDeclaration, WorkflowStrategyDeclaration, WorkflowTriggerDeclarations, } from './lib/types';
|
|
14
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,oBAAoB,EACpB,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,GACjC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,6BAA6B,GACnC,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EACL,0BAA0B,EAC1B,oCAAoC,EACpC,4BAA4B,EAC5B,sBAAsB,EACtB,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,+BAA+B,EAC/B,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EACf,4BAA4B,EAC5B,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,cAAc,EACd,cAAc,EACd,sBAAsB,EACtB,2BAA2B,EAC3B,kBAAkB,EAClB,6BAA6B,EAC7B,+BAA+B,EAC/B,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,8BAA8B,EAC9B,gBAAgB,EAChB,oBAAoB,EACpB,2BAA2B,EAC3B,gBAAgB,EAChB,kCAAkC,EAClC,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EACL,oBAAoB,EACpB,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,GACjC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAChC,KAAK,6BAA6B,GACnC,MAAM,kCAAkC,CAAC;AAC1C,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EACL,0BAA0B,EAC1B,oCAAoC,EACpC,4BAA4B,EAC5B,sBAAsB,EACtB,gCAAgC,EAChC,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,qBA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}
|
package/dist/workflow/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extractJsonSchemaTopLevelKeys = exports.extractZodTopLevelObjectKeys = exports.isAgentShapedAction = exports.getWorkspaceManifestContract = exports.compileWorkflow = exports.compileManifestSource = exports.canonicalJsonStringify = exports.canonicalJsonSha256 = exports.applyGateDefaults = exports.DECISION_GATE_ACTION_ID = exports.serializeWorkflowDocument = exports.dispatchInputsToJsonSchema = exports.extractDispatchInputDescriptors = exports.DispatchInputStringFormat = exports.DispatchInputFieldType = exports.parseDurationMs = exports.stripInterpolation = exports.isInterpolationWrapped = exports.extractInterpolations = exports.evaluateExpression = exports.compileExpression = exports.ExpressionRoot = exports.ExpressionNodeKind = exports.ExpressionFunction = exports.EMPTY_CONTEXT_SEEDS = exports.validateWorkflowDocument = exports.validateReusableWorkflowDocument = exports.validateActionManifest = exports.parseAndValidateWorkflowYaml = exports.parseAndValidateReusableWorkflowYaml = exports.parseAndValidateActionYaml = exports.collectInstallationResourceHints = exports.InstallationResourceKind = exports.validateActionInputs = exports.isWorkflowDslError = exports.WorkflowDslError = void 0;
|
|
3
|
+
exports.scanTopLevelZodObjectDeclarations = exports.isDeliverableSpecIntrospectionError = exports.DeliverableSpecIntrospectionFailure = exports.DeliverableSpecIntrospectionError = exports.extractJsonSchemaTopLevelKeys = exports.extractZodTopLevelObjectKeys = exports.isAgentShapedAction = exports.getWorkspaceManifestContract = exports.compileWorkflow = exports.compileManifestSource = exports.canonicalJsonStringify = exports.canonicalJsonSha256 = exports.applyGateDefaults = exports.DECISION_GATE_ACTION_ID = exports.serializeWorkflowDocument = exports.dispatchInputsToJsonSchema = exports.extractDispatchInputDescriptors = exports.DispatchInputStringFormat = exports.DispatchInputFieldType = exports.parseDurationMs = exports.stripInterpolation = exports.isInterpolationWrapped = exports.extractInterpolations = exports.evaluateExpression = exports.compileExpression = exports.ExpressionRoot = exports.ExpressionNodeKind = exports.ExpressionFunction = exports.EMPTY_CONTEXT_SEEDS = exports.validateWorkflowDocument = exports.validateReusableWorkflowDocument = exports.validateActionManifest = exports.parseAndValidateWorkflowYaml = exports.parseAndValidateReusableWorkflowYaml = exports.parseAndValidateActionYaml = exports.collectInstallationResourceHints = exports.InstallationResourceKind = exports.validateActionInputs = exports.isWorkflowDslError = exports.WorkflowDslError = void 0;
|
|
4
4
|
var errors_1 = require("./lib/errors");
|
|
5
5
|
Object.defineProperty(exports, "WorkflowDslError", { enumerable: true, get: function () { return errors_1.WorkflowDslError; } });
|
|
6
6
|
Object.defineProperty(exports, "isWorkflowDslError", { enumerable: true, get: function () { return errors_1.isWorkflowDslError; } });
|
|
@@ -48,4 +48,10 @@ Object.defineProperty(exports, "isAgentShapedAction", { enumerable: true, get: f
|
|
|
48
48
|
var deliverable_spec_keys_1 = require("./lib/deliverable-spec-keys");
|
|
49
49
|
Object.defineProperty(exports, "extractZodTopLevelObjectKeys", { enumerable: true, get: function () { return deliverable_spec_keys_1.extractZodTopLevelObjectKeys; } });
|
|
50
50
|
Object.defineProperty(exports, "extractJsonSchemaTopLevelKeys", { enumerable: true, get: function () { return deliverable_spec_keys_1.extractJsonSchemaTopLevelKeys; } });
|
|
51
|
+
var deliverable_spec_introspection_error_1 = require("./lib/deliverable-spec-introspection-error");
|
|
52
|
+
Object.defineProperty(exports, "DeliverableSpecIntrospectionError", { enumerable: true, get: function () { return deliverable_spec_introspection_error_1.DeliverableSpecIntrospectionError; } });
|
|
53
|
+
Object.defineProperty(exports, "DeliverableSpecIntrospectionFailure", { enumerable: true, get: function () { return deliverable_spec_introspection_error_1.DeliverableSpecIntrospectionFailure; } });
|
|
54
|
+
Object.defineProperty(exports, "isDeliverableSpecIntrospectionError", { enumerable: true, get: function () { return deliverable_spec_introspection_error_1.isDeliverableSpecIntrospectionError; } });
|
|
55
|
+
var deliverable_spec_source_scan_1 = require("./lib/deliverable-spec-source-scan");
|
|
56
|
+
Object.defineProperty(exports, "scanTopLevelZodObjectDeclarations", { enumerable: true, get: function () { return deliverable_spec_source_scan_1.scanTopLevelZodObjectDeclarations; } });
|
|
51
57
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflow/index.ts"],"names":[],"mappings":";;;AAeA,uCAAoE;AAA3D,0GAAA,gBAAgB,OAAA;AAAE,4GAAA,kBAAkB,OAAA;AAC7C,uEAIsC;AAHpC,8HAAA,oBAAoB,OAAA;AAItB,+EAI0C;AAHxC,sIAAA,wBAAwB,OAAA;AACxB,8IAAA,gCAAgC,OAAA;AAIlC,2CAOwB;AANtB,sHAAA,0BAA0B,OAAA;AAC1B,gIAAA,oCAAoC,OAAA;AACpC,wHAAA,4BAA4B,OAAA;AAC5B,kHAAA,sBAAsB,OAAA;AACtB,4HAAA,gCAAgC,OAAA;AAChC,oHAAA,wBAAwB,OAAA;AAE1B,+CAa0B;AAZxB,iHAAA,mBAAmB,OAAA;AACnB,gHAAA,kBAAkB,OAAA;AAClB,gHAAA,kBAAkB,OAAA;AAClB,4GAAA,cAAc,OAAA;AACd,+GAAA,iBAAiB,OAAA;AACjB,gHAAA,kBAAkB,OAAA;AAClB,mHAAA,qBAAqB,OAAA;AACrB,oHAAA,sBAAsB,OAAA;AACtB,gHAAA,kBAAkB,OAAA;AAKpB,2CAAiD;AAAxC,2GAAA,eAAe,OAAA;AACxB,yDAK+B;AAJ7B,yHAAA,sBAAsB,OAAA;AACtB,4HAAA,yBAAyB,OAAA;AACzB,kIAAA,+BAA+B,OAAA;AAGjC,uEAAkF;AAAzE,4HAAA,0BAA0B,OAAA;AACnC,+CAA6D;AAApD,uHAAA,yBAAyB,OAAA;AAClC,2CAawB;AAZtB,mHAAA,uBAAuB,OAAA;AACvB,6GAAA,iBAAiB,OAAA;AACjB,+GAAA,mBAAmB,OAAA;AACnB,kHAAA,sBAAsB,OAAA;AACtB,iHAAA,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A;AACtB,iHAAA,qBAAqB,OAAA;AACrB,2GAAA,eAAe,OAAA;AACf,wHAAA,4BAA4B,OAAA;AAC5B,+GAAA,mBAAmB,OAAA;AAMrB,qEAGqC;AAFnC,qIAAA,4BAA4B,OAAA;AAC5B,sIAAA,6BAA6B,OAAA;AAE/B,mGAIoD;AAHlD,yJAAA,iCAAiC,OAAA;AACjC,2JAAA,mCAAmC,OAAA;AACnC,2JAAA,mCAAmC,OAAA;AAErC,mFAAuF;AAA9E,iJAAA,iCAAiC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../src/workflow/lib/compiler/compile.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../src/workflow/lib/compiler/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,WAAW,EAGjB,MAAM,mCAAmC,CAAC;AAyC3C,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,SAAS,CAAC;AAmBjB,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,CA4ThE"}
|
|
@@ -19,7 +19,7 @@ const payload_reach_in_1 = require("./payload-reach-in");
|
|
|
19
19
|
const installation_resource_validator_1 = require("./installation-resource-validator");
|
|
20
20
|
const variable_requirements_1 = require("./variable-requirements");
|
|
21
21
|
function compileWorkflow(input) {
|
|
22
|
-
const { workflowRef, trigger, resolvedRefs,
|
|
22
|
+
const { workflowRef, trigger, resolvedRefs, workflowDefinitionContentHash } = input;
|
|
23
23
|
const workflow = (0, gate_defaults_1.applyGateDefaults)(input.workflow, resolvedRefs);
|
|
24
24
|
const inputs = (0, inputs_1.bindTriggerInputs)(workflow, trigger, input.previewMode ?? false);
|
|
25
25
|
const vars = workflow.vars ?? {};
|
|
@@ -49,6 +49,13 @@ function compileWorkflow(input) {
|
|
|
49
49
|
: authoredNeeds;
|
|
50
50
|
return { key, payload: decl, needs: merged };
|
|
51
51
|
}));
|
|
52
|
+
const manifestSourcesByJob = {};
|
|
53
|
+
for (const [jobKey, job] of Object.entries(workflow.jobs)) {
|
|
54
|
+
const resolved = lookupResolvedRef(job.uses, resolvedRefs);
|
|
55
|
+
manifestSourcesByJob[jobKey] = resolved.isReusableWorkflow
|
|
56
|
+
? null
|
|
57
|
+
: (0, manifest_source_1.compileManifestSource)(jobKey, job.with, resolved.actionManifest, input.resolvedAgents ?? {});
|
|
58
|
+
}
|
|
52
59
|
const compiledJobs = orderedJobs.map(({ key, payload, needs }) => {
|
|
53
60
|
const resolved = lookupResolvedRef(payload.uses, resolvedRefs);
|
|
54
61
|
const actionRef = {
|
|
@@ -61,7 +68,7 @@ function compileWorkflow(input) {
|
|
|
61
68
|
isReusableWorkflow: resolved.isReusableWorkflow,
|
|
62
69
|
inputsSchema: resolved.isReusableWorkflow
|
|
63
70
|
? null
|
|
64
|
-
: resolved.actionManifest?.spec.inputs ?? null,
|
|
71
|
+
: (resolved.actionManifest?.spec.inputs ?? null),
|
|
65
72
|
};
|
|
66
73
|
const jobPermissions = (0, permissions_1.normalizePermissions)(payload.permissions);
|
|
67
74
|
(0, permissions_1.assertJobPermissionsFit)(jobPermissions, permissions, key);
|
|
@@ -69,9 +76,7 @@ function compileWorkflow(input) {
|
|
|
69
76
|
const mountPlan = resolved.isReusableWorkflow
|
|
70
77
|
? { readOnly: {}, readWrite: {} }
|
|
71
78
|
: (0, mount_plan_1.compileMountPlan)(key, payload.with, resolved.actionManifest);
|
|
72
|
-
const manifestSource =
|
|
73
|
-
? null
|
|
74
|
-
: (0, manifest_source_1.compileManifestSource)(key, payload.with, resolved.actionManifest);
|
|
79
|
+
const manifestSource = manifestSourcesByJob[key] ?? null;
|
|
75
80
|
const retry = (0, retry_timeout_1.resolveJobRetry)(defaults.retry, resolved.actionManifest?.spec.retryDefaults ?? null, payload.retry);
|
|
76
81
|
const timeoutMs = (0, retry_timeout_1.resolveJobTimeout)(defaults.timeoutMs, resolved.actionManifest?.spec.timeoutDefaults ?? null, payload.timeout);
|
|
77
82
|
const ifExpression = payload.if !== undefined
|
|
@@ -82,7 +87,7 @@ function compileWorkflow(input) {
|
|
|
82
87
|
return rewritten;
|
|
83
88
|
})()
|
|
84
89
|
: null;
|
|
85
|
-
const compiledWith = (0, review_step_1.rewriteReviewStepWith)(key, payload, workflow);
|
|
90
|
+
const compiledWith = attachResolvedReviewerPins((0, review_step_1.rewriteReviewStepWith)(key, payload, workflow, manifestSourcesByJob), input.resolvedAgents ?? {});
|
|
86
91
|
(0, installation_resource_validator_1.validateInstallationResourceBindings)({
|
|
87
92
|
jobKey: key,
|
|
88
93
|
actionId: actionRef.id,
|
|
@@ -94,7 +99,9 @@ function compileWorkflow(input) {
|
|
|
94
99
|
jobKey: key,
|
|
95
100
|
title: payload.title ?? null,
|
|
96
101
|
needs,
|
|
97
|
-
matrixGather: Object.freeze([
|
|
102
|
+
matrixGather: Object.freeze([
|
|
103
|
+
...(payload.matrixGather ?? []),
|
|
104
|
+
]),
|
|
98
105
|
ifExpression,
|
|
99
106
|
strategy,
|
|
100
107
|
action: actionRef,
|
|
@@ -125,7 +132,7 @@ function compileWorkflow(input) {
|
|
|
125
132
|
defaults,
|
|
126
133
|
jobs: Object.freeze(compiledJobs),
|
|
127
134
|
snapshotCreatedAt,
|
|
128
|
-
|
|
135
|
+
workflowDefinitionContentHash,
|
|
129
136
|
workflowCallOutputs,
|
|
130
137
|
workflowOutputs,
|
|
131
138
|
...(input.briefcase !== undefined && { briefcase: input.briefcase }),
|
|
@@ -245,6 +252,18 @@ function validateJobLiteralReferences(jobKey, job, resolvedAgents, resolvedSpecs
|
|
|
245
252
|
if (resolvedAgents) {
|
|
246
253
|
assertLiteralAgent(jobKey, 'with.agentRef', withMap['agentRef'], resolvedAgents);
|
|
247
254
|
validateReviewerAgents(jobKey, withMap['reviewers'], resolvedAgents);
|
|
255
|
+
validateReviewerAgents(jobKey, withMap['recipients'], resolvedAgents);
|
|
256
|
+
const escalationChain = withMap['escalationChain'];
|
|
257
|
+
if (Array.isArray(escalationChain)) {
|
|
258
|
+
for (let i = 0; i < escalationChain.length; i++) {
|
|
259
|
+
const step = escalationChain[i];
|
|
260
|
+
if (step !== null &&
|
|
261
|
+
typeof step === 'object' &&
|
|
262
|
+
!Array.isArray(step)) {
|
|
263
|
+
validateReviewerAgents(jobKey, step['recipients'], resolvedAgents);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
248
267
|
}
|
|
249
268
|
if (resolvedSpecs) {
|
|
250
269
|
assertLiteralDeliverableSpec(jobKey, 'with.deliverableSpecRef', withMap['deliverableSpecRef'], resolvedSpecs);
|
|
@@ -263,8 +282,66 @@ function validateReviewerAgents(jobKey, reviewers, resolvedAgents) {
|
|
|
263
282
|
Array.isArray(reviewer)) {
|
|
264
283
|
continue;
|
|
265
284
|
}
|
|
266
|
-
assertLiteralAgent(jobKey, `with.reviewers[${i}].agentRef`, reviewer['agentRef'], resolvedAgents);
|
|
285
|
+
assertLiteralAgent(jobKey, `with.reviewers[${i}].agentRef`, reviewer['target']?.['agentRef'] ?? reviewer['agentRef'], resolvedAgents);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
function attachResolvedReviewerPins(withBlock, resolvedAgents) {
|
|
289
|
+
const pinRecipients = (value) => {
|
|
290
|
+
if (!Array.isArray(value))
|
|
291
|
+
return value;
|
|
292
|
+
return value.map((recipient) => {
|
|
293
|
+
if (recipient === null ||
|
|
294
|
+
typeof recipient !== 'object' ||
|
|
295
|
+
Array.isArray(recipient)) {
|
|
296
|
+
return recipient;
|
|
297
|
+
}
|
|
298
|
+
const record = recipient;
|
|
299
|
+
if (record['kind'] !== 'agent')
|
|
300
|
+
return recipient;
|
|
301
|
+
const target = record['target'];
|
|
302
|
+
if (target === null ||
|
|
303
|
+
typeof target !== 'object' ||
|
|
304
|
+
Array.isArray(target)) {
|
|
305
|
+
return recipient;
|
|
306
|
+
}
|
|
307
|
+
const targetRecord = target;
|
|
308
|
+
const agentRef = targetRecord['agentRef'];
|
|
309
|
+
if (!isLiteralStringValue(agentRef))
|
|
310
|
+
return recipient;
|
|
311
|
+
const resolved = resolvedAgents[agentRef];
|
|
312
|
+
if (resolved === undefined)
|
|
313
|
+
return recipient;
|
|
314
|
+
return Object.freeze({
|
|
315
|
+
...record,
|
|
316
|
+
target: Object.freeze({
|
|
317
|
+
...targetRecord,
|
|
318
|
+
agentRevisionPin: Object.freeze({
|
|
319
|
+
agentRevisionId: resolved.agentRevisionId,
|
|
320
|
+
agentContentHash: resolved.agentContentHash,
|
|
321
|
+
agentSlug: resolved.slug,
|
|
322
|
+
}),
|
|
323
|
+
}),
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
};
|
|
327
|
+
const out = { ...withBlock };
|
|
328
|
+
if ('reviewers' in out)
|
|
329
|
+
out['reviewers'] = pinRecipients(out['reviewers']);
|
|
330
|
+
if ('recipients' in out)
|
|
331
|
+
out['recipients'] = pinRecipients(out['recipients']);
|
|
332
|
+
if (Array.isArray(out['escalationChain'])) {
|
|
333
|
+
out['escalationChain'] = out['escalationChain'].map((step) => {
|
|
334
|
+
if (step === null || typeof step !== 'object' || Array.isArray(step)) {
|
|
335
|
+
return step;
|
|
336
|
+
}
|
|
337
|
+
const record = step;
|
|
338
|
+
return Object.freeze({
|
|
339
|
+
...record,
|
|
340
|
+
recipients: pinRecipients(record['recipients']),
|
|
341
|
+
});
|
|
342
|
+
});
|
|
267
343
|
}
|
|
344
|
+
return Object.freeze(out);
|
|
268
345
|
}
|
|
269
346
|
function isLiteralStringValue(value) {
|
|
270
347
|
return typeof value === 'string' && !value.includes('${{');
|
|
@@ -273,16 +350,16 @@ function assertLiteralAgent(jobKey, fieldPath, value, resolvedAgents) {
|
|
|
273
350
|
if (!isLiteralStringValue(value)) {
|
|
274
351
|
return;
|
|
275
352
|
}
|
|
276
|
-
|
|
277
|
-
if (resolvedAgents[slug] !== undefined) {
|
|
353
|
+
if (resolvedAgents[value] !== undefined) {
|
|
278
354
|
return;
|
|
279
355
|
}
|
|
280
356
|
const knownPreview = formatKnownPreview(Object.keys(resolvedAgents));
|
|
281
|
-
throw new errors_1.WorkflowDslError(workflow_1.WorkflowErrorCode.DSL_UNKNOWN_AGENT, `Job '${jobKey}' ${fieldPath} = '${value}' is not a registered agent. Known: [${knownPreview}].`, {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
357
|
+
throw new errors_1.WorkflowDslError(workflow_1.WorkflowErrorCode.DSL_UNKNOWN_AGENT, `Job '${jobKey}' ${fieldPath} = '${value}' is not a registered agent. Known: [${knownPreview}].`, {
|
|
358
|
+
jobKey,
|
|
359
|
+
fieldPath,
|
|
360
|
+
value,
|
|
361
|
+
knownCount: Object.keys(resolvedAgents).length,
|
|
362
|
+
});
|
|
286
363
|
}
|
|
287
364
|
function assertLiteralDeliverableSpec(jobKey, fieldPath, value, resolvedSpecs) {
|
|
288
365
|
if (!isLiteralStringValue(value)) {
|
|
@@ -371,7 +448,11 @@ function compileWorkflowOutputs(workflow) {
|
|
|
371
448
|
throw new errors_1.WorkflowDslError(workflow_1.WorkflowErrorCode.DSL_SEMANTIC_INVALID, `outputs.${name}: fromJob "${decl.fromJob}" is not a declared job`, { outputName: name, fromJob: decl.fromJob });
|
|
372
449
|
}
|
|
373
450
|
if (!job.outputs || !(decl.fromOutput in job.outputs)) {
|
|
374
|
-
throw new errors_1.WorkflowDslError(workflow_1.WorkflowErrorCode.DSL_SEMANTIC_INVALID, `outputs.${name}: job "${decl.fromJob}" does not declare an output named "${decl.fromOutput}"`, {
|
|
451
|
+
throw new errors_1.WorkflowDslError(workflow_1.WorkflowErrorCode.DSL_SEMANTIC_INVALID, `outputs.${name}: job "${decl.fromJob}" does not declare an output named "${decl.fromOutput}"`, {
|
|
452
|
+
outputName: name,
|
|
453
|
+
fromJob: decl.fromJob,
|
|
454
|
+
fromOutput: decl.fromOutput,
|
|
455
|
+
});
|
|
375
456
|
}
|
|
376
457
|
if (seenSlugs.has(decl.slug)) {
|
|
377
458
|
throw new errors_1.WorkflowDslError(workflow_1.WorkflowErrorCode.DSL_SEMANTIC_INVALID, `outputs.${name}: slug "${decl.slug}" is already used by another output`, { outputName: name, slug: decl.slug });
|
|
@@ -422,7 +503,9 @@ function validateMatrixGather(doc) {
|
|
|
422
503
|
if (!targetDecl) {
|
|
423
504
|
throw new errors_1.WorkflowDslError(workflow_1.WorkflowErrorCode.DSL_SEMANTIC_INVALID, `Job '${jobKey}' matrixGather references unknown job '${target}'.`, { jobKey, target });
|
|
424
505
|
}
|
|
425
|
-
if (!targetDecl.strategy ||
|
|
506
|
+
if (!targetDecl.strategy ||
|
|
507
|
+
(!('matrix' in targetDecl.strategy) &&
|
|
508
|
+
!('dynamic' in targetDecl.strategy))) {
|
|
426
509
|
throw new errors_1.WorkflowDslError(workflow_1.WorkflowErrorCode.DSL_SEMANTIC_INVALID, `Job '${jobKey}' matrixGather references '${target}' which has no matrix/dynamic strategy; gathering only makes sense across matrix entries.`, { jobKey, target });
|
|
427
510
|
}
|
|
428
511
|
}
|
|
@@ -576,7 +659,8 @@ function validateNeedsAccess(doc, consumerJobKey, fieldPath, consumerBinding, ac
|
|
|
576
659
|
return;
|
|
577
660
|
}
|
|
578
661
|
const keyBy = isDynamicMatrix
|
|
579
|
-
? upstream.strategy.dynamic.keyBy ??
|
|
662
|
+
? (upstream.strategy.dynamic.keyBy ??
|
|
663
|
+
null)
|
|
580
664
|
: null;
|
|
581
665
|
if (access.steps.length === 0)
|
|
582
666
|
return;
|
|
@@ -666,7 +750,8 @@ function collectMatrixMemberPath(node) {
|
|
|
666
750
|
}
|
|
667
751
|
function assertStrategyInvariants(compiled) {
|
|
668
752
|
for (const job of compiled.jobs) {
|
|
669
|
-
if (job.strategy.kind === workflow_1.MatrixStrategyKind.STATIC &&
|
|
753
|
+
if (job.strategy.kind === workflow_1.MatrixStrategyKind.STATIC &&
|
|
754
|
+
job.strategy.entries.length === 0) {
|
|
670
755
|
throw new errors_1.WorkflowDslError(workflow_1.WorkflowErrorCode.DSL_SEMANTIC_INVALID, `Job '${job.jobKey}' static strategy expansion produced zero entries.`, { jobKey: job.jobKey });
|
|
671
756
|
}
|
|
672
757
|
}
|