yaml-flow 8.8.7 → 8.9.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 (155) hide show
  1. package/browser/adapters/firestore-storage.js +2 -2
  2. package/browser/adapters/localstorage-storage.js +3 -3
  3. package/browser/asset-integrity.json +7 -7
  4. package/browser/server-runtime-controlface.js +5 -5
  5. package/examples/board/test/server-http-test-browser.ts +2394 -0
  6. package/examples/board/test/server-http-test.js +44 -35
  7. package/lib/{artifacts-store-lib-C6qBpMfU.d.cts → artifacts-store-lib-CqkJEgbx.d.cts} +1 -1
  8. package/lib/{artifacts-store-lib-D4qf7Q-7.d.ts → artifacts-store-lib-D6Bo4yFN.d.ts} +1 -1
  9. package/lib/artifacts-store-public.d.cts +5 -3
  10. package/lib/artifacts-store-public.d.ts +5 -3
  11. package/lib/board-callback-transport-Bekq8Gp-.d.ts +71 -0
  12. package/lib/board-callback-transport-kP0K6UMq.d.cts +71 -0
  13. package/lib/board-live-cards-lib-DVh3t9NT.d.cts +222 -0
  14. package/lib/board-live-cards-lib-iU8xOwNp.d.ts +222 -0
  15. package/lib/board-live-cards-mcp.cjs +1 -1
  16. package/lib/board-live-cards-mcp.d.cts +4 -8
  17. package/lib/board-live-cards-mcp.d.ts +4 -8
  18. package/lib/board-live-cards-mcp.js +1 -1
  19. package/lib/board-live-cards-node.cjs +7 -7
  20. package/lib/board-live-cards-node.d.cts +15 -11
  21. package/lib/board-live-cards-node.d.ts +15 -11
  22. package/lib/board-live-cards-node.js +7 -7
  23. package/lib/{board-live-cards-public-async-CYjr4mgX.d.cts → board-live-cards-public-async-Cl0M3j5P.d.cts} +6 -4
  24. package/lib/{board-live-cards-public-async-DlyC3PgC.d.ts → board-live-cards-public-async-U98IXUBx.d.ts} +6 -4
  25. package/lib/board-live-cards-public.cjs +1 -1
  26. package/lib/board-live-cards-public.d.cts +325 -3
  27. package/lib/board-live-cards-public.d.ts +325 -3
  28. package/lib/board-live-cards-public.js +1 -1
  29. package/lib/board-live-cards-server-runtime.cjs +1 -1
  30. package/lib/board-live-cards-server-runtime.d.cts +8 -6
  31. package/lib/board-live-cards-server-runtime.d.ts +8 -6
  32. package/lib/board-live-cards-server-runtime.js +1 -1
  33. package/lib/{board-platform-adapter-async-JP9V-U5E.d.ts → board-platform-adapter-async-ByBRFn1G.d.ts} +4 -3
  34. package/lib/{board-platform-adapter-async-BZIftm36.d.cts → board-platform-adapter-async-DjBwE0m9.d.cts} +4 -3
  35. package/lib/board-state-reducer.cjs +2 -0
  36. package/lib/board-state-reducer.d.cts +53 -0
  37. package/lib/board-state-reducer.d.ts +53 -0
  38. package/lib/board-state-reducer.js +2 -0
  39. package/lib/card-store-public.cjs +1 -1
  40. package/lib/card-store-public.d.cts +11 -4
  41. package/lib/card-store-public.d.ts +11 -4
  42. package/lib/card-store-public.js +1 -1
  43. package/lib/chat-store-public.cjs +1 -1
  44. package/lib/chat-store-public.d.cts +15 -4
  45. package/lib/chat-store-public.d.ts +15 -4
  46. package/lib/chat-store-public.js +1 -1
  47. package/lib/chunk-2RIHC5TZ.cjs +2 -0
  48. package/lib/chunk-37FDOKDK.js +3 -0
  49. package/lib/chunk-3S7LV2HZ.cjs +2 -0
  50. package/lib/chunk-3T5TMAWG.cjs +3 -0
  51. package/lib/chunk-5XLFPPTY.cjs +2 -0
  52. package/lib/{chunk-R44X3RQB.cjs → chunk-6EJRZHFP.cjs} +2 -2
  53. package/lib/{chunk-NNSBBO5R.js → chunk-6MD6FVE3.js} +2 -2
  54. package/lib/chunk-7QNEV5S3.js +2 -0
  55. package/lib/{chunk-6OPXQPSC.js → chunk-7UJQMFVS.js} +2 -2
  56. package/lib/chunk-BJGK5FNL.js +2 -0
  57. package/lib/{chunk-ETW3BXHD.cjs → chunk-BQJVCCFU.cjs} +2 -2
  58. package/lib/chunk-DQPBAB5Z.cjs +2 -0
  59. package/lib/chunk-JB4Q2W7I.js +7 -0
  60. package/lib/chunk-JYVYAAXT.js +3 -0
  61. package/lib/chunk-LFVMX23W.cjs +7 -0
  62. package/lib/chunk-NIBLKYXN.js +2 -0
  63. package/lib/chunk-OF4FPYNI.cjs +2 -0
  64. package/lib/chunk-P3R6TXII.js +3 -0
  65. package/lib/{chunk-7BTZCOT5.js → chunk-QLB6PKOT.js} +2 -2
  66. package/lib/chunk-R4YASXSJ.js +2 -0
  67. package/lib/chunk-RZRIXQ6A.cjs +3 -0
  68. package/lib/chunk-SDJ3747Q.cjs +2 -0
  69. package/lib/chunk-SJANU3PL.cjs +3 -0
  70. package/lib/chunk-UGB7PC4P.js +2 -0
  71. package/lib/chunk-VBYNMTWC.js +2 -0
  72. package/lib/{chunk-37HDEW26.cjs → chunk-WRMOGPRG.cjs} +2 -2
  73. package/lib/cloud-storage.cjs +1 -1
  74. package/lib/cloud-storage.d.cts +44 -8
  75. package/lib/cloud-storage.d.ts +44 -8
  76. package/lib/cloud-storage.js +1 -1
  77. package/lib/firebase-storage/index.d.cts +2 -2
  78. package/lib/firebase-storage/index.d.ts +2 -2
  79. package/lib/firestore-storage/index.cjs +2 -2
  80. package/lib/firestore-storage/index.d.cts +6 -5
  81. package/lib/firestore-storage/index.d.ts +6 -5
  82. package/lib/firestore-storage/index.js +2 -2
  83. package/lib/index.cjs +2 -2
  84. package/lib/index.d.cts +1 -1
  85. package/lib/index.d.ts +1 -1
  86. package/lib/index.js +1 -1
  87. package/lib/localstorage-storage/index.cjs +1 -1
  88. package/lib/localstorage-storage/index.d.cts +6 -5
  89. package/lib/localstorage-storage/index.d.ts +6 -5
  90. package/lib/localstorage-storage/index.js +1 -1
  91. package/lib/notification-consumer/index.cjs +2 -0
  92. package/lib/notification-consumer/index.d.cts +17 -0
  93. package/lib/notification-consumer/index.d.ts +17 -0
  94. package/lib/notification-consumer/index.js +2 -0
  95. package/lib/queue-storage-public.cjs +2 -0
  96. package/lib/queue-storage-public.d.cts +13 -0
  97. package/lib/queue-storage-public.d.ts +13 -0
  98. package/lib/queue-storage-public.js +2 -0
  99. package/lib/server-jobs-queue-runner/index.cjs +1 -1
  100. package/lib/server-jobs-queue-runner/index.d.cts +9 -7
  101. package/lib/server-jobs-queue-runner/index.d.ts +9 -7
  102. package/lib/server-jobs-queue-runner/index.js +1 -1
  103. package/lib/server-runtime/index.cjs +1 -1
  104. package/lib/server-runtime/index.d.cts +9 -7
  105. package/lib/server-runtime/index.d.ts +9 -7
  106. package/lib/server-runtime/index.js +1 -1
  107. package/lib/server-runtime-agentface/index.d.cts +8 -6
  108. package/lib/server-runtime-agentface/index.d.ts +8 -6
  109. package/lib/server-runtime-controlface/index.cjs +1 -1
  110. package/lib/server-runtime-controlface/index.d.cts +8 -6
  111. package/lib/server-runtime-controlface/index.d.ts +8 -6
  112. package/lib/server-runtime-controlface/index.js +1 -1
  113. package/lib/server-runtime-core/index.cjs +1 -1
  114. package/lib/server-runtime-core/index.d.cts +16 -37
  115. package/lib/server-runtime-core/index.d.ts +16 -37
  116. package/lib/server-runtime-core/index.js +1 -1
  117. package/lib/server-runtime-watchers/index.cjs +1 -1
  118. package/lib/server-runtime-watchers/index.d.cts +11 -8
  119. package/lib/server-runtime-watchers/index.d.ts +11 -8
  120. package/lib/server-runtime-watchers/index.js +1 -1
  121. package/lib/server-runtime-webhooks/index.d.cts +8 -6
  122. package/lib/server-runtime-webhooks/index.d.ts +8 -6
  123. package/lib/{sse-hub-DM8bw-dO.d.ts → sse-hub-BRBvymHR.d.cts} +18 -15
  124. package/lib/{sse-hub-BDjWI7JR.d.cts → sse-hub-D_94fV87.d.ts} +18 -15
  125. package/lib/step-machine-public/index.d.cts +1 -1
  126. package/lib/step-machine-public/index.d.ts +1 -1
  127. package/lib/{storage-async-interface-CyO-zwVQ.d.cts → storage-async-interface-CLOXiqwC.d.cts} +2 -2
  128. package/lib/{storage-async-interface-CG0bMqvE.d.ts → storage-async-interface-Cb-SULrI.d.ts} +2 -2
  129. package/lib/{storage-interface-D-iEiTJA.d.cts → storage-interface-DogVPooM.d.cts} +1 -1
  130. package/lib/{storage-interface-D-iEiTJA.d.ts → storage-interface-DogVPooM.d.ts} +1 -1
  131. package/lib/stores/index.d.cts +1 -1
  132. package/lib/stores/index.d.ts +1 -1
  133. package/lib/stores/kv.d.cts +1 -1
  134. package/lib/stores/kv.d.ts +1 -1
  135. package/lib/{types-BsfXZyI3.d.ts → types-BsqzUZNl.d.ts} +6 -4
  136. package/lib/{types-CPnYv7RC.d.cts → types-DxhB6Toz.d.cts} +6 -4
  137. package/package.json +16 -1
  138. package/lib/board-live-cards-public-BT5HrgqZ.d.cts +0 -529
  139. package/lib/board-live-cards-public-DSRamFm8.d.ts +0 -529
  140. package/lib/chunk-35N7ONTH.js +0 -2
  141. package/lib/chunk-36QUKFL7.cjs +0 -3
  142. package/lib/chunk-3MMTBEAO.js +0 -2
  143. package/lib/chunk-7QQFDYBM.js +0 -3
  144. package/lib/chunk-7QZ267XP.cjs +0 -2
  145. package/lib/chunk-ABAVFLDP.js +0 -7
  146. package/lib/chunk-EPCJYP4N.js +0 -3
  147. package/lib/chunk-H22NK6KH.cjs +0 -7
  148. package/lib/chunk-KBELAKIY.js +0 -2
  149. package/lib/chunk-OJ2CAQ4C.cjs +0 -2
  150. package/lib/chunk-Q3OTUDIE.js +0 -2
  151. package/lib/chunk-QG6ERLZQ.cjs +0 -3
  152. package/lib/chunk-UB54HZA4.cjs +0 -2
  153. package/lib/chunk-YMEIPKLW.cjs +0 -2
  154. package/lib/chunk-ZENTBLLA.cjs +0 -3
  155. package/lib/chunk-ZWVT24YW.js +0 -3
@@ -1,4 +1,326 @@
1
- import './storage-interface-D-iEiTJA.cjs';
2
- export { p as BOARD_GRAPH_KEY, B as BoardChangeNotification, l as BoardLiveCardsNonCorePublic, c as BoardLiveCardsPublic, z as BoardLiveCardsPublicOptions, d as BoardNonCorePlatformAdapter, e as BoardPlatformAdapter, C as CommandInput, a as CommandResult, E as EMPTY_CONFIG, q as SNAPSHOT_SCHEMA_VERSION_V1, r as createBoardLiveCardsNonCorePublic, s as createBoardLiveCardsPublic } from './board-live-cards-public-BT5HrgqZ.cjs';
3
- import './execution-refs.cjs';
1
+ import { K as KVStorage, B as BlobStorage, S as ScratchStorage, A as ArchiveFactory, Q as QueueStorage, g as AtomicRelayLock, a as KindValueRef } from './storage-interface-DogVPooM.cjs';
2
+ import { C as ChatStorage, B as BoardCallbackTransport } from './board-callback-transport-kP0K6UMq.cjs';
3
+ import { ExecutionRef } from './execution-refs.cjs';
4
+ import { k as BoardStatusObject, L as LiveCard, h as NotificationEmitter, J as JournalStorageAdapter, B as BoardChangeNotification } from './board-live-cards-lib-DVh3t9NT.cjs';
5
+ export { l as BOARD_GRAPH_KEY, E as EMPTY_CONFIG, S as SNAPSHOT_SCHEMA_VERSION_V1 } from './board-live-cards-lib-DVh3t9NT.cjs';
4
6
  import './types-BBhqYGhE.cjs';
7
+
8
+ /**
9
+ * board-live-cards-public.ts
10
+ *
11
+ * Platform-free public API layer for the board-live-cards system.
12
+ *
13
+ * ─────────────────────────────────────────────────────────────────────────────
14
+ * LAYER DIAGRAM
15
+ * ─────────────────────────────────────────────────────────────────────────────
16
+ *
17
+ * board-live-cards-cli.ts (THIN — arg parse → call public → print JSON)
18
+ * ↓ calls
19
+ * board-live-cards-public.ts (THIS FILE — facade, all logic, no platform code)
20
+ * ↓ depends on injected
21
+ * board-live-cards-lib.ts (pure domain — stores, graph, codecs)
22
+ *
23
+ * ─────────────────────────────────────────────────────────────────────────────
24
+ * PLATFORM ADAPTERS (injected into BoardPlatformAdapter)
25
+ * ─────────────────────────────────────────────────────────────────────────────
26
+ *
27
+ * Node/FS createFsBoardPlatformAdapter(baseRef, cliDir)
28
+ * Azure Functions createAzureBoardPlatformAdapter(baseRef, containerClient, …)
29
+ * Firebase Fn createFirebaseBoardPlatformAdapter(baseRef, firestoreDb, …)
30
+ * In-memory/test createInMemoryBoardPlatformAdapter(baseRef)
31
+ *
32
+ * ─────────────────────────────────────────────────────────────────────────────
33
+ * USAGE
34
+ * ─────────────────────────────────────────────────────────────────────────────
35
+ *
36
+ * const board = createBoardLiveCardsPublic(baseRef, adapter);
37
+ * const status = board.status();
38
+ */
39
+
40
+ type CommandInput = {
41
+ params?: Record<string, string | number | boolean>;
42
+ body?: unknown;
43
+ };
44
+ type CommandResult<T = undefined> = (T extends undefined ? {
45
+ status: 'success';
46
+ } : {
47
+ status: 'success';
48
+ data: T;
49
+ }) | {
50
+ status: 'fail';
51
+ error: string;
52
+ } | {
53
+ status: 'error';
54
+ error: string;
55
+ };
56
+ interface BoardPlatformAdapter {
57
+ /**
58
+ * KV storage factory — scoped by namespace.
59
+ * Namespaces used by the public layer:
60
+ * 'state-snapshot' — board graph snapshot (StateSnapshotStorageAdapter, built internally)
61
+ * 'config' — board configuration (.task-executor, .chat-handler, .chat-handler-flow, .card-store-ref)
62
+ * 'card-upsert' — card upsert dedup index
63
+ * 'execution-requests' — queued execution requests (keyed by journalId)
64
+ * 'card-runtime' — card runtime state snapshots
65
+ * 'output' — published board status + card computed outputs
66
+ */
67
+ kvStorage(namespace: string): KVStorage;
68
+ /**
69
+ * Build a KVStorage rooted at the given ref.
70
+ * Used by the public layer for both card store and outputs store routing.
71
+ * FS: createFsKvStorage(parseRef(ref).value)
72
+ * localStorage: createLocalStorageKvStorage(parseRef(ref).value)
73
+ */
74
+ kvStorageForRef(ref: string): KVStorage;
75
+ /**
76
+ * Blob storage factory — scoped by namespace.
77
+ * Namespaces used by the public layer:
78
+ * '' — root-scoped blob access (for resolving arbitrary KindValueRef blobs)
79
+ */
80
+ blobStorage(namespace: string): BlobStorage;
81
+ blobStorageForRef(ref: string): BlobStorage;
82
+ chatStorageForRef(ref: string): ChatStorage;
83
+ /**
84
+ * Ephemeral scratch store for transient I/O staging (probe in/out/err,
85
+ * dispatchExecution argv/out/err). Default scope is board-local; if the
86
+ * config has a 'scratch-store-ref' set, scratchStorageForRef(ref) is used
87
+ * instead.
88
+ */
89
+ scratchStorage(): ScratchStorage;
90
+ scratchStorageForRef(ref: string): ScratchStorage;
91
+ /**
92
+ * Archive factory — long-lived tracking / audit store. Default scope is
93
+ * board-local; if the config has an 'archive-store-ref' set,
94
+ * archiveFactoryForRef(ref) is used instead so archives can live on a
95
+ * different backend / path than the main board runtime.
96
+ */
97
+ archiveFactory(): ArchiveFactory;
98
+ archiveFactoryForRef(ref: string): ArchiveFactory;
99
+ /**
100
+ * Journal storage adapter (append-only log).
101
+ * Uses the lib's JournalStorageAdapter interface.
102
+ * One journal per board — no namespace parameter needed.
103
+ */
104
+ journalAdapter(): JournalStorageAdapter;
105
+ journalAdapterForRef(ref: string): JournalStorageAdapter;
106
+ /**
107
+ * Queue storage lane resolved from an explicit queue store ref.
108
+ * The adapter chooses the backend from the ref; lane chooses the internal queue.
109
+ */
110
+ queueStorageForRef(ref: string, lane: string): QueueStorage;
111
+ /**
112
+ * AtomicRelayLock — non-blocking try-acquire with relay-on-busy semantics.
113
+ * Guards processAccumulatedEvents drain cycle.
114
+ * FS: proper-lockfile (createFsAtomicRelayLock)
115
+ * Azure: blob lease
116
+ * Firestore: Firestore transaction + sentinel document
117
+ */
118
+ lock: AtomicRelayLock;
119
+ /**
120
+ * Adapter-owned callback transport used to build worker callback payloads.
121
+ * The board core treats callback delivery as a platform concern.
122
+ */
123
+ callbackTransport?: BoardCallbackTransport;
124
+ /**
125
+ * Generic execution dispatch — platform adapts ExecutionRef → actual transport.
126
+ * Public layer constructs fully-formed semantic args (source def, base_ref,
127
+ * callback token with selfRef baked in). Platform handles transport:
128
+ * Node host adapter: may write args to temp file and may spawn a detached process
129
+ * Azure: HTTP POST args as JSON body
130
+ * Firebase: publishes args as pubsub message
131
+ */
132
+ dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
133
+ dispatched: boolean;
134
+ error?: string;
135
+ }>;
136
+ /**
137
+ * Whether dispatchExecution can accept a board-owned staged source output ref
138
+ * for this executor. When false/absent, the adapter keeps its legacy staging
139
+ * protocol such as scratch in/out refs for local process launch.
140
+ */
141
+ supportsDirectSourceOutput?(ref: ExecutionRef): boolean;
142
+ /**
143
+ * Resolve a blob ref to its string contents.
144
+ * The adapter handles the platform-specific lookup (e.g. absolute FS path vs board-relative key).
145
+ * Throws if the blob does not exist.
146
+ */
147
+ resolveBlob(ref: KindValueRef): string;
148
+ /**
149
+ * Compute a stable, deterministic content hash for any JSON-serializable value.
150
+ * Used for dedup indexes and snapshot versioning.
151
+ * Node/FS: computeStableJsonHash (storage-fs-adapters)
152
+ * Browser: Web Crypto subtle.digest or equivalent
153
+ */
154
+ hashFn(value: unknown): string;
155
+ /**
156
+ * Generate a random short ID (32 hex chars).
157
+ * Used for commit IDs and delivery tokens.
158
+ * Node/FS: getHash(`${Date.now()}-${Math.random()}`).slice(0, 32)
159
+ * Browser: crypto.randomUUID().replace(/-/g, '')
160
+ */
161
+ genId(): string;
162
+ /**
163
+ * Request an additional drain pass asynchronously (e.g. spawn a background process).
164
+ * Called as the relay continuation after each drain cycle so that events written
165
+ * during the cycle (e.g. task-completed appended by the card handler) are eventually
166
+ * processed even when the current process exits immediately after returning.
167
+ * Optional — if absent, no continuation is scheduled.
168
+ */
169
+ requestProcessAccumulated?(): void;
170
+ /**
171
+ * Optional cross-process board change notification publisher (named pipe, webhook, pubsub, etc.).
172
+ * Called once per drain cycle with the complete batch of notifications produced in that cycle.
173
+ */
174
+ publishBoardChangeNotifications?(notifications: BoardChangeNotification[]): void | Promise<void>;
175
+ /** Optional warn sink — defaults to no-op. */
176
+ onWarn?(msg: string): void;
177
+ }
178
+ interface BoardLiveCardsPublic {
179
+ init(input: CommandInput): CommandResult;
180
+ status(input: CommandInput): CommandResult<BoardStatusObject>;
181
+ getBoardRuntimeStoreRef(input: CommandInput): CommandResult<{
182
+ storeRef: string | null;
183
+ }>;
184
+ getCardStoreRef(input: CommandInput): CommandResult<{
185
+ storeRef: string;
186
+ }>;
187
+ getOutputsStoreRef(input: CommandInput): CommandResult<{
188
+ storeRef: string;
189
+ }>;
190
+ getScratchStoreRef(input: CommandInput): CommandResult<{
191
+ storeRef: string | null;
192
+ }>;
193
+ getChatStoreRef(input: CommandInput): CommandResult<{
194
+ storeRef: string | null;
195
+ }>;
196
+ getArtifactsStoreRef(input: CommandInput): CommandResult<{
197
+ storeRef: string | null;
198
+ }>;
199
+ getFetchedSourcesStoreRef(input: CommandInput): CommandResult<{
200
+ storeRef: string | null;
201
+ }>;
202
+ getConfig(input: CommandInput): CommandResult<{
203
+ value: unknown;
204
+ }>;
205
+ getOutputsDataObject(input: CommandInput): CommandResult;
206
+ getAllOutputsDataObjects(input: CommandInput): CommandResult<Record<string, unknown>>;
207
+ getOutputsComputedValues(input: CommandInput): CommandResult;
208
+ getAllOutputsComputedValues(input: CommandInput): CommandResult<Record<string, unknown>>;
209
+ getOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, string>>;
210
+ getAllOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, Record<string, string>>>;
211
+ buildSseOneShotPayload(input: CommandInput): CommandResult<BoardSseOneShotPayload>;
212
+ removeCard(input: CommandInput): CommandResult;
213
+ addCardFiles(input: CommandInput): CommandResult<{
214
+ cardId: string;
215
+ files_added: Array<{
216
+ idx: number;
217
+ entry: unknown;
218
+ }>;
219
+ notified: true;
220
+ }>;
221
+ retrigger(input: CommandInput): CommandResult;
222
+ processAccumulatedEvents(input: CommandInput): Promise<CommandResult>;
223
+ upsertCard(input: CommandInput): CommandResult;
224
+ taskFailed(input: CommandInput): CommandResult;
225
+ taskProgress(input: CommandInput): CommandResult;
226
+ sourceDataFetched(input: CommandInput): CommandResult;
227
+ sourceDataFetchFailure(input: CommandInput): CommandResult;
228
+ }
229
+ interface BoardSseOneShotPayload {
230
+ cardDefinitions: Array<Record<string, unknown>>;
231
+ statusSnapshot: BoardStatusObject;
232
+ dataObjectsByToken: Record<string, unknown>;
233
+ cardRuntimeById: Record<string, unknown>;
234
+ }
235
+ interface BoardLiveCardsPublicOptions {
236
+ boardRuntimeStoreRef?: string;
237
+ scratchStoreRef?: string;
238
+ taskExecutorRef?: ExecutionRef;
239
+ chatHandlerFlow?: unknown;
240
+ emitNotification?: NotificationEmitter;
241
+ }
242
+ declare function createBoardLiveCardsPublic(baseRef: KindValueRef, adapter: BoardPlatformAdapter, options?: BoardLiveCardsPublicOptions): BoardLiveCardsPublic;
243
+ interface BoardNonCorePlatformAdapter extends BoardPlatformAdapter {
244
+ /**
245
+ * Invoke a task executor subcommand and return stdout.
246
+ * Throws on transport failure, non-zero exit, or timeout.
247
+ */
248
+ invokeExecutor(ref: ExecutionRef, subcommand: string, opts?: {
249
+ timeout?: number;
250
+ input?: string;
251
+ }): Promise<string>;
252
+ /** Schema-only card validator (no executor invocation). */
253
+ validateSchema(card: Record<string, unknown>): {
254
+ ok: boolean;
255
+ errors: string[];
256
+ };
257
+ /** Absolute-path blob I/O for resolving arbitrary KindValueRef blobs. */
258
+ absoluteBlob: BlobStorage;
259
+ /**
260
+ * Default timeouts (ms) for executor request/response calls.
261
+ * Each field can also be overridden per-source via source_def.timeout.
262
+ *
263
+ * validationMs — validate-source-def, validate-card-preflight (structural, fast). Default: 10_000.
264
+ * preflightMs — source preflight executor hooks (probe-source-preflight). Default: 60_000.
265
+ * probeMs — run-source-fetch in probe/simulation paths. Default: 60_000.
266
+ * describeMs — describe-capabilities introspection. Default: 10_000.
267
+ */
268
+ executorTimeouts?: {
269
+ validationMs?: number;
270
+ preflightMs?: number;
271
+ probeMs?: number;
272
+ describeMs?: number;
273
+ };
274
+ }
275
+ interface BoardLiveCardsNonCorePublic {
276
+ /** body: { "card-content": <card> } — card JSON arrives via stdin; validates schema + JSONata + provides refs + source_defs (executor, if configured) */
277
+ validateCardPreflight(input: CommandInput): Promise<CommandResult<{
278
+ cardId: string;
279
+ isValid: boolean;
280
+ issues: string[];
281
+ }>>;
282
+ /** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — card JSON arrives via stdin; no board state needed */
283
+ probeSourcePreflight(input: CommandInput): Promise<CommandResult>;
284
+ /** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — runs the real source fetch flow as a preflight */
285
+ runSourcePreflight(input: CommandInput): Promise<CommandResult<{
286
+ bindTo: string;
287
+ ok: boolean;
288
+ result: unknown;
289
+ issues: string[];
290
+ }>>;
291
+ /** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — evaluates compute expressions with supplied data; no board state needed */
292
+ evalCardCompute(input: CommandInput): CommandResult<{
293
+ cardId: string;
294
+ ok: boolean;
295
+ computed_values: Record<string, unknown>;
296
+ errors: Array<{
297
+ bindTo: string;
298
+ error: string;
299
+ }>;
300
+ }>;
301
+ /** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — full cycle: validate → resolve projections → probe sources → compute */
302
+ simulateCardCycle(input: CommandInput): Promise<CommandResult>;
303
+ /** no params needed */
304
+ describeTaskExecutorCapabilities(input: CommandInput): Promise<CommandResult>;
305
+ /**
306
+ * Write/update cards in the configured card store.
307
+ * body: { ops: Array<{ op: 'update', id: string, 'card-content': LiveCard }> }
308
+ */
309
+ updatesInCardStore(input: CommandInput): CommandResult;
310
+ /**
311
+ * Read cards from the configured card store by id.
312
+ * body: { ids: string[] }
313
+ */
314
+ readFromCardStore(input: CommandInput): CommandResult<{
315
+ cards: Array<{
316
+ id: string;
317
+ 'card-content': LiveCard | null;
318
+ }>;
319
+ }>;
320
+ }
321
+ declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter, opts?: {
322
+ boardRuntimeStoreRef?: string;
323
+ taskExecutorRef?: ExecutionRef;
324
+ }): BoardLiveCardsNonCorePublic;
325
+
326
+ export { BoardChangeNotification, type BoardLiveCardsNonCorePublic, type BoardLiveCardsPublic, type BoardLiveCardsPublicOptions, type BoardNonCorePlatformAdapter, type BoardPlatformAdapter, type BoardSseOneShotPayload, type CommandInput, type CommandResult, createBoardLiveCardsNonCorePublic, createBoardLiveCardsPublic };
@@ -1,4 +1,326 @@
1
- import './storage-interface-D-iEiTJA.js';
2
- export { p as BOARD_GRAPH_KEY, B as BoardChangeNotification, l as BoardLiveCardsNonCorePublic, c as BoardLiveCardsPublic, z as BoardLiveCardsPublicOptions, d as BoardNonCorePlatformAdapter, e as BoardPlatformAdapter, C as CommandInput, a as CommandResult, E as EMPTY_CONFIG, q as SNAPSHOT_SCHEMA_VERSION_V1, r as createBoardLiveCardsNonCorePublic, s as createBoardLiveCardsPublic } from './board-live-cards-public-DSRamFm8.js';
3
- import './execution-refs.js';
1
+ import { K as KVStorage, B as BlobStorage, S as ScratchStorage, A as ArchiveFactory, Q as QueueStorage, g as AtomicRelayLock, a as KindValueRef } from './storage-interface-DogVPooM.js';
2
+ import { C as ChatStorage, B as BoardCallbackTransport } from './board-callback-transport-Bekq8Gp-.js';
3
+ import { ExecutionRef } from './execution-refs.js';
4
+ import { k as BoardStatusObject, L as LiveCard, h as NotificationEmitter, J as JournalStorageAdapter, B as BoardChangeNotification } from './board-live-cards-lib-iU8xOwNp.js';
5
+ export { l as BOARD_GRAPH_KEY, E as EMPTY_CONFIG, S as SNAPSHOT_SCHEMA_VERSION_V1 } from './board-live-cards-lib-iU8xOwNp.js';
4
6
  import './types-BBhqYGhE.js';
7
+
8
+ /**
9
+ * board-live-cards-public.ts
10
+ *
11
+ * Platform-free public API layer for the board-live-cards system.
12
+ *
13
+ * ─────────────────────────────────────────────────────────────────────────────
14
+ * LAYER DIAGRAM
15
+ * ─────────────────────────────────────────────────────────────────────────────
16
+ *
17
+ * board-live-cards-cli.ts (THIN — arg parse → call public → print JSON)
18
+ * ↓ calls
19
+ * board-live-cards-public.ts (THIS FILE — facade, all logic, no platform code)
20
+ * ↓ depends on injected
21
+ * board-live-cards-lib.ts (pure domain — stores, graph, codecs)
22
+ *
23
+ * ─────────────────────────────────────────────────────────────────────────────
24
+ * PLATFORM ADAPTERS (injected into BoardPlatformAdapter)
25
+ * ─────────────────────────────────────────────────────────────────────────────
26
+ *
27
+ * Node/FS createFsBoardPlatformAdapter(baseRef, cliDir)
28
+ * Azure Functions createAzureBoardPlatformAdapter(baseRef, containerClient, …)
29
+ * Firebase Fn createFirebaseBoardPlatformAdapter(baseRef, firestoreDb, …)
30
+ * In-memory/test createInMemoryBoardPlatformAdapter(baseRef)
31
+ *
32
+ * ─────────────────────────────────────────────────────────────────────────────
33
+ * USAGE
34
+ * ─────────────────────────────────────────────────────────────────────────────
35
+ *
36
+ * const board = createBoardLiveCardsPublic(baseRef, adapter);
37
+ * const status = board.status();
38
+ */
39
+
40
+ type CommandInput = {
41
+ params?: Record<string, string | number | boolean>;
42
+ body?: unknown;
43
+ };
44
+ type CommandResult<T = undefined> = (T extends undefined ? {
45
+ status: 'success';
46
+ } : {
47
+ status: 'success';
48
+ data: T;
49
+ }) | {
50
+ status: 'fail';
51
+ error: string;
52
+ } | {
53
+ status: 'error';
54
+ error: string;
55
+ };
56
+ interface BoardPlatformAdapter {
57
+ /**
58
+ * KV storage factory — scoped by namespace.
59
+ * Namespaces used by the public layer:
60
+ * 'state-snapshot' — board graph snapshot (StateSnapshotStorageAdapter, built internally)
61
+ * 'config' — board configuration (.task-executor, .chat-handler, .chat-handler-flow, .card-store-ref)
62
+ * 'card-upsert' — card upsert dedup index
63
+ * 'execution-requests' — queued execution requests (keyed by journalId)
64
+ * 'card-runtime' — card runtime state snapshots
65
+ * 'output' — published board status + card computed outputs
66
+ */
67
+ kvStorage(namespace: string): KVStorage;
68
+ /**
69
+ * Build a KVStorage rooted at the given ref.
70
+ * Used by the public layer for both card store and outputs store routing.
71
+ * FS: createFsKvStorage(parseRef(ref).value)
72
+ * localStorage: createLocalStorageKvStorage(parseRef(ref).value)
73
+ */
74
+ kvStorageForRef(ref: string): KVStorage;
75
+ /**
76
+ * Blob storage factory — scoped by namespace.
77
+ * Namespaces used by the public layer:
78
+ * '' — root-scoped blob access (for resolving arbitrary KindValueRef blobs)
79
+ */
80
+ blobStorage(namespace: string): BlobStorage;
81
+ blobStorageForRef(ref: string): BlobStorage;
82
+ chatStorageForRef(ref: string): ChatStorage;
83
+ /**
84
+ * Ephemeral scratch store for transient I/O staging (probe in/out/err,
85
+ * dispatchExecution argv/out/err). Default scope is board-local; if the
86
+ * config has a 'scratch-store-ref' set, scratchStorageForRef(ref) is used
87
+ * instead.
88
+ */
89
+ scratchStorage(): ScratchStorage;
90
+ scratchStorageForRef(ref: string): ScratchStorage;
91
+ /**
92
+ * Archive factory — long-lived tracking / audit store. Default scope is
93
+ * board-local; if the config has an 'archive-store-ref' set,
94
+ * archiveFactoryForRef(ref) is used instead so archives can live on a
95
+ * different backend / path than the main board runtime.
96
+ */
97
+ archiveFactory(): ArchiveFactory;
98
+ archiveFactoryForRef(ref: string): ArchiveFactory;
99
+ /**
100
+ * Journal storage adapter (append-only log).
101
+ * Uses the lib's JournalStorageAdapter interface.
102
+ * One journal per board — no namespace parameter needed.
103
+ */
104
+ journalAdapter(): JournalStorageAdapter;
105
+ journalAdapterForRef(ref: string): JournalStorageAdapter;
106
+ /**
107
+ * Queue storage lane resolved from an explicit queue store ref.
108
+ * The adapter chooses the backend from the ref; lane chooses the internal queue.
109
+ */
110
+ queueStorageForRef(ref: string, lane: string): QueueStorage;
111
+ /**
112
+ * AtomicRelayLock — non-blocking try-acquire with relay-on-busy semantics.
113
+ * Guards processAccumulatedEvents drain cycle.
114
+ * FS: proper-lockfile (createFsAtomicRelayLock)
115
+ * Azure: blob lease
116
+ * Firestore: Firestore transaction + sentinel document
117
+ */
118
+ lock: AtomicRelayLock;
119
+ /**
120
+ * Adapter-owned callback transport used to build worker callback payloads.
121
+ * The board core treats callback delivery as a platform concern.
122
+ */
123
+ callbackTransport?: BoardCallbackTransport;
124
+ /**
125
+ * Generic execution dispatch — platform adapts ExecutionRef → actual transport.
126
+ * Public layer constructs fully-formed semantic args (source def, base_ref,
127
+ * callback token with selfRef baked in). Platform handles transport:
128
+ * Node host adapter: may write args to temp file and may spawn a detached process
129
+ * Azure: HTTP POST args as JSON body
130
+ * Firebase: publishes args as pubsub message
131
+ */
132
+ dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
133
+ dispatched: boolean;
134
+ error?: string;
135
+ }>;
136
+ /**
137
+ * Whether dispatchExecution can accept a board-owned staged source output ref
138
+ * for this executor. When false/absent, the adapter keeps its legacy staging
139
+ * protocol such as scratch in/out refs for local process launch.
140
+ */
141
+ supportsDirectSourceOutput?(ref: ExecutionRef): boolean;
142
+ /**
143
+ * Resolve a blob ref to its string contents.
144
+ * The adapter handles the platform-specific lookup (e.g. absolute FS path vs board-relative key).
145
+ * Throws if the blob does not exist.
146
+ */
147
+ resolveBlob(ref: KindValueRef): string;
148
+ /**
149
+ * Compute a stable, deterministic content hash for any JSON-serializable value.
150
+ * Used for dedup indexes and snapshot versioning.
151
+ * Node/FS: computeStableJsonHash (storage-fs-adapters)
152
+ * Browser: Web Crypto subtle.digest or equivalent
153
+ */
154
+ hashFn(value: unknown): string;
155
+ /**
156
+ * Generate a random short ID (32 hex chars).
157
+ * Used for commit IDs and delivery tokens.
158
+ * Node/FS: getHash(`${Date.now()}-${Math.random()}`).slice(0, 32)
159
+ * Browser: crypto.randomUUID().replace(/-/g, '')
160
+ */
161
+ genId(): string;
162
+ /**
163
+ * Request an additional drain pass asynchronously (e.g. spawn a background process).
164
+ * Called as the relay continuation after each drain cycle so that events written
165
+ * during the cycle (e.g. task-completed appended by the card handler) are eventually
166
+ * processed even when the current process exits immediately after returning.
167
+ * Optional — if absent, no continuation is scheduled.
168
+ */
169
+ requestProcessAccumulated?(): void;
170
+ /**
171
+ * Optional cross-process board change notification publisher (named pipe, webhook, pubsub, etc.).
172
+ * Called once per drain cycle with the complete batch of notifications produced in that cycle.
173
+ */
174
+ publishBoardChangeNotifications?(notifications: BoardChangeNotification[]): void | Promise<void>;
175
+ /** Optional warn sink — defaults to no-op. */
176
+ onWarn?(msg: string): void;
177
+ }
178
+ interface BoardLiveCardsPublic {
179
+ init(input: CommandInput): CommandResult;
180
+ status(input: CommandInput): CommandResult<BoardStatusObject>;
181
+ getBoardRuntimeStoreRef(input: CommandInput): CommandResult<{
182
+ storeRef: string | null;
183
+ }>;
184
+ getCardStoreRef(input: CommandInput): CommandResult<{
185
+ storeRef: string;
186
+ }>;
187
+ getOutputsStoreRef(input: CommandInput): CommandResult<{
188
+ storeRef: string;
189
+ }>;
190
+ getScratchStoreRef(input: CommandInput): CommandResult<{
191
+ storeRef: string | null;
192
+ }>;
193
+ getChatStoreRef(input: CommandInput): CommandResult<{
194
+ storeRef: string | null;
195
+ }>;
196
+ getArtifactsStoreRef(input: CommandInput): CommandResult<{
197
+ storeRef: string | null;
198
+ }>;
199
+ getFetchedSourcesStoreRef(input: CommandInput): CommandResult<{
200
+ storeRef: string | null;
201
+ }>;
202
+ getConfig(input: CommandInput): CommandResult<{
203
+ value: unknown;
204
+ }>;
205
+ getOutputsDataObject(input: CommandInput): CommandResult;
206
+ getAllOutputsDataObjects(input: CommandInput): CommandResult<Record<string, unknown>>;
207
+ getOutputsComputedValues(input: CommandInput): CommandResult;
208
+ getAllOutputsComputedValues(input: CommandInput): CommandResult<Record<string, unknown>>;
209
+ getOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, string>>;
210
+ getAllOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, Record<string, string>>>;
211
+ buildSseOneShotPayload(input: CommandInput): CommandResult<BoardSseOneShotPayload>;
212
+ removeCard(input: CommandInput): CommandResult;
213
+ addCardFiles(input: CommandInput): CommandResult<{
214
+ cardId: string;
215
+ files_added: Array<{
216
+ idx: number;
217
+ entry: unknown;
218
+ }>;
219
+ notified: true;
220
+ }>;
221
+ retrigger(input: CommandInput): CommandResult;
222
+ processAccumulatedEvents(input: CommandInput): Promise<CommandResult>;
223
+ upsertCard(input: CommandInput): CommandResult;
224
+ taskFailed(input: CommandInput): CommandResult;
225
+ taskProgress(input: CommandInput): CommandResult;
226
+ sourceDataFetched(input: CommandInput): CommandResult;
227
+ sourceDataFetchFailure(input: CommandInput): CommandResult;
228
+ }
229
+ interface BoardSseOneShotPayload {
230
+ cardDefinitions: Array<Record<string, unknown>>;
231
+ statusSnapshot: BoardStatusObject;
232
+ dataObjectsByToken: Record<string, unknown>;
233
+ cardRuntimeById: Record<string, unknown>;
234
+ }
235
+ interface BoardLiveCardsPublicOptions {
236
+ boardRuntimeStoreRef?: string;
237
+ scratchStoreRef?: string;
238
+ taskExecutorRef?: ExecutionRef;
239
+ chatHandlerFlow?: unknown;
240
+ emitNotification?: NotificationEmitter;
241
+ }
242
+ declare function createBoardLiveCardsPublic(baseRef: KindValueRef, adapter: BoardPlatformAdapter, options?: BoardLiveCardsPublicOptions): BoardLiveCardsPublic;
243
+ interface BoardNonCorePlatformAdapter extends BoardPlatformAdapter {
244
+ /**
245
+ * Invoke a task executor subcommand and return stdout.
246
+ * Throws on transport failure, non-zero exit, or timeout.
247
+ */
248
+ invokeExecutor(ref: ExecutionRef, subcommand: string, opts?: {
249
+ timeout?: number;
250
+ input?: string;
251
+ }): Promise<string>;
252
+ /** Schema-only card validator (no executor invocation). */
253
+ validateSchema(card: Record<string, unknown>): {
254
+ ok: boolean;
255
+ errors: string[];
256
+ };
257
+ /** Absolute-path blob I/O for resolving arbitrary KindValueRef blobs. */
258
+ absoluteBlob: BlobStorage;
259
+ /**
260
+ * Default timeouts (ms) for executor request/response calls.
261
+ * Each field can also be overridden per-source via source_def.timeout.
262
+ *
263
+ * validationMs — validate-source-def, validate-card-preflight (structural, fast). Default: 10_000.
264
+ * preflightMs — source preflight executor hooks (probe-source-preflight). Default: 60_000.
265
+ * probeMs — run-source-fetch in probe/simulation paths. Default: 60_000.
266
+ * describeMs — describe-capabilities introspection. Default: 10_000.
267
+ */
268
+ executorTimeouts?: {
269
+ validationMs?: number;
270
+ preflightMs?: number;
271
+ probeMs?: number;
272
+ describeMs?: number;
273
+ };
274
+ }
275
+ interface BoardLiveCardsNonCorePublic {
276
+ /** body: { "card-content": <card> } — card JSON arrives via stdin; validates schema + JSONata + provides refs + source_defs (executor, if configured) */
277
+ validateCardPreflight(input: CommandInput): Promise<CommandResult<{
278
+ cardId: string;
279
+ isValid: boolean;
280
+ issues: string[];
281
+ }>>;
282
+ /** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — card JSON arrives via stdin; no board state needed */
283
+ probeSourcePreflight(input: CommandInput): Promise<CommandResult>;
284
+ /** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — runs the real source fetch flow as a preflight */
285
+ runSourcePreflight(input: CommandInput): Promise<CommandResult<{
286
+ bindTo: string;
287
+ ok: boolean;
288
+ result: unknown;
289
+ issues: string[];
290
+ }>>;
291
+ /** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — evaluates compute expressions with supplied data; no board state needed */
292
+ evalCardCompute(input: CommandInput): CommandResult<{
293
+ cardId: string;
294
+ ok: boolean;
295
+ computed_values: Record<string, unknown>;
296
+ errors: Array<{
297
+ bindTo: string;
298
+ error: string;
299
+ }>;
300
+ }>;
301
+ /** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — full cycle: validate → resolve projections → probe sources → compute */
302
+ simulateCardCycle(input: CommandInput): Promise<CommandResult>;
303
+ /** no params needed */
304
+ describeTaskExecutorCapabilities(input: CommandInput): Promise<CommandResult>;
305
+ /**
306
+ * Write/update cards in the configured card store.
307
+ * body: { ops: Array<{ op: 'update', id: string, 'card-content': LiveCard }> }
308
+ */
309
+ updatesInCardStore(input: CommandInput): CommandResult;
310
+ /**
311
+ * Read cards from the configured card store by id.
312
+ * body: { ids: string[] }
313
+ */
314
+ readFromCardStore(input: CommandInput): CommandResult<{
315
+ cards: Array<{
316
+ id: string;
317
+ 'card-content': LiveCard | null;
318
+ }>;
319
+ }>;
320
+ }
321
+ declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter, opts?: {
322
+ boardRuntimeStoreRef?: string;
323
+ taskExecutorRef?: ExecutionRef;
324
+ }): BoardLiveCardsNonCorePublic;
325
+
326
+ export { BoardChangeNotification, type BoardLiveCardsNonCorePublic, type BoardLiveCardsPublic, type BoardLiveCardsPublicOptions, type BoardNonCorePlatformAdapter, type BoardPlatformAdapter, type BoardSseOneShotPayload, type CommandInput, type CommandResult, createBoardLiveCardsNonCorePublic, createBoardLiveCardsPublic };
@@ -1,2 +1,2 @@
1
- export{n as BOARD_GRAPH_KEY,u as EMPTY_CONFIG,m as SNAPSHOT_SCHEMA_VERSION_V1,z as createBoardLiveCardsNonCorePublic,y as createBoardLiveCardsPublic}from'./chunk-ZWVT24YW.js';import'./chunk-ANKA7HEJ.js';import'./chunk-44L64VQ2.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';import'./chunk-JMDHDY6M.js';import'./chunk-3KC6LBOG.js';import'./chunk-MNEOJWPS.js';import'./chunk-KBELAKIY.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=board-live-cards-public.js.map
1
+ export{n as BOARD_GRAPH_KEY,u as EMPTY_CONFIG,m as SNAPSHOT_SCHEMA_VERSION_V1,z as createBoardLiveCardsNonCorePublic,y as createBoardLiveCardsPublic}from'./chunk-P3R6TXII.js';import'./chunk-ANKA7HEJ.js';import'./chunk-44L64VQ2.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';import'./chunk-JMDHDY6M.js';import'./chunk-3KC6LBOG.js';import'./chunk-MNEOJWPS.js';import'./chunk-7QNEV5S3.js';import'./chunk-UGB7PC4P.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=board-live-cards-public.js.map
2
2
  //# sourceMappingURL=board-live-cards-public.js.map