@studio-foundation/engine 0.4.0-beta → 0.5.2
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 +1 -1
- package/dist/__tests__/engine.script-stage.test.js +13 -32
- package/dist/__tests__/engine.script-stage.test.js.map +1 -1
- package/dist/engine.d.ts +2 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +134 -1
- package/dist/engine.js.map +1 -1
- package/dist/events.d.ts +48 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/pipeline/call-input.d.ts +4 -0
- package/dist/pipeline/call-input.d.ts.map +1 -0
- package/dist/pipeline/call-input.js +28 -0
- package/dist/pipeline/call-input.js.map +1 -0
- package/dist/pipeline/call-orchestrator.d.ts +21 -0
- package/dist/pipeline/call-orchestrator.d.ts.map +1 -0
- package/dist/pipeline/call-orchestrator.js +127 -0
- package/dist/pipeline/call-orchestrator.js.map +1 -0
- package/dist/pipeline/condition-evaluator.d.ts +12 -0
- package/dist/pipeline/condition-evaluator.d.ts.map +1 -1
- package/dist/pipeline/condition-evaluator.js +27 -9
- package/dist/pipeline/condition-evaluator.js.map +1 -1
- package/dist/pipeline/context-propagation.d.ts +1 -0
- package/dist/pipeline/context-propagation.d.ts.map +1 -1
- package/dist/pipeline/context-propagation.js +18 -0
- package/dist/pipeline/context-propagation.js.map +1 -1
- package/dist/pipeline/contract-loader.d.ts.map +1 -1
- package/dist/pipeline/contract-loader.js +67 -0
- package/dist/pipeline/contract-loader.js.map +1 -1
- package/dist/pipeline/external-validator.d.ts +3 -0
- package/dist/pipeline/external-validator.d.ts.map +1 -0
- package/dist/pipeline/external-validator.js +65 -0
- package/dist/pipeline/external-validator.js.map +1 -0
- package/dist/pipeline/external-validator.test.d.ts +2 -0
- package/dist/pipeline/external-validator.test.d.ts.map +1 -0
- package/dist/pipeline/external-validator.test.js +40 -0
- package/dist/pipeline/external-validator.test.js.map +1 -0
- package/dist/pipeline/loader.d.ts.map +1 -1
- package/dist/pipeline/loader.js +154 -1
- package/dist/pipeline/loader.js.map +1 -1
- package/dist/pipeline/loader.test.js +30 -0
- package/dist/pipeline/loader.test.js.map +1 -1
- package/dist/pipeline/map-input.d.ts +13 -0
- package/dist/pipeline/map-input.d.ts.map +1 -0
- package/dist/pipeline/map-input.js +80 -0
- package/dist/pipeline/map-input.js.map +1 -0
- package/dist/pipeline/map-orchestrator.d.ts +35 -0
- package/dist/pipeline/map-orchestrator.d.ts.map +1 -0
- package/dist/pipeline/map-orchestrator.js +223 -0
- package/dist/pipeline/map-orchestrator.js.map +1 -0
- package/dist/pipeline/output-checker.d.ts +3 -0
- package/dist/pipeline/output-checker.d.ts.map +1 -0
- package/dist/pipeline/output-checker.js +40 -0
- package/dist/pipeline/output-checker.js.map +1 -0
- package/dist/pipeline/output-checker.test.d.ts +2 -0
- package/dist/pipeline/output-checker.test.d.ts.map +1 -0
- package/dist/pipeline/output-checker.test.js +62 -0
- package/dist/pipeline/output-checker.test.js.map +1 -0
- package/dist/pipeline/stage-executor.d.ts.map +1 -1
- package/dist/pipeline/stage-executor.js +48 -9
- package/dist/pipeline/stage-executor.js.map +1 -1
- package/dist/pipeline/stage-resolver.js +1 -1
- package/dist/pipeline/stage-resolver.js.map +1 -1
- package/dist/pipeline/strict-fields.d.ts +20 -0
- package/dist/pipeline/strict-fields.d.ts.map +1 -0
- package/dist/pipeline/strict-fields.js +62 -0
- package/dist/pipeline/strict-fields.js.map +1 -0
- package/dist/pipeline/task-input.d.ts +14 -0
- package/dist/pipeline/task-input.d.ts.map +1 -0
- package/dist/pipeline/task-input.js +22 -0
- package/dist/pipeline/task-input.js.map +1 -0
- package/dist/pipeline/task-input.test.d.ts +2 -0
- package/dist/pipeline/task-input.test.d.ts.map +1 -0
- package/dist/pipeline/task-input.test.js +33 -0
- package/dist/pipeline/task-input.test.js.map +1 -0
- package/dist/pipeline/template-interpolation.d.ts +9 -0
- package/dist/pipeline/template-interpolation.d.ts.map +1 -0
- package/dist/pipeline/template-interpolation.js +33 -0
- package/dist/pipeline/template-interpolation.js.map +1 -0
- package/dist/state/status-derivation.js +3 -3
- package/dist/state/status-derivation.js.map +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Shared {{...}} template interpolation for sub-pipeline input mapping.
|
|
2
|
+
//
|
|
3
|
+
// Both fan-out (`map`) and one-shot (`call`) stages build a child run's input
|
|
4
|
+
// from a template of `{{ref}}` references. They differ only in *what* a ref
|
|
5
|
+
// resolves against — a map has an item/index scope, a call reads the parent
|
|
6
|
+
// context — so the substitution mechanics live here once and each caller passes
|
|
7
|
+
// its own resolver.
|
|
8
|
+
function stringify(value) {
|
|
9
|
+
if (value === undefined || value === null)
|
|
10
|
+
return '';
|
|
11
|
+
if (typeof value === 'string')
|
|
12
|
+
return value;
|
|
13
|
+
if (typeof value === 'object')
|
|
14
|
+
return JSON.stringify(value);
|
|
15
|
+
return String(value);
|
|
16
|
+
}
|
|
17
|
+
const SOLE_TOKEN = /^\{\{([^}]+)\}\}$/;
|
|
18
|
+
const TOKEN = /\{\{([^}]+)\}\}/g;
|
|
19
|
+
/**
|
|
20
|
+
* Interpolate a template value against a reference resolver. Non-strings pass
|
|
21
|
+
* through unchanged. A string that is exactly one `{{ref}}` keeps the resolved
|
|
22
|
+
* value's native type (so an object/array stays structured); any other string
|
|
23
|
+
* interpolates each `{{ref}}` to text.
|
|
24
|
+
*/
|
|
25
|
+
export function interpolateTemplate(value, resolve) {
|
|
26
|
+
if (typeof value !== 'string')
|
|
27
|
+
return value;
|
|
28
|
+
const sole = value.match(SOLE_TOKEN);
|
|
29
|
+
if (sole)
|
|
30
|
+
return resolve(sole[1].trim());
|
|
31
|
+
return value.replace(TOKEN, (_full, ref) => stringify(resolve(ref.trim())));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=template-interpolation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-interpolation.js","sourceRoot":"","sources":["../../src/pipeline/template-interpolation.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAC5E,gFAAgF;AAChF,oBAAoB;AAIpB,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IACrD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC5D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,GAAG,mBAAmB,CAAC;AACvC,MAAM,KAAK,GAAG,kBAAkB,CAAC;AAEjC;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc,EAAE,OAAoB;IACtE,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE5C,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACrC,IAAI,IAAI;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAEzC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Derive stage status from ralph result
|
|
2
2
|
// THIS IS THE CRITICAL FUNCTION
|
|
3
3
|
//
|
|
4
|
-
//
|
|
4
|
+
// Each stage = 1 ralph call = 1 task.
|
|
5
5
|
// This function maps ralph's result directly to stage status.
|
|
6
6
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
7
|
+
// An earlier architectural bug let stage status drift from task status.
|
|
8
|
+
// The fix: SIMPLE, DETERMINISTIC, NO MAGIC.
|
|
9
9
|
/**
|
|
10
10
|
* Derives stage status from ralph result.
|
|
11
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-derivation.js","sourceRoot":"","sources":["../../src/state/status-derivation.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,gCAAgC;AAChC,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"status-derivation.js","sourceRoot":"","sources":["../../src/state/status-derivation.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,gCAAgC;AAChC,EAAE;AACF,sCAAsC;AACtC,8DAA8D;AAC9D,EAAE;AACF,wEAAwE;AACxE,4CAA4C;AAK5C;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,WAAiC;IACjE,IAAI,WAAW,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QACvC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;QACvC,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,8DAA8D;IAC9D,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AAC1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studio-foundation/engine",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Pipeline orchestration
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "Pipeline orchestration, state machine, and lifecycle hooks for Studio",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"better-sqlite3": "^9.0.0",
|
|
27
27
|
"js-yaml": "^4.1.0",
|
|
28
28
|
"pg": "^8.19.0",
|
|
29
|
-
"@studio-foundation/contracts": "0.
|
|
30
|
-
"@studio-foundation/
|
|
31
|
-
"@studio-foundation/
|
|
29
|
+
"@studio-foundation/contracts": "0.5.2",
|
|
30
|
+
"@studio-foundation/runner": "0.5.2",
|
|
31
|
+
"@studio-foundation/ralph": "0.5.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/better-sqlite3": "^7.6.8",
|