yaml-flow 8.0.0 → 8.0.3
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/browser/asset-integrity.json +2 -2
- package/browser/board-livecards-localstorage.js +5 -5
- package/cli/browser-api/board-live-cards-browser-adapter.d.ts +2 -2
- package/cli/{execution-interface-C_A6WCiK.d.ts → execution-interface-ftO1W7Po.d.ts} +4 -2
- package/cli/node/board-live-cards-cli.js +7 -7
- package/cli/node/card-store-cli.js +1 -1
- package/cli/node/execution-adapter.d.ts +47 -2
- package/cli/node/execution-adapter.js +2 -2
- package/cli/node/fs-board-adapter.d.ts +4 -4
- package/cli/node/fs-board-adapter.js +7 -7
- package/cli/node/step-machine-cli.js +4 -4
- package/cli/{types-CziUxkiv.d.ts → types-C2YQXFwo.d.ts} +1 -1
- package/examples/ARCHITECTURE.md +188 -0
- package/examples/board/demo-shell-with-server.html +2 -2
- package/examples/board-local/demo-shell-localstorage.html +3 -3
- package/examples/step-machine-cli/json/double-handler.js +20 -0
- package/examples/step-machine-cli/json/mixed-handlers.flow.json +118 -0
- package/examples/step-machine-cli/json/mixed-handlers.input.json +5 -0
- package/examples/step-machine-cli/json/scale-handler.js +13 -0
- package/examples/step-machine-cli/yaml/double-handler.js +20 -0
- package/examples/step-machine-cli/yaml/mixed-handlers.flow.yaml +94 -0
- package/examples/step-machine-cli/yaml/mixed-handlers.input.json +5 -0
- package/examples/step-machine-cli/yaml/scale-handler.js +13 -0
- package/lib/board-live-cards-node.cjs +7 -7
- package/lib/board-live-cards-node.d.cts +46 -2
- package/lib/board-live-cards-node.d.ts +46 -2
- package/lib/board-live-cards-node.js +7 -7
- package/lib/board-live-cards-public.cjs +1 -1
- package/lib/board-live-cards-public.js +1 -1
- package/lib/board-live-cards-server-runtime.cjs +2 -2
- package/lib/board-live-cards-server-runtime.js +2 -2
- package/lib/execution-refs.cjs +1 -1
- package/lib/execution-refs.d.cts +4 -2
- package/lib/execution-refs.d.ts +4 -2
- package/lib/execution-refs.js +1 -1
- package/lib/server-runtime/index.cjs +2 -2
- package/lib/server-runtime/index.js +2 -2
- package/package.json +4 -4
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/card-store-ref.json +0 -1
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/chat-handler.json +0 -1
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/outputs-store-ref.json +0 -1
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/task-executor.json +0 -1
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.state-snapshot/board/graph.json +0 -29
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.state-snapshot/board/lastJournalProcessedId.json +0 -1
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime-out/.outputs/status.json +0 -25
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-market-prices/computed_values.json +0 -67
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-portfolio/computed_values.json +0 -1
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-portfolio-value/computed_values.json +0 -52
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/holdings.json +0 -22
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/positions.json +0 -46
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/quotes.json +0 -35
- package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/status.json +0 -113
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
id: mixed-handlers-demo
|
|
2
|
+
settings:
|
|
3
|
+
start_step: step1_compute
|
|
4
|
+
max_total_steps: 15
|
|
5
|
+
timeout_ms: 15000
|
|
6
|
+
|
|
7
|
+
steps:
|
|
8
|
+
step1_compute:
|
|
9
|
+
description: Inline compute — adds two numbers using JSONata
|
|
10
|
+
expects_data: [a, b]
|
|
11
|
+
produces_data: [sum]
|
|
12
|
+
input_validations:
|
|
13
|
+
- $type(a) = "number"
|
|
14
|
+
- $type(b) = "number"
|
|
15
|
+
handler:
|
|
16
|
+
type: compute-jsonata
|
|
17
|
+
expr:
|
|
18
|
+
- data.sum = expects_data.a + expects_data.b
|
|
19
|
+
- result = "success"
|
|
20
|
+
transitions:
|
|
21
|
+
success: step2_ref
|
|
22
|
+
failure: failed_state
|
|
23
|
+
|
|
24
|
+
step2_ref:
|
|
25
|
+
description: Ref handler — doubles the sum via an external Node script
|
|
26
|
+
expects_data: [sum]
|
|
27
|
+
produces_data: [doubled]
|
|
28
|
+
handler:
|
|
29
|
+
type: ref
|
|
30
|
+
howToRun: local-node
|
|
31
|
+
whatToRun: {kind: fs-path, value: ./double-handler.js}
|
|
32
|
+
transitions:
|
|
33
|
+
success: step3_scale_each
|
|
34
|
+
failure: failed_state
|
|
35
|
+
|
|
36
|
+
step3_scale_each:
|
|
37
|
+
description: forEach + compute-jsonata — scale doubled value by each multiplier
|
|
38
|
+
expects_data: [doubled, multipliers]
|
|
39
|
+
produces_data: [scaled_values]
|
|
40
|
+
forEach:
|
|
41
|
+
items: multipliers
|
|
42
|
+
as: multiplier
|
|
43
|
+
concurrency: 3
|
|
44
|
+
collectAs: scaled_values
|
|
45
|
+
handler:
|
|
46
|
+
type: compute-jsonata
|
|
47
|
+
expr:
|
|
48
|
+
- data.value = expects_data.doubled * expects_data.multiplier
|
|
49
|
+
- result = "success"
|
|
50
|
+
transitions:
|
|
51
|
+
success: step4_ref_each
|
|
52
|
+
failure: failed_state
|
|
53
|
+
|
|
54
|
+
step4_ref_each:
|
|
55
|
+
description: forEach + ref — re-scale each value via an external Node script
|
|
56
|
+
expects_data: [scaled_values]
|
|
57
|
+
produces_data: [final_values]
|
|
58
|
+
forEach:
|
|
59
|
+
items: scaled_values
|
|
60
|
+
as: item
|
|
61
|
+
concurrency: 3
|
|
62
|
+
collectAs: final_values
|
|
63
|
+
handler:
|
|
64
|
+
type: ref
|
|
65
|
+
howToRun: local-node
|
|
66
|
+
whatToRun: {kind: fs-path, value: ./scale-handler.js}
|
|
67
|
+
argsMassaging:
|
|
68
|
+
cmdTemplate:
|
|
69
|
+
- "$string(item.value)"
|
|
70
|
+
- "'2'"
|
|
71
|
+
transitions:
|
|
72
|
+
success: step5_grade
|
|
73
|
+
failure: failed_state
|
|
74
|
+
|
|
75
|
+
step5_grade:
|
|
76
|
+
description: Inline compute — classifies whether any final value exceeds 200
|
|
77
|
+
expects_data: [final_values]
|
|
78
|
+
produces_data: [grade]
|
|
79
|
+
handler:
|
|
80
|
+
type: compute-jsonata
|
|
81
|
+
expr:
|
|
82
|
+
- 'data.grade = $max(expects_data.final_values.scaled) >= 200 ? "large" : "small"'
|
|
83
|
+
- result = "success"
|
|
84
|
+
transitions:
|
|
85
|
+
success: success_state
|
|
86
|
+
failure: failed_state
|
|
87
|
+
|
|
88
|
+
terminal_states:
|
|
89
|
+
success_state:
|
|
90
|
+
return_intent: success
|
|
91
|
+
return_artifacts: [a, b, sum, doubled, scaled_values, final_values, grade]
|
|
92
|
+
failed_state:
|
|
93
|
+
return_intent: failure
|
|
94
|
+
return_artifacts: [error]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Ref handler: takes value and multiplier as CLI args, writes JSON to stdout.
|
|
3
|
+
// Usage: node scale-handler.js <value> <multiplier>
|
|
4
|
+
|
|
5
|
+
const value = Number(process.argv[2]);
|
|
6
|
+
const multiplier = Number(process.argv[3]);
|
|
7
|
+
|
|
8
|
+
if (!Number.isFinite(value) || !Number.isFinite(multiplier)) {
|
|
9
|
+
process.stderr.write('scale-handler requires numeric value and multiplier as CLI args\n');
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
process.stdout.write(JSON.stringify({ scaled: value * multiplier }));
|