yaml-flow 8.5.3 → 8.6.1

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 (166) hide show
  1. package/browser/asset-integrity.json +3 -3
  2. package/examples/board/demo-shell-with-server.html +2 -2
  3. package/examples/board/doc.html +2 -2
  4. package/examples/board/server/board-server.js +266 -5
  5. package/examples/board/server/board-worker/task-executor.js +166 -51
  6. package/examples/board/server/chat-flow/copilot-chat/assistant.js +25 -12
  7. package/examples/board/server/chat-flow/copilot-chat/probe.js +7 -0
  8. package/examples/board/server/chat-flow/copilot-chat/shared.js +97 -0
  9. package/examples/board/server/chat-flow/flow-steps.json +109 -51
  10. package/examples/board/server-config.json +1 -0
  11. package/examples/board/test/server-http-test.js +870 -67
  12. package/examples/board-local/demo-shell-localstorage.html +3 -3
  13. package/lib/{artifacts-store-lib-D-k-E8Vy.d.ts → artifacts-store-lib-C1rtrkxm.d.ts} +1 -1
  14. package/lib/{artifacts-store-lib-CVgtQrNZ.d.cts → artifacts-store-lib-CLOtsiav.d.cts} +1 -1
  15. package/lib/artifacts-store-public.cjs +1 -1
  16. package/lib/artifacts-store-public.d.cts +3 -3
  17. package/lib/artifacts-store-public.d.ts +3 -3
  18. package/lib/artifacts-store-public.js +1 -1
  19. package/lib/batch/index.cjs +1 -1
  20. package/lib/batch/index.js +1 -1
  21. package/lib/board-live-cards-mcp.cjs +1 -1
  22. package/lib/board-live-cards-mcp.d.cts +35 -15
  23. package/lib/board-live-cards-mcp.d.ts +35 -15
  24. package/lib/board-live-cards-mcp.js +1 -1
  25. package/lib/board-live-cards-node.cjs +8 -16
  26. package/lib/board-live-cards-node.d.cts +32 -12
  27. package/lib/board-live-cards-node.d.ts +32 -12
  28. package/lib/board-live-cards-node.js +8 -16
  29. package/lib/{board-live-cards-public-BGS22cMb.d.ts → board-live-cards-public-CBVjm327.d.ts} +59 -24
  30. package/lib/{board-live-cards-public-B13InXhC.d.cts → board-live-cards-public-CPJy-aGW.d.cts} +59 -24
  31. package/lib/board-live-cards-public.cjs +1 -2
  32. package/lib/board-live-cards-public.d.cts +2 -2
  33. package/lib/board-live-cards-public.d.ts +2 -2
  34. package/lib/board-live-cards-public.js +1 -2
  35. package/lib/board-live-cards-server-runtime.cjs +1 -7
  36. package/lib/board-live-cards-server-runtime.d.cts +5 -5
  37. package/lib/board-live-cards-server-runtime.d.ts +5 -5
  38. package/lib/board-live-cards-server-runtime.js +1 -7
  39. package/lib/board-livegraph-runtime/index.cjs +1 -2
  40. package/lib/board-livegraph-runtime/index.js +1 -2
  41. package/lib/board-worker-adapter.cjs +21 -7
  42. package/lib/board-worker-adapter.d.cts +17 -2
  43. package/lib/board-worker-adapter.d.ts +17 -2
  44. package/lib/board-worker-adapter.js +21 -7
  45. package/lib/card-compute/index.cjs +1 -9
  46. package/lib/card-compute/index.js +1 -9
  47. package/lib/card-store-public.cjs +1 -1
  48. package/lib/card-store-public.d.cts +2 -2
  49. package/lib/card-store-public.d.ts +2 -2
  50. package/lib/card-store-public.js +1 -1
  51. package/lib/card-validation.cjs +1 -9
  52. package/lib/card-validation.js +1 -9
  53. package/lib/{chat-storage-lib-CJn7a6OH.d.ts → chat-storage-lib-Bce-xx6l.d.ts} +1 -1
  54. package/lib/{chat-storage-lib-0imhRX3l.d.cts → chat-storage-lib-CKylihjm.d.cts} +1 -1
  55. package/lib/chat-store-public.cjs +1 -1
  56. package/lib/chat-store-public.d.cts +3 -3
  57. package/lib/chat-store-public.d.ts +3 -3
  58. package/lib/chat-store-public.js +1 -1
  59. package/lib/chunk-2MZUYY65.cjs +2 -0
  60. package/lib/chunk-5DB54ZX2.cjs +2 -0
  61. package/lib/chunk-5EA2ESS4.cjs +16 -0
  62. package/lib/chunk-6APH25VI.js +2 -0
  63. package/lib/chunk-76ON3V7R.js +2 -0
  64. package/lib/chunk-7BKNHFNH.js +2 -0
  65. package/lib/chunk-CWREBRXS.js +3 -0
  66. package/lib/chunk-DAXACY63.js +2 -0
  67. package/lib/chunk-FW4363Y4.js +2 -0
  68. package/lib/chunk-FZ2SBU5M.js +3 -0
  69. package/lib/chunk-G4XXRHL2.cjs +3 -0
  70. package/lib/chunk-GNFE24S7.cjs +2 -0
  71. package/lib/chunk-GYQXDNNI.cjs +2 -0
  72. package/lib/chunk-H5KD3JPY.cjs +2 -0
  73. package/lib/chunk-HLJH7LGW.js +16 -0
  74. package/lib/chunk-I4WH5U5D.cjs +2 -0
  75. package/lib/chunk-IXZG74EW.cjs +2 -0
  76. package/lib/chunk-JAL25FGA.cjs +2 -0
  77. package/lib/chunk-JM5EKT57.js +2 -0
  78. package/lib/chunk-JMDHDY6M.js +2 -0
  79. package/lib/chunk-KBELAKIY.js +2 -0
  80. package/lib/chunk-KHJABJ45.cjs +3 -0
  81. package/lib/chunk-KLRUISRY.cjs +2 -0
  82. package/lib/chunk-KNFFDVLD.cjs +2 -0
  83. package/lib/chunk-LBMEVV4U.js +2 -0
  84. package/lib/chunk-LDAP75GN.js +2 -0
  85. package/lib/chunk-LODXIALE.cjs +2 -0
  86. package/lib/chunk-LVNQCE5X.cjs +3 -0
  87. package/lib/chunk-M7EQRS6W.js +3 -0
  88. package/lib/chunk-MNEOJWPS.js +10 -0
  89. package/lib/chunk-NJJ7WEDT.cjs +2 -0
  90. package/lib/chunk-NMZ6XNLB.cjs +3 -0
  91. package/lib/chunk-OPNGCSXJ.js +2 -0
  92. package/lib/chunk-P64UKI3L.cjs +8 -0
  93. package/lib/chunk-P7ZCDICS.cjs +2 -0
  94. package/lib/chunk-Q6H7NINN.cjs +5 -0
  95. package/lib/chunk-Q6VSL327.js +8 -0
  96. package/lib/chunk-QWBNDVUA.js +5 -0
  97. package/lib/chunk-S6DRP2HX.cjs +2 -0
  98. package/lib/chunk-UJ7ZTV4J.cjs +10 -0
  99. package/lib/chunk-UVE65IPR.cjs +3 -0
  100. package/lib/chunk-VCCTAUIG.js +2 -0
  101. package/lib/chunk-VGT3TRQG.js +3 -0
  102. package/lib/chunk-VLBB3D6B.js +3 -0
  103. package/lib/chunk-WDPOGXTY.js +2 -0
  104. package/lib/chunk-X3LC4LII.js +2 -0
  105. package/lib/chunk-YGKDQLYP.js +2 -0
  106. package/lib/chunk-YMEIPKLW.cjs +2 -0
  107. package/lib/config/index.cjs +1 -1
  108. package/lib/config/index.js +1 -1
  109. package/lib/continuous-event-graph/index.cjs +1 -2
  110. package/lib/continuous-event-graph/index.js +1 -2
  111. package/lib/event-graph/index.cjs +1 -22
  112. package/lib/event-graph/index.js +1 -22
  113. package/lib/execution-refs.cjs +1 -2
  114. package/lib/execution-refs.d.cts +3 -2
  115. package/lib/execution-refs.d.ts +3 -2
  116. package/lib/execution-refs.js +1 -2
  117. package/lib/index.cjs +2 -24
  118. package/lib/index.d.cts +1 -1
  119. package/lib/index.d.ts +1 -1
  120. package/lib/index.js +2 -24
  121. package/lib/server-runtime/index.cjs +1 -7
  122. package/lib/server-runtime/index.d.cts +6 -6
  123. package/lib/server-runtime/index.d.ts +6 -6
  124. package/lib/server-runtime/index.js +1 -7
  125. package/lib/step-machine/index.cjs +1 -11
  126. package/lib/step-machine/index.js +1 -11
  127. package/lib/step-machine-public/index.cjs +1 -4
  128. package/lib/step-machine-public/index.d.cts +1 -1
  129. package/lib/step-machine-public/index.d.ts +1 -1
  130. package/lib/step-machine-public/index.js +1 -4
  131. package/lib/{storage-interface-B2WD9D5n.d.cts → storage-interface-Ct-C4tlz.d.cts} +28 -1
  132. package/lib/{storage-interface-B2WD9D5n.d.ts → storage-interface-Ct-C4tlz.d.ts} +28 -1
  133. package/lib/stores/index.cjs +1 -2
  134. package/lib/stores/index.d.cts +1 -1
  135. package/lib/stores/index.d.ts +1 -1
  136. package/lib/stores/index.js +1 -2
  137. package/lib/stores/kv.cjs +1 -2
  138. package/lib/stores/kv.d.cts +1 -1
  139. package/lib/stores/kv.d.ts +1 -1
  140. package/lib/stores/kv.js +1 -2
  141. package/lib/stores/memory.cjs +1 -1
  142. package/lib/stores/memory.js +1 -1
  143. package/lib/{types-30R357js.d.ts → types-BuK2UMxk.d.ts} +4 -4
  144. package/lib/{types-CIgsh56O.d.cts → types-DRl0Hy_p.d.cts} +4 -4
  145. package/package.json +2 -16
  146. package/cli/board-live-cards-lib-COi4bSpk.d.ts +0 -322
  147. package/cli/browser-api/board-live-cards-browser-adapter.d.ts +0 -36
  148. package/cli/browser-api/board-live-cards-browser-adapter.js +0 -4
  149. package/cli/browser-api/card-store-browser-api.d.ts +0 -25
  150. package/cli/browser-api/card-store-browser-api.js +0 -2
  151. package/cli/browser-api/jsonata-sync.cjs +0 -7623
  152. package/cli/bundled/artifacts-store-cli.mjs +0 -12
  153. package/cli/bundled/batch-runner-cli.mjs +0 -3
  154. package/cli/bundled/board-live-cards-cli.mjs +0 -29
  155. package/cli/bundled/card-store-cli.mjs +0 -154
  156. package/cli/bundled/chat-store-cli.mjs +0 -16
  157. package/cli/bundled/jsonata-sync.cjs +0 -7623
  158. package/cli/bundled/step-machine-cli.mjs +0 -150
  159. package/cli/execution-interface-BCIhu1gO.d.ts +0 -442
  160. package/cli/types-H3EMBPY2.d.ts +0 -398
  161. package/examples/board/server/README-mcp-api.md +0 -690
  162. package/examples/board/test/server-http-mcp-test.js +0 -1280
  163. package/lib/board-livegraph-runtime/jsonata-sync.cjs +0 -7623
  164. package/lib/card-compute/jsonata-sync.cjs +0 -7623
  165. package/lib/continuous-event-graph/jsonata-sync.cjs +0 -7623
  166. package/lib/server-runtime/jsonata-sync.cjs +0 -7623
@@ -1,398 +0,0 @@
1
- import { b as KVStorage, B as BlobStorage, S as ScratchStorage, c as ArchiveFactory, d as AtomicRelayLock, E as ExecutionRef, K as KindValueRef, J as JournalStorage } from './execution-interface-BCIhu1gO.js';
2
- import { L as LiveCard, B as BoardStatusObject, J as JournalStorageAdapter, O as OutputStoreEvent } from './board-live-cards-lib-COi4bSpk.js';
3
-
4
- /**
5
- * board-live-cards-public.ts
6
- *
7
- * Platform-free public API layer for the board-live-cards system.
8
- *
9
- * ─────────────────────────────────────────────────────────────────────────────
10
- * LAYER DIAGRAM
11
- * ─────────────────────────────────────────────────────────────────────────────
12
- *
13
- * board-live-cards-cli.ts (THIN — arg parse → call public → print JSON)
14
- * ↓ calls
15
- * board-live-cards-public.ts (THIS FILE — facade, all logic, no platform code)
16
- * ↓ depends on injected
17
- * board-live-cards-lib.ts (pure domain — stores, graph, codecs)
18
- *
19
- * ─────────────────────────────────────────────────────────────────────────────
20
- * PLATFORM ADAPTERS (injected into BoardPlatformAdapter)
21
- * ─────────────────────────────────────────────────────────────────────────────
22
- *
23
- * Node/FS createFsBoardPlatformAdapter(baseRef, cliDir)
24
- * Azure Functions createAzureBoardPlatformAdapter(baseRef, containerClient, …)
25
- * Firebase Fn createFirebaseBoardPlatformAdapter(baseRef, firestoreDb, …)
26
- * In-memory/test createInMemoryBoardPlatformAdapter(baseRef)
27
- *
28
- * ─────────────────────────────────────────────────────────────────────────────
29
- * USAGE
30
- * ─────────────────────────────────────────────────────────────────────────────
31
- *
32
- * const board = createBoardLiveCardsPublic(baseRef, adapter);
33
- * const result = await board.processAccumulatedEvents();
34
- * const status = board.status();
35
- */
36
-
37
- type CommandInput = {
38
- params?: Record<string, string | number | boolean>;
39
- body?: unknown;
40
- };
41
- type CommandResult<T = undefined> = (T extends undefined ? {
42
- status: 'success';
43
- } : {
44
- status: 'success';
45
- data: T;
46
- }) | {
47
- status: 'fail';
48
- error: string;
49
- } | {
50
- status: 'error';
51
- error: string;
52
- };
53
- interface BoardPlatformAdapter {
54
- /**
55
- * KV storage factory — scoped by namespace.
56
- * Namespaces used by the public layer:
57
- * 'state-snapshot' — board graph snapshot (StateSnapshotStorageAdapter, built internally)
58
- * 'config' — board configuration (.task-executor, .chat-handler, .chat-handler-flow, .card-store-ref)
59
- * 'card-upsert' — card upsert dedup index
60
- * 'execution-requests' — queued execution requests (keyed by journalId)
61
- * 'card-runtime' — card runtime state snapshots
62
- * 'output' — published board status + card computed outputs
63
- */
64
- kvStorage(namespace: string): KVStorage;
65
- /**
66
- * Build a KVStorage rooted at the given ref.
67
- * Used by the public layer for both card store and outputs store routing.
68
- * FS: createFsKvStorage(parseRef(ref).value)
69
- * localStorage: createLocalStorageKvStorage(parseRef(ref).value)
70
- */
71
- kvStorageForRef(ref: string): KVStorage;
72
- /**
73
- * Blob storage factory — scoped by namespace.
74
- * Namespaces used by the public layer:
75
- * 'sources' — fetched source data files (keyed by cardId/outputFile)
76
- * '' — root-scoped blob access (for resolving arbitrary KindValueRef blobs)
77
- */
78
- blobStorage(namespace: string): BlobStorage;
79
- /**
80
- * Ephemeral scratch store for transient I/O staging (probe in/out/err,
81
- * dispatchExecution argv/out/err). Default scope is board-local; if the
82
- * config has a 'scratch-store-ref' set, scratchStorageForRef(ref) is used
83
- * instead.
84
- */
85
- scratchStorage(): ScratchStorage;
86
- scratchStorageForRef(ref: string): ScratchStorage;
87
- /**
88
- * Archive factory — long-lived tracking / audit store. Default scope is
89
- * board-local; if the config has an 'archive-store-ref' set,
90
- * archiveFactoryForRef(ref) is used instead so archives can live on a
91
- * different backend / path than the main board runtime.
92
- */
93
- archiveFactory(): ArchiveFactory;
94
- archiveFactoryForRef(ref: string): ArchiveFactory;
95
- /**
96
- * Journal storage adapter (append-only log).
97
- * Uses the lib's JournalStorageAdapter interface.
98
- * One journal per board — no namespace parameter needed.
99
- */
100
- journalAdapter(): JournalStorageAdapter;
101
- /**
102
- * AtomicRelayLock — non-blocking try-acquire with relay-on-busy semantics.
103
- * Guards processAccumulatedEvents drain cycle.
104
- * FS: proper-lockfile (createFsAtomicRelayLock)
105
- * Azure: blob lease
106
- * Firestore: Firestore transaction + sentinel document
107
- */
108
- lock: AtomicRelayLock;
109
- /**
110
- * Self-identity ExecutionRef — how to invoke THIS board instance.
111
- * Embedded in source callback tokens so executors know where to report back.
112
- * Node/FS: { howToRun: 'local-node', whatToRun: 'b64:<base64url({"kind":"yaml-flow-cli","value":"board-live-cards-cli.js"})>' }
113
- * Azure Fn: { howToRun: 'http:post', whatToRun: 'b64:<base64url({"kind":"http-url","value":"https://…/api/board"})>' }
114
- */
115
- selfRef: ExecutionRef;
116
- /**
117
- * Generic execution dispatch — platform adapts ExecutionRef → actual transport.
118
- * Public layer constructs fully-formed semantic args (source def, base_ref,
119
- * callback token with selfRef baked in). Platform handles transport:
120
- * Node: writes args to temp file, spawns detached process
121
- * Azure: HTTP POST args as JSON body
122
- * Firebase: publishes args as pubsub message
123
- */
124
- dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
125
- dispatched: boolean;
126
- error?: string;
127
- }>;
128
- /**
129
- * Resolve a blob ref to its string contents.
130
- * The adapter handles the platform-specific lookup (e.g. absolute FS path vs board-relative key).
131
- * Throws if the blob does not exist.
132
- */
133
- resolveBlob(ref: KindValueRef): string;
134
- /**
135
- * Compute a stable, deterministic content hash for any JSON-serializable value.
136
- * Used for dedup indexes and snapshot versioning.
137
- * Node/FS: computeStableJsonHash (storage-fs-adapters)
138
- * Browser: Web Crypto subtle.digest or equivalent
139
- */
140
- hashFn(value: unknown): string;
141
- /**
142
- * Generate a random short ID (32 hex chars).
143
- * Used for commit IDs and delivery tokens.
144
- * Node/FS: getHash(`${Date.now()}-${Math.random()}`).slice(0, 32)
145
- * Browser: crypto.randomUUID().replace(/-/g, '')
146
- */
147
- genId(): string;
148
- /**
149
- * Request an additional drain pass asynchronously (e.g. spawn a background process).
150
- * Called as the relay continuation after each drain cycle so that events written
151
- * during the cycle (e.g. task-completed appended by the card handler) are eventually
152
- * processed even when the current process exits immediately after returning.
153
- * Optional — if absent, no continuation is scheduled.
154
- */
155
- requestProcessAccumulated?(): void;
156
- /**
157
- * Optional cross-process board change notification publisher (named pipe, webhook, pubsub, etc.).
158
- * Called once per drain cycle with the complete batch of notifications produced in that cycle.
159
- */
160
- publishBoardChangeNotifications?(notifications: BoardChangeNotification[]): void | Promise<void>;
161
- /** Optional warn sink — defaults to no-op. */
162
- onWarn?(msg: string): void;
163
- }
164
- interface BoardLiveCardsPublic {
165
- init(input: CommandInput): CommandResult;
166
- status(input: CommandInput): CommandResult<BoardStatusObject>;
167
- getCardStoreRef(input: CommandInput): CommandResult<{
168
- storeRef: string;
169
- }>;
170
- getOutputsStoreRef(input: CommandInput): CommandResult<{
171
- storeRef: string;
172
- }>;
173
- getScratchStoreRef(input: CommandInput): CommandResult<{
174
- storeRef: string | null;
175
- }>;
176
- getArchiveStoreRef(input: CommandInput): CommandResult<{
177
- storeRef: string | null;
178
- }>;
179
- getChatStoreRef(input: CommandInput): CommandResult<{
180
- storeRef: string | null;
181
- }>;
182
- getArtifactsStoreRef(input: CommandInput): CommandResult<{
183
- storeRef: string | null;
184
- }>;
185
- getConfig(input: CommandInput): CommandResult<{
186
- value: unknown;
187
- }>;
188
- getOutputsDataObject(input: CommandInput): CommandResult;
189
- getAllOutputsDataObjects(input: CommandInput): CommandResult<Record<string, unknown>>;
190
- getOutputsComputedValues(input: CommandInput): CommandResult;
191
- getAllOutputsComputedValues(input: CommandInput): CommandResult<Record<string, unknown>>;
192
- getOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, string>>;
193
- getAllOutputsFetchedSources(input: CommandInput): CommandResult<Record<string, Record<string, string>>>;
194
- removeCard(input: CommandInput): CommandResult;
195
- addCardFiles(input: CommandInput): CommandResult<{
196
- cardId: string;
197
- files_added: Array<{
198
- idx: number;
199
- entry: unknown;
200
- }>;
201
- notified: true;
202
- }>;
203
- cardRefreshedNotify(input: CommandInput): CommandResult;
204
- retrigger(input: CommandInput): CommandResult;
205
- processAccumulatedEvents(input: CommandInput): Promise<CommandResult>;
206
- upsertCard(input: CommandInput): CommandResult;
207
- taskFailed(input: CommandInput): CommandResult;
208
- taskProgress(input: CommandInput): CommandResult;
209
- sourceDataFetched(input: CommandInput): CommandResult;
210
- sourceDataFetchFailure(input: CommandInput): CommandResult;
211
- }
212
- type BoardChangeNotification = OutputStoreEvent | {
213
- kind: 'card_refreshed';
214
- cardId: string;
215
- card: LiveCard;
216
- } | {
217
- kind: 'card_removed';
218
- cardId: string;
219
- };
220
- declare function createBoardLiveCardsPublic(baseRef: KindValueRef, adapter: BoardPlatformAdapter): BoardLiveCardsPublic;
221
- interface BoardNonCorePlatformAdapter extends BoardPlatformAdapter {
222
- /**
223
- * Synchronously invoke a task executor subcommand and return stdout.
224
- * Throws on non-zero exit or timeout.
225
- */
226
- invokeExecutorSync(ref: ExecutionRef, subcommand: string, args: string[], opts?: {
227
- timeout?: number;
228
- input?: string;
229
- }): string;
230
- /** Schema-only card validator (no executor invocation). */
231
- validateSchema(card: Record<string, unknown>): {
232
- ok: boolean;
233
- errors: string[];
234
- };
235
- /** Absolute-path blob I/O for resolving arbitrary KindValueRef blobs. */
236
- absoluteBlob: BlobStorage;
237
- /**
238
- * Default timeouts (ms) for synchronous executor invocations.
239
- * Each field can also be overridden per-source via source_def.timeout.
240
- *
241
- * validationMs — validate-source-def, validate-card-preflight (structural, fast). Default: 10_000.
242
- * preflightMs — source preflight executor hooks (probe-source-preflight). Default: 60_000.
243
- * probeMs — run-source-fetch in probe/simulation paths. Default: 60_000.
244
- * describeMs — describe-capabilities introspection. Default: 10_000.
245
- */
246
- executorTimeouts?: {
247
- validationMs?: number;
248
- preflightMs?: number;
249
- probeMs?: number;
250
- describeMs?: number;
251
- };
252
- }
253
- interface BoardLiveCardsNonCorePublic {
254
- /** params: cardId? or all?; returns array even for single card */
255
- validateCard(input: CommandInput): CommandResult<Array<{
256
- cardId: string;
257
- isValid: boolean;
258
- issues: string[];
259
- }>>;
260
- /** body: { "card-content": <card> } — card JSON arrives via stdin; validates schema + JSONata + provides refs + source_defs (executor, if configured) */
261
- validateCardPreflight(input: CommandInput): CommandResult<{
262
- cardId: string;
263
- isValid: boolean;
264
- issues: string[];
265
- }>;
266
- /** params: cardId, sourceIdx, outRef?; body — mockProjections object */
267
- probeSource(input: CommandInput): CommandResult;
268
- /** body: { sourceDef, mockProjections }; params: outRef? */
269
- probeTmpSource(input: CommandInput): CommandResult;
270
- /** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — card JSON arrives via stdin; no board state needed */
271
- probeSourcePreflight(input: CommandInput): CommandResult;
272
- /** body: { "card-content": <card>, "mock-projections"?: {} }; params: sourceIdx, outRef? — runs the real source fetch flow as a preflight */
273
- runSourcePreflight(input: CommandInput): CommandResult<{
274
- bindTo: string;
275
- ok: boolean;
276
- result: unknown;
277
- issues: string[];
278
- }>;
279
- /** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — evaluates compute expressions with supplied data; no board state needed */
280
- evalCardCompute(input: CommandInput): CommandResult<{
281
- cardId: string;
282
- ok: boolean;
283
- computed_values: Record<string, unknown>;
284
- errors: Array<{
285
- bindTo: string;
286
- error: string;
287
- }>;
288
- }>;
289
- /** body: { "card-content": <card>, "mock-fetched-sources"?: {}, "mock-requires"?: {} } — full cycle: validate → resolve projections → probe sources → compute */
290
- simulateCardCycle(input: CommandInput): CommandResult;
291
- /** no params needed */
292
- describeTaskExecutorCapabilities(input: CommandInput): CommandResult;
293
- /**
294
- * Write/update cards in the configured card store.
295
- * body: { ops: Array<{ op: 'update', id: string, 'card-content': LiveCard }> }
296
- */
297
- updatesInCardStore(input: CommandInput): CommandResult;
298
- /**
299
- * Read cards from the configured card store by id.
300
- * body: { ids: string[] }
301
- */
302
- readFromCardStore(input: CommandInput): CommandResult<{
303
- cards: Array<{
304
- id: string;
305
- 'card-content': LiveCard | null;
306
- }>;
307
- }>;
308
- }
309
- declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter): BoardLiveCardsNonCorePublic;
310
-
311
- /**
312
- * chat-storage-lib.ts
313
- *
314
- * ChatStorage interface + factories backed by JournalStorage (history) and
315
- * KVStorage (processing state and config).
316
- *
317
- * Platform-free — no node:fs or node:crypto imports.
318
- */
319
-
320
- interface ChatRecord {
321
- /** Journal entry id — also used as SSE cursor. */
322
- id: string;
323
- role: string;
324
- text: string;
325
- files: unknown[];
326
- turn: string;
327
- updated_at: string;
328
- }
329
- interface ChatConfig {
330
- systemPrompt?: string;
331
- }
332
- interface ChatReadAfterResult {
333
- records: ChatRecord[];
334
- /** Pass as cursor on the next call. Null when the journal is empty. */
335
- cursor: string | null;
336
- }
337
- interface ChatStorage {
338
- /** Append a message; returns the new entry id (usable as a cursor). */
339
- append(cardId: string, role: string, text: string, files?: unknown[], turn?: string): string;
340
- /** Read all messages in insertion order. */
341
- readAll(cardId: string): ChatRecord[];
342
- /**
343
- * Read messages appended after cursor.
344
- * Pass null to read from the beginning.
345
- */
346
- readAfter(cardId: string, cursor: string | null): ChatReadAfterResult;
347
- /** Remove all messages for this card. */
348
- clear(cardId: string): void;
349
- setProcessing(cardId: string, active: boolean): void;
350
- isProcessing(cardId: string): boolean;
351
- getConfig(cardId: string): ChatConfig;
352
- setConfig(cardId: string, patch: Partial<ChatConfig>): void;
353
- }
354
- /**
355
- * Create a ChatStorage backed by:
356
- * - journalFactory(cardId) → JournalStorage (one per-card journal for history)
357
- * - kv → KVStorage (shared processing flags + config)
358
- */
359
- declare function createChatStorage(journalFactory: (cardId: string) => JournalStorage, kv: KVStorage): ChatStorage;
360
- declare function createInMemoryChatStorage(): ChatStorage;
361
-
362
- interface InvocationAdapter {
363
- /**
364
- * Fire-and-forget invocation of an ExecutionRef with args.
365
- * Used for chat-handler dispatch, and potentially task-executor / inference-adapter.
366
- * Returns a promise that resolves when the invocation is dispatched (not completed).
367
- */
368
- invoke(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
369
- dispatched: boolean;
370
- error?: string;
371
- }>;
372
- /**
373
- * Optional synchronous describe call — asks the target to identify itself.
374
- * Used for pre-init validation (e.g. confirming a chat-handler reports kind='chat-handler').
375
- * Hosts that pre-register capabilities at deploy time may omit this.
376
- */
377
- describe?(ref: ExecutionRef): Promise<DescribeEnvelope | null>;
378
- }
379
- interface NotificationTransport {
380
- /**
381
- * Start listening for events on a notification endpoint identified by a kind-ref.
382
- * The ref kind determines the transport mechanism:
383
- * ::named-pipe::/tmp/board-x.sock
384
- * ::firestore-watch::collections/board-x/notifications
385
- * ::signalr::https://x.service.signalr.net/hub/board-x
386
- * onEvent is called with parsed JSON notification objects.
387
- * Returns a teardown function.
388
- */
389
- subscribe(ref: KindValueRef, onEvent: (event: unknown) => void): Promise<() => void>;
390
- }
391
- interface DescribeEnvelope {
392
- name: string;
393
- kind: 'task-executor' | 'chat-handler' | 'inference-adapter';
394
- protocolVersion: string;
395
- supports?: string[];
396
- }
397
-
398
- export { type BoardPlatformAdapter as B, type ChatStorage as C, type DescribeEnvelope as D, type InvocationAdapter as I, type NotificationTransport as N, type CommandInput as a, type CommandResult as b, type ChatRecord as c, type ChatReadAfterResult as d, type ChatConfig as e, type BoardNonCorePlatformAdapter as f, type BoardLiveCardsNonCorePublic as g, type BoardLiveCardsPublic as h, createBoardLiveCardsNonCorePublic as i, createBoardLiveCardsPublic as j, createChatStorage as k, createInMemoryChatStorage as l };