yaml-flow 5.4.2 → 6.0.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.
Files changed (199) hide show
  1. package/board-live-cards-cli.js +2 -2
  2. package/board-livecards-server-runtime.js +486 -547
  3. package/browser/asset-integrity.json +10 -0
  4. package/browser/board-livegraph-engine.js +2 -1676
  5. package/browser/board-livegraph-engine.js.map +1 -1
  6. package/browser/live-cards.js +347 -26
  7. package/browser/live-cards.schema.json +418 -132
  8. package/card-store.js +37 -0
  9. package/dist/batch/index.cjs +1 -108
  10. package/dist/batch/index.cjs.map +1 -1
  11. package/dist/batch/index.js +1 -106
  12. package/dist/batch/index.js.map +1 -1
  13. package/dist/board-live-cards-lib-Bg6EvCo5.d.cts +136 -0
  14. package/dist/board-live-cards-lib-jM2uYG1v.d.ts +136 -0
  15. package/dist/board-live-cards-public-CltXYgaY.d.cts +314 -0
  16. package/dist/board-live-cards-public-f-E-FAyp.d.ts +314 -0
  17. package/dist/board-livegraph-runtime/index.cjs +2 -1671
  18. package/dist/board-livegraph-runtime/index.cjs.map +1 -1
  19. package/dist/board-livegraph-runtime/index.d.cts +1 -2
  20. package/dist/board-livegraph-runtime/index.d.ts +1 -2
  21. package/dist/board-livegraph-runtime/index.js +2 -1662
  22. package/dist/board-livegraph-runtime/index.js.map +1 -1
  23. package/dist/board-livegraph-runtime/jsonata-sync.cjs +7587 -0
  24. package/dist/card-compute/index.cjs +9 -7159
  25. package/dist/card-compute/index.cjs.map +1 -1
  26. package/dist/card-compute/index.d.cts +22 -0
  27. package/dist/card-compute/index.d.ts +22 -0
  28. package/dist/card-compute/index.js +9 -7145
  29. package/dist/card-compute/index.js.map +1 -1
  30. package/dist/card-compute/jsonata-sync.cjs +7587 -0
  31. package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs +2 -0
  32. package/dist/cli/browser-api/board-live-cards-browser-adapter.cjs.map +1 -0
  33. package/dist/cli/browser-api/board-live-cards-browser-adapter.d.cts +24 -0
  34. package/dist/cli/browser-api/board-live-cards-browser-adapter.d.ts +24 -0
  35. package/dist/cli/browser-api/board-live-cards-browser-adapter.js +2 -0
  36. package/dist/cli/browser-api/board-live-cards-browser-adapter.js.map +1 -0
  37. package/dist/cli/browser-api/card-store-browser-api.cjs +2 -0
  38. package/dist/cli/browser-api/card-store-browser-api.cjs.map +1 -0
  39. package/dist/cli/browser-api/card-store-browser-api.d.cts +26 -0
  40. package/dist/cli/browser-api/card-store-browser-api.d.ts +26 -0
  41. package/dist/cli/browser-api/card-store-browser-api.js +2 -0
  42. package/dist/cli/browser-api/card-store-browser-api.js.map +1 -0
  43. package/dist/cli/browser-api/jsonata-sync.cjs +7587 -0
  44. package/dist/cli/node/artifacts-store-cli.cjs +11 -0
  45. package/dist/cli/node/artifacts-store-cli.cjs.map +1 -0
  46. package/dist/cli/node/artifacts-store-cli.d.cts +8 -0
  47. package/dist/cli/node/artifacts-store-cli.d.ts +8 -0
  48. package/dist/cli/node/artifacts-store-cli.js +11 -0
  49. package/dist/cli/node/artifacts-store-cli.js.map +1 -0
  50. package/dist/cli/node/board-live-cards-cli.cjs +15 -0
  51. package/dist/cli/node/board-live-cards-cli.cjs.map +1 -0
  52. package/dist/cli/node/board-live-cards-cli.d.cts +20 -0
  53. package/dist/cli/node/board-live-cards-cli.d.ts +20 -0
  54. package/dist/cli/node/board-live-cards-cli.js +15 -0
  55. package/dist/cli/node/board-live-cards-cli.js.map +1 -0
  56. package/dist/cli/node/card-store-cli.cjs +8 -0
  57. package/dist/cli/node/card-store-cli.cjs.map +1 -0
  58. package/dist/cli/node/card-store-cli.d.cts +15 -0
  59. package/dist/cli/node/card-store-cli.d.ts +15 -0
  60. package/dist/cli/node/card-store-cli.js +8 -0
  61. package/dist/cli/node/card-store-cli.js.map +1 -0
  62. package/dist/cli/node/fs-board-adapter.cjs +14 -0
  63. package/dist/cli/node/fs-board-adapter.cjs.map +1 -0
  64. package/dist/cli/node/fs-board-adapter.d.cts +204 -0
  65. package/dist/cli/node/fs-board-adapter.d.ts +204 -0
  66. package/dist/cli/node/fs-board-adapter.js +14 -0
  67. package/dist/cli/node/fs-board-adapter.js.map +1 -0
  68. package/dist/cli/node/jsonata-sync.cjs +7587 -0
  69. package/dist/cli/node/source-cli-task-executor.cjs +11 -0
  70. package/dist/cli/node/source-cli-task-executor.cjs.map +1 -0
  71. package/dist/cli/node/source-cli-task-executor.d.cts +1 -0
  72. package/dist/cli/node/source-cli-task-executor.d.ts +1 -0
  73. package/dist/cli/node/source-cli-task-executor.js +11 -0
  74. package/dist/cli/node/source-cli-task-executor.js.map +1 -0
  75. package/dist/config/index.cjs +1 -79
  76. package/dist/config/index.cjs.map +1 -1
  77. package/dist/config/index.js +1 -76
  78. package/dist/config/index.js.map +1 -1
  79. package/dist/continuous-event-graph/index.cjs +2 -2129
  80. package/dist/continuous-event-graph/index.cjs.map +1 -1
  81. package/dist/continuous-event-graph/index.d.cts +81 -5
  82. package/dist/continuous-event-graph/index.d.ts +81 -5
  83. package/dist/continuous-event-graph/index.js +2 -2088
  84. package/dist/continuous-event-graph/index.js.map +1 -1
  85. package/dist/continuous-event-graph/jsonata-sync.cjs +7587 -0
  86. package/dist/event-graph/index.cjs +22 -8292
  87. package/dist/event-graph/index.cjs.map +1 -1
  88. package/dist/event-graph/index.js +22 -8237
  89. package/dist/event-graph/index.js.map +1 -1
  90. package/dist/execution-refs.cjs +2 -0
  91. package/dist/execution-refs.cjs.map +1 -0
  92. package/dist/execution-refs.d.cts +222 -0
  93. package/dist/execution-refs.d.ts +222 -0
  94. package/dist/execution-refs.js +2 -0
  95. package/dist/execution-refs.js.map +1 -0
  96. package/dist/index.cjs +29 -13221
  97. package/dist/index.cjs.map +1 -1
  98. package/dist/index.d.cts +2 -4
  99. package/dist/index.d.ts +2 -4
  100. package/dist/index.js +29 -13112
  101. package/dist/index.js.map +1 -1
  102. package/dist/inference/index.cjs +5 -617
  103. package/dist/inference/index.cjs.map +1 -1
  104. package/dist/inference/index.js +5 -610
  105. package/dist/inference/index.js.map +1 -1
  106. package/dist/jsonata-sync.cjs +7587 -0
  107. package/dist/{live-cards-bridge-x5XREkXm.d.cts → live-cards-bridge-BXbVTsna.d.cts} +27 -4
  108. package/dist/{live-cards-bridge-EQjytzI_.d.ts → live-cards-bridge-Ds28XR15.d.ts} +27 -4
  109. package/dist/pycli/quickjs-board-runtime.global.js +9 -0
  110. package/dist/pycli/quickjs-board-runtime.global.js.map +1 -0
  111. package/dist/pycli/quickjs-step-machine-runtime.global.js +5 -0
  112. package/dist/pycli/quickjs-step-machine-runtime.global.js.map +1 -0
  113. package/dist/step-machine/index.cjs +11 -7129
  114. package/dist/step-machine/index.cjs.map +1 -1
  115. package/dist/step-machine/index.js +11 -7113
  116. package/dist/step-machine/index.js.map +1 -1
  117. package/dist/storage-refs.cjs +10 -0
  118. package/dist/storage-refs.cjs.map +1 -0
  119. package/dist/storage-refs.d.cts +92 -0
  120. package/dist/storage-refs.d.ts +92 -0
  121. package/dist/storage-refs.js +10 -0
  122. package/dist/storage-refs.js.map +1 -0
  123. package/dist/stores/file.cjs +1 -114
  124. package/dist/stores/file.cjs.map +1 -1
  125. package/dist/stores/file.js +1 -112
  126. package/dist/stores/file.js.map +1 -1
  127. package/dist/stores/index.cjs +1 -231
  128. package/dist/stores/index.cjs.map +1 -1
  129. package/dist/stores/index.js +1 -227
  130. package/dist/stores/index.js.map +1 -1
  131. package/dist/stores/localStorage.cjs +1 -76
  132. package/dist/stores/localStorage.cjs.map +1 -1
  133. package/dist/stores/localStorage.js +1 -74
  134. package/dist/stores/localStorage.js.map +1 -1
  135. package/dist/stores/memory.cjs +1 -47
  136. package/dist/stores/memory.cjs.map +1 -1
  137. package/dist/stores/memory.js +1 -45
  138. package/dist/stores/memory.js.map +1 -1
  139. package/examples/browser/boards/portfolio-tracker/portfolio-t4.js +292 -0
  140. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-fetch-prices.js +218 -0
  141. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-fetch-prices.py +201 -0
  142. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-inference-adapter.js +25 -16
  143. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-public.js +553 -0
  144. package/examples/browser/boards/portfolio-tracker/portfolio-tracker.py +365 -0
  145. package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/.runtime-out +1 -0
  146. package/examples/cli/step-machine-cli/portfolio-tracker/--base-ref/board-graph.json +32 -0
  147. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +53 -1
  148. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/add-cards-cli.js +15 -6
  149. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/init-board-cli.js +6 -1
  150. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/poll-status-cli.js +57 -0
  151. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/retrigger-cli.js +1 -1
  152. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/status-cli.js +1 -1
  153. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/update-holdings-cli.js +7 -2
  154. package/examples/cli/step-machine-cli/portfolio-tracker/handlers/wait-completed-cli.js +6 -2
  155. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/_board_pycli.py +97 -0
  156. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/add-cards.py +50 -0
  157. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/init-board.py +44 -0
  158. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/poll-status.py +70 -0
  159. package/examples/cli/step-machine-cli/portfolio-tracker/handlers-py/reset-board-dir.py +36 -0
  160. package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-demo.flow.yaml +26 -0
  161. package/examples/cli/step-machine-cli/portfolio-tracker/inline-python-handlers.py +39 -0
  162. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker-pycli.flow.yaml +80 -0
  163. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.flow.yaml +25 -172
  164. package/examples/cli/step-machine-cli/portfolio-tracker/portfolio-tracker.input.json +40 -34
  165. package/examples/cli/step-machine-cli/portfolio-tracker/run-inline-python-demo-pycli.py +46 -0
  166. package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker-pycli.py +77 -0
  167. package/examples/cli/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +1 -2
  168. package/examples/example-board/agent-instructions.md +11 -5
  169. package/examples/example-board/demo-chat-handler.js +14 -4
  170. package/examples/example-board/demo-server-config.json +1 -0
  171. package/examples/example-board/demo-server.js +14 -7
  172. package/examples/example-board/demo-shell-browser.html +5 -4
  173. package/examples/example-board/demo-shell-with-server.html +6 -5
  174. package/examples/example-board/demo-task-executor.js +81 -35
  175. package/examples/index.html +0 -14
  176. package/examples/step-machine-cli/portfolio-tracker/handlers/_board-cli.js +0 -1
  177. package/examples/step-machine-cli/portfolio-tracker/run-portfolio-tracker.bat +1 -2
  178. package/package.json +39 -3
  179. package/schema/live-cards.schema.json +418 -132
  180. package/dist/cli/board-live-cards-cli.cjs +0 -10650
  181. package/dist/cli/board-live-cards-cli.cjs.map +0 -1
  182. package/dist/cli/board-live-cards-cli.d.cts +0 -179
  183. package/dist/cli/board-live-cards-cli.d.ts +0 -179
  184. package/dist/cli/board-live-cards-cli.js +0 -10598
  185. package/dist/cli/board-live-cards-cli.js.map +0 -1
  186. package/dist/journal-9HEgs7dU.d.ts +0 -28
  187. package/dist/journal-B-JCfQnh.d.cts +0 -28
  188. package/dist/schedule-Cszq9LYY.d.ts +0 -21
  189. package/dist/schedule-qWNL0RQh.d.cts +0 -21
  190. package/examples/browser/boards/portfolio-tracker/cards/holdings-table.json +0 -22
  191. package/examples/browser/boards/portfolio-tracker/cards/portfolio-form.json +0 -16
  192. package/examples/browser/boards/portfolio-tracker/cards/portfolio-risk-assessment.json +0 -28
  193. package/examples/browser/boards/portfolio-tracker/cards/portfolio-value.json +0 -15
  194. package/examples/browser/boards/portfolio-tracker/cards/price-fetch.json +0 -15
  195. package/examples/browser/boards/portfolio-tracker/cards/rebalancing-strategy.json +0 -28
  196. package/examples/browser/boards/portfolio-tracker/fetch-prices.js +0 -43
  197. package/examples/browser/boards/portfolio-tracker/portfolio-tracker-task-executor.cjs +0 -96
  198. package/examples/browser/boards/portfolio-tracker/portfolio-tracker.bat +0 -7
  199. package/examples/browser/boards/portfolio-tracker/portfolio-tracker.js +0 -351
@@ -2,11 +2,9 @@ import { L as LiveGraph, N as NodeInfo, b as LiveGraphSnapshot, D as DownstreamR
2
2
  export { B as BlockedTask, P as PendingTask, S as ScheduleResult, d as UnresolvedDependency } from '../types-CHSdoAAA.cjs';
3
3
  import { T as TaskConfig, f as GraphEvent, G as GraphConfig } from '../types-BBhqYGhE.cjs';
4
4
  export { c as ExecutionState, e as GraphEngineStore, g as GraphSettings } from '../types-BBhqYGhE.cjs';
5
- export { s as schedule } from '../schedule-qWNL0RQh.cjs';
6
- import { R as ReactiveGraph, e as TaskHandlerInput, T as TaskHandlerFn } from '../live-cards-bridge-x5XREkXm.cjs';
7
- export { L as LiveBoard, a as LiveCard, b as LiveCardsToReactiveOptions, c as LiveCardsToReactiveResult, d as ReactiveGraphOptions, f as TaskHandlerReturn, h as computeDataHash, g as createReactiveGraph, l as liveCardsToReactiveGraph } from '../live-cards-bridge-x5XREkXm.cjs';
5
+ import { R as ReactiveGraph, e as TaskHandlerInput, T as TaskHandlerFn } from '../live-cards-bridge-BXbVTsna.cjs';
6
+ export { L as LiveBoard, a as LiveCard, b as LiveCardsToReactiveOptions, c as LiveCardsToReactiveResult, d as ReactiveGraphOptions, f as TaskHandlerReturn, h as computeDataHash, g as createReactiveGraph, l as liveCardsToReactiveGraph, s as schedule } from '../live-cards-bridge-BXbVTsna.cjs';
8
7
  import { a as GraphValidationResult } from '../validate-Dbu7ygys.cjs';
9
- export { J as Journal, M as MemoryJournal } from '../journal-B-JCfQnh.cjs';
10
8
 
11
9
  /**
12
10
  * Continuous Event Graph — Core
@@ -327,6 +325,29 @@ declare function mutateGraph(live: LiveGraph, mutations: GraphMutation[]): LiveG
327
325
  interface ResolveCallbackFn {
328
326
  (callbackToken: string, data: Record<string, unknown>, errors?: string[]): void;
329
327
  }
328
+ /**
329
+ * Structured command specification for process-based handlers.
330
+ *
331
+ * Use this everywhere instead of raw command strings:
332
+ * - command: the executable name or path (no embedded args)
333
+ * - args: explicit argument array (no shell quoting needed)
334
+ *
335
+ * JSON config format:
336
+ * Old: { "command": "node path/to/exec.js --flag" } ← parsed for compat by parseCommandSpec
337
+ * New: { "command": "node", "args": ["path/to/exec.js", "--flag"] }
338
+ */
339
+ interface CommandSpec {
340
+ /** Executable name or path. No embedded args. */
341
+ command: string;
342
+ /** Explicit argument list. No shell quoting needed. */
343
+ args?: string[];
344
+ /** Working directory. */
345
+ cwd?: string;
346
+ /** Additional environment variables merged over process.env. */
347
+ env?: Record<string, string>;
348
+ /** Timeout in milliseconds. */
349
+ timeoutMs?: number;
350
+ }
330
351
  /**
331
352
  * Wrap a plain async function as a TaskHandlerFn.
332
353
  *
@@ -401,6 +422,36 @@ interface ShellHandlerOptions {
401
422
  * ```
402
423
  */
403
424
  declare function createShellHandler(options: ShellHandlerOptions): TaskHandlerFn;
425
+ interface ProcessHandlerOptions extends CommandSpec {
426
+ /** Map exit codes to result keys (default: 0 → success, non-zero → error) */
427
+ exitCodeMap?: Record<number, string>;
428
+ /** If true, include stdout/stderr/exitCode in the data payload */
429
+ captureOutput?: boolean;
430
+ /** Lazy getter for the resolveCallback function */
431
+ getResolve: () => ResolveCallbackFn;
432
+ }
433
+ /**
434
+ * Create a TaskHandlerFn that spawns a process using structured command + args.
435
+ *
436
+ * Unlike createShellHandler, this uses execFile — no ambient shell, no quoting
437
+ * issues, safe on Windows and Linux. ${taskName} is substituted in both the
438
+ * command and each arg string.
439
+ *
440
+ * Prefer this over createShellHandler for all programmatic invocations
441
+ * (task-executors, source fetchers, inference adapters).
442
+ *
443
+ * @example
444
+ * ```ts
445
+ * const handler = createProcessHandler({
446
+ * command: 'node',
447
+ * args: ['scripts/fetch.js', '--task', '${taskName}'],
448
+ * cwd: '/app',
449
+ * captureOutput: true,
450
+ * getResolve: () => graph.resolveCallback.bind(graph),
451
+ * });
452
+ * ```
453
+ */
454
+ declare function createProcessHandler(options: ProcessHandlerOptions): TaskHandlerFn;
404
455
  interface ScriptHandlerOptions {
405
456
  /** Path to the script file */
406
457
  scriptPath: string;
@@ -474,4 +525,29 @@ declare function createWebhookHandler(options: WebhookHandlerOptions): TaskHandl
474
525
  */
475
526
  declare function createNoopHandler(getResolve: () => ResolveCallbackFn, staticData?: Record<string, unknown>): TaskHandlerFn;
476
527
 
477
- export { DownstreamResult, GraphConfig, GraphEvent, type GraphMutation, LiveGraph, LiveGraphHealth, LiveGraphSnapshot, NodeInfo, ReactiveGraph, type ReactiveGraphValidationInput, type ResolveCallbackFn, type ScriptHandlerOptions, type ShellHandlerOptions, TaskConfig, TaskHandlerFn, TaskHandlerInput, UnreachableNodesResult, UnreachableTokensResult, UpstreamResult, type WebhookHandlerOptions, addNode, addProvides, addRequires, applyEvent, applyEvents, createCallbackHandler, createFireAndForgetHandler, createLiveGraph, createNoopHandler, createScriptHandler, createShellHandler, createWebhookHandler, disableNode, drainTokens, enableNode, getDownstream, getNode, getUnreachableNodes, getUnreachableTokens, getUpstream, injectTokens, inspect, mutateGraph, removeNode, removeProvides, removeRequires, resetNode, restore, snapshot, validateLiveGraph, validateReactiveGraph };
528
+ /**
529
+ * Continuous Event Graph — Journal
530
+ *
531
+ * Append-only event log for the reactive layer.
532
+ * Handlers append events here; drain() reads and clears atomically.
533
+ *
534
+ * Adapter:
535
+ * - MemoryJournal: in-process array (default)
536
+ */
537
+
538
+ interface Journal {
539
+ /** Append an event to the journal. Safe to call from concurrent callbacks. */
540
+ append(event: GraphEvent): void;
541
+ /** Read all pending events and clear the journal atomically. */
542
+ drain(): GraphEvent[];
543
+ /** Number of pending events (for observability). */
544
+ readonly size: number;
545
+ }
546
+ declare class MemoryJournal implements Journal {
547
+ private buffer;
548
+ append(event: GraphEvent): void;
549
+ drain(): GraphEvent[];
550
+ get size(): number;
551
+ }
552
+
553
+ export { type CommandSpec, DownstreamResult, GraphConfig, GraphEvent, type GraphMutation, type Journal, LiveGraph, LiveGraphHealth, LiveGraphSnapshot, MemoryJournal, NodeInfo, type ProcessHandlerOptions, ReactiveGraph, type ReactiveGraphValidationInput, type ResolveCallbackFn, type ScriptHandlerOptions, type ShellHandlerOptions, TaskConfig, TaskHandlerFn, TaskHandlerInput, UnreachableNodesResult, UnreachableTokensResult, UpstreamResult, type WebhookHandlerOptions, addNode, addProvides, addRequires, applyEvent, applyEvents, createCallbackHandler, createFireAndForgetHandler, createLiveGraph, createNoopHandler, createProcessHandler, createScriptHandler, createShellHandler, createWebhookHandler, disableNode, drainTokens, enableNode, getDownstream, getNode, getUnreachableNodes, getUnreachableTokens, getUpstream, injectTokens, inspect, mutateGraph, removeNode, removeProvides, removeRequires, resetNode, restore, snapshot, validateLiveGraph, validateReactiveGraph };
@@ -2,11 +2,9 @@ import { L as LiveGraph, N as NodeInfo, b as LiveGraphSnapshot, D as DownstreamR
2
2
  export { B as BlockedTask, P as PendingTask, S as ScheduleResult, d as UnresolvedDependency } from '../types-CoW0gQl3.js';
3
3
  import { T as TaskConfig, f as GraphEvent, G as GraphConfig } from '../types-BBhqYGhE.js';
4
4
  export { c as ExecutionState, e as GraphEngineStore, g as GraphSettings } from '../types-BBhqYGhE.js';
5
- export { s as schedule } from '../schedule-Cszq9LYY.js';
6
- import { R as ReactiveGraph, e as TaskHandlerInput, T as TaskHandlerFn } from '../live-cards-bridge-EQjytzI_.js';
7
- export { L as LiveBoard, a as LiveCard, b as LiveCardsToReactiveOptions, c as LiveCardsToReactiveResult, d as ReactiveGraphOptions, f as TaskHandlerReturn, h as computeDataHash, g as createReactiveGraph, l as liveCardsToReactiveGraph } from '../live-cards-bridge-EQjytzI_.js';
5
+ import { R as ReactiveGraph, e as TaskHandlerInput, T as TaskHandlerFn } from '../live-cards-bridge-Ds28XR15.js';
6
+ export { L as LiveBoard, a as LiveCard, b as LiveCardsToReactiveOptions, c as LiveCardsToReactiveResult, d as ReactiveGraphOptions, f as TaskHandlerReturn, h as computeDataHash, g as createReactiveGraph, l as liveCardsToReactiveGraph, s as schedule } from '../live-cards-bridge-Ds28XR15.js';
8
7
  import { a as GraphValidationResult } from '../validate-BAVzUJWa.js';
9
- export { J as Journal, M as MemoryJournal } from '../journal-9HEgs7dU.js';
10
8
 
11
9
  /**
12
10
  * Continuous Event Graph — Core
@@ -327,6 +325,29 @@ declare function mutateGraph(live: LiveGraph, mutations: GraphMutation[]): LiveG
327
325
  interface ResolveCallbackFn {
328
326
  (callbackToken: string, data: Record<string, unknown>, errors?: string[]): void;
329
327
  }
328
+ /**
329
+ * Structured command specification for process-based handlers.
330
+ *
331
+ * Use this everywhere instead of raw command strings:
332
+ * - command: the executable name or path (no embedded args)
333
+ * - args: explicit argument array (no shell quoting needed)
334
+ *
335
+ * JSON config format:
336
+ * Old: { "command": "node path/to/exec.js --flag" } ← parsed for compat by parseCommandSpec
337
+ * New: { "command": "node", "args": ["path/to/exec.js", "--flag"] }
338
+ */
339
+ interface CommandSpec {
340
+ /** Executable name or path. No embedded args. */
341
+ command: string;
342
+ /** Explicit argument list. No shell quoting needed. */
343
+ args?: string[];
344
+ /** Working directory. */
345
+ cwd?: string;
346
+ /** Additional environment variables merged over process.env. */
347
+ env?: Record<string, string>;
348
+ /** Timeout in milliseconds. */
349
+ timeoutMs?: number;
350
+ }
330
351
  /**
331
352
  * Wrap a plain async function as a TaskHandlerFn.
332
353
  *
@@ -401,6 +422,36 @@ interface ShellHandlerOptions {
401
422
  * ```
402
423
  */
403
424
  declare function createShellHandler(options: ShellHandlerOptions): TaskHandlerFn;
425
+ interface ProcessHandlerOptions extends CommandSpec {
426
+ /** Map exit codes to result keys (default: 0 → success, non-zero → error) */
427
+ exitCodeMap?: Record<number, string>;
428
+ /** If true, include stdout/stderr/exitCode in the data payload */
429
+ captureOutput?: boolean;
430
+ /** Lazy getter for the resolveCallback function */
431
+ getResolve: () => ResolveCallbackFn;
432
+ }
433
+ /**
434
+ * Create a TaskHandlerFn that spawns a process using structured command + args.
435
+ *
436
+ * Unlike createShellHandler, this uses execFile — no ambient shell, no quoting
437
+ * issues, safe on Windows and Linux. ${taskName} is substituted in both the
438
+ * command and each arg string.
439
+ *
440
+ * Prefer this over createShellHandler for all programmatic invocations
441
+ * (task-executors, source fetchers, inference adapters).
442
+ *
443
+ * @example
444
+ * ```ts
445
+ * const handler = createProcessHandler({
446
+ * command: 'node',
447
+ * args: ['scripts/fetch.js', '--task', '${taskName}'],
448
+ * cwd: '/app',
449
+ * captureOutput: true,
450
+ * getResolve: () => graph.resolveCallback.bind(graph),
451
+ * });
452
+ * ```
453
+ */
454
+ declare function createProcessHandler(options: ProcessHandlerOptions): TaskHandlerFn;
404
455
  interface ScriptHandlerOptions {
405
456
  /** Path to the script file */
406
457
  scriptPath: string;
@@ -474,4 +525,29 @@ declare function createWebhookHandler(options: WebhookHandlerOptions): TaskHandl
474
525
  */
475
526
  declare function createNoopHandler(getResolve: () => ResolveCallbackFn, staticData?: Record<string, unknown>): TaskHandlerFn;
476
527
 
477
- export { DownstreamResult, GraphConfig, GraphEvent, type GraphMutation, LiveGraph, LiveGraphHealth, LiveGraphSnapshot, NodeInfo, ReactiveGraph, type ReactiveGraphValidationInput, type ResolveCallbackFn, type ScriptHandlerOptions, type ShellHandlerOptions, TaskConfig, TaskHandlerFn, TaskHandlerInput, UnreachableNodesResult, UnreachableTokensResult, UpstreamResult, type WebhookHandlerOptions, addNode, addProvides, addRequires, applyEvent, applyEvents, createCallbackHandler, createFireAndForgetHandler, createLiveGraph, createNoopHandler, createScriptHandler, createShellHandler, createWebhookHandler, disableNode, drainTokens, enableNode, getDownstream, getNode, getUnreachableNodes, getUnreachableTokens, getUpstream, injectTokens, inspect, mutateGraph, removeNode, removeProvides, removeRequires, resetNode, restore, snapshot, validateLiveGraph, validateReactiveGraph };
528
+ /**
529
+ * Continuous Event Graph — Journal
530
+ *
531
+ * Append-only event log for the reactive layer.
532
+ * Handlers append events here; drain() reads and clears atomically.
533
+ *
534
+ * Adapter:
535
+ * - MemoryJournal: in-process array (default)
536
+ */
537
+
538
+ interface Journal {
539
+ /** Append an event to the journal. Safe to call from concurrent callbacks. */
540
+ append(event: GraphEvent): void;
541
+ /** Read all pending events and clear the journal atomically. */
542
+ drain(): GraphEvent[];
543
+ /** Number of pending events (for observability). */
544
+ readonly size: number;
545
+ }
546
+ declare class MemoryJournal implements Journal {
547
+ private buffer;
548
+ append(event: GraphEvent): void;
549
+ drain(): GraphEvent[];
550
+ get size(): number;
551
+ }
552
+
553
+ export { type CommandSpec, DownstreamResult, GraphConfig, GraphEvent, type GraphMutation, type Journal, LiveGraph, LiveGraphHealth, LiveGraphSnapshot, MemoryJournal, NodeInfo, type ProcessHandlerOptions, ReactiveGraph, type ReactiveGraphValidationInput, type ResolveCallbackFn, type ScriptHandlerOptions, type ShellHandlerOptions, TaskConfig, TaskHandlerFn, TaskHandlerInput, UnreachableNodesResult, UnreachableTokensResult, UpstreamResult, type WebhookHandlerOptions, addNode, addProvides, addRequires, applyEvent, applyEvents, createCallbackHandler, createFireAndForgetHandler, createLiveGraph, createNoopHandler, createProcessHandler, createScriptHandler, createShellHandler, createWebhookHandler, disableNode, drainTokens, enableNode, getDownstream, getNode, getUnreachableNodes, getUnreachableTokens, getUpstream, injectTokens, inspect, mutateGraph, removeNode, removeProvides, removeRequires, resetNode, restore, snapshot, validateLiveGraph, validateReactiveGraph };