yaml-flow 8.7.1 → 8.8.5

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 (195) hide show
  1. package/browser/adapters/firebase-storage.js +2 -2
  2. package/browser/adapters/firestore-storage.js +2 -2
  3. package/browser/adapters/localstorage-storage.js +3 -3
  4. package/browser/asset-integrity.json +9 -13
  5. package/browser/live-cards.js +6 -6
  6. package/browser/server-runtime-controlface.js +5 -5
  7. package/examples/ARCHITECTURE.md +0 -27
  8. package/examples/board/server/board-server.js +150 -100
  9. package/examples/board/server/board-worker/source_def_flows.json +0 -8
  10. package/examples/board/server/board-worker/task-executor.js +1 -3
  11. package/examples/board/server/chat-flow/flow-steps.json +5 -5
  12. package/examples/board/test/server-http-test.js +726 -87
  13. package/examples/board-firestore/server/worker.js +8 -0
  14. package/examples/portfolio-tracker/portfolio-tracker.js +11 -1
  15. package/examples/portfolio-tracker/test/portfolio-t4.js +12 -2
  16. package/lib/{artifacts-store-lib-D9nMkVcE.d.cts → artifacts-store-lib-C6qBpMfU.d.cts} +1 -1
  17. package/lib/{artifacts-store-lib-DSSMqVL2.d.ts → artifacts-store-lib-D4qf7Q-7.d.ts} +1 -1
  18. package/lib/artifacts-store-public.d.cts +3 -3
  19. package/lib/artifacts-store-public.d.ts +3 -3
  20. package/lib/board-live-cards-mcp.cjs +1 -1
  21. package/lib/board-live-cards-mcp.d.cts +6 -7
  22. package/lib/board-live-cards-mcp.d.ts +6 -7
  23. package/lib/board-live-cards-mcp.js +1 -1
  24. package/lib/board-live-cards-node.cjs +8 -8
  25. package/lib/board-live-cards-node.d.cts +70 -15
  26. package/lib/board-live-cards-node.d.ts +70 -15
  27. package/lib/board-live-cards-node.js +8 -8
  28. package/lib/{board-live-cards-public-LlVUQPL2.d.cts → board-live-cards-public-BT5HrgqZ.d.cts} +82 -59
  29. package/lib/{board-live-cards-public-JNRKfBZy.d.ts → board-live-cards-public-DSRamFm8.d.ts} +82 -59
  30. package/lib/{board-live-cards-public-async-Di9QB141.d.cts → board-live-cards-public-async-CYjr4mgX.d.cts} +18 -8
  31. package/lib/{board-live-cards-public-async-fwd1QI82.d.ts → board-live-cards-public-async-DlyC3PgC.d.ts} +18 -8
  32. package/lib/board-live-cards-public.cjs +1 -1
  33. package/lib/board-live-cards-public.d.cts +2 -2
  34. package/lib/board-live-cards-public.d.ts +2 -2
  35. package/lib/board-live-cards-public.js +1 -1
  36. package/lib/board-live-cards-server-runtime.cjs +1 -1
  37. package/lib/board-live-cards-server-runtime.d.cts +6 -8
  38. package/lib/board-live-cards-server-runtime.d.ts +6 -8
  39. package/lib/board-live-cards-server-runtime.js +1 -1
  40. package/lib/board-livegraph-runtime/index.cjs +1 -1
  41. package/lib/board-livegraph-runtime/index.d.cts +1 -0
  42. package/lib/board-livegraph-runtime/index.d.ts +1 -0
  43. package/lib/board-livegraph-runtime/index.js +1 -1
  44. package/lib/{board-platform-adapter-async-BfHmHdx2.d.cts → board-platform-adapter-async-BZIftm36.d.cts} +18 -14
  45. package/lib/{board-platform-adapter-async-DYahVzIK.d.ts → board-platform-adapter-async-JP9V-U5E.d.ts} +18 -14
  46. package/lib/board-worker-adapter.cjs +1 -24
  47. package/lib/board-worker-adapter.d.cts +68 -3
  48. package/lib/board-worker-adapter.d.ts +68 -3
  49. package/lib/board-worker-adapter.js +1 -24
  50. package/lib/card-store-public.d.cts +2 -2
  51. package/lib/card-store-public.d.ts +2 -2
  52. package/lib/chat-store-public.cjs +1 -1
  53. package/lib/chat-store-public.d.cts +20 -20
  54. package/lib/chat-store-public.d.ts +20 -20
  55. package/lib/chat-store-public.js +1 -1
  56. package/lib/chunk-35N7ONTH.js +2 -0
  57. package/lib/chunk-36QUKFL7.cjs +3 -0
  58. package/lib/chunk-37HDEW26.cjs +2 -0
  59. package/lib/{chunk-PMUSJQSR.cjs → chunk-3CZCGNY4.cjs} +2 -2
  60. package/lib/{chunk-BQS3EIEK.js → chunk-44L64VQ2.js} +3 -3
  61. package/lib/{chunk-YGKDQLYP.js → chunk-4HIEOBJC.js} +2 -2
  62. package/lib/chunk-6OPXQPSC.js +2 -0
  63. package/lib/chunk-7BTZCOT5.js +2 -0
  64. package/lib/{chunk-U2N6MCD5.cjs → chunk-7JVHYHT2.cjs} +2 -2
  65. package/lib/chunk-7QQFDYBM.js +3 -0
  66. package/lib/chunk-7QZ267XP.cjs +2 -0
  67. package/lib/chunk-ABAVFLDP.js +7 -0
  68. package/lib/{chunk-XQRNDX4Q.js → chunk-ANKA7HEJ.js} +2 -2
  69. package/lib/{chunk-KAWQPLIE.cjs → chunk-BQUQTOPB.cjs} +2 -2
  70. package/lib/chunk-ETW3BXHD.cjs +2 -0
  71. package/lib/{chunk-SGV7PU4H.js → chunk-FOFGEABN.js} +2 -2
  72. package/lib/chunk-GPCMBPLK.cjs +2 -0
  73. package/lib/chunk-H22NK6KH.cjs +7 -0
  74. package/lib/chunk-H4TYOSMD.cjs +45 -0
  75. package/lib/chunk-HFW7E2Z7.cjs +4 -0
  76. package/lib/chunk-J4MHQ7JF.js +45 -0
  77. package/lib/chunk-MCPADH33.cjs +2 -0
  78. package/lib/chunk-NBJTYAYN.cjs +2 -0
  79. package/lib/chunk-NNSBBO5R.js +2 -0
  80. package/lib/chunk-NU5NO5NM.js +2 -0
  81. package/lib/chunk-O5UYCGIN.js +2 -0
  82. package/lib/chunk-O6II7S4M.js +3 -0
  83. package/lib/chunk-PN5D32NP.cjs +3 -0
  84. package/lib/chunk-Q3OTUDIE.js +2 -0
  85. package/lib/chunk-R44X3RQB.cjs +2 -0
  86. package/lib/chunk-RKKSVOP2.js +2 -0
  87. package/lib/chunk-UB54HZA4.cjs +2 -0
  88. package/lib/{chunk-CIAJNUR4.js → chunk-VGDLSS2H.js} +2 -2
  89. package/lib/{chunk-SFVO2LB2.cjs → chunk-VQCIOKJV.cjs} +3 -3
  90. package/lib/chunk-VS3BXEYK.js +4 -0
  91. package/lib/{chunk-S6DRP2HX.cjs → chunk-XQAHHUZO.cjs} +2 -2
  92. package/lib/chunk-Y4WK7HE4.js +2 -0
  93. package/lib/chunk-ZENTBLLA.cjs +3 -0
  94. package/lib/chunk-ZK3E7L4Y.cjs +2 -0
  95. package/lib/chunk-ZWVT24YW.js +3 -0
  96. package/lib/cloud-storage.cjs +1 -1
  97. package/lib/cloud-storage.d.cts +6 -6
  98. package/lib/cloud-storage.d.ts +6 -6
  99. package/lib/cloud-storage.js +1 -1
  100. package/lib/execution-refs.cjs +1 -1
  101. package/lib/execution-refs.js +1 -1
  102. package/lib/firebase-storage/index.cjs +2 -2
  103. package/lib/firebase-storage/index.d.cts +2 -2
  104. package/lib/firebase-storage/index.d.ts +2 -2
  105. package/lib/firebase-storage/index.js +2 -2
  106. package/lib/firestore-storage/index.cjs +2 -2
  107. package/lib/firestore-storage/index.d.cts +12 -21
  108. package/lib/firestore-storage/index.d.ts +12 -21
  109. package/lib/firestore-storage/index.js +2 -2
  110. package/lib/index.cjs +2 -2
  111. package/lib/index.d.cts +1 -1
  112. package/lib/index.d.ts +1 -1
  113. package/lib/index.js +1 -1
  114. package/lib/localstorage-storage/index.cjs +1 -1
  115. package/lib/localstorage-storage/index.d.cts +10 -6
  116. package/lib/localstorage-storage/index.d.ts +10 -6
  117. package/lib/localstorage-storage/index.js +1 -1
  118. package/lib/{mcp-tool-registries-W3TRj6O5.d.cts → mcp-tool-registries-CRtea2x4.d.cts} +3 -0
  119. package/lib/{mcp-tool-registries-BBObLYga.d.ts → mcp-tool-registries-D3rWSppt.d.ts} +3 -0
  120. package/lib/server-jobs-queue-runner/index.cjs +1 -1
  121. package/lib/server-jobs-queue-runner/index.d.cts +12 -9
  122. package/lib/server-jobs-queue-runner/index.d.ts +12 -9
  123. package/lib/server-jobs-queue-runner/index.js +1 -1
  124. package/lib/server-runtime/index.cjs +1 -1
  125. package/lib/server-runtime/index.d.cts +7 -9
  126. package/lib/server-runtime/index.d.ts +7 -9
  127. package/lib/server-runtime/index.js +1 -1
  128. package/lib/server-runtime-agentface/index.d.cts +7 -9
  129. package/lib/server-runtime-agentface/index.d.ts +7 -9
  130. package/lib/server-runtime-controlface/index.cjs +1 -1
  131. package/lib/server-runtime-controlface/index.d.cts +8 -9
  132. package/lib/server-runtime-controlface/index.d.ts +8 -9
  133. package/lib/server-runtime-controlface/index.js +1 -1
  134. package/lib/server-runtime-core/index.cjs +1 -1
  135. package/lib/server-runtime-core/index.d.cts +59 -21
  136. package/lib/server-runtime-core/index.d.ts +59 -21
  137. package/lib/server-runtime-core/index.js +1 -1
  138. package/lib/server-runtime-watchers/index.cjs +1 -1
  139. package/lib/server-runtime-watchers/index.d.cts +9 -65
  140. package/lib/server-runtime-watchers/index.d.ts +9 -65
  141. package/lib/server-runtime-watchers/index.js +1 -1
  142. package/lib/server-runtime-webhooks/index.d.cts +7 -9
  143. package/lib/server-runtime-webhooks/index.d.ts +7 -9
  144. package/lib/sse-hub-BDjWI7JR.d.cts +63 -0
  145. package/lib/sse-hub-DM8bw-dO.d.ts +63 -0
  146. package/lib/step-machine-public/index.cjs +1 -1
  147. package/lib/step-machine-public/index.d.cts +1 -1
  148. package/lib/step-machine-public/index.d.ts +1 -1
  149. package/lib/step-machine-public/index.js +1 -1
  150. package/lib/{storage-async-interface-BRR4eBjx.d.cts → storage-async-interface-CG0bMqvE.d.ts} +20 -1
  151. package/lib/{storage-async-interface-DhlOVPSp.d.ts → storage-async-interface-CyO-zwVQ.d.cts} +20 -1
  152. package/lib/{storage-interface-BFiD3kyB.d.ts → storage-interface-D-iEiTJA.d.cts} +45 -1
  153. package/lib/{storage-interface-BFiD3kyB.d.cts → storage-interface-D-iEiTJA.d.ts} +45 -1
  154. package/lib/stores/index.d.cts +1 -1
  155. package/lib/stores/index.d.ts +1 -1
  156. package/lib/stores/kv.d.cts +1 -1
  157. package/lib/stores/kv.d.ts +1 -1
  158. package/lib/{types-SO5OZm4s.d.ts → types-BsfXZyI3.d.ts} +64 -29
  159. package/lib/{types-Ba8H5_Wo.d.cts → types-CPnYv7RC.d.cts} +64 -29
  160. package/package.json +4 -5
  161. package/browser/board-livecards-client.js +0 -2
  162. package/examples/board/demo-shell-with-server.html +0 -272
  163. package/examples/board/doc.html +0 -465
  164. package/examples/board/server-config.json +0 -24
  165. package/examples/board/test/sse-worker.js +0 -49
  166. package/lib/chat-storage-lib-B9Q34Dyv.d.cts +0 -54
  167. package/lib/chat-storage-lib-DB9iSai2.d.ts +0 -54
  168. package/lib/chunk-5XHOHTLZ.cjs +0 -2
  169. package/lib/chunk-6APH25VI.js +0 -2
  170. package/lib/chunk-76C7N4YT.js +0 -3
  171. package/lib/chunk-76ON3V7R.js +0 -2
  172. package/lib/chunk-7ICPAABP.cjs +0 -7
  173. package/lib/chunk-ASR44K7H.cjs +0 -3
  174. package/lib/chunk-CPAXTVBQ.cjs +0 -2
  175. package/lib/chunk-EGRHWZRV.js +0 -2
  176. package/lib/chunk-EZENHAVZ.cjs +0 -2
  177. package/lib/chunk-GL2OHR2E.cjs +0 -2
  178. package/lib/chunk-GYQXDNNI.cjs +0 -2
  179. package/lib/chunk-HEEDJEKM.js +0 -2
  180. package/lib/chunk-IPLSRN6P.cjs +0 -4
  181. package/lib/chunk-J6EGN6S4.cjs +0 -3
  182. package/lib/chunk-JH37NJGP.js +0 -3
  183. package/lib/chunk-JJL5VOQZ.cjs +0 -3
  184. package/lib/chunk-NJJ7WEDT.cjs +0 -2
  185. package/lib/chunk-NKIQRCOM.cjs +0 -2
  186. package/lib/chunk-PBCDDO4V.cjs +0 -2
  187. package/lib/chunk-PBOQ4HYB.cjs +0 -2
  188. package/lib/chunk-PRKRXAVN.js +0 -3
  189. package/lib/chunk-QJVR3FWQ.js +0 -2
  190. package/lib/chunk-S44QZUDX.js +0 -2
  191. package/lib/chunk-TSN3RTXT.js +0 -4
  192. package/lib/chunk-VXJHBWK3.js +0 -2
  193. package/lib/chunk-WHDEBJLT.js +0 -7
  194. package/lib/chunk-YGALANRO.js +0 -2
  195. package/lib/chunk-ZCNN6XPV.js +0 -2
@@ -1,2 +1,2 @@
1
- export{b as createMultiBoardServerRuntime,a as createSingleBoardServerRuntime}from'./chunk-76C7N4YT.js';import'./chunk-QJVR3FWQ.js';import'./chunk-NTICU4OK.js';import'./chunk-O7NOHKVR.js';import'./chunk-WHDEBJLT.js';import'./chunk-SGV7PU4H.js';import'./chunk-XYN5D3GL.js';import'./chunk-ZJ5M5COT.js';export{a as createHostedBoardQueueLaneRegistry}from'./chunk-YGALANRO.js';import'./chunk-6APH25VI.js';import'./chunk-VXJHBWK3.js';import'./chunk-PRKRXAVN.js';import'./chunk-HEEDJEKM.js';import'./chunk-JH37NJGP.js';import'./chunk-XQRNDX4Q.js';import'./chunk-BQS3EIEK.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';import'./chunk-ZCNN6XPV.js';import'./chunk-JMDHDY6M.js';import'./chunk-3KC6LBOG.js';import'./chunk-MNEOJWPS.js';import'./chunk-KBELAKIY.js';import'./chunk-76ON3V7R.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=board-live-cards-server-runtime.js.map
1
+ export{b as createMultiBoardServerRuntime,a as createSingleBoardServerRuntime}from'./chunk-O6II7S4M.js';import'./chunk-NU5NO5NM.js';import'./chunk-NTICU4OK.js';import'./chunk-O7NOHKVR.js';import'./chunk-ABAVFLDP.js';import'./chunk-XYN5D3GL.js';import'./chunk-ZJ5M5COT.js';export{a as createHostedBoardQueueLaneRegistry}from'./chunk-6OPXQPSC.js';import'./chunk-FOFGEABN.js';import'./chunk-O5UYCGIN.js';import'./chunk-RKKSVOP2.js';import'./chunk-7QQFDYBM.js';import'./chunk-NNSBBO5R.js';import'./chunk-ZWVT24YW.js';import'./chunk-ANKA7HEJ.js';import'./chunk-44L64VQ2.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';import'./chunk-35N7ONTH.js';import'./chunk-JMDHDY6M.js';import'./chunk-3KC6LBOG.js';import'./chunk-MNEOJWPS.js';import'./chunk-KBELAKIY.js';import'./chunk-Q3OTUDIE.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=board-live-cards-server-runtime.js.map
2
2
  //# sourceMappingURL=board-live-cards-server-runtime.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkS6DRP2HX_cjs=require('../chunk-S6DRP2HX.cjs');require('../chunk-G4XXRHL2.cjs'),require('../chunk-LODXIALE.cjs'),require('../chunk-IXZG74EW.cjs'),require('../chunk-HWYMZK3N.cjs'),require('../chunk-UJ7ZTV4J.cjs'),require('../chunk-GNFE24S7.cjs');Object.defineProperty(exports,"LocalStorageService",{enumerable:true,get:function(){return chunkS6DRP2HX_cjs.a}});Object.defineProperty(exports,"buildBrowserArtifactsFromRuntime",{enumerable:true,get:function(){return chunkS6DRP2HX_cjs.e}});Object.defineProperty(exports,"createBoardLiveGraphRuntime",{enumerable:true,get:function(){return chunkS6DRP2HX_cjs.b}});Object.defineProperty(exports,"selectAllLiveCardModels",{enumerable:true,get:function(){return chunkS6DRP2HX_cjs.d}});Object.defineProperty(exports,"selectLiveCardModel",{enumerable:true,get:function(){return chunkS6DRP2HX_cjs.c}});//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var chunkXQAHHUZO_cjs=require('../chunk-XQAHHUZO.cjs');require('../chunk-G4XXRHL2.cjs'),require('../chunk-LODXIALE.cjs'),require('../chunk-IXZG74EW.cjs'),require('../chunk-HWYMZK3N.cjs'),require('../chunk-UJ7ZTV4J.cjs'),require('../chunk-GNFE24S7.cjs');Object.defineProperty(exports,"LocalStorageService",{enumerable:true,get:function(){return chunkXQAHHUZO_cjs.a}});Object.defineProperty(exports,"buildBrowserArtifactsFromRuntime",{enumerable:true,get:function(){return chunkXQAHHUZO_cjs.e}});Object.defineProperty(exports,"createBoardLiveGraphRuntime",{enumerable:true,get:function(){return chunkXQAHHUZO_cjs.b}});Object.defineProperty(exports,"selectAllLiveCardModels",{enumerable:true,get:function(){return chunkXQAHHUZO_cjs.d}});Object.defineProperty(exports,"selectLiveCardModel",{enumerable:true,get:function(){return chunkXQAHHUZO_cjs.c}});//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
@@ -31,6 +31,7 @@ interface CardChatMessage {
31
31
  role: string;
32
32
  text: string;
33
33
  files?: unknown[];
34
+ turn?: string;
34
35
  }
35
36
  interface CardChatState {
36
37
  messages: CardChatMessage[];
@@ -31,6 +31,7 @@ interface CardChatMessage {
31
31
  role: string;
32
32
  text: string;
33
33
  files?: unknown[];
34
+ turn?: string;
34
35
  }
35
36
  interface CardChatState {
36
37
  messages: CardChatMessage[];
@@ -1,2 +1,2 @@
1
- export{a as LocalStorageService,e as buildBrowserArtifactsFromRuntime,b as createBoardLiveGraphRuntime,d as selectAllLiveCardModels,c as selectLiveCardModel}from'../chunk-YGKDQLYP.js';import'../chunk-VGT3TRQG.js';import'../chunk-WDPOGXTY.js';import'../chunk-JMDHDY6M.js';import'../chunk-3KC6LBOG.js';import'../chunk-MNEOJWPS.js';import'../chunk-FW4363Y4.js';//# sourceMappingURL=index.js.map
1
+ export{a as LocalStorageService,e as buildBrowserArtifactsFromRuntime,b as createBoardLiveGraphRuntime,d as selectAllLiveCardModels,c as selectLiveCardModel}from'../chunk-4HIEOBJC.js';import'../chunk-VGT3TRQG.js';import'../chunk-WDPOGXTY.js';import'../chunk-JMDHDY6M.js';import'../chunk-3KC6LBOG.js';import'../chunk-MNEOJWPS.js';import'../chunk-FW4363Y4.js';//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- import { i as BoardCallbackTransport, B as BoardChangeNotification } from './board-live-cards-public-LlVUQPL2.cjs';
1
+ import { f as ChatStorage, k as BoardCallbackTransport, B as BoardChangeNotification } from './board-live-cards-public-BT5HrgqZ.cjs';
2
2
  import { ExecutionRef } from './execution-refs.cjs';
3
- import { a as KindValueRef } from './storage-interface-BFiD3kyB.cjs';
4
- import { c as AsyncKVStorage, a as AsyncBlobStorage, f as AsyncScratchStorage, A as AsyncArchiveFactory, b as AsyncJournalStorage, e as AsyncQueueStorage, d as AsyncAtomicRelayLock } from './storage-async-interface-BRR4eBjx.cjs';
3
+ import { a as KindValueRef } from './storage-interface-D-iEiTJA.cjs';
4
+ import { c as AsyncKVStorage, a as AsyncBlobStorage, e as AsyncQueueStorage, f as AsyncScratchStorage, A as AsyncArchiveFactory, b as AsyncJournalStorage, d as AsyncAtomicRelayLock } from './storage-async-interface-CyO-zwVQ.cjs';
5
5
 
6
6
  interface AsyncBoardWorkerRequest {
7
7
  boardId?: string;
@@ -40,31 +40,36 @@ interface AsyncBoardConfigStore {
40
40
  writeTaskExecutorRef(ref: ExecutionRef): Promise<void>;
41
41
  readChatHandlerFlow(): Promise<unknown>;
42
42
  writeChatHandlerFlow(flow: unknown): Promise<void>;
43
+ readBoardRuntimeStoreRef(): Promise<string | null>;
44
+ writeBoardRuntimeStoreRef(ref: string): Promise<void>;
43
45
  readCardStoreRef(): Promise<string | null>;
44
46
  writeCardStoreRef(ref: string): Promise<void>;
45
47
  readOutputsStoreRef(): Promise<string | null>;
46
48
  writeOutputsStoreRef(ref: string): Promise<void>;
49
+ readQueueStoreRef(): Promise<string | null>;
50
+ writeQueueStoreRef(ref: string): Promise<void>;
47
51
  readScratchStoreRef(): Promise<string | null>;
48
52
  writeScratchStoreRef(ref: string): Promise<void>;
49
- readArchiveStoreRef(): Promise<string | null>;
50
- writeArchiveStoreRef(ref: string): Promise<void>;
51
53
  readChatStoreRef(): Promise<string | null>;
52
54
  writeChatStoreRef(ref: string): Promise<void>;
53
55
  readArtifactsStoreRef(): Promise<string | null>;
54
56
  writeArtifactsStoreRef(ref: string): Promise<void>;
57
+ readFetchedSourcesStoreRef(): Promise<string | null>;
58
+ writeFetchedSourcesStoreRef(ref: string): Promise<void>;
55
59
  }
56
60
  interface AsyncBoardPlatformAdapter {
57
61
  kvStorage(namespace: string): AsyncKVStorage;
58
62
  kvStorageForRef(ref: string): AsyncKVStorage;
59
63
  blobStorage(namespace: string): AsyncBlobStorage;
64
+ blobStorageForRef(ref: string): AsyncBlobStorage;
65
+ chatStorageForRef(ref: string): ChatStorage;
66
+ queueStorageForRef(ref: string, lane: string): AsyncQueueStorage;
60
67
  scratchStorage(): AsyncScratchStorage;
61
68
  scratchStorageForRef(ref: string): AsyncScratchStorage;
62
69
  archiveFactory(): AsyncArchiveFactory;
63
70
  archiveFactoryForRef(ref: string): AsyncArchiveFactory;
64
71
  journalStorage(): AsyncJournalStorage;
65
- boardWorkerStore(): AsyncBoardWorkerStore;
66
- chatAgentStore(): AsyncBoardWorkerStore;
67
- processAccumulatedStore(): AsyncQueueStorage;
72
+ journalStorageForRef(ref: string): AsyncJournalStorage;
68
73
  lock: AsyncAtomicRelayLock;
69
74
  callbackTransport?: BoardCallbackTransport;
70
75
  dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
@@ -96,17 +101,16 @@ interface HostedAsyncBoardPlatformAdapterOptions {
96
101
  kvStorage(namespace: string): AsyncKVStorage;
97
102
  kvStorageForRef(ref: string): AsyncKVStorage;
98
103
  blobStorage(namespace: string): AsyncBlobStorage;
104
+ blobStorageForRef(ref: string): AsyncBlobStorage;
105
+ chatStorageForRef(ref: string): ChatStorage;
106
+ queueStoreRef?: string;
107
+ queueStorageForRef(ref: string, lane: string): AsyncQueueStorage;
99
108
  scratchStorage(): AsyncScratchStorage;
100
109
  scratchStorageForRef(ref: string): AsyncScratchStorage;
101
110
  archiveFactory(): AsyncArchiveFactory;
102
111
  archiveFactoryForRef(ref: string): AsyncArchiveFactory;
103
112
  journalStorage(): AsyncJournalStorage;
104
- queueStorage?: AsyncQueueStorage;
105
- boardWorkerStore?: AsyncBoardWorkerStore;
106
- chatAgentQueueStorage?: AsyncQueueStorage;
107
- chatAgentStore?: AsyncBoardWorkerStore;
108
- processAccumulatedQueueStorage?: AsyncQueueStorage;
109
- processAccumulatedStore?: AsyncQueueStorage;
113
+ journalStorageForRef(ref: string): AsyncJournalStorage;
110
114
  lock: AsyncAtomicRelayLock;
111
115
  callbackTransport?: BoardCallbackTransport;
112
116
  fetch?: HostedFetchLike;
@@ -1,7 +1,7 @@
1
- import { i as BoardCallbackTransport, B as BoardChangeNotification } from './board-live-cards-public-JNRKfBZy.js';
1
+ import { f as ChatStorage, k as BoardCallbackTransport, B as BoardChangeNotification } from './board-live-cards-public-DSRamFm8.js';
2
2
  import { ExecutionRef } from './execution-refs.js';
3
- import { a as KindValueRef } from './storage-interface-BFiD3kyB.js';
4
- import { c as AsyncKVStorage, a as AsyncBlobStorage, f as AsyncScratchStorage, A as AsyncArchiveFactory, b as AsyncJournalStorage, e as AsyncQueueStorage, d as AsyncAtomicRelayLock } from './storage-async-interface-DhlOVPSp.js';
3
+ import { a as KindValueRef } from './storage-interface-D-iEiTJA.js';
4
+ import { c as AsyncKVStorage, a as AsyncBlobStorage, e as AsyncQueueStorage, f as AsyncScratchStorage, A as AsyncArchiveFactory, b as AsyncJournalStorage, d as AsyncAtomicRelayLock } from './storage-async-interface-CG0bMqvE.js';
5
5
 
6
6
  interface AsyncBoardWorkerRequest {
7
7
  boardId?: string;
@@ -40,31 +40,36 @@ interface AsyncBoardConfigStore {
40
40
  writeTaskExecutorRef(ref: ExecutionRef): Promise<void>;
41
41
  readChatHandlerFlow(): Promise<unknown>;
42
42
  writeChatHandlerFlow(flow: unknown): Promise<void>;
43
+ readBoardRuntimeStoreRef(): Promise<string | null>;
44
+ writeBoardRuntimeStoreRef(ref: string): Promise<void>;
43
45
  readCardStoreRef(): Promise<string | null>;
44
46
  writeCardStoreRef(ref: string): Promise<void>;
45
47
  readOutputsStoreRef(): Promise<string | null>;
46
48
  writeOutputsStoreRef(ref: string): Promise<void>;
49
+ readQueueStoreRef(): Promise<string | null>;
50
+ writeQueueStoreRef(ref: string): Promise<void>;
47
51
  readScratchStoreRef(): Promise<string | null>;
48
52
  writeScratchStoreRef(ref: string): Promise<void>;
49
- readArchiveStoreRef(): Promise<string | null>;
50
- writeArchiveStoreRef(ref: string): Promise<void>;
51
53
  readChatStoreRef(): Promise<string | null>;
52
54
  writeChatStoreRef(ref: string): Promise<void>;
53
55
  readArtifactsStoreRef(): Promise<string | null>;
54
56
  writeArtifactsStoreRef(ref: string): Promise<void>;
57
+ readFetchedSourcesStoreRef(): Promise<string | null>;
58
+ writeFetchedSourcesStoreRef(ref: string): Promise<void>;
55
59
  }
56
60
  interface AsyncBoardPlatformAdapter {
57
61
  kvStorage(namespace: string): AsyncKVStorage;
58
62
  kvStorageForRef(ref: string): AsyncKVStorage;
59
63
  blobStorage(namespace: string): AsyncBlobStorage;
64
+ blobStorageForRef(ref: string): AsyncBlobStorage;
65
+ chatStorageForRef(ref: string): ChatStorage;
66
+ queueStorageForRef(ref: string, lane: string): AsyncQueueStorage;
60
67
  scratchStorage(): AsyncScratchStorage;
61
68
  scratchStorageForRef(ref: string): AsyncScratchStorage;
62
69
  archiveFactory(): AsyncArchiveFactory;
63
70
  archiveFactoryForRef(ref: string): AsyncArchiveFactory;
64
71
  journalStorage(): AsyncJournalStorage;
65
- boardWorkerStore(): AsyncBoardWorkerStore;
66
- chatAgentStore(): AsyncBoardWorkerStore;
67
- processAccumulatedStore(): AsyncQueueStorage;
72
+ journalStorageForRef(ref: string): AsyncJournalStorage;
68
73
  lock: AsyncAtomicRelayLock;
69
74
  callbackTransport?: BoardCallbackTransport;
70
75
  dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
@@ -96,17 +101,16 @@ interface HostedAsyncBoardPlatformAdapterOptions {
96
101
  kvStorage(namespace: string): AsyncKVStorage;
97
102
  kvStorageForRef(ref: string): AsyncKVStorage;
98
103
  blobStorage(namespace: string): AsyncBlobStorage;
104
+ blobStorageForRef(ref: string): AsyncBlobStorage;
105
+ chatStorageForRef(ref: string): ChatStorage;
106
+ queueStoreRef?: string;
107
+ queueStorageForRef(ref: string, lane: string): AsyncQueueStorage;
99
108
  scratchStorage(): AsyncScratchStorage;
100
109
  scratchStorageForRef(ref: string): AsyncScratchStorage;
101
110
  archiveFactory(): AsyncArchiveFactory;
102
111
  archiveFactoryForRef(ref: string): AsyncArchiveFactory;
103
112
  journalStorage(): AsyncJournalStorage;
104
- queueStorage?: AsyncQueueStorage;
105
- boardWorkerStore?: AsyncBoardWorkerStore;
106
- chatAgentQueueStorage?: AsyncQueueStorage;
107
- chatAgentStore?: AsyncBoardWorkerStore;
108
- processAccumulatedQueueStorage?: AsyncQueueStorage;
109
- processAccumulatedStore?: AsyncQueueStorage;
113
+ journalStorageForRef(ref: string): AsyncJournalStorage;
110
114
  lock: AsyncAtomicRelayLock;
111
115
  callbackTransport?: BoardCallbackTransport;
112
116
  fetch?: HostedFetchLike;
@@ -1,25 +1,2 @@
1
- 'use strict';require('./chunk-GNFE24S7.cjs');var l=require('fs'),a=require('path'),child_process=require('child_process'),module$1=require('module');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var l__namespace=/*#__PURE__*/_interopNamespace(l);var a__namespace=/*#__PURE__*/_interopNamespace(a);var p=new Map;function v(r,e){let t=String(r||"").trim();if(!t)throw new Error("registerInProcessBoardWorkerCallback: key is required");p.set(t,e);}function B(r){let e=String(r||"").trim();e&&p.delete(e);}async function f(r,e){let t=String(e||"").trim();if(!t)throw new Error("in-process-loop callback requires a non-empty handler key");let o=p.get(t);if(!o)throw new Error(`in-process-loop callback handler not registered: ${t}`);let n=await o(r);if(n&&n.status&&n.status!=="success")throw new Error(n.error||`in-process-loop callback failed with status: ${n.status}`)}function g(r,e,t){w(m(r),JSON.stringify({tool:"webhook.source-fetch-done",args:{token:e,ref:t}}));}function h(r,e,t){w(m(r),JSON.stringify({tool:"webhook.source-fetch-failed",args:{token:e,reason:t}}));}function m(r){return String(r||"").replace(/\/+$/,"")}function w(r,e){let t=`
2
- const rawUrl = ${JSON.stringify(r)};
3
- const rawBody = ${JSON.stringify(e)};
4
- const u = new URL(rawUrl);
5
- const {request} = require(u.protocol === 'https:' ? 'https' : 'http');
6
- const h = { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(rawBody) };
7
- const req = request({hostname:u.hostname,port:u.port,path:u.pathname+u.search,method:'POST',headers:h}, (res) => {
8
- let responseBody = '';
9
- res.setEncoding('utf8');
10
- res.on('data', chunk => { responseBody += chunk; });
11
- res.on('end', () => {
12
- const code = res.statusCode || 500;
13
- if (code < 200 || code >= 300) {
14
- const msg = responseBody.trim() || res.statusMessage || ('HTTP ' + code);
15
- process.stderr.write(msg);
16
- process.exit(1);
17
- }
18
- });
19
- });
20
- req.on('error', e => { process.stderr.write(e.message); process.exit(1); });
21
- req.write(rawBody);
22
- req.end();
23
- `,o=child_process.spawnSync(process.execPath,["-e",t],{encoding:"utf-8",windowsHide:true});if(o.status!==0)throw new Error(`http-post failed: ${o.stderr?.trim()}`)}var S=module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('board-worker-adapter.cjs', document.baseURI).href)));function b(r,e,t){x(r,["source-data-fetched","--ref",t,"--token",e],"reportComplete");}function y(r,e,t){x(r,["source-data-fetch-failure","--token",e,"--reason",t],"reportFailed");}function x(r,e,t){let o=I(r.whatToRun),{cmd:n,args:s}=T(o),i=P(r),u=child_process.spawnSync(n,[...s,...e,...i?["--notify-channel",i]:[]],{encoding:"utf-8",windowsHide:true});if(u.status!==0)throw new Error(`${t}: board CLI exited ${u.status}: ${u.stderr?.trim()}`)}function I(r){let e=E(r);if(e.kind==="yaml-flow-cli"){let t=a__namespace.basename(e.value.trim());if(!t)throw new Error(`Invalid yaml-flow-cli ref: expected non-empty cli file name, got ${JSON.stringify(e.value)}`);let o=a__namespace.dirname(S.resolve("yaml-flow/package.json")),n=t.replace(/\.[^.]+$/,""),s=a__namespace.join(o,"cli","bundled",`${n}.mjs`);if(l__namespace.existsSync(s))return s;let i=a__namespace.join(o,"cli","node",t);if(l__namespace.existsSync(i))return i;throw new Error(`Invalid yaml-flow-cli ref: could not find ${t} under cli/bundled or cli/node in ${o}`)}return e.value}function P(r){let e=r.extra?.notifyChannel;return typeof e=="string"&&e.length>0?e:void 0}function T(r){if(!r.endsWith(".ts"))return {cmd:process.execPath,args:[r]};let e=a__namespace.dirname(r),t=[];for(let n=1;n<=5;n++){let s=a__namespace.join(e,...Array(n).fill(".."),"node_modules");t.push(a__namespace.join(s,"tsx","dist","cli.mjs")),t.push(a__namespace.join(s,".bin","tsx"));}let o=t.find(n=>l__namespace.existsSync(n));return o?{cmd:process.execPath,args:[o,r]}:{cmd:"npx",args:["tsx",r]}}function E(r){if(!r.startsWith("b64:"))throw new Error(`Invalid ref format (expected b64:<base64url(json)>): ${r}`);let e=r.slice(4),t=e.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-e.length%4)%4),o;try{o=JSON.parse(Buffer.from(t,"base64").toString("utf8"));}catch{throw new Error(`Invalid ref format (malformed base64url/json): ${r}`)}if(!o||typeof o!="object")throw new Error(`Invalid ref format (expected object payload): ${r}`);let n=o;if(typeof n.kind!="string"||typeof n.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${r}`);return {kind:n.kind,value:n.value}}function d(r){if(!r.startsWith("b64:"))throw new Error(`Invalid ref format (expected b64:<base64url(json)>): ${r}`);let e=r.slice(4),t=e.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-e.length%4)%4),o;try{o=JSON.parse(Buffer.from(t,"base64").toString("utf8"));}catch{throw new Error(`Invalid ref format (malformed base64url/json): ${r}`)}if(!o||typeof o!="object")throw new Error(`Invalid ref format (expected object payload): ${r}`);let n=o;if(typeof n.kind!="string"||typeof n.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${r}`);return {kind:n.kind,value:n.value}}function k(r){return `b64:${Buffer.from(JSON.stringify(r),"utf8").toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}`}function N(){return {read(r){if(!l__namespace.default.existsSync(r))return null;try{return l__namespace.default.readFileSync(r,"utf-8")}catch{return null}},write(r,e){l__namespace.default.mkdirSync(a__namespace.default.dirname(r),{recursive:true}),l__namespace.default.writeFileSync(r,e,"utf-8");}}}function _(r){if(r.kind==="fs-path")return N();throw new Error(`Unsupported storage kind: "${r.kind}". Supported kinds: fs-path`)}function M(r,e){let{token:t,via:o}=r;if(o.howToRun==="local-node"||o.howToRun==="local-process"){b(o,t,k(e));return}if(o.howToRun==="http:post"){g(d(o.whatToRun).value,t,k(e));return}if(o.howToRun==="in-process-loop"){f({token:t,outcome:"success",ref:k(e)},d(o.whatToRun).value);return}throw new Error(`reportComplete: unsupported via.howToRun "${o.howToRun}"`)}function A(r,e){let{token:t,via:o}=r;if(o.howToRun==="local-node"||o.howToRun==="local-process"){y(o,t,e);return}if(o.howToRun==="http:post"){h(d(o.whatToRun).value,t,e);return}if(o.howToRun==="in-process-loop"){f({token:t,outcome:"failure",reason:e},d(o.whatToRun).value);return}throw new Error(`reportFailed: unsupported via.howToRun "${o.howToRun}"`)}
24
- exports.blobStorageForRef=_;exports.parseRef=d;exports.registerInProcessBoardWorkerCallback=v;exports.reportComplete=M;exports.reportFailed=A;exports.serializeRef=k;exports.unregisterInProcessBoardWorkerCallback=B;//# sourceMappingURL=board-worker-adapter.cjs.map
1
+ 'use strict';var chunkH4TYOSMD_cjs=require('./chunk-H4TYOSMD.cjs');require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"blobStorageForRef",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.g}});Object.defineProperty(exports,"createImmediateBoardWorkerHook",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.m}});Object.defineProperty(exports,"createImmediateBoardWorkerRef",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.k}});Object.defineProperty(exports,"invokeBoardWorker",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.h}});Object.defineProperty(exports,"invokeBoardWorkerSync",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.i}});Object.defineProperty(exports,"invokeStepMachineExecutionRef",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.j}});Object.defineProperty(exports,"loadImmediateBoardWorkerHandler",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.l}});Object.defineProperty(exports,"parseRef",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.e}});Object.defineProperty(exports,"registerInProcessBoardWorkerCallback",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.a}});Object.defineProperty(exports,"registerInProcessBoardWorkerInvoke",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.c}});Object.defineProperty(exports,"reportComplete",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.n}});Object.defineProperty(exports,"reportFailed",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.o}});Object.defineProperty(exports,"serializeRef",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.f}});Object.defineProperty(exports,"unregisterInProcessBoardWorkerCallback",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.b}});Object.defineProperty(exports,"unregisterInProcessBoardWorkerInvoke",{enumerable:true,get:function(){return chunkH4TYOSMD_cjs.d}});//# sourceMappingURL=board-worker-adapter.cjs.map
25
2
  //# sourceMappingURL=board-worker-adapter.cjs.map
@@ -13,6 +13,20 @@ type InProcessBoardWorkerCallbackHandler = (payload: InProcessBoardWorkerCallbac
13
13
  declare function registerInProcessBoardWorkerCallback(key: string, handler: InProcessBoardWorkerCallbackHandler): void;
14
14
  declare function unregisterInProcessBoardWorkerCallback(key: string): void;
15
15
 
16
+ interface InProcessBoardWorkerInvokeRequest {
17
+ subcommand?: string;
18
+ inRef?: string;
19
+ outRef?: string;
20
+ errRef?: string;
21
+ input?: string;
22
+ extra?: Record<string, unknown>;
23
+ [key: string]: unknown;
24
+ }
25
+ type InProcessBoardWorkerInvokeResult = unknown;
26
+ type InProcessBoardWorkerInvokeHandler = (request: InProcessBoardWorkerInvokeRequest) => InProcessBoardWorkerInvokeResult | Promise<InProcessBoardWorkerInvokeResult>;
27
+ declare function registerInProcessBoardWorkerInvoke(key: string, handler: InProcessBoardWorkerInvokeHandler): void;
28
+ declare function unregisterInProcessBoardWorkerInvoke(key: string): void;
29
+
16
30
  /**
17
31
  * board-worker-adapter.ts
18
32
  *
@@ -87,11 +101,56 @@ interface ExecutionRef {
87
101
  meta?: string;
88
102
  /** Transport / runtime kind. */
89
103
  howToRun: 'local-node' | 'local-python' | 'local-process' | 'http:post' | 'http:get' | 'built-in' | 'in-process-loop';
90
- /** Address of the target in b64:<base64url(json)> wire form. */
91
- whatToRun: string;
104
+ /** Address of the target in b64:<base64url(json)> wire form or plain object ref form. */
105
+ whatToRun: string | KindValueRef;
106
+ /** Optional JSONata-based mapping from logical args to transport shape. */
107
+ argsMassaging?: ArgsMassaging;
108
+ /** Optional raw-result transforms expected by step-machine-public. */
109
+ outputTransforms?: OutputTransforms;
92
110
  /** Opaque executor config stored with the ref. */
93
111
  extra?: Record<string, unknown>;
94
112
  }
113
+ interface LocalNodeExecutionRef extends ExecutionRef {
114
+ howToRun: 'local-node' | 'local-process';
115
+ }
116
+ interface ArgsMassaging {
117
+ cmdTemplate?: string[];
118
+ stdinTemplate?: string;
119
+ urlTemplate?: string;
120
+ headerTemplate?: string;
121
+ bodyTemplate?: string;
122
+ }
123
+ interface OutputTransforms {
124
+ resultExpr?: string;
125
+ dataTemplate?: string;
126
+ errorExpr?: string;
127
+ }
128
+ interface NormalizedHandlerResult {
129
+ result: string;
130
+ data: Record<string, unknown>;
131
+ error?: string;
132
+ }
133
+ interface StepMachineInvokeOptions {
134
+ timeoutMs?: number;
135
+ label?: string;
136
+ }
137
+ interface BoardWorkerInvokeRequest {
138
+ subcommand?: string;
139
+ inRef?: string;
140
+ outRef?: string;
141
+ errRef?: string;
142
+ input?: string;
143
+ extra?: Record<string, unknown>;
144
+ [key: string]: unknown;
145
+ }
146
+ type BoardWorkerInvokeResult = unknown;
147
+ interface ImmediateBoardWorkerRequest {
148
+ subcommand: string;
149
+ input?: string;
150
+ timeoutMs?: number;
151
+ extra?: Record<string, unknown>;
152
+ }
153
+ type ImmediateBoardWorkerHandler = (request: ImmediateBoardWorkerRequest) => unknown | Promise<unknown>;
95
154
  type BoardWorkerCallbackOutcome = 'success' | 'failure';
96
155
  /**
97
156
  * Describes how the board wants to receive task completion callbacks.
@@ -104,6 +163,12 @@ interface TaskCallback {
104
163
  /** Delivery mechanism — an ExecutionRef pointing at the board CLI or endpoint. */
105
164
  via: ExecutionRef;
106
165
  }
166
+ declare function invokeBoardWorker(via: ExecutionRef, request: BoardWorkerInvokeRequest): Promise<BoardWorkerInvokeResult>;
167
+ declare function invokeBoardWorkerSync(via: ExecutionRef, request: BoardWorkerInvokeRequest): BoardWorkerInvokeResult;
168
+ declare function invokeStepMachineExecutionRef(via: ExecutionRef, args: Record<string, unknown>, options?: StepMachineInvokeOptions): Promise<NormalizedHandlerResult>;
169
+ declare function createImmediateBoardWorkerRef(scriptPath: string, extra?: Record<string, unknown>): LocalNodeExecutionRef;
170
+ declare function loadImmediateBoardWorkerHandler(scriptPath: string): Promise<ImmediateBoardWorkerHandler>;
171
+ declare function createImmediateBoardWorkerHook(execute: ImmediateBoardWorkerHandler, defaultExtra?: Record<string, unknown>): ImmediateBoardWorkerHandler;
107
172
  /**
108
173
  * Report successful task completion back to the board.
109
174
  * Call this from a task-executor after writing the result to outRef.
@@ -115,4 +180,4 @@ declare function reportComplete(callback: TaskCallback, outRef: KindValueRef): v
115
180
  */
116
181
  declare function reportFailed(callback: TaskCallback, reason: string): void;
117
182
 
118
- export { type BlobStorage, type BoardWorkerCallbackOutcome, type ExecutionRef, type InProcessBoardWorkerCallbackHandler, type InProcessBoardWorkerCallbackPayload, type InProcessBoardWorkerCallbackResult, type KindValueRef, type TaskCallback, blobStorageForRef, parseRef, registerInProcessBoardWorkerCallback, reportComplete, reportFailed, serializeRef, unregisterInProcessBoardWorkerCallback };
183
+ export { type ArgsMassaging, type BlobStorage, type BoardWorkerCallbackOutcome, type BoardWorkerInvokeRequest, type BoardWorkerInvokeResult, type ExecutionRef, type ImmediateBoardWorkerHandler, type ImmediateBoardWorkerRequest, type InProcessBoardWorkerCallbackHandler, type InProcessBoardWorkerCallbackPayload, type InProcessBoardWorkerCallbackResult, type InProcessBoardWorkerInvokeHandler, type InProcessBoardWorkerInvokeRequest, type InProcessBoardWorkerInvokeResult, type KindValueRef, type LocalNodeExecutionRef, type NormalizedHandlerResult, type OutputTransforms, type StepMachineInvokeOptions, type TaskCallback, blobStorageForRef, createImmediateBoardWorkerHook, createImmediateBoardWorkerRef, invokeBoardWorker, invokeBoardWorkerSync, invokeStepMachineExecutionRef, loadImmediateBoardWorkerHandler, parseRef, registerInProcessBoardWorkerCallback, registerInProcessBoardWorkerInvoke, reportComplete, reportFailed, serializeRef, unregisterInProcessBoardWorkerCallback, unregisterInProcessBoardWorkerInvoke };
@@ -13,6 +13,20 @@ type InProcessBoardWorkerCallbackHandler = (payload: InProcessBoardWorkerCallbac
13
13
  declare function registerInProcessBoardWorkerCallback(key: string, handler: InProcessBoardWorkerCallbackHandler): void;
14
14
  declare function unregisterInProcessBoardWorkerCallback(key: string): void;
15
15
 
16
+ interface InProcessBoardWorkerInvokeRequest {
17
+ subcommand?: string;
18
+ inRef?: string;
19
+ outRef?: string;
20
+ errRef?: string;
21
+ input?: string;
22
+ extra?: Record<string, unknown>;
23
+ [key: string]: unknown;
24
+ }
25
+ type InProcessBoardWorkerInvokeResult = unknown;
26
+ type InProcessBoardWorkerInvokeHandler = (request: InProcessBoardWorkerInvokeRequest) => InProcessBoardWorkerInvokeResult | Promise<InProcessBoardWorkerInvokeResult>;
27
+ declare function registerInProcessBoardWorkerInvoke(key: string, handler: InProcessBoardWorkerInvokeHandler): void;
28
+ declare function unregisterInProcessBoardWorkerInvoke(key: string): void;
29
+
16
30
  /**
17
31
  * board-worker-adapter.ts
18
32
  *
@@ -87,11 +101,56 @@ interface ExecutionRef {
87
101
  meta?: string;
88
102
  /** Transport / runtime kind. */
89
103
  howToRun: 'local-node' | 'local-python' | 'local-process' | 'http:post' | 'http:get' | 'built-in' | 'in-process-loop';
90
- /** Address of the target in b64:<base64url(json)> wire form. */
91
- whatToRun: string;
104
+ /** Address of the target in b64:<base64url(json)> wire form or plain object ref form. */
105
+ whatToRun: string | KindValueRef;
106
+ /** Optional JSONata-based mapping from logical args to transport shape. */
107
+ argsMassaging?: ArgsMassaging;
108
+ /** Optional raw-result transforms expected by step-machine-public. */
109
+ outputTransforms?: OutputTransforms;
92
110
  /** Opaque executor config stored with the ref. */
93
111
  extra?: Record<string, unknown>;
94
112
  }
113
+ interface LocalNodeExecutionRef extends ExecutionRef {
114
+ howToRun: 'local-node' | 'local-process';
115
+ }
116
+ interface ArgsMassaging {
117
+ cmdTemplate?: string[];
118
+ stdinTemplate?: string;
119
+ urlTemplate?: string;
120
+ headerTemplate?: string;
121
+ bodyTemplate?: string;
122
+ }
123
+ interface OutputTransforms {
124
+ resultExpr?: string;
125
+ dataTemplate?: string;
126
+ errorExpr?: string;
127
+ }
128
+ interface NormalizedHandlerResult {
129
+ result: string;
130
+ data: Record<string, unknown>;
131
+ error?: string;
132
+ }
133
+ interface StepMachineInvokeOptions {
134
+ timeoutMs?: number;
135
+ label?: string;
136
+ }
137
+ interface BoardWorkerInvokeRequest {
138
+ subcommand?: string;
139
+ inRef?: string;
140
+ outRef?: string;
141
+ errRef?: string;
142
+ input?: string;
143
+ extra?: Record<string, unknown>;
144
+ [key: string]: unknown;
145
+ }
146
+ type BoardWorkerInvokeResult = unknown;
147
+ interface ImmediateBoardWorkerRequest {
148
+ subcommand: string;
149
+ input?: string;
150
+ timeoutMs?: number;
151
+ extra?: Record<string, unknown>;
152
+ }
153
+ type ImmediateBoardWorkerHandler = (request: ImmediateBoardWorkerRequest) => unknown | Promise<unknown>;
95
154
  type BoardWorkerCallbackOutcome = 'success' | 'failure';
96
155
  /**
97
156
  * Describes how the board wants to receive task completion callbacks.
@@ -104,6 +163,12 @@ interface TaskCallback {
104
163
  /** Delivery mechanism — an ExecutionRef pointing at the board CLI or endpoint. */
105
164
  via: ExecutionRef;
106
165
  }
166
+ declare function invokeBoardWorker(via: ExecutionRef, request: BoardWorkerInvokeRequest): Promise<BoardWorkerInvokeResult>;
167
+ declare function invokeBoardWorkerSync(via: ExecutionRef, request: BoardWorkerInvokeRequest): BoardWorkerInvokeResult;
168
+ declare function invokeStepMachineExecutionRef(via: ExecutionRef, args: Record<string, unknown>, options?: StepMachineInvokeOptions): Promise<NormalizedHandlerResult>;
169
+ declare function createImmediateBoardWorkerRef(scriptPath: string, extra?: Record<string, unknown>): LocalNodeExecutionRef;
170
+ declare function loadImmediateBoardWorkerHandler(scriptPath: string): Promise<ImmediateBoardWorkerHandler>;
171
+ declare function createImmediateBoardWorkerHook(execute: ImmediateBoardWorkerHandler, defaultExtra?: Record<string, unknown>): ImmediateBoardWorkerHandler;
107
172
  /**
108
173
  * Report successful task completion back to the board.
109
174
  * Call this from a task-executor after writing the result to outRef.
@@ -115,4 +180,4 @@ declare function reportComplete(callback: TaskCallback, outRef: KindValueRef): v
115
180
  */
116
181
  declare function reportFailed(callback: TaskCallback, reason: string): void;
117
182
 
118
- export { type BlobStorage, type BoardWorkerCallbackOutcome, type ExecutionRef, type InProcessBoardWorkerCallbackHandler, type InProcessBoardWorkerCallbackPayload, type InProcessBoardWorkerCallbackResult, type KindValueRef, type TaskCallback, blobStorageForRef, parseRef, registerInProcessBoardWorkerCallback, reportComplete, reportFailed, serializeRef, unregisterInProcessBoardWorkerCallback };
183
+ export { type ArgsMassaging, type BlobStorage, type BoardWorkerCallbackOutcome, type BoardWorkerInvokeRequest, type BoardWorkerInvokeResult, type ExecutionRef, type ImmediateBoardWorkerHandler, type ImmediateBoardWorkerRequest, type InProcessBoardWorkerCallbackHandler, type InProcessBoardWorkerCallbackPayload, type InProcessBoardWorkerCallbackResult, type InProcessBoardWorkerInvokeHandler, type InProcessBoardWorkerInvokeRequest, type InProcessBoardWorkerInvokeResult, type KindValueRef, type LocalNodeExecutionRef, type NormalizedHandlerResult, type OutputTransforms, type StepMachineInvokeOptions, type TaskCallback, blobStorageForRef, createImmediateBoardWorkerHook, createImmediateBoardWorkerRef, invokeBoardWorker, invokeBoardWorkerSync, invokeStepMachineExecutionRef, loadImmediateBoardWorkerHandler, parseRef, registerInProcessBoardWorkerCallback, registerInProcessBoardWorkerInvoke, reportComplete, reportFailed, serializeRef, unregisterInProcessBoardWorkerCallback, unregisterInProcessBoardWorkerInvoke };
@@ -1,25 +1,2 @@
1
- import'./chunk-FW4363Y4.js';import*as l from'fs';import l__default from'fs';import*as a from'path';import a__default from'path';import {spawnSync}from'child_process';import {createRequire}from'module';var p=new Map;function v(r,e){let t=String(r||"").trim();if(!t)throw new Error("registerInProcessBoardWorkerCallback: key is required");p.set(t,e);}function B(r){let e=String(r||"").trim();e&&p.delete(e);}async function f(r,e){let t=String(e||"").trim();if(!t)throw new Error("in-process-loop callback requires a non-empty handler key");let o=p.get(t);if(!o)throw new Error(`in-process-loop callback handler not registered: ${t}`);let n=await o(r);if(n&&n.status&&n.status!=="success")throw new Error(n.error||`in-process-loop callback failed with status: ${n.status}`)}function g(r,e,t){w(m(r),JSON.stringify({tool:"webhook.source-fetch-done",args:{token:e,ref:t}}));}function h(r,e,t){w(m(r),JSON.stringify({tool:"webhook.source-fetch-failed",args:{token:e,reason:t}}));}function m(r){return String(r||"").replace(/\/+$/,"")}function w(r,e){let t=`
2
- const rawUrl = ${JSON.stringify(r)};
3
- const rawBody = ${JSON.stringify(e)};
4
- const u = new URL(rawUrl);
5
- const {request} = require(u.protocol === 'https:' ? 'https' : 'http');
6
- const h = { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(rawBody) };
7
- const req = request({hostname:u.hostname,port:u.port,path:u.pathname+u.search,method:'POST',headers:h}, (res) => {
8
- let responseBody = '';
9
- res.setEncoding('utf8');
10
- res.on('data', chunk => { responseBody += chunk; });
11
- res.on('end', () => {
12
- const code = res.statusCode || 500;
13
- if (code < 200 || code >= 300) {
14
- const msg = responseBody.trim() || res.statusMessage || ('HTTP ' + code);
15
- process.stderr.write(msg);
16
- process.exit(1);
17
- }
18
- });
19
- });
20
- req.on('error', e => { process.stderr.write(e.message); process.exit(1); });
21
- req.write(rawBody);
22
- req.end();
23
- `,o=spawnSync(process.execPath,["-e",t],{encoding:"utf-8",windowsHide:true});if(o.status!==0)throw new Error(`http-post failed: ${o.stderr?.trim()}`)}var S=createRequire(import.meta.url);function b(r,e,t){x(r,["source-data-fetched","--ref",t,"--token",e],"reportComplete");}function y(r,e,t){x(r,["source-data-fetch-failure","--token",e,"--reason",t],"reportFailed");}function x(r,e,t){let o=I(r.whatToRun),{cmd:n,args:s}=T(o),i=P(r),u=spawnSync(n,[...s,...e,...i?["--notify-channel",i]:[]],{encoding:"utf-8",windowsHide:true});if(u.status!==0)throw new Error(`${t}: board CLI exited ${u.status}: ${u.stderr?.trim()}`)}function I(r){let e=E(r);if(e.kind==="yaml-flow-cli"){let t=a.basename(e.value.trim());if(!t)throw new Error(`Invalid yaml-flow-cli ref: expected non-empty cli file name, got ${JSON.stringify(e.value)}`);let o=a.dirname(S.resolve("yaml-flow/package.json")),n=t.replace(/\.[^.]+$/,""),s=a.join(o,"cli","bundled",`${n}.mjs`);if(l.existsSync(s))return s;let i=a.join(o,"cli","node",t);if(l.existsSync(i))return i;throw new Error(`Invalid yaml-flow-cli ref: could not find ${t} under cli/bundled or cli/node in ${o}`)}return e.value}function P(r){let e=r.extra?.notifyChannel;return typeof e=="string"&&e.length>0?e:void 0}function T(r){if(!r.endsWith(".ts"))return {cmd:process.execPath,args:[r]};let e=a.dirname(r),t=[];for(let n=1;n<=5;n++){let s=a.join(e,...Array(n).fill(".."),"node_modules");t.push(a.join(s,"tsx","dist","cli.mjs")),t.push(a.join(s,".bin","tsx"));}let o=t.find(n=>l.existsSync(n));return o?{cmd:process.execPath,args:[o,r]}:{cmd:"npx",args:["tsx",r]}}function E(r){if(!r.startsWith("b64:"))throw new Error(`Invalid ref format (expected b64:<base64url(json)>): ${r}`);let e=r.slice(4),t=e.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-e.length%4)%4),o;try{o=JSON.parse(Buffer.from(t,"base64").toString("utf8"));}catch{throw new Error(`Invalid ref format (malformed base64url/json): ${r}`)}if(!o||typeof o!="object")throw new Error(`Invalid ref format (expected object payload): ${r}`);let n=o;if(typeof n.kind!="string"||typeof n.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${r}`);return {kind:n.kind,value:n.value}}function d(r){if(!r.startsWith("b64:"))throw new Error(`Invalid ref format (expected b64:<base64url(json)>): ${r}`);let e=r.slice(4),t=e.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-e.length%4)%4),o;try{o=JSON.parse(Buffer.from(t,"base64").toString("utf8"));}catch{throw new Error(`Invalid ref format (malformed base64url/json): ${r}`)}if(!o||typeof o!="object")throw new Error(`Invalid ref format (expected object payload): ${r}`);let n=o;if(typeof n.kind!="string"||typeof n.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${r}`);return {kind:n.kind,value:n.value}}function k(r){return `b64:${Buffer.from(JSON.stringify(r),"utf8").toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}`}function N(){return {read(r){if(!l__default.existsSync(r))return null;try{return l__default.readFileSync(r,"utf-8")}catch{return null}},write(r,e){l__default.mkdirSync(a__default.dirname(r),{recursive:true}),l__default.writeFileSync(r,e,"utf-8");}}}function _(r){if(r.kind==="fs-path")return N();throw new Error(`Unsupported storage kind: "${r.kind}". Supported kinds: fs-path`)}function M(r,e){let{token:t,via:o}=r;if(o.howToRun==="local-node"||o.howToRun==="local-process"){b(o,t,k(e));return}if(o.howToRun==="http:post"){g(d(o.whatToRun).value,t,k(e));return}if(o.howToRun==="in-process-loop"){f({token:t,outcome:"success",ref:k(e)},d(o.whatToRun).value);return}throw new Error(`reportComplete: unsupported via.howToRun "${o.howToRun}"`)}function A(r,e){let{token:t,via:o}=r;if(o.howToRun==="local-node"||o.howToRun==="local-process"){y(o,t,e);return}if(o.howToRun==="http:post"){h(d(o.whatToRun).value,t,e);return}if(o.howToRun==="in-process-loop"){f({token:t,outcome:"failure",reason:e},d(o.whatToRun).value);return}throw new Error(`reportFailed: unsupported via.howToRun "${o.howToRun}"`)}
24
- export{_ as blobStorageForRef,d as parseRef,v as registerInProcessBoardWorkerCallback,M as reportComplete,A as reportFailed,k as serializeRef,B as unregisterInProcessBoardWorkerCallback};//# sourceMappingURL=board-worker-adapter.js.map
1
+ export{g as blobStorageForRef,m as createImmediateBoardWorkerHook,k as createImmediateBoardWorkerRef,h as invokeBoardWorker,i as invokeBoardWorkerSync,j as invokeStepMachineExecutionRef,l as loadImmediateBoardWorkerHandler,e as parseRef,a as registerInProcessBoardWorkerCallback,c as registerInProcessBoardWorkerInvoke,n as reportComplete,o as reportFailed,f as serializeRef,b as unregisterInProcessBoardWorkerCallback,d as unregisterInProcessBoardWorkerInvoke}from'./chunk-J4MHQ7JF.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=board-worker-adapter.js.map
25
2
  //# sourceMappingURL=board-worker-adapter.js.map
@@ -1,5 +1,5 @@
1
- import { C as CommandInput, a as CommandResult, L as LiveCard, b as CardAdminStore } from './board-live-cards-public-LlVUQPL2.cjs';
2
- import './storage-interface-BFiD3kyB.cjs';
1
+ import { C as CommandInput, a as CommandResult, L as LiveCard, b as CardAdminStore } from './board-live-cards-public-BT5HrgqZ.cjs';
2
+ import './storage-interface-D-iEiTJA.cjs';
3
3
  import './execution-refs.cjs';
4
4
  import './types-BBhqYGhE.cjs';
5
5
 
@@ -1,5 +1,5 @@
1
- import { C as CommandInput, a as CommandResult, L as LiveCard, b as CardAdminStore } from './board-live-cards-public-JNRKfBZy.js';
2
- import './storage-interface-BFiD3kyB.js';
1
+ import { C as CommandInput, a as CommandResult, L as LiveCard, b as CardAdminStore } from './board-live-cards-public-DSRamFm8.js';
2
+ import './storage-interface-D-iEiTJA.js';
3
3
  import './execution-refs.js';
4
4
  import './types-BBhqYGhE.js';
5
5
 
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkGYQXDNNI_cjs=require('./chunk-GYQXDNNI.cjs');require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"createChatStorePublic",{enumerable:true,get:function(){return chunkGYQXDNNI_cjs.a}});//# sourceMappingURL=chat-store-public.cjs.map
1
+ 'use strict';var chunkUB54HZA4_cjs=require('./chunk-UB54HZA4.cjs');require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"createChatStorePublic",{enumerable:true,get:function(){return chunkUB54HZA4_cjs.a}});//# sourceMappingURL=chat-store-public.cjs.map
2
2
  //# sourceMappingURL=chat-store-public.cjs.map
@@ -1,6 +1,5 @@
1
- import { C as CommandInput, a as CommandResult } from './board-live-cards-public-LlVUQPL2.cjs';
2
- import { a as ChatRecord, b as ChatReadAfterResult, c as ChatConfig, C as ChatStorage } from './chat-storage-lib-B9Q34Dyv.cjs';
3
- import './storage-interface-BFiD3kyB.cjs';
1
+ import { C as CommandInput, a as CommandResult, g as ChatRecord, h as ChatReadAfterResult, i as ChatConfig, f as ChatStorage } from './board-live-cards-public-BT5HrgqZ.cjs';
2
+ import './storage-interface-D-iEiTJA.cjs';
4
3
  import './execution-refs.cjs';
5
4
  import './types-BBhqYGhE.cjs';
6
5
 
@@ -29,6 +28,7 @@ import './types-BBhqYGhE.cjs';
29
28
  * const result = store.setConfig({ params: { cardId: 'c1' }, body: { systemPrompt: '...' } });
30
29
  */
31
30
 
31
+ type Awaitable<T> = T | Promise<T>;
32
32
  type ChatStoreCommandName = 'append' | 'read-all' | 'read-after' | 'clear' | 'set-processing' | 'is-processing' | 'get-config' | 'set-config';
33
33
  type ChatStoreCommandEnvelope = {
34
34
  command: ChatStoreCommandName;
@@ -65,71 +65,71 @@ interface ChatStorePublic {
65
65
  * body.text: string
66
66
  * body.files?: unknown[]
67
67
  */
68
- append(input: CommandInput): CommandResult<{
68
+ append(input: CommandInput): Awaitable<CommandResult<{
69
69
  id: string;
70
- }>;
70
+ }>>;
71
71
  /**
72
72
  * Read all messages for a card in insertion order.
73
73
  * params.cardId: string
74
74
  * body.lastUserTurns?: positive integer
75
75
  */
76
- readAll(input: CommandInput): CommandResult<{
76
+ readAll(input: CommandInput): Awaitable<CommandResult<{
77
77
  records: ChatRecord[];
78
- }>;
78
+ }>>;
79
79
  /**
80
80
  * Read messages appended after a cursor.
81
81
  * params.cardId: string
82
82
  * params.cursor?: string | null (omit or null to read from the beginning)
83
83
  */
84
- readAfter(input: CommandInput): CommandResult<ChatReadAfterResult>;
84
+ readAfter(input: CommandInput): Awaitable<CommandResult<ChatReadAfterResult>>;
85
85
  /**
86
86
  * Remove all messages for a card.
87
87
  * params.cardId: string
88
88
  */
89
- clear(input: CommandInput): CommandResult<{
89
+ clear(input: CommandInput): Awaitable<CommandResult<{
90
90
  ok: true;
91
- }>;
91
+ }>>;
92
92
  /**
93
93
  * Set or clear the processing flag for a card.
94
94
  * params.cardId: string
95
95
  * body.active: boolean
96
96
  */
97
- setProcessing(input: CommandInput): CommandResult<{
97
+ setProcessing(input: CommandInput): Awaitable<CommandResult<{
98
98
  ok: true;
99
- }>;
99
+ }>>;
100
100
  /**
101
101
  * Check whether a card is currently processing.
102
102
  * params.cardId: string
103
103
  */
104
- isProcessing(input: CommandInput): CommandResult<{
104
+ isProcessing(input: CommandInput): Awaitable<CommandResult<{
105
105
  active: boolean;
106
- }>;
106
+ }>>;
107
107
  /**
108
108
  * Read the chat config for a card.
109
109
  * params.cardId: string
110
110
  */
111
- getConfig(input: CommandInput): CommandResult<{
111
+ getConfig(input: CommandInput): Awaitable<CommandResult<{
112
112
  config: ChatConfig;
113
- }>;
113
+ }>>;
114
114
  /**
115
115
  * Patch (merge) the chat config for a card.
116
116
  * params.cardId: string
117
117
  * body: Partial<ChatConfig> e.g. { systemPrompt: '...' }
118
118
  */
119
- setConfig(input: CommandInput): CommandResult<{
119
+ setConfig(input: CommandInput): Awaitable<CommandResult<{
120
120
  ok: true;
121
- }>;
121
+ }>>;
122
122
  /**
123
123
  * Run a single command envelope against this store instance.
124
124
  * The store is already bound to a backing adapter, so boardDir is not part
125
125
  * of the public contract here.
126
126
  */
127
- run(envelope: ChatStoreCommandEnvelope, label?: string): CommandResult<unknown>;
127
+ run(envelope: ChatStoreCommandEnvelope, label?: string): Awaitable<CommandResult<unknown>>;
128
128
  /**
129
129
  * Run a sequence of command envelopes with optional top-level cardId default.
130
130
  * Stops on first non-success result and returns that failure/error.
131
131
  */
132
- runBatch(envelope: ChatStoreCommandBatchEnvelope): CommandResult<ChatStoreBatchResult>;
132
+ runBatch(envelope: ChatStoreCommandBatchEnvelope): Awaitable<CommandResult<ChatStoreBatchResult>>;
133
133
  }
134
134
  declare function createChatStorePublic(store: ChatStorage): ChatStorePublic;
135
135