yaml-flow 8.8.7 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/adapters/firestore-storage.js +2 -2
- package/browser/adapters/localstorage-storage.js +3 -3
- package/browser/asset-integrity.json +7 -7
- package/browser/server-runtime-controlface.js +5 -5
- package/examples/board/test/server-http-test-browser.ts +2394 -0
- package/examples/board/test/server-http-test.js +44 -35
- package/lib/{artifacts-store-lib-C6qBpMfU.d.cts → artifacts-store-lib-CqkJEgbx.d.cts} +1 -1
- package/lib/{artifacts-store-lib-D4qf7Q-7.d.ts → artifacts-store-lib-D6Bo4yFN.d.ts} +1 -1
- package/lib/artifacts-store-public.d.cts +5 -3
- package/lib/artifacts-store-public.d.ts +5 -3
- package/lib/board-callback-transport-Bekq8Gp-.d.ts +71 -0
- package/lib/board-callback-transport-kP0K6UMq.d.cts +71 -0
- package/lib/board-live-cards-lib-DVh3t9NT.d.cts +222 -0
- package/lib/board-live-cards-lib-iU8xOwNp.d.ts +222 -0
- package/lib/board-live-cards-mcp.cjs +1 -1
- package/lib/board-live-cards-mcp.d.cts +4 -8
- package/lib/board-live-cards-mcp.d.ts +4 -8
- package/lib/board-live-cards-mcp.js +1 -1
- package/lib/board-live-cards-node.cjs +7 -7
- package/lib/board-live-cards-node.d.cts +15 -11
- package/lib/board-live-cards-node.d.ts +15 -11
- package/lib/board-live-cards-node.js +7 -7
- package/lib/{board-live-cards-public-async-CYjr4mgX.d.cts → board-live-cards-public-async-Cl0M3j5P.d.cts} +6 -4
- package/lib/{board-live-cards-public-async-DlyC3PgC.d.ts → board-live-cards-public-async-U98IXUBx.d.ts} +6 -4
- package/lib/board-live-cards-public.cjs +1 -1
- package/lib/board-live-cards-public.d.cts +325 -3
- package/lib/board-live-cards-public.d.ts +325 -3
- 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 +8 -6
- package/lib/board-live-cards-server-runtime.d.ts +8 -6
- package/lib/board-live-cards-server-runtime.js +1 -1
- package/lib/{board-platform-adapter-async-JP9V-U5E.d.ts → board-platform-adapter-async-ByBRFn1G.d.ts} +4 -3
- package/lib/{board-platform-adapter-async-BZIftm36.d.cts → board-platform-adapter-async-DjBwE0m9.d.cts} +4 -3
- package/lib/board-state-reducer.cjs +2 -0
- package/lib/board-state-reducer.d.cts +53 -0
- package/lib/board-state-reducer.d.ts +53 -0
- package/lib/board-state-reducer.js +2 -0
- package/lib/card-store-public.cjs +1 -1
- package/lib/card-store-public.d.cts +11 -4
- package/lib/card-store-public.d.ts +11 -4
- package/lib/card-store-public.js +1 -1
- package/lib/chat-store-public.cjs +1 -1
- package/lib/chat-store-public.d.cts +15 -4
- package/lib/chat-store-public.d.ts +15 -4
- package/lib/chat-store-public.js +1 -1
- package/lib/chunk-2RIHC5TZ.cjs +2 -0
- package/lib/chunk-37FDOKDK.js +3 -0
- package/lib/chunk-3S7LV2HZ.cjs +2 -0
- package/lib/chunk-3T5TMAWG.cjs +3 -0
- package/lib/chunk-5XLFPPTY.cjs +2 -0
- package/lib/{chunk-R44X3RQB.cjs → chunk-6EJRZHFP.cjs} +2 -2
- package/lib/{chunk-NNSBBO5R.js → chunk-6MD6FVE3.js} +2 -2
- package/lib/chunk-7QNEV5S3.js +2 -0
- package/lib/{chunk-6OPXQPSC.js → chunk-7UJQMFVS.js} +2 -2
- package/lib/chunk-BJGK5FNL.js +2 -0
- package/lib/{chunk-ETW3BXHD.cjs → chunk-BQJVCCFU.cjs} +2 -2
- package/lib/chunk-DQPBAB5Z.cjs +2 -0
- package/lib/chunk-JB4Q2W7I.js +7 -0
- package/lib/chunk-JYVYAAXT.js +3 -0
- package/lib/chunk-LFVMX23W.cjs +7 -0
- package/lib/chunk-NIBLKYXN.js +2 -0
- package/lib/chunk-OF4FPYNI.cjs +2 -0
- package/lib/chunk-P3R6TXII.js +3 -0
- package/lib/{chunk-7BTZCOT5.js → chunk-QLB6PKOT.js} +2 -2
- package/lib/chunk-R4YASXSJ.js +2 -0
- package/lib/chunk-RZRIXQ6A.cjs +3 -0
- package/lib/chunk-SDJ3747Q.cjs +2 -0
- package/lib/chunk-SJANU3PL.cjs +3 -0
- package/lib/chunk-UGB7PC4P.js +2 -0
- package/lib/chunk-VBYNMTWC.js +2 -0
- package/lib/{chunk-37HDEW26.cjs → chunk-WRMOGPRG.cjs} +2 -2
- package/lib/cloud-storage.cjs +1 -1
- package/lib/cloud-storage.d.cts +44 -8
- package/lib/cloud-storage.d.ts +44 -8
- package/lib/cloud-storage.js +1 -1
- package/lib/firebase-storage/index.d.cts +2 -2
- package/lib/firebase-storage/index.d.ts +2 -2
- package/lib/firestore-storage/index.cjs +2 -2
- package/lib/firestore-storage/index.d.cts +6 -5
- package/lib/firestore-storage/index.d.ts +6 -5
- package/lib/firestore-storage/index.js +2 -2
- package/lib/index.cjs +2 -2
- package/lib/index.d.cts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/localstorage-storage/index.cjs +1 -1
- package/lib/localstorage-storage/index.d.cts +6 -5
- package/lib/localstorage-storage/index.d.ts +6 -5
- package/lib/localstorage-storage/index.js +1 -1
- package/lib/notification-consumer/index.cjs +2 -0
- package/lib/notification-consumer/index.d.cts +17 -0
- package/lib/notification-consumer/index.d.ts +17 -0
- package/lib/notification-consumer/index.js +2 -0
- package/lib/queue-storage-public.cjs +2 -0
- package/lib/queue-storage-public.d.cts +13 -0
- package/lib/queue-storage-public.d.ts +13 -0
- package/lib/queue-storage-public.js +2 -0
- package/lib/server-jobs-queue-runner/index.cjs +1 -1
- package/lib/server-jobs-queue-runner/index.d.cts +9 -7
- package/lib/server-jobs-queue-runner/index.d.ts +9 -7
- package/lib/server-jobs-queue-runner/index.js +1 -1
- package/lib/server-runtime/index.cjs +1 -1
- package/lib/server-runtime/index.d.cts +9 -7
- package/lib/server-runtime/index.d.ts +9 -7
- package/lib/server-runtime/index.js +1 -1
- package/lib/server-runtime-agentface/index.d.cts +8 -6
- package/lib/server-runtime-agentface/index.d.ts +8 -6
- package/lib/server-runtime-controlface/index.cjs +1 -1
- package/lib/server-runtime-controlface/index.d.cts +8 -6
- package/lib/server-runtime-controlface/index.d.ts +8 -6
- package/lib/server-runtime-controlface/index.js +1 -1
- package/lib/server-runtime-core/index.cjs +1 -1
- package/lib/server-runtime-core/index.d.cts +16 -37
- package/lib/server-runtime-core/index.d.ts +16 -37
- package/lib/server-runtime-core/index.js +1 -1
- package/lib/server-runtime-watchers/index.cjs +1 -1
- package/lib/server-runtime-watchers/index.d.cts +11 -8
- package/lib/server-runtime-watchers/index.d.ts +11 -8
- package/lib/server-runtime-watchers/index.js +1 -1
- package/lib/server-runtime-webhooks/index.d.cts +8 -6
- package/lib/server-runtime-webhooks/index.d.ts +8 -6
- package/lib/{sse-hub-DM8bw-dO.d.ts → sse-hub-BRBvymHR.d.cts} +18 -15
- package/lib/{sse-hub-BDjWI7JR.d.cts → sse-hub-D_94fV87.d.ts} +18 -15
- package/lib/step-machine-public/index.d.cts +1 -1
- package/lib/step-machine-public/index.d.ts +1 -1
- package/lib/{storage-async-interface-CyO-zwVQ.d.cts → storage-async-interface-CLOXiqwC.d.cts} +2 -2
- package/lib/{storage-async-interface-CG0bMqvE.d.ts → storage-async-interface-Cb-SULrI.d.ts} +2 -2
- package/lib/{storage-interface-D-iEiTJA.d.cts → storage-interface-DogVPooM.d.cts} +1 -1
- package/lib/{storage-interface-D-iEiTJA.d.ts → storage-interface-DogVPooM.d.ts} +1 -1
- package/lib/stores/index.d.cts +1 -1
- package/lib/stores/index.d.ts +1 -1
- package/lib/stores/kv.d.cts +1 -1
- package/lib/stores/kv.d.ts +1 -1
- package/lib/{types-BsfXZyI3.d.ts → types-BsqzUZNl.d.ts} +6 -4
- package/lib/{types-CPnYv7RC.d.cts → types-DxhB6Toz.d.cts} +6 -4
- package/package.json +16 -1
- package/lib/board-live-cards-public-BT5HrgqZ.d.cts +0 -529
- package/lib/board-live-cards-public-DSRamFm8.d.ts +0 -529
- package/lib/chunk-35N7ONTH.js +0 -2
- package/lib/chunk-36QUKFL7.cjs +0 -3
- package/lib/chunk-3MMTBEAO.js +0 -2
- package/lib/chunk-7QQFDYBM.js +0 -3
- package/lib/chunk-7QZ267XP.cjs +0 -2
- package/lib/chunk-ABAVFLDP.js +0 -7
- package/lib/chunk-EPCJYP4N.js +0 -3
- package/lib/chunk-H22NK6KH.cjs +0 -7
- package/lib/chunk-KBELAKIY.js +0 -2
- package/lib/chunk-OJ2CAQ4C.cjs +0 -2
- package/lib/chunk-Q3OTUDIE.js +0 -2
- package/lib/chunk-QG6ERLZQ.cjs +0 -3
- package/lib/chunk-UB54HZA4.cjs +0 -2
- package/lib/chunk-YMEIPKLW.cjs +0 -2
- package/lib/chunk-ZENTBLLA.cjs +0 -3
- package/lib/chunk-ZWVT24YW.js +0 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkRZRIXQ6A_cjs=require('./chunk-RZRIXQ6A.cjs');require('./chunk-LFVMX23W.cjs'),require('./chunk-NM6O35RY.cjs'),require('./chunk-NBJTYAYN.cjs'),require('./chunk-3S7LV2HZ.cjs');var chunkBQJVCCFU_cjs=require('./chunk-BQJVCCFU.cjs');require('./chunk-BQUQTOPB.cjs'),require('./chunk-GPCMBPLK.cjs'),require('./chunk-7FGPOGRV.cjs'),require('./chunk-LPXVVMQT.cjs'),require('./chunk-272IYUKT.cjs'),require('./chunk-3T5TMAWG.cjs'),require('./chunk-WRMOGPRG.cjs'),require('./chunk-SJANU3PL.cjs'),require('./chunk-7JVHYHT2.cjs'),require('./chunk-VQCIOKJV.cjs'),require('./chunk-G4XXRHL2.cjs'),require('./chunk-LODXIALE.cjs'),require('./chunk-DQPBAB5Z.cjs'),require('./chunk-IXZG74EW.cjs'),require('./chunk-HWYMZK3N.cjs'),require('./chunk-UJ7ZTV4J.cjs'),require('./chunk-5XLFPPTY.cjs'),require('./chunk-SDJ3747Q.cjs'),require('./chunk-OF4FPYNI.cjs'),require('./chunk-2RIHC5TZ.cjs'),require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"createMultiBoardServerRuntime",{enumerable:true,get:function(){return chunkRZRIXQ6A_cjs.b}});Object.defineProperty(exports,"createSingleBoardServerRuntime",{enumerable:true,get:function(){return chunkRZRIXQ6A_cjs.a}});Object.defineProperty(exports,"createHostedBoardQueueLaneRegistry",{enumerable:true,get:function(){return chunkBQJVCCFU_cjs.a}});//# sourceMappingURL=board-live-cards-server-runtime.cjs.map
|
|
2
2
|
//# sourceMappingURL=board-live-cards-server-runtime.cjs.map
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
export { A as Awaitable, B as BoardContextConfig, c as BoardRuntimeNonCorePublic, d as BoardRuntimePlatformAdapter, e as BoardRuntimePublic, f as BoardWorkerRequest, 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, g as RuntimeRequest, h as RuntimeResponse, b as SingleBoardRuntime, S as SingleBoardRuntimeOptions } from './types-
|
|
1
|
+
export { A as Awaitable, B as BoardContextConfig, c as BoardRuntimeNonCorePublic, d as BoardRuntimePlatformAdapter, e as BoardRuntimePublic, f as BoardWorkerRequest, 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, g as RuntimeRequest, h as RuntimeResponse, b as SingleBoardRuntime, S as SingleBoardRuntimeOptions } from './types-DxhB6Toz.cjs';
|
|
2
2
|
export { HostedBoardQueueLaneRegistryOptions, createHostedBoardQueueLaneRegistry } from './server-jobs-queue-runner/index.cjs';
|
|
3
|
-
export { A as AsyncBoardLiveCardsPublic } from './board-live-cards-public-async-
|
|
4
|
-
export { A as AsyncBoardPlatformAdapter } from './board-platform-adapter-async-
|
|
5
|
-
export { B as BlobStorage, K as KVStorage, a as KindValueRef } from './storage-interface-
|
|
6
|
-
export { B as BoardChangeNotification
|
|
3
|
+
export { A as AsyncBoardLiveCardsPublic } from './board-live-cards-public-async-Cl0M3j5P.cjs';
|
|
4
|
+
export { A as AsyncBoardPlatformAdapter } from './board-platform-adapter-async-DjBwE0m9.cjs';
|
|
5
|
+
export { B as BlobStorage, K as KVStorage, a as KindValueRef } from './storage-interface-DogVPooM.cjs';
|
|
6
|
+
export { B as BoardChangeNotification } from './board-live-cards-lib-DVh3t9NT.cjs';
|
|
7
|
+
export { BoardLiveCardsPublic, BoardNonCorePlatformAdapter, BoardPlatformAdapter, CommandInput, CommandResult } from './board-live-cards-public.cjs';
|
|
8
|
+
export { C as ChatStorage } from './board-callback-transport-kP0K6UMq.cjs';
|
|
7
9
|
export { ExecutionRef } from './execution-refs.cjs';
|
|
8
10
|
export { createMultiBoardServerRuntime, createSingleBoardServerRuntime } from './server-runtime/index.cjs';
|
|
9
11
|
import './queue-lane-registry-PaZuFpwp.cjs';
|
|
10
|
-
import './storage-async-interface-CyO-zwVQ.cjs';
|
|
11
12
|
import './types-BBhqYGhE.cjs';
|
|
13
|
+
import './storage-async-interface-CLOXiqwC.cjs';
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
export { A as Awaitable, B as BoardContextConfig, c as BoardRuntimeNonCorePublic, d as BoardRuntimePlatformAdapter, e as BoardRuntimePublic, f as BoardWorkerRequest, 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, g as RuntimeRequest, h as RuntimeResponse, b as SingleBoardRuntime, S as SingleBoardRuntimeOptions } from './types-
|
|
1
|
+
export { A as Awaitable, B as BoardContextConfig, c as BoardRuntimeNonCorePublic, d as BoardRuntimePlatformAdapter, e as BoardRuntimePublic, f as BoardWorkerRequest, 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, g as RuntimeRequest, h as RuntimeResponse, b as SingleBoardRuntime, S as SingleBoardRuntimeOptions } from './types-BsqzUZNl.js';
|
|
2
2
|
export { HostedBoardQueueLaneRegistryOptions, createHostedBoardQueueLaneRegistry } from './server-jobs-queue-runner/index.js';
|
|
3
|
-
export { A as AsyncBoardLiveCardsPublic } from './board-live-cards-public-async-
|
|
4
|
-
export { A as AsyncBoardPlatformAdapter } from './board-platform-adapter-async-
|
|
5
|
-
export { B as BlobStorage, K as KVStorage, a as KindValueRef } from './storage-interface-
|
|
6
|
-
export { B as BoardChangeNotification
|
|
3
|
+
export { A as AsyncBoardLiveCardsPublic } from './board-live-cards-public-async-U98IXUBx.js';
|
|
4
|
+
export { A as AsyncBoardPlatformAdapter } from './board-platform-adapter-async-ByBRFn1G.js';
|
|
5
|
+
export { B as BlobStorage, K as KVStorage, a as KindValueRef } from './storage-interface-DogVPooM.js';
|
|
6
|
+
export { B as BoardChangeNotification } from './board-live-cards-lib-iU8xOwNp.js';
|
|
7
|
+
export { BoardLiveCardsPublic, BoardNonCorePlatformAdapter, BoardPlatformAdapter, CommandInput, CommandResult } from './board-live-cards-public.js';
|
|
8
|
+
export { C as ChatStorage } from './board-callback-transport-Bekq8Gp-.js';
|
|
7
9
|
export { ExecutionRef } from './execution-refs.js';
|
|
8
10
|
export { createMultiBoardServerRuntime, createSingleBoardServerRuntime } from './server-runtime/index.js';
|
|
9
11
|
import './queue-lane-registry-PaZuFpwp.js';
|
|
10
|
-
import './storage-async-interface-CG0bMqvE.js';
|
|
11
12
|
import './types-BBhqYGhE.js';
|
|
13
|
+
import './storage-async-interface-Cb-SULrI.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{b as createMultiBoardServerRuntime,a as createSingleBoardServerRuntime}from'./chunk-
|
|
1
|
+
export{b as createMultiBoardServerRuntime,a as createSingleBoardServerRuntime}from'./chunk-37FDOKDK.js';import'./chunk-JB4Q2W7I.js';import'./chunk-XYN5D3GL.js';import'./chunk-O5UYCGIN.js';import'./chunk-R4YASXSJ.js';export{a as createHostedBoardQueueLaneRegistry}from'./chunk-7UJQMFVS.js';import'./chunk-FOFGEABN.js';import'./chunk-RKKSVOP2.js';import'./chunk-NTICU4OK.js';import'./chunk-O7NOHKVR.js';import'./chunk-ZJ5M5COT.js';import'./chunk-JYVYAAXT.js';import'./chunk-6MD6FVE3.js';import'./chunk-P3R6TXII.js';import'./chunk-ANKA7HEJ.js';import'./chunk-44L64VQ2.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';import'./chunk-VBYNMTWC.js';import'./chunk-JMDHDY6M.js';import'./chunk-3KC6LBOG.js';import'./chunk-MNEOJWPS.js';import'./chunk-7QNEV5S3.js';import'./chunk-BJGK5FNL.js';import'./chunk-NIBLKYXN.js';import'./chunk-UGB7PC4P.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=board-live-cards-server-runtime.js.map
|
|
2
2
|
//# sourceMappingURL=board-live-cards-server-runtime.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as BoardChangeNotification } from './board-live-cards-lib-iU8xOwNp.js';
|
|
2
|
+
import { C as ChatStorage, B as BoardCallbackTransport } from './board-callback-transport-Bekq8Gp-.js';
|
|
2
3
|
import { ExecutionRef } from './execution-refs.js';
|
|
3
|
-
import { a as KindValueRef } from './storage-interface-
|
|
4
|
-
import {
|
|
4
|
+
import { a as KindValueRef } from './storage-interface-DogVPooM.js';
|
|
5
|
+
import { A as AsyncKVStorage, a as AsyncBlobStorage, b as AsyncQueueStorage, c as AsyncScratchStorage, d as AsyncArchiveFactory, e as AsyncJournalStorage, f as AsyncAtomicRelayLock } from './storage-async-interface-Cb-SULrI.js';
|
|
5
6
|
|
|
6
7
|
interface AsyncBoardWorkerRequest {
|
|
7
8
|
boardId?: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as BoardChangeNotification } from './board-live-cards-lib-DVh3t9NT.cjs';
|
|
2
|
+
import { C as ChatStorage, B as BoardCallbackTransport } from './board-callback-transport-kP0K6UMq.cjs';
|
|
2
3
|
import { ExecutionRef } from './execution-refs.cjs';
|
|
3
|
-
import { a as KindValueRef } from './storage-interface-
|
|
4
|
-
import {
|
|
4
|
+
import { a as KindValueRef } from './storage-interface-DogVPooM.cjs';
|
|
5
|
+
import { A as AsyncKVStorage, a as AsyncBlobStorage, b as AsyncQueueStorage, c as AsyncScratchStorage, d as AsyncArchiveFactory, e as AsyncJournalStorage, f as AsyncAtomicRelayLock } from './storage-async-interface-CLOXiqwC.cjs';
|
|
5
6
|
|
|
6
7
|
interface AsyncBoardWorkerRequest {
|
|
7
8
|
boardId?: string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunk2RIHC5TZ_cjs=require('./chunk-2RIHC5TZ.cjs');require('./chunk-GNFE24S7.cjs');function k(a){return JSON.parse(JSON.stringify(a))}function v(a,o){if(a===o)return a;try{if(JSON.stringify(a)===JSON.stringify(o))return a}catch{}return o}function m(a,o){if(a===o)return true;try{return JSON.stringify(a)===JSON.stringify(o)}catch{return false}}function B(a){return a==="running"||a==="in-progress"?"loading":a==="failed"?"error":"fresh"}function S(a,o,h){let C=a,l=(C&&Array.isArray(C.cardDefinitions)?C.cardDefinitions:[]).map(d=>d.id),f=o&&o.modelsById||{},_={};for(let d of l){let p=h(a,d),t=f[d];if(!t){_[d]=p;continue}let r=p.card_chats!=null?v(t.card_chats,p.card_chats??null):t.card_chats??null,e={id:p.id,card:v(t.card,p.card),card_data:v(t.card_data,p.card_data),requires:v(t.requires,p.requires),computed_values:v(t.computed_values,p.computed_values),runtime_state:v(t.runtime_state,p.runtime_state),card_chats:r};_[d]=e.card===t.card&&e.card_data===t.card_data&&e.requires===t.requires&&e.computed_values===t.computed_values&&e.runtime_state===t.runtime_state&&e.card_chats===t.card_chats?t:e;}let u=o?.cardWatchParties||{},g=Object.fromEntries(l.filter(d=>Object.prototype.hasOwnProperty.call(u,d)).map(d=>[d,u[d]]));return {payload:a,cardIds:l,modelsById:_,cardWatchParties:g}}function q(a,o={}){if(!a)return a;let h=typeof o.includeCard=="function"?o.includeCard:(()=>true),C=typeof o.mapCard=="function"?o.mapCard:(u=>u),c=false,l=[],f={};for(let u of a.cardIds){let g=a.modelsById[u];if(!g){c=true;continue}if(!h(g,a)){c=true;continue}let d=C(g,a);if(!d||d.id!==u)throw new Error(`deriveBoardState: mapped card must preserve id "${u}"`);d!==g&&(c=true),l.push(u),f[u]=d;}let _=typeof o.mapPayload=="function"?o.mapPayload(a.payload,{sourceState:a,cardIds:l,modelsById:f}):a.payload;return _!==a.payload&&(c=true),!c&&l.length===a.cardIds.length?a:{payload:_,cardIds:l,modelsById:f,cardWatchParties:a.cardWatchParties}}function x(a,o,h,C){if(!a||!Array.isArray(o)||o.length===0)return a;let c=a.modelsById,l=a.cardIds,f=a.cardWatchParties||{},_=false,u=false,g={};for(let t of l){let r=c[t],e=r&&r.requires;if(e&&typeof e=="object")for(let s of Object.keys(e))(g[s]=g[s]||[]).push(t);}function d(){_||(c={...c},_=true);}function p(t){if(t.kind!=="card_watchparty"||!t.cardId||!t.channel)return;let r=f[t.cardId]||{},e=Array.isArray(r[t.channel])?r[t.channel]:[],s=e;if(t.clear){if(e.length===0)return;s=[];}else if(t.replace){let i=Number.isFinite(Number(t.sentAtMs))?Number(t.sentAtMs):0,n={payload:t.payload,ts:i};if(e.length===1&&e[0]?.ts===n.ts&&m(e[0]?.payload,n.payload))return;s=[n];}else {let i={payload:t.payload,ts:Number.isFinite(Number(t.sentAtMs))?Number(t.sentAtMs):0};s=[...e,i];}f={...f,[t.cardId]:{...r,[t.channel]:s}},u=true;}for(let t of o)if(!(!t||!t.kind)){if(t.kind==="card_watchparty"){p(t);continue}if(chunk2RIHC5TZ_cjs.c(t)){if(t.kind==="card_chats"){let r=t.cardId,e=c[r];if(!e)continue;let s=Array.isArray(t.messages)?t.messages:e.card_chats?.messages??[],i=typeof t.receiving=="boolean"?t.receiving:e.card_chats?.receiving??false,n=typeof t.processing=="boolean"?t.processing:e.card_chats?.processing??false,y={messages:s,receiving:i,processing:n};if(m(e.card_chats,y))continue;d(),c[r]={...e,card_chats:y},u=true;}else if(t.kind==="chat_messages"){let r=t.cardId,e=c[r];if(!e)continue;let s=Array.isArray(t.messages)?t.messages:[],i=e.card_chats||{receiving:false,processing:false},n={messages:s,receiving:i.receiving,processing:!!i.processing};if(m(e.card_chats,n))continue;d(),c[r]={...e,card_chats:n},u=true;}else if(t.kind==="chat_processing"){let r=t.cardId,e=c[r];if(!e)continue;let s=e.card_chats||{messages:[],receiving:false},i={messages:s.messages,receiving:s.receiving,processing:t.active===true};if(m(e.card_chats,i))continue;d(),c[r]={...e,card_chats:i},u=true;}continue}if(chunk2RIHC5TZ_cjs.b(t)){if(t.kind==="computed_values"){let r=t.cardId,e=c[r];if(!e)continue;let s=t.values||{};if(m(e.computed_values,s))continue;d(),c[r]={...e,computed_values:s},u=true;}else if(t.kind==="data_object"){let r=t.key,e=t.payload,s=g[r]||[];for(let i of s){let n=c[i];if(!n)continue;let y=n.requires||{};m(y[r],e)||(d(),c[i]={...n,requires:{...y,[r]:e}},u=true);}}else if(t.kind==="card_refreshed"){let r=t.cardId,e=null,s=c[r],i=t.card;if(s&&i&&typeof i=="object"&&!Array.isArray(i)){let n=i,y=n.card_data&&typeof n.card_data=="object"&&!Array.isArray(n.card_data)?n.card_data:s.card_data,b=n.requires&&typeof n.requires=="object"&&!Array.isArray(n.requires)?n.requires:s.requires,w=n.computed_values&&typeof n.computed_values=="object"&&!Array.isArray(n.computed_values)?n.computed_values:s.computed_values,A=n.runtime_state&&typeof n.runtime_state=="object"&&!Array.isArray(n.runtime_state)?n.runtime_state:s.runtime_state;e={...s,card:i,card_data:y,requires:b,computed_values:w,runtime_state:A};}if(!e)try{let n=C();n&&(e=h(n,r));}catch{}if(!e||s&&m(s.card,e.card)&&m(s.card_data,e.card_data)&&m(s.requires,e.requires)&&m(s.computed_values,e.computed_values)&&m(s.runtime_state,e.runtime_state))continue;d(),c[r]=e,l.includes(r)||(l=[...l,r]),u=true;}else if(t.kind==="card_removed"){let r=t.cardId;if(!c[r])continue;if(d(),delete c[r],l=l.filter(e=>e!==r),Object.prototype.hasOwnProperty.call(f,r)){let e={...f};delete e[r],f=e;}u=true;}else if(t.kind==="status"){let r=t.status?.cards??[];for(let e of r){let s=e?.name;if(!s||!c[s])continue;let i=c[s],n=B(e.status),y={...i.card_data||{},status:n,lastRun:e.runtime?.last_transition_at??null,...e.error?.message?{error:e.error.message}:{}};e.error?.message||delete y.error;let b={task_status:e.status??null,card_status:n,runtime:e.runtime?k(e.runtime):{},error:e.error?k(e.error):null,blocked_by:Array.isArray(e.blocked_by)?k(e.blocked_by):[],requires_missing:Array.isArray(e.requires_missing)?k(e.requires_missing):[]};m(i.card_data,y)&&m(i.runtime_state,b)||(d(),c[s]={...i,card_data:y,runtime_state:b},u=true);}}}}return u?{payload:a.payload,cardIds:l,modelsById:c,cardWatchParties:f}:a}exports.applyNotification=x;exports.buildBoardState=S;exports.deriveBoardState=q;//# sourceMappingURL=board-state-reducer.cjs.map
|
|
2
|
+
//# sourceMappingURL=board-state-reducer.cjs.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { c as NotificationChatMessage, R as RuntimeNotification } from './board-live-cards-lib-DVh3t9NT.cjs';
|
|
2
|
+
import './types-BBhqYGhE.cjs';
|
|
3
|
+
import './storage-interface-DogVPooM.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* board-state-reducer — shared reactive state helpers for browser board shells.
|
|
7
|
+
*
|
|
8
|
+
* Used by browser board shells and transport clients.
|
|
9
|
+
*
|
|
10
|
+
* Pure functions; no side effects; no DOM/localStorage/fetch dependencies.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
type CardChatMessage = NotificationChatMessage;
|
|
14
|
+
interface CardChatState {
|
|
15
|
+
messages: CardChatMessage[];
|
|
16
|
+
receiving: boolean;
|
|
17
|
+
processing?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface CardWatchPartyEvent {
|
|
20
|
+
payload: unknown;
|
|
21
|
+
ts: number;
|
|
22
|
+
}
|
|
23
|
+
type CardWatchPartyChannelState = Record<string, CardWatchPartyEvent[]>;
|
|
24
|
+
interface CardModel {
|
|
25
|
+
id: string;
|
|
26
|
+
card: unknown;
|
|
27
|
+
card_data: unknown;
|
|
28
|
+
requires: unknown;
|
|
29
|
+
computed_values: unknown;
|
|
30
|
+
runtime_state: unknown;
|
|
31
|
+
card_chats: CardChatState | null;
|
|
32
|
+
}
|
|
33
|
+
interface BoardState {
|
|
34
|
+
payload: unknown;
|
|
35
|
+
cardIds: string[];
|
|
36
|
+
modelsById: Record<string, CardModel>;
|
|
37
|
+
cardWatchParties: Record<string, CardWatchPartyChannelState>;
|
|
38
|
+
}
|
|
39
|
+
interface DeriveBoardStateOptions {
|
|
40
|
+
includeCard?: (model: CardModel, sourceState: BoardState) => boolean;
|
|
41
|
+
mapCard?: (model: CardModel, sourceState: BoardState) => CardModel;
|
|
42
|
+
mapPayload?: (payload: unknown, context: {
|
|
43
|
+
sourceState: BoardState;
|
|
44
|
+
cardIds: string[];
|
|
45
|
+
modelsById: Record<string, CardModel>;
|
|
46
|
+
}) => unknown;
|
|
47
|
+
}
|
|
48
|
+
type SelectLiveCardModelFn = (payload: unknown, cardId: string) => CardModel;
|
|
49
|
+
declare function buildBoardState(payload: unknown, prevState: BoardState | null, selectLiveCardModel: SelectLiveCardModelFn): BoardState;
|
|
50
|
+
declare function deriveBoardState(sourceState: BoardState, options?: DeriveBoardStateOptions): BoardState;
|
|
51
|
+
declare function applyNotification(prevState: BoardState, notifications: RuntimeNotification[], selectLiveCardModel: SelectLiveCardModelFn, getFullPayload: () => unknown): BoardState;
|
|
52
|
+
|
|
53
|
+
export { type BoardState, type CardChatMessage, type CardChatState, type CardModel, type DeriveBoardStateOptions, type SelectLiveCardModelFn, applyNotification, buildBoardState, deriveBoardState };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { c as NotificationChatMessage, R as RuntimeNotification } from './board-live-cards-lib-iU8xOwNp.js';
|
|
2
|
+
import './types-BBhqYGhE.js';
|
|
3
|
+
import './storage-interface-DogVPooM.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* board-state-reducer — shared reactive state helpers for browser board shells.
|
|
7
|
+
*
|
|
8
|
+
* Used by browser board shells and transport clients.
|
|
9
|
+
*
|
|
10
|
+
* Pure functions; no side effects; no DOM/localStorage/fetch dependencies.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
type CardChatMessage = NotificationChatMessage;
|
|
14
|
+
interface CardChatState {
|
|
15
|
+
messages: CardChatMessage[];
|
|
16
|
+
receiving: boolean;
|
|
17
|
+
processing?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface CardWatchPartyEvent {
|
|
20
|
+
payload: unknown;
|
|
21
|
+
ts: number;
|
|
22
|
+
}
|
|
23
|
+
type CardWatchPartyChannelState = Record<string, CardWatchPartyEvent[]>;
|
|
24
|
+
interface CardModel {
|
|
25
|
+
id: string;
|
|
26
|
+
card: unknown;
|
|
27
|
+
card_data: unknown;
|
|
28
|
+
requires: unknown;
|
|
29
|
+
computed_values: unknown;
|
|
30
|
+
runtime_state: unknown;
|
|
31
|
+
card_chats: CardChatState | null;
|
|
32
|
+
}
|
|
33
|
+
interface BoardState {
|
|
34
|
+
payload: unknown;
|
|
35
|
+
cardIds: string[];
|
|
36
|
+
modelsById: Record<string, CardModel>;
|
|
37
|
+
cardWatchParties: Record<string, CardWatchPartyChannelState>;
|
|
38
|
+
}
|
|
39
|
+
interface DeriveBoardStateOptions {
|
|
40
|
+
includeCard?: (model: CardModel, sourceState: BoardState) => boolean;
|
|
41
|
+
mapCard?: (model: CardModel, sourceState: BoardState) => CardModel;
|
|
42
|
+
mapPayload?: (payload: unknown, context: {
|
|
43
|
+
sourceState: BoardState;
|
|
44
|
+
cardIds: string[];
|
|
45
|
+
modelsById: Record<string, CardModel>;
|
|
46
|
+
}) => unknown;
|
|
47
|
+
}
|
|
48
|
+
type SelectLiveCardModelFn = (payload: unknown, cardId: string) => CardModel;
|
|
49
|
+
declare function buildBoardState(payload: unknown, prevState: BoardState | null, selectLiveCardModel: SelectLiveCardModelFn): BoardState;
|
|
50
|
+
declare function deriveBoardState(sourceState: BoardState, options?: DeriveBoardStateOptions): BoardState;
|
|
51
|
+
declare function applyNotification(prevState: BoardState, notifications: RuntimeNotification[], selectLiveCardModel: SelectLiveCardModelFn, getFullPayload: () => unknown): BoardState;
|
|
52
|
+
|
|
53
|
+
export { type BoardState, type CardChatMessage, type CardChatState, type CardModel, type DeriveBoardStateOptions, type SelectLiveCardModelFn, applyNotification, buildBoardState, deriveBoardState };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {c,b}from'./chunk-UGB7PC4P.js';import'./chunk-FW4363Y4.js';function k(a){return JSON.parse(JSON.stringify(a))}function v(a,o){if(a===o)return a;try{if(JSON.stringify(a)===JSON.stringify(o))return a}catch{}return o}function m(a,o){if(a===o)return true;try{return JSON.stringify(a)===JSON.stringify(o)}catch{return false}}function B(a){return a==="running"||a==="in-progress"?"loading":a==="failed"?"error":"fresh"}function S(a,o,h){let C=a,l=(C&&Array.isArray(C.cardDefinitions)?C.cardDefinitions:[]).map(d=>d.id),f=o&&o.modelsById||{},_={};for(let d of l){let p=h(a,d),t=f[d];if(!t){_[d]=p;continue}let r=p.card_chats!=null?v(t.card_chats,p.card_chats??null):t.card_chats??null,e={id:p.id,card:v(t.card,p.card),card_data:v(t.card_data,p.card_data),requires:v(t.requires,p.requires),computed_values:v(t.computed_values,p.computed_values),runtime_state:v(t.runtime_state,p.runtime_state),card_chats:r};_[d]=e.card===t.card&&e.card_data===t.card_data&&e.requires===t.requires&&e.computed_values===t.computed_values&&e.runtime_state===t.runtime_state&&e.card_chats===t.card_chats?t:e;}let u=o?.cardWatchParties||{},g=Object.fromEntries(l.filter(d=>Object.prototype.hasOwnProperty.call(u,d)).map(d=>[d,u[d]]));return {payload:a,cardIds:l,modelsById:_,cardWatchParties:g}}function q(a,o={}){if(!a)return a;let h=typeof o.includeCard=="function"?o.includeCard:(()=>true),C=typeof o.mapCard=="function"?o.mapCard:(u=>u),c=false,l=[],f={};for(let u of a.cardIds){let g=a.modelsById[u];if(!g){c=true;continue}if(!h(g,a)){c=true;continue}let d=C(g,a);if(!d||d.id!==u)throw new Error(`deriveBoardState: mapped card must preserve id "${u}"`);d!==g&&(c=true),l.push(u),f[u]=d;}let _=typeof o.mapPayload=="function"?o.mapPayload(a.payload,{sourceState:a,cardIds:l,modelsById:f}):a.payload;return _!==a.payload&&(c=true),!c&&l.length===a.cardIds.length?a:{payload:_,cardIds:l,modelsById:f,cardWatchParties:a.cardWatchParties}}function x(a,o,h,C){if(!a||!Array.isArray(o)||o.length===0)return a;let c$1=a.modelsById,l=a.cardIds,f=a.cardWatchParties||{},_=false,u=false,g={};for(let t of l){let r=c$1[t],e=r&&r.requires;if(e&&typeof e=="object")for(let s of Object.keys(e))(g[s]=g[s]||[]).push(t);}function d(){_||(c$1={...c$1},_=true);}function p(t){if(t.kind!=="card_watchparty"||!t.cardId||!t.channel)return;let r=f[t.cardId]||{},e=Array.isArray(r[t.channel])?r[t.channel]:[],s=e;if(t.clear){if(e.length===0)return;s=[];}else if(t.replace){let i=Number.isFinite(Number(t.sentAtMs))?Number(t.sentAtMs):0,n={payload:t.payload,ts:i};if(e.length===1&&e[0]?.ts===n.ts&&m(e[0]?.payload,n.payload))return;s=[n];}else {let i={payload:t.payload,ts:Number.isFinite(Number(t.sentAtMs))?Number(t.sentAtMs):0};s=[...e,i];}f={...f,[t.cardId]:{...r,[t.channel]:s}},u=true;}for(let t of o)if(!(!t||!t.kind)){if(t.kind==="card_watchparty"){p(t);continue}if(c(t)){if(t.kind==="card_chats"){let r=t.cardId,e=c$1[r];if(!e)continue;let s=Array.isArray(t.messages)?t.messages:e.card_chats?.messages??[],i=typeof t.receiving=="boolean"?t.receiving:e.card_chats?.receiving??false,n=typeof t.processing=="boolean"?t.processing:e.card_chats?.processing??false,y={messages:s,receiving:i,processing:n};if(m(e.card_chats,y))continue;d(),c$1[r]={...e,card_chats:y},u=true;}else if(t.kind==="chat_messages"){let r=t.cardId,e=c$1[r];if(!e)continue;let s=Array.isArray(t.messages)?t.messages:[],i=e.card_chats||{receiving:false,processing:false},n={messages:s,receiving:i.receiving,processing:!!i.processing};if(m(e.card_chats,n))continue;d(),c$1[r]={...e,card_chats:n},u=true;}else if(t.kind==="chat_processing"){let r=t.cardId,e=c$1[r];if(!e)continue;let s=e.card_chats||{messages:[],receiving:false},i={messages:s.messages,receiving:s.receiving,processing:t.active===true};if(m(e.card_chats,i))continue;d(),c$1[r]={...e,card_chats:i},u=true;}continue}if(b(t)){if(t.kind==="computed_values"){let r=t.cardId,e=c$1[r];if(!e)continue;let s=t.values||{};if(m(e.computed_values,s))continue;d(),c$1[r]={...e,computed_values:s},u=true;}else if(t.kind==="data_object"){let r=t.key,e=t.payload,s=g[r]||[];for(let i of s){let n=c$1[i];if(!n)continue;let y=n.requires||{};m(y[r],e)||(d(),c$1[i]={...n,requires:{...y,[r]:e}},u=true);}}else if(t.kind==="card_refreshed"){let r=t.cardId,e=null,s=c$1[r],i=t.card;if(s&&i&&typeof i=="object"&&!Array.isArray(i)){let n=i,y=n.card_data&&typeof n.card_data=="object"&&!Array.isArray(n.card_data)?n.card_data:s.card_data,b=n.requires&&typeof n.requires=="object"&&!Array.isArray(n.requires)?n.requires:s.requires,w=n.computed_values&&typeof n.computed_values=="object"&&!Array.isArray(n.computed_values)?n.computed_values:s.computed_values,A=n.runtime_state&&typeof n.runtime_state=="object"&&!Array.isArray(n.runtime_state)?n.runtime_state:s.runtime_state;e={...s,card:i,card_data:y,requires:b,computed_values:w,runtime_state:A};}if(!e)try{let n=C();n&&(e=h(n,r));}catch{}if(!e||s&&m(s.card,e.card)&&m(s.card_data,e.card_data)&&m(s.requires,e.requires)&&m(s.computed_values,e.computed_values)&&m(s.runtime_state,e.runtime_state))continue;d(),c$1[r]=e,l.includes(r)||(l=[...l,r]),u=true;}else if(t.kind==="card_removed"){let r=t.cardId;if(!c$1[r])continue;if(d(),delete c$1[r],l=l.filter(e=>e!==r),Object.prototype.hasOwnProperty.call(f,r)){let e={...f};delete e[r],f=e;}u=true;}else if(t.kind==="status"){let r=t.status?.cards??[];for(let e of r){let s=e?.name;if(!s||!c$1[s])continue;let i=c$1[s],n=B(e.status),y={...i.card_data||{},status:n,lastRun:e.runtime?.last_transition_at??null,...e.error?.message?{error:e.error.message}:{}};e.error?.message||delete y.error;let b={task_status:e.status??null,card_status:n,runtime:e.runtime?k(e.runtime):{},error:e.error?k(e.error):null,blocked_by:Array.isArray(e.blocked_by)?k(e.blocked_by):[],requires_missing:Array.isArray(e.requires_missing)?k(e.requires_missing):[]};m(i.card_data,y)&&m(i.runtime_state,b)||(d(),c$1[s]={...i,card_data:y,runtime_state:b},u=true);}}}}return u?{payload:a.payload,cardIds:l,modelsById:c$1,cardWatchParties:f}:a}export{x as applyNotification,S as buildBoardState,q as deriveBoardState};//# sourceMappingURL=board-state-reducer.js.map
|
|
2
|
+
//# sourceMappingURL=board-state-reducer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk5XLFPPTY_cjs=require('./chunk-5XLFPPTY.cjs');require('./chunk-2RIHC5TZ.cjs'),require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"createCardStorePublic",{enumerable:true,get:function(){return chunk5XLFPPTY_cjs.a}});//# sourceMappingURL=card-store-public.cjs.map
|
|
2
2
|
//# sourceMappingURL=card-store-public.cjs.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { CommandInput, CommandResult } from './board-live-cards-public.cjs';
|
|
2
|
+
import { L as LiveCard, d as RuntimeNotificationBatch, h as NotificationEmitter, j as CardAdminStore } from './board-live-cards-lib-DVh3t9NT.cjs';
|
|
3
|
+
import './storage-interface-DogVPooM.cjs';
|
|
4
|
+
import './board-callback-transport-kP0K6UMq.cjs';
|
|
3
5
|
import './execution-refs.cjs';
|
|
4
6
|
import './types-BBhqYGhE.cjs';
|
|
5
7
|
|
|
@@ -31,6 +33,8 @@ interface CardStorePublic {
|
|
|
31
33
|
get(input: CommandInput): CommandResult<{
|
|
32
34
|
cards: LiveCard[];
|
|
33
35
|
}>;
|
|
36
|
+
/** Build a notification-batch snapshot from one card (params.id) or all cards. */
|
|
37
|
+
buildNotificationBatch(input: CommandInput): CommandResult<RuntimeNotificationBatch>;
|
|
34
38
|
/**
|
|
35
39
|
* Write cards into the store.
|
|
36
40
|
* body: single card object { id, ... } or an array of card objects.
|
|
@@ -67,6 +71,9 @@ interface CardStorePublic {
|
|
|
67
71
|
}>;
|
|
68
72
|
}>;
|
|
69
73
|
}
|
|
70
|
-
|
|
74
|
+
interface CardStorePublicOptions {
|
|
75
|
+
emitNotification?: NotificationEmitter;
|
|
76
|
+
}
|
|
77
|
+
declare function createCardStorePublic(store: CardAdminStore, options?: CardStorePublicOptions): CardStorePublic;
|
|
71
78
|
|
|
72
|
-
export { type CardStorePublic, createCardStorePublic };
|
|
79
|
+
export { type CardStorePublic, type CardStorePublicOptions, createCardStorePublic };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { CommandInput, CommandResult } from './board-live-cards-public.js';
|
|
2
|
+
import { L as LiveCard, d as RuntimeNotificationBatch, h as NotificationEmitter, j as CardAdminStore } from './board-live-cards-lib-iU8xOwNp.js';
|
|
3
|
+
import './storage-interface-DogVPooM.js';
|
|
4
|
+
import './board-callback-transport-Bekq8Gp-.js';
|
|
3
5
|
import './execution-refs.js';
|
|
4
6
|
import './types-BBhqYGhE.js';
|
|
5
7
|
|
|
@@ -31,6 +33,8 @@ interface CardStorePublic {
|
|
|
31
33
|
get(input: CommandInput): CommandResult<{
|
|
32
34
|
cards: LiveCard[];
|
|
33
35
|
}>;
|
|
36
|
+
/** Build a notification-batch snapshot from one card (params.id) or all cards. */
|
|
37
|
+
buildNotificationBatch(input: CommandInput): CommandResult<RuntimeNotificationBatch>;
|
|
34
38
|
/**
|
|
35
39
|
* Write cards into the store.
|
|
36
40
|
* body: single card object { id, ... } or an array of card objects.
|
|
@@ -67,6 +71,9 @@ interface CardStorePublic {
|
|
|
67
71
|
}>;
|
|
68
72
|
}>;
|
|
69
73
|
}
|
|
70
|
-
|
|
74
|
+
interface CardStorePublicOptions {
|
|
75
|
+
emitNotification?: NotificationEmitter;
|
|
76
|
+
}
|
|
77
|
+
declare function createCardStorePublic(store: CardAdminStore, options?: CardStorePublicOptions): CardStorePublic;
|
|
71
78
|
|
|
72
|
-
export { type CardStorePublic, createCardStorePublic };
|
|
79
|
+
export { type CardStorePublic, type CardStorePublicOptions, createCardStorePublic };
|
package/lib/card-store-public.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as createCardStorePublic}from'./chunk-
|
|
1
|
+
export{a as createCardStorePublic}from'./chunk-7QNEV5S3.js';import'./chunk-UGB7PC4P.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=card-store-public.js.map
|
|
2
2
|
//# sourceMappingURL=card-store-public.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkOF4FPYNI_cjs=require('./chunk-OF4FPYNI.cjs');require('./chunk-2RIHC5TZ.cjs'),require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"createChatStorePublic",{enumerable:true,get:function(){return chunkOF4FPYNI_cjs.a}});//# sourceMappingURL=chat-store-public.cjs.map
|
|
2
2
|
//# sourceMappingURL=chat-store-public.cjs.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { CommandInput, CommandResult } from './board-live-cards-public.cjs';
|
|
2
|
+
import { a as ChatRecord, b as ChatReadAfterResult, c as ChatConfig, C as ChatStorage } from './board-callback-transport-kP0K6UMq.cjs';
|
|
3
|
+
import { d as RuntimeNotificationBatch, h as NotificationEmitter } from './board-live-cards-lib-DVh3t9NT.cjs';
|
|
4
|
+
import './storage-interface-DogVPooM.cjs';
|
|
3
5
|
import './execution-refs.cjs';
|
|
4
6
|
import './types-BBhqYGhE.cjs';
|
|
5
7
|
|
|
@@ -57,6 +59,9 @@ type ChatStoreBatchResult = {
|
|
|
57
59
|
data?: unknown;
|
|
58
60
|
}>;
|
|
59
61
|
};
|
|
62
|
+
interface ChatStorePublicOptions {
|
|
63
|
+
emitNotification?: NotificationEmitter;
|
|
64
|
+
}
|
|
60
65
|
interface ChatStorePublic {
|
|
61
66
|
/**
|
|
62
67
|
* Append a message to a card's chat history.
|
|
@@ -76,6 +81,12 @@ interface ChatStorePublic {
|
|
|
76
81
|
readAll(input: CommandInput): Awaitable<CommandResult<{
|
|
77
82
|
records: ChatRecord[];
|
|
78
83
|
}>>;
|
|
84
|
+
/**
|
|
85
|
+
* Build the per-card chat subscription hydration batch.
|
|
86
|
+
* params.cardId: string
|
|
87
|
+
* body.receiving?: boolean
|
|
88
|
+
*/
|
|
89
|
+
buildSseOneShotBatch(input: CommandInput): Awaitable<CommandResult<RuntimeNotificationBatch>>;
|
|
79
90
|
/**
|
|
80
91
|
* Read messages appended after a cursor.
|
|
81
92
|
* params.cardId: string
|
|
@@ -131,6 +142,6 @@ interface ChatStorePublic {
|
|
|
131
142
|
*/
|
|
132
143
|
runBatch(envelope: ChatStoreCommandBatchEnvelope): Awaitable<CommandResult<ChatStoreBatchResult>>;
|
|
133
144
|
}
|
|
134
|
-
declare function createChatStorePublic(store: ChatStorage): ChatStorePublic;
|
|
145
|
+
declare function createChatStorePublic(store: ChatStorage, options?: ChatStorePublicOptions): ChatStorePublic;
|
|
135
146
|
|
|
136
|
-
export { type ChatStoreBatchResult, type ChatStoreCommandBatchEnvelope, type ChatStoreCommandEnvelope, type ChatStoreCommandName, type ChatStorePublic, createChatStorePublic };
|
|
147
|
+
export { type ChatStoreBatchResult, type ChatStoreCommandBatchEnvelope, type ChatStoreCommandEnvelope, type ChatStoreCommandName, type ChatStorePublic, type ChatStorePublicOptions, createChatStorePublic };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import './
|
|
1
|
+
import { CommandInput, CommandResult } from './board-live-cards-public.js';
|
|
2
|
+
import { a as ChatRecord, b as ChatReadAfterResult, c as ChatConfig, C as ChatStorage } from './board-callback-transport-Bekq8Gp-.js';
|
|
3
|
+
import { d as RuntimeNotificationBatch, h as NotificationEmitter } from './board-live-cards-lib-iU8xOwNp.js';
|
|
4
|
+
import './storage-interface-DogVPooM.js';
|
|
3
5
|
import './execution-refs.js';
|
|
4
6
|
import './types-BBhqYGhE.js';
|
|
5
7
|
|
|
@@ -57,6 +59,9 @@ type ChatStoreBatchResult = {
|
|
|
57
59
|
data?: unknown;
|
|
58
60
|
}>;
|
|
59
61
|
};
|
|
62
|
+
interface ChatStorePublicOptions {
|
|
63
|
+
emitNotification?: NotificationEmitter;
|
|
64
|
+
}
|
|
60
65
|
interface ChatStorePublic {
|
|
61
66
|
/**
|
|
62
67
|
* Append a message to a card's chat history.
|
|
@@ -76,6 +81,12 @@ interface ChatStorePublic {
|
|
|
76
81
|
readAll(input: CommandInput): Awaitable<CommandResult<{
|
|
77
82
|
records: ChatRecord[];
|
|
78
83
|
}>>;
|
|
84
|
+
/**
|
|
85
|
+
* Build the per-card chat subscription hydration batch.
|
|
86
|
+
* params.cardId: string
|
|
87
|
+
* body.receiving?: boolean
|
|
88
|
+
*/
|
|
89
|
+
buildSseOneShotBatch(input: CommandInput): Awaitable<CommandResult<RuntimeNotificationBatch>>;
|
|
79
90
|
/**
|
|
80
91
|
* Read messages appended after a cursor.
|
|
81
92
|
* params.cardId: string
|
|
@@ -131,6 +142,6 @@ interface ChatStorePublic {
|
|
|
131
142
|
*/
|
|
132
143
|
runBatch(envelope: ChatStoreCommandBatchEnvelope): Awaitable<CommandResult<ChatStoreBatchResult>>;
|
|
133
144
|
}
|
|
134
|
-
declare function createChatStorePublic(store: ChatStorage): ChatStorePublic;
|
|
145
|
+
declare function createChatStorePublic(store: ChatStorage, options?: ChatStorePublicOptions): ChatStorePublic;
|
|
135
146
|
|
|
136
|
-
export { type ChatStoreBatchResult, type ChatStoreCommandBatchEnvelope, type ChatStoreCommandEnvelope, type ChatStoreCommandName, type ChatStorePublic, createChatStorePublic };
|
|
147
|
+
export { type ChatStoreBatchResult, type ChatStoreCommandBatchEnvelope, type ChatStoreCommandEnvelope, type ChatStoreCommandName, type ChatStorePublic, type ChatStorePublicOptions, createChatStorePublic };
|
package/lib/chat-store-public.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as createChatStorePublic}from'./chunk-
|
|
1
|
+
export{a as createChatStorePublic}from'./chunk-NIBLKYXN.js';import'./chunk-UGB7PC4P.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=chat-store-public.js.map
|
|
2
2
|
//# sourceMappingURL=chat-store-public.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';function n(t){if(!t||typeof t!="object")return false;let e=t;return e.kind==="notification-batch"&&Array.isArray(e.notifications)}function r(t){let e=t.category??i(t.kind);return e==="board-output"||e==="card-store"}function c(t){let e=t.category??i(t.kind);return e==="chat-store"||e==="hosted-runtime"}function i(t){switch(t){case "computed_values":case "data_object":case "status":return "board-output";case "card_refreshed":case "card_removed":return "card-store";case "card_chats":case "chat_messages":return "chat-store";case "chat_processing":case "card_watchparty":return "hosted-runtime";case "message_enqueued":return "queue-storage"}}function o(t){return t.category?t:{...t,category:i(t.kind)}}function a(t){return t.map(e=>o(e))}function s(t){return {...t,category:t.category??"batch",notifications:a(t.notifications)}}exports.a=n;exports.b=r;exports.c=c;exports.d=i;exports.e=a;exports.f=s;//# sourceMappingURL=chunk-2RIHC5TZ.cjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-2RIHC5TZ.cjs.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {a,b}from'./chunk-JB4Q2W7I.js';import {a as a$3}from'./chunk-XYN5D3GL.js';import {a as a$6,c as c$2}from'./chunk-O5UYCGIN.js';import {p,j,k,l,c as c$1,d as d$1,m,n,e as e$1,a as a$8,b as b$3,o}from'./chunk-R4YASXSJ.js';import {a as a$4,d as d$2,b as b$2,c as c$3}from'./chunk-FOFGEABN.js';import {a as a$c}from'./chunk-RKKSVOP2.js';import {a as a$2}from'./chunk-NTICU4OK.js';import {a as a$9,c as c$4}from'./chunk-O7NOHKVR.js';import {a as a$a,b as b$4}from'./chunk-ZJ5M5COT.js';import {i,d,c,b as b$1,g,h}from'./chunk-JYVYAAXT.js';import {a as a$b}from'./chunk-6MD6FVE3.js';import {y,z,l as l$1}from'./chunk-P3R6TXII.js';import {a as a$5}from'./chunk-7QNEV5S3.js';import {a as a$7}from'./chunk-BJGK5FNL.js';import {a as a$1}from'./chunk-NIBLKYXN.js';import {e}from'./chunk-UGB7PC4P.js';function ce(R){let{apiBasePath:h,json:w,readJsonBody:L,initBoardAndSetup:F,bootstrapBoard:v,buildPublishedRuntimePayload:W,createMcpControlplaneToolRegistry:j,retriggerCard:M,applyCardAction:I,resolveChatHandlerTarget:E,sendCardFileDownloadResponse:$}=R;async function J(H,B,V){let l=H.method||"GET",A=V,u=A.pathname;try{if(l==="POST"&&u===`${h}/mcp-actions`){await v();let m=Date.now(),b=new Date(m).toISOString(),S=await L(H),f=typeof S.tool=="string"?S.tool.trim():"",T=S.args&&typeof S.args=="object"&&!Array.isArray(S.args)?S.args:{};if(!f)return w(B,400,{error:"tool is required"}),!0;let P=a$9(T,"card_id");if(!P)return w(B,400,{error:"MCP action requires card_id"}),!0;if(f==="retrigger-card"||f==="retrigger"){await M(P);let O=Date.now();return w(B,200,{status:"success",data:{ok:!0,cardId:P,actionType:f,requestReceivedAt:b,requestReceivedAtMs:m,responseSentAt:new Date(O).toISOString(),responseSentAtMs:O,responseStatus:200}}),!0}let g=c$4(T,"payload");if(f==="chat-send"&&!await E(P)){let O=Date.now();return w(B,409,{error:`chat handler is not configured for card: ${P}`,requestReceivedAt:b,requestReceivedAtMs:m,responseSentAt:new Date(O).toISOString(),responseSentAtMs:O,responseStatus:409}),!0}if(f==="chat-send"){let O=typeof g["turn-id"]=="string"?g["turn-id"]:typeof g.turnId=="string"?g.turnId:typeof g.turn=="string"?g.turn:"";if(!O||!String(O).trim()){let at=Date.now();return w(B,400,{error:`chat-send requires a non-empty 'turn-id' (or 'turnId'/'turn') in payload for card: ${P}`,requestReceivedAt:b,requestReceivedAtMs:m,responseSentAt:new Date(at).toISOString(),responseSentAtMs:at,responseStatus:400}),!0}}await I(P,f,g);let _=Date.now();return w(B,200,{status:"success",data:{ok:!0,cardId:P,actionType:f,requestReceivedAt:b,requestReceivedAtMs:m,responseSentAt:new Date(_).toISOString(),responseSentAtMs:_,responseStatus:200}}),!0}if(l==="POST"&&u===`${h}/mcp-controlplane`){await v();let m=await L(H),b=typeof m.tool=="string"?m.tool.trim():"",S=m.args&&typeof m.args=="object"&&!Array.isArray(m.args)?m.args:{};if(!b)return w(B,400,{error:"tool is required"}),!0;try{let f=await a$a(b,S,j());if(f&&typeof f=="object"&&!Array.isArray(f)){let T=f;if(T.status==="fail")return w(B,400,{error:b$4(f,"Request failed")}),!0;if(T.status==="error")return w(B,500,{error:b$4(f,"Internal error")}),!0}w(B,200,f);}catch(f){let T=typeof f?.statusCode=="number"?Number(f.statusCode):500,P=f instanceof Error?f.message:String(f);w(B,T,{error:P});}return !0}let k=u.match(new RegExp(`^${c$3(h)}/cards/([^/]+)/retrigger$`));if(l==="POST"&&k){await v();let m=decodeURIComponent(k[1]);return await M(m),w(B,200,{ok:!0}),!0}let x=u.match(new RegExp(`^${c$3(h)}/cards/([^/]+)/actions$`));if(l==="POST"&&x){await v();let m=decodeURIComponent(x[1]),b=Date.now(),S=new Date(b).toISOString(),f=await L(H),T=f?.actionType;if(T==="chat-send"&&!await E(m)){let g=Date.now();return w(B,409,{error:`chat handler is not configured for card: ${m}`,requestReceivedAt:S,requestReceivedAtMs:b,responseSentAt:new Date(g).toISOString(),responseSentAtMs:g,responseStatus:409}),!0}if(T==="chat-send"){let g=f?.payload??{},_=typeof g["turn-id"]=="string"?g["turn-id"]:typeof g.turnId=="string"?g.turnId:typeof g.turn=="string"?g.turn:"";if(!_||!String(_).trim()){let O=Date.now();return w(B,400,{error:`chat-send requires a non-empty 'turn-id' (or 'turnId'/'turn') in payload for card: ${m}`,requestReceivedAt:S,requestReceivedAtMs:b,responseSentAt:new Date(O).toISOString(),responseSentAtMs:O,responseStatus:400}),!0}}await I(m,T,f?.payload);let P=Date.now();return w(B,200,{ok:!0,requestReceivedAt:S,requestReceivedAtMs:b,responseSentAt:new Date(P).toISOString(),responseSentAtMs:P,responseStatus:200}),!0}let N=u.match(new RegExp(`^${c$3(h)}/cards/([^/]+)/files/(\\d+)$`));if(l==="GET"&&N){let m=decodeURIComponent(N[1]),b=parseInt(N[2],10),S=A.searchParams.get("sn");return await $(B,m,b,S),!0}return !1}catch(k){let x=k?.statusCode||500;return w(B,x,{error:String(k?.message||k)}),true}}return {handleRuntimeApi:J}}var ze=3e4;function Ke(R){let h=R.socket?.remoteAddress??"";return h==="127.0.0.1"||h==="::1"||h==="::ffff:127.0.0.1"}function ue(R){let{apiBasePath:h,emitNotifications:w,readJsonBody:L,json:F}=R,v=`${h}/notify-q`;async function W(j,M,I){if(I.pathname!==v)return false;if((j.method??"").toUpperCase()!=="POST")return F(M,405,{status:"error",error:"Method not allowed"}),true;if(!Ke(j))return F(M,403,{status:"error",error:"Forbidden"}),true;let E;try{E=await L(j);}catch{return F(M,400,{status:"error",error:"Invalid JSON body"}),true}if(!E||typeof E!="object"||!Array.isArray(E.notifications))return F(M,400,{status:"error",error:"body.notifications must be an array"}),true;let $=E.notifications,{accepted:J,rejected:H}=b$3($,Date.now(),ze);return J.length>0&&w(J),F(M,200,{status:"success",data:{accepted:J.length,rejected:H}}),true}return {handleNotifyRoute:W}}var le={"Access-Control-Allow-Origin":"*","Access-Control-Allow-Headers":"content-type,x-file-name","Access-Control-Allow-Methods":"GET,POST,PATCH,OPTIONS"},de="chat-handler-flow-queue",ot="__probe__echo__probe__";function jr(R){let h$1=String(R.apiBasePath||"/api/board").replace(/\/$/,""),w={...le,...R.corsHeaders||{}},L=R.queueLaneTuning??{},F=R.boardId||"",v=R.logger||{info:console.log,warn:console.warn,error:console.error},W=R.invocationAdapter,j$1=R.chatFlowRunner||null,M=R.notificationTransport||null,I=R.serverUrl||null,E=R.executionExtra||{},$=R.onSseClientConnected,J=R.onSseClientDisconnected,H=R.onChannelSubscribed,B=R.onChannelUnsubscribed,V=a({buildChatOneShotBatch:async(t,e)=>await tt.buildSseOneShotBatch({params:{cardId:t},body:{receiving:e}}),onSseClientDisconnected:J}),l$2=a({buildChatOneShotBatch:async()=>({status:"success",data:{kind:"notification-batch",category:"batch",notifications:[]}})});function A(t){function e(a){return {...a,queueStorageForRef(d,C){return a$7(a.queueStorageForRef(d,C),{lane:C,emitNotification:i$1})}}}function r(a){return {...a,queueStorageForRef(d,C){return h(a.queueStorageForRef(d,C),{lane:C,emitNotification:i$1})}}}function n(a){return {async get(d){return a.get(d)},async set(d){return a.set(d)},async del(d){return a.del(d)},async patch(d){return a.patch(d)},async appendFiles(d){return a.appendFiles(d)}}}function o(a){return {async get(d){return await a.get(d)},async set(d){return await a.set(d)},async del(d){return await a.del(d)},async patch(d){return await a.patch(d)},async appendFiles(d){return await a.appendFiles(d)}}}let s=null;function i$1(a){if(a.kind==="notification-batch"){O(a.notifications,s??void 0);return}O([a],s??void 0);}let c$2=a$4(t.boardAdapter)?r(t.boardAdapter):e(t.boardAdapter),D=t.nonCoreAdapter??(!a$4(c$2)&&b$3(c$2)?c$2:null),y$1=a$4(c$2)?i(t.baseRef,c$2,{boardRuntimeStoreRef:t.boardRuntimeStoreRef,scratchStoreRef:t.scratchStoreRef,taskExecutorRef:t.taskExecutorRef,chatHandlerFlow:t.chatHandlerFlow,emitNotification:i$1}):y(t.baseRef,c$2,{boardRuntimeStoreRef:t.boardRuntimeStoreRef,scratchStoreRef:t.scratchStoreRef,taskExecutorRef:t.taskExecutorRef,chatHandlerFlow:t.chatHandlerFlow,emitNotification:i$1}),q=t.nonCore??(D?z(t.baseRef,D,{boardRuntimeStoreRef:t.boardRuntimeStoreRef,taskExecutorRef:t.taskExecutorRef}):null),Ue=c$2.chatStorageForRef(t.chatStoreRef),lt,We=a$4(c$2)?(()=>{let a=d(c(b$1(c$2.kvStorageForRef(t.cardStoreRef)),c$2.hashFn),v.warn),d$1=g(a,{emitNotification:i$1}),C=o(d$1);return lt={get(p){return C.get(p)},set(p){return C.set(p)}},C})():(()=>{let a=c$2.kvStorageForRef(t.cardStoreRef),C=a$5(l$1({readIndex:()=>a.read("_index"),writeIndex:p=>a.write("_index",p),readCard:p=>a.read(p),writeCard:(p,pt)=>(a.write(p,pt),p),removeCard:p=>{a.delete(p);},cardExists:p=>a.read(p)!==null,defaultCardKey:p=>p},v.warn),{emitNotification:i$1});return lt=C,n(C)})(),ft;if(a$4(c$2)){let a=c$2.blobStorageForRef(t.artifactsStoreRef);ft={async putBytes(d,C){if(a.writeBytes){await a.writeBytes(d,C);return}let p=JSON.stringify({__kind:"bytes-array",data:[...C]});await a.write(d,p);},async getBytes(d){if(a.readBytes){let p=await a.readBytes(d);if(p!==null)return p}let C=await a.read(d);if(C===null)return null;try{let p=JSON.parse(C);if(p&&p.__kind==="bytes-array"&&Array.isArray(p.data))return new Uint8Array(p.data)}catch{}return new TextEncoder().encode(C)},async listKeys(d){return await a.listKeys(d)}};}else {let a=c$2.blobStorageForRef(t.artifactsStoreRef),d=a$6(a);ft={putBytes(C,p,pt){d.putBytes(C,p,pt);},getBytes(C){return d.getBytes(C)},listKeys(C){return d.list(C).map(p=>p.key)}};}let Je={async init(a){return y$1.init(a)},async status(a){return y$1.status(a)},async getConfig(a){return y$1.getConfig(a)},async getAllOutputsDataObjects(a){return y$1.getAllOutputsDataObjects(a)},async getAllOutputsComputedValues(a){return y$1.getAllOutputsComputedValues(a)},async getOutputsFetchedSources(a){return y$1.getOutputsFetchedSources(a)},async buildSseOneShotPayload(a){return y$1.buildSseOneShotPayload(a)},async upsertCard(a){return y$1.upsertCard(a)},async removeCard(a){return y$1.removeCard(a)},async sourceDataFetched(a){return y$1.sourceDataFetched(a)},async sourceDataFetchFailure(a){return y$1.sourceDataFetchFailure(a)}};return s={label:t.label,board:y$1,nonCore:q,publicCardStore:lt,boardOps:Je,cardStoreOps:We,get filesArtifacts(){return ft},get chatStorage(){return Ue},boardAdapter:c$2,boardRuntimeStoreRef:t.boardRuntimeStoreRef,cardStoreRef:t.cardStoreRef,outputsStoreRef:t.outputsStoreRef,artifactsStoreRef:t.artifactsStoreRef,fetchedSourcesStoreRef:t.fetchedSourcesStoreRef,queueStoreRef:t.queueStoreRef,chatStoreRef:t.chatStoreRef,scratchStoreRef:t.scratchStoreRef,notifyRef:t.notifyRef,taskExecutorRef:t.taskExecutorRef,chatHandlerRef:t.chatHandlerRef,chatHandlerFlow:t.chatHandlerFlow,inferenceAdapterRef:t.inferenceAdapterRef,notification:c$1(),notificationTeardown:null,initialized:false,cardsBootstrapped:false},s}let u=R.boards.map(A),k$1=new Map;function x(t){return k$1.get(t)??0}function N(t){return t.queueStoreRef}function m$1(t,e){if(a$4(t.boardAdapter)){let n=t.boardAdapter.queueStorageForRef(N(t),e);return a$b(n)}let r=t.boardAdapter.queueStorageForRef(N(t),e);return a$c(r)}function b$3(t){let e=t;return typeof e.invokeExecutor=="function"&&typeof e.validateSchema=="function"}function S(t){let e=u[x(t)];return {files:e?e.filesArtifacts:null}}function f(){return c$2()}function T(t){return String(t||"").replace(/[^a-zA-Z0-9_-]/g,"_")||"unknown-card"}function P(t){return "cardId"in t&&typeof t.cardId=="string"?z$1(t.cardId)??void 0:u[0]??void 0}function g$1(t){for(let e of t){let r=P(e);if(r)return r}return u[0]??void 0}function _(t,e$2={}){if(!t||t.length===0)return;let r=e(t),n={kind:"notification-batch",category:"batch",notifications:r},o=e$2.ctx??g$1(r);if(e$2.appendState!==false&&o&&e$1(o.notification,n),e$2.broadcastSse!==false){let s=r.filter(c=>c.kind==="message_enqueued"),i=r.filter(c=>c.kind!=="message_enqueued");i.length>0&&V.broadcastNotificationBatch(i),s.length>0&&l$2.broadcastNotificationBatch(s);}if(!(e$2.mirrorExternal===false||!o?.boardAdapter.publishBoardChangeNotifications))try{let s=r.filter(i=>i.category==="board-output"||i.category==="card-store");s.length>0&&o.boardAdapter.publishBoardChangeNotifications(s);}catch{}}function O(t,e){_(t,{ctx:e,appendState:true,broadcastSse:true,mirrorExternal:true});}async function at(t){if(!t||t.notificationTeardown||!M||!t.notifyRef)return;let e=await M.subscribe(t.notifyRef,r=>{let n=a$8(r);_(n,{ctx:t,appendState:true,broadcastSse:true,mirrorExternal:false});});t.notificationTeardown=e;}async function fe(t){if(!t||t.initialized)return;let e={boardRuntimeStoreRef:t.boardRuntimeStoreRef,cardStoreRef:t.cardStoreRef,outputsStoreRef:t.outputsStoreRef,fetchedSourcesStoreRef:t.fetchedSourcesStoreRef,artifactsStoreRef:t.artifactsStoreRef,queueStoreRef:t.queueStoreRef,chatStoreRef:t.chatStoreRef,scratchStoreRef:t.scratchStoreRef},r={};t.taskExecutorRef&&(r["task-executor-ref"]=t.taskExecutorRef),t.chatHandlerFlow!==void 0&&(r["chat-handler-flow"]=t.chatHandlerFlow);let n=await t.boardOps.init({params:e,body:r});if(n.status!=="success")throw Object.assign(new Error(n.error||`init failed for ${t.label}`),{statusCode:500});if(await at(t),!t.chatHandlerFlow&&t.chatHandlerRef&&W.describe)try{let o=await W.describe(t.chatHandlerRef);o&&o.kind!=="chat-handler"?v.warn(`[init] chat-handler describe returned kind="${o.kind}", expected "chat-handler" for ${t.label}`):o&&v.info(`[init] chat-handler validated: ${o.name} (protocol ${o.protocolVersion}) for ${t.label}`);}catch(o){v.warn(`[init] chat-handler describe failed for ${t.label}: ${o?.message||String(o)}`);}t.initialized=true;}async function ut(t){let e=[],r=await t.boardOps.status({});r.status==="success"&&r.data!=null&&d$1(r.data)&&e.push({kind:"status",status:r.data});let n=await t.boardOps.getAllOutputsDataObjects({});if(n.status==="success"&&n.data!=null)for(let[s,i]of Object.entries(n.data))s&&e.push({kind:"data_object",key:s,payload:i});let o=await t.boardOps.getAllOutputsComputedValues({});if(o.status==="success"&&o.data!=null)for(let[s,i]of Object.entries(o.data))s&&i&&typeof i=="object"&&!Array.isArray(i)&&e.push({kind:"computed_values",cardId:s,values:i});e.length>0&&_(e,{ctx:t,appendState:true,broadcastSse:true,mirrorExternal:false});}async function Rt(t,e){if(!t||t.cardsBootstrapped)return;let r=await t.cardStoreOps.get({}),n=r.status==="success"&&Array.isArray(r.data?.cards)?r.data.cards:[];for(let o of n)typeof o.id=="string"&&(k$1.set(o.id,e),await t.boardOps.upsertCard({params:{cardId:o.id}}));t.cardsBootstrapped=true;}async function G(){for(let t of u)await fe(t);}async function st(){await G();for(let t=0;t<u.length;t++)await ut(u[t]),await Rt(u[t],t),await ut(u[t]);}async function yt(t=false){t||await G();for(let e of u){let r=await e.board.processAccumulatedEvents({});if(r.status!=="success")return r}return {status:"success"}}function z$1(t){return u[x(t)]??null}async function X(t){let e=z$1(t);if(!e)return null;let r=await e.cardStoreOps.get({params:{id:t}});if(r.status!=="success")return null;let n=Array.isArray(r.data?.cards)?r.data.cards:[];return n.length>0?n[0]:null}async function pe(){let t=async r=>{if(!r)return [];let n=await r.cardStoreOps.get({});return n.status!=="success"||!Array.isArray(n.data?.cards)?[]:n.data.cards},e=[];for(let r of u)e.push(...await t(r));return e}function ht(){return u[0]??null}function me(t){return z$1(t)??ht()}function U(t){let e=me(t);if(!e)throw Object.assign(new Error(`Board context is unavailable for chat operations: ${t}`),{statusCode:404});return e.chatStorage}async function ge(t){return await U(t).isProcessing(t)}async function Y(t,e){let r=await tt.setProcessing({params:{cardId:t},body:{active:e}});if(r.status!=="success")throw Object.assign(new Error(r.error||`Failed to set chat processing for card: ${t}`),{statusCode:500})}let tt=a$1({append(t,e,r,n,o){return U(t).append(t,e,r,n,o)},readAll(t){return U(t).readAll(t)},readAfter(t,e){return U(t).readAfter(t,e)},clear(t){return U(t).clear(t)},setProcessing(t,e){return U(t).setProcessing(t,e)},isProcessing(t){return U(t).isProcessing(t)},getConfig(t){return U(t).getConfig(t)},setConfig(t,e){return U(t).setConfig(t,e)}},{emitNotification(t){if(t.kind==="notification-batch"){O(t.notifications);return}O([t]);}}),wt=p({boardContexts:u,cardOwnerIndex:k$1,cardContextForCard:t=>z$1(t),readStatusSnapshot:()=>be(),readDataObjectsByToken:()=>Ce(),readCardRuntimeArtifacts:()=>Se(),readCardFromStore:t=>X(t),readCardDefinitions:()=>pe(),processAccumulatedLaneInternal:t=>yt(t),reportSourceFetched:(t,e)=>kt(t,{ref:e}),reportSourceFetchFailure:(t,e)=>Pt(t,{reason:e}),uploadCardFile:(t,e,r,n,o)=>Ct(t,e,r,n,o),chatStorePublic:tt,serverUrl:I,apiBasePath:h$1}),Re=wt.mcpCardStoreFacade,it=wt.createMcpFacade,ye=j({boardId:F,bootstrapBoard:()=>st(),sseHub:V,onChannelSubscribed:H,onChannelUnsubscribed:B,getMcpFacade:()=>it(),getMcpCardStoreFacade:()=>Re()});function he(t){return m(t)}function we(){return n(it())}function bt(){return o({boardId:F,uploadCardFile:Ct,getMcpFacade:()=>it(),controlplane:ye})}let ct=k({boardId:F,boardContexts:u,readChatRecords:t=>Fe(t),getChatProcessing:t=>ge(t)}),be=ct.readStatusSnapshot,Se=ct.readCardRuntimeArtifacts,Ce=ct.readDataObjectsByToken,dt=ct.buildPublishedRuntimePayload;async function St(t,e,r){let n=r?.syncBoard!==false,o=r?.restartOnlyIfChanged===true,s=z$1(t);if(!s)throw Object.assign(new Error(`Card not found: ${t}`),{statusCode:404});let i=await X(t);if(!i)throw Object.assign(new Error(`Card not found: ${t}`),{statusCode:404});let c=o?JSON.stringify(i):null,D=e(i)||i;if(o&&JSON.stringify(D)===c)return;let y=await s.cardStoreOps.set({body:D});if(y.status!=="success")throw Object.assign(new Error(y.error||`Failed to persist card: ${t}`),{statusCode:500});if(n){let q=await s.boardOps.upsertCard({params:{cardId:t,restart:true}});if(q.status!=="success")throw Object.assign(new Error(q.error||`Failed to upsert card: ${t}`),{statusCode:500})}}async function Ae(t,e){await St(t,e,{syncBoard:true});}async function Be(t,e){await St(t,e,{syncBoard:false});}async function ke(t){let e=z$1(t);if(!e)throw Object.assign(new Error(`Card not found: ${t}`),{statusCode:404});if(!await X(t))throw Object.assign(new Error(`Card not found: ${t}`),{statusCode:404});let n=await e.boardOps.upsertCard({params:{cardId:t,restart:true}});if(n.status!=="success")throw Object.assign(new Error(n.error||`Failed to retrigger card: ${t}`),{statusCode:500})}async function Pe(t){let e=await tt.clear({params:{cardId:t}});if(e.status!=="success")throw Object.assign(new Error(e.error||`Failed to clear chat records for card: ${t}`),{statusCode:500});try{await Y(t,!1);}catch{}}async function Oe(t,e,r,n,o=""){let s=typeof r=="string"?r.trim():"",i=await tt.append({params:{cardId:t},body:{role:e||"system",text:s,files:n,turn:o}});if(i.status!=="success")throw Object.assign(new Error(i.error||`Failed to append chat record for card: ${t}`),{statusCode:500});return String(i.data?.id||"")}async function Fe(t){return await U(t).readAll(t)}let Ct=l({safeCardId:t=>T(t),artifactsStores:t=>S(t),cardFileMetadataStore:()=>f(),readCardFromStore:t=>X(t),updateCardLocalOnly:(t,e)=>Be(t,e),writeChatRecord:(t,e,r,n,o)=>Oe(t,e,r,n,o)}).uploadCardFile;async function At(t){let e=z$1(t);if(!e)return null;let r=await e.boardOps.getConfig({params:{key:"chat-handler-flow"}}),o=(r.status==="success"?r.data?.value:null)??e.chatHandlerFlow??null,s=e.chatHandlerRef;return o==null&&(!s||typeof s!="object")?null:{ctx:e,handlerFlow:o,handlerRef:s}}function ve(t){let e=typeof t=="string"?t.trim():"";if(e.length<ot.length*2||!e.startsWith(ot)||!e.endsWith(ot))return null;let r=e.slice(ot.length,e.length-ot.length).trim(),n=/^([A-Za-z0-9_-]+)__(.*)$/s.exec(r);return n?{assistant:n[1].trim().toLowerCase(),text:n[2].trim()}:{assistant:"echo",text:r}}async function xe(t,e,r=false,n="",o=""){try{let s=await At(t);if(!s){try{await Y(t,!1);}catch{}return}let{ctx:i,handlerFlow:c,handlerRef:D}=s;if(!r)try{await Y(t,!0);}catch{}let y={boardId:F,cardId:String(t),lastChatEntryId:e,...n?{turnId:n}:{},...typeof o=="string"&&o.trim()?{probe:o.trim()}:{},...E,...I?{serverUrl:I}:{}},q=c!=null?{meta:"chat-handler-flow",howToRun:"built-in",whatToRun:{kind:"built-in",value:de}}:D;a$4(i.boardAdapter)?await m$1(i,"chat-agent").enqueueRequest({boardId:F,ref:q,args:c!=null?{...y,__chatHandlerFlow:c}:y}):m$1(i,"chat-agent").enqueueRequest({boardId:F,ref:q,args:c!=null?{...y,__chatHandlerFlow:c}:y}),await Promise.resolve(i.boardAdapter.requestProcessAccumulated?.());}catch(s){try{await Y(t,!1);}catch{}v.warn(`[chat-handler] queue failed for card "${t}": ${s instanceof Error?s.message:String(s)}`);}}async function Te(t,e,r){if(e.howToRun==="built-in"&&b$2(e)===de){let n=j$1,o=r.__chatHandlerFlow,s={...r};return delete s.__chatHandlerFlow,n?n.run(o,s,{boardId:F,cardId:String(s.cardId||""),label:t.label,logger:v,serverUrl:I,executionExtra:E}):{dispatched:false,error:"chat-handler-flow configured but no chatFlowRunner was provided"}}return W.invoke(e,r)}async function Ne(t,e=false){e||await G();let r=typeof t.args?.cardId=="string"?t.args.cardId:"",n=r?z$1(r):ht();if(!n)throw new Error(r?`Board context is unavailable for chat-agent request: ${r}`:"Board context is unavailable for chat-agent request");let o=await Te(n,t.ref,t.args);if(!o.dispatched){if(r)try{await Y(r,!1);}catch{}throw new Error(o.error||`chat-agent dispatch failed for card "${r||"unknown"}"`)}}async function Ee(t,e,r){if(e==="chat-send"){let o=r&&typeof r["turn-id"]=="string"?r["turn-id"]:r&&typeof r.turnId=="string"?r.turnId:r&&typeof r.turn=="string"?r.turn:"";if(r&&"files"in r&&r.files!==void 0&&r.files!==null)throw Object.assign(new Error('chat-send does not accept a "files" parameter; upload attachments via manage.add-chat-attachment first'),{statusCode:400});let s=bt(),i=ve(r?.text),c=i?i.text:r?.text,D=await a$a("manage.add-chat-entry-and-any-attachments",{board_id:F,card_id:t,role:"user",text:c,turn_id:o,files:[]},s);if(D?.status!=="success")throw new Error(b$4(D,`chat-send append failed for card ${t}`));let y=D?.data?.id;if(typeof y!="string"||!y)throw new Error(`chat-send did not return an append id for card ${t}`);let q=await a$a("setstate.chat-processing-started",{board_id:F,card_id:t},s);if(q?.status!=="success")throw new Error(b$4(q,`chat-send processing update failed for card ${t}`));xe(t,y,true,o,i?.assistant||"");return}await Ae(t,o=>{let s=new Date().toISOString(),i=o.card_data&&typeof o.card_data=="object"?o.card_data:{};if(o.card_data=i,e==="file-upload"){let c=f().normalizeIncoming(r?.files,s);return c.length>0&&f().merge(i,c),o}if(e==="action"){let c=r&&typeof r.buttonId=="string"?r.buttonId:"";if(!c)return o;i.lastAction={buttonId:c,at:s},i.lastActionText=`${c} @ ${s}`;}return o});}function et(t,e,r){let n=JSON.stringify(r),o=typeof Buffer<"u"?Buffer.byteLength(n):new TextEncoder().encode(n).length;t.writeHead(e,{...w,"Content-Type":"application/json; charset=utf-8","Content-Length":o}),t.end(n);}async function Bt(t,e,r){let n=await X(t);if(!n)throw Object.assign(new Error("Card not found"),{statusCode:404});let o=f().resolve(n.card_data,e,r);if(!o.ok&&o.reason==="stale_reference")throw Object.assign(new Error("File reference is stale. Refresh and try again."),{statusCode:409});if(!o.ok)throw Object.assign(new Error("File not found"),{statusCode:404});let s=o.file,i=T(t),c=S(t),D=String(s.stored_name||""),y=`${i}/${D}`,q=c.files?await c.files.getBytes(y):null;if(!q)throw Object.assign(new Error("File not found"),{statusCode:404});return {fileRecord:s,bytes:q}}async function je(t,e,r,n){let{fileRecord:o,bytes:s}=await Bt(e,r,n),i=String(o.name||o.stored_name||"download.bin"),c=String(o.mime_type||"application/octet-stream");t.writeHead(200,{"Content-Type":c,"Content-Disposition":`attachment; filename="${i}"`,"Content-Length":s.length}),t.end(s);}function Me(t){let e=String(t||"").toLowerCase();return e.startsWith("text/")||e.includes("json")||e.includes("xml")||e.includes("javascript")||e.includes("typescript")||e.includes("yaml")||e.includes("csv")}function _e(t,e,r){let n=t.split(/\r?\n/);return (e==="head"?n.slice(0,r):n.slice(-r)).join(`
|
|
2
|
+
`)}async function rt(t){let e=[];for await(let n of t)e.push(n);let r=typeof Buffer<"u"?Buffer.concat(e).toString("utf-8").trim():new TextDecoder().decode(d$2(e)).trim();return r?JSON.parse(r):{}}async function kt(t,e){let r=typeof e.ref=="string"?e.ref.trim():"";if(!r)return {status:"fail",error:"board-worker success callback requires body.ref"};let n=u[0];return n?n.boardOps.sourceDataFetched({params:{token:t,ref:r}}):{status:"fail",error:"no board context"}}async function Pt(t,e){let r=typeof e.reason=="string"&&e.reason.trim()?e.reason:"unknown",n=u[0];return n?n.boardOps.sourceDataFetchFailure({params:{token:t,reason:r}}):{status:"fail",error:"no board context"}}let De=b({sseHub:V,queueSseHub:l$2,corsHeaders:w,json:et,buildPublishedRuntimePayload:()=>dt(),onSseClientConnected:$,onChannelSubscribed:H,onChannelUnsubscribed:B,apiBasePath:h$1,readJsonBody:t=>rt(t),initBoardAndSetup:()=>G(),bootstrapBoard:()=>st(),boardContexts:u,publishPersistedStateSnapshot:t=>ut(t),upsertCardsFromSource:(t,e)=>Rt(t,e)}).handleWatchersRoutes,qe=a$2({apiBasePath:h$1,json:et,readJsonBody:t=>rt(t),bootstrapBoard:()=>st(),createMcpFacade:()=>it(),createMcpToolRegistry:t=>he(t),resolveCardFileDownloadPayload:(t,e,r)=>Bt(t,e,r),isLikelyTextMimeType:t=>Me(t),sliceTextByLines:(t,e,r)=>_e(t,e,r)}).handleAgentfaceApi,Ie=a$3({apiBasePath:h$1,json:et,readJsonBody:t=>rt(t),initBoardAndSetup:()=>G(),createMcpWebhookToolRegistry:()=>we()}).handleWebhooksApi,$e=ce({apiBasePath:h$1,json:et,readJsonBody:t=>rt(t),initBoardAndSetup:()=>G(),bootstrapBoard:()=>st(),buildPublishedRuntimePayload:()=>dt(),createMcpControlplaneToolRegistry:()=>bt(),retriggerCard:t=>ke(t),applyCardAction:(t,e,r)=>Ee(t,e,r),resolveChatHandlerTarget:t=>At(t),sendCardFileDownloadResponse:(t,e,r,n)=>je(t,e,r,n)}).handleRuntimeApi,He=ue({apiBasePath:h$1,emitNotifications:t=>O(t),readJsonBody:t=>rt(t),json:(t,e,r)=>et(t,e,r)}).handleNotifyRoute;async function Le(t,e,r){return !!(await qe(t,e,r)||await Ie(t,e,r)||await De(t,e,r)||await He(t,e,r)||await $e(t,e,r))}return {get apiBasePath(){return h$1},get corsHeaders(){return w},get queueLaneTuning(){return L},handleRuntimeApi:Le,emitNotification(t){if(t.kind==="notification-batch"){O(t.notifications);return}O([t]);},buildPublishedRuntimePayload:dt,__drainProcessAccumulatedLane:yt,handleChatAgentRequest:Ne,clearChatRecords:Pe,reportSourceFetched(t,e){return kt(t,{ref:e})},reportSourceFetchFailure(t,e){return Pt(t,{reason:e})},get cardStore(){return u[0]?.publicCardStore??{get(){return Promise.resolve({status:"fail",error:"no board context"})},set(){return Promise.resolve({status:"fail",error:"no board context"})}}}}}function Mr(R){let h=String(R.apiBasePath||"/api/boards").replace(/\/$/,""),w={...le,...R.corsHeaders||{}},L=R.serverMetaStore,F=R.boardRuntimeFactory,v=new Map,W="boards-config.json";function j(){let l=L.getText(W);if(!l)return {boards:[{id:"default",label:"Default Board"}]};try{return JSON.parse(l)}catch{return {boards:[{id:"default",label:"Default Board"}]}}}function M(l){L.putText(W,JSON.stringify(l,null,2));}function I(l){let A=String(l||"").replace(/[^a-zA-Z0-9_-]/g,"_").replace(/^_+|_+$/g,"");return A.length>0&&A.length<=64?A:null}function E(l){if(v.has(l))return v.get(l);let u=j().boards.find(x=>x.id===l)||{},k=F(l,u);return v.set(l,k),k}function $(l,A,u){let k=JSON.stringify(u),x=typeof Buffer<"u"?Buffer.byteLength(k):new TextEncoder().encode(k).length;l.writeHead(A,{...w,"Content-Type":"application/json; charset=utf-8","Content-Length":x}),l.end(k);}async function J(l,A,u){let k=l.method||"GET",x=u.pathname;if(k==="GET"&&x===h)return $(A,200,{ok:true,boards:j().boards}),true;if(k==="POST"&&x===h){let N=[];for await(let g of l)N.push(g);let m=typeof Buffer<"u"?Buffer.concat(N).toString("utf-8").trim():new TextDecoder().decode(d$2(N)).trim(),b={};try{b=m?JSON.parse(m):{};}catch{b={};}let S=I(b.id);if(!S)return $(A,400,{error:"board id must be 1-64 alphanumeric/dash/underscore characters"}),true;let f=j();if(f.boards.some(g=>g.id===S))return $(A,409,{error:`Board "${S}" is already registered`}),true;let T=typeof b.label=="string"&&b.label.trim()?b.label.trim():S,P={id:S,label:T};for(let[g,_]of Object.entries(b))g==="id"||g==="label"||_!=null&&(P[g]=_);return f.boards.push(P),M(f),$(A,200,{ok:true,board:P}),true}return false}async function H(l,A,u){let x=u.pathname.match(new RegExp(`^${c$3(h)}/([^/]+)(/|$)`));if(!x)return false;let N=I(decodeURIComponent(x[1]));return N?j().boards.some(S=>S.id===N)?!!await E(N).handleRuntimeApi(l,A,u):($(A,404,{error:`Board "${N}" not registered. POST ${h} with {id} to register it first.`}),true):($(A,400,{error:"Invalid board id"}),true)}async function B(l,A,u){return !!(await J(l,A,u)||await H(l,A,u))}function V(l){if(!j().boards.some(u=>u.id===l))throw Object.assign(new Error(`Board "${l}" not registered`),{statusCode:404});return {service:E(l)}}return {get apiBasePath(){return h},get corsHeaders(){return w},handleApi:B,requireBoardService:V}}export{jr as a,Mr as b};//# sourceMappingURL=chunk-37FDOKDK.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-37FDOKDK.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkBQUQTOPB_cjs=require('./chunk-BQUQTOPB.cjs'),chunkLPXVVMQT_cjs=require('./chunk-LPXVVMQT.cjs'),chunkVQCIOKJV_cjs=require('./chunk-VQCIOKJV.cjs'),chunkDQPBAB5Z_cjs=require('./chunk-DQPBAB5Z.cjs');function v(a){if(!a||typeof a!="object")return false;let e=a;return typeof e.kind=="string"&&e.kind.length>0}function J(a){if(!a||typeof a!="object")return [];let e=a;return e.kind==="notification-batch"?Array.isArray(e.notifications)?e.notifications.filter(v):[]:v(a)?[a]:[]}function X(a,e,i){let u=0;return {accepted:a.filter(R=>{if(!v(R))return u++,false;let _=R;return typeof _.sentAtMs=="number"&&e-_.sentAtMs>i?(u++,false):true}),rejected:u}}function Q(){return {status:null,computedValues:{},dataObjects:{},cards:{}}}function z(a){if(!a||typeof a!="object")return false;let e=a.summary;return !e||typeof e!="object"?false:Number(e.card_count||0)>0}function W(a){if(!a||typeof a!="object")return false;let e=a;return e.kind==="notification-batch"&&Array.isArray(e.notifications)}function V(a,e){if(e.kind==="status"){z(e.status)&&(a.status=e.status);return}if(e.kind==="computed_values"){a.computedValues[e.cardId]=e.values;return}if(e.kind==="data_object"){a.dataObjects[e.key]=e.payload;return}if(e.kind==="card_refreshed"){a.cards[e.cardId]=e.card;return}e.kind==="card_removed"&&(delete a.cards[e.cardId],delete a.computedValues[e.cardId]);}function Y(a,e){if(W(e)){for(let i of e.notifications)v(i)&&V(a,i);return}v(e)&&V(a,e);}function j(a,e){if(a?.status==="success")return Object.prototype.hasOwnProperty.call(a,"data")?a.data:void 0;throw a?.status==="fail"||a?.status==="error"?Object.assign(new Error(a.error||`${e} failed`),{statusCode:400}):Object.assign(new Error(`${e} returned an unexpected response`),{statusCode:500})}async function N(a,e){return j(await a,e)}function q(a){let e=chunkLPXVVMQT_cjs.a(a,"key");if(!e)throw Object.assign(new Error("MCP tool requires key"),{statusCode:400});let i=e.split(".");if(!(i.length>=2&&i[0]==="chat"&&i.every(f=>/^[A-Za-z_][A-Za-z0-9_]*$/.test(f))))throw Object.assign(new Error("MCP tool only supports card private keys under chat.*"),{statusCode:400});return e}function E(a,e){let i=a.__private;for(let u of e.split(".")){if(!i||typeof i!="object"||Array.isArray(i)||!Object.prototype.hasOwnProperty.call(i,u))return {exists:false,value:null};i=i[u];}return {exists:true,value:i}}function oe(a){let{boardId:e,bootstrapBoard:i,sseHub:u,onChannelSubscribed:f,onChannelUnsubscribed:R,getMcpFacade:_,getMcpCardStoreFacade:r}=a;function g(s){let d=chunkLPXVVMQT_cjs.a(s,"board_id");if(!d)throw Object.assign(new Error("MCP tool requires board_id"),{statusCode:400});if(d!==e)throw Object.assign(new Error(`Unknown board_id: ${d}`),{statusCode:400})}function b(s){let d=chunkLPXVVMQT_cjs.a(s,"client_id");if(!d)throw Object.assign(new Error("MCP tool requires client_id"),{statusCode:400});return d}function y(s){g(s);let d=b(s),n=chunkLPXVVMQT_cjs.a(s,"channel_name"),t=chunkLPXVVMQT_cjs.a(s,"card_id")||void 0;if(!n)throw Object.assign(new Error("MCP tool requires channel_name"),{statusCode:400});return {clientId:d,channelName:n,...t?{cardId:t}:{}}}function c(s){g(s);let d=chunkLPXVVMQT_cjs.a(s,"card_id");if(!d)throw Object.assign(new Error("MCP tool requires card_id"),{statusCode:400});return {cardId:d}}async function C(s){await i();let{cardId:d}=c(s),n=b(s);if(!await u.subscribeChat(n,d))throw Object.assign(new Error(`SSE client not connected: ${n}`),{statusCode:404});return {status:"success",data:{boardId:e,cardId:d,clientId:n,subscribed:true}}}async function m(s){await i();let{cardId:d}=c(s),n=b(s);if(!u.unsubscribeChat(n,d))throw Object.assign(new Error(`SSE client not connected: ${n}`),{statusCode:404});return {status:"success",data:{boardId:e,cardId:d,clientId:n,subscribed:false}}}async function w(s,d){await i();let{clientId:n,channelName:t,cardId:o}=y(s);if(!u.has(n))throw Object.assign(new Error(`SSE client not connected: ${n}`),{statusCode:404});return d?(u.subscribeChannel(n,t,o),f?.(n,t,o?{cardId:o}:{})):(u.unsubscribeChannel(n,t,o),R?.(n,t,o?{cardId:o}:{})),{status:"success",data:{boardId:e,clientId:n,channelName:t,subscribed:d,...o?{cardId:o}:{}}}}async function S(s,d){let{cardId:n}=c(s);return await _().setChatProcessing({cardId:n,active:d}),{status:"success",data:{boardId:e,cardId:n,active:d}}}async function l(s){let{cardId:d}=c(s),n=await _().getChatProcessing({cardId:d});return {status:"success",data:{boardId:e,cardId:d,active:n.active}}}async function h(s){let{cardId:d}=c(s),n=q(s);if(!Object.prototype.hasOwnProperty.call(s,"value"))throw Object.assign(new Error("MCP tool requires value"),{statusCode:400});if(n.split(".").includes("visible_controlplane_only")){let t=await N(r().get({params:{id:d}}),"cardStore.get"),o=Array.isArray(t.cards)&&t.cards.length>0&&typeof t.cards[0]=="object"&&!Array.isArray(t.cards[0])?t.cards[0]:null,k=o?E(o,"visible_controlplane_only").value:void 0;if(s.value!==k)throw Object.assign(new Error("MCP tool cannot change the reserved private flag visible_controlplane_only"),{statusCode:403});return {status:"success",data:{boardId:e,cardId:d,key:n}}}return j(await r().patch({params:{id:d,path:`__private.${n}`},body:{value:s.value}}),"cardStore.patch"),{status:"success",data:{boardId:e,cardId:d,key:n}}}async function I(s){let{cardId:d}=c(s),n=q(s),t=await N(r().get({params:{id:d}}),"cardStore.get"),o=Array.isArray(t.cards)&&t.cards.length>0&&t.cards[0]&&typeof t.cards[0]=="object"&&!Array.isArray(t.cards[0])?t.cards[0]:null;if(!o)throw Object.assign(new Error(`Card "${d}" not found`),{statusCode:404});let k=E(o,n);return {status:"success",data:{boardId:e,cardId:d,key:n,exists:k.exists,value:k.value}}}return {requireCardArgs:c,subscribeChat:C,unsubscribeChat:m,watchChannel:w,setChatProcessing:S,getChatProcessing:l,setCardMeta:h,getCardMeta:I}}function ie(a){let{boardId:e,boardContexts:i,readChatRecords:u,getChatProcessing:f}=a;function R(c){if(c.length===0)return null;if(c.length===1)return c[0];let C=[],m=["completed","eligible","pending","blocked","unresolved","failed","in_progress","orphan_cards"],w={};for(let l of m)w[l]=0;for(let l of c){let h=l,I=Array.isArray(h.cards)?h.cards:[];C.push(...I);for(let s of m)w[s]+=Number(h?.summary?.[s]||0);}let S=c[0];return {...S,cards:C,summary:{...S.summary||{},card_count:C.length,...w}}}async function _(){let c=[];for(let C of i)try{let m=await C.boardOps.buildSseOneShotPayload({});m.status==="success"&&m.data&&c.push(m.data);}catch{}return c}async function r(){let C=(await _()).map(m=>m.statusSnapshot).filter(Boolean);if(C.length===0){let m=i.map(w=>w.notification.status).filter(Boolean);return R(m)}return R(C)}async function g(){let c={},C=await _();for(let m of C)Object.assign(c,m.cardRuntimeById||{});if(Object.keys(c).length>0)return c;for(let m of i)for(let[w,S]of Object.entries(m.notification.computedValues)){let l=m.notification.cards[w];c[w]={schema_version:"v1",card_id:w,card_data:l?.card_data??{},computed_values:S??{}};}return c}async function b(){let c={},C=await _();for(let m of C)Object.assign(c,m.dataObjectsByToken||{});if(Object.keys(c).length===0)for(let m of i)Object.assign(c,m.notification.dataObjects||{});return c}async function y(){let c=await _(),C=c.flatMap(l=>Array.isArray(l.cardDefinitions)?l.cardDefinitions:[]),m={},w={};for(let l of c)Object.assign(m,l.dataObjectsByToken||{}),Object.assign(w,l.cardRuntimeById||{});let S={};for(let l of C){if(!l?.id)continue;let h=l.id;try{let I=await u(h),s=await f(h);(I.length>0||s)&&(S[h]={messages:I.map(d=>({role:String(d.role||"system"),text:String(d.text||""),files:Array.isArray(d.files)?d.files:[]})),receiving:!1,processing:s});}catch{}}return {boardId:e,cardDefinitions:C,statusSnapshot:await r(),dataObjectsByToken:m,cardRuntimeById:w,cardChatsByCardId:S}}return {readStatusSnapshot:r,readCardRuntimeArtifacts:g,readDataObjectsByToken:b,buildPublishedRuntimePayload:y}}function K(a){let e=String(a||"").trim();if(!e)return "upload.bin";let i=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return (i>=0?e.slice(i+1):e)||"upload.bin"}function ce(a){let{safeCardId:e,artifactsStores:i,cardFileMetadataStore:u,readCardFromStore:f,updateCardLocalOnly:R,writeChatRecord:_}=a;async function r(y){let c=[];try{let C=await f(y);if(!C)return c;let m=u().read(C.card_data&&typeof C.card_data=="object"?C.card_data:null);for(let w of m)c.push(String(w.stored_name??""));}catch{}return c}async function g(y,c,C,m){let w=e(y),S=i(y),l=K(c),h=await r(y),s=`${String(h.length+1).padStart(3,"0")}-${l}`.slice(-36);if(!S.files)throw Object.assign(new Error(`artifactsStoreRef is not configured for card uploads: ${y}`),{statusCode:500});return await S.files.putBytes(`${w}/${s}`,new Uint8Array(m),C||"application/octet-stream"),{name:l,stored_name:s,size:m.length,mime_type:C||"application/octet-stream",uploaded_at:new Date().toISOString()}}async function b(y,c,C,m,w){if(!m.length)throw Object.assign(new Error("Empty upload body"),{statusCode:400});let S=w?.inChat===true,l=await g(y,c,C,m),h=null;if(await R(y,I=>{let s=new Date().toISOString(),d=I.card_data&&typeof I.card_data=="object"?I.card_data:{};I.card_data=d;let n=u().normalizeIncoming([{name:l.name,stored_name:l.stored_name,size:l.size,mime_type:l.mime_type,uploaded_at:l.uploaded_at||s,chat:S}],s);return h=u().merge(d,n).findIndex(o=>o.stored_name===l.stored_name),I}),S&&w?.suppressChatRecordWrite!==true){let I=typeof h=="number"&&h>=0?` #${h}`:"";await _(y,"system",`file uploaded: ${l.name} as ${l.stored_name}${I}`,[],w?.turnId??"");}return {ok:true,file:{...l,...typeof h=="number"&&h>=0?{file_idx:h}:{},chat:S},...typeof h=="number"&&h>=0?{file_idx:h}:{}}}return {uploadCardFile:b,readCardStoredFileNames:r}}function pe(a){return {"discover.source-kinds":()=>a.discoverSourceKinds(),"inspect.board-runtime-status":()=>a.inspectBoardRuntimeStatus(),"inspect.card-definition-and-runtime":e=>a.inspectCardDefinitionAndRuntime({cardId:chunkLPXVVMQT_cjs.a(e,"card_id")}),"inspect.chat-messages-on-cards":e=>{let i=chunkLPXVVMQT_cjs.b(e,"tail_turns"),u=chunkLPXVVMQT_cjs.b(e,"tail"),f=chunkLPXVVMQT_cjs.a(e,"turn_id"),R=e.all_turns===true,_=chunkLPXVVMQT_cjs.a(e,"tail_turns_before_id");return a.inspectChatMessagesOnCards({cardId:chunkLPXVVMQT_cjs.a(e,"card_id"),...i!==void 0?{lastUserTurns:i}:{},...u!==void 0?{tail:u}:{},...f?{turnId:f}:{},...R?{allTurns:true}:{},..._?{tailTurnsBeforeId:_}:{}})},"inspect.file-contents":e=>a.inspectFileContents({cardId:chunkLPXVVMQT_cjs.a(e,"card_id"),fileIdx:Number(chunkLPXVVMQT_cjs.b(e,"file_idx"))}),"preflight.validate-candidate-card-definition":e=>a.preflightValidateCandidateCardDefinition({candidateCardContent:chunkLPXVVMQT_cjs.d(e,"candidate_card_content","candidate_card_content")}),"preflight.materialize-candidate-card":e=>a.preflightMaterializeCandidateCard({candidateCardContent:chunkLPXVVMQT_cjs.d(e,"candidate_card_content","candidate_card_content"),mockRequires:chunkLPXVVMQT_cjs.d(e,"mock_requires","mock_requires"),mockFetchedSources:chunkLPXVVMQT_cjs.d(e,"mock_fetched_sources","mock_fetched_sources")}),"preflight.probe-single-source-in-candidate-card":e=>a.preflightProbeSingleSourceInCandidateCard({candidateCardContent:chunkLPXVVMQT_cjs.d(e,"candidate_card_content","candidate_card_content"),mockProjections:chunkLPXVVMQT_cjs.c(e,"mock_projections"),sourceIdx:chunkLPXVVMQT_cjs.e(e,"source_idx","source_idx")}),"preflight.run-single-source-in-candidate-card":e=>a.preflightRunSingleSourceInCandidateCard({candidateCardContent:chunkLPXVVMQT_cjs.d(e,"candidate_card_content","candidate_card_content"),mockProjections:chunkLPXVVMQT_cjs.c(e,"mock_projections"),sourceIdx:chunkLPXVVMQT_cjs.e(e,"source_idx","source_idx")}),"preflight.run-single-source-in-live-card":e=>a.preflightRunSingleSourceInLiveCard({cardId:chunkLPXVVMQT_cjs.a(e,"card_id"),sourceIdx:chunkLPXVVMQT_cjs.e(e,"source_idx","source_idx"),mockRequires:chunkLPXVVMQT_cjs.d(e,"mock_requires","mock_requires")}),"preflight.run-one-cycle-with-candidate-card":e=>a.preflightRunOneCycleWithCandidateCard({candidateCardContent:chunkLPXVVMQT_cjs.d(e,"candidate_card_content","candidate_card_content"),mockRequires:chunkLPXVVMQT_cjs.c(e,"mock_requires")}),"manage.read-card":e=>a.manageReadCard({cardId:chunkLPXVVMQT_cjs.a(e,"card_id")}),"stage-ai-response-and-any-attachments":e=>{let i=chunkLPXVVMQT_cjs.a(e,"turn_id");if(!i)throw Object.assign(new Error("stage-ai-response-and-any-attachments requires a non-empty turn_id"),{statusCode:400});return a.manageAddChatEntryAndAnyAttachments({cardId:chunkLPXVVMQT_cjs.a(e,"card_id"),role:"assistant",...typeof e.text=="string"?{text:e.text}:{},...i?{turn:i}:{},...Array.isArray(e.files)?{files:e.files}:{}})},"stage-ai-failure-message":e=>{let i=chunkLPXVVMQT_cjs.a(e,"turn_id"),u=chunkLPXVVMQT_cjs.a(e,"failure");if(!i)throw Object.assign(new Error("stage-ai-failure-message requires a non-empty turn_id"),{statusCode:400});if(!u)throw Object.assign(new Error("stage-ai-failure-message requires a non-empty failure"),{statusCode:400});return a.manageAddChatEntryAndAnyAttachments({cardId:chunkLPXVVMQT_cjs.a(e,"card_id"),role:"system",text:u,turn:i})},"manage.upsert-card":e=>a.manageUpsertCard({cardId:chunkLPXVVMQT_cjs.a(e,"card_id"),candidateCardContent:chunkLPXVVMQT_cjs.c(e,"candidate_card_content")}),"manage.remove-card":e=>a.manageRemoveCard({cardId:chunkLPXVVMQT_cjs.a(e,"card_id")})}}function me(a){return {"webhook.process-accumulated":()=>a.webhookProcessAccumulated(),"webhook.source-fetch-done":e=>a.webhookSourceFetchDone({token:chunkLPXVVMQT_cjs.a(e,"token"),ref:chunkLPXVVMQT_cjs.a(e,"ref")}),"webhook.source-fetch-failed":e=>a.webhookSourceFetchFailed({token:chunkLPXVVMQT_cjs.a(e,"token"),reason:chunkLPXVVMQT_cjs.a(e,"reason")})}}function fe(a){let{boardId:e,uploadCardFile:i,getMcpFacade:u,controlplane:f}=a;function R(r,g){let b=chunkLPXVVMQT_cjs.a(r,"board_id");if(!b)throw Object.assign(new Error(`${g} requires board_id`),{statusCode:400});if(b!==e)throw Object.assign(new Error(`Unknown board_id: ${b}`),{statusCode:400})}function _(r,g){let{cardId:b}=f.requireCardArgs(r),y=chunkLPXVVMQT_cjs.a(r,"turn_id");return R(r,g),u().manageAddChatAttachment({cardId:b,role:chunkLPXVVMQT_cjs.a(r,"role")||"user",...y?{turn:y}:{},files:[{file_name:chunkLPXVVMQT_cjs.a(r,"file_name"),content_type:chunkLPXVVMQT_cjs.a(r,"content_type")||"application/octet-stream",...typeof r.text=="string"?{text:r.text}:{},...typeof r.base64=="string"?{base64:r.base64}:{},...Array.isArray(r.bytes)?{bytes:r.bytes}:{}}]})}return {"list-runtime-cards":r=>(R(r,"list-runtime-cards"),u().listRuntimeCards()),"sse.subscribe-chat":r=>f.subscribeChat(r),"sse.unsubscribe-chat":r=>f.unsubscribeChat(r),"sse.watch-channel":r=>f.watchChannel(r,true),"sse.unwatch-channel":r=>f.watchChannel(r,false),"getstate.is-chat-processing":r=>f.getChatProcessing(r),"setstate.chat-processing-started":r=>f.setChatProcessing(r,true),"setstate.chat-processing-done":r=>f.setChatProcessing(r,false),"getstate.card-private":r=>f.getCardMeta(r),"setstate.card-private":r=>f.setCardMeta(r),"manage.upload-card-file":r=>{let g=chunkLPXVVMQT_cjs.a(r,"card_id"),b=chunkLPXVVMQT_cjs.a(r,"file_name"),y=chunkLPXVVMQT_cjs.a(r,"content_type")||"application/octet-stream",c=chunkLPXVVMQT_cjs.f(r);if(R(r,"manage.upload-card-file"),!g)throw Object.assign(new Error("manage.upload-card-file requires card_id"),{statusCode:400});if(!b)throw Object.assign(new Error("manage.upload-card-file requires file_name"),{statusCode:400});if(!c)throw Object.assign(new Error("manage.upload-card-file requires args.bytes, args.text, or args.base64"),{statusCode:400});return i(g,b,y,c,{inChat:false})},"manage.add-chat-attachment":r=>_(r,"manage.add-chat-attachment"),"manage.add-chat-attachement":r=>_(r,"manage.add-chat-attachement"),"manage.add-chat-entry-and-any-attachments":r=>{let{cardId:g}=f.requireCardArgs(r),b=chunkLPXVVMQT_cjs.a(r,"role")||"user",y=chunkLPXVVMQT_cjs.a(r,"turn_id");return R(r,"manage.add-chat-entry-and-any-attachments"),u().manageAddChatEntryAndAnyAttachments({cardId:g,role:b,...typeof r.text=="string"?{text:r.text}:{},...y?{turn:y}:{},...Array.isArray(r.files)?{files:r.files}:{}})},"manage.patch-card":r=>{let{cardId:g}=f.requireCardArgs(r);return R(r,"manage.patch-card"),u().managePatchCard({cardId:g,patch:chunkLPXVVMQT_cjs.c(r,"patch")})},"manage.upsert-card":r=>{let{cardId:g}=f.requireCardArgs(r);return R(r,"manage.upsert-card"),u().manageUpsertCard({cardId:g,candidateCardContent:chunkLPXVVMQT_cjs.c(r,"candidate_card_content")})},"manage.remove-card":r=>{let{cardId:g}=f.requireCardArgs(r);return R(r,"manage.remove-card"),u().manageRemoveCard({cardId:g})},"manage.admin-read-card":async r=>{let{cardId:g}=f.requireCardArgs(r);return {status:"success",data:{cards:await u().adminReadCard({cardId:g})}}},"manage.admin-upsert-card":r=>{let g=chunkLPXVVMQT_cjs.a(r,"board_id"),b=chunkLPXVVMQT_cjs.a(r,"card_id");if(!g)throw Object.assign(new Error("manage.admin-upsert-card requires board_id"),{statusCode:400});if(!b)throw Object.assign(new Error("manage.admin-upsert-card requires card_id"),{statusCode:400});if(g!==e)throw Object.assign(new Error(`Unknown board_id: ${g}`),{statusCode:400});return u().adminUpsertCard({cardId:b,candidateCardContent:chunkLPXVVMQT_cjs.c(r,"candidate_card_content")})}}}function ye(a){let{boardContexts:e,cardOwnerIndex:i,cardContextForCard:u,readStatusSnapshot:f,readDataObjectsByToken:R,readCardRuntimeArtifacts:_,readCardFromStore:r,readCardDefinitions:g,processAccumulatedLaneInternal:b,reportSourceFetched:y,reportSourceFetchFailure:c,uploadCardFile:C,chatStorePublic:m,serverUrl:w,apiBasePath:S}=a;function l(){return e[0]??null}function h(){return {async status(){let n=await f();return n==null?{status:"fail",error:"Board status is unavailable"}:{status:"success",data:n}},async getOutputsDataObject(n){let t=n?.params?.key;return t?{status:"success",data:(await R())[t]}:{status:"fail",error:"getOutputsDataObject requires params.key"}},async getOutputsComputedValues(n){let t=n?.params?.key;return t?{status:"success",data:(await _())[t]?.computed_values}:{status:"fail",error:"getOutputsComputedValues requires params.key"}},async getOutputsFetchedSources(n){let t=n?.params?.key;if(!t)return {status:"fail",error:"getOutputsFetchedSources requires params.key"};let o=u(t)??l();return o?o.boardOps.getOutputsFetchedSources({params:{key:t}}):{status:"fail",error:"Board context is unavailable"}},async removeCard(n){let t=n?.params?.id;if(!t)return {status:"fail",error:"removeCard requires params.id"};let o=u(t)??l();return o?o.boardOps.removeCard({params:{id:t}}):{status:"fail",error:"Board context is unavailable"}},async upsertCard(n){let t=n?.params?.cardId;if(!t)return {status:"fail",error:"upsertCard requires params.cardId"};let o=u(t)??l();if(!o)return {status:"fail",error:"Board context is unavailable"};let k=await o.boardOps.upsertCard({params:{cardId:t,restart:n.params.restart===true}});if(k.status!=="success")return k;if(chunkBQUQTOPB_cjs.a(o.boardAdapter)){let P=await b(true);if(P.status!=="success")return P}return k}}}function I(){let n=()=>{let t=l();if(!t?.nonCore)throw new Error("Board non-core adapter is not configured for MCP preflight/discovery tools");return t.nonCore};return {describeTaskExecutorCapabilities(t){return n().describeTaskExecutorCapabilities(t)},validateCardPreflight(t){return n().validateCardPreflight(t)},evalCardCompute(t){return n().evalCardCompute(t)},probeSourcePreflight(t){return n().probeSourcePreflight(t)},runSourcePreflight(t){return n().runSourcePreflight(t)},simulateCardCycle(t){return n().simulateCardCycle(t)}}}function s(){return {async get(n){let t=typeof n.params?.id=="string"?n.params.id:void 0;if(t){let o=await r(t);return o?{status:"success",data:{cards:[o]}}:{status:"success",data:{cards:[]}}}return {status:"success",data:{cards:await g()}}},async set(n){let t=n.body;if(t==null)return {status:"fail",error:"set requires a body (card object or array of cards)"};let o=Array.isArray(t)?t:[t];for(let k of o){let P=k,O=typeof P.id=="string"?P.id:"";if(!O)return {status:"fail",error:"each card must have a string `id` field"};let D=i.get(O)??0,L=e[D]??l();if(!L)return {status:"fail",error:"Board context is unavailable"};let T=await L.cardStoreOps.set({body:P});if(T.status!=="success")return T;i.set(O,D);}return {status:"success",data:{count:o.length}}},async del(n){let t=[n.params?.id,...n.body?.ids??[]].filter(o=>typeof o=="string"&&!!o);if(t.length===0)return {status:"fail",error:"del requires body.ids (string[]) or params.id"};for(let o of t){let k=u(o)??l();if(!k)return {status:"fail",error:"Board context is unavailable"};let P=await k.cardStoreOps.del({params:{id:o}});if(P.status!=="success")return P;i.delete(o);}return {status:"success",data:{count:t.length}}},async patch(n){let t=typeof n.params?.id=="string"?n.params.id:void 0,o=typeof n.params?.path=="string"?n.params.path:void 0;if(!t||!o)return {status:"fail",error:"patch requires params.id and params.path"};let k=u(t)??l();return k?k.cardStoreOps.patch(n):{status:"fail",error:"Board context is unavailable"}},async appendFiles(n){let t=typeof n.params?.id=="string"?n.params.id:void 0;if(!t)return {status:"fail",error:"appendFiles requires params.id"};let o=u(t)??l();return o?o.cardStoreOps.appendFiles(n):{status:"fail",error:"Board context is unavailable"}}}}function d(){return chunkDQPBAB5Z_cjs.a({board:h(),nonCore:I(),cardStore:s(),chatStore:m,processAccumulated:()=>b(true),sourceFetchDone:({token:n,ref:t})=>y(n,t),sourceFetchFailed:({token:n,reason:t})=>c(n,t),uploadCardFile({cardId:n,fileName:t,contentType:o,bytes:k,suppressChatRecordWrite:P}){return C(n,t,o,k,{inChat:true,...P===true?{suppressChatRecordWrite:true}:{}})},buildFileDownloadUrl({cardId:n,fileIdx:t,storedName:o}){let k=`${w||""}${S}/cards/${encodeURIComponent(n)}/files/${t}`;return o?`${k}?sn=${encodeURIComponent(o)}`:k},readFetchedSourceJsonByRef({cardId:n,ref:t}){let o=u(n)??l();if(!o||chunkBQUQTOPB_cjs.a(o.boardAdapter))return null;let O=o.boardAdapter.resolveBlob(chunkVQCIOKJV_cjs.b(t)).trim();return O?JSON.parse(O):null}})}return {mcpBoardFacade:h,mcpNonCoreFacade:I,mcpCardStoreFacade:s,createMcpFacade:d}}exports.a=J;exports.b=X;exports.c=Q;exports.d=z;exports.e=Y;exports.f=j;exports.g=N;exports.h=q;exports.i=E;exports.j=oe;exports.k=ie;exports.l=ce;exports.m=pe;exports.n=me;exports.o=fe;exports.p=ye;//# sourceMappingURL=chunk-3S7LV2HZ.cjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-3S7LV2HZ.cjs.map
|