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.
Files changed (52) hide show
  1. package/browser/asset-integrity.json +2 -2
  2. package/browser/board-livecards-localstorage.js +5 -5
  3. package/cli/browser-api/board-live-cards-browser-adapter.d.ts +2 -2
  4. package/cli/{execution-interface-C_A6WCiK.d.ts → execution-interface-ftO1W7Po.d.ts} +4 -2
  5. package/cli/node/board-live-cards-cli.js +7 -7
  6. package/cli/node/card-store-cli.js +1 -1
  7. package/cli/node/execution-adapter.d.ts +47 -2
  8. package/cli/node/execution-adapter.js +2 -2
  9. package/cli/node/fs-board-adapter.d.ts +4 -4
  10. package/cli/node/fs-board-adapter.js +7 -7
  11. package/cli/node/step-machine-cli.js +4 -4
  12. package/cli/{types-CziUxkiv.d.ts → types-C2YQXFwo.d.ts} +1 -1
  13. package/examples/ARCHITECTURE.md +188 -0
  14. package/examples/board/demo-shell-with-server.html +2 -2
  15. package/examples/board-local/demo-shell-localstorage.html +3 -3
  16. package/examples/step-machine-cli/json/double-handler.js +20 -0
  17. package/examples/step-machine-cli/json/mixed-handlers.flow.json +118 -0
  18. package/examples/step-machine-cli/json/mixed-handlers.input.json +5 -0
  19. package/examples/step-machine-cli/json/scale-handler.js +13 -0
  20. package/examples/step-machine-cli/yaml/double-handler.js +20 -0
  21. package/examples/step-machine-cli/yaml/mixed-handlers.flow.yaml +94 -0
  22. package/examples/step-machine-cli/yaml/mixed-handlers.input.json +5 -0
  23. package/examples/step-machine-cli/yaml/scale-handler.js +13 -0
  24. package/lib/board-live-cards-node.cjs +7 -7
  25. package/lib/board-live-cards-node.d.cts +46 -2
  26. package/lib/board-live-cards-node.d.ts +46 -2
  27. package/lib/board-live-cards-node.js +7 -7
  28. package/lib/board-live-cards-public.cjs +1 -1
  29. package/lib/board-live-cards-public.js +1 -1
  30. package/lib/board-live-cards-server-runtime.cjs +2 -2
  31. package/lib/board-live-cards-server-runtime.js +2 -2
  32. package/lib/execution-refs.cjs +1 -1
  33. package/lib/execution-refs.d.cts +4 -2
  34. package/lib/execution-refs.d.ts +4 -2
  35. package/lib/execution-refs.js +1 -1
  36. package/lib/server-runtime/index.cjs +2 -2
  37. package/lib/server-runtime/index.js +2 -2
  38. package/package.json +4 -4
  39. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/card-store-ref.json +0 -1
  40. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/chat-handler.json +0 -1
  41. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/outputs-store-ref.json +0 -1
  42. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.config/task-executor.json +0 -1
  43. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.state-snapshot/board/graph.json +0 -29
  44. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime/.state-snapshot/board/lastJournalProcessedId.json +0 -1
  45. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/gandalf-runtime-out/.outputs/status.json +0 -25
  46. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-market-prices/computed_values.json +0 -67
  47. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-portfolio/computed_values.json +0 -1
  48. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/cards/card-portfolio-value/computed_values.json +0 -52
  49. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/holdings.json +0 -22
  50. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/positions.json +0 -46
  51. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/data-objects/quotes.json +0 -35
  52. package/examples/board/.demo-setup/run-1778643703151-3360-dopnpv/board-default/runtime-out/.outputs/status.json +0 -113
@@ -4,12 +4,38 @@ import { a as KindValueRef } from './storage-interface-BhAON-gW.cjs';
4
4
  export { p as parseRef, s as serializeRef } from './storage-interface-BhAON-gW.cjs';
5
5
  import { e as BoardNonCorePlatformAdapter, d as BoardPlatformAdapter } from './board-live-cards-public-BnmRAbQV.cjs';
6
6
  export { f as BOARD_GRAPH_KEY, g as BoardLiveCardsNonCorePublic, c as BoardLiveCardsPublic, C as CommandInput, a as CommandResult, E as EMPTY_CONFIG, L as LiveCard, S as SNAPSHOT_SCHEMA_VERSION_V1, h as createBoardLiveCardsNonCorePublic, i as createBoardLiveCardsPublic, j as createCardStore } from './board-live-cards-public-BnmRAbQV.cjs';
7
- import { ExecutionRef } from './execution-refs.cjs';
7
+ import { ExecutionRef, ArgsMassaging } from './execution-refs.cjs';
8
8
  export { executionRefFromScriptPath, parseExecutionRef, serializeExecutionRef } from './execution-refs.cjs';
9
9
  export { createCardStorePublic } from './card-store-public.cjs';
10
10
  export { c as createArtifactsStore, a as createArtifactsStorePublic, b as createCardFileMetadataStore, d as createChatArtifactsStore, e as createFileArtifactsStore } from './artifacts-store-lib-public-DGa8BpJT.cjs';
11
11
  import './types-BBhqYGhE.cjs';
12
12
 
13
+ /**
14
+ * cli/common/args-massaging — JSONata-based mapping from logical args to
15
+ * transport-specific shape.
16
+ *
17
+ * `argsMassaging` is a property of `ExecutionRef`, so honoring it is the job
18
+ * of every adapter (Node spawn, HTTP, Azure Function, etc.). This helper is
19
+ * the shared pure-JSONata implementation reused by all adapters.
20
+ *
21
+ * Adapters call this as the first step inside their `invokeRefSync` /
22
+ * `dispatchExecution` implementation, then perform their transport using
23
+ * `cmdArgs` / `body` / `url`.
24
+ */
25
+
26
+ interface MassagedArgs {
27
+ /** Resolved argv tail for local transports. */
28
+ cmdArgs?: string[];
29
+ /** Resolved stdin payload for local transports. */
30
+ stdin?: unknown;
31
+ /** Resolved final URL string for http transports. */
32
+ url?: string;
33
+ /** Resolved request headers for http transports. */
34
+ headers?: Record<string, string>;
35
+ /** Resolved request body for http transports. */
36
+ body?: unknown;
37
+ }
38
+
13
39
  /**
14
40
  * execution-adapter.ts
15
41
  *
@@ -73,6 +99,24 @@ interface InvokeRefSyncOptions {
73
99
  /** Label used in error messages (default: 'invokeRefSync'). */
74
100
  label?: string;
75
101
  }
102
+ interface InvokeExecutionRefOptions extends InvokeRefSyncOptions {
103
+ /** Extra async transport handlers keyed by `ExecutionRef.howToRun`. */
104
+ transports?: Record<string, TransportInvoker>;
105
+ /** Extra synchronous transport handlers keyed by `ExecutionRef.howToRun`. */
106
+ syncTransports?: Record<string, SyncTransportInvoker>;
107
+ }
108
+ type TransportInvoker = (ref: ExecutionRef, args: Record<string, unknown>, options?: InvokeExecutionRefOptions) => Promise<InvokeRefResult>;
109
+ type SyncTransportInvoker = (ref: ExecutionRef, args: Record<string, unknown>, options?: InvokeExecutionRefOptions) => InvokeRefResult;
110
+ interface CreateExecutionRefInvokerOptions extends InvokeExecutionRefOptions {
111
+ }
112
+ interface ExecutionRefInvoker {
113
+ invoke(ref: ExecutionRef, args: Record<string, unknown>): Promise<InvokeRefResult>;
114
+ invokeSync(ref: ExecutionRef, args: Record<string, unknown>): InvokeRefResult;
115
+ }
116
+ declare function evaluateArgsMassaging(argsMassaging: ArgsMassaging | undefined, args: Record<string, unknown>, label?: string): MassagedArgs;
117
+ declare function invokeExecutionRef(ref: ExecutionRef, args: Record<string, unknown>, options?: InvokeExecutionRefOptions): Promise<InvokeRefResult>;
118
+ declare function invokeExecutionRefSync(ref: ExecutionRef, args: Record<string, unknown>, options?: InvokeExecutionRefOptions): InvokeRefResult;
119
+ declare function createExecutionRefInvoker(options?: CreateExecutionRefInvokerOptions): ExecutionRefInvoker;
76
120
  /**
77
121
  * Invoke an ExecutionRef synchronously with a request/reply contract.
78
122
  *
@@ -131,4 +175,4 @@ declare function createFsBoardNonCorePlatformAdapter(baseRef: KindValueRef, cliD
131
175
  */
132
176
  declare function decodeBoardRefFromToken(token: string): string | null;
133
177
 
134
- export { BoardNonCorePlatformAdapter, BoardPlatformAdapter, ExecutionRef, InvocationAdapter, KindValueRef, createFsBoardNonCorePlatformAdapter, createFsBoardPlatformAdapter, createNodeSpawnInvocationAdapter, decodeBoardRefFromToken, invokeRefSync };
178
+ export { BoardNonCorePlatformAdapter, BoardPlatformAdapter, type CreateExecutionRefInvokerOptions, ExecutionRef, type ExecutionRefInvoker, InvocationAdapter, type InvokeExecutionRefOptions, type InvokeRefResult, KindValueRef, type SyncTransportInvoker, type TransportInvoker, createExecutionRefInvoker, createFsBoardNonCorePlatformAdapter, createFsBoardPlatformAdapter, createNodeSpawnInvocationAdapter, decodeBoardRefFromToken, evaluateArgsMassaging, invokeExecutionRef, invokeExecutionRefSync, invokeRefSync };
@@ -4,12 +4,38 @@ import { a as KindValueRef } from './storage-interface-BhAON-gW.js';
4
4
  export { p as parseRef, s as serializeRef } from './storage-interface-BhAON-gW.js';
5
5
  import { e as BoardNonCorePlatformAdapter, d as BoardPlatformAdapter } from './board-live-cards-public-CsmYrvpd.js';
6
6
  export { f as BOARD_GRAPH_KEY, g as BoardLiveCardsNonCorePublic, c as BoardLiveCardsPublic, C as CommandInput, a as CommandResult, E as EMPTY_CONFIG, L as LiveCard, S as SNAPSHOT_SCHEMA_VERSION_V1, h as createBoardLiveCardsNonCorePublic, i as createBoardLiveCardsPublic, j as createCardStore } from './board-live-cards-public-CsmYrvpd.js';
7
- import { ExecutionRef } from './execution-refs.js';
7
+ import { ExecutionRef, ArgsMassaging } from './execution-refs.js';
8
8
  export { executionRefFromScriptPath, parseExecutionRef, serializeExecutionRef } from './execution-refs.js';
9
9
  export { createCardStorePublic } from './card-store-public.js';
10
10
  export { c as createArtifactsStore, a as createArtifactsStorePublic, b as createCardFileMetadataStore, d as createChatArtifactsStore, e as createFileArtifactsStore } from './artifacts-store-lib-public-BABrgFkV.js';
11
11
  import './types-BBhqYGhE.js';
12
12
 
13
+ /**
14
+ * cli/common/args-massaging — JSONata-based mapping from logical args to
15
+ * transport-specific shape.
16
+ *
17
+ * `argsMassaging` is a property of `ExecutionRef`, so honoring it is the job
18
+ * of every adapter (Node spawn, HTTP, Azure Function, etc.). This helper is
19
+ * the shared pure-JSONata implementation reused by all adapters.
20
+ *
21
+ * Adapters call this as the first step inside their `invokeRefSync` /
22
+ * `dispatchExecution` implementation, then perform their transport using
23
+ * `cmdArgs` / `body` / `url`.
24
+ */
25
+
26
+ interface MassagedArgs {
27
+ /** Resolved argv tail for local transports. */
28
+ cmdArgs?: string[];
29
+ /** Resolved stdin payload for local transports. */
30
+ stdin?: unknown;
31
+ /** Resolved final URL string for http transports. */
32
+ url?: string;
33
+ /** Resolved request headers for http transports. */
34
+ headers?: Record<string, string>;
35
+ /** Resolved request body for http transports. */
36
+ body?: unknown;
37
+ }
38
+
13
39
  /**
14
40
  * execution-adapter.ts
15
41
  *
@@ -73,6 +99,24 @@ interface InvokeRefSyncOptions {
73
99
  /** Label used in error messages (default: 'invokeRefSync'). */
74
100
  label?: string;
75
101
  }
102
+ interface InvokeExecutionRefOptions extends InvokeRefSyncOptions {
103
+ /** Extra async transport handlers keyed by `ExecutionRef.howToRun`. */
104
+ transports?: Record<string, TransportInvoker>;
105
+ /** Extra synchronous transport handlers keyed by `ExecutionRef.howToRun`. */
106
+ syncTransports?: Record<string, SyncTransportInvoker>;
107
+ }
108
+ type TransportInvoker = (ref: ExecutionRef, args: Record<string, unknown>, options?: InvokeExecutionRefOptions) => Promise<InvokeRefResult>;
109
+ type SyncTransportInvoker = (ref: ExecutionRef, args: Record<string, unknown>, options?: InvokeExecutionRefOptions) => InvokeRefResult;
110
+ interface CreateExecutionRefInvokerOptions extends InvokeExecutionRefOptions {
111
+ }
112
+ interface ExecutionRefInvoker {
113
+ invoke(ref: ExecutionRef, args: Record<string, unknown>): Promise<InvokeRefResult>;
114
+ invokeSync(ref: ExecutionRef, args: Record<string, unknown>): InvokeRefResult;
115
+ }
116
+ declare function evaluateArgsMassaging(argsMassaging: ArgsMassaging | undefined, args: Record<string, unknown>, label?: string): MassagedArgs;
117
+ declare function invokeExecutionRef(ref: ExecutionRef, args: Record<string, unknown>, options?: InvokeExecutionRefOptions): Promise<InvokeRefResult>;
118
+ declare function invokeExecutionRefSync(ref: ExecutionRef, args: Record<string, unknown>, options?: InvokeExecutionRefOptions): InvokeRefResult;
119
+ declare function createExecutionRefInvoker(options?: CreateExecutionRefInvokerOptions): ExecutionRefInvoker;
76
120
  /**
77
121
  * Invoke an ExecutionRef synchronously with a request/reply contract.
78
122
  *
@@ -131,4 +175,4 @@ declare function createFsBoardNonCorePlatformAdapter(baseRef: KindValueRef, cliD
131
175
  */
132
176
  declare function decodeBoardRefFromToken(token: string): string | null;
133
177
 
134
- export { BoardNonCorePlatformAdapter, BoardPlatformAdapter, ExecutionRef, InvocationAdapter, KindValueRef, createFsBoardNonCorePlatformAdapter, createFsBoardPlatformAdapter, createNodeSpawnInvocationAdapter, decodeBoardRefFromToken, invokeRefSync };
178
+ export { BoardNonCorePlatformAdapter, BoardPlatformAdapter, type CreateExecutionRefInvokerOptions, ExecutionRef, type ExecutionRefInvoker, InvocationAdapter, type InvokeExecutionRefOptions, type InvokeRefResult, KindValueRef, type SyncTransportInvoker, type TransportInvoker, createExecutionRefInvoker, createFsBoardNonCorePlatformAdapter, createFsBoardPlatformAdapter, createNodeSpawnInvocationAdapter, decodeBoardRefFromToken, evaluateArgsMassaging, invokeExecutionRef, invokeExecutionRefSync, invokeRefSync };