yaml-flow 8.6.4 → 8.7.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.
- package/browser/adapters/firebase-storage.js +3 -0
- package/browser/adapters/firestore-storage.js +3 -0
- package/browser/adapters/localstorage-storage.js +4 -0
- package/browser/asset-integrity.json +22 -6
- package/browser/live-cards.schema.json +10 -1
- package/browser/server-runtime-controlface.js +8 -0
- package/examples/ARCHITECTURE.md +5 -32
- package/examples/board/demo-shell-with-server.html +2 -2
- package/examples/board/doc.html +2 -2
- package/examples/board/server/board-server.js +4 -2
- package/examples/board/test/server-http-test.js +73 -79
- package/examples/board-firestore/README.md +81 -0
- package/examples/board-firestore/browser/board-runtime.js +263 -0
- package/examples/board-firestore/firestore.indexes.json +29 -0
- package/examples/board-firestore/package.json +14 -0
- package/examples/board-firestore/server/adapters/firestore-archive-factory.js +59 -0
- package/examples/board-firestore/server/adapters/firestore-blob-storage.js +82 -0
- package/examples/board-firestore/server/adapters/firestore-board-adapter.js +127 -0
- package/examples/board-firestore/server/adapters/firestore-journal-storage.js +54 -0
- package/examples/board-firestore/server/adapters/firestore-kv-storage.js +47 -0
- package/examples/board-firestore/server/adapters/firestore-lock.js +62 -0
- package/examples/board-firestore/server/adapters/firestore-queue-storage.js +186 -0
- package/examples/board-firestore/server/adapters/firestore-scratch-storage.js +50 -0
- package/examples/board-firestore/server/worker.js +146 -0
- package/lib/{artifacts-store-lib-BR-Samty.d.cts → artifacts-store-lib-D9nMkVcE.d.cts} +1 -1
- package/lib/{artifacts-store-lib-DT7XlWUL.d.ts → artifacts-store-lib-DSSMqVL2.d.ts} +1 -1
- package/lib/artifacts-store-public.d.cts +2 -2
- package/lib/artifacts-store-public.d.ts +2 -2
- package/lib/board-live-cards-mcp.cjs +1 -1
- package/lib/board-live-cards-mcp.d.cts +51 -3
- package/lib/board-live-cards-mcp.d.ts +51 -3
- package/lib/board-live-cards-mcp.js +1 -1
- package/lib/board-live-cards-node.cjs +5 -5
- package/lib/board-live-cards-node.d.cts +16 -11
- package/lib/board-live-cards-node.d.ts +16 -11
- package/lib/board-live-cards-node.js +5 -5
- package/lib/{board-live-cards-public-BMUIPOrc.d.ts → board-live-cards-public-JNRKfBZy.d.ts} +1 -1
- package/lib/{board-live-cards-public-wkNmBIRC.d.cts → board-live-cards-public-LlVUQPL2.d.cts} +1 -1
- package/lib/board-live-cards-public-async-Di9QB141.d.cts +55 -0
- package/lib/board-live-cards-public-async-fwd1QI82.d.ts +55 -0
- package/lib/board-live-cards-public.cjs +1 -1
- package/lib/board-live-cards-public.d.cts +1 -1
- package/lib/board-live-cards-public.d.ts +1 -1
- package/lib/board-live-cards-public.js +1 -1
- package/lib/board-live-cards-server-runtime.cjs +1 -1
- package/lib/board-live-cards-server-runtime.d.cts +10 -6
- package/lib/board-live-cards-server-runtime.d.ts +10 -6
- package/lib/board-live-cards-server-runtime.js +1 -1
- package/lib/board-livegraph-runtime/index.cjs +1 -1
- package/lib/board-livegraph-runtime/index.js +1 -1
- package/lib/board-platform-adapter-async-BfHmHdx2.d.cts +129 -0
- package/lib/board-platform-adapter-async-DYahVzIK.d.ts +129 -0
- package/lib/board-worker-adapter.cjs +3 -3
- package/lib/board-worker-adapter.js +3 -3
- package/lib/card-compute/index.cjs +1 -1
- package/lib/card-compute/index.js +1 -1
- package/lib/card-store-public.d.cts +1 -1
- package/lib/card-store-public.d.ts +1 -1
- package/lib/card-validation.cjs +1 -1
- package/lib/card-validation.js +1 -1
- package/lib/{chat-storage-lib-BIUbE-fM.d.cts → chat-storage-lib-B9Q34Dyv.d.cts} +1 -1
- package/lib/{chat-storage-lib-BlG-sobS.d.ts → chat-storage-lib-DB9iSai2.d.ts} +1 -1
- package/lib/chat-store-public.d.cts +2 -2
- package/lib/chat-store-public.d.ts +2 -2
- package/lib/chunk-272IYUKT.cjs +2 -0
- package/lib/chunk-3KC6LBOG.js +3 -0
- package/lib/chunk-5XHOHTLZ.cjs +2 -0
- package/lib/chunk-6APH25VI.js +2 -0
- package/lib/chunk-76C7N4YT.js +3 -0
- package/lib/chunk-7FGPOGRV.cjs +2 -0
- package/lib/chunk-7ICPAABP.cjs +7 -0
- package/lib/chunk-ASR44K7H.cjs +3 -0
- package/lib/chunk-CPAXTVBQ.cjs +2 -0
- package/lib/chunk-EGRHWZRV.js +2 -0
- package/lib/chunk-EZENHAVZ.cjs +2 -0
- package/lib/chunk-FO4KNVU7.cjs +2 -0
- package/lib/chunk-GL2OHR2E.cjs +2 -0
- package/lib/chunk-HWYMZK3N.cjs +3 -0
- package/lib/chunk-IPLSRN6P.cjs +4 -0
- package/lib/{chunk-H5HBXPOI.cjs → chunk-J6EGN6S4.cjs} +3 -3
- package/lib/chunk-JH37NJGP.js +3 -0
- package/lib/chunk-JJL5VOQZ.cjs +3 -0
- package/lib/chunk-KAWQPLIE.cjs +2 -0
- package/lib/chunk-LPXVVMQT.cjs +2 -0
- package/lib/chunk-NJJ7WEDT.cjs +2 -0
- package/lib/chunk-NKIQRCOM.cjs +2 -0
- package/lib/chunk-NM6O35RY.cjs +2 -0
- package/lib/chunk-NTICU4OK.js +2 -0
- package/lib/chunk-O7NOHKVR.js +2 -0
- package/lib/chunk-PBOQ4HYB.cjs +2 -0
- package/lib/{chunk-VMW4Z6EF.js → chunk-PRKRXAVN.js} +3 -3
- package/lib/chunk-QJVR3FWQ.js +2 -0
- package/lib/chunk-S44QZUDX.js +2 -0
- package/lib/chunk-SGV7PU4H.js +2 -0
- package/lib/chunk-TSN3RTXT.js +4 -0
- package/lib/chunk-VXJHBWK3.js +2 -0
- package/lib/chunk-WHDEBJLT.js +7 -0
- package/lib/chunk-XYN5D3GL.js +2 -0
- package/lib/chunk-YBYXCFAI.js +2 -0
- package/lib/chunk-YGALANRO.js +2 -0
- package/lib/chunk-ZCNN6XPV.js +2 -0
- package/lib/chunk-ZJ5M5COT.js +2 -0
- package/lib/cloud-storage.cjs +1 -1
- package/lib/cloud-storage.d.cts +5 -3
- package/lib/cloud-storage.d.ts +5 -3
- package/lib/cloud-storage.js +1 -1
- package/lib/continuous-event-graph/index.cjs +1 -1
- package/lib/continuous-event-graph/index.js +1 -1
- package/lib/firebase-storage/index.cjs +3 -0
- package/lib/firebase-storage/index.d.cts +57 -0
- package/lib/firebase-storage/index.d.ts +57 -0
- package/lib/firebase-storage/index.js +3 -0
- package/lib/firestore-storage/index.cjs +3 -0
- package/lib/firestore-storage/index.d.cts +111 -0
- package/lib/firestore-storage/index.d.ts +111 -0
- package/lib/firestore-storage/index.js +3 -0
- package/lib/index.cjs +2 -2
- package/lib/index.js +1 -1
- package/lib/localstorage-storage/index.cjs +2 -0
- package/lib/localstorage-storage/index.d.cts +39 -0
- package/lib/localstorage-storage/index.d.ts +39 -0
- package/lib/localstorage-storage/index.js +2 -0
- package/lib/mcp-tool-registries-BBObLYga.d.ts +41 -0
- package/lib/mcp-tool-registries-W3TRj6O5.d.cts +41 -0
- package/lib/queue-lane-registry-PaZuFpwp.d.cts +30 -0
- package/lib/queue-lane-registry-PaZuFpwp.d.ts +30 -0
- package/lib/server-jobs-queue-runner/index.cjs +2 -0
- package/lib/server-jobs-queue-runner/index.d.cts +22 -0
- package/lib/server-jobs-queue-runner/index.d.ts +22 -0
- package/lib/server-jobs-queue-runner/index.js +2 -0
- package/lib/server-runtime/index.cjs +1 -1
- package/lib/server-runtime/index.d.cts +11 -17
- package/lib/server-runtime/index.d.ts +11 -17
- package/lib/server-runtime/index.js +1 -1
- package/lib/server-runtime-agentface/index.cjs +2 -0
- package/lib/server-runtime-agentface/index.d.cts +53 -0
- package/lib/server-runtime-agentface/index.d.ts +53 -0
- package/lib/server-runtime-agentface/index.js +2 -0
- package/lib/server-runtime-controlface/index.cjs +2 -0
- package/lib/server-runtime-controlface/index.d.cts +29 -0
- package/lib/server-runtime-controlface/index.d.ts +29 -0
- package/lib/server-runtime-controlface/index.js +2 -0
- package/lib/server-runtime-core/index.cjs +2 -0
- package/lib/server-runtime-core/index.d.cts +378 -0
- package/lib/server-runtime-core/index.d.ts +378 -0
- package/lib/server-runtime-core/index.js +2 -0
- package/lib/server-runtime-watchers/index.cjs +2 -0
- package/lib/server-runtime-watchers/index.d.cts +127 -0
- package/lib/server-runtime-watchers/index.d.ts +127 -0
- package/lib/server-runtime-watchers/index.js +2 -0
- package/lib/server-runtime-webhooks/index.cjs +2 -0
- package/lib/server-runtime-webhooks/index.d.cts +34 -0
- package/lib/server-runtime-webhooks/index.d.ts +34 -0
- package/lib/server-runtime-webhooks/index.js +2 -0
- package/lib/storage-async-interface-BRR4eBjx.d.cts +81 -0
- package/lib/storage-async-interface-DhlOVPSp.d.ts +81 -0
- package/lib/{queue-lane-registry-BPKWWgd4.d.cts → types-Ba8H5_Wo.d.cts} +10 -34
- package/lib/{queue-lane-registry-Be6c0ftj.d.ts → types-SO5OZm4s.d.ts} +10 -34
- package/package.json +46 -2
- package/schema/live-cards.schema.json +10 -1
- package/examples/board-local/demo-shell-localstorage.html +0 -843
- package/lib/board-live-cards-public-async-DKZqbJVU.d.ts +0 -256
- package/lib/board-live-cards-public-async-dMWNbWq6.d.cts +0 -256
- package/lib/chunk-KXWT3CY6.cjs +0 -8
- package/lib/chunk-MLVTJASJ.js +0 -2
- package/lib/chunk-N6P2JW4W.js +0 -3
- package/lib/chunk-NMZ6XNLB.cjs +0 -3
- package/lib/chunk-OEFTOO47.cjs +0 -3
- package/lib/chunk-OJLA6NLU.js +0 -8
- package/lib/chunk-R5L5WUKN.js +0 -2
- package/lib/chunk-VLBB3D6B.js +0 -3
- package/lib/chunk-WOALA3V5.cjs +0 -2
- package/lib/chunk-YEB5QHGE.cjs +0 -2
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { f as RuntimeRequest, g as RuntimeResponse } from '../types-SO5OZm4s.js';
|
|
2
|
+
import { T as ToolRegistry } from '../mcp-tool-registries-BBObLYga.js';
|
|
3
|
+
import '../artifacts-store-lib-DSSMqVL2.js';
|
|
4
|
+
import '../storage-interface-BFiD3kyB.js';
|
|
5
|
+
import '../board-live-cards-public-JNRKfBZy.js';
|
|
6
|
+
import '../execution-refs.js';
|
|
7
|
+
import '../types-BBhqYGhE.js';
|
|
8
|
+
import '../board-platform-adapter-async-DYahVzIK.js';
|
|
9
|
+
import '../storage-async-interface-DhlOVPSp.js';
|
|
10
|
+
import '../board-live-cards-public-async-fwd1QI82.js';
|
|
11
|
+
import '../chat-storage-lib-DB9iSai2.js';
|
|
12
|
+
import '../board-live-cards-mcp.js';
|
|
13
|
+
import '../chat-store-public.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* server-runtime/routes-agentface.ts
|
|
17
|
+
*
|
|
18
|
+
* Agent-facing MCP routes extracted from createSingleBoardServerRuntime.
|
|
19
|
+
* POST /mcp — general MCP tool dispatch (read-only, stateless)
|
|
20
|
+
* POST /mcp-raw — raw file-content streaming (inspect.file-contents only)
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
interface McpFacadeLike {
|
|
24
|
+
inspectFileContents: (args: {
|
|
25
|
+
cardId: string;
|
|
26
|
+
fileIdx: number;
|
|
27
|
+
}) => unknown;
|
|
28
|
+
}
|
|
29
|
+
interface CardFileRecord {
|
|
30
|
+
name?: unknown;
|
|
31
|
+
stored_name?: unknown;
|
|
32
|
+
mime_type?: unknown;
|
|
33
|
+
}
|
|
34
|
+
interface RoutesAgentfaceDeps {
|
|
35
|
+
apiBasePath: string;
|
|
36
|
+
json: (res: RuntimeResponse, status: number, payload: unknown) => void;
|
|
37
|
+
readJsonBody: (req: RuntimeRequest) => Promise<Record<string, unknown>>;
|
|
38
|
+
bootstrapBoard: () => Promise<void>;
|
|
39
|
+
createMcpFacade: () => McpFacadeLike;
|
|
40
|
+
createMcpToolRegistry: (mcp: McpFacadeLike) => ToolRegistry;
|
|
41
|
+
resolveCardFileDownloadPayload: (cardId: string, idx: number, expectedStoredName: string | null) => Promise<{
|
|
42
|
+
fileRecord: CardFileRecord;
|
|
43
|
+
bytes: Uint8Array;
|
|
44
|
+
}>;
|
|
45
|
+
isLikelyTextMimeType: (mimeType: string) => boolean;
|
|
46
|
+
sliceTextByLines: (text: string, mode: 'head' | 'tail', count: number) => string;
|
|
47
|
+
}
|
|
48
|
+
interface RoutesAgentface {
|
|
49
|
+
handleAgentfaceApi: (req: RuntimeRequest, res: RuntimeResponse, parsedUrl: URL) => Promise<boolean>;
|
|
50
|
+
}
|
|
51
|
+
declare function createRoutesAgentface(deps: RoutesAgentfaceDeps): RoutesAgentface;
|
|
52
|
+
|
|
53
|
+
export { type RoutesAgentface, type RoutesAgentfaceDeps, createRoutesAgentface };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkASR44K7H_cjs=require('../chunk-ASR44K7H.cjs');require('../chunk-EZENHAVZ.cjs'),require('../chunk-7FGPOGRV.cjs'),require('../chunk-LPXVVMQT.cjs'),require('../chunk-7ICPAABP.cjs'),require('../chunk-KAWQPLIE.cjs'),require('../chunk-NM6O35RY.cjs'),require('../chunk-272IYUKT.cjs'),require('../chunk-CPAXTVBQ.cjs'),require('../chunk-NJJ7WEDT.cjs'),require('../chunk-GL2OHR2E.cjs'),require('../chunk-J6EGN6S4.cjs'),require('../chunk-PBCDDO4V.cjs'),require('../chunk-JJL5VOQZ.cjs'),require('../chunk-U2N6MCD5.cjs'),require('../chunk-SFVO2LB2.cjs'),require('../chunk-G4XXRHL2.cjs'),require('../chunk-LODXIALE.cjs'),require('../chunk-PBOQ4HYB.cjs'),require('../chunk-IXZG74EW.cjs'),require('../chunk-HWYMZK3N.cjs'),require('../chunk-UJ7ZTV4J.cjs'),require('../chunk-YMEIPKLW.cjs'),require('../chunk-GYQXDNNI.cjs'),require('../chunk-GNFE24S7.cjs');var a=["/mcp","/mcp-raw","/mcp-controlplane","/mcp-webhooks"];function l(n,e){return a.some(r=>e===`${n}${r}`)}function s(n,e){return a.some(r=>{let i=`${r}`;if(!e.startsWith(`${n}/`)||!e.endsWith(i))return false;let t=e.slice(n.length+1,e.length-i.length);return t.length>0&&!t.includes("/")})}function d(n){let e=chunkASR44K7H_cjs.a(n);return {...e,async handleRuntimeApi(r,i,t){return l(e.apiBasePath,t.pathname)?e.handleRuntimeApi(r,i,t):false}}}function c(n){let e=chunkASR44K7H_cjs.b(n);return {...e,async handleApi(r,i,t){return s(e.apiBasePath,t.pathname)?e.handleApi(r,i,t):false}}}exports.createMultiBoardServerRuntime=c;exports.createSingleBoardServerRuntime=d;//# sourceMappingURL=index.cjs.map
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { M as MultiBoardRuntimeOptions, a as MultiBoardRuntime, S as SingleBoardRuntimeOptions, b as SingleBoardRuntime } from '../types-Ba8H5_Wo.cjs';
|
|
2
|
+
import '../artifacts-store-lib-D9nMkVcE.cjs';
|
|
3
|
+
import '../storage-interface-BFiD3kyB.cjs';
|
|
4
|
+
import '../board-live-cards-public-LlVUQPL2.cjs';
|
|
5
|
+
import '../execution-refs.cjs';
|
|
6
|
+
import '../types-BBhqYGhE.cjs';
|
|
7
|
+
import '../board-platform-adapter-async-BfHmHdx2.cjs';
|
|
8
|
+
import '../storage-async-interface-BRR4eBjx.cjs';
|
|
9
|
+
import '../board-live-cards-public-async-Di9QB141.cjs';
|
|
10
|
+
import '../chat-storage-lib-B9Q34Dyv.cjs';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* server-runtime-controlface
|
|
14
|
+
*
|
|
15
|
+
* MCP-only server runtime surface.
|
|
16
|
+
* POST /mcp
|
|
17
|
+
* POST /mcp-raw
|
|
18
|
+
* POST /mcp-controlplane
|
|
19
|
+
* POST /mcp-webhooks
|
|
20
|
+
*
|
|
21
|
+
* This package intentionally does not expose /init-board, /board-status,
|
|
22
|
+
* /cards/*, or /sse watcher routes. Browser builds keep the full dispatcher
|
|
23
|
+
* through a dedicated browser entrypoint.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
declare function createSingleBoardServerRuntime(options: SingleBoardRuntimeOptions): SingleBoardRuntime;
|
|
27
|
+
declare function createMultiBoardServerRuntime(options: MultiBoardRuntimeOptions): MultiBoardRuntime;
|
|
28
|
+
|
|
29
|
+
export { MultiBoardRuntime, MultiBoardRuntimeOptions, SingleBoardRuntime, SingleBoardRuntimeOptions, createMultiBoardServerRuntime, createSingleBoardServerRuntime };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { M as MultiBoardRuntimeOptions, a as MultiBoardRuntime, S as SingleBoardRuntimeOptions, b as SingleBoardRuntime } from '../types-SO5OZm4s.js';
|
|
2
|
+
import '../artifacts-store-lib-DSSMqVL2.js';
|
|
3
|
+
import '../storage-interface-BFiD3kyB.js';
|
|
4
|
+
import '../board-live-cards-public-JNRKfBZy.js';
|
|
5
|
+
import '../execution-refs.js';
|
|
6
|
+
import '../types-BBhqYGhE.js';
|
|
7
|
+
import '../board-platform-adapter-async-DYahVzIK.js';
|
|
8
|
+
import '../storage-async-interface-DhlOVPSp.js';
|
|
9
|
+
import '../board-live-cards-public-async-fwd1QI82.js';
|
|
10
|
+
import '../chat-storage-lib-DB9iSai2.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* server-runtime-controlface
|
|
14
|
+
*
|
|
15
|
+
* MCP-only server runtime surface.
|
|
16
|
+
* POST /mcp
|
|
17
|
+
* POST /mcp-raw
|
|
18
|
+
* POST /mcp-controlplane
|
|
19
|
+
* POST /mcp-webhooks
|
|
20
|
+
*
|
|
21
|
+
* This package intentionally does not expose /init-board, /board-status,
|
|
22
|
+
* /cards/*, or /sse watcher routes. Browser builds keep the full dispatcher
|
|
23
|
+
* through a dedicated browser entrypoint.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
declare function createSingleBoardServerRuntime(options: SingleBoardRuntimeOptions): SingleBoardRuntime;
|
|
27
|
+
declare function createMultiBoardServerRuntime(options: MultiBoardRuntimeOptions): MultiBoardRuntime;
|
|
28
|
+
|
|
29
|
+
export { MultiBoardRuntime, MultiBoardRuntimeOptions, SingleBoardRuntime, SingleBoardRuntimeOptions, createMultiBoardServerRuntime, createSingleBoardServerRuntime };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1,b}from'../chunk-76C7N4YT.js';import'../chunk-QJVR3FWQ.js';import'../chunk-NTICU4OK.js';import'../chunk-O7NOHKVR.js';import'../chunk-WHDEBJLT.js';import'../chunk-SGV7PU4H.js';import'../chunk-XYN5D3GL.js';import'../chunk-ZJ5M5COT.js';import'../chunk-YGALANRO.js';import'../chunk-6APH25VI.js';import'../chunk-VXJHBWK3.js';import'../chunk-PRKRXAVN.js';import'../chunk-HEEDJEKM.js';import'../chunk-JH37NJGP.js';import'../chunk-XQRNDX4Q.js';import'../chunk-BQS3EIEK.js';import'../chunk-VGT3TRQG.js';import'../chunk-WDPOGXTY.js';import'../chunk-ZCNN6XPV.js';import'../chunk-JMDHDY6M.js';import'../chunk-3KC6LBOG.js';import'../chunk-MNEOJWPS.js';import'../chunk-KBELAKIY.js';import'../chunk-76ON3V7R.js';import'../chunk-FW4363Y4.js';var a=["/mcp","/mcp-raw","/mcp-controlplane","/mcp-webhooks"];function l(n,e){return a.some(r=>e===`${n}${r}`)}function s(n,e){return a.some(r=>{let i=`${r}`;if(!e.startsWith(`${n}/`)||!e.endsWith(i))return false;let t=e.slice(n.length+1,e.length-i.length);return t.length>0&&!t.includes("/")})}function d(n){let e=a$1(n);return {...e,async handleRuntimeApi(r,i,t){return l(e.apiBasePath,t.pathname)?e.handleRuntimeApi(r,i,t):false}}}function c(n){let e=b(n);return {...e,async handleApi(r,i,t){return s(e.apiBasePath,t.pathname)?e.handleApi(r,i,t):false}}}export{c as createMultiBoardServerRuntime,d as createSingleBoardServerRuntime};//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkEZENHAVZ_cjs=require('../chunk-EZENHAVZ.cjs'),chunkLPXVVMQT_cjs=require('../chunk-LPXVVMQT.cjs'),chunkKAWQPLIE_cjs=require('../chunk-KAWQPLIE.cjs'),chunk272IYUKT_cjs=require('../chunk-272IYUKT.cjs'),chunkCPAXTVBQ_cjs=require('../chunk-CPAXTVBQ.cjs');require('../chunk-GL2OHR2E.cjs'),require('../chunk-SFVO2LB2.cjs'),require('../chunk-PBOQ4HYB.cjs'),require('../chunk-IXZG74EW.cjs'),require('../chunk-HWYMZK3N.cjs'),require('../chunk-UJ7ZTV4J.cjs'),require('../chunk-GNFE24S7.cjs');Object.defineProperty(exports,"appendNotification",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.c}});Object.defineProperty(exports,"createCardFileOps",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.j}});Object.defineProperty(exports,"createControlplaneToolHandlers",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.h}});Object.defineProperty(exports,"createMcpControlplaneToolRegistry",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.m}});Object.defineProperty(exports,"createMcpFacadeModule",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.n}});Object.defineProperty(exports,"createMcpToolRegistry",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.k}});Object.defineProperty(exports,"createMcpWebhookToolRegistry",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.l}});Object.defineProperty(exports,"createRuntimePayloadModule",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.i}});Object.defineProperty(exports,"expectControlplaneSuccess",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.d}});Object.defineProperty(exports,"expectControlplaneSuccessAsync",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.e}});Object.defineProperty(exports,"getCardMetaKey",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.f}});Object.defineProperty(exports,"hasNonEmptyCardCountStatus",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.b}});Object.defineProperty(exports,"makeNotificationState",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.a}});Object.defineProperty(exports,"readCardMetaValue",{enumerable:true,get:function(){return chunkEZENHAVZ_cjs.g}});Object.defineProperty(exports,"getMcpArgNumber",{enumerable:true,get:function(){return chunkLPXVVMQT_cjs.b}});Object.defineProperty(exports,"getMcpArgRecord",{enumerable:true,get:function(){return chunkLPXVVMQT_cjs.c}});Object.defineProperty(exports,"getMcpArgString",{enumerable:true,get:function(){return chunkLPXVVMQT_cjs.a}});Object.defineProperty(exports,"getRequiredMcpArgNumber",{enumerable:true,get:function(){return chunkLPXVVMQT_cjs.e}});Object.defineProperty(exports,"getRequiredMcpArgRecord",{enumerable:true,get:function(){return chunkLPXVVMQT_cjs.d}});Object.defineProperty(exports,"parseMcpUploadBytes",{enumerable:true,get:function(){return chunkLPXVVMQT_cjs.f}});Object.defineProperty(exports,"concatUint8Arrays",{enumerable:true,get:function(){return chunkKAWQPLIE_cjs.d}});Object.defineProperty(exports,"escapeRegExp",{enumerable:true,get:function(){return chunkKAWQPLIE_cjs.c}});Object.defineProperty(exports,"executionWhatToRunValue",{enumerable:true,get:function(){return chunkKAWQPLIE_cjs.b}});Object.defineProperty(exports,"isAsyncBoardPlatformAdapter",{enumerable:true,get:function(){return chunkKAWQPLIE_cjs.a}});Object.defineProperty(exports,"extractMcpFailureMessage",{enumerable:true,get:function(){return chunk272IYUKT_cjs.b}});Object.defineProperty(exports,"invokeMcpTool",{enumerable:true,get:function(){return chunk272IYUKT_cjs.a}});Object.defineProperty(exports,"createHostedBoardQueueLaneRegistry",{enumerable:true,get:function(){return chunkCPAXTVBQ_cjs.a}});//# sourceMappingURL=index.cjs.map
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { d as BoardRuntimePlatformAdapter } from '../types-Ba8H5_Wo.cjs';
|
|
2
|
+
export { A as Awaitable, B as BoardContextConfig, c as BoardRuntimeNonCorePublic, e as BoardRuntimePublic, C as ChatHandlerFlowRunner, D as DescribeEnvelope, H as HostedBoardQueueLaneTuning, I as InvocationAdapter, a as MultiBoardRuntime, M as MultiBoardRuntimeOptions, N as NotificationTransport, Q as QueueLaneRuntimeTuning, R as RuntimeLogger, f as RuntimeRequest, g as RuntimeResponse, b as SingleBoardRuntime, S as SingleBoardRuntimeOptions } from '../types-Ba8H5_Wo.cjs';
|
|
3
|
+
export { HostedBoardQueueLaneRegistryOptions, createHostedBoardQueueLaneRegistry } from '../server-jobs-queue-runner/index.cjs';
|
|
4
|
+
export { M as McpControlplaneRegistryDeps, a as McpFacadeForRegistry, b as McpWebhookFacadeForRegistry, T as ToolRegistry, c as createMcpControlplaneToolRegistry, d as createMcpToolRegistry, e as createMcpWebhookToolRegistry } from '../mcp-tool-registries-W3TRj6O5.cjs';
|
|
5
|
+
import { createBoardLiveCardsMcp, BoardLiveCardsMcpBoardDeps, BoardLiveCardsMcpNonCoreDeps, BoardLiveCardsMcpCardStoreDeps, BoardLiveCardsMcp } from '../board-live-cards-mcp.cjs';
|
|
6
|
+
import { a as CommandResult } from '../board-live-cards-public-LlVUQPL2.cjs';
|
|
7
|
+
export { B as BoardChangeNotification, c as BoardLiveCardsPublic, d as BoardNonCorePlatformAdapter, e as BoardPlatformAdapter, f as BoardWorkerRequest, C as CommandInput } from '../board-live-cards-public-LlVUQPL2.cjs';
|
|
8
|
+
import { C as CardFileMetadataStore } from '../artifacts-store-lib-D9nMkVcE.cjs';
|
|
9
|
+
import { A as AsyncBoardPlatformAdapter } from '../board-platform-adapter-async-BfHmHdx2.cjs';
|
|
10
|
+
import { ExecutionRef } from '../execution-refs.cjs';
|
|
11
|
+
export { A as AsyncBoardLiveCardsPublic } from '../board-live-cards-public-async-Di9QB141.cjs';
|
|
12
|
+
export { B as BlobStorage, K as KVStorage, a as KindValueRef } from '../storage-interface-BFiD3kyB.cjs';
|
|
13
|
+
export { C as ChatStorage } from '../chat-storage-lib-B9Q34Dyv.cjs';
|
|
14
|
+
import '../queue-lane-registry-PaZuFpwp.cjs';
|
|
15
|
+
import '../chat-store-public.cjs';
|
|
16
|
+
import '../types-BBhqYGhE.cjs';
|
|
17
|
+
import '../storage-async-interface-BRR4eBjx.cjs';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* server-runtime/notifications.ts
|
|
21
|
+
*
|
|
22
|
+
* Per-board notification accumulator state and the small set of pure helpers
|
|
23
|
+
* that fold incoming runtime events into that state. Owned by the runtime
|
|
24
|
+
* closure; no I/O.
|
|
25
|
+
*/
|
|
26
|
+
interface NotificationState {
|
|
27
|
+
status: unknown;
|
|
28
|
+
computedValues: Record<string, unknown>;
|
|
29
|
+
dataObjects: Record<string, unknown>;
|
|
30
|
+
cards: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
declare function makeNotificationState(): NotificationState;
|
|
33
|
+
declare function hasNonEmptyCardCountStatus(status: unknown): boolean;
|
|
34
|
+
declare function appendNotification(state: NotificationState, event: unknown): void;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* server-runtime/mcp-invoker.ts
|
|
38
|
+
*
|
|
39
|
+
* Pure helpers for invoking MCP tools through a registry and turning a tool
|
|
40
|
+
* result into a human-readable error message. Both helpers are platform-free
|
|
41
|
+
* and depend only on plain values — no closure state.
|
|
42
|
+
*/
|
|
43
|
+
type McpToolHandler = (args: Record<string, unknown>) => unknown | Promise<unknown>;
|
|
44
|
+
type McpToolRegistry = Record<string, McpToolHandler>;
|
|
45
|
+
/**
|
|
46
|
+
* Look up `tool` in `registry` and invoke it with `args`. Normalises the
|
|
47
|
+
* returned shape so callers always see `{ status, data? }` (or an explicit
|
|
48
|
+
* `fail` / `error` envelope). Throws an Error tagged with `statusCode: 400`
|
|
49
|
+
* if the tool is unknown.
|
|
50
|
+
*/
|
|
51
|
+
declare function invokeMcpTool(tool: string, args: Record<string, unknown>, registry: McpToolRegistry): Promise<unknown>;
|
|
52
|
+
/**
|
|
53
|
+
* Extract a single human-readable failure message from an MCP tool result,
|
|
54
|
+
* looking through validation envelopes for the first useful issue string.
|
|
55
|
+
* Returns `fallback` when nothing better can be found.
|
|
56
|
+
*/
|
|
57
|
+
declare function extractMcpFailureMessage(result: unknown, fallback: string): string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* server-runtime/mcp-args.ts
|
|
61
|
+
*
|
|
62
|
+
* Pure MCP tool argument parsers. These read from the args record and do not
|
|
63
|
+
* touch runtime state. Kept here so the index closure does not redefine them.
|
|
64
|
+
*/
|
|
65
|
+
declare function getMcpArgString(args: Record<string, unknown>, ...keys: string[]): string;
|
|
66
|
+
declare function getMcpArgNumber(args: Record<string, unknown>, ...keys: string[]): number | undefined;
|
|
67
|
+
declare function getMcpArgRecord(args: Record<string, unknown>, ...keys: string[]): Record<string, unknown>;
|
|
68
|
+
declare function getRequiredMcpArgRecord(args: Record<string, unknown>, errorKey: string, ...keys: string[]): Record<string, unknown>;
|
|
69
|
+
declare function getRequiredMcpArgNumber(args: Record<string, unknown>, errorKey: string, ...keys: string[]): number;
|
|
70
|
+
declare function parseMcpUploadBytes(args: Record<string, unknown>): Uint8Array | null;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* server-runtime/mcp-facade.ts
|
|
74
|
+
*
|
|
75
|
+
* MCP facade wiring extracted from createSingleBoardServerRuntime.
|
|
76
|
+
* Builds the four facade pieces used by the per-board MCP entry point:
|
|
77
|
+
* - mcpBoardFacade (board command surface used by MCP)
|
|
78
|
+
* - mcpNonCoreFacade (preflight / discovery surface)
|
|
79
|
+
* - mcpCardStoreFacade (card-store CRUD surface)
|
|
80
|
+
* - createMcpFacade (composes the above into BoardLiveCardsMcp)
|
|
81
|
+
*
|
|
82
|
+
* The facade reaches into many runtime closures (status snapshots,
|
|
83
|
+
* data-object reads, card-store reads, lane drains, etc.). Those are
|
|
84
|
+
* passed in as narrow callbacks so this module stays portable.
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
/** Subset of BoardContext consumed by the facade. */
|
|
88
|
+
interface McpFacadeBoardContextLike {
|
|
89
|
+
boardAdapter: unknown;
|
|
90
|
+
boardOps: {
|
|
91
|
+
getOutputsFetchedSources: (input: {
|
|
92
|
+
params: {
|
|
93
|
+
key: string;
|
|
94
|
+
};
|
|
95
|
+
}) => Promise<CommandResult>;
|
|
96
|
+
removeCard: (input: {
|
|
97
|
+
params: {
|
|
98
|
+
id: string;
|
|
99
|
+
};
|
|
100
|
+
}) => Promise<CommandResult>;
|
|
101
|
+
cardRefreshedNotify: (input: {
|
|
102
|
+
params: {
|
|
103
|
+
cardId: string;
|
|
104
|
+
};
|
|
105
|
+
}) => Promise<CommandResult>;
|
|
106
|
+
upsertCard: (input: {
|
|
107
|
+
params: {
|
|
108
|
+
cardId: string;
|
|
109
|
+
restart: boolean;
|
|
110
|
+
};
|
|
111
|
+
}) => Promise<CommandResult>;
|
|
112
|
+
};
|
|
113
|
+
cardStoreOps: {
|
|
114
|
+
set: (input: {
|
|
115
|
+
body: unknown;
|
|
116
|
+
}) => Promise<CommandResult>;
|
|
117
|
+
del: (input: {
|
|
118
|
+
params: {
|
|
119
|
+
id: string;
|
|
120
|
+
};
|
|
121
|
+
}) => Promise<CommandResult>;
|
|
122
|
+
patch: (input: {
|
|
123
|
+
params?: {
|
|
124
|
+
id?: string;
|
|
125
|
+
path?: string;
|
|
126
|
+
};
|
|
127
|
+
body?: unknown;
|
|
128
|
+
}) => Promise<CommandResult>;
|
|
129
|
+
appendFiles: (input: {
|
|
130
|
+
params?: {
|
|
131
|
+
id?: string;
|
|
132
|
+
};
|
|
133
|
+
body?: unknown;
|
|
134
|
+
}) => Promise<CommandResult>;
|
|
135
|
+
};
|
|
136
|
+
nonCore: {
|
|
137
|
+
describeTaskExecutorCapabilities: (input: unknown) => unknown;
|
|
138
|
+
validateCardPreflight: (input: unknown) => unknown;
|
|
139
|
+
evalCardCompute: (input: unknown) => unknown;
|
|
140
|
+
probeSourcePreflight: (input: unknown) => unknown;
|
|
141
|
+
runSourcePreflight: (input: unknown) => unknown;
|
|
142
|
+
simulateCardCycle: (input: unknown) => unknown;
|
|
143
|
+
} | null;
|
|
144
|
+
}
|
|
145
|
+
interface McpFacadeDeps {
|
|
146
|
+
boardContexts: ReadonlyArray<McpFacadeBoardContextLike>;
|
|
147
|
+
cardOwnerIndex: Map<string, number>;
|
|
148
|
+
cardContextForCard: (cardId: string) => McpFacadeBoardContextLike | null;
|
|
149
|
+
readStatusSnapshot: () => Promise<unknown>;
|
|
150
|
+
readDataObjectsByToken: () => Promise<Record<string, unknown>>;
|
|
151
|
+
readCardRuntimeArtifacts: () => Promise<Record<string, unknown>>;
|
|
152
|
+
readCardFromStore: (cardId: string) => Promise<Record<string, unknown> | null>;
|
|
153
|
+
readCardDefinitions: () => Promise<unknown[]>;
|
|
154
|
+
processAccumulatedLaneInternal: (skipInit?: boolean) => Promise<CommandResult>;
|
|
155
|
+
reportSourceFetched: (token: string, ref: string) => Promise<CommandResult>;
|
|
156
|
+
reportSourceFetchFailure: (token: string, reason: string) => Promise<CommandResult>;
|
|
157
|
+
uploadCardFile: (cardId: string, fileName: string, contentType: string, bytes: Uint8Array, opts?: {
|
|
158
|
+
inChat?: boolean;
|
|
159
|
+
suppressChatRecordWrite?: boolean;
|
|
160
|
+
}) => unknown | Promise<unknown>;
|
|
161
|
+
chatStorePublic: Parameters<typeof createBoardLiveCardsMcp>[0]['chatStore'];
|
|
162
|
+
serverUrl: string | null;
|
|
163
|
+
apiBasePath: string;
|
|
164
|
+
}
|
|
165
|
+
interface McpFacadeModule {
|
|
166
|
+
mcpBoardFacade: () => BoardLiveCardsMcpBoardDeps;
|
|
167
|
+
mcpNonCoreFacade: () => BoardLiveCardsMcpNonCoreDeps;
|
|
168
|
+
mcpCardStoreFacade: () => BoardLiveCardsMcpCardStoreDeps;
|
|
169
|
+
createMcpFacade: () => BoardLiveCardsMcp;
|
|
170
|
+
}
|
|
171
|
+
declare function createMcpFacadeModule(deps: McpFacadeDeps): McpFacadeModule;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* server-runtime/runtime-payload.ts
|
|
175
|
+
*
|
|
176
|
+
* Read-only aggregation of the per-runtime "published" payload that SSE
|
|
177
|
+
* snapshots and the /board-status endpoint return. Pulled out of
|
|
178
|
+
* createSingleBoardServerRuntime so the closure no longer has to host the
|
|
179
|
+
* three readers (status, computed-values, data-objects) plus the published
|
|
180
|
+
* payload assembler.
|
|
181
|
+
*
|
|
182
|
+
* Uses a structural board-context type with only the fields the readers need,
|
|
183
|
+
* so this module doesn't pull in the heavy BoardContext interface from
|
|
184
|
+
* index.ts.
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
/** Minimum surface of the kv-storage handle used to read persisted status. */
|
|
188
|
+
interface KvStorageReader {
|
|
189
|
+
read(key: string): unknown | Promise<unknown>;
|
|
190
|
+
}
|
|
191
|
+
/** Minimum surface of the board-platform adapter consumed by readStatusSnapshot. */
|
|
192
|
+
interface BoardAdapterForPayload {
|
|
193
|
+
kvStorageForRef(ref: string): KvStorageReader;
|
|
194
|
+
}
|
|
195
|
+
/** Minimum surface of the board-ops handle consumed by payload readers. */
|
|
196
|
+
interface BoardOpsForPayload {
|
|
197
|
+
getAllOutputsComputedValues(input: Record<string, unknown>): {
|
|
198
|
+
status: string;
|
|
199
|
+
data?: unknown;
|
|
200
|
+
} | Promise<{
|
|
201
|
+
status: string;
|
|
202
|
+
data?: unknown;
|
|
203
|
+
}>;
|
|
204
|
+
getAllOutputsDataObjects(input: Record<string, unknown>): {
|
|
205
|
+
status: string;
|
|
206
|
+
data?: unknown;
|
|
207
|
+
} | Promise<{
|
|
208
|
+
status: string;
|
|
209
|
+
data?: unknown;
|
|
210
|
+
}>;
|
|
211
|
+
}
|
|
212
|
+
/** Subset of BoardContext consumed by runtime-payload readers. */
|
|
213
|
+
interface RuntimePayloadBoardContext {
|
|
214
|
+
boardOps: BoardOpsForPayload;
|
|
215
|
+
boardAdapter: BoardAdapterForPayload;
|
|
216
|
+
outputsStoreRef: string;
|
|
217
|
+
notification: NotificationState;
|
|
218
|
+
}
|
|
219
|
+
interface RuntimePayloadDeps {
|
|
220
|
+
boardId: string;
|
|
221
|
+
/** Live reference to the runtime's board-contexts array (read on each call). */
|
|
222
|
+
boardContexts: ReadonlyArray<RuntimePayloadBoardContext>;
|
|
223
|
+
readCardDefinitions: () => Promise<Array<Record<string, unknown>>>;
|
|
224
|
+
readChatRecords: (cardId: string) => Array<Record<string, unknown>>;
|
|
225
|
+
getChatProcessing: (cardId: string) => boolean;
|
|
226
|
+
}
|
|
227
|
+
interface RuntimePayloadModule {
|
|
228
|
+
readStatusSnapshot: () => Promise<unknown>;
|
|
229
|
+
readCardRuntimeArtifacts: () => Promise<Record<string, unknown>>;
|
|
230
|
+
readDataObjectsByToken: () => Promise<Record<string, unknown>>;
|
|
231
|
+
buildPublishedRuntimePayload: () => Promise<unknown>;
|
|
232
|
+
}
|
|
233
|
+
declare function createRuntimePayloadModule(deps: RuntimePayloadDeps): RuntimePayloadModule;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* server-runtime/controlplane-tool-handlers.ts
|
|
237
|
+
*
|
|
238
|
+
* Handlers for the small "controlplane" MCP tools that read/write chat
|
|
239
|
+
* processing state and per-card meta. Each handler validates `board_id`
|
|
240
|
+
* against the runtime's own boardId, requires `card_id`, then delegates to
|
|
241
|
+
* the MCP facade or card-store facade supplied by the host runtime.
|
|
242
|
+
*
|
|
243
|
+
* The handlers are factored out of createSingleBoardServerRuntime so that
|
|
244
|
+
* createMcpControlplaneToolRegistry in index.ts can simply wire them up,
|
|
245
|
+
* keeping the closure free of repetitive arg-validation noise.
|
|
246
|
+
*/
|
|
247
|
+
|
|
248
|
+
interface ControlplaneToolHandlersDeps {
|
|
249
|
+
boardId: string;
|
|
250
|
+
/** Returns the live MCP facade (chat processing getters/setters). */
|
|
251
|
+
getMcpFacade: () => {
|
|
252
|
+
setChatProcessing: (args: {
|
|
253
|
+
cardId: string;
|
|
254
|
+
active: boolean;
|
|
255
|
+
}) => unknown;
|
|
256
|
+
getChatProcessing: (args: {
|
|
257
|
+
cardId: string;
|
|
258
|
+
}) => {
|
|
259
|
+
active: boolean;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
/** Returns the card-store facade used for meta reads/writes. */
|
|
263
|
+
getMcpCardStoreFacade: () => BoardLiveCardsMcpCardStoreDeps;
|
|
264
|
+
}
|
|
265
|
+
interface ControlplaneToolHandlers {
|
|
266
|
+
requireCardArgs: (args: Record<string, unknown>) => {
|
|
267
|
+
cardId: string;
|
|
268
|
+
};
|
|
269
|
+
setChatProcessing: (args: Record<string, unknown>, active: boolean) => {
|
|
270
|
+
status: 'success';
|
|
271
|
+
data: {
|
|
272
|
+
boardId: string;
|
|
273
|
+
cardId: string;
|
|
274
|
+
active: boolean;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
getChatProcessing: (args: Record<string, unknown>) => {
|
|
278
|
+
status: 'success';
|
|
279
|
+
data: {
|
|
280
|
+
boardId: string;
|
|
281
|
+
cardId: string;
|
|
282
|
+
active: boolean;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
setCardMeta: (args: Record<string, unknown>) => Promise<{
|
|
286
|
+
status: 'success';
|
|
287
|
+
data: {
|
|
288
|
+
boardId: string;
|
|
289
|
+
cardId: string;
|
|
290
|
+
key: string;
|
|
291
|
+
};
|
|
292
|
+
}>;
|
|
293
|
+
getCardMeta: (args: Record<string, unknown>) => Promise<{
|
|
294
|
+
status: 'success';
|
|
295
|
+
data: {
|
|
296
|
+
boardId: string;
|
|
297
|
+
cardId: string;
|
|
298
|
+
key: string;
|
|
299
|
+
exists: boolean;
|
|
300
|
+
value: unknown;
|
|
301
|
+
};
|
|
302
|
+
}>;
|
|
303
|
+
}
|
|
304
|
+
declare function createControlplaneToolHandlers(deps: ControlplaneToolHandlersDeps): ControlplaneToolHandlers;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* server-runtime/controlplane-helpers.ts
|
|
308
|
+
*
|
|
309
|
+
* Pure helpers used by the runtime's controlplane MCP handlers. The handlers
|
|
310
|
+
* themselves still live in index.ts because they capture closure state; these
|
|
311
|
+
* utilities are stateless.
|
|
312
|
+
*/
|
|
313
|
+
|
|
314
|
+
declare function expectControlplaneSuccess<T>(result: CommandResult<T>, commandName: string): T;
|
|
315
|
+
declare function expectControlplaneSuccessAsync<T>(result: CommandResult<T> | Promise<CommandResult<T>>, commandName: string): Promise<T>;
|
|
316
|
+
declare function getCardMetaKey(args: Record<string, unknown>): string;
|
|
317
|
+
declare function readCardMetaValue(card: Record<string, unknown>, key: string): {
|
|
318
|
+
exists: boolean;
|
|
319
|
+
value: unknown;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* server-runtime/card-file-ops.ts
|
|
324
|
+
*
|
|
325
|
+
* Per-card file upload / metadata-merge orchestration extracted from
|
|
326
|
+
* createSingleBoardServerRuntime. The factory takes narrow callbacks for
|
|
327
|
+
* the small handful of closure-owned helpers (card-store reads,
|
|
328
|
+
* card-data writes, chat-record writes, artifact stores, file-metadata
|
|
329
|
+
* normaliser) and exposes the upload entry point plus its read helper.
|
|
330
|
+
*/
|
|
331
|
+
|
|
332
|
+
/** Subset of the per-card files artifact store consumed by file-ops. */
|
|
333
|
+
interface FilesArtifactsStoreLike {
|
|
334
|
+
putBytes(key: string, content: Uint8Array, contentType?: string): unknown | Promise<unknown>;
|
|
335
|
+
}
|
|
336
|
+
interface CardFileOpsDeps {
|
|
337
|
+
/** Sanitised card-id suitable for use as a storage prefix. */
|
|
338
|
+
safeCardId: (cardId: string) => string;
|
|
339
|
+
/** Returns the per-card artifact stores; `files` is the bytes sink. */
|
|
340
|
+
artifactsStores: (cardId: string) => {
|
|
341
|
+
files: FilesArtifactsStoreLike | null;
|
|
342
|
+
};
|
|
343
|
+
/** Card-file-metadata store wired against the runtime's persistence layer. */
|
|
344
|
+
cardFileMetadataStore: () => CardFileMetadataStore;
|
|
345
|
+
/** Read the persisted card from the store (used to count existing files). */
|
|
346
|
+
readCardFromStore: (cardId: string) => Promise<Record<string, unknown> | null>;
|
|
347
|
+
/** Apply a local-only update to a card; same shape as updateCardLocalOnly. */
|
|
348
|
+
updateCardLocalOnly: (cardId: string, updateFn: (card: Record<string, unknown>) => Record<string, unknown> | void) => Promise<void>;
|
|
349
|
+
/** Append a chat record (used for in-chat upload announcements). */
|
|
350
|
+
writeChatRecord: (cardId: string, role: string, text: string, files: unknown[], turnId: string) => unknown;
|
|
351
|
+
}
|
|
352
|
+
interface CardFileOps {
|
|
353
|
+
uploadCardFile: (cardId: string, requestedName: string, contentType: string, buffer: Uint8Array, opts?: {
|
|
354
|
+
inChat?: boolean;
|
|
355
|
+
turnId?: string;
|
|
356
|
+
suppressChatRecordWrite?: boolean;
|
|
357
|
+
}) => Promise<{
|
|
358
|
+
ok: true;
|
|
359
|
+
file: Record<string, unknown>;
|
|
360
|
+
}>;
|
|
361
|
+
readCardStoredFileNames: (cardId: string) => Promise<string[]>;
|
|
362
|
+
}
|
|
363
|
+
declare function createCardFileOps(deps: CardFileOpsDeps): CardFileOps;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* server-runtime/internal-helpers.ts
|
|
367
|
+
*
|
|
368
|
+
* Small, pure helpers shared across the server-runtime slices. No closure
|
|
369
|
+
* state, no I/O. Anything that depends on runtime state belongs in a slice
|
|
370
|
+
* module, not here.
|
|
371
|
+
*/
|
|
372
|
+
|
|
373
|
+
declare function isAsyncBoardPlatformAdapter(adapter: BoardRuntimePlatformAdapter): adapter is AsyncBoardPlatformAdapter;
|
|
374
|
+
declare function executionWhatToRunValue(ref: ExecutionRef): string;
|
|
375
|
+
declare function escapeRegExp(str: string): string;
|
|
376
|
+
declare function concatUint8Arrays(arrays: Uint8Array[]): Uint8Array;
|
|
377
|
+
|
|
378
|
+
export { AsyncBoardPlatformAdapter, BoardRuntimePlatformAdapter, CommandResult, ExecutionRef, type McpFacadeBoardContextLike, type McpFacadeDeps, type McpFacadeModule, type McpToolHandler, type McpToolRegistry, type NotificationState, type RuntimePayloadBoardContext, type RuntimePayloadDeps, type RuntimePayloadModule, appendNotification, concatUint8Arrays, createCardFileOps, createControlplaneToolHandlers, createMcpFacadeModule, createRuntimePayloadModule, escapeRegExp, executionWhatToRunValue, expectControlplaneSuccess, expectControlplaneSuccessAsync, extractMcpFailureMessage, getCardMetaKey, getMcpArgNumber, getMcpArgRecord, getMcpArgString, getRequiredMcpArgNumber, getRequiredMcpArgRecord, hasNonEmptyCardCountStatus, invokeMcpTool, isAsyncBoardPlatformAdapter, makeNotificationState, parseMcpUploadBytes, readCardMetaValue };
|