yaml-flow 8.5.3 → 8.6.2

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 (176) 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 +773 -13
  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 +2 -0
  11. package/examples/board/test/server-http-test.js +878 -67
  12. package/examples/board-local/demo-shell-localstorage.html +3 -3
  13. package/lib/{artifacts-store-lib-CVgtQrNZ.d.cts → artifacts-store-lib-BR-Samty.d.cts} +1 -1
  14. package/lib/{artifacts-store-lib-D-k-E8Vy.d.ts → artifacts-store-lib-DT7XlWUL.d.ts} +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 +87 -34
  23. package/lib/board-live-cards-mcp.d.ts +87 -34
  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 +52 -14
  27. package/lib/board-live-cards-node.d.ts +52 -14
  28. package/lib/board-live-cards-node.js +8 -16
  29. package/lib/{board-live-cards-public-BGS22cMb.d.ts → board-live-cards-public-BMUIPOrc.d.ts} +90 -30
  30. package/lib/board-live-cards-public-async-DKZqbJVU.d.ts +256 -0
  31. package/lib/board-live-cards-public-async-dMWNbWq6.d.cts +256 -0
  32. package/lib/{board-live-cards-public-B13InXhC.d.cts → board-live-cards-public-wkNmBIRC.d.cts} +90 -30
  33. package/lib/board-live-cards-public.cjs +1 -2
  34. package/lib/board-live-cards-public.d.cts +2 -2
  35. package/lib/board-live-cards-public.d.ts +2 -2
  36. package/lib/board-live-cards-public.js +1 -2
  37. package/lib/board-live-cards-server-runtime.cjs +1 -7
  38. package/lib/board-live-cards-server-runtime.d.cts +7 -6
  39. package/lib/board-live-cards-server-runtime.d.ts +7 -6
  40. package/lib/board-live-cards-server-runtime.js +1 -7
  41. package/lib/board-livegraph-runtime/index.cjs +1 -2
  42. package/lib/board-livegraph-runtime/index.js +1 -2
  43. package/lib/board-worker-adapter.cjs +22 -7
  44. package/lib/board-worker-adapter.d.cts +28 -3
  45. package/lib/board-worker-adapter.d.ts +28 -3
  46. package/lib/board-worker-adapter.js +22 -7
  47. package/lib/card-compute/index.cjs +1 -9
  48. package/lib/card-compute/index.js +1 -9
  49. package/lib/card-store-public.cjs +1 -1
  50. package/lib/card-store-public.d.cts +2 -2
  51. package/lib/card-store-public.d.ts +2 -2
  52. package/lib/card-store-public.js +1 -1
  53. package/lib/card-validation.cjs +1 -9
  54. package/lib/card-validation.js +1 -9
  55. package/lib/{chat-storage-lib-0imhRX3l.d.cts → chat-storage-lib-BIUbE-fM.d.cts} +1 -1
  56. package/lib/{chat-storage-lib-CJn7a6OH.d.ts → chat-storage-lib-BlG-sobS.d.ts} +1 -1
  57. package/lib/chat-store-public.cjs +1 -1
  58. package/lib/chat-store-public.d.cts +3 -3
  59. package/lib/chat-store-public.d.ts +3 -3
  60. package/lib/chat-store-public.js +1 -1
  61. package/lib/chunk-2MZUYY65.cjs +2 -0
  62. package/lib/chunk-5EA2ESS4.cjs +16 -0
  63. package/lib/chunk-76ON3V7R.js +2 -0
  64. package/lib/chunk-7BKNHFNH.js +2 -0
  65. package/lib/chunk-BQS3EIEK.js +3 -0
  66. package/lib/chunk-CIAJNUR4.js +2 -0
  67. package/lib/chunk-DAXACY63.js +2 -0
  68. package/lib/chunk-FW4363Y4.js +2 -0
  69. package/lib/chunk-FZ2SBU5M.js +3 -0
  70. package/lib/chunk-G4XXRHL2.cjs +3 -0
  71. package/lib/chunk-GJJMEAVN.cjs +2 -0
  72. package/lib/chunk-GNFE24S7.cjs +2 -0
  73. package/lib/chunk-GYQXDNNI.cjs +2 -0
  74. package/lib/chunk-H5HBXPOI.cjs +3 -0
  75. package/lib/chunk-H5KD3JPY.cjs +2 -0
  76. package/lib/chunk-HEEDJEKM.js +2 -0
  77. package/lib/chunk-HLJH7LGW.js +16 -0
  78. package/lib/chunk-IXZG74EW.cjs +2 -0
  79. package/lib/chunk-JAL25FGA.cjs +2 -0
  80. package/lib/chunk-JM5EKT57.js +2 -0
  81. package/lib/chunk-JMDHDY6M.js +2 -0
  82. package/lib/chunk-KBELAKIY.js +2 -0
  83. package/lib/chunk-KHJABJ45.cjs +3 -0
  84. package/lib/chunk-KLRUISRY.cjs +2 -0
  85. package/lib/chunk-KQX6R4PV.cjs +8 -0
  86. package/lib/chunk-LODXIALE.cjs +2 -0
  87. package/lib/chunk-MLVTJASJ.js +2 -0
  88. package/lib/chunk-MNEOJWPS.js +10 -0
  89. package/lib/chunk-N6P2JW4W.js +3 -0
  90. package/lib/chunk-NMZ6XNLB.cjs +3 -0
  91. package/lib/chunk-OEFTOO47.cjs +3 -0
  92. package/lib/chunk-OPNGCSXJ.js +2 -0
  93. package/lib/chunk-OSWJKJLB.js +8 -0
  94. package/lib/chunk-P7ZCDICS.cjs +2 -0
  95. package/lib/chunk-PBCDDO4V.cjs +2 -0
  96. package/lib/chunk-PMUSJQSR.cjs +2 -0
  97. package/lib/chunk-Q6H7NINN.cjs +5 -0
  98. package/lib/chunk-QWBNDVUA.js +5 -0
  99. package/lib/chunk-S6DRP2HX.cjs +2 -0
  100. package/lib/chunk-SCWHDI3I.js +2 -0
  101. package/lib/chunk-SFVO2LB2.cjs +3 -0
  102. package/lib/chunk-U2N6MCD5.cjs +2 -0
  103. package/lib/chunk-UJ7ZTV4J.cjs +10 -0
  104. package/lib/chunk-VGT3TRQG.js +3 -0
  105. package/lib/chunk-VLBB3D6B.js +3 -0
  106. package/lib/chunk-VMW4Z6EF.js +3 -0
  107. package/lib/chunk-WDPOGXTY.js +2 -0
  108. package/lib/chunk-WOALA3V5.cjs +2 -0
  109. package/lib/chunk-X3LC4LII.js +2 -0
  110. package/lib/chunk-XQRNDX4Q.js +2 -0
  111. package/lib/chunk-YGKDQLYP.js +2 -0
  112. package/lib/chunk-YMEIPKLW.cjs +2 -0
  113. package/lib/cloud-storage.cjs +2 -0
  114. package/lib/cloud-storage.d.cts +177 -0
  115. package/lib/cloud-storage.d.ts +177 -0
  116. package/lib/cloud-storage.js +2 -0
  117. package/lib/config/index.cjs +1 -1
  118. package/lib/config/index.js +1 -1
  119. package/lib/continuous-event-graph/index.cjs +1 -2
  120. package/lib/continuous-event-graph/index.js +1 -2
  121. package/lib/event-graph/index.cjs +1 -22
  122. package/lib/event-graph/index.js +1 -22
  123. package/lib/execution-refs.cjs +1 -2
  124. package/lib/execution-refs.d.cts +3 -2
  125. package/lib/execution-refs.d.ts +3 -2
  126. package/lib/execution-refs.js +1 -2
  127. package/lib/index.cjs +2 -24
  128. package/lib/index.d.cts +1 -1
  129. package/lib/index.d.ts +1 -1
  130. package/lib/index.js +2 -24
  131. package/lib/{types-CIgsh56O.d.cts → queue-lane-registry-BPKWWgd4.d.cts} +66 -14
  132. package/lib/{types-30R357js.d.ts → queue-lane-registry-Be6c0ftj.d.ts} +66 -14
  133. package/lib/server-runtime/index.cjs +1 -7
  134. package/lib/server-runtime/index.d.cts +18 -7
  135. package/lib/server-runtime/index.d.ts +18 -7
  136. package/lib/server-runtime/index.js +1 -7
  137. package/lib/step-machine/index.cjs +1 -11
  138. package/lib/step-machine/index.js +1 -11
  139. package/lib/step-machine-public/index.cjs +1 -4
  140. package/lib/step-machine-public/index.d.cts +1 -1
  141. package/lib/step-machine-public/index.d.ts +1 -1
  142. package/lib/step-machine-public/index.js +1 -4
  143. package/lib/{storage-interface-B2WD9D5n.d.cts → storage-interface-BFiD3kyB.d.cts} +38 -1
  144. package/lib/{storage-interface-B2WD9D5n.d.ts → storage-interface-BFiD3kyB.d.ts} +38 -1
  145. package/lib/stores/index.cjs +1 -2
  146. package/lib/stores/index.d.cts +1 -1
  147. package/lib/stores/index.d.ts +1 -1
  148. package/lib/stores/index.js +1 -2
  149. package/lib/stores/kv.cjs +1 -2
  150. package/lib/stores/kv.d.cts +1 -1
  151. package/lib/stores/kv.d.ts +1 -1
  152. package/lib/stores/kv.js +1 -2
  153. package/lib/stores/memory.cjs +1 -1
  154. package/lib/stores/memory.js +1 -1
  155. package/package.json +7 -16
  156. package/cli/board-live-cards-lib-COi4bSpk.d.ts +0 -322
  157. package/cli/browser-api/board-live-cards-browser-adapter.d.ts +0 -36
  158. package/cli/browser-api/board-live-cards-browser-adapter.js +0 -4
  159. package/cli/browser-api/card-store-browser-api.d.ts +0 -25
  160. package/cli/browser-api/card-store-browser-api.js +0 -2
  161. package/cli/browser-api/jsonata-sync.cjs +0 -7623
  162. package/cli/bundled/artifacts-store-cli.mjs +0 -12
  163. package/cli/bundled/batch-runner-cli.mjs +0 -3
  164. package/cli/bundled/board-live-cards-cli.mjs +0 -29
  165. package/cli/bundled/card-store-cli.mjs +0 -154
  166. package/cli/bundled/chat-store-cli.mjs +0 -16
  167. package/cli/bundled/jsonata-sync.cjs +0 -7623
  168. package/cli/bundled/step-machine-cli.mjs +0 -150
  169. package/cli/execution-interface-BCIhu1gO.d.ts +0 -442
  170. package/cli/types-H3EMBPY2.d.ts +0 -398
  171. package/examples/board/server/README-mcp-api.md +0 -690
  172. package/examples/board/test/server-http-mcp-test.js +0 -1280
  173. package/lib/board-livegraph-runtime/jsonata-sync.cjs +0 -7623
  174. package/lib/card-compute/jsonata-sync.cjs +0 -7623
  175. package/lib/continuous-event-graph/jsonata-sync.cjs +0 -7623
  176. package/lib/server-runtime/jsonata-sync.cjs +0 -7623
@@ -1,690 +0,0 @@
1
- # Board Server — MCP API Reference
2
-
3
- Every board server exposes two MCP endpoints under `/api/boards/:boardId`:
4
-
5
- | Endpoint | Content-Type | Purpose |
6
- |---|---|---|
7
- | `POST /api/boards/:boardId/mcp` | `application/json` → `application/json` | All tools except file downloads |
8
- | `POST /api/boards/:boardId/mcp-raw` | `application/json` → `application/octet-stream` | File content download only (`inspect.file-contents`) |
9
-
10
- ## Request / response shape
11
-
12
- ```json
13
- // POST /api/boards/:boardId/mcp
14
- {
15
- "tool": "<tool-name>",
16
- "args": { ... }
17
- }
18
-
19
- // Response (200)
20
- {
21
- "status": "success",
22
- "data": { ... }
23
- }
24
-
25
- // Error (400 / 500)
26
- {
27
- "error": "message"
28
- }
29
- ```
30
-
31
- ---
32
-
33
- ## Tool reference
34
-
35
- ### `discover.source-kinds`
36
-
37
- Returns the known source-kind registry from the task executor.
38
-
39
- **Args:** none
40
-
41
- **Returns:**
42
- ```json
43
- {
44
- "status": "success",
45
- "data": {
46
- "version": "...",
47
- "commonSourceFields": { ... },
48
- "sourceKinds": { "<kind>": { ... } }
49
- }
50
- }
51
- ```
52
-
53
- ---
54
-
55
- ### `inspect.board-runtime-status`
56
-
57
- Returns a summary of all registered cards and overall board state.
58
-
59
- **Args:** none
60
-
61
- **Returns:**
62
- ```json
63
- {
64
- "status": "success",
65
- "data": {
66
- "meta": { ... },
67
- "summary": {
68
- "card_count": 2,
69
- "completed": 1,
70
- "eligible": 0,
71
- "pending": 0,
72
- "blocked": 0,
73
- "in_progress": 1,
74
- "failed": 0,
75
- "unresolved": 0
76
- },
77
- "cards": [
78
- {
79
- "card-id": "my-card",
80
- "status": "completed",
81
- "error": null,
82
- "requires": [],
83
- "requires_satisfied": [],
84
- "requires_missing": [],
85
- "provides_declared": ["output-key"],
86
- "provides_runtime": ["output-key"]
87
- }
88
- ]
89
- }
90
- }
91
- ```
92
-
93
- ---
94
-
95
- ### `inspect.card-definition-and-runtime`
96
-
97
- Returns the full card definition, its runtime state, and the current values of all `provides` outputs.
98
-
99
- **Args:**
100
-
101
- | Field | Type | Required |
102
- |---|---|---|
103
- | `card_id` | string | yes |
104
-
105
- **Returns:**
106
- ```json
107
- {
108
- "status": "success",
109
- "data": {
110
- "cardId": "my-card",
111
- "card_status_in_board": {
112
- "name": "my-card",
113
- "status": "completed",
114
- "error": null,
115
- "requires": [],
116
- "requires_satisfied": [],
117
- "requires_missing": [],
118
- "provides_declared": ["output-key"],
119
- "provides_runtime": ["output-key"]
120
- },
121
- "card_definition_and_static_data": {
122
- "id": "my-card",
123
- "card_data": { ... },
124
- "source_defs": [ ... ]
125
- },
126
- "refs_for_fetched_source_files": {
127
- "output.json": "sha256:abc123..."
128
- },
129
- "runtime_data": {
130
- "requires": { "upstream-key": { ... } },
131
- "provides": { "output-key": { ... } },
132
- "computed_values": { ... },
133
- "rendered_view": {
134
- "layout": "...",
135
- "features": { ... },
136
- "elements": [ { "id": "el1", "kind": "text", "label": "Output", "visible": true, "resolved": "..." } ]
137
- }
138
- }
139
- }
140
- }
141
- ```
142
-
143
- ---
144
-
145
- ### `inspect.chat-messages-on-cards`
146
-
147
- Returns chat records for one or all cards, with flexible filtering.
148
-
149
- **Args:**
150
-
151
- | Field | Type | Default | Notes |
152
- |---|---|---|---|
153
- | `card_id` | string | — | Target card |
154
- | `all-turns` | boolean | `false` | Return all turns (ignores `tail-turns`) |
155
- | `tail-turns` | number | — | Last N user turns only |
156
- | `tail` | number | — | Last N individual messages |
157
- | `turn-id` | string | — | Only messages with this turn id |
158
- | `tail-turns-before-id` | string | — | Requires `tail-turns`; messages before the given turn id |
159
-
160
- **Returns:**
161
- ```json
162
- {
163
- "status": "success",
164
- "data": {
165
- "cardId": "my-card",
166
- "messages": [
167
- { "role": "user", "text": "hello", "turn": "abc123", "ts": "2026-05-28T10:00:00.000Z" },
168
- { "role": "system", "text": "processing...", "turn": "abc123", "ts": "2026-05-28T10:00:00.100Z" },
169
- { "role": "assistant","text": "hi there", "turn": "abc123", "ts": "2026-05-28T10:00:01.200Z" }
170
- ]
171
- }
172
- }
173
- ```
174
-
175
- When a system message references a file attachment, a `retrieval_hint` field is added:
176
- ```json
177
- { "role": "system", "text": "file uploaded: report.pdf as abc.pdf #0", "turn": "abc123",
178
- "retrieval_hint": "Retrieve using inspect-file-contents --card-id my-card --file-idx 0" }
179
- ```
180
-
181
- ---
182
-
183
- ### `inspect.file-contents` _(only on `/mcp-raw`)_
184
-
185
- Downloads the raw bytes of a file attachment stored on a card.
186
-
187
- **Endpoint:** `POST /api/boards/:boardId/mcp-raw`
188
-
189
- **Args:**
190
-
191
- | Field | Type | Required |
192
- |---|---|---|
193
- | `card_id` | string | yes |
194
- | `file_idx` | number | yes |
195
-
196
- **On `/mcp-raw`:** returns raw bytes (`application/octet-stream`) with headers:
197
- - `Content-Disposition: attachment; filename="<name>"`
198
- - `Content-Type: <mime_type>`
199
-
200
- **On `/mcp`:** this tool is rejected. Use `/mcp-raw`.
201
-
202
- ---
203
-
204
- ### `manage.read-card`
205
-
206
- Reads the stored document for a single live card.
207
-
208
- **Args:**
209
-
210
- | Field | Type | Required |
211
- |---|---|---|
212
- | `card_id` | string | yes |
213
-
214
- **Returns:** array containing the matching live card document (empty array if not found), wrapped in the MCP success envelope:
215
- ```json
216
- {
217
- "status": "success",
218
- "data": [
219
- {
220
- "id": "my-card",
221
- "card_data": {
222
- "id": "my-card",
223
- "sources": [ ... ],
224
- "compute": { ... },
225
- "files": [ { "name": "report.pdf", "stored_name": "abc.pdf", "mime_type": "application/pdf", "size": 1024 } ]
226
- }
227
- }
228
- ]
229
- }
230
- ```
231
-
232
- ---
233
-
234
- ### `manage.upsert-card`
235
-
236
- Validates, stores, and registers a card definition. Triggers a board restart for the card.
237
-
238
- **Args:**
239
-
240
- | Field | Type | Required |
241
- |---|---|---|
242
- | `card_id` | string | yes |
243
- | `candidate_card_content` | object | yes — must include `id` matching `card_id` |
244
-
245
- **Returns (success):**
246
- ```json
247
- {
248
- "status": "success",
249
- "data": {
250
- "validation": { "status": "success", "data": { "isValid": true } },
251
- "card_saved": null,
252
- "board_result": { "status": "success" },
253
- "refresh_notify": { "status": "success" }
254
- }
255
- }
256
- ```
257
-
258
- **Returns (validation failure):**
259
- ```json
260
- { "error": "Validation failed" }
261
- ```
262
-
263
- ---
264
-
265
- ### `manage.remove-card`
266
-
267
- Removes a card from both the live board runtime and persistent card storage.
268
-
269
- **Args:**
270
-
271
- | Field | Type | Required |
272
- |---|---|---|
273
- | `card_id` | string | yes |
274
-
275
- **Returns:** the card removal result. On success:
276
- ```json
277
- {
278
- "status": "success",
279
- "data": {
280
- "board_result": { "status": "success" },
281
- "store_result": { "status": "success", "data": { "count": 1 } }
282
- }
283
- }
284
- ```
285
-
286
- > **Behavior notes:**
287
- > - The card is fully removed from persistent storage. `readAll` will not return it after removal.
288
- > - Re-upserting a card with the same `card_id` after removal creates a fresh card with no prior state.
289
-
290
- ---
291
-
292
- ### `manage.upload-card-file`
293
-
294
- Uploads a file to a card's attachment store (outside the chat flow).
295
-
296
- **Args — provide exactly one of `bytes`, `text`, or `base64`:**
297
-
298
- | Field | Type | Notes |
299
- |---|---|---|
300
- | `card_id` | string | required |
301
- | `file_name` | string | required |
302
- | `content_type` | string | optional, default `application/octet-stream` |
303
- | `bytes` | number[] | raw byte array |
304
- | `text` | string | UTF-8 encoded |
305
- | `base64` | string | base64 or base64url encoded |
306
-
307
- **Returns:** the stored file metadata object in the MCP success envelope:
308
- ```json
309
- {
310
- "status": "success",
311
- "data": {
312
- "ok": true,
313
- "file": {
314
- "fileIdx": 2,
315
- "name": "report.pdf",
316
- "stored_name": "abc123.pdf",
317
- "mime_type": "application/pdf",
318
- "size": 204800,
319
- "uploaded_at": "2026-05-28T10:00:00.000Z"
320
- }
321
- }
322
- }
323
- ```
324
-
325
- ---
326
-
327
- ### `stage-ai-response-and-any-attachments`
328
-
329
- Stages an assistant response (with optional file attachments) directly into a card's chat store. Used by agent pipelines to inject a response without going through the SSE chat flow.
330
-
331
- **Args:**
332
-
333
- | Field | Type | Notes |
334
- |---|---|---|
335
- | `card_id` | string | required |
336
- | `text` | string | response text |
337
- | `turn-id` | string | turn id to associate the message with |
338
- | `files` | array | optional array of file metadata objects |
339
-
340
- **Returns:**
341
- ```json
342
- {
343
- "status": "success",
344
- "data": {
345
- "cardId": "my-card",
346
- "id": "msg-uuid-...",
347
- "role": "assistant",
348
- "turn": "abc123",
349
- "files": []
350
- }
351
- }
352
- ```
353
-
354
- ---
355
-
356
- ## `preflight.*` tools
357
-
358
- Preflight tools let you test a **candidate card definition** in-memory without committing it to the board.
359
-
360
- ### Quick Reference
361
-
362
- All preflight tools are invoked through:
363
-
364
- ```json
365
- {
366
- "tool": "preflight.<name>",
367
- "args": { ... }
368
- }
369
- ```
370
-
371
- | Tool | MCP `args` shape | Success `data` shape |
372
- |---|---|---|
373
- | `preflight.validate-candidate-card-definition` | `{ "candidate_card_content": <card> }` | `{ "cardId": string, "isValid": boolean, "issues": string[] }` |
374
- | `preflight.materialize-candidate-card` | `{ "candidate_card_content": <card>, "mock_requires": {}, "mock_fetched_sources": {} }` | `{ "cardId": string, "ok": boolean, "computed_values": object, "errors": Array<{ bindTo, error }>, "provides_outputs": object, "rendered_view": object }` |
375
- | `preflight.probe-single-source-in-candidate-card` | `{ "candidate_card_content": <card>, "source_idx": number, "mock_projections": {} }` | `{ "bindTo": string, "reachable": boolean, "latencyMs"?: number, "note"?: string }` |
376
- | `preflight.run-single-source-in-candidate-card` | `{ "candidate_card_content": <card>, "source_idx": number, "mock_projections": {} }` | `{ "bindTo": string, "ok": boolean, "result": unknown, "issues": string[] }` |
377
- | `preflight.run-single-source-in-live-card` | `{ "card_id": string, "source_idx": number, "mock_requires": {} }` | `{ "bindTo": string, "ok": boolean, "result": unknown, "issues": string[] }` |
378
- | `preflight.run-one-cycle-with-candidate-card` | `{ "candidate_card_content": <card>, "mock_requires": {} }` | `{ "cardId": string, "ok": boolean, "issues": string[], "provides_outputs": object, "rendered_view": object }` |
379
-
380
- Unless otherwise noted, successful HTTP responses use the normal MCP envelope:
381
-
382
- ```json
383
- {
384
- "status": "success",
385
- "data": { ... }
386
- }
387
- ```
388
-
389
- ### `preflight.validate-candidate-card-definition`
390
-
391
- Schema-validates a candidate card.
392
-
393
- **Args:**
394
-
395
- | Field | Type | Required |
396
- |---|---|---|
397
- | `candidate_card_content` | object | yes |
398
-
399
- **MCP request body:**
400
- ```json
401
- {
402
- "tool": "preflight.validate-candidate-card-definition",
403
- "args": {
404
- "candidate_card_content": { "id": "my-card", "card_data": {} }
405
- }
406
- }
407
- ```
408
-
409
- **Returns (valid):**
410
- ```json
411
- { "status": "success", "data": { "cardId": "my-card", "isValid": true, "issues": [] } }
412
- ```
413
-
414
- **Returns (invalid):** outer `status` is still `"success"` — the validator ran cleanly, it just found problems:
415
- ```json
416
- { "status": "success", "data": { "cardId": "my-card", "isValid": false, "issues": [ "view.elements[0].kind is required", "source_defs[0].bindTo is duplicate" ] } }
417
- ```
418
-
419
- ---
420
-
421
- ### `preflight.materialize-candidate-card`
422
-
423
- Evaluates the card's `compute[]` steps with the supplied mocks. Does **not** run sources and does **not** produce a rendered view — use `preflight.run-one-cycle-with-candidate-card` for a full pipeline simulation.
424
-
425
- **Args:**
426
-
427
- | Field | Type | Notes |
428
- |---|---|---|
429
- | `candidate_card_content` | object | required |
430
- | `mock_requires` | object | required — may be empty, but the key must be present |
431
- | `mock_fetched_sources` | object | required — may be empty, but the key must be present |
432
-
433
- **MCP request body:**
434
- ```json
435
- {
436
- "tool": "preflight.materialize-candidate-card",
437
- "args": {
438
- "candidate_card_content": { "id": "my-card", "card_data": {}, "compute": [] },
439
- "mock_requires": {},
440
- "mock_fetched_sources": {}
441
- }
442
- }
443
- ```
444
-
445
- **Returns:**
446
- ```json
447
- {
448
- "status": "success",
449
- "data": {
450
- "cardId": "my-card",
451
- "ok": true,
452
- "computed_values": { "title": "My Report", "count": 42 },
453
- "errors": [],
454
- "provides_outputs": {
455
- "output-key": { "title": "My Report", "count": 42 }
456
- },
457
- "rendered_view": {
458
- "layout": "stack",
459
- "features": {},
460
- "elements": [
461
- { "id": "summary", "kind": "text", "label": "Summary", "visible": true, "resolved": "My Report" }
462
- ]
463
- }
464
- }
465
- }
466
- ```
467
-
468
- `errors` is an array of `{ "bindTo": string, "error": string }`. On compute failure `ok` is `false` and `errors` lists each broken binding:
469
- ```json
470
- { "status": "success", "data": { "cardId": "my-card", "ok": false, "computed_values": {}, "errors": [ { "bindTo": "title", "error": "undefined variable" } ], "provides_outputs": {}, "rendered_view": { "layout": null, "features": null, "elements": [] } } }
471
- ```
472
-
473
- If `mock_requires` or `mock_fetched_sources` is omitted entirely, the MCP call fails with a 400-style error such as `{ "error": "MCP tool requires mock_requires" }`.
474
-
475
- ---
476
-
477
- ### `preflight.probe-single-source-in-candidate-card`
478
-
479
- Calls the registered task executor's `probe-source-preflight` hook for a single source in a candidate card — tests reachability without fetching data. **Requires a task executor to be registered**; returns an error if none is configured.
480
-
481
- **Args:**
482
-
483
- | Field | Type | Notes |
484
- |---|---|---|
485
- | `candidate_card_content` | object | required |
486
- | `source_idx` | number | index into the card's `source_defs` array |
487
- | `mock_projections` | object | optional mock projection data |
488
-
489
- **MCP request body:**
490
- ```json
491
- {
492
- "tool": "preflight.probe-single-source-in-candidate-card",
493
- "args": {
494
- "candidate_card_content": { "id": "my-card", "card_data": {}, "source_defs": [ ... ] },
495
- "source_idx": 0,
496
- "mock_projections": {}
497
- }
498
- }
499
- ```
500
-
501
- **Returns:** connectivity / readiness metadata for the source — does **not** return fetched data:
502
- ```json
503
- {
504
- "status": "success",
505
- "data": {
506
- "bindTo": "my-source",
507
- "reachable": true,
508
- "latencyMs": 45,
509
- "note": "endpoint reachable"
510
- }
511
- }
512
- ```
513
-
514
- > If no task executor is configured the call fails with an HTTP error such as `{ "error": "No task-executor registered for this board" }`.
515
-
516
- ---
517
-
518
- ### `preflight.run-single-source-in-candidate-card`
519
-
520
- Executes a single source in a candidate card and returns the real fetched output. This path is live-fetch-only and **requires a configured task executor**.
521
-
522
- **Args:**
523
-
524
- | Field | Type | Notes |
525
- |---|---|---|
526
- | `candidate_card_content` | object | required |
527
- | `source_idx` | number | index into the card's `source_defs` array |
528
- | `mock_projections` | object | optional mock projection data |
529
-
530
- **MCP request body:**
531
- ```json
532
- {
533
- "tool": "preflight.run-single-source-in-candidate-card",
534
- "args": {
535
- "candidate_card_content": { "id": "my-card", "card_data": {}, "source_defs": [ ... ] },
536
- "source_idx": 0,
537
- "mock_projections": {}
538
- }
539
- }
540
- ```
541
-
542
- **Returns:**
543
- ```json
544
- {
545
- "status": "success",
546
- "data": {
547
- "bindTo": "my-source",
548
- "ok": true,
549
- "result": { "items": [ ... ] },
550
- "issues": []
551
- }
552
- }
553
- ```
554
-
555
- On live fetch failure the command still returns `status: "success"`, but with `ok: false` and a populated `issues` list:
556
-
557
- ```json
558
- {
559
- "status": "success",
560
- "data": {
561
- "bindTo": "my-source",
562
- "ok": false,
563
- "result": null,
564
- "issues": ["Probe failed: network timeout"]
565
- }
566
- }
567
- ```
568
-
569
- Field notes:
570
-
571
- - `result` is parsed JSON when possible; otherwise it is returned as a raw string
572
- - `issues` is empty on success and contains live-fetch errors when `ok` is `false`
573
- - If no task executor is configured, the call fails with an HTTP error such as `{ "error": "No task-executor registered for this board" }`
574
- - Request-shape problems such as an out-of-range `source_idx` also fail with an HTTP error, for example `{ "error": "sourceIdx 4 out of range (card has 1 source(s))" }`
575
-
576
- ---
577
-
578
- ### `preflight.run-single-source-in-live-card`
579
-
580
- Executes a single source using an already-saved live card in card storage. This is useful when you want run-source behavior without supplying `candidate_card_content`.
581
-
582
- **Args:**
583
-
584
- | Field | Type | Notes |
585
- |---|---|---|
586
- | `card_id` | string | required; id of an existing live card |
587
- | `source_idx` | number | required; index into the card's `source_defs` array |
588
- | `mock_requires` | object | required; same contract as `preflight.run-one-cycle-with-candidate-card` |
589
-
590
- **MCP request body:**
591
- ```json
592
- {
593
- "tool": "preflight.run-single-source-in-live-card",
594
- "args": {
595
- "card_id": "card-market-prices",
596
- "source_idx": 0,
597
- "mock_requires": {}
598
- }
599
- }
600
- ```
601
-
602
- **Returns:** same shape as `preflight.run-single-source-in-candidate-card`:
603
- ```json
604
- {
605
- "status": "success",
606
- "data": {
607
- "bindTo": "my-source",
608
- "ok": true,
609
- "result": { "items": [ ... ] },
610
- "issues": []
611
- }
612
- }
613
- ```
614
-
615
- On execution failure this still returns `status: "success"` with `ok: false` and `issues` populated.
616
-
617
- ```json
618
- {
619
- "status": "success",
620
- "data": {
621
- "bindTo": "my-source",
622
- "ok": false,
623
- "result": null,
624
- "issues": ["Probe failed: network timeout"]
625
- }
626
- }
627
- ```
628
-
629
- Request/config errors fail with HTTP error envelopes, for example:
630
-
631
- - `{ "error": "Card \"missing-card\" not found" }`
632
- - `{ "error": "sourceIdx 4 out of range (card has 1 source(s))" }`
633
- - `{ "error": "MCP tool requires mock_requires" }`
634
-
635
- ---
636
-
637
- ### `preflight.run-one-cycle-with-candidate-card`
638
-
639
- Runs a full computation cycle (all sources → compute) against a candidate card in-memory and returns the simplified MCP-facing runtime shape. Nothing is persisted.
640
-
641
- **Args:**
642
-
643
- | Field | Type | Notes |
644
- |---|---|---|
645
- | `candidate_card_content` | object | required |
646
- | `mock_requires` | object | optional mock values for `requires` keys |
647
-
648
- **MCP request body:**
649
- ```json
650
- {
651
- "tool": "preflight.run-one-cycle-with-candidate-card",
652
- "args": {
653
- "candidate_card_content": { "id": "my-card", "card_data": {}, "provides": [], "view": {} },
654
- "mock_requires": {}
655
- }
656
- }
657
- ```
658
-
659
- **Returns:**
660
- ```json
661
- {
662
- "status": "success",
663
- "data": {
664
- "cardId": "my-card",
665
- "ok": true,
666
- "issues": [],
667
- "provides_outputs": {
668
- "output-key": { "title": "My Report", "count": 42 }
669
- },
670
- "rendered_view": {
671
- "layout": "stack",
672
- "features": {},
673
- "elements": [
674
- { "id": "summary", "kind": "text", "label": "Summary", "visible": true, "resolved": "My Report" }
675
- ]
676
- }
677
- }
678
- }
679
- ```
680
-
681
- Field notes:
682
-
683
- - `issues` is a flattened list built from validation issues, source probe errors, projection errors, and compute errors
684
- - `provides_outputs` is resolved from the card's public `provides[]` bindings; if no `provides[]` is declared, the default binding is `{ "bindTo": cardId, "ref": "card_data" }`
685
- - `rendered_view` is materialized from the simulated runtime node using the card's `view`
686
- - The MCP facade intentionally hides low-level `validation`, `source_probes`, `projection_errors`, and `compute_errors` details behind `ok` + `issues`
687
-
688
- ---
689
-
690
-