yaml-flow 8.11.2 → 8.11.4
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 +5 -5
- package/browser/server-runtime-controlface.js +5 -5
- package/examples/board/test/server-http-test-browser.ts +9 -1
- package/examples/board/test/server-http-test.js +15 -19
- package/lib/board-live-cards-node.cjs +2 -2
- package/lib/board-live-cards-node.d.cts +2 -2
- package/lib/board-live-cards-node.d.ts +2 -2
- package/lib/board-live-cards-node.js +2 -2
- package/lib/board-live-cards-public.cjs +1 -1
- package/lib/board-live-cards-public.js +1 -1
- package/lib/board-live-cards-server-runtime.cjs +1 -1
- package/lib/board-live-cards-server-runtime.d.cts +1 -1
- package/lib/board-live-cards-server-runtime.d.ts +1 -1
- package/lib/board-live-cards-server-runtime.js +1 -1
- package/lib/board-livegraph-runtime/index.cjs +1 -1
- package/lib/board-livegraph-runtime/index.d.cts +1 -0
- package/lib/board-livegraph-runtime/index.d.ts +1 -0
- package/lib/board-livegraph-runtime/index.js +1 -1
- package/lib/chunk-37JSBRZO.js +2 -0
- package/lib/{chunk-ZCU5O2LR.js → chunk-4BEQXKRF.js} +2 -2
- package/lib/chunk-5VTIOM2U.js +3 -0
- package/lib/chunk-BAG7MHZP.cjs +3 -0
- package/lib/chunk-EZOXABJ2.js +3 -0
- package/lib/chunk-HVLWVMG6.cjs +3 -0
- package/lib/chunk-LRO5AL75.cjs +2 -0
- package/lib/chunk-MQAVZUXB.cjs +3 -0
- package/lib/chunk-WHKT5HN4.js +3 -0
- package/lib/{chunk-FFHG3CFU.cjs → chunk-Z26U6RSG.cjs} +2 -2
- package/lib/cloud-storage.cjs +1 -1
- package/lib/cloud-storage.js +1 -1
- package/lib/firestore-storage/index.cjs +1 -1
- package/lib/firestore-storage/index.js +1 -1
- package/lib/index.cjs +2 -2
- package/lib/index.js +1 -1
- package/lib/localstorage-storage/index.cjs +1 -1
- package/lib/localstorage-storage/index.js +1 -1
- package/lib/server-jobs-queue-runner/index.d.cts +1 -1
- package/lib/server-jobs-queue-runner/index.d.ts +1 -1
- package/lib/server-runtime/index.cjs +1 -1
- package/lib/server-runtime/index.d.cts +2 -2
- package/lib/server-runtime/index.d.ts +2 -2
- package/lib/server-runtime/index.js +1 -1
- package/lib/server-runtime-agentface/index.d.cts +1 -1
- package/lib/server-runtime-agentface/index.d.ts +1 -1
- package/lib/server-runtime-controlface/index.cjs +1 -1
- package/lib/server-runtime-controlface/index.d.cts +1 -1
- package/lib/server-runtime-controlface/index.d.ts +1 -1
- 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 +7 -4
- package/lib/server-runtime-core/index.d.ts +7 -4
- package/lib/server-runtime-core/index.js +1 -1
- package/lib/server-runtime-watchers/index.d.cts +3 -3
- package/lib/server-runtime-watchers/index.d.ts +3 -3
- package/lib/server-runtime-webhooks/index.d.cts +1 -1
- package/lib/server-runtime-webhooks/index.d.ts +1 -1
- package/lib/{sse-hub-D_94fV87.d.ts → sse-hub-D_QHswxL.d.ts} +1 -1
- package/lib/{sse-hub-BRBvymHR.d.cts → sse-hub-XO6crN9o.d.cts} +1 -1
- package/lib/{types-BsqzUZNl.d.ts → types-B8Yieskx.d.ts} +2 -0
- package/lib/{types-DxhB6Toz.d.cts → types-gTf9pAyC.d.cts} +2 -0
- package/package.json +1 -1
- package/lib/chunk-42ZOYXEV.cjs +0 -3
- package/lib/chunk-AHW6EMUO.js +0 -3
- package/lib/chunk-CZ6ZFWFT.js +0 -2
- package/lib/chunk-EYBDAEVO.cjs +0 -3
- package/lib/chunk-HFI2NAZJ.js +0 -3
- package/lib/chunk-LDVJPFIW.js +0 -3
- package/lib/chunk-NMOUBZXX.cjs +0 -2
- package/lib/chunk-ZOZ7ZDGA.cjs +0 -3
|
@@ -209,8 +209,15 @@ function reducePayload(payload) {
|
|
|
209
209
|
if (payload && Array.isArray(payload.cardDefinitions)) {
|
|
210
210
|
NS.latestFullPayload = payload;
|
|
211
211
|
NS.boardState = buildBoardState(payload, NS.boardState, selectLiveCardModelFromPayload);
|
|
212
|
+
const publishedSummary = extractStatusSummaryFromPayload(payload);
|
|
213
|
+
if (publishedSummary) {
|
|
214
|
+
NS.statusSummary = publishedSummary;
|
|
215
|
+
}
|
|
212
216
|
NS.statusGeneration += 1;
|
|
213
217
|
syncProjectedStateFromBoardState();
|
|
218
|
+
if (publishedSummary) {
|
|
219
|
+
NS.statusSummary = publishedSummary;
|
|
220
|
+
}
|
|
214
221
|
return [];
|
|
215
222
|
}
|
|
216
223
|
|
|
@@ -231,6 +238,7 @@ function reducePayload(payload) {
|
|
|
231
238
|
|
|
232
239
|
for (const notification of notifications) {
|
|
233
240
|
if (notification?.kind === 'status' && notification.status?.summary) {
|
|
241
|
+
NS.statusSummary = notification.status.summary;
|
|
234
242
|
NS.statusGeneration += 1;
|
|
235
243
|
}
|
|
236
244
|
if (notification && (notification.kind === 'card_removed' || notification.kind === 'card_refreshed') && notification.cardId) {
|
|
@@ -1574,7 +1582,7 @@ try {
|
|
|
1574
1582
|
console.log('[T3c] ok: fresh /sse first payload hydrated the current board state');
|
|
1575
1583
|
|
|
1576
1584
|
console.log('\n=== TS: one-shot, raw framing, replay, delta ordering, and chat hydration ===');
|
|
1577
|
-
const tsExpectedChatRes = await httpMcp('inspect.chat-messages-on-cards', { card_id: CHAT_CARD_ID,
|
|
1585
|
+
const tsExpectedChatRes = await httpMcp('inspect.chat-messages-on-cards', { card_id: CHAT_CARD_ID, tail_turns: 1 });
|
|
1578
1586
|
assert(tsExpectedChatRes.status === 200, `TS inspect.chat-messages-on-cards returned ${tsExpectedChatRes.status}`);
|
|
1579
1587
|
const tsExpectedChatMessages = normalizeHydratedChatMessages(tsExpectedChatRes.data?.data?.messages || []);
|
|
1580
1588
|
|
|
@@ -62,6 +62,7 @@ const T0_CARD_FILES = [
|
|
|
62
62
|
'cardT-portfolio-value.json',
|
|
63
63
|
];
|
|
64
64
|
const T0_EXPECTED_CARD_IDS = ['card-market-prices', 'card-portfolio', 'card-portfolio-value'];
|
|
65
|
+
const BASE_RUNTIME_CARD_COUNT = T0_EXPECTED_CARD_IDS.length;
|
|
65
66
|
const T2_FILE_CARD_ID = 'card-market-prices';
|
|
66
67
|
const CHAT_CARD_ID = 'card-portfolio';
|
|
67
68
|
|
|
@@ -857,12 +858,12 @@ try {
|
|
|
857
858
|
console.log(`[T0.2] upserted ${cardId}`);
|
|
858
859
|
}
|
|
859
860
|
|
|
860
|
-
console.log(
|
|
861
|
+
console.log(`\n=== T0 Step 3: wait for all ${BASE_RUNTIME_CARD_COUNT} runtime cards to complete via SSE ===`);
|
|
861
862
|
const t0Summary = await waitUntil(() => {
|
|
862
863
|
const s = NS.statusSummary;
|
|
863
|
-
if (s && s.card_count ===
|
|
864
|
+
if (s && s.card_count === BASE_RUNTIME_CARD_COUNT && s.completed === BASE_RUNTIME_CARD_COUNT) return s;
|
|
864
865
|
return false;
|
|
865
|
-
}, 60_000,
|
|
866
|
+
}, 60_000, `T0 initial completion (${BASE_RUNTIME_CARD_COUNT} runtime cards)`);
|
|
866
867
|
assert(t0Summary.failed === 0, `T0 expected failed=0, got ${t0Summary.failed}`);
|
|
867
868
|
console.log(`[T0.3] completed: ${JSON.stringify(t0Summary)}`);
|
|
868
869
|
|
|
@@ -872,19 +873,14 @@ try {
|
|
|
872
873
|
assert(statusMcpRes.data?.status === 'success', `inspect.board-runtime-status failed: ${JSON.stringify(statusMcpRes.data)}`);
|
|
873
874
|
const mcpSummary = statusMcpRes.data?.data?.summary;
|
|
874
875
|
assert(mcpSummary, 'summary missing from inspect.board-runtime-status');
|
|
875
|
-
assert(mcpSummary.card_count ===
|
|
876
|
-
`expected card_count=${
|
|
876
|
+
assert(mcpSummary.card_count === BASE_RUNTIME_CARD_COUNT,
|
|
877
|
+
`expected card_count=${BASE_RUNTIME_CARD_COUNT}, got ${mcpSummary.card_count}`);
|
|
877
878
|
assert(mcpSummary.completed === mcpSummary.card_count, `not all complete: ${JSON.stringify(mcpSummary)}`);
|
|
878
879
|
console.log(`[T0.4] board-status: ${JSON.stringify(mcpSummary)}`);
|
|
879
880
|
|
|
880
881
|
const t0OneShotPayload = await waitForFirstSsePayload(`${BASE}/sse?one-shot`);
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
`T0 sys_keys_board_state missing from one-shot payload: ${JSON.stringify(t0OneShotPayload?.dataObjectsByToken)}`);
|
|
884
|
-
assert(JSON.stringify(t0SysKeysBoardState) === JSON.stringify({
|
|
885
|
-
card_ids: T0_EXPECTED_CARD_IDS,
|
|
886
|
-
data_object_keys: ['holdings', 'positions', 'quotes'],
|
|
887
|
-
}), `T0 sys_keys_board_state mismatch: ${JSON.stringify(t0SysKeysBoardState)}`);
|
|
882
|
+
assert(!Object.prototype.hasOwnProperty.call(t0OneShotPayload?.dataObjectsByToken ?? {}, 'sys_keys_board_state'),
|
|
883
|
+
`T0 one-shot payload should not expose sys_keys_board_state: ${JSON.stringify(t0OneShotPayload?.dataObjectsByToken)}`);
|
|
888
884
|
|
|
889
885
|
// Verify computed_values arrived for portfolio-value card
|
|
890
886
|
const t0Positions = NS.computedValues['card-portfolio-value']?.positions;
|
|
@@ -1322,7 +1318,7 @@ try {
|
|
|
1322
1318
|
assert(t3eUpsertOtherRes.data?.status === 'success', `T3e manage.upsert-card(${t3eOtherCardId}) failed: ${JSON.stringify(t3eUpsertOtherRes.data)}`);
|
|
1323
1319
|
await waitUntil(() => {
|
|
1324
1320
|
const s = NS.statusSummary;
|
|
1325
|
-
if (s && s.card_count ===
|
|
1321
|
+
if (s && s.card_count === BASE_RUNTIME_CARD_COUNT + 1) return s;
|
|
1326
1322
|
return false;
|
|
1327
1323
|
}, 30_000, 'T3e extra chat card visible in board summary');
|
|
1328
1324
|
|
|
@@ -1436,9 +1432,9 @@ try {
|
|
|
1436
1432
|
assert(t3eRemoveOtherRes.data?.status === 'success', `T3e manage.remove-card(${t3eOtherCardId}) failed: ${JSON.stringify(t3eRemoveOtherRes.data)}`);
|
|
1437
1433
|
await waitUntil(() => {
|
|
1438
1434
|
const s = NS.statusSummary;
|
|
1439
|
-
if (s && s.card_count ===
|
|
1435
|
+
if (s && s.card_count === BASE_RUNTIME_CARD_COUNT) return s;
|
|
1440
1436
|
return false;
|
|
1441
|
-
}, 30_000,
|
|
1437
|
+
}, 30_000, `T3e cleanup card_count back to ${BASE_RUNTIME_CARD_COUNT}`);
|
|
1442
1438
|
}
|
|
1443
1439
|
}
|
|
1444
1440
|
|
|
@@ -1492,7 +1488,7 @@ try {
|
|
|
1492
1488
|
console.log('[T3c] ok: fresh /sse first payload hydrated the current board state');
|
|
1493
1489
|
|
|
1494
1490
|
console.log('\n=== TS: one-shot, raw framing, replay, delta ordering, and chat hydration ===');
|
|
1495
|
-
const tsExpectedChatRes = await httpMcp('inspect.chat-messages-on-cards', { card_id: CHAT_CARD_ID,
|
|
1491
|
+
const tsExpectedChatRes = await httpMcp('inspect.chat-messages-on-cards', { card_id: CHAT_CARD_ID, tail_turns: 1 });
|
|
1496
1492
|
assert(tsExpectedChatRes.status === 200, `TS inspect.chat-messages-on-cards returned ${tsExpectedChatRes.status}`);
|
|
1497
1493
|
const tsExpectedChatMessages = normalizeHydratedChatMessages(tsExpectedChatRes.data?.data?.messages || []);
|
|
1498
1494
|
|
|
@@ -1540,7 +1536,7 @@ try {
|
|
|
1540
1536
|
|
|
1541
1537
|
for (let idx = 0; idx < tsTempCards.length; idx += 1) {
|
|
1542
1538
|
const tsCard = tsTempCards[idx];
|
|
1543
|
-
const tsExpectedCardCount =
|
|
1539
|
+
const tsExpectedCardCount = BASE_RUNTIME_CARD_COUNT + idx + 1;
|
|
1544
1540
|
const tsFrameStart = tsRawFrames.length;
|
|
1545
1541
|
const tsUpsertRes = await httpMcp('manage.upsert-card', {
|
|
1546
1542
|
card_id: tsCard.id,
|
|
@@ -1596,9 +1592,9 @@ try {
|
|
|
1596
1592
|
}
|
|
1597
1593
|
await waitUntil(() => {
|
|
1598
1594
|
const summary = NS.statusSummary;
|
|
1599
|
-
if (summary && summary.card_count ===
|
|
1595
|
+
if (summary && summary.card_count === BASE_RUNTIME_CARD_COUNT) return summary;
|
|
1600
1596
|
return false;
|
|
1601
|
-
}, 30_000,
|
|
1597
|
+
}, 30_000, `TS cleanup card_count back to ${BASE_RUNTIME_CARD_COUNT}`);
|
|
1602
1598
|
} finally {
|
|
1603
1599
|
tsDeltaClient.close();
|
|
1604
1600
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var chunkMCPADH33_cjs=require('./chunk-MCPADH33.cjs'),chunkCPJXGK2T_cjs=require('./chunk-CPJXGK2T.cjs'),chunkNBJTYAYN_cjs=require('./chunk-NBJTYAYN.cjs'),chunkGPCMBPLK_cjs=require('./chunk-GPCMBPLK.cjs'),chunkH4TYOSMD_cjs=require('./chunk-H4TYOSMD.cjs'),chunk3CZCGNY4_cjs=require('./chunk-3CZCGNY4.cjs');require('./chunk-6EJRZHFP.cjs'),require('./chunk-
|
|
1
|
+
'use strict';var chunkMCPADH33_cjs=require('./chunk-MCPADH33.cjs'),chunkCPJXGK2T_cjs=require('./chunk-CPJXGK2T.cjs'),chunkNBJTYAYN_cjs=require('./chunk-NBJTYAYN.cjs'),chunkGPCMBPLK_cjs=require('./chunk-GPCMBPLK.cjs'),chunkH4TYOSMD_cjs=require('./chunk-H4TYOSMD.cjs'),chunk3CZCGNY4_cjs=require('./chunk-3CZCGNY4.cjs');require('./chunk-6EJRZHFP.cjs'),require('./chunk-HVLWVMG6.cjs');var chunkWRMOGPRG_cjs=require('./chunk-WRMOGPRG.cjs'),chunkBAG7MHZP_cjs=require('./chunk-BAG7MHZP.cjs'),chunk7JVHYHT2_cjs=require('./chunk-7JVHYHT2.cjs'),chunkVQCIOKJV_cjs=require('./chunk-VQCIOKJV.cjs');require('./chunk-G4XXRHL2.cjs'),require('./chunk-LODXIALE.cjs');var chunkGHUW6P4G_cjs=require('./chunk-GHUW6P4G.cjs'),chunkQBEQL4TL_cjs=require('./chunk-QBEQL4TL.cjs'),chunkQEHKMLHA_cjs=require('./chunk-QEHKMLHA.cjs');require('./chunk-UJ7ZTV4J.cjs');var chunk5XLFPPTY_cjs=require('./chunk-5XLFPPTY.cjs'),chunkSDJ3747Q_cjs=require('./chunk-SDJ3747Q.cjs'),chunkP7ZCDICS_cjs=require('./chunk-P7ZCDICS.cjs');require('./chunk-2RIHC5TZ.cjs'),require('./chunk-GNFE24S7.cjs');var child_process=require('child_process'),i=require('fs'),qe=require('os'),w=require('path'),Le=require('net'),url=require('url'),crypto=require('crypto'),module$1=require('module'),properLockfile=require('proper-lockfile');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var i__namespace=/*#__PURE__*/_interopNamespace(i);var qe__namespace=/*#__PURE__*/_interopNamespace(qe);var w__namespace=/*#__PURE__*/_interopNamespace(w);var Le__namespace=/*#__PURE__*/_interopNamespace(Le);function C(...e){return w__namespace.join(...e)}function Ne(e){return w__namespace.isAbsolute(e)}function ue(){return crypto.randomUUID()}function Qe(e){return crypto.createHash("sha256").update(e).digest("hex")}function Je(e){return w__namespace.dirname(url.fileURLToPath(e))}function Ft(e){if(typeof e=="object"&&e!==null){let{command:r,args:o=[],...n}=e,s=Oe(r,o);return {...n,command:s.command,args:s.args}}let t=De(e);if(t.length===0)throw new Error(`Empty command spec: ${JSON.stringify(e)}`);return Oe(t[0],t.slice(1))}function Oe(e,t){return /^(node|node\.exe)$/i.test(e)?{command:process.execPath,args:t}:/\.m?js$/i.test(e)?{command:process.execPath,args:[e,...t]}:{command:e,args:t}}function De(e){let t=[],r="",o=null;for(let n of e.trim()){if(o){n===o?o=null:r+=n;continue}if(n==='"'||n==="'"){o=n;continue}if(/\s/.test(n)){r&&(t.push(r),r="");continue}r+=n;}if(o)throw new Error(`Unterminated quote in command: ${e}`);return r&&t.push(r),t}function Ke(e){return process.platform==="win32"&&/\.(cmd|bat)$/i.test(e)}function We(e,t){let{command:r,args:o=[],cwd:n,env:s,timeoutMs:u}=e;return child_process.execFileSync(r,o,{shell:Ke(r),timeout:u,encoding:t?.encoding??"utf-8",cwd:n,windowsHide:true,env:s?{...process.env,...s}:void 0,input:t?.input})}function $t(e,t){let{command:r,args:o=[],cwd:n,env:s,timeoutMs:u=3e4}=e;child_process.execFile(r,o,{shell:Ke(r),encoding:"utf8",windowsHide:true,timeout:u,maxBuffer:10*1024*1024,cwd:n,env:s?{...process.env,...s}:void 0},(p,x,c)=>t(p??null,x,c));}function He(e,t,r){let o=w__namespace.join(e,"board-live-cards-cli.js");if(i__namespace.existsSync(o))return {cmd:process.execPath,args:[o,t,...r]};let n=w__namespace.join(e,"board-live-cards-cli.ts"),u=[w__namespace.join(e,"..","..","..","node_modules","tsx","dist","cli.mjs"),w__namespace.join(e,"..","..","node_modules","tsx","dist","cli.mjs"),w__namespace.join(e,"..","..","..","node_modules",".bin","tsx"),w__namespace.join(e,"..","..","node_modules",".bin","tsx")].find(x=>i__namespace.existsSync(x));return i__namespace.existsSync(n)&&u?{cmd:process.execPath,args:[u,n,t,...r]}:{cmd:process.platform==="win32"?"npx.cmd":"npx",args:["tsx",n,t,...r]}}function Ve(e){let t=w__namespace.join(e,"board-live-cards-cli.mjs");if(i__namespace.existsSync(t))return t;let r=w__namespace.join(e,"..","..","..","dev","board-live-cards-cli.js");if(i__namespace.existsSync(r))return r;let o=w__namespace.join(e,"..","..","dev","board-live-cards-cli.js");if(i__namespace.existsSync(o))return o;let n=w__namespace.join(e,"board-live-cards-cli.js");if(i__namespace.existsSync(n))return n;throw new Error(`resolveBoardCliCallbackTarget: cannot find callback target in ${e} (expected dev/board-live-cards-cli.js wrapper, ${n}, or ${t})`)}function Mt(e){return process.platform==="win32"?`\\\\.\\pipe\\${e}`:w__namespace.join(qe__namespace.tmpdir(),`${e}.sock`)}var ce=new Map;function Ue(e,t,r){if(t.length===0)return;let o=t.map(p=>JSON.stringify(p)).join(`
|
|
2
2
|
`)+`
|
|
3
3
|
`,n=ce.get(e);if(n&&!n.socket.destroyed){n.ready?n.socket.write(o):n.queue.push(o);return}let s=Mt(e),u=Le__namespace.createConnection(s);n={socket:u,ready:false,queue:[o]},ce.set(e,n),u.on("connect",()=>{n.ready=true;for(let p of n.queue)u.write(p);n.queue.length=0;}),u.on("error",p=>{r?.(`[named-pipe publish] ${s}: ${p instanceof Error?p.message:String(p)}`),ce.delete(e);}),u.on("close",()=>{ce.delete(e);});}function ze(){return {executeSync(e,t,r){return We({command:e,args:t,cwd:r?.cwd,timeoutMs:r?.timeout,env:r?.env},{encoding:r?.encoding,input:r?.input})},executeAsync(e,t,r){$t({command:e,args:t},r);},resolveInvocation(e,t){let r=Ft({command:e,args:t});return {cmd:r.command,args:r.args??[]}},splitCommand:De}}function xe(e){return {id:e.id??"board-worker",pollIntervalMs:e.pollIntervalMs,visibilityMs:e.visibilityMs,concurrency:e.concurrency,maxAttempts:e.maxAttempts,async lease(t){return e.workerStore.leaseRequests(t).map(r=>({id:r.messageId,attempt:r.attempt,message:r.request,ack:()=>e.workerStore.ackRequest(r.messageId,r.leaseToken),nack:o=>e.workerStore.nackRequest(r.messageId,r.leaseToken,o)}))},async handle(t){await e.handleRequest(t.args,t);},onError:e.onError}}function we(e){return {id:e.id,pollIntervalMs:e.pollIntervalMs,visibilityMs:e.visibilityMs,concurrency:e.concurrency,maxAttempts:e.maxAttempts,async lease(t){return e.queueStorage.lease(t).map(r=>({id:r.id,attempt:r.attempt,message:r.body,ack:()=>e.queueStorage.ack(r.id,r.leaseToken),nack:o=>e.queueStorage.nack(r.id,r.leaseToken,o)}))},handle:e.handleMessage,onError:e.onError}}async function Ge(e,t){try{await e.handle(t.message,t),await t.ack();}catch(r){let o=t.attempt>=Math.max(1,Math.floor(e.maxAttempts??5));await t.nack({dead:o,reason:r instanceof Error?r.message:String(r)}),e.onError?.(r,t);}}function Ye(e){let t=Math.max(1,Math.floor(e.pollIntervalMs??250)),r=Math.max(1,Math.floor(e.visibilityMs??6e4)),o=Math.max(1,Math.floor(e.concurrency??1)),n=false,s=false;async function u(){if(!(n||s)){s=true;try{let x=await e.lease({max:o,visibilityMs:r});for(let c of x)await Ge(e,c);}finally{s=false;}}}let p=setInterval(()=>{u();},t);return typeof p.unref=="function"&&p.unref(),u(),()=>{n=true,clearInterval(p);}}async function _t(e){let t=Math.max(1,Math.floor(e.visibilityMs??6e4)),r=Math.max(1,Math.floor(e.concurrency??1)),o=await e.lease({max:r,visibilityMs:t});for(let n of o)await Ge(e,n);return o.length}async function de(e,t){let r=Math.max(1,Math.floor(t?.maxPasses??256)),o=0;for(let n=0;n<r;n+=1){let s=await _t(e);if(o+=s,s<=0)return o}throw new Error(`drainQueueLaneToIdle exceeded ${r} passes for lane "${e.id}"`)}function Ot(e){let r=(Array.isArray(e)?e:e.lanes).map(o=>Ye(o));return ()=>{for(let o of r)o();}}var Lt=module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('board-live-cards-node.cjs', document.baseURI).href)));function Nt(e){return typeof e=="object"?e:chunkVQCIOKJV_cjs.b(e)}function Xe(e){let t=w__namespace.basename(String(e||"").trim());if(!t)throw new Error(`resolveYamlFlowCliPath: expected non-empty cli file name, got ${JSON.stringify(e)}`);let r=w__namespace.dirname(Lt.resolve("yaml-flow/package.json")),o=t.replace(/\.[^.]+$/,""),n=w__namespace.join(r,"cli","bundled",`${o}.mjs`);if(i__namespace.existsSync(n))return n;let s=w__namespace.join(r,"cli","node",t);if(i__namespace.existsSync(s))return s;throw new Error(`resolveYamlFlowCliPath: could not find ${t} under cli/bundled or cli/node in ${r}`)}function L(e){let t=Nt(e);return t.kind==="yaml-flow-cli"?Xe(t.value):t.value}function Qt(e,t){let r=L(e);switch(r){case "source-cli-task-executor":{let o=w__namespace.join(t,"source-cli-task-executor.js");if(i__namespace.existsSync(o))return {command:process.execPath,args:[o]};let n=w__namespace.join(t,"source-cli-task-executor.ts"),s=w__namespace.join(t,"..","..","node_modules","tsx","dist","cli.mjs"),u=w__namespace.join(t,"..","..","node_modules",".bin","tsx"),p=i__namespace.existsSync(s)?s:u;return i__namespace.existsSync(n)&&i__namespace.existsSync(p)?{command:process.execPath,args:[p,n]}:{command:process.execPath,args:[o]}}case "board-live-cards":{let{cmd:o,args:n}=He(t,"_",[]);return {command:o,args:n}}default:throw new Error(`resolveBuiltIn: unknown built-in name "${r}". Supported: source-cli-task-executor, board-live-cards`)}}function Jt(e,t){if(e.howToRun==="built-in"){let{command:o,args:n}=Qt(e.whatToRun,t);return {command:o,baseArgs:n}}let r=(typeof e.whatToRun=="object",L(e.whatToRun));switch(e.howToRun){case "local-node":return {command:process.execPath,baseArgs:[r]};case "local-python":return {command:process.platform==="win32"?"python":"python3",baseArgs:[r]};case "local-process":return {command:r,baseArgs:[]};default:throw new Error(`resolveBaseInvocation: howToRun "${e.howToRun}" is not a local transport`)}}function le(e,t){return Jt(e,t)}var be=new Map;function Dt(e,t){let r=String(e||"").trim();if(!r)throw new Error("registerInProcessExecutionHandler: key is required");be.set(r,t);}function Kt(e){let t=String(e||"").trim();t&&be.delete(t);}function et(e){let t=e.trim();if(!t)throw new Error("empty stdout");try{return JSON.parse(t)}catch{let r=t.split(/\r?\n/).filter(Boolean),o=r[r.length-1];return JSON.parse(o)}}function tt(e,t){return {...t,whatToRun:L(e.whatToRun),...e.extra?{extra:e.extra}:{}}}function ke(e,t,r="invokeExecutionRef"){return chunk3CZCGNY4_cjs.a(e,t,r)}function rt(e,t){if(e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.result=="string"&&e.data&&typeof e.data=="object"&&!Array.isArray(e.data))return {...e,...t||{}};if(e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.status=="string"){let o=e,n=o.status==="success"?"success":o.status==="fail"?"failure":o.status,s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:o.data===void 0?{}:{stdout:o.data};return {result:n,data:s,...typeof o.error=="string"?{error:o.error}:{},...t||{}}}return {result:"success",data:e&&typeof e=="object"&&!Array.isArray(e)?e:{stdout:e},...t||{}}}function q(e){return {result:"failure",data:{error:e}}}function V(e,t,r){let o=r?.label??"invokeExecutionRefSync",n=r?.cliDir??r?.cwd??process.cwd(),s;try{s=ke(e.argsMassaging,tt(e,t),o);}catch(h){let R=h instanceof Error?h.message:String(h);return q(R)}let u;try{u=le(e,n);}catch(h){let R=h instanceof Error?h.message:String(h);return q(`[${o}] ref resolution failed: ${R}`)}let p=[...u.baseArgs,...s.cmdArgs??[]],x=JSON.stringify(s.stdin??t),c=ze(),l;try{l=c.executeSync(u.command,p,{timeout:r?.timeoutMs??3e4,encoding:"utf-8",cwd:r?.cwd,input:x});}catch(h){let R=h,y=(R.stderr?String(R.stderr):"").trim(),d=typeof R.status=="number"?R.status:"unknown",f=y||R.message;return q(`[${o}] ref exited with status ${d}${f?`: ${f}`:""}`)}try{return rt(et(l))}catch{return {result:"success",data:{stdout:l.trim()}}}}async function Ze(e,t,r){let o=r?.label??"invokeExecutionRef",n;try{n=ke(e.argsMassaging,tt(e,t),o);}catch(h){let R=h instanceof Error?h.message:String(h);return q(R)}let s=L(e.whatToRun),u=n.headers?{"Content-Type":"application/json",...n.headers}:{"Content-Type":"application/json"},p=n.url??s,x;if(e.howToRun==="http:get"){let h=n.body&&typeof n.body=="object"&&!Array.isArray(n.body)?n.body:t,R=new URLSearchParams(Object.entries(h).filter(([,y])=>y!=null).map(([y,d])=>[y,String(d)]));R.size>0&&(p=`${p}${p.includes("?")?"&":"?"}${R.toString()}`);}else x=JSON.stringify(n.body??t);let c={method:e.howToRun==="http:get"?"GET":"POST",headers:u,body:x},l=0;for(;;)try{let h=await fetch(p,c);if(!h.ok){let f=await h.text().catch(()=>"");return q(`[${o}] HTTP ${h.status}${f?`: ${f}`:""}`)}let R={};h.headers.forEach((f,m)=>{R[m]=f;});let y=new Uint8Array(await h.arrayBuffer());if(y.byteLength===0)return {result:"success",data:{},headers:R};let d=new TextDecoder().decode(y);try{return rt(et(d),{headers:R})}catch{return {result:"success",data:{stdout:d},headers:R}}}catch(h){let R=h?.cause,y=R&&typeof R=="object"&&"code"in R?String(R.code||""):"";if((y==="ECONNRESET"||y==="UND_ERR_SOCKET")&&l===0){l+=1;continue}let f=h instanceof Error?h.message:String(h),m=R instanceof Error?`${R.name}: ${R.message}${y?` [${y}]`:""}`:R?String(R):"",S=n.url??s??"",a=`${f}${m?` (cause: ${m})`:""}${S?` url=${S}`:""}`;return q(`[${o}] ${a}`)}}async function Wt(e,t,r){let o=r?.label??"invokeExecutionRef",n=L(e.whatToRun).trim();if(!n)return q(`[${o}] in-process-loop requires a non-empty handler key`);let s=be.get(n);if(!s)return q(`[${o}] no in-process handler registered for: ${n}`);try{return await s(e,t,r)}catch(u){let p=u instanceof Error?u.message:String(u);return q(`[${o}] ${p}`)}}var Ht={"local-node":async(e,t,r)=>V(e,t,r),"local-python":async(e,t,r)=>V(e,t,r),"local-process":async(e,t,r)=>V(e,t,r),"built-in":async(e,t,r)=>V(e,t,r),"http:post":Ze,"http:get":Ze,"in-process-loop":Wt},Vt={"local-node":V,"local-python":V,"local-process":V,"built-in":V};async function Z(e,t,r){let o=r?.transports?.[e.howToRun]??Ht[e.howToRun];return o?o(e,t,r):q(`[${r?.label??"invokeExecutionRef"}] unsupported howToRun: ${e.howToRun}`)}function ve(e,t,r){let o=r?.syncTransports?.[e.howToRun]??Vt[e.howToRun];return o?o(e,t,r):q(`[${r?.label??"invokeExecutionRefSync"}] unsupported sync howToRun: ${e.howToRun}`)}function Ut(e){return {invoke(t,r){return Z(t,r,e)},invokeSync(t,r){return ve(t,r,e)}}}function zt(e,t,r){return ve(e,t,r)}function Ae(e={}){let t=e.resolveRef??(r=>r);return {...e.executorTimeouts?{executorTimeouts:e.executorTimeouts}:{},async invokeExecutor(r,o,n){let s=t(r);if(s.howToRun==="queue-storage")throw new Error("queue-storage does not support inline executor request/response");if(s.howToRun==="http:post"||s.howToRun==="in-process-loop"){let l=await chunkH4TYOSMD_cjs.h(s,{subcommand:o,...n?.input!==void 0?{input:n.input}:{}});return typeof l=="string"?l:l&&typeof l=="object"&&!Array.isArray(l)&&typeof l.stdout=="string"?String(l.stdout):JSON.stringify(l??{})}if(s.howToRun==="http:get"){let l=await Z(s,{subcommand:o,...n?.input!==void 0?{input:n.input}:{},...s.extra?{extra:s.extra}:{}},{cwd:process.cwd(),timeoutMs:n?.timeout??3e4,label:`invokeExecutor:${o}`});if(l.result!=="success"){let h=typeof l.data?.error=="string"?l.data.error:l.error;throw new Error(h||`executor request failed: ${l.result}`)}return typeof l.data?.stdout=="string"?l.data.stdout:JSON.stringify(l.data??{})}if(!e.resolveCliDir)throw new Error(`createNonCoreExecutorDispatcher: ref.howToRun="${s.howToRun}" requires opts.resolveCliDir`);let{command:u,baseArgs:p}=le(s,e.resolveCliDir()),x=s.extra?["--extra",Buffer.from(JSON.stringify(s.extra)).toString("base64")]:[],c=[...p,o,...x];return await new Promise((l,h)=>{let R=child_process.spawn(u,c,{cwd:process.cwd(),stdio:"pipe",windowsHide:true,shell:process.platform==="win32"&&/\.(cmd|bat)$/i.test(u)}),y=[],d=[],f=false,m=null,S=g=>{f||(f=true,m&&clearTimeout(m),h(g));},a=g=>{f||(f=true,m&&clearTimeout(m),l(g));};R.stdout.on("data",g=>{y.push(Buffer.from(g));}),R.stderr.on("data",g=>{d.push(Buffer.from(g));}),R.on("error",g=>{let v=g;v.stdout=Buffer.concat(y).toString("utf-8"),v.stderr=Buffer.concat(d).toString("utf-8"),S(v);}),R.on("close",g=>{let v=Buffer.concat(y).toString("utf-8"),b=Buffer.concat(d).toString("utf-8");if(g===0){a(v);return}let k=new Error(b.trim()||`executor exited with status ${g}`);k.stdout=v,k.stderr=b,S(k);}),n?.timeout&&n.timeout>0&&(m=setTimeout(()=>{R.kill();let g=new Error(`executor timed out after ${n.timeout}ms`);g.stdout=Buffer.concat(y).toString("utf-8"),g.stderr=Buffer.concat(d).toString("utf-8"),S(g);},n.timeout)),n?.input!==void 0?R.stdin.end(n.input):R.stdin.end();})}}}function B(e,t){if(process.platform!=="win32"){i__namespace.renameSync(e,t);return}let r=[10,20,40,80,160];for(let o=0;o<=r.length;o++)try{i__namespace.renameSync(e,t);return}catch(n){let s=n.code;if((s==="EPERM"||s==="EBUSY")&&o<r.length){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,r[o]);continue}throw n}}function U(e){function t(n){return w__namespace.join(e,...n.split("/"))}function r(n){return w__namespace.relative(e,n).replace(/\\/g,"/")}function o(n,s){if(i__namespace.existsSync(n))for(let u of i__namespace.readdirSync(n,{withFileTypes:true})){let p=w__namespace.join(n,u.name);if(u.isDirectory()){o(p,s);continue}u.isFile()&&s.push(r(p));}}return {read(n){let s=t(n);if(!i__namespace.existsSync(s))return null;try{return i__namespace.readFileSync(s,"utf-8")}catch{return null}},write(n,s){let u=t(n),p=`${u}.${process.pid}.${crypto.randomUUID()}.tmp`;i__namespace.mkdirSync(w__namespace.dirname(u),{recursive:true}),i__namespace.writeFileSync(p,s,"utf-8"),B(p,u);},exists(n){return i__namespace.existsSync(t(n))},remove(n){let s=t(n);try{i__namespace.existsSync(s)&&i__namespace.unlinkSync(s);}catch{}},readBytes(n){let s=t(n);if(!i__namespace.existsSync(s))return null;try{return new Uint8Array(i__namespace.readFileSync(s))}catch{return null}},writeBytes(n,s){let u=t(n),p=`${u}.${process.pid}.${crypto.randomUUID()}.tmp`;i__namespace.mkdirSync(w__namespace.dirname(u),{recursive:true}),i__namespace.writeFileSync(p,Buffer.from(s)),B(p,u);},listKeys(n){let s=[];o(e,s);let u=s.sort();return n?u.filter(p=>p.startsWith(n)):u},stat(n){let s=t(n);if(!i__namespace.existsSync(s))return null;try{let u=i__namespace.statSync(s);return {key:n,size:Number(u.size||0),updatedAt:new Date(u.mtimeMs).toISOString()}}catch{return null}},keyRef(n){return {kind:"fs-path",value:t(n)}},renameKey(n,s){let u=t(n);if(!i__namespace.existsSync(u))return false;let p=t(s);return i__namespace.mkdirSync(w__namespace.dirname(p),{recursive:true}),B(u,p),true}}}function Ie(){return {read(e){if(!i__namespace.existsSync(e))return null;try{return i__namespace.readFileSync(e,"utf-8")}catch{return null}},write(e,t){let r=`${e}.${process.pid}.${crypto.randomUUID()}.tmp`;i__namespace.mkdirSync(w__namespace.dirname(e),{recursive:true}),i__namespace.writeFileSync(r,t,"utf-8"),B(r,e);},exists(e){return i__namespace.existsSync(e)},remove(e){try{i__namespace.existsSync(e)&&i__namespace.unlinkSync(e);}catch{}},readBytes(e){if(!i__namespace.existsSync(e))return null;try{return new Uint8Array(i__namespace.readFileSync(e))}catch{return null}},writeBytes(e,t){let r=`${e}.${process.pid}.${crypto.randomUUID()}.tmp`;i__namespace.mkdirSync(w__namespace.dirname(e),{recursive:true}),i__namespace.writeFileSync(r,Buffer.from(t)),B(r,e);},stat(e){if(!i__namespace.existsSync(e))return null;try{let t=i__namespace.statSync(e);return {key:e,size:Number(t.size||0),updatedAt:new Date(t.mtimeMs).toISOString()}}catch{return null}},listKeys(e){return []},renameKey(e,t){return i__namespace.existsSync(e)?(i__namespace.mkdirSync(w__namespace.dirname(t),{recursive:true}),B(e,t),true):false}}}function D(e,t){let r=`${e}.${process.pid}.${crypto.randomUUID()}.tmp`;i__namespace.mkdirSync(w__namespace.dirname(e),{recursive:true}),i__namespace.writeFileSync(r,JSON.stringify(t,null,2),"utf-8"),B(r,e);}function N(e){if(!i__namespace.existsSync(e))return null;try{return JSON.parse(i__namespace.readFileSync(e,"utf-8"))}catch{return null}}function X(e){return i__namespace.existsSync(e)?i__namespace.readdirSync(e).filter(t=>t.endsWith(".json")).sort().map(t=>w__namespace.join(e,t)):[]}function ee(e){return {id:e.id,body:e.body,enqueuedAt:e.enqueuedAt,attempt:e.attempt}}function Xt(e){return {...ee(e),leaseToken:String(e.leaseToken||""),leaseExpiresAt:String(e.leaseExpiresAt||"")}}function er(e){return {...ee(e),reason:e.reason}}function je(e){let t=w__namespace.join(e,"active"),r=w__namespace.join(e,"leased"),o=w__namespace.join(e,"done"),n=w__namespace.join(e,"dead"),s=w__namespace.join(e,"staged");for(let d of [t,r,o,n,s])i__namespace.mkdirSync(d,{recursive:true});let u=0;function p(d){let f=d.replace(/[:.]/g,"-"),m=String(u++).padStart(6,"0");return `${f}-${m}`}function x(d){let f=d.activeOrderKey||p(String(d.enqueuedAt||new Date().toISOString()));return w__namespace.join(t,`${f}-${d.id}.json`)}function c(d){return w__namespace.join(r,`${d}.json`)}function l(d){return w__namespace.join(o,`${d}.json`)}function h(d){return w__namespace.join(n,`${d}.json`)}function R(d){return w__namespace.join(s,`${d}.json`)}function y(){let d=Date.now();for(let f of X(r)){let m=N(f);if(!m?.leaseExpiresAt)continue;let S=Date.parse(m.leaseExpiresAt);if(Number.isNaN(S)||S>d)continue;let a={id:m.id,body:m.body,enqueuedAt:m.enqueuedAt,attempt:m.attempt,activeOrderKey:m.activeOrderKey};D(x(a),a);try{i__namespace.unlinkSync(f);}catch{}}}return {enqueue(d){let f={id:crypto.randomUUID(),body:d,enqueuedAt:new Date().toISOString(),attempt:0};return f.activeOrderKey=p(f.enqueuedAt),D(x(f),f),ee(f)},enqueueMany(d){return d.map(f=>this.enqueue(f))},enqueueIfAbsent(d,f){y();for(let S of [t,r,s])for(let a of X(S))if(N(a)?.dedupKey===f)return null;let m={id:crypto.randomUUID(),body:d,enqueuedAt:new Date().toISOString(),attempt:0,dedupKey:f};return m.activeOrderKey=p(m.enqueuedAt),D(x(m),m),ee(m)},lease(d){y();let f=Math.max(1,Math.floor(d?.max??1)),m=Math.max(1,Math.floor(d?.visibilityMs??6e4)),S=[];for(let a of X(t)){if(S.length>=f)break;let g=N(a);if(!g)continue;let v=c(g.id);try{B(a,v);}catch{continue}let b={...g,attempt:(Number(g.attempt)||0)+1,leaseToken:crypto.randomUUID(),leaseExpiresAt:new Date(Date.now()+m).toISOString()};D(v,b),S.push(Xt(b));}return S},ack(d,f){let m=c(d),S=N(m);if(!S||S.leaseToken!==f)return false;try{B(m,l(d));}catch{return false}return true},nack(d,f,m){let S=c(d),a=N(S);if(!a||a.leaseToken!==f)return false;let g={id:a.id,body:a.body,enqueuedAt:a.enqueuedAt,attempt:a.attempt,activeOrderKey:a.activeOrderKey};m?.dead?(g.reason=m.reason,D(h(d),g)):D(x(g),g);try{i__namespace.unlinkSync(S);}catch{}return true},peekActive(d){return y(),X(t).map(f=>N(f)).filter(f=>!!f).map(ee)},peekDeadLetter(d){return X(n).map(f=>N(f)).filter(f=>!!f).map(er)},stage(d,f){let m=f?.dedupKey;if(m){y();for(let a of [t,r,s])for(let g of X(a))if(N(g)?.dedupKey===m)return null}let S={id:crypto.randomUUID(),body:d,enqueuedAt:new Date().toISOString(),attempt:0,...m?{dedupKey:m}:{}};return D(R(S.id),S),ee(S)},commitStaged(d){let f=R(d),m=N(f);if(!m)return false;let S=new Date().toISOString(),a={...m,attempt:0,enqueuedAt:S,activeOrderKey:p(S)};D(x(a),a);try{i__namespace.unlinkSync(f);}catch{}return true},discardStaged(d,f){let m=R(d),S=N(m);if(!S)return false;let a={id:S.id,body:S.body,enqueuedAt:S.enqueuedAt,attempt:S.attempt,reason:f};D(h(d),a);try{i__namespace.unlinkSync(m);}catch{}return true},peekStaged(d){return X(s).map(f=>N(f)).filter(f=>!!f).map(ee)}}}var Ee="__scratch-marker",Te="__scratch-config.json",tr=1440*60*1e3,rr=720*60*1e3,nr=500;function nt(e,t){if(!e)return t;let r=e.replace(/[^A-Za-z0-9._-]/g,"_");return r.length>0?r:t}function oe(e){i__namespace.mkdirSync(e,{recursive:true});let t=w__namespace.join(e,Ee),r=w__namespace.join(e,Te),o=!i__namespace.existsSync(t);if(o)try{i__namespace.writeFileSync(t,`scratch-store
|
|
4
4
|
${new Date().toISOString()}
|
|
@@ -8,5 +8,5 @@ ${new Date().toISOString()}
|
|
|
8
8
|
`).filter(Boolean).map(o=>JSON.parse(o)):[]}return {append(r){let o={id:crypto.randomUUID(),payload:r};return i__namespace.mkdirSync(w__namespace.dirname(e),{recursive:true}),i__namespace.appendFileSync(e,JSON.stringify(o)+`
|
|
9
9
|
`,"utf-8"),o},readAll(){return t()},readAfter(r){let o=t();if(!r)return {entries:o,newCursor:o.length>0?o[o.length-1].id:null};let n=o.findIndex(u=>u.id===r),s=n===-1?o:o.slice(n+1);return {entries:s,newCursor:s.length>0?s[s.length-1].id:r}},clear(){i__namespace.existsSync(e)&&i__namespace.truncateSync(e,0);}}}function Ce(e){if(e==null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return `[${e.map(Ce).join(",")}]`;let t=e;return `{${Object.keys(t).sort().map(o=>`${JSON.stringify(o)}:${Ce(t[o])}`).join(",")}}`}function st(e){return crypto.createHash("sha256").update(Ce(e)).digest("hex")}function Be(e){let t=w__namespace.join(e,"board-journal.jsonl");return {readAllEntries(){if(!i__namespace.existsSync(t))return [];let r=i__namespace.readFileSync(t,"utf-8").trim();return r?r.split(`
|
|
10
10
|
`).filter(Boolean).map(o=>JSON.parse(o)):[]},appendEntry(r){i__namespace.appendFileSync(t,JSON.stringify(r)+`
|
|
11
|
-
`,"utf-8");},generateId(){return crypto.randomUUID()}}}function it(e){return {tryAcquire(){try{if(!i__namespace.existsSync(e)){i__namespace.mkdirSync(w__namespace.dirname(e),{recursive:!0});try{i__namespace.writeFileSync(e,"{}",{flag:"wx"});}catch{}}return properLockfile.lockSync(e,{retries:0})}catch{return null}}}}function z(e){return {status:"success",data:e}}function Q(e){return {status:"fail",error:e}}function re(e){return {status:"error",error:e instanceof Error?e.message:String(e)}}function ne(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ar(e,t={}){let r=()=>chunkWRMOGPRG_cjs.b(e.kvStorage("config")),o=t.unsupportedLabel??"hosted async runtime";async function n(){return t.taskExecutorRef?t.taskExecutorRef:await r().readTaskExecutorRef().catch(()=>{})}async function s(y,d,f){let m=await n();if(!m||!t.invokeExecutor)throw new Error(`${y} is not supported on the ${o} yet`);let a=(await t.invokeExecutor(m,y,{...d!==void 0?{input:typeof d=="string"?d:JSON.stringify(d)}:{},...f!==void 0?{timeout:f}:{}})).trim();return a?ne(JSON.parse(a)):{}}async function u(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("validateCardPreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=chunkCPJXGK2T_cjs.a(f),a=Array.isArray(f.source_defs)&&f.source_defs.length>0,g=[...S.issues];if(a)if(t.invokeExecutor&&await n())for(let v of f.source_defs){let b=typeof v.bindTo=="string"?v.bindTo:"(unknown)";try{let k=await s("validate-source-def",v,1e4);if(k.ok!==!0&&Array.isArray(k.errors))for(let A of k.errors)typeof A=="string"&&A&&g.push(`source "${b}": ${A}`);}catch(k){g.push(`source "${b}": executor validate-source-def failed \u2014 ${k instanceof Error?k.message:String(k)}`);}}else await n()&&g.push(`executor-backed source_def preflight is not supported on the ${o} yet`);return z({cardId:m,isValid:g.length===0,issues:g})}catch(d){return re(d)}}function p(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("evalCardCompute requires a JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=d["mock-fetched-sources"]??{},a=d["mock-requires"]??{},g=f.compute;if(!g||!Array.isArray(g)||g.length===0)return z({cardId:m,ok:!0,computed_values:{},errors:[]});let v={id:m,card_data:f.card_data??{},requires:a,source_defs:f.source_defs,compute:g},b=chunkQBEQL4TL_cjs.a.runSync(v,{sourcesData:S});return z({cardId:m,ok:(b.errors??[]).length===0,computed_values:b.node.computed_values??{},errors:b.errors??[]})}catch(d){return re(d)}}async function x(y){return Q(`${y} is not supported on the ${o} yet`)}async function c(){try{return t.invokeExecutor&&await n()?z(await s("describe-capabilities",void 0,1e4)):await x("describeTaskExecutorCapabilities")}catch(y){return re(y)}}async function l(y){try{if(!t.invokeExecutor||!await n())return await x("probeSourcePreflight");if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("probeSourcePreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=ne(d["mock-projections"]??{}),S=y.params?.sourceIdx,a=Array.isArray(f.source_defs)?f.source_defs:[];if(S===void 0)return Q("probeSourcePreflight requires params.sourceIdx");if(S<0||S>=a.length)return Q(`sourceIdx ${S} out of range (card has ${a.length} source(s))`);let g=a[S],v=typeof g.bindTo=="string"?g.bindTo:"source",b=await s("probe-source-preflight",{...g,_projections:m},g.timeout??6e4);return b.ok!==!0?Q(typeof b.error=="string"?b.error:"Preflight probe failed"):z({bindTo:v,reachable:b.reachable,latencyMs:b.latencyMs,...typeof b.note=="string"?{note:b.note}:{}})}catch(d){return re(d)}}async function h(y){try{if(!t.invokeExecutor||!await n())return await x("runSourcePreflight");if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("runSourcePreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=ne(d["mock-projections"]??{}),S=y.params?.sourceIdx,a=Array.isArray(f.source_defs)?f.source_defs:[];if(S===void 0)return Q("runSourcePreflight requires params.sourceIdx");if(S<0||S>=a.length)return Q(`sourceIdx ${S} out of range (card has ${a.length} source(s))`);let g=a[S],v=typeof g.bindTo=="string"?g.bindTo:"source",b=await s("run-source-preflight",{...g,_projections:m},g.timeout??6e4);return b.ok!==!0?z({bindTo:v,ok:!1,result:null,issues:[typeof b.error=="string"?b.error:"Preflight run failed"]}):z({bindTo:v,ok:!0,result:Object.prototype.hasOwnProperty.call(b,"resultValue")?b.resultValue:null,issues:[]})}catch(d){return re(d)}}async function R(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("simulateCardCycle requires a JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=ne(d["mock-fetched-sources"]??{}),a=ne(d["mock-requires"]??{}),g=await u({body:{"card-content":f}}),v=g.status==="success"?{isValid:g.data.isValid,issues:g.data.issues}:{isValid:!1,issues:[g.status==="fail"?g.error:"internal error"]},b=Array.isArray(f.source_defs)?f.source_defs:[],k=ne(f.card_data??{}),A=[],F=[];if(b.length>0){A=chunkQBEQL4TL_cjs.a.enrichSourcesSync(b,{card_data:k,requires:a});for(let I of A){let P=I.projections,W=I._projections;if(P&&W){for(let $ of Object.keys(P))if(W[$]===void 0){let ut=typeof I.bindTo=="string"?I.bindTo:"(unknown)";F.push({bindTo:ut,key:$,error:`Projection "${$}" resolved to undefined`});}}}}let E=[],M={...S};for(let I=0;I<A.length;I+=1){let P=A[I],W=typeof P.bindTo=="string"?P.bindTo:`source_${I}`;if(!t.invokeExecutor||!await n()){E.push({bindTo:W,skipped:!0,error:"No task executor configured"});continue}try{let $=await s("run-source-preflight",P,P.timeout??6e4);$.ok===!0&&!Object.prototype.hasOwnProperty.call(S,W)&&Object.prototype.hasOwnProperty.call($,"resultValue")&&(M[W]=$.resultValue),E.push({bindTo:W,reachable:$.reachable,latencyMs:$.latencyMs,...$.ok===!0?{}:{error:typeof $.error=="string"?$.error:"Preflight run failed"}});}catch{E.push({bindTo:W,skipped:!0,error:"Executor does not support run-source-preflight"});}}let K=f.compute,te={},G=[];if(K&&Array.isArray(K)&&K.length>0){let I={id:m,card_data:k,requires:a,source_defs:f.source_defs,compute:K},P=chunkQBEQL4TL_cjs.a.runSync(I,{sourcesData:M});te=P.node.computed_values??{},G=P.errors??[];}return z({cardId:m,ok:v.isValid&&F.length===0&&G.length===0&&E.every(I=>!I.error),validation:v,source_probes:E,projection_errors:F,fetched_sources:M,computed_values:te,compute_errors:G})}catch(d){return re(d)}}return {describeTaskExecutorCapabilities:c,validateCardPreflight:u,evalCardCompute:p,probeSourcePreflight:l,runSourcePreflight:h,simulateCardCycle:R}}function sn(){return {async invoke(e,t){if(e.howToRun!=="local-node")return {dispatched:false,error:`createNodeSpawnInvocationAdapter: unsupported howToRun "${e.howToRun}"`};let r="";try{let s=e.whatToRun;r=L(s);}catch{r="";}if(!r)return {dispatched:false,error:"createNodeSpawnInvocationAdapter: could not resolve executable path from whatToRun"};let o={...t},n=Buffer.from(JSON.stringify(o)).toString("base64");try{return child_process.spawn(process.execPath,[r,"--boardId",String(t.boardId??""),"--cardId",String(t.cardId??""),"--extraEncJson",n],{stdio:"ignore",windowsHide:!0}).unref(),{dispatched:!0}}catch(s){return {dispatched:false,error:s instanceof Error?s.message:String(s)}}},async describe(e){if(e.howToRun!=="local-node")return null;let t="";try{let r=e.whatToRun;t=L(r);}catch{t="";}if(!t)return null;try{let r=child_process.spawnSync(process.execPath,[t,"describe"],{timeout:5e3,encoding:"utf-8",windowsHide:!0});return r.status!==0?null:JSON.parse(String(r.stdout).trim())}catch{return null}}}}var dr=".board.lock";function at(e,t){if(!e||!t)return false;let r=String(e).replace(/[\\/]+$/,"").split(/[\\/]+/).filter(Boolean);return r.length>0&&r[r.length-1]===t}function lr(e,t){return typeof e=="string"?{cliDir:e,opts:t}:{cliDir:void 0,opts:e}}function fr(e,t){return typeof e=="string"?{cliDir:e,opts:t}:{cliDir:void 0,opts:e}}function ct(e){if(e)return e;let t=Je((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('board-live-cards-node.cjs', document.baseURI).href))),r=[t,C(t,"..","cli","node"),C(t,"..","..","cli","node")];for(let o of r)try{return Ve(o),o}catch{}throw new Error(`createFsBoardPlatformAdapter: could not resolve a public CLI directory from module dir ${t}`)}function pr(e,t,r){let{cliDir:o,opts:n}=lr(t,r),s=e.value,u=null,p,x=null,c;function l(){return c||(c=ct(o)),c}function h(a){let g=n?.queueStoreRef;if(!g)throw new Error(`createFsBoardPlatformAdapter: ${a} requires opts.queueStoreRef`);return g}function R(a){let g=n?.boardRuntimeStoreRef;if(!g)throw new Error(`createFsBoardPlatformAdapter: ${a} requires opts.boardRuntimeStoreRef`);return g}let y=n?.callbackTransport??chunkEYBDAEVO_cjs.g({notifyChannel:n?.notifyChannel,boardRuntimeStoreRef:n?.boardRuntimeStoreRef,queueStoreRef:n?.queueStoreRef}),d;function f(a){return d.queueStorageForRef(h(`internal lane "${a}"`),a)}function m(a){return chunkGPCMBPLK_cjs.a(f(a))}function S(){if(n?.suppressSpawn||u)return;let a=xe({id:"task-executor",workerStore:m("task-executor"),handleRequest:async(g,v)=>{let b=await Z(v.ref,v.args,{cliDir:l(),cwd:process.cwd(),label:"fsBoardAdapter.boardWorker"});if(b.result!=="success"){let k=typeof b.data?.error=="string"?b.data.error:b.error;throw new Error(k||b.result)}}});u=de(a).catch(g=>{n?.onWarn?.(`[board-worker] in-process queue drain failed: ${g instanceof Error?g.message:String(g)}`);}).finally(()=>{u=null,f("task-executor").peekActive().length>0&&S();});}return d={kvStorage:a=>se(C(s,`.${a}`)),blobStorage:a=>a?U(C(s,a)):U(s),blobStorageForRef:a=>U(chunkVQCIOKJV_cjs.b(a).value),chatStorageForRef:a=>gr(chunkVQCIOKJV_cjs.b(a).value),queueStorageForRef:(a,g)=>je(C(chunkVQCIOKJV_cjs.b(a).value,g)),scratchStorage:()=>oe(C(s,".tmp")),scratchStorageForRef:a=>oe(chunkVQCIOKJV_cjs.b(a).value),archiveFactory:()=>ge(C(s,"archive")),archiveFactoryForRef:a=>ge(chunkVQCIOKJV_cjs.b(a).value),journalAdapter:()=>Be(s),journalAdapterForRef:a=>Be(chunkVQCIOKJV_cjs.b(a).value),lock:it(C(s,dr)),callbackTransport:y,async dispatchExecution(a,g){let v=!!g.output?.ref;if(a.howToRun==="queue-storage")try{let k=m("task-executor"),A=typeof a.extra?.boardId=="string"?a.extra.boardId:void 0;if(v)return k.enqueueRequest({boardId:A,ref:a,args:g}),{dispatched:!0};let F=g.source_def?.bindTo??ue().slice(0,8),E=oe(C(s,".tmp")),M=E.create(JSON.stringify(g,null,2),`exec-in-${F}`,".json"),K=E.getUniqueKey(`exec-out-${F}`,".json"),te=E.getUniqueKey(`exec-err-${F}`,".txt"),G=chunkVQCIOKJV_cjs.a(E.keyRef(M)),I=chunkVQCIOKJV_cjs.a(E.keyRef(K)),P=chunkVQCIOKJV_cjs.a(E.keyRef(te));return k.enqueueRequest({boardId:A,ref:a,args:{subcommand:"run-source-fetch",inRef:G,outRef:I,errRef:P}}),{dispatched:!0}}catch(k){return {dispatched:false,error:k instanceof Error?k.message:String(k)}}if(v&&(a.howToRun==="http:post"||a.howToRun==="in-process-loop"))try{if(a.howToRun==="http:post"){let F=L(a.whatToRun),E=await fetch(F,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...g,...a.extra?{extra:a.extra}:{}})});if(!E.ok){let M=await E.text().catch(()=>"");return {dispatched:!1,error:`HTTP ${E.status}: ${M}`}}return {dispatched:!0}}let k=await Z(a,g,{cwd:process.cwd(),label:"dispatchExecution.directHostedWorker"});return k.result==="success"?{dispatched:!0}:{dispatched:!1,error:(typeof k.data?.error=="string"?k.data.error:k.error)||k.result}}catch(k){return {dispatched:false,error:k instanceof Error?k.message:String(k)}}let b=a.howToRun==="local-node"||a.howToRun==="local-process"||a.howToRun==="local-python"||a.howToRun==="built-in";if(n?.suppressSpawn&&b)return {dispatched:false};try{let k=g.source_def?.bindTo??ue().slice(0,8),A=oe(C(s,".tmp")),F=A.create(JSON.stringify(g,null,2),`exec-in-${k}`,".json"),E=A.getUniqueKey(`exec-out-${k}`,".json"),M=A.getUniqueKey(`exec-err-${k}`,".txt"),K=chunkVQCIOKJV_cjs.a(A.keyRef(F)),te=chunkVQCIOKJV_cjs.a(A.keyRef(E)),G=chunkVQCIOKJV_cjs.a(A.keyRef(M)),I=m("task-executor"),P=typeof a.extra?.boardId=="string"?a.extra.boardId:void 0;return I.enqueueRequest({boardId:P,ref:a,args:{subcommand:"run-source-fetch",inRef:K,outRef:te,errRef:G}}),S(),{dispatched:!0}}catch(k){let A=k instanceof Error?k.message:String(k);try{let F=ge(C(s,"archive")),E=new Date().toISOString().replace(/[:.]/g,"-"),M=g.source_def?.bindTo??"unknown";F.blob("exec-failures").write(`${E}-${M}.json`,JSON.stringify({error:A,args:g,ref:a,at:new Date().toISOString()},null,2));}catch{}return {dispatched:false,error:A}}},supportsDirectSourceOutput(a){return a.howToRun==="queue-storage"||a.howToRun==="http:post"||a.howToRun==="in-process-loop"},resolveBlob(a){let g=Ne(a.value)?Ie().read(a.value):U(s).read(a.value);if(g===null)throw new Error(`resolveBlob: blob not found: ::${a.kind}::${a.value}`);return g},hashFn:st,genId:()=>Qe(`${Date.now()}-${Math.random()}`).slice(0,32),kvStorageForRef:a=>se(chunkVQCIOKJV_cjs.b(a).value),requestProcessAccumulated(){if(n?.suppressSpawn||x)return;let a=this,g=p??=chunkEYBDAEVO_cjs.y(e,a,{boardRuntimeStoreRef:R("requestProcessAccumulated")}),v=we({id:"process-accumulated",queueStorage:f("process-accumulated"),handleMessage:async()=>{let b=await g.processAccumulatedEvents({});if(b.status!=="success")throw new Error(b.error||`processAccumulatedEvents returned ${b.status}`)}});x=de(v).catch(b=>{n?.onWarn?.(`[process-accumulated] in-process queue drain failed: ${b instanceof Error?b.message:String(b)}`);}).finally(()=>{x=null,f("process-accumulated").peekActive().length>0&&a.requestProcessAccumulated?.();});},publishBoardChangeNotifications(a){if(!n?.notifyChannel||a.length===0)return;let g=a.map(v=>({id:ue(),ts:new Date().toISOString(),boardRef:chunkVQCIOKJV_cjs.a(e),notification:v}));Ue(n.notifyChannel,g,n.onWarn);},onWarn:n?.onWarn},d}function an(e,t,r){let{cliDir:o,opts:n}=fr(t,r),s,u=()=>(s||(s=ct(o)),s),p=pr(e,o,n),x=Ae({resolveCliDir:u,...n?.resolveRef?{resolveRef:n.resolveRef}:{}});return {...p,invokeExecutor:x.invokeExecutor,validateSchema(c){let l=chunkQEHKMLHA_cjs.d(c);return {ok:l.errors.length===0,errors:l.errors}},absoluteBlob:Ie()}}function cn(e,t={}){let r=t.chatsSubdir??"chats",o=t.kvSubdir??".kv",n=o?[o,"chat"]:["chat"],s=r&&!at(e,r)?C(e,r):e,u=se(C(e,...n));return chunkMCPADH33_cjs.a(p=>{let c=`${String(p).replace(/[^a-zA-Z0-9_-]/g,"_")}.jsonl`,l=C(s,c);return me(l)},u)}function gr(e){return chunkMCPADH33_cjs.a(t=>{let o=`${String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}.jsonl`;return me(C(e,"journal",o))},se(C(e,"kv")))}function un(e,t={}){let r=t.filesSubdir??"files",o=r&&!at(e,r)?C(e,r):e;return chunkNBJTYAYN_cjs.a(U(o))}function dn(e){try{let t=JSON.parse(Buffer.from(e,"base64url").toString());return typeof t.br=="string"?t.br:null}catch{return null}}Object.defineProperty(exports,"createChatStorage",{enumerable:true,get:function(){return chunkMCPADH33_cjs.a}});Object.defineProperty(exports,"createInMemoryChatStorage",{enumerable:true,get:function(){return chunkMCPADH33_cjs.c}});Object.defineProperty(exports,"createArtifactsStore",{enumerable:true,get:function(){return chunkNBJTYAYN_cjs.a}});Object.defineProperty(exports,"createCardFileMetadataStore",{enumerable:true,get:function(){return chunkNBJTYAYN_cjs.c}});Object.defineProperty(exports,"createFileArtifactsStore",{enumerable:true,get:function(){return chunkNBJTYAYN_cjs.b}});Object.defineProperty(exports,"createBoardWorkerStore",{enumerable:true,get:function(){return chunkGPCMBPLK_cjs.a}});Object.defineProperty(exports,"createQueueLaneRegistry",{enumerable:true,get:function(){return chunkGPCMBPLK_cjs.b}});Object.defineProperty(exports,"BOARD_GRAPH_KEY",{enumerable:true,get:function(){return chunkEYBDAEVO_cjs.n}});Object.defineProperty(exports,"EMPTY_CONFIG",{enumerable:true,get:function(){return chunkEYBDAEVO_cjs.u}});Object.defineProperty(exports,"SNAPSHOT_SCHEMA_VERSION_V1",{enumerable:true,get:function(){return chunkEYBDAEVO_cjs.m}});Object.defineProperty(exports,"createBoardLiveCardsNonCorePublic",{enumerable:true,get:function(){return chunkEYBDAEVO_cjs.z}});Object.defineProperty(exports,"createBoardLiveCardsPublic",{enumerable:true,get:function(){return chunkEYBDAEVO_cjs.y}});Object.defineProperty(exports,"createCardStore",{enumerable:true,get:function(){return chunkEYBDAEVO_cjs.l}});Object.defineProperty(exports,"createHttpBoardCallbackTransport",{enumerable:true,get:function(){return chunkEYBDAEVO_cjs.e}});Object.defineProperty(exports,"createInProcessBoardCallbackTransport",{enumerable:true,get:function(){return chunkEYBDAEVO_cjs.f}});Object.defineProperty(exports,"createLocalNodeBoardCallbackTransport",{enumerable:true,get:function(){return chunkEYBDAEVO_cjs.g}});Object.defineProperty(exports,"executionRefFromScriptPath",{enumerable:true,get:function(){return chunk7JVHYHT2_cjs.a}});Object.defineProperty(exports,"parseExecutionRef",{enumerable:true,get:function(){return chunk7JVHYHT2_cjs.c}});Object.defineProperty(exports,"serializeExecutionRef",{enumerable:true,get:function(){return chunk7JVHYHT2_cjs.b}});Object.defineProperty(exports,"parseRef",{enumerable:true,get:function(){return chunkVQCIOKJV_cjs.b}});Object.defineProperty(exports,"serializeRef",{enumerable:true,get:function(){return chunkVQCIOKJV_cjs.a}});Object.defineProperty(exports,"createBoardLiveCardsMcp",{enumerable:true,get:function(){return chunkGHUW6P4G_cjs.a}});Object.defineProperty(exports,"createCardStorePublic",{enumerable:true,get:function(){return chunk5XLFPPTY_cjs.a}});Object.defineProperty(exports,"createQueueStoragePublic",{enumerable:true,get:function(){return chunkSDJ3747Q_cjs.a}});Object.defineProperty(exports,"createArtifactsStorePublic",{enumerable:true,get:function(){return chunkP7ZCDICS_cjs.a}});exports.buildLocalBaseSpec=le;exports.createBoardWorkerQueueLane=xe;exports.createExecutionRefInvoker=Ut;exports.createFsBlobStorage=U;exports.createFsBoardChatStorage=cn;exports.createFsBoardFileArtifactsStore=un;exports.createFsBoardNonCorePlatformAdapter=an;exports.createFsBoardPlatformAdapter=pr;exports.createFsChatStorageForRefRoot=gr;exports.createFsQueueStorage=je;exports.createHostedAsyncBoardNonCorePublic=ar;exports.createNodeSpawnInvocationAdapter=sn;exports.createNonCoreExecutorDispatcher=Ae;exports.createQueueStorageLane=we;exports.decodeBoardRefFromToken=dn;exports.drainQueueLaneToIdle=de;exports.evaluateArgsMassaging=ke;exports.invokeExecutionRef=Z;exports.invokeExecutionRefSync=ve;exports.invokeRefSync=zt;exports.registerInProcessExecutionHandler=Dt;exports.resolveWhatToRunValue=L;exports.resolveYamlFlowCliPath=Xe;exports.startQueueLaneRunner=Ye;exports.startQueueLaneRunners=Ot;exports.unregisterInProcessExecutionHandler=Kt;//# sourceMappingURL=board-live-cards-node.cjs.map
|
|
11
|
+
`,"utf-8");},generateId(){return crypto.randomUUID()}}}function it(e){return {tryAcquire(){try{if(!i__namespace.existsSync(e)){i__namespace.mkdirSync(w__namespace.dirname(e),{recursive:!0});try{i__namespace.writeFileSync(e,"{}",{flag:"wx"});}catch{}}return properLockfile.lockSync(e,{retries:0})}catch{return null}}}}function z(e){return {status:"success",data:e}}function Q(e){return {status:"fail",error:e}}function re(e){return {status:"error",error:e instanceof Error?e.message:String(e)}}function ne(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ar(e,t={}){let r=()=>chunkWRMOGPRG_cjs.b(e.kvStorage("config")),o=t.unsupportedLabel??"hosted async runtime";async function n(){return t.taskExecutorRef?t.taskExecutorRef:await r().readTaskExecutorRef().catch(()=>{})}async function s(y,d,f){let m=await n();if(!m||!t.invokeExecutor)throw new Error(`${y} is not supported on the ${o} yet`);let a=(await t.invokeExecutor(m,y,{...d!==void 0?{input:typeof d=="string"?d:JSON.stringify(d)}:{},...f!==void 0?{timeout:f}:{}})).trim();return a?ne(JSON.parse(a)):{}}async function u(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("validateCardPreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=chunkCPJXGK2T_cjs.a(f),a=Array.isArray(f.source_defs)&&f.source_defs.length>0,g=[...S.issues];if(a)if(t.invokeExecutor&&await n())for(let v of f.source_defs){let b=typeof v.bindTo=="string"?v.bindTo:"(unknown)";try{let k=await s("validate-source-def",v,1e4);if(k.ok!==!0&&Array.isArray(k.errors))for(let A of k.errors)typeof A=="string"&&A&&g.push(`source "${b}": ${A}`);}catch(k){g.push(`source "${b}": executor validate-source-def failed \u2014 ${k instanceof Error?k.message:String(k)}`);}}else await n()&&g.push(`executor-backed source_def preflight is not supported on the ${o} yet`);return z({cardId:m,isValid:g.length===0,issues:g})}catch(d){return re(d)}}function p(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("evalCardCompute requires a JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=d["mock-fetched-sources"]??{},a=d["mock-requires"]??{},g=f.compute;if(!g||!Array.isArray(g)||g.length===0)return z({cardId:m,ok:!0,computed_values:{},errors:[]});let v={id:m,card_data:f.card_data??{},requires:a,source_defs:f.source_defs,compute:g},b=chunkQBEQL4TL_cjs.a.runSync(v,{sourcesData:S});return z({cardId:m,ok:(b.errors??[]).length===0,computed_values:b.node.computed_values??{},errors:b.errors??[]})}catch(d){return re(d)}}async function x(y){return Q(`${y} is not supported on the ${o} yet`)}async function c(){try{return t.invokeExecutor&&await n()?z(await s("describe-capabilities",void 0,1e4)):await x("describeTaskExecutorCapabilities")}catch(y){return re(y)}}async function l(y){try{if(!t.invokeExecutor||!await n())return await x("probeSourcePreflight");if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("probeSourcePreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=ne(d["mock-projections"]??{}),S=y.params?.sourceIdx,a=Array.isArray(f.source_defs)?f.source_defs:[];if(S===void 0)return Q("probeSourcePreflight requires params.sourceIdx");if(S<0||S>=a.length)return Q(`sourceIdx ${S} out of range (card has ${a.length} source(s))`);let g=a[S],v=typeof g.bindTo=="string"?g.bindTo:"source",b=await s("probe-source-preflight",{...g,_projections:m},g.timeout??6e4);return b.ok!==!0?Q(typeof b.error=="string"?b.error:"Preflight probe failed"):z({bindTo:v,reachable:b.reachable,latencyMs:b.latencyMs,...typeof b.note=="string"?{note:b.note}:{}})}catch(d){return re(d)}}async function h(y){try{if(!t.invokeExecutor||!await n())return await x("runSourcePreflight");if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("runSourcePreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=ne(d["mock-projections"]??{}),S=y.params?.sourceIdx,a=Array.isArray(f.source_defs)?f.source_defs:[];if(S===void 0)return Q("runSourcePreflight requires params.sourceIdx");if(S<0||S>=a.length)return Q(`sourceIdx ${S} out of range (card has ${a.length} source(s))`);let g=a[S],v=typeof g.bindTo=="string"?g.bindTo:"source",b=await s("run-source-preflight",{...g,_projections:m},g.timeout??6e4);return b.ok!==!0?z({bindTo:v,ok:!1,result:null,issues:[typeof b.error=="string"?b.error:"Preflight run failed"]}):z({bindTo:v,ok:!0,result:Object.prototype.hasOwnProperty.call(b,"resultValue")?b.resultValue:null,issues:[]})}catch(d){return re(d)}}async function R(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("simulateCardCycle requires a JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=ne(d["mock-fetched-sources"]??{}),a=ne(d["mock-requires"]??{}),g=await u({body:{"card-content":f}}),v=g.status==="success"?{isValid:g.data.isValid,issues:g.data.issues}:{isValid:!1,issues:[g.status==="fail"?g.error:"internal error"]},b=Array.isArray(f.source_defs)?f.source_defs:[],k=ne(f.card_data??{}),A=[],F=[];if(b.length>0){A=chunkQBEQL4TL_cjs.a.enrichSourcesSync(b,{card_data:k,requires:a});for(let I of A){let P=I.projections,W=I._projections;if(P&&W){for(let $ of Object.keys(P))if(W[$]===void 0){let ut=typeof I.bindTo=="string"?I.bindTo:"(unknown)";F.push({bindTo:ut,key:$,error:`Projection "${$}" resolved to undefined`});}}}}let E=[],M={...S};for(let I=0;I<A.length;I+=1){let P=A[I],W=typeof P.bindTo=="string"?P.bindTo:`source_${I}`;if(!t.invokeExecutor||!await n()){E.push({bindTo:W,skipped:!0,error:"No task executor configured"});continue}try{let $=await s("run-source-preflight",P,P.timeout??6e4);$.ok===!0&&!Object.prototype.hasOwnProperty.call(S,W)&&Object.prototype.hasOwnProperty.call($,"resultValue")&&(M[W]=$.resultValue),E.push({bindTo:W,reachable:$.reachable,latencyMs:$.latencyMs,...$.ok===!0?{}:{error:typeof $.error=="string"?$.error:"Preflight run failed"}});}catch{E.push({bindTo:W,skipped:!0,error:"Executor does not support run-source-preflight"});}}let K=f.compute,te={},G=[];if(K&&Array.isArray(K)&&K.length>0){let I={id:m,card_data:k,requires:a,source_defs:f.source_defs,compute:K},P=chunkQBEQL4TL_cjs.a.runSync(I,{sourcesData:M});te=P.node.computed_values??{},G=P.errors??[];}return z({cardId:m,ok:v.isValid&&F.length===0&&G.length===0&&E.every(I=>!I.error),validation:v,source_probes:E,projection_errors:F,fetched_sources:M,computed_values:te,compute_errors:G})}catch(d){return re(d)}}return {describeTaskExecutorCapabilities:c,validateCardPreflight:u,evalCardCompute:p,probeSourcePreflight:l,runSourcePreflight:h,simulateCardCycle:R}}function sn(){return {async invoke(e,t){if(e.howToRun!=="local-node")return {dispatched:false,error:`createNodeSpawnInvocationAdapter: unsupported howToRun "${e.howToRun}"`};let r="";try{let s=e.whatToRun;r=L(s);}catch{r="";}if(!r)return {dispatched:false,error:"createNodeSpawnInvocationAdapter: could not resolve executable path from whatToRun"};let o={...t},n=Buffer.from(JSON.stringify(o)).toString("base64");try{return child_process.spawn(process.execPath,[r,"--boardId",String(t.boardId??""),"--cardId",String(t.cardId??""),"--extraEncJson",n],{stdio:"ignore",windowsHide:!0}).unref(),{dispatched:!0}}catch(s){return {dispatched:false,error:s instanceof Error?s.message:String(s)}}},async describe(e){if(e.howToRun!=="local-node")return null;let t="";try{let r=e.whatToRun;t=L(r);}catch{t="";}if(!t)return null;try{let r=child_process.spawnSync(process.execPath,[t,"describe"],{timeout:5e3,encoding:"utf-8",windowsHide:!0});return r.status!==0?null:JSON.parse(String(r.stdout).trim())}catch{return null}}}}var dr=".board.lock";function at(e,t){if(!e||!t)return false;let r=String(e).replace(/[\\/]+$/,"").split(/[\\/]+/).filter(Boolean);return r.length>0&&r[r.length-1]===t}function lr(e,t){return typeof e=="string"?{cliDir:e,opts:t}:{cliDir:void 0,opts:e}}function fr(e,t){return typeof e=="string"?{cliDir:e,opts:t}:{cliDir:void 0,opts:e}}function ct(e){if(e)return e;let t=Je((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('board-live-cards-node.cjs', document.baseURI).href))),r=[t,C(t,"..","cli","node"),C(t,"..","..","cli","node")];for(let o of r)try{return Ve(o),o}catch{}throw new Error(`createFsBoardPlatformAdapter: could not resolve a public CLI directory from module dir ${t}`)}function pr(e,t,r){let{cliDir:o,opts:n}=lr(t,r),s=e.value,u=null,p,x=null,c;function l(){return c||(c=ct(o)),c}function h(a){let g=n?.queueStoreRef;if(!g)throw new Error(`createFsBoardPlatformAdapter: ${a} requires opts.queueStoreRef`);return g}function R(a){let g=n?.boardRuntimeStoreRef;if(!g)throw new Error(`createFsBoardPlatformAdapter: ${a} requires opts.boardRuntimeStoreRef`);return g}let y=n?.callbackTransport??chunkBAG7MHZP_cjs.g({notifyChannel:n?.notifyChannel,boardRuntimeStoreRef:n?.boardRuntimeStoreRef,queueStoreRef:n?.queueStoreRef}),d;function f(a){return d.queueStorageForRef(h(`internal lane "${a}"`),a)}function m(a){return chunkGPCMBPLK_cjs.a(f(a))}function S(){if(n?.suppressSpawn||u)return;let a=xe({id:"task-executor",workerStore:m("task-executor"),handleRequest:async(g,v)=>{let b=await Z(v.ref,v.args,{cliDir:l(),cwd:process.cwd(),label:"fsBoardAdapter.boardWorker"});if(b.result!=="success"){let k=typeof b.data?.error=="string"?b.data.error:b.error;throw new Error(k||b.result)}}});u=de(a).catch(g=>{n?.onWarn?.(`[board-worker] in-process queue drain failed: ${g instanceof Error?g.message:String(g)}`);}).finally(()=>{u=null,f("task-executor").peekActive().length>0&&S();});}return d={kvStorage:a=>se(C(s,`.${a}`)),blobStorage:a=>a?U(C(s,a)):U(s),blobStorageForRef:a=>U(chunkVQCIOKJV_cjs.b(a).value),chatStorageForRef:a=>gr(chunkVQCIOKJV_cjs.b(a).value),queueStorageForRef:(a,g)=>je(C(chunkVQCIOKJV_cjs.b(a).value,g)),scratchStorage:()=>oe(C(s,".tmp")),scratchStorageForRef:a=>oe(chunkVQCIOKJV_cjs.b(a).value),archiveFactory:()=>ge(C(s,"archive")),archiveFactoryForRef:a=>ge(chunkVQCIOKJV_cjs.b(a).value),journalAdapter:()=>Be(s),journalAdapterForRef:a=>Be(chunkVQCIOKJV_cjs.b(a).value),lock:it(C(s,dr)),callbackTransport:y,async dispatchExecution(a,g){let v=!!g.output?.ref;if(a.howToRun==="queue-storage")try{let k=m("task-executor"),A=typeof a.extra?.boardId=="string"?a.extra.boardId:void 0;if(v)return k.enqueueRequest({boardId:A,ref:a,args:g}),{dispatched:!0};let F=g.source_def?.bindTo??ue().slice(0,8),E=oe(C(s,".tmp")),M=E.create(JSON.stringify(g,null,2),`exec-in-${F}`,".json"),K=E.getUniqueKey(`exec-out-${F}`,".json"),te=E.getUniqueKey(`exec-err-${F}`,".txt"),G=chunkVQCIOKJV_cjs.a(E.keyRef(M)),I=chunkVQCIOKJV_cjs.a(E.keyRef(K)),P=chunkVQCIOKJV_cjs.a(E.keyRef(te));return k.enqueueRequest({boardId:A,ref:a,args:{subcommand:"run-source-fetch",inRef:G,outRef:I,errRef:P}}),{dispatched:!0}}catch(k){return {dispatched:false,error:k instanceof Error?k.message:String(k)}}if(v&&(a.howToRun==="http:post"||a.howToRun==="in-process-loop"))try{if(a.howToRun==="http:post"){let F=L(a.whatToRun),E=await fetch(F,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...g,...a.extra?{extra:a.extra}:{}})});if(!E.ok){let M=await E.text().catch(()=>"");return {dispatched:!1,error:`HTTP ${E.status}: ${M}`}}return {dispatched:!0}}let k=await Z(a,g,{cwd:process.cwd(),label:"dispatchExecution.directHostedWorker"});return k.result==="success"?{dispatched:!0}:{dispatched:!1,error:(typeof k.data?.error=="string"?k.data.error:k.error)||k.result}}catch(k){return {dispatched:false,error:k instanceof Error?k.message:String(k)}}let b=a.howToRun==="local-node"||a.howToRun==="local-process"||a.howToRun==="local-python"||a.howToRun==="built-in";if(n?.suppressSpawn&&b)return {dispatched:false};try{let k=g.source_def?.bindTo??ue().slice(0,8),A=oe(C(s,".tmp")),F=A.create(JSON.stringify(g,null,2),`exec-in-${k}`,".json"),E=A.getUniqueKey(`exec-out-${k}`,".json"),M=A.getUniqueKey(`exec-err-${k}`,".txt"),K=chunkVQCIOKJV_cjs.a(A.keyRef(F)),te=chunkVQCIOKJV_cjs.a(A.keyRef(E)),G=chunkVQCIOKJV_cjs.a(A.keyRef(M)),I=m("task-executor"),P=typeof a.extra?.boardId=="string"?a.extra.boardId:void 0;return I.enqueueRequest({boardId:P,ref:a,args:{subcommand:"run-source-fetch",inRef:K,outRef:te,errRef:G}}),S(),{dispatched:!0}}catch(k){let A=k instanceof Error?k.message:String(k);try{let F=ge(C(s,"archive")),E=new Date().toISOString().replace(/[:.]/g,"-"),M=g.source_def?.bindTo??"unknown";F.blob("exec-failures").write(`${E}-${M}.json`,JSON.stringify({error:A,args:g,ref:a,at:new Date().toISOString()},null,2));}catch{}return {dispatched:false,error:A}}},supportsDirectSourceOutput(a){return a.howToRun==="queue-storage"||a.howToRun==="http:post"||a.howToRun==="in-process-loop"},resolveBlob(a){let g=Ne(a.value)?Ie().read(a.value):U(s).read(a.value);if(g===null)throw new Error(`resolveBlob: blob not found: ::${a.kind}::${a.value}`);return g},hashFn:st,genId:()=>Qe(`${Date.now()}-${Math.random()}`).slice(0,32),kvStorageForRef:a=>se(chunkVQCIOKJV_cjs.b(a).value),requestProcessAccumulated(){if(n?.suppressSpawn||x)return;let a=this,g=p??=chunkBAG7MHZP_cjs.F(e,a,{boardRuntimeStoreRef:R("requestProcessAccumulated")}),v=we({id:"process-accumulated",queueStorage:f("process-accumulated"),handleMessage:async()=>{let b=await g.processAccumulatedEvents({});if(b.status!=="success")throw new Error(b.error||`processAccumulatedEvents returned ${b.status}`)}});x=de(v).catch(b=>{n?.onWarn?.(`[process-accumulated] in-process queue drain failed: ${b instanceof Error?b.message:String(b)}`);}).finally(()=>{x=null,f("process-accumulated").peekActive().length>0&&a.requestProcessAccumulated?.();});},publishBoardChangeNotifications(a){if(!n?.notifyChannel||a.length===0)return;let g=a.map(v=>({id:ue(),ts:new Date().toISOString(),boardRef:chunkVQCIOKJV_cjs.a(e),notification:v}));Ue(n.notifyChannel,g,n.onWarn);},onWarn:n?.onWarn},d}function an(e,t,r){let{cliDir:o,opts:n}=fr(t,r),s,u=()=>(s||(s=ct(o)),s),p=pr(e,o,n),x=Ae({resolveCliDir:u,...n?.resolveRef?{resolveRef:n.resolveRef}:{}});return {...p,invokeExecutor:x.invokeExecutor,validateSchema(c){let l=chunkQEHKMLHA_cjs.d(c);return {ok:l.errors.length===0,errors:l.errors}},absoluteBlob:Ie()}}function cn(e,t={}){let r=t.chatsSubdir??"chats",o=t.kvSubdir??".kv",n=o?[o,"chat"]:["chat"],s=r&&!at(e,r)?C(e,r):e,u=se(C(e,...n));return chunkMCPADH33_cjs.a(p=>{let c=`${String(p).replace(/[^a-zA-Z0-9_-]/g,"_")}.jsonl`,l=C(s,c);return me(l)},u)}function gr(e){return chunkMCPADH33_cjs.a(t=>{let o=`${String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}.jsonl`;return me(C(e,"journal",o))},se(C(e,"kv")))}function un(e,t={}){let r=t.filesSubdir??"files",o=r&&!at(e,r)?C(e,r):e;return chunkNBJTYAYN_cjs.a(U(o))}function dn(e){try{let t=JSON.parse(Buffer.from(e,"base64url").toString());return typeof t.br=="string"?t.br:null}catch{return null}}Object.defineProperty(exports,"createChatStorage",{enumerable:true,get:function(){return chunkMCPADH33_cjs.a}});Object.defineProperty(exports,"createInMemoryChatStorage",{enumerable:true,get:function(){return chunkMCPADH33_cjs.c}});Object.defineProperty(exports,"createArtifactsStore",{enumerable:true,get:function(){return chunkNBJTYAYN_cjs.a}});Object.defineProperty(exports,"createCardFileMetadataStore",{enumerable:true,get:function(){return chunkNBJTYAYN_cjs.c}});Object.defineProperty(exports,"createFileArtifactsStore",{enumerable:true,get:function(){return chunkNBJTYAYN_cjs.b}});Object.defineProperty(exports,"createBoardWorkerStore",{enumerable:true,get:function(){return chunkGPCMBPLK_cjs.a}});Object.defineProperty(exports,"createQueueLaneRegistry",{enumerable:true,get:function(){return chunkGPCMBPLK_cjs.b}});Object.defineProperty(exports,"BOARD_GRAPH_KEY",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.s}});Object.defineProperty(exports,"EMPTY_CONFIG",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.B}});Object.defineProperty(exports,"SNAPSHOT_SCHEMA_VERSION_V1",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.r}});Object.defineProperty(exports,"createBoardLiveCardsNonCorePublic",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.G}});Object.defineProperty(exports,"createBoardLiveCardsPublic",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.F}});Object.defineProperty(exports,"createCardStore",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.q}});Object.defineProperty(exports,"createHttpBoardCallbackTransport",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.e}});Object.defineProperty(exports,"createInProcessBoardCallbackTransport",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.f}});Object.defineProperty(exports,"createLocalNodeBoardCallbackTransport",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.g}});Object.defineProperty(exports,"executionRefFromScriptPath",{enumerable:true,get:function(){return chunk7JVHYHT2_cjs.a}});Object.defineProperty(exports,"parseExecutionRef",{enumerable:true,get:function(){return chunk7JVHYHT2_cjs.c}});Object.defineProperty(exports,"serializeExecutionRef",{enumerable:true,get:function(){return chunk7JVHYHT2_cjs.b}});Object.defineProperty(exports,"parseRef",{enumerable:true,get:function(){return chunkVQCIOKJV_cjs.b}});Object.defineProperty(exports,"serializeRef",{enumerable:true,get:function(){return chunkVQCIOKJV_cjs.a}});Object.defineProperty(exports,"createBoardLiveCardsMcp",{enumerable:true,get:function(){return chunkGHUW6P4G_cjs.a}});Object.defineProperty(exports,"createCardStorePublic",{enumerable:true,get:function(){return chunk5XLFPPTY_cjs.a}});Object.defineProperty(exports,"createQueueStoragePublic",{enumerable:true,get:function(){return chunkSDJ3747Q_cjs.a}});Object.defineProperty(exports,"createArtifactsStorePublic",{enumerable:true,get:function(){return chunkP7ZCDICS_cjs.a}});exports.buildLocalBaseSpec=le;exports.createBoardWorkerQueueLane=xe;exports.createExecutionRefInvoker=Ut;exports.createFsBlobStorage=U;exports.createFsBoardChatStorage=cn;exports.createFsBoardFileArtifactsStore=un;exports.createFsBoardNonCorePlatformAdapter=an;exports.createFsBoardPlatformAdapter=pr;exports.createFsChatStorageForRefRoot=gr;exports.createFsQueueStorage=je;exports.createHostedAsyncBoardNonCorePublic=ar;exports.createNodeSpawnInvocationAdapter=sn;exports.createNonCoreExecutorDispatcher=Ae;exports.createQueueStorageLane=we;exports.decodeBoardRefFromToken=dn;exports.drainQueueLaneToIdle=de;exports.evaluateArgsMassaging=ke;exports.invokeExecutionRef=Z;exports.invokeExecutionRefSync=ve;exports.invokeRefSync=zt;exports.registerInProcessExecutionHandler=Dt;exports.resolveWhatToRunValue=L;exports.resolveYamlFlowCliPath=Xe;exports.startQueueLaneRunner=Ye;exports.startQueueLaneRunners=Ot;exports.unregisterInProcessExecutionHandler=Kt;//# sourceMappingURL=board-live-cards-node.cjs.map
|
|
12
12
|
//# sourceMappingURL=board-live-cards-node.cjs.map
|
|
@@ -2,8 +2,8 @@ import { a as ArtifactsStore } from './artifacts-store-lib-CqkJEgbx.cjs';
|
|
|
2
2
|
export { c as createArtifactsStore, b as createCardFileMetadataStore, d as createFileArtifactsStore } from './artifacts-store-lib-CqkJEgbx.cjs';
|
|
3
3
|
import { ExecutionRef, ArgsMassaging } from './execution-refs.cjs';
|
|
4
4
|
export { executionRefFromScriptPath, parseExecutionRef, serializeExecutionRef } from './execution-refs.cjs';
|
|
5
|
-
import { c as BoardRuntimeNonCorePublic, i as BoardWorkerStore, f as BoardWorkerRequest, I as InvocationAdapter } from './types-
|
|
6
|
-
export { j as BoardWorkerDeadLetterRequest, k as BoardWorkerLeasedRequest, l as BoardWorkerQueuedRequest, D as DescribeEnvelope, m as createBoardWorkerStore } from './types-
|
|
5
|
+
import { c as BoardRuntimeNonCorePublic, i as BoardWorkerStore, f as BoardWorkerRequest, I as InvocationAdapter } from './types-gTf9pAyC.cjs';
|
|
6
|
+
export { j as BoardWorkerDeadLetterRequest, k as BoardWorkerLeasedRequest, l as BoardWorkerQueuedRequest, D as DescribeEnvelope, m as createBoardWorkerStore } from './types-gTf9pAyC.cjs';
|
|
7
7
|
import { a as KindValueRef, B as BlobStorage, Q as QueueStorage } from './storage-interface-DogVPooM.cjs';
|
|
8
8
|
export { p as parseRef, s as serializeRef } from './storage-interface-DogVPooM.cjs';
|
|
9
9
|
import { C as ChatStorage, B as BoardCallbackTransport } from './board-callback-transport-kP0K6UMq.cjs';
|
|
@@ -2,8 +2,8 @@ import { a as ArtifactsStore } from './artifacts-store-lib-D6Bo4yFN.js';
|
|
|
2
2
|
export { c as createArtifactsStore, b as createCardFileMetadataStore, d as createFileArtifactsStore } from './artifacts-store-lib-D6Bo4yFN.js';
|
|
3
3
|
import { ExecutionRef, ArgsMassaging } from './execution-refs.js';
|
|
4
4
|
export { executionRefFromScriptPath, parseExecutionRef, serializeExecutionRef } from './execution-refs.js';
|
|
5
|
-
import { c as BoardRuntimeNonCorePublic, i as BoardWorkerStore, f as BoardWorkerRequest, I as InvocationAdapter } from './types-
|
|
6
|
-
export { j as BoardWorkerDeadLetterRequest, k as BoardWorkerLeasedRequest, l as BoardWorkerQueuedRequest, D as DescribeEnvelope, m as createBoardWorkerStore } from './types-
|
|
5
|
+
import { c as BoardRuntimeNonCorePublic, i as BoardWorkerStore, f as BoardWorkerRequest, I as InvocationAdapter } from './types-B8Yieskx.js';
|
|
6
|
+
export { j as BoardWorkerDeadLetterRequest, k as BoardWorkerLeasedRequest, l as BoardWorkerQueuedRequest, D as DescribeEnvelope, m as createBoardWorkerStore } from './types-B8Yieskx.js';
|
|
7
7
|
import { a as KindValueRef, B as BlobStorage, Q as QueueStorage } from './storage-interface-DogVPooM.js';
|
|
8
8
|
export { p as parseRef, s as serializeRef } from './storage-interface-DogVPooM.js';
|
|
9
9
|
import { C as ChatStorage, B as BoardCallbackTransport } from './board-callback-transport-Bekq8Gp-.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-Y4WK7HE4.js';export{a as createChatStorage,c as createInMemoryChatStorage}from'./chunk-Y4WK7HE4.js';import {a as a$5}from'./chunk-2LGCYN35.js';import {a as a$3}from'./chunk-O5UYCGIN.js';export{a as createArtifactsStore,c as createCardFileMetadataStore,b as createFileArtifactsStore}from'./chunk-O5UYCGIN.js';import {a as a$4}from'./chunk-RKKSVOP2.js';export{a as createBoardWorkerStore,b as createQueueLaneRegistry}from'./chunk-RKKSVOP2.js';import {h}from'./chunk-J4MHQ7JF.js';import {a}from'./chunk-VGDLSS2H.js';import'./chunk-QLB6PKOT.js';import'./chunk-
|
|
1
|
+
import {a as a$2}from'./chunk-Y4WK7HE4.js';export{a as createChatStorage,c as createInMemoryChatStorage}from'./chunk-Y4WK7HE4.js';import {a as a$5}from'./chunk-2LGCYN35.js';import {a as a$3}from'./chunk-O5UYCGIN.js';export{a as createArtifactsStore,c as createCardFileMetadataStore,b as createFileArtifactsStore}from'./chunk-O5UYCGIN.js';import {a as a$4}from'./chunk-RKKSVOP2.js';export{a as createBoardWorkerStore,b as createQueueLaneRegistry}from'./chunk-RKKSVOP2.js';import {h}from'./chunk-J4MHQ7JF.js';import {a}from'./chunk-VGDLSS2H.js';import'./chunk-QLB6PKOT.js';import'./chunk-5VTIOM2U.js';import {b as b$1}from'./chunk-6MD6FVE3.js';import {g,F}from'./chunk-EZOXABJ2.js';export{s as BOARD_GRAPH_KEY,B as EMPTY_CONFIG,r as SNAPSHOT_SCHEMA_VERSION_V1,G as createBoardLiveCardsNonCorePublic,F as createBoardLiveCardsPublic,q as createCardStore,e as createHttpBoardCallbackTransport,f as createInProcessBoardCallbackTransport,g as createLocalNodeBoardCallbackTransport}from'./chunk-EZOXABJ2.js';export{a as executionRefFromScriptPath,c as parseExecutionRef,b as serializeExecutionRef}from'./chunk-ANKA7HEJ.js';import {a as a$1,b}from'./chunk-44L64VQ2.js';export{b as parseRef,a as serializeRef}from'./chunk-44L64VQ2.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';export{a as createBoardLiveCardsMcp}from'./chunk-6M3RIGUH.js';import {a as a$6}from'./chunk-ATOQP3BD.js';import {d}from'./chunk-YT76JNKE.js';import'./chunk-MNEOJWPS.js';export{a as createCardStorePublic}from'./chunk-7QNEV5S3.js';export{a as createQueueStoragePublic}from'./chunk-BJGK5FNL.js';export{a as createArtifactsStorePublic}from'./chunk-X3LC4LII.js';import'./chunk-UGB7PC4P.js';import'./chunk-FW4363Y4.js';import {spawn,spawnSync,execFile,execFileSync}from'child_process';import*as i from'fs';import*as qe from'os';import*as w from'path';import*as Le from'net';import {fileURLToPath}from'url';import {randomUUID,createHash}from'crypto';import {createRequire}from'module';import {lockSync}from'proper-lockfile';function C(...e){return w.join(...e)}function Ne(e){return w.isAbsolute(e)}function ue(){return randomUUID()}function Qe(e){return createHash("sha256").update(e).digest("hex")}function Je(e){return w.dirname(fileURLToPath(e))}function Ft(e){if(typeof e=="object"&&e!==null){let{command:r,args:o=[],...n}=e,s=Oe(r,o);return {...n,command:s.command,args:s.args}}let t=De(e);if(t.length===0)throw new Error(`Empty command spec: ${JSON.stringify(e)}`);return Oe(t[0],t.slice(1))}function Oe(e,t){return /^(node|node\.exe)$/i.test(e)?{command:process.execPath,args:t}:/\.m?js$/i.test(e)?{command:process.execPath,args:[e,...t]}:{command:e,args:t}}function De(e){let t=[],r="",o=null;for(let n of e.trim()){if(o){n===o?o=null:r+=n;continue}if(n==='"'||n==="'"){o=n;continue}if(/\s/.test(n)){r&&(t.push(r),r="");continue}r+=n;}if(o)throw new Error(`Unterminated quote in command: ${e}`);return r&&t.push(r),t}function Ke(e){return process.platform==="win32"&&/\.(cmd|bat)$/i.test(e)}function We(e,t){let{command:r,args:o=[],cwd:n,env:s,timeoutMs:u}=e;return execFileSync(r,o,{shell:Ke(r),timeout:u,encoding:t?.encoding??"utf-8",cwd:n,windowsHide:true,env:s?{...process.env,...s}:void 0,input:t?.input})}function $t(e,t){let{command:r,args:o=[],cwd:n,env:s,timeoutMs:u=3e4}=e;execFile(r,o,{shell:Ke(r),encoding:"utf8",windowsHide:true,timeout:u,maxBuffer:10*1024*1024,cwd:n,env:s?{...process.env,...s}:void 0},(p,x,c)=>t(p??null,x,c));}function He(e,t,r){let o=w.join(e,"board-live-cards-cli.js");if(i.existsSync(o))return {cmd:process.execPath,args:[o,t,...r]};let n=w.join(e,"board-live-cards-cli.ts"),u=[w.join(e,"..","..","..","node_modules","tsx","dist","cli.mjs"),w.join(e,"..","..","node_modules","tsx","dist","cli.mjs"),w.join(e,"..","..","..","node_modules",".bin","tsx"),w.join(e,"..","..","node_modules",".bin","tsx")].find(x=>i.existsSync(x));return i.existsSync(n)&&u?{cmd:process.execPath,args:[u,n,t,...r]}:{cmd:process.platform==="win32"?"npx.cmd":"npx",args:["tsx",n,t,...r]}}function Ve(e){let t=w.join(e,"board-live-cards-cli.mjs");if(i.existsSync(t))return t;let r=w.join(e,"..","..","..","dev","board-live-cards-cli.js");if(i.existsSync(r))return r;let o=w.join(e,"..","..","dev","board-live-cards-cli.js");if(i.existsSync(o))return o;let n=w.join(e,"board-live-cards-cli.js");if(i.existsSync(n))return n;throw new Error(`resolveBoardCliCallbackTarget: cannot find callback target in ${e} (expected dev/board-live-cards-cli.js wrapper, ${n}, or ${t})`)}function Mt(e){return process.platform==="win32"?`\\\\.\\pipe\\${e}`:w.join(qe.tmpdir(),`${e}.sock`)}var ce=new Map;function Ue(e,t,r){if(t.length===0)return;let o=t.map(p=>JSON.stringify(p)).join(`
|
|
2
2
|
`)+`
|
|
3
3
|
`,n=ce.get(e);if(n&&!n.socket.destroyed){n.ready?n.socket.write(o):n.queue.push(o);return}let s=Mt(e),u=Le.createConnection(s);n={socket:u,ready:false,queue:[o]},ce.set(e,n),u.on("connect",()=>{n.ready=true;for(let p of n.queue)u.write(p);n.queue.length=0;}),u.on("error",p=>{r?.(`[named-pipe publish] ${s}: ${p instanceof Error?p.message:String(p)}`),ce.delete(e);}),u.on("close",()=>{ce.delete(e);});}function ze(){return {executeSync(e,t,r){return We({command:e,args:t,cwd:r?.cwd,timeoutMs:r?.timeout,env:r?.env},{encoding:r?.encoding,input:r?.input})},executeAsync(e,t,r){$t({command:e,args:t},r);},resolveInvocation(e,t){let r=Ft({command:e,args:t});return {cmd:r.command,args:r.args??[]}},splitCommand:De}}function xe(e){return {id:e.id??"board-worker",pollIntervalMs:e.pollIntervalMs,visibilityMs:e.visibilityMs,concurrency:e.concurrency,maxAttempts:e.maxAttempts,async lease(t){return e.workerStore.leaseRequests(t).map(r=>({id:r.messageId,attempt:r.attempt,message:r.request,ack:()=>e.workerStore.ackRequest(r.messageId,r.leaseToken),nack:o=>e.workerStore.nackRequest(r.messageId,r.leaseToken,o)}))},async handle(t){await e.handleRequest(t.args,t);},onError:e.onError}}function we(e){return {id:e.id,pollIntervalMs:e.pollIntervalMs,visibilityMs:e.visibilityMs,concurrency:e.concurrency,maxAttempts:e.maxAttempts,async lease(t){return e.queueStorage.lease(t).map(r=>({id:r.id,attempt:r.attempt,message:r.body,ack:()=>e.queueStorage.ack(r.id,r.leaseToken),nack:o=>e.queueStorage.nack(r.id,r.leaseToken,o)}))},handle:e.handleMessage,onError:e.onError}}async function Ge(e,t){try{await e.handle(t.message,t),await t.ack();}catch(r){let o=t.attempt>=Math.max(1,Math.floor(e.maxAttempts??5));await t.nack({dead:o,reason:r instanceof Error?r.message:String(r)}),e.onError?.(r,t);}}function Ye(e){let t=Math.max(1,Math.floor(e.pollIntervalMs??250)),r=Math.max(1,Math.floor(e.visibilityMs??6e4)),o=Math.max(1,Math.floor(e.concurrency??1)),n=false,s=false;async function u(){if(!(n||s)){s=true;try{let x=await e.lease({max:o,visibilityMs:r});for(let c of x)await Ge(e,c);}finally{s=false;}}}let p=setInterval(()=>{u();},t);return typeof p.unref=="function"&&p.unref(),u(),()=>{n=true,clearInterval(p);}}async function _t(e){let t=Math.max(1,Math.floor(e.visibilityMs??6e4)),r=Math.max(1,Math.floor(e.concurrency??1)),o=await e.lease({max:r,visibilityMs:t});for(let n of o)await Ge(e,n);return o.length}async function de(e,t){let r=Math.max(1,Math.floor(t?.maxPasses??256)),o=0;for(let n=0;n<r;n+=1){let s=await _t(e);if(o+=s,s<=0)return o}throw new Error(`drainQueueLaneToIdle exceeded ${r} passes for lane "${e.id}"`)}function Ot(e){let r=(Array.isArray(e)?e:e.lanes).map(o=>Ye(o));return ()=>{for(let o of r)o();}}var Lt=createRequire(import.meta.url);function Nt(e){return typeof e=="object"?e:b(e)}function Xe(e){let t=w.basename(String(e||"").trim());if(!t)throw new Error(`resolveYamlFlowCliPath: expected non-empty cli file name, got ${JSON.stringify(e)}`);let r=w.dirname(Lt.resolve("yaml-flow/package.json")),o=t.replace(/\.[^.]+$/,""),n=w.join(r,"cli","bundled",`${o}.mjs`);if(i.existsSync(n))return n;let s=w.join(r,"cli","node",t);if(i.existsSync(s))return s;throw new Error(`resolveYamlFlowCliPath: could not find ${t} under cli/bundled or cli/node in ${r}`)}function L(e){let t=Nt(e);return t.kind==="yaml-flow-cli"?Xe(t.value):t.value}function Qt(e,t){let r=L(e);switch(r){case "source-cli-task-executor":{let o=w.join(t,"source-cli-task-executor.js");if(i.existsSync(o))return {command:process.execPath,args:[o]};let n=w.join(t,"source-cli-task-executor.ts"),s=w.join(t,"..","..","node_modules","tsx","dist","cli.mjs"),u=w.join(t,"..","..","node_modules",".bin","tsx"),p=i.existsSync(s)?s:u;return i.existsSync(n)&&i.existsSync(p)?{command:process.execPath,args:[p,n]}:{command:process.execPath,args:[o]}}case "board-live-cards":{let{cmd:o,args:n}=He(t,"_",[]);return {command:o,args:n}}default:throw new Error(`resolveBuiltIn: unknown built-in name "${r}". Supported: source-cli-task-executor, board-live-cards`)}}function Jt(e,t){if(e.howToRun==="built-in"){let{command:o,args:n}=Qt(e.whatToRun,t);return {command:o,baseArgs:n}}let r=(typeof e.whatToRun=="object",L(e.whatToRun));switch(e.howToRun){case "local-node":return {command:process.execPath,baseArgs:[r]};case "local-python":return {command:process.platform==="win32"?"python":"python3",baseArgs:[r]};case "local-process":return {command:r,baseArgs:[]};default:throw new Error(`resolveBaseInvocation: howToRun "${e.howToRun}" is not a local transport`)}}function le(e,t){return Jt(e,t)}var be=new Map;function Dt(e,t){let r=String(e||"").trim();if(!r)throw new Error("registerInProcessExecutionHandler: key is required");be.set(r,t);}function Kt(e){let t=String(e||"").trim();t&&be.delete(t);}function et(e){let t=e.trim();if(!t)throw new Error("empty stdout");try{return JSON.parse(t)}catch{let r=t.split(/\r?\n/).filter(Boolean),o=r[r.length-1];return JSON.parse(o)}}function tt(e,t){return {...t,whatToRun:L(e.whatToRun),...e.extra?{extra:e.extra}:{}}}function ke(e,t,r="invokeExecutionRef"){return a(e,t,r)}function rt(e,t){if(e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.result=="string"&&e.data&&typeof e.data=="object"&&!Array.isArray(e.data))return {...e,...t||{}};if(e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.status=="string"){let o=e,n=o.status==="success"?"success":o.status==="fail"?"failure":o.status,s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:o.data===void 0?{}:{stdout:o.data};return {result:n,data:s,...typeof o.error=="string"?{error:o.error}:{},...t||{}}}return {result:"success",data:e&&typeof e=="object"&&!Array.isArray(e)?e:{stdout:e},...t||{}}}function q(e){return {result:"failure",data:{error:e}}}function V(e,t,r){let o=r?.label??"invokeExecutionRefSync",n=r?.cliDir??r?.cwd??process.cwd(),s;try{s=ke(e.argsMassaging,tt(e,t),o);}catch(h){let R=h instanceof Error?h.message:String(h);return q(R)}let u;try{u=le(e,n);}catch(h){let R=h instanceof Error?h.message:String(h);return q(`[${o}] ref resolution failed: ${R}`)}let p=[...u.baseArgs,...s.cmdArgs??[]],x=JSON.stringify(s.stdin??t),c=ze(),l;try{l=c.executeSync(u.command,p,{timeout:r?.timeoutMs??3e4,encoding:"utf-8",cwd:r?.cwd,input:x});}catch(h){let R=h,y=(R.stderr?String(R.stderr):"").trim(),d=typeof R.status=="number"?R.status:"unknown",f=y||R.message;return q(`[${o}] ref exited with status ${d}${f?`: ${f}`:""}`)}try{return rt(et(l))}catch{return {result:"success",data:{stdout:l.trim()}}}}async function Ze(e,t,r){let o=r?.label??"invokeExecutionRef",n;try{n=ke(e.argsMassaging,tt(e,t),o);}catch(h){let R=h instanceof Error?h.message:String(h);return q(R)}let s=L(e.whatToRun),u=n.headers?{"Content-Type":"application/json",...n.headers}:{"Content-Type":"application/json"},p=n.url??s,x;if(e.howToRun==="http:get"){let h=n.body&&typeof n.body=="object"&&!Array.isArray(n.body)?n.body:t,R=new URLSearchParams(Object.entries(h).filter(([,y])=>y!=null).map(([y,d])=>[y,String(d)]));R.size>0&&(p=`${p}${p.includes("?")?"&":"?"}${R.toString()}`);}else x=JSON.stringify(n.body??t);let c={method:e.howToRun==="http:get"?"GET":"POST",headers:u,body:x},l=0;for(;;)try{let h=await fetch(p,c);if(!h.ok){let f=await h.text().catch(()=>"");return q(`[${o}] HTTP ${h.status}${f?`: ${f}`:""}`)}let R={};h.headers.forEach((f,m)=>{R[m]=f;});let y=new Uint8Array(await h.arrayBuffer());if(y.byteLength===0)return {result:"success",data:{},headers:R};let d=new TextDecoder().decode(y);try{return rt(et(d),{headers:R})}catch{return {result:"success",data:{stdout:d},headers:R}}}catch(h){let R=h?.cause,y=R&&typeof R=="object"&&"code"in R?String(R.code||""):"";if((y==="ECONNRESET"||y==="UND_ERR_SOCKET")&&l===0){l+=1;continue}let f=h instanceof Error?h.message:String(h),m=R instanceof Error?`${R.name}: ${R.message}${y?` [${y}]`:""}`:R?String(R):"",S=n.url??s??"",a=`${f}${m?` (cause: ${m})`:""}${S?` url=${S}`:""}`;return q(`[${o}] ${a}`)}}async function Wt(e,t,r){let o=r?.label??"invokeExecutionRef",n=L(e.whatToRun).trim();if(!n)return q(`[${o}] in-process-loop requires a non-empty handler key`);let s=be.get(n);if(!s)return q(`[${o}] no in-process handler registered for: ${n}`);try{return await s(e,t,r)}catch(u){let p=u instanceof Error?u.message:String(u);return q(`[${o}] ${p}`)}}var Ht={"local-node":async(e,t,r)=>V(e,t,r),"local-python":async(e,t,r)=>V(e,t,r),"local-process":async(e,t,r)=>V(e,t,r),"built-in":async(e,t,r)=>V(e,t,r),"http:post":Ze,"http:get":Ze,"in-process-loop":Wt},Vt={"local-node":V,"local-python":V,"local-process":V,"built-in":V};async function Z(e,t,r){let o=r?.transports?.[e.howToRun]??Ht[e.howToRun];return o?o(e,t,r):q(`[${r?.label??"invokeExecutionRef"}] unsupported howToRun: ${e.howToRun}`)}function ve(e,t,r){let o=r?.syncTransports?.[e.howToRun]??Vt[e.howToRun];return o?o(e,t,r):q(`[${r?.label??"invokeExecutionRefSync"}] unsupported sync howToRun: ${e.howToRun}`)}function Ut(e){return {invoke(t,r){return Z(t,r,e)},invokeSync(t,r){return ve(t,r,e)}}}function zt(e,t,r){return ve(e,t,r)}function Ae(e={}){let t=e.resolveRef??(r=>r);return {...e.executorTimeouts?{executorTimeouts:e.executorTimeouts}:{},async invokeExecutor(r,o,n){let s=t(r);if(s.howToRun==="queue-storage")throw new Error("queue-storage does not support inline executor request/response");if(s.howToRun==="http:post"||s.howToRun==="in-process-loop"){let l=await h(s,{subcommand:o,...n?.input!==void 0?{input:n.input}:{}});return typeof l=="string"?l:l&&typeof l=="object"&&!Array.isArray(l)&&typeof l.stdout=="string"?String(l.stdout):JSON.stringify(l??{})}if(s.howToRun==="http:get"){let l=await Z(s,{subcommand:o,...n?.input!==void 0?{input:n.input}:{},...s.extra?{extra:s.extra}:{}},{cwd:process.cwd(),timeoutMs:n?.timeout??3e4,label:`invokeExecutor:${o}`});if(l.result!=="success"){let h=typeof l.data?.error=="string"?l.data.error:l.error;throw new Error(h||`executor request failed: ${l.result}`)}return typeof l.data?.stdout=="string"?l.data.stdout:JSON.stringify(l.data??{})}if(!e.resolveCliDir)throw new Error(`createNonCoreExecutorDispatcher: ref.howToRun="${s.howToRun}" requires opts.resolveCliDir`);let{command:u,baseArgs:p}=le(s,e.resolveCliDir()),x=s.extra?["--extra",Buffer.from(JSON.stringify(s.extra)).toString("base64")]:[],c=[...p,o,...x];return await new Promise((l,h)=>{let R=spawn(u,c,{cwd:process.cwd(),stdio:"pipe",windowsHide:true,shell:process.platform==="win32"&&/\.(cmd|bat)$/i.test(u)}),y=[],d=[],f=false,m=null,S=g=>{f||(f=true,m&&clearTimeout(m),h(g));},a=g=>{f||(f=true,m&&clearTimeout(m),l(g));};R.stdout.on("data",g=>{y.push(Buffer.from(g));}),R.stderr.on("data",g=>{d.push(Buffer.from(g));}),R.on("error",g=>{let v=g;v.stdout=Buffer.concat(y).toString("utf-8"),v.stderr=Buffer.concat(d).toString("utf-8"),S(v);}),R.on("close",g=>{let v=Buffer.concat(y).toString("utf-8"),b=Buffer.concat(d).toString("utf-8");if(g===0){a(v);return}let k=new Error(b.trim()||`executor exited with status ${g}`);k.stdout=v,k.stderr=b,S(k);}),n?.timeout&&n.timeout>0&&(m=setTimeout(()=>{R.kill();let g=new Error(`executor timed out after ${n.timeout}ms`);g.stdout=Buffer.concat(y).toString("utf-8"),g.stderr=Buffer.concat(d).toString("utf-8"),S(g);},n.timeout)),n?.input!==void 0?R.stdin.end(n.input):R.stdin.end();})}}}function B(e,t){if(process.platform!=="win32"){i.renameSync(e,t);return}let r=[10,20,40,80,160];for(let o=0;o<=r.length;o++)try{i.renameSync(e,t);return}catch(n){let s=n.code;if((s==="EPERM"||s==="EBUSY")&&o<r.length){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,r[o]);continue}throw n}}function U(e){function t(n){return w.join(e,...n.split("/"))}function r(n){return w.relative(e,n).replace(/\\/g,"/")}function o(n,s){if(i.existsSync(n))for(let u of i.readdirSync(n,{withFileTypes:true})){let p=w.join(n,u.name);if(u.isDirectory()){o(p,s);continue}u.isFile()&&s.push(r(p));}}return {read(n){let s=t(n);if(!i.existsSync(s))return null;try{return i.readFileSync(s,"utf-8")}catch{return null}},write(n,s){let u=t(n),p=`${u}.${process.pid}.${randomUUID()}.tmp`;i.mkdirSync(w.dirname(u),{recursive:true}),i.writeFileSync(p,s,"utf-8"),B(p,u);},exists(n){return i.existsSync(t(n))},remove(n){let s=t(n);try{i.existsSync(s)&&i.unlinkSync(s);}catch{}},readBytes(n){let s=t(n);if(!i.existsSync(s))return null;try{return new Uint8Array(i.readFileSync(s))}catch{return null}},writeBytes(n,s){let u=t(n),p=`${u}.${process.pid}.${randomUUID()}.tmp`;i.mkdirSync(w.dirname(u),{recursive:true}),i.writeFileSync(p,Buffer.from(s)),B(p,u);},listKeys(n){let s=[];o(e,s);let u=s.sort();return n?u.filter(p=>p.startsWith(n)):u},stat(n){let s=t(n);if(!i.existsSync(s))return null;try{let u=i.statSync(s);return {key:n,size:Number(u.size||0),updatedAt:new Date(u.mtimeMs).toISOString()}}catch{return null}},keyRef(n){return {kind:"fs-path",value:t(n)}},renameKey(n,s){let u=t(n);if(!i.existsSync(u))return false;let p=t(s);return i.mkdirSync(w.dirname(p),{recursive:true}),B(u,p),true}}}function Ie(){return {read(e){if(!i.existsSync(e))return null;try{return i.readFileSync(e,"utf-8")}catch{return null}},write(e,t){let r=`${e}.${process.pid}.${randomUUID()}.tmp`;i.mkdirSync(w.dirname(e),{recursive:true}),i.writeFileSync(r,t,"utf-8"),B(r,e);},exists(e){return i.existsSync(e)},remove(e){try{i.existsSync(e)&&i.unlinkSync(e);}catch{}},readBytes(e){if(!i.existsSync(e))return null;try{return new Uint8Array(i.readFileSync(e))}catch{return null}},writeBytes(e,t){let r=`${e}.${process.pid}.${randomUUID()}.tmp`;i.mkdirSync(w.dirname(e),{recursive:true}),i.writeFileSync(r,Buffer.from(t)),B(r,e);},stat(e){if(!i.existsSync(e))return null;try{let t=i.statSync(e);return {key:e,size:Number(t.size||0),updatedAt:new Date(t.mtimeMs).toISOString()}}catch{return null}},listKeys(e){return []},renameKey(e,t){return i.existsSync(e)?(i.mkdirSync(w.dirname(t),{recursive:true}),B(e,t),true):false}}}function D(e,t){let r=`${e}.${process.pid}.${randomUUID()}.tmp`;i.mkdirSync(w.dirname(e),{recursive:true}),i.writeFileSync(r,JSON.stringify(t,null,2),"utf-8"),B(r,e);}function N(e){if(!i.existsSync(e))return null;try{return JSON.parse(i.readFileSync(e,"utf-8"))}catch{return null}}function X(e){return i.existsSync(e)?i.readdirSync(e).filter(t=>t.endsWith(".json")).sort().map(t=>w.join(e,t)):[]}function ee(e){return {id:e.id,body:e.body,enqueuedAt:e.enqueuedAt,attempt:e.attempt}}function Xt(e){return {...ee(e),leaseToken:String(e.leaseToken||""),leaseExpiresAt:String(e.leaseExpiresAt||"")}}function er(e){return {...ee(e),reason:e.reason}}function je(e){let t=w.join(e,"active"),r=w.join(e,"leased"),o=w.join(e,"done"),n=w.join(e,"dead"),s=w.join(e,"staged");for(let d of [t,r,o,n,s])i.mkdirSync(d,{recursive:true});let u=0;function p(d){let f=d.replace(/[:.]/g,"-"),m=String(u++).padStart(6,"0");return `${f}-${m}`}function x(d){let f=d.activeOrderKey||p(String(d.enqueuedAt||new Date().toISOString()));return w.join(t,`${f}-${d.id}.json`)}function c(d){return w.join(r,`${d}.json`)}function l(d){return w.join(o,`${d}.json`)}function h(d){return w.join(n,`${d}.json`)}function R(d){return w.join(s,`${d}.json`)}function y(){let d=Date.now();for(let f of X(r)){let m=N(f);if(!m?.leaseExpiresAt)continue;let S=Date.parse(m.leaseExpiresAt);if(Number.isNaN(S)||S>d)continue;let a={id:m.id,body:m.body,enqueuedAt:m.enqueuedAt,attempt:m.attempt,activeOrderKey:m.activeOrderKey};D(x(a),a);try{i.unlinkSync(f);}catch{}}}return {enqueue(d){let f={id:randomUUID(),body:d,enqueuedAt:new Date().toISOString(),attempt:0};return f.activeOrderKey=p(f.enqueuedAt),D(x(f),f),ee(f)},enqueueMany(d){return d.map(f=>this.enqueue(f))},enqueueIfAbsent(d,f){y();for(let S of [t,r,s])for(let a of X(S))if(N(a)?.dedupKey===f)return null;let m={id:randomUUID(),body:d,enqueuedAt:new Date().toISOString(),attempt:0,dedupKey:f};return m.activeOrderKey=p(m.enqueuedAt),D(x(m),m),ee(m)},lease(d){y();let f=Math.max(1,Math.floor(d?.max??1)),m=Math.max(1,Math.floor(d?.visibilityMs??6e4)),S=[];for(let a of X(t)){if(S.length>=f)break;let g=N(a);if(!g)continue;let v=c(g.id);try{B(a,v);}catch{continue}let b={...g,attempt:(Number(g.attempt)||0)+1,leaseToken:randomUUID(),leaseExpiresAt:new Date(Date.now()+m).toISOString()};D(v,b),S.push(Xt(b));}return S},ack(d,f){let m=c(d),S=N(m);if(!S||S.leaseToken!==f)return false;try{B(m,l(d));}catch{return false}return true},nack(d,f,m){let S=c(d),a=N(S);if(!a||a.leaseToken!==f)return false;let g={id:a.id,body:a.body,enqueuedAt:a.enqueuedAt,attempt:a.attempt,activeOrderKey:a.activeOrderKey};m?.dead?(g.reason=m.reason,D(h(d),g)):D(x(g),g);try{i.unlinkSync(S);}catch{}return true},peekActive(d){return y(),X(t).map(f=>N(f)).filter(f=>!!f).map(ee)},peekDeadLetter(d){return X(n).map(f=>N(f)).filter(f=>!!f).map(er)},stage(d,f){let m=f?.dedupKey;if(m){y();for(let a of [t,r,s])for(let g of X(a))if(N(g)?.dedupKey===m)return null}let S={id:randomUUID(),body:d,enqueuedAt:new Date().toISOString(),attempt:0,...m?{dedupKey:m}:{}};return D(R(S.id),S),ee(S)},commitStaged(d){let f=R(d),m=N(f);if(!m)return false;let S=new Date().toISOString(),a={...m,attempt:0,enqueuedAt:S,activeOrderKey:p(S)};D(x(a),a);try{i.unlinkSync(f);}catch{}return true},discardStaged(d,f){let m=R(d),S=N(m);if(!S)return false;let a={id:S.id,body:S.body,enqueuedAt:S.enqueuedAt,attempt:S.attempt,reason:f};D(h(d),a);try{i.unlinkSync(m);}catch{}return true},peekStaged(d){return X(s).map(f=>N(f)).filter(f=>!!f).map(ee)}}}var Ee="__scratch-marker",Te="__scratch-config.json",tr=1440*60*1e3,rr=720*60*1e3,nr=500;function nt(e,t){if(!e)return t;let r=e.replace(/[^A-Za-z0-9._-]/g,"_");return r.length>0?r:t}function oe(e){i.mkdirSync(e,{recursive:true});let t=w.join(e,Ee),r=w.join(e,Te),o=!i.existsSync(t);if(o)try{i.writeFileSync(t,`scratch-store
|
|
4
4
|
${new Date().toISOString()}
|
|
@@ -8,5 +8,5 @@ ${new Date().toISOString()}
|
|
|
8
8
|
`).filter(Boolean).map(o=>JSON.parse(o)):[]}return {append(r){let o={id:randomUUID(),payload:r};return i.mkdirSync(w.dirname(e),{recursive:true}),i.appendFileSync(e,JSON.stringify(o)+`
|
|
9
9
|
`,"utf-8"),o},readAll(){return t()},readAfter(r){let o=t();if(!r)return {entries:o,newCursor:o.length>0?o[o.length-1].id:null};let n=o.findIndex(u=>u.id===r),s=n===-1?o:o.slice(n+1);return {entries:s,newCursor:s.length>0?s[s.length-1].id:r}},clear(){i.existsSync(e)&&i.truncateSync(e,0);}}}function Ce(e){if(e==null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return `[${e.map(Ce).join(",")}]`;let t=e;return `{${Object.keys(t).sort().map(o=>`${JSON.stringify(o)}:${Ce(t[o])}`).join(",")}}`}function st(e){return createHash("sha256").update(Ce(e)).digest("hex")}function Be(e){let t=w.join(e,"board-journal.jsonl");return {readAllEntries(){if(!i.existsSync(t))return [];let r=i.readFileSync(t,"utf-8").trim();return r?r.split(`
|
|
10
10
|
`).filter(Boolean).map(o=>JSON.parse(o)):[]},appendEntry(r){i.appendFileSync(t,JSON.stringify(r)+`
|
|
11
|
-
`,"utf-8");},generateId(){return randomUUID()}}}function it(e){return {tryAcquire(){try{if(!i.existsSync(e)){i.mkdirSync(w.dirname(e),{recursive:!0});try{i.writeFileSync(e,"{}",{flag:"wx"});}catch{}}return lockSync(e,{retries:0})}catch{return null}}}}function z(e){return {status:"success",data:e}}function Q(e){return {status:"fail",error:e}}function re(e){return {status:"error",error:e instanceof Error?e.message:String(e)}}function ne(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ar(e,t={}){let r=()=>b$1(e.kvStorage("config")),o=t.unsupportedLabel??"hosted async runtime";async function n(){return t.taskExecutorRef?t.taskExecutorRef:await r().readTaskExecutorRef().catch(()=>{})}async function s(y,d,f){let m=await n();if(!m||!t.invokeExecutor)throw new Error(`${y} is not supported on the ${o} yet`);let a=(await t.invokeExecutor(m,y,{...d!==void 0?{input:typeof d=="string"?d:JSON.stringify(d)}:{},...f!==void 0?{timeout:f}:{}})).trim();return a?ne(JSON.parse(a)):{}}async function u(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("validateCardPreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=a$5(f),a=Array.isArray(f.source_defs)&&f.source_defs.length>0,g=[...S.issues];if(a)if(t.invokeExecutor&&await n())for(let v of f.source_defs){let b=typeof v.bindTo=="string"?v.bindTo:"(unknown)";try{let k=await s("validate-source-def",v,1e4);if(k.ok!==!0&&Array.isArray(k.errors))for(let A of k.errors)typeof A=="string"&&A&&g.push(`source "${b}": ${A}`);}catch(k){g.push(`source "${b}": executor validate-source-def failed \u2014 ${k instanceof Error?k.message:String(k)}`);}}else await n()&&g.push(`executor-backed source_def preflight is not supported on the ${o} yet`);return z({cardId:m,isValid:g.length===0,issues:g})}catch(d){return re(d)}}function p(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("evalCardCompute requires a JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=d["mock-fetched-sources"]??{},a=d["mock-requires"]??{},g=f.compute;if(!g||!Array.isArray(g)||g.length===0)return z({cardId:m,ok:!0,computed_values:{},errors:[]});let v={id:m,card_data:f.card_data??{},requires:a,source_defs:f.source_defs,compute:g},b=a$6.runSync(v,{sourcesData:S});return z({cardId:m,ok:(b.errors??[]).length===0,computed_values:b.node.computed_values??{},errors:b.errors??[]})}catch(d){return re(d)}}async function x(y){return Q(`${y} is not supported on the ${o} yet`)}async function c(){try{return t.invokeExecutor&&await n()?z(await s("describe-capabilities",void 0,1e4)):await x("describeTaskExecutorCapabilities")}catch(y){return re(y)}}async function l(y){try{if(!t.invokeExecutor||!await n())return await x("probeSourcePreflight");if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("probeSourcePreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=ne(d["mock-projections"]??{}),S=y.params?.sourceIdx,a=Array.isArray(f.source_defs)?f.source_defs:[];if(S===void 0)return Q("probeSourcePreflight requires params.sourceIdx");if(S<0||S>=a.length)return Q(`sourceIdx ${S} out of range (card has ${a.length} source(s))`);let g=a[S],v=typeof g.bindTo=="string"?g.bindTo:"source",b=await s("probe-source-preflight",{...g,_projections:m},g.timeout??6e4);return b.ok!==!0?Q(typeof b.error=="string"?b.error:"Preflight probe failed"):z({bindTo:v,reachable:b.reachable,latencyMs:b.latencyMs,...typeof b.note=="string"?{note:b.note}:{}})}catch(d){return re(d)}}async function h(y){try{if(!t.invokeExecutor||!await n())return await x("runSourcePreflight");if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("runSourcePreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=ne(d["mock-projections"]??{}),S=y.params?.sourceIdx,a=Array.isArray(f.source_defs)?f.source_defs:[];if(S===void 0)return Q("runSourcePreflight requires params.sourceIdx");if(S<0||S>=a.length)return Q(`sourceIdx ${S} out of range (card has ${a.length} source(s))`);let g=a[S],v=typeof g.bindTo=="string"?g.bindTo:"source",b=await s("run-source-preflight",{...g,_projections:m},g.timeout??6e4);return b.ok!==!0?z({bindTo:v,ok:!1,result:null,issues:[typeof b.error=="string"?b.error:"Preflight run failed"]}):z({bindTo:v,ok:!0,result:Object.prototype.hasOwnProperty.call(b,"resultValue")?b.resultValue:null,issues:[]})}catch(d){return re(d)}}async function R(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("simulateCardCycle requires a JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=ne(d["mock-fetched-sources"]??{}),a=ne(d["mock-requires"]??{}),g=await u({body:{"card-content":f}}),v=g.status==="success"?{isValid:g.data.isValid,issues:g.data.issues}:{isValid:!1,issues:[g.status==="fail"?g.error:"internal error"]},b=Array.isArray(f.source_defs)?f.source_defs:[],k=ne(f.card_data??{}),A=[],F=[];if(b.length>0){A=a$6.enrichSourcesSync(b,{card_data:k,requires:a});for(let I of A){let P=I.projections,W=I._projections;if(P&&W){for(let $ of Object.keys(P))if(W[$]===void 0){let ut=typeof I.bindTo=="string"?I.bindTo:"(unknown)";F.push({bindTo:ut,key:$,error:`Projection "${$}" resolved to undefined`});}}}}let E=[],M={...S};for(let I=0;I<A.length;I+=1){let P=A[I],W=typeof P.bindTo=="string"?P.bindTo:`source_${I}`;if(!t.invokeExecutor||!await n()){E.push({bindTo:W,skipped:!0,error:"No task executor configured"});continue}try{let $=await s("run-source-preflight",P,P.timeout??6e4);$.ok===!0&&!Object.prototype.hasOwnProperty.call(S,W)&&Object.prototype.hasOwnProperty.call($,"resultValue")&&(M[W]=$.resultValue),E.push({bindTo:W,reachable:$.reachable,latencyMs:$.latencyMs,...$.ok===!0?{}:{error:typeof $.error=="string"?$.error:"Preflight run failed"}});}catch{E.push({bindTo:W,skipped:!0,error:"Executor does not support run-source-preflight"});}}let K=f.compute,te={},G=[];if(K&&Array.isArray(K)&&K.length>0){let I={id:m,card_data:k,requires:a,source_defs:f.source_defs,compute:K},P=a$6.runSync(I,{sourcesData:M});te=P.node.computed_values??{},G=P.errors??[];}return z({cardId:m,ok:v.isValid&&F.length===0&&G.length===0&&E.every(I=>!I.error),validation:v,source_probes:E,projection_errors:F,fetched_sources:M,computed_values:te,compute_errors:G})}catch(d){return re(d)}}return {describeTaskExecutorCapabilities:c,validateCardPreflight:u,evalCardCompute:p,probeSourcePreflight:l,runSourcePreflight:h,simulateCardCycle:R}}function sn(){return {async invoke(e,t){if(e.howToRun!=="local-node")return {dispatched:false,error:`createNodeSpawnInvocationAdapter: unsupported howToRun "${e.howToRun}"`};let r="";try{let s=e.whatToRun;r=L(s);}catch{r="";}if(!r)return {dispatched:false,error:"createNodeSpawnInvocationAdapter: could not resolve executable path from whatToRun"};let o={...t},n=Buffer.from(JSON.stringify(o)).toString("base64");try{return spawn(process.execPath,[r,"--boardId",String(t.boardId??""),"--cardId",String(t.cardId??""),"--extraEncJson",n],{stdio:"ignore",windowsHide:!0}).unref(),{dispatched:!0}}catch(s){return {dispatched:false,error:s instanceof Error?s.message:String(s)}}},async describe(e){if(e.howToRun!=="local-node")return null;let t="";try{let r=e.whatToRun;t=L(r);}catch{t="";}if(!t)return null;try{let r=spawnSync(process.execPath,[t,"describe"],{timeout:5e3,encoding:"utf-8",windowsHide:!0});return r.status!==0?null:JSON.parse(String(r.stdout).trim())}catch{return null}}}}var dr=".board.lock";function at(e,t){if(!e||!t)return false;let r=String(e).replace(/[\\/]+$/,"").split(/[\\/]+/).filter(Boolean);return r.length>0&&r[r.length-1]===t}function lr(e,t){return typeof e=="string"?{cliDir:e,opts:t}:{cliDir:void 0,opts:e}}function fr(e,t){return typeof e=="string"?{cliDir:e,opts:t}:{cliDir:void 0,opts:e}}function ct(e){if(e)return e;let t=Je(import.meta.url),r=[t,C(t,"..","cli","node"),C(t,"..","..","cli","node")];for(let o of r)try{return Ve(o),o}catch{}throw new Error(`createFsBoardPlatformAdapter: could not resolve a public CLI directory from module dir ${t}`)}function pr(e,t,r){let{cliDir:o,opts:n}=lr(t,r),s=e.value,u=null,p,x=null,c;function l(){return c||(c=ct(o)),c}function h(a){let g=n?.queueStoreRef;if(!g)throw new Error(`createFsBoardPlatformAdapter: ${a} requires opts.queueStoreRef`);return g}function R(a){let g=n?.boardRuntimeStoreRef;if(!g)throw new Error(`createFsBoardPlatformAdapter: ${a} requires opts.boardRuntimeStoreRef`);return g}let y$1=n?.callbackTransport??g({notifyChannel:n?.notifyChannel,boardRuntimeStoreRef:n?.boardRuntimeStoreRef,queueStoreRef:n?.queueStoreRef}),d;function f(a){return d.queueStorageForRef(h(`internal lane "${a}"`),a)}function m(a){return a$4(f(a))}function S(){if(n?.suppressSpawn||u)return;let a=xe({id:"task-executor",workerStore:m("task-executor"),handleRequest:async(g,v)=>{let b=await Z(v.ref,v.args,{cliDir:l(),cwd:process.cwd(),label:"fsBoardAdapter.boardWorker"});if(b.result!=="success"){let k=typeof b.data?.error=="string"?b.data.error:b.error;throw new Error(k||b.result)}}});u=de(a).catch(g=>{n?.onWarn?.(`[board-worker] in-process queue drain failed: ${g instanceof Error?g.message:String(g)}`);}).finally(()=>{u=null,f("task-executor").peekActive().length>0&&S();});}return d={kvStorage:a=>se(C(s,`.${a}`)),blobStorage:a=>a?U(C(s,a)):U(s),blobStorageForRef:a=>U(b(a).value),chatStorageForRef:a=>gr(b(a).value),queueStorageForRef:(a,g)=>je(C(b(a).value,g)),scratchStorage:()=>oe(C(s,".tmp")),scratchStorageForRef:a=>oe(b(a).value),archiveFactory:()=>ge(C(s,"archive")),archiveFactoryForRef:a=>ge(b(a).value),journalAdapter:()=>Be(s),journalAdapterForRef:a=>Be(b(a).value),lock:it(C(s,dr)),callbackTransport:y$1,async dispatchExecution(a,g){let v=!!g.output?.ref;if(a.howToRun==="queue-storage")try{let k=m("task-executor"),A=typeof a.extra?.boardId=="string"?a.extra.boardId:void 0;if(v)return k.enqueueRequest({boardId:A,ref:a,args:g}),{dispatched:!0};let F=g.source_def?.bindTo??ue().slice(0,8),E=oe(C(s,".tmp")),M=E.create(JSON.stringify(g,null,2),`exec-in-${F}`,".json"),K=E.getUniqueKey(`exec-out-${F}`,".json"),te=E.getUniqueKey(`exec-err-${F}`,".txt"),G=a$1(E.keyRef(M)),I=a$1(E.keyRef(K)),P=a$1(E.keyRef(te));return k.enqueueRequest({boardId:A,ref:a,args:{subcommand:"run-source-fetch",inRef:G,outRef:I,errRef:P}}),{dispatched:!0}}catch(k){return {dispatched:false,error:k instanceof Error?k.message:String(k)}}if(v&&(a.howToRun==="http:post"||a.howToRun==="in-process-loop"))try{if(a.howToRun==="http:post"){let F=L(a.whatToRun),E=await fetch(F,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...g,...a.extra?{extra:a.extra}:{}})});if(!E.ok){let M=await E.text().catch(()=>"");return {dispatched:!1,error:`HTTP ${E.status}: ${M}`}}return {dispatched:!0}}let k=await Z(a,g,{cwd:process.cwd(),label:"dispatchExecution.directHostedWorker"});return k.result==="success"?{dispatched:!0}:{dispatched:!1,error:(typeof k.data?.error=="string"?k.data.error:k.error)||k.result}}catch(k){return {dispatched:false,error:k instanceof Error?k.message:String(k)}}let b=a.howToRun==="local-node"||a.howToRun==="local-process"||a.howToRun==="local-python"||a.howToRun==="built-in";if(n?.suppressSpawn&&b)return {dispatched:false};try{let k=g.source_def?.bindTo??ue().slice(0,8),A=oe(C(s,".tmp")),F=A.create(JSON.stringify(g,null,2),`exec-in-${k}`,".json"),E=A.getUniqueKey(`exec-out-${k}`,".json"),M=A.getUniqueKey(`exec-err-${k}`,".txt"),K=a$1(A.keyRef(F)),te=a$1(A.keyRef(E)),G=a$1(A.keyRef(M)),I=m("task-executor"),P=typeof a.extra?.boardId=="string"?a.extra.boardId:void 0;return I.enqueueRequest({boardId:P,ref:a,args:{subcommand:"run-source-fetch",inRef:K,outRef:te,errRef:G}}),S(),{dispatched:!0}}catch(k){let A=k instanceof Error?k.message:String(k);try{let F=ge(C(s,"archive")),E=new Date().toISOString().replace(/[:.]/g,"-"),M=g.source_def?.bindTo??"unknown";F.blob("exec-failures").write(`${E}-${M}.json`,JSON.stringify({error:A,args:g,ref:a,at:new Date().toISOString()},null,2));}catch{}return {dispatched:false,error:A}}},supportsDirectSourceOutput(a){return a.howToRun==="queue-storage"||a.howToRun==="http:post"||a.howToRun==="in-process-loop"},resolveBlob(a){let g=Ne(a.value)?Ie().read(a.value):U(s).read(a.value);if(g===null)throw new Error(`resolveBlob: blob not found: ::${a.kind}::${a.value}`);return g},hashFn:st,genId:()=>Qe(`${Date.now()}-${Math.random()}`).slice(0,32),kvStorageForRef:a=>se(b(a).value),requestProcessAccumulated(){if(n?.suppressSpawn||x)return;let a=this,g=p??=y(e,a,{boardRuntimeStoreRef:R("requestProcessAccumulated")}),v=we({id:"process-accumulated",queueStorage:f("process-accumulated"),handleMessage:async()=>{let b=await g.processAccumulatedEvents({});if(b.status!=="success")throw new Error(b.error||`processAccumulatedEvents returned ${b.status}`)}});x=de(v).catch(b=>{n?.onWarn?.(`[process-accumulated] in-process queue drain failed: ${b instanceof Error?b.message:String(b)}`);}).finally(()=>{x=null,f("process-accumulated").peekActive().length>0&&a.requestProcessAccumulated?.();});},publishBoardChangeNotifications(a){if(!n?.notifyChannel||a.length===0)return;let g=a.map(v=>({id:ue(),ts:new Date().toISOString(),boardRef:a$1(e),notification:v}));Ue(n.notifyChannel,g,n.onWarn);},onWarn:n?.onWarn},d}function an(e,t,r){let{cliDir:o,opts:n}=fr(t,r),s,u=()=>(s||(s=ct(o)),s),p=pr(e,o,n),x=Ae({resolveCliDir:u,...n?.resolveRef?{resolveRef:n.resolveRef}:{}});return {...p,invokeExecutor:x.invokeExecutor,validateSchema(c){let l=d(c);return {ok:l.errors.length===0,errors:l.errors}},absoluteBlob:Ie()}}function cn(e,t={}){let r=t.chatsSubdir??"chats",o=t.kvSubdir??".kv",n=o?[o,"chat"]:["chat"],s=r&&!at(e,r)?C(e,r):e,u=se(C(e,...n));return a$2(p=>{let c=`${String(p).replace(/[^a-zA-Z0-9_-]/g,"_")}.jsonl`,l=C(s,c);return me(l)},u)}function gr(e){return a$2(t=>{let o=`${String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}.jsonl`;return me(C(e,"journal",o))},se(C(e,"kv")))}function un(e,t={}){let r=t.filesSubdir??"files",o=r&&!at(e,r)?C(e,r):e;return a$3(U(o))}function dn(e){try{let t=JSON.parse(Buffer.from(e,"base64url").toString());return typeof t.br=="string"?t.br:null}catch{return null}}export{le as buildLocalBaseSpec,xe as createBoardWorkerQueueLane,Ut as createExecutionRefInvoker,U as createFsBlobStorage,cn as createFsBoardChatStorage,un as createFsBoardFileArtifactsStore,an as createFsBoardNonCorePlatformAdapter,pr as createFsBoardPlatformAdapter,gr as createFsChatStorageForRefRoot,je as createFsQueueStorage,ar as createHostedAsyncBoardNonCorePublic,sn as createNodeSpawnInvocationAdapter,Ae as createNonCoreExecutorDispatcher,we as createQueueStorageLane,dn as decodeBoardRefFromToken,de as drainQueueLaneToIdle,ke as evaluateArgsMassaging,Z as invokeExecutionRef,ve as invokeExecutionRefSync,zt as invokeRefSync,Dt as registerInProcessExecutionHandler,L as resolveWhatToRunValue,Xe as resolveYamlFlowCliPath,Ye as startQueueLaneRunner,Ot as startQueueLaneRunners,Kt as unregisterInProcessExecutionHandler};//# sourceMappingURL=board-live-cards-node.js.map
|
|
11
|
+
`,"utf-8");},generateId(){return randomUUID()}}}function it(e){return {tryAcquire(){try{if(!i.existsSync(e)){i.mkdirSync(w.dirname(e),{recursive:!0});try{i.writeFileSync(e,"{}",{flag:"wx"});}catch{}}return lockSync(e,{retries:0})}catch{return null}}}}function z(e){return {status:"success",data:e}}function Q(e){return {status:"fail",error:e}}function re(e){return {status:"error",error:e instanceof Error?e.message:String(e)}}function ne(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function ar(e,t={}){let r=()=>b$1(e.kvStorage("config")),o=t.unsupportedLabel??"hosted async runtime";async function n(){return t.taskExecutorRef?t.taskExecutorRef:await r().readTaskExecutorRef().catch(()=>{})}async function s(y,d,f){let m=await n();if(!m||!t.invokeExecutor)throw new Error(`${y} is not supported on the ${o} yet`);let a=(await t.invokeExecutor(m,y,{...d!==void 0?{input:typeof d=="string"?d:JSON.stringify(d)}:{},...f!==void 0?{timeout:f}:{}})).trim();return a?ne(JSON.parse(a)):{}}async function u(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("validateCardPreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=a$5(f),a=Array.isArray(f.source_defs)&&f.source_defs.length>0,g=[...S.issues];if(a)if(t.invokeExecutor&&await n())for(let v of f.source_defs){let b=typeof v.bindTo=="string"?v.bindTo:"(unknown)";try{let k=await s("validate-source-def",v,1e4);if(k.ok!==!0&&Array.isArray(k.errors))for(let A of k.errors)typeof A=="string"&&A&&g.push(`source "${b}": ${A}`);}catch(k){g.push(`source "${b}": executor validate-source-def failed \u2014 ${k instanceof Error?k.message:String(k)}`);}}else await n()&&g.push(`executor-backed source_def preflight is not supported on the ${o} yet`);return z({cardId:m,isValid:g.length===0,issues:g})}catch(d){return re(d)}}function p(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("evalCardCompute requires a JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=d["mock-fetched-sources"]??{},a=d["mock-requires"]??{},g=f.compute;if(!g||!Array.isArray(g)||g.length===0)return z({cardId:m,ok:!0,computed_values:{},errors:[]});let v={id:m,card_data:f.card_data??{},requires:a,source_defs:f.source_defs,compute:g},b=a$6.runSync(v,{sourcesData:S});return z({cardId:m,ok:(b.errors??[]).length===0,computed_values:b.node.computed_values??{},errors:b.errors??[]})}catch(d){return re(d)}}async function x(y){return Q(`${y} is not supported on the ${o} yet`)}async function c(){try{return t.invokeExecutor&&await n()?z(await s("describe-capabilities",void 0,1e4)):await x("describeTaskExecutorCapabilities")}catch(y){return re(y)}}async function l(y){try{if(!t.invokeExecutor||!await n())return await x("probeSourcePreflight");if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("probeSourcePreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=ne(d["mock-projections"]??{}),S=y.params?.sourceIdx,a=Array.isArray(f.source_defs)?f.source_defs:[];if(S===void 0)return Q("probeSourcePreflight requires params.sourceIdx");if(S<0||S>=a.length)return Q(`sourceIdx ${S} out of range (card has ${a.length} source(s))`);let g=a[S],v=typeof g.bindTo=="string"?g.bindTo:"source",b=await s("probe-source-preflight",{...g,_projections:m},g.timeout??6e4);return b.ok!==!0?Q(typeof b.error=="string"?b.error:"Preflight probe failed"):z({bindTo:v,reachable:b.reachable,latencyMs:b.latencyMs,...typeof b.note=="string"?{note:b.note}:{}})}catch(d){return re(d)}}async function h(y){try{if(!t.invokeExecutor||!await n())return await x("runSourcePreflight");if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("runSourcePreflight requires card JSON object in body");let d=y.body,f=d["card-content"]??d,m=ne(d["mock-projections"]??{}),S=y.params?.sourceIdx,a=Array.isArray(f.source_defs)?f.source_defs:[];if(S===void 0)return Q("runSourcePreflight requires params.sourceIdx");if(S<0||S>=a.length)return Q(`sourceIdx ${S} out of range (card has ${a.length} source(s))`);let g=a[S],v=typeof g.bindTo=="string"?g.bindTo:"source",b=await s("run-source-preflight",{...g,_projections:m},g.timeout??6e4);return b.ok!==!0?z({bindTo:v,ok:!1,result:null,issues:[typeof b.error=="string"?b.error:"Preflight run failed"]}):z({bindTo:v,ok:!0,result:Object.prototype.hasOwnProperty.call(b,"resultValue")?b.resultValue:null,issues:[]})}catch(d){return re(d)}}async function R(y){try{if(!y.body||typeof y.body!="object"||Array.isArray(y.body))return Q("simulateCardCycle requires a JSON object in body");let d=y.body,f=d["card-content"]??d,m=typeof f.id=="string"?f.id:"(unknown)",S=ne(d["mock-fetched-sources"]??{}),a=ne(d["mock-requires"]??{}),g=await u({body:{"card-content":f}}),v=g.status==="success"?{isValid:g.data.isValid,issues:g.data.issues}:{isValid:!1,issues:[g.status==="fail"?g.error:"internal error"]},b=Array.isArray(f.source_defs)?f.source_defs:[],k=ne(f.card_data??{}),A=[],F=[];if(b.length>0){A=a$6.enrichSourcesSync(b,{card_data:k,requires:a});for(let I of A){let P=I.projections,W=I._projections;if(P&&W){for(let $ of Object.keys(P))if(W[$]===void 0){let ut=typeof I.bindTo=="string"?I.bindTo:"(unknown)";F.push({bindTo:ut,key:$,error:`Projection "${$}" resolved to undefined`});}}}}let E=[],M={...S};for(let I=0;I<A.length;I+=1){let P=A[I],W=typeof P.bindTo=="string"?P.bindTo:`source_${I}`;if(!t.invokeExecutor||!await n()){E.push({bindTo:W,skipped:!0,error:"No task executor configured"});continue}try{let $=await s("run-source-preflight",P,P.timeout??6e4);$.ok===!0&&!Object.prototype.hasOwnProperty.call(S,W)&&Object.prototype.hasOwnProperty.call($,"resultValue")&&(M[W]=$.resultValue),E.push({bindTo:W,reachable:$.reachable,latencyMs:$.latencyMs,...$.ok===!0?{}:{error:typeof $.error=="string"?$.error:"Preflight run failed"}});}catch{E.push({bindTo:W,skipped:!0,error:"Executor does not support run-source-preflight"});}}let K=f.compute,te={},G=[];if(K&&Array.isArray(K)&&K.length>0){let I={id:m,card_data:k,requires:a,source_defs:f.source_defs,compute:K},P=a$6.runSync(I,{sourcesData:M});te=P.node.computed_values??{},G=P.errors??[];}return z({cardId:m,ok:v.isValid&&F.length===0&&G.length===0&&E.every(I=>!I.error),validation:v,source_probes:E,projection_errors:F,fetched_sources:M,computed_values:te,compute_errors:G})}catch(d){return re(d)}}return {describeTaskExecutorCapabilities:c,validateCardPreflight:u,evalCardCompute:p,probeSourcePreflight:l,runSourcePreflight:h,simulateCardCycle:R}}function sn(){return {async invoke(e,t){if(e.howToRun!=="local-node")return {dispatched:false,error:`createNodeSpawnInvocationAdapter: unsupported howToRun "${e.howToRun}"`};let r="";try{let s=e.whatToRun;r=L(s);}catch{r="";}if(!r)return {dispatched:false,error:"createNodeSpawnInvocationAdapter: could not resolve executable path from whatToRun"};let o={...t},n=Buffer.from(JSON.stringify(o)).toString("base64");try{return spawn(process.execPath,[r,"--boardId",String(t.boardId??""),"--cardId",String(t.cardId??""),"--extraEncJson",n],{stdio:"ignore",windowsHide:!0}).unref(),{dispatched:!0}}catch(s){return {dispatched:false,error:s instanceof Error?s.message:String(s)}}},async describe(e){if(e.howToRun!=="local-node")return null;let t="";try{let r=e.whatToRun;t=L(r);}catch{t="";}if(!t)return null;try{let r=spawnSync(process.execPath,[t,"describe"],{timeout:5e3,encoding:"utf-8",windowsHide:!0});return r.status!==0?null:JSON.parse(String(r.stdout).trim())}catch{return null}}}}var dr=".board.lock";function at(e,t){if(!e||!t)return false;let r=String(e).replace(/[\\/]+$/,"").split(/[\\/]+/).filter(Boolean);return r.length>0&&r[r.length-1]===t}function lr(e,t){return typeof e=="string"?{cliDir:e,opts:t}:{cliDir:void 0,opts:e}}function fr(e,t){return typeof e=="string"?{cliDir:e,opts:t}:{cliDir:void 0,opts:e}}function ct(e){if(e)return e;let t=Je(import.meta.url),r=[t,C(t,"..","cli","node"),C(t,"..","..","cli","node")];for(let o of r)try{return Ve(o),o}catch{}throw new Error(`createFsBoardPlatformAdapter: could not resolve a public CLI directory from module dir ${t}`)}function pr(e,t,r){let{cliDir:o,opts:n}=lr(t,r),s=e.value,u=null,p,x=null,c;function l(){return c||(c=ct(o)),c}function h(a){let g=n?.queueStoreRef;if(!g)throw new Error(`createFsBoardPlatformAdapter: ${a} requires opts.queueStoreRef`);return g}function R(a){let g=n?.boardRuntimeStoreRef;if(!g)throw new Error(`createFsBoardPlatformAdapter: ${a} requires opts.boardRuntimeStoreRef`);return g}let y=n?.callbackTransport??g({notifyChannel:n?.notifyChannel,boardRuntimeStoreRef:n?.boardRuntimeStoreRef,queueStoreRef:n?.queueStoreRef}),d;function f(a){return d.queueStorageForRef(h(`internal lane "${a}"`),a)}function m(a){return a$4(f(a))}function S(){if(n?.suppressSpawn||u)return;let a=xe({id:"task-executor",workerStore:m("task-executor"),handleRequest:async(g,v)=>{let b=await Z(v.ref,v.args,{cliDir:l(),cwd:process.cwd(),label:"fsBoardAdapter.boardWorker"});if(b.result!=="success"){let k=typeof b.data?.error=="string"?b.data.error:b.error;throw new Error(k||b.result)}}});u=de(a).catch(g=>{n?.onWarn?.(`[board-worker] in-process queue drain failed: ${g instanceof Error?g.message:String(g)}`);}).finally(()=>{u=null,f("task-executor").peekActive().length>0&&S();});}return d={kvStorage:a=>se(C(s,`.${a}`)),blobStorage:a=>a?U(C(s,a)):U(s),blobStorageForRef:a=>U(b(a).value),chatStorageForRef:a=>gr(b(a).value),queueStorageForRef:(a,g)=>je(C(b(a).value,g)),scratchStorage:()=>oe(C(s,".tmp")),scratchStorageForRef:a=>oe(b(a).value),archiveFactory:()=>ge(C(s,"archive")),archiveFactoryForRef:a=>ge(b(a).value),journalAdapter:()=>Be(s),journalAdapterForRef:a=>Be(b(a).value),lock:it(C(s,dr)),callbackTransport:y,async dispatchExecution(a,g){let v=!!g.output?.ref;if(a.howToRun==="queue-storage")try{let k=m("task-executor"),A=typeof a.extra?.boardId=="string"?a.extra.boardId:void 0;if(v)return k.enqueueRequest({boardId:A,ref:a,args:g}),{dispatched:!0};let F=g.source_def?.bindTo??ue().slice(0,8),E=oe(C(s,".tmp")),M=E.create(JSON.stringify(g,null,2),`exec-in-${F}`,".json"),K=E.getUniqueKey(`exec-out-${F}`,".json"),te=E.getUniqueKey(`exec-err-${F}`,".txt"),G=a$1(E.keyRef(M)),I=a$1(E.keyRef(K)),P=a$1(E.keyRef(te));return k.enqueueRequest({boardId:A,ref:a,args:{subcommand:"run-source-fetch",inRef:G,outRef:I,errRef:P}}),{dispatched:!0}}catch(k){return {dispatched:false,error:k instanceof Error?k.message:String(k)}}if(v&&(a.howToRun==="http:post"||a.howToRun==="in-process-loop"))try{if(a.howToRun==="http:post"){let F=L(a.whatToRun),E=await fetch(F,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...g,...a.extra?{extra:a.extra}:{}})});if(!E.ok){let M=await E.text().catch(()=>"");return {dispatched:!1,error:`HTTP ${E.status}: ${M}`}}return {dispatched:!0}}let k=await Z(a,g,{cwd:process.cwd(),label:"dispatchExecution.directHostedWorker"});return k.result==="success"?{dispatched:!0}:{dispatched:!1,error:(typeof k.data?.error=="string"?k.data.error:k.error)||k.result}}catch(k){return {dispatched:false,error:k instanceof Error?k.message:String(k)}}let b=a.howToRun==="local-node"||a.howToRun==="local-process"||a.howToRun==="local-python"||a.howToRun==="built-in";if(n?.suppressSpawn&&b)return {dispatched:false};try{let k=g.source_def?.bindTo??ue().slice(0,8),A=oe(C(s,".tmp")),F=A.create(JSON.stringify(g,null,2),`exec-in-${k}`,".json"),E=A.getUniqueKey(`exec-out-${k}`,".json"),M=A.getUniqueKey(`exec-err-${k}`,".txt"),K=a$1(A.keyRef(F)),te=a$1(A.keyRef(E)),G=a$1(A.keyRef(M)),I=m("task-executor"),P=typeof a.extra?.boardId=="string"?a.extra.boardId:void 0;return I.enqueueRequest({boardId:P,ref:a,args:{subcommand:"run-source-fetch",inRef:K,outRef:te,errRef:G}}),S(),{dispatched:!0}}catch(k){let A=k instanceof Error?k.message:String(k);try{let F=ge(C(s,"archive")),E=new Date().toISOString().replace(/[:.]/g,"-"),M=g.source_def?.bindTo??"unknown";F.blob("exec-failures").write(`${E}-${M}.json`,JSON.stringify({error:A,args:g,ref:a,at:new Date().toISOString()},null,2));}catch{}return {dispatched:false,error:A}}},supportsDirectSourceOutput(a){return a.howToRun==="queue-storage"||a.howToRun==="http:post"||a.howToRun==="in-process-loop"},resolveBlob(a){let g=Ne(a.value)?Ie().read(a.value):U(s).read(a.value);if(g===null)throw new Error(`resolveBlob: blob not found: ::${a.kind}::${a.value}`);return g},hashFn:st,genId:()=>Qe(`${Date.now()}-${Math.random()}`).slice(0,32),kvStorageForRef:a=>se(b(a).value),requestProcessAccumulated(){if(n?.suppressSpawn||x)return;let a=this,g=p??=F(e,a,{boardRuntimeStoreRef:R("requestProcessAccumulated")}),v=we({id:"process-accumulated",queueStorage:f("process-accumulated"),handleMessage:async()=>{let b=await g.processAccumulatedEvents({});if(b.status!=="success")throw new Error(b.error||`processAccumulatedEvents returned ${b.status}`)}});x=de(v).catch(b=>{n?.onWarn?.(`[process-accumulated] in-process queue drain failed: ${b instanceof Error?b.message:String(b)}`);}).finally(()=>{x=null,f("process-accumulated").peekActive().length>0&&a.requestProcessAccumulated?.();});},publishBoardChangeNotifications(a){if(!n?.notifyChannel||a.length===0)return;let g=a.map(v=>({id:ue(),ts:new Date().toISOString(),boardRef:a$1(e),notification:v}));Ue(n.notifyChannel,g,n.onWarn);},onWarn:n?.onWarn},d}function an(e,t,r){let{cliDir:o,opts:n}=fr(t,r),s,u=()=>(s||(s=ct(o)),s),p=pr(e,o,n),x=Ae({resolveCliDir:u,...n?.resolveRef?{resolveRef:n.resolveRef}:{}});return {...p,invokeExecutor:x.invokeExecutor,validateSchema(c){let l=d(c);return {ok:l.errors.length===0,errors:l.errors}},absoluteBlob:Ie()}}function cn(e,t={}){let r=t.chatsSubdir??"chats",o=t.kvSubdir??".kv",n=o?[o,"chat"]:["chat"],s=r&&!at(e,r)?C(e,r):e,u=se(C(e,...n));return a$2(p=>{let c=`${String(p).replace(/[^a-zA-Z0-9_-]/g,"_")}.jsonl`,l=C(s,c);return me(l)},u)}function gr(e){return a$2(t=>{let o=`${String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}.jsonl`;return me(C(e,"journal",o))},se(C(e,"kv")))}function un(e,t={}){let r=t.filesSubdir??"files",o=r&&!at(e,r)?C(e,r):e;return a$3(U(o))}function dn(e){try{let t=JSON.parse(Buffer.from(e,"base64url").toString());return typeof t.br=="string"?t.br:null}catch{return null}}export{le as buildLocalBaseSpec,xe as createBoardWorkerQueueLane,Ut as createExecutionRefInvoker,U as createFsBlobStorage,cn as createFsBoardChatStorage,un as createFsBoardFileArtifactsStore,an as createFsBoardNonCorePlatformAdapter,pr as createFsBoardPlatformAdapter,gr as createFsChatStorageForRefRoot,je as createFsQueueStorage,ar as createHostedAsyncBoardNonCorePublic,sn as createNodeSpawnInvocationAdapter,Ae as createNonCoreExecutorDispatcher,we as createQueueStorageLane,dn as decodeBoardRefFromToken,de as drainQueueLaneToIdle,ke as evaluateArgsMassaging,Z as invokeExecutionRef,ve as invokeExecutionRefSync,zt as invokeRefSync,Dt as registerInProcessExecutionHandler,L as resolveWhatToRunValue,Xe as resolveYamlFlowCliPath,Ye as startQueueLaneRunner,Ot as startQueueLaneRunners,Kt as unregisterInProcessExecutionHandler};//# sourceMappingURL=board-live-cards-node.js.map
|
|
12
12
|
//# sourceMappingURL=board-live-cards-node.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkBAG7MHZP_cjs=require('./chunk-BAG7MHZP.cjs');require('./chunk-7JVHYHT2.cjs'),require('./chunk-VQCIOKJV.cjs'),require('./chunk-G4XXRHL2.cjs'),require('./chunk-LODXIALE.cjs'),require('./chunk-QBEQL4TL.cjs'),require('./chunk-QEHKMLHA.cjs'),require('./chunk-UJ7ZTV4J.cjs'),require('./chunk-5XLFPPTY.cjs'),require('./chunk-2RIHC5TZ.cjs'),require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"BOARD_GRAPH_KEY",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.s}});Object.defineProperty(exports,"EMPTY_CONFIG",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.B}});Object.defineProperty(exports,"SNAPSHOT_SCHEMA_VERSION_V1",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.r}});Object.defineProperty(exports,"createBoardLiveCardsNonCorePublic",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.G}});Object.defineProperty(exports,"createBoardLiveCardsPublic",{enumerable:true,get:function(){return chunkBAG7MHZP_cjs.F}});//# sourceMappingURL=board-live-cards-public.cjs.map
|
|
2
2
|
//# sourceMappingURL=board-live-cards-public.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{s as BOARD_GRAPH_KEY,B as EMPTY_CONFIG,r as SNAPSHOT_SCHEMA_VERSION_V1,G as createBoardLiveCardsNonCorePublic,F as createBoardLiveCardsPublic}from'./chunk-EZOXABJ2.js';import'./chunk-ANKA7HEJ.js';import'./chunk-44L64VQ2.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';import'./chunk-ATOQP3BD.js';import'./chunk-YT76JNKE.js';import'./chunk-MNEOJWPS.js';import'./chunk-7QNEV5S3.js';import'./chunk-UGB7PC4P.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=board-live-cards-public.js.map
|
|
2
2
|
//# sourceMappingURL=board-live-cards-public.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkMQAVZUXB_cjs=require('./chunk-MQAVZUXB.cjs');require('./chunk-LFVMX23W.cjs'),require('./chunk-NM6O35RY.cjs'),require('./chunk-NBJTYAYN.cjs'),require('./chunk-LRO5AL75.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-HVLWVMG6.cjs'),require('./chunk-WRMOGPRG.cjs'),require('./chunk-BAG7MHZP.cjs'),require('./chunk-7JVHYHT2.cjs'),require('./chunk-VQCIOKJV.cjs'),require('./chunk-G4XXRHL2.cjs'),require('./chunk-LODXIALE.cjs'),require('./chunk-GHUW6P4G.cjs'),require('./chunk-QBEQL4TL.cjs'),require('./chunk-QEHKMLHA.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 chunkMQAVZUXB_cjs.b}});Object.defineProperty(exports,"createSingleBoardServerRuntime",{enumerable:true,get:function(){return chunkMQAVZUXB_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,4 +1,4 @@
|
|
|
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-gTf9pAyC.cjs';
|
|
2
2
|
export { HostedBoardQueueLaneRegistryOptions, createHostedBoardQueueLaneRegistry } from './server-jobs-queue-runner/index.cjs';
|
|
3
3
|
export { A as AsyncBoardLiveCardsPublic } from './board-live-cards-public-async-Cl0M3j5P.cjs';
|
|
4
4
|
export { A as AsyncBoardPlatformAdapter } from './board-platform-adapter-async-DjBwE0m9.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
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-B8Yieskx.js';
|
|
2
2
|
export { HostedBoardQueueLaneRegistryOptions, createHostedBoardQueueLaneRegistry } from './server-jobs-queue-runner/index.js';
|
|
3
3
|
export { A as AsyncBoardLiveCardsPublic } from './board-live-cards-public-async-U98IXUBx.js';
|
|
4
4
|
export { A as AsyncBoardPlatformAdapter } from './board-platform-adapter-async-ByBRFn1G.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-WHKT5HN4.js';import'./chunk-JB4Q2W7I.js';import'./chunk-XYN5D3GL.js';import'./chunk-O5UYCGIN.js';import'./chunk-37JSBRZO.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-5VTIOM2U.js';import'./chunk-6MD6FVE3.js';import'./chunk-EZOXABJ2.js';import'./chunk-ANKA7HEJ.js';import'./chunk-44L64VQ2.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';import'./chunk-6M3RIGUH.js';import'./chunk-ATOQP3BD.js';import'./chunk-YT76JNKE.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,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkZ26U6RSG_cjs=require('../chunk-Z26U6RSG.cjs');require('../chunk-G4XXRHL2.cjs'),require('../chunk-LODXIALE.cjs'),require('../chunk-QBEQL4TL.cjs'),require('../chunk-QEHKMLHA.cjs'),require('../chunk-UJ7ZTV4J.cjs'),require('../chunk-GNFE24S7.cjs');Object.defineProperty(exports,"LocalStorageService",{enumerable:true,get:function(){return chunkZ26U6RSG_cjs.a}});Object.defineProperty(exports,"buildBrowserArtifactsFromRuntime",{enumerable:true,get:function(){return chunkZ26U6RSG_cjs.e}});Object.defineProperty(exports,"createBoardLiveGraphRuntime",{enumerable:true,get:function(){return chunkZ26U6RSG_cjs.b}});Object.defineProperty(exports,"selectAllLiveCardModels",{enumerable:true,get:function(){return chunkZ26U6RSG_cjs.d}});Object.defineProperty(exports,"selectLiveCardModel",{enumerable:true,get:function(){return chunkZ26U6RSG_cjs.c}});//# sourceMappingURL=index.cjs.map
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|