yaml-flow 8.6.4 → 8.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/adapters/firebase-storage.js +3 -0
- package/browser/adapters/firestore-storage.js +3 -0
- package/browser/adapters/localstorage-storage.js +4 -0
- package/browser/asset-integrity.json +22 -6
- package/browser/live-cards.schema.json +10 -1
- package/browser/server-runtime-controlface.js +8 -0
- package/examples/ARCHITECTURE.md +5 -32
- package/examples/board/demo-shell-with-server.html +2 -2
- package/examples/board/doc.html +2 -2
- package/examples/board/server/board-server.js +4 -2
- package/examples/board/test/server-http-test.js +73 -79
- package/examples/board-firestore/README.md +81 -0
- package/examples/board-firestore/browser/board-runtime.js +263 -0
- package/examples/board-firestore/firestore.indexes.json +29 -0
- package/examples/board-firestore/package.json +14 -0
- package/examples/board-firestore/server/adapters/firestore-archive-factory.js +59 -0
- package/examples/board-firestore/server/adapters/firestore-blob-storage.js +82 -0
- package/examples/board-firestore/server/adapters/firestore-board-adapter.js +127 -0
- package/examples/board-firestore/server/adapters/firestore-journal-storage.js +54 -0
- package/examples/board-firestore/server/adapters/firestore-kv-storage.js +47 -0
- package/examples/board-firestore/server/adapters/firestore-lock.js +62 -0
- package/examples/board-firestore/server/adapters/firestore-queue-storage.js +186 -0
- package/examples/board-firestore/server/adapters/firestore-scratch-storage.js +50 -0
- package/examples/board-firestore/server/worker.js +146 -0
- package/lib/{artifacts-store-lib-BR-Samty.d.cts → artifacts-store-lib-D9nMkVcE.d.cts} +1 -1
- package/lib/{artifacts-store-lib-DT7XlWUL.d.ts → artifacts-store-lib-DSSMqVL2.d.ts} +1 -1
- package/lib/artifacts-store-public.d.cts +2 -2
- package/lib/artifacts-store-public.d.ts +2 -2
- package/lib/board-live-cards-mcp.cjs +1 -1
- package/lib/board-live-cards-mcp.d.cts +51 -3
- package/lib/board-live-cards-mcp.d.ts +51 -3
- package/lib/board-live-cards-mcp.js +1 -1
- package/lib/board-live-cards-node.cjs +5 -5
- package/lib/board-live-cards-node.d.cts +16 -11
- package/lib/board-live-cards-node.d.ts +16 -11
- package/lib/board-live-cards-node.js +5 -5
- package/lib/{board-live-cards-public-BMUIPOrc.d.ts → board-live-cards-public-JNRKfBZy.d.ts} +1 -1
- package/lib/{board-live-cards-public-wkNmBIRC.d.cts → board-live-cards-public-LlVUQPL2.d.cts} +1 -1
- package/lib/board-live-cards-public-async-Di9QB141.d.cts +55 -0
- package/lib/board-live-cards-public-async-fwd1QI82.d.ts +55 -0
- package/lib/board-live-cards-public.cjs +1 -1
- package/lib/board-live-cards-public.d.cts +1 -1
- package/lib/board-live-cards-public.d.ts +1 -1
- package/lib/board-live-cards-public.js +1 -1
- package/lib/board-live-cards-server-runtime.cjs +1 -1
- package/lib/board-live-cards-server-runtime.d.cts +10 -6
- package/lib/board-live-cards-server-runtime.d.ts +10 -6
- package/lib/board-live-cards-server-runtime.js +1 -1
- package/lib/board-livegraph-runtime/index.cjs +1 -1
- package/lib/board-livegraph-runtime/index.js +1 -1
- package/lib/board-platform-adapter-async-BfHmHdx2.d.cts +129 -0
- package/lib/board-platform-adapter-async-DYahVzIK.d.ts +129 -0
- package/lib/board-worker-adapter.cjs +3 -3
- package/lib/board-worker-adapter.js +3 -3
- package/lib/card-compute/index.cjs +1 -1
- package/lib/card-compute/index.js +1 -1
- package/lib/card-store-public.d.cts +1 -1
- package/lib/card-store-public.d.ts +1 -1
- package/lib/card-validation.cjs +1 -1
- package/lib/card-validation.js +1 -1
- package/lib/{chat-storage-lib-BIUbE-fM.d.cts → chat-storage-lib-B9Q34Dyv.d.cts} +1 -1
- package/lib/{chat-storage-lib-BlG-sobS.d.ts → chat-storage-lib-DB9iSai2.d.ts} +1 -1
- package/lib/chat-store-public.d.cts +2 -2
- package/lib/chat-store-public.d.ts +2 -2
- package/lib/chunk-272IYUKT.cjs +2 -0
- package/lib/chunk-3KC6LBOG.js +3 -0
- package/lib/chunk-5XHOHTLZ.cjs +2 -0
- package/lib/chunk-6APH25VI.js +2 -0
- package/lib/chunk-76C7N4YT.js +3 -0
- package/lib/chunk-7FGPOGRV.cjs +2 -0
- package/lib/chunk-7ICPAABP.cjs +7 -0
- package/lib/chunk-ASR44K7H.cjs +3 -0
- package/lib/chunk-CPAXTVBQ.cjs +2 -0
- package/lib/chunk-EGRHWZRV.js +2 -0
- package/lib/chunk-EZENHAVZ.cjs +2 -0
- package/lib/chunk-FO4KNVU7.cjs +2 -0
- package/lib/chunk-GL2OHR2E.cjs +2 -0
- package/lib/chunk-HWYMZK3N.cjs +3 -0
- package/lib/chunk-IPLSRN6P.cjs +4 -0
- package/lib/{chunk-H5HBXPOI.cjs → chunk-J6EGN6S4.cjs} +3 -3
- package/lib/chunk-JH37NJGP.js +3 -0
- package/lib/chunk-JJL5VOQZ.cjs +3 -0
- package/lib/chunk-KAWQPLIE.cjs +2 -0
- package/lib/chunk-LPXVVMQT.cjs +2 -0
- package/lib/chunk-NJJ7WEDT.cjs +2 -0
- package/lib/chunk-NKIQRCOM.cjs +2 -0
- package/lib/chunk-NM6O35RY.cjs +2 -0
- package/lib/chunk-NTICU4OK.js +2 -0
- package/lib/chunk-O7NOHKVR.js +2 -0
- package/lib/chunk-PBOQ4HYB.cjs +2 -0
- package/lib/{chunk-VMW4Z6EF.js → chunk-PRKRXAVN.js} +3 -3
- package/lib/chunk-QJVR3FWQ.js +2 -0
- package/lib/chunk-S44QZUDX.js +2 -0
- package/lib/chunk-SGV7PU4H.js +2 -0
- package/lib/chunk-TSN3RTXT.js +4 -0
- package/lib/chunk-VXJHBWK3.js +2 -0
- package/lib/chunk-WHDEBJLT.js +7 -0
- package/lib/chunk-XYN5D3GL.js +2 -0
- package/lib/chunk-YBYXCFAI.js +2 -0
- package/lib/chunk-YGALANRO.js +2 -0
- package/lib/chunk-ZCNN6XPV.js +2 -0
- package/lib/chunk-ZJ5M5COT.js +2 -0
- package/lib/cloud-storage.cjs +1 -1
- package/lib/cloud-storage.d.cts +5 -3
- package/lib/cloud-storage.d.ts +5 -3
- package/lib/cloud-storage.js +1 -1
- package/lib/continuous-event-graph/index.cjs +1 -1
- package/lib/continuous-event-graph/index.js +1 -1
- package/lib/firebase-storage/index.cjs +3 -0
- package/lib/firebase-storage/index.d.cts +57 -0
- package/lib/firebase-storage/index.d.ts +57 -0
- package/lib/firebase-storage/index.js +3 -0
- package/lib/firestore-storage/index.cjs +3 -0
- package/lib/firestore-storage/index.d.cts +111 -0
- package/lib/firestore-storage/index.d.ts +111 -0
- package/lib/firestore-storage/index.js +3 -0
- package/lib/index.cjs +2 -2
- package/lib/index.js +1 -1
- package/lib/localstorage-storage/index.cjs +2 -0
- package/lib/localstorage-storage/index.d.cts +39 -0
- package/lib/localstorage-storage/index.d.ts +39 -0
- package/lib/localstorage-storage/index.js +2 -0
- package/lib/mcp-tool-registries-BBObLYga.d.ts +41 -0
- package/lib/mcp-tool-registries-W3TRj6O5.d.cts +41 -0
- package/lib/queue-lane-registry-PaZuFpwp.d.cts +30 -0
- package/lib/queue-lane-registry-PaZuFpwp.d.ts +30 -0
- package/lib/server-jobs-queue-runner/index.cjs +2 -0
- package/lib/server-jobs-queue-runner/index.d.cts +22 -0
- package/lib/server-jobs-queue-runner/index.d.ts +22 -0
- package/lib/server-jobs-queue-runner/index.js +2 -0
- package/lib/server-runtime/index.cjs +1 -1
- package/lib/server-runtime/index.d.cts +11 -17
- package/lib/server-runtime/index.d.ts +11 -17
- package/lib/server-runtime/index.js +1 -1
- package/lib/server-runtime-agentface/index.cjs +2 -0
- package/lib/server-runtime-agentface/index.d.cts +53 -0
- package/lib/server-runtime-agentface/index.d.ts +53 -0
- package/lib/server-runtime-agentface/index.js +2 -0
- package/lib/server-runtime-controlface/index.cjs +2 -0
- package/lib/server-runtime-controlface/index.d.cts +29 -0
- package/lib/server-runtime-controlface/index.d.ts +29 -0
- package/lib/server-runtime-controlface/index.js +2 -0
- package/lib/server-runtime-core/index.cjs +2 -0
- package/lib/server-runtime-core/index.d.cts +378 -0
- package/lib/server-runtime-core/index.d.ts +378 -0
- package/lib/server-runtime-core/index.js +2 -0
- package/lib/server-runtime-watchers/index.cjs +2 -0
- package/lib/server-runtime-watchers/index.d.cts +127 -0
- package/lib/server-runtime-watchers/index.d.ts +127 -0
- package/lib/server-runtime-watchers/index.js +2 -0
- package/lib/server-runtime-webhooks/index.cjs +2 -0
- package/lib/server-runtime-webhooks/index.d.cts +34 -0
- package/lib/server-runtime-webhooks/index.d.ts +34 -0
- package/lib/server-runtime-webhooks/index.js +2 -0
- package/lib/storage-async-interface-BRR4eBjx.d.cts +81 -0
- package/lib/storage-async-interface-DhlOVPSp.d.ts +81 -0
- package/lib/{queue-lane-registry-BPKWWgd4.d.cts → types-Ba8H5_Wo.d.cts} +10 -34
- package/lib/{queue-lane-registry-Be6c0ftj.d.ts → types-SO5OZm4s.d.ts} +10 -34
- package/package.json +46 -2
- package/schema/live-cards.schema.json +10 -1
- package/examples/board-local/demo-shell-localstorage.html +0 -843
- package/lib/board-live-cards-public-async-DKZqbJVU.d.ts +0 -256
- package/lib/board-live-cards-public-async-dMWNbWq6.d.cts +0 -256
- package/lib/chunk-KXWT3CY6.cjs +0 -8
- package/lib/chunk-MLVTJASJ.js +0 -2
- package/lib/chunk-N6P2JW4W.js +0 -3
- package/lib/chunk-NMZ6XNLB.cjs +0 -3
- package/lib/chunk-OEFTOO47.cjs +0 -3
- package/lib/chunk-OJLA6NLU.js +0 -8
- package/lib/chunk-R5L5WUKN.js +0 -2
- package/lib/chunk-VLBB3D6B.js +0 -3
- package/lib/chunk-WOALA3V5.cjs +0 -2
- package/lib/chunk-YEB5QHGE.cjs +0 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {a as a$3,c}from'./chunk-
|
|
1
|
+
import'./chunk-EGRHWZRV.js';import {a as a$3,c}from'./chunk-6APH25VI.js';export{c as createArtifactsStore,e as createCardFileMetadataStore,a as createChatStorage,d as createFileArtifactsStore,b as createInMemoryChatStorage}from'./chunk-6APH25VI.js';export{a as createQueueLaneRegistry}from'./chunk-VXJHBWK3.js';import {a as a$1}from'./chunk-CIAJNUR4.js';import'./chunk-HEEDJEKM.js';import {g,y as y$1}from'./chunk-JH37NJGP.js';export{n as BOARD_GRAPH_KEY,u as EMPTY_CONFIG,m as SNAPSHOT_SCHEMA_VERSION_V1,z as createBoardLiveCardsNonCorePublic,y as createBoardLiveCardsPublic,l as createCardStore,e as createHttpBoardCallbackTransport,f as createInProcessBoardCallbackTransport,g as createLocalNodeBoardCallbackTransport}from'./chunk-JH37NJGP.js';export{a as executionRefFromScriptPath,c as parseExecutionRef,b as serializeExecutionRef}from'./chunk-XQRNDX4Q.js';import {a as a$2,b as b$1}from'./chunk-BQS3EIEK.js';export{b as parseRef,a as serializeRef}from'./chunk-BQS3EIEK.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';export{a as createBoardLiveCardsMcp}from'./chunk-ZCNN6XPV.js';import'./chunk-JMDHDY6M.js';import {d}from'./chunk-3KC6LBOG.js';import'./chunk-MNEOJWPS.js';export{a as createCardStorePublic}from'./chunk-KBELAKIY.js';export{a as createArtifactsStorePublic}from'./chunk-X3LC4LII.js';import'./chunk-FW4363Y4.js';import {spawnSync,spawn,execFile,execFileSync}from'child_process';import*as a from'fs';import*as Ee from'os';import*as y from'path';import*as Te from'net';import {fileURLToPath}from'url';import {randomUUID,createHash}from'crypto';import {createRequire}from'module';import {lockSync}from'proper-lockfile';function b(...e){return y.join(...e)}function Be(e){return y.isAbsolute(e)}function X(){return randomUUID()}function Ie(e){return createHash("sha256").update(e).digest("hex")}function Ce(e){return y.dirname(fileURLToPath(e))}function kt(e){if(typeof e=="object"&&e!==null){let{command:r,args:n=[],...o}=e,s=Ae(r,n);return {...o,command:s.command,args:s.args}}let t=Me(e);if(t.length===0)throw new Error(`Empty command spec: ${JSON.stringify(e)}`);return Ae(t[0],t.slice(1))}function Ae(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 Me(e){let t=[],r="",n=null;for(let o of e.trim()){if(n){o===n?n=null:r+=o;continue}if(o==='"'||o==="'"){n=o;continue}if(/\s/.test(o)){r&&(t.push(r),r="");continue}r+=o;}if(n)throw new Error(`Unterminated quote in command: ${e}`);return r&&t.push(r),t}function Fe(e){return process.platform==="win32"&&/\.(cmd|bat)$/i.test(e)}function je(e,t){let{command:r,args:n=[],cwd:o,env:s,timeoutMs:u}=e;return execFileSync(r,n,{shell:Fe(r),timeout:u,encoding:t?.encoding??"utf-8",cwd:o,windowsHide:true,env:s?{...process.env,...s}:void 0,input:t?.input})}function wt(e,t){let{command:r,args:n=[],cwd:o,env:s,timeoutMs:u=3e4}=e;execFile(r,n,{shell:Fe(r),encoding:"utf8",windowsHide:true,timeout:u,maxBuffer:10*1024*1024,cwd:o,env:s?{...process.env,...s}:void 0},(l,g,i)=>t(l??null,g,i));}function $e(e,t,r){let n=y.join(e,"board-live-cards-cli.js");if(a.existsSync(n))return {cmd:process.execPath,args:[n,t,...r]};let o=y.join(e,"board-live-cards-cli.ts"),u=[y.join(e,"..","..","..","node_modules","tsx","dist","cli.mjs"),y.join(e,"..","..","node_modules","tsx","dist","cli.mjs"),y.join(e,"..","..","..","node_modules",".bin","tsx"),y.join(e,"..","..","node_modules",".bin","tsx")].find(g=>a.existsSync(g));return a.existsSync(o)&&u?{cmd:process.execPath,args:[u,o,t,...r]}:{cmd:process.platform==="win32"?"npx.cmd":"npx",args:["tsx",o,t,...r]}}function Pe(e){let t=y.join(e,"board-live-cards-cli.mjs");if(a.existsSync(t))return t;let r=y.join(e,"..","..","..","dev","board-live-cards-cli.js");if(a.existsSync(r))return r;let n=y.join(e,"..","..","dev","board-live-cards-cli.js");if(a.existsSync(n))return n;let o=y.join(e,"board-live-cards-cli.js");if(a.existsSync(o))return o;throw new Error(`resolveBoardCliCallbackTarget: cannot find callback target in ${e} (expected dev/board-live-cards-cli.js wrapper, ${o}, or ${t})`)}function vt(e){return process.platform==="win32"?`\\\\.\\pipe\\${e}`:y.join(Ee.tmpdir(),`${e}.sock`)}var Z=new Map;function qe(e,t,r){if(t.length===0)return;let n=t.map(l=>JSON.stringify(l)).join(`
|
|
2
2
|
`)+`
|
|
3
|
-
`,o=Z.get(e);if(o&&!o.socket.destroyed){o.ready?o.socket.write(n):o.queue.push(n);return}let s=vt(e),u=Te.createConnection(s);o={socket:u,ready:false,queue:[n]},Z.set(e,o),u.on("connect",()=>{o.ready=true;for(let l of o.queue)u.write(l);o.queue.length=0;}),u.on("error",l=>{r?.(`[named-pipe publish] ${s}: ${l instanceof Error?l.message:String(l)}`),Z.delete(e);}),u.on("close",()=>{Z.delete(e);});}function qe(){return {executeSync(e,t,r){return je({command:e,args:t,cwd:r?.cwd,timeoutMs:r?.timeout,env:r?.env},{encoding:r?.encoding,input:r?.input})},executeAsync(e,t,r){kt({command:e,args:t},r);},resolveInvocation(e,t){let r=wt({command:e,args:t});return {cmd:r.command,args:r.args??[]}},splitCommand:Fe}}function fe(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:n=>e.workerStore.nackRequest(r.messageId,r.leaseToken,n)}))},async handle(t){await e.handleRequest(t.args,t);},onError:e.onError}}function pe(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:n=>e.queueStorage.nack(r.id,r.leaseToken,n)}))},handle:e.handleMessage,onError:e.onError}}async function Oe(e,t){try{await e.handle(t.message,t),await t.ack();}catch(r){let n=t.attempt>=Math.max(1,Math.floor(e.maxAttempts??5));await t.nack({dead:n,reason:r instanceof Error?r.message:String(r)}),e.onError?.(r,t);}}function Qe(e){let t=Math.max(1,Math.floor(e.pollIntervalMs??250)),r=Math.max(1,Math.floor(e.visibilityMs??6e4)),n=Math.max(1,Math.floor(e.concurrency??1)),o=false,s=false;async function u(){if(!(o||s)){s=true;try{let g=await e.lease({max:n,visibilityMs:r});for(let i of g)await Oe(e,i);}finally{s=false;}}}let l=setInterval(()=>{u();},t);return typeof l.unref=="function"&&l.unref(),u(),()=>{o=true,clearInterval(l);}}async function bt(e){let t=Math.max(1,Math.floor(e.visibilityMs??6e4)),r=Math.max(1,Math.floor(e.concurrency??1)),n=await e.lease({max:r,visibilityMs:t});for(let o of n)await Oe(e,o);return n.length}async function ee(e,t){let r=Math.max(1,Math.floor(t?.maxPasses??256)),n=0;for(let o=0;o<r;o+=1){let s=await bt(e);if(n+=s,s<=0)return n}throw new Error(`drainQueueLaneToIdle exceeded ${r} passes for lane "${e.id}"`)}function At(e){let r=(Array.isArray(e)?e:e.lanes).map(n=>Qe(n));return ()=>{for(let n of r)n();}}var Tt=createRequire(import.meta.url);function Bt(e){return typeof e=="object"?e:b$1(e)}function Ne(e){let t=y.basename(String(e||"").trim());if(!t)throw new Error(`resolveYamlFlowCliPath: expected non-empty cli file name, got ${JSON.stringify(e)}`);let r=y.dirname(Tt.resolve("yaml-flow/package.json")),n=t.replace(/\.[^.]+$/,""),o=y.join(r,"cli","bundled",`${n}.mjs`);if(a.existsSync(o))return o;let s=y.join(r,"cli","node",t);if(a.existsSync(s))return s;throw new Error(`resolveYamlFlowCliPath: could not find ${t} under cli/bundled or cli/node in ${r}`)}function $(e){let t=Bt(e);return t.kind==="yaml-flow-cli"?Ne(t.value):t.value}function It(e,t){let r=$(e);switch(r){case "source-cli-task-executor":{let n=y.join(t,"source-cli-task-executor.js");if(a.existsSync(n))return {command:process.execPath,args:[n]};let o=y.join(t,"source-cli-task-executor.ts"),s=y.join(t,"..","..","node_modules","tsx","dist","cli.mjs"),u=y.join(t,"..","..","node_modules",".bin","tsx"),l=a.existsSync(s)?s:u;return a.existsSync(o)&&a.existsSync(l)?{command:process.execPath,args:[l,o]}:{command:process.execPath,args:[n]}}case "board-live-cards":{let{cmd:n,args:o}=$e(t,"_",[]);return {command:n,args:o}}default:throw new Error(`resolveBuiltIn: unknown built-in name "${r}". Supported: source-cli-task-executor, board-live-cards`)}}function Ct(e,t){if(e.howToRun==="built-in"){let{command:n,args:o}=It(e.whatToRun,t);return {command:n,baseArgs:o}}let r=(typeof e.whatToRun=="object",$(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 te(e,t){return Ct(e,t)}var ge=new Map;function Ft(e,t){let r=String(e||"").trim();if(!r)throw new Error("registerInProcessExecutionHandler: key is required");ge.set(r,t);}function Mt(e){let t=String(e||"").trim();t&&ge.delete(t);}function _e(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),n=r[r.length-1];return JSON.parse(n)}}function Je(e,t){return {...t,whatToRun:$(e.whatToRun),...e.extra?{extra:e.extra}:{}}}function me(e,t,r="invokeExecutionRef"){return a$1(e,t,r)}function De(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 n=e,o=n.status==="success"?"success":n.status==="fail"?"failure":n.status,s=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:n.data===void 0?{}:{stdout:n.data};return {result:o,data:s,...typeof n.error=="string"?{error:n.error}:{},...t||{}}}return {result:"success",data:e&&typeof e=="object"&&!Array.isArray(e)?e:{stdout:e},...t||{}}}function j(e){return {result:"failure",data:{error:e}}}function q(e,t,r){let n=r?.label??"invokeExecutionRefSync",o=r?.cliDir??r?.cwd??process.cwd(),s;try{s=me(e.argsMassaging,Je(e,t),n);}catch(d){let f=d instanceof Error?d.message:String(d);return j(f)}let u;try{u=te(e,o);}catch(d){let f=d instanceof Error?d.message:String(d);return j(`[${n}] ref resolution failed: ${f}`)}let l=[...u.baseArgs,...s.cmdArgs??[]],g=JSON.stringify(s.stdin??t),i=qe(),c;try{c=i.executeSync(u.command,l,{timeout:r?.timeoutMs??3e4,encoding:"utf-8",cwd:r?.cwd,input:g});}catch(d){let f=d,m=(f.stderr?String(f.stderr):"").trim(),S=typeof f.status=="number"?f.status:"unknown",h=m||f.message;return j(`[${n}] ref exited with status ${S}${h?`: ${h}`:""}`)}try{return De(_e(c))}catch{return {result:"success",data:{stdout:c.trim()}}}}async function We(e,t,r){let n=r?.label??"invokeExecutionRef",o;try{o=me(e.argsMassaging,Je(e,t),n);}catch(d){let f=d instanceof Error?d.message:String(d);return j(f)}let s=$(e.whatToRun),u=o.headers?{"Content-Type":"application/json",...o.headers}:{"Content-Type":"application/json"},l=o.url??s,g;if(e.howToRun==="http:get"){let d=o.body&&typeof o.body=="object"&&!Array.isArray(o.body)?o.body:t,f=new URLSearchParams(Object.entries(d).filter(([,m])=>m!=null).map(([m,S])=>[m,String(S)]));f.size>0&&(l=`${l}${l.includes("?")?"&":"?"}${f.toString()}`);}else g=JSON.stringify(o.body??t);let i={method:e.howToRun==="http:get"?"GET":"POST",headers:u,body:g},c=0;for(;;)try{let d=await fetch(l,i);if(!d.ok){let h=await d.text().catch(()=>"");return j(`[${n}] HTTP ${d.status}${h?`: ${h}`:""}`)}let f={};d.headers.forEach((h,k)=>{f[k]=h;});let m=new Uint8Array(await d.arrayBuffer());if(m.byteLength===0)return {result:"success",data:{},headers:f};let S=new TextDecoder().decode(m);try{return De(_e(S),{headers:f})}catch{return {result:"success",data:{stdout:S},headers:f}}}catch(d){let f=d?.cause,m=f&&typeof f=="object"&&"code"in f?String(f.code||""):"";if((m==="ECONNRESET"||m==="UND_ERR_SOCKET")&&c===0){c+=1;continue}let h=d instanceof Error?d.message:String(d),k=f instanceof Error?`${f.name}: ${f.message}${m?` [${m}]`:""}`:f?String(f):"",p=o.url??s??"",x=`${h}${k?` (cause: ${k})`:""}${p?` url=${p}`:""}`;return j(`[${n}] ${x}`)}}async function jt(e,t,r){let n=r?.label??"invokeExecutionRef",o=$(e.whatToRun).trim();if(!o)return j(`[${n}] in-process-loop requires a non-empty handler key`);let s=ge.get(o);if(!s)return j(`[${n}] no in-process handler registered for: ${o}`);try{return await s(e,t,r)}catch(u){let l=u instanceof Error?u.message:String(u);return j(`[${n}] ${l}`)}}var $t={"local-node":async(e,t,r)=>q(e,t,r),"local-python":async(e,t,r)=>q(e,t,r),"local-process":async(e,t,r)=>q(e,t,r),"built-in":async(e,t,r)=>q(e,t,r),"http:post":We,"http:get":We,"in-process-loop":jt},Pt={"local-node":q,"local-python":q,"local-process":q,"built-in":q};async function D(e,t,r){let n=r?.transports?.[e.howToRun]??$t[e.howToRun];return n?n(e,t,r):j(`[${r?.label??"invokeExecutionRef"}] unsupported howToRun: ${e.howToRun}`)}function ye(e,t,r){let n=r?.syncTransports?.[e.howToRun]??Pt[e.howToRun];return n?n(e,t,r):j(`[${r?.label??"invokeExecutionRefSync"}] unsupported sync howToRun: ${e.howToRun}`)}function Lt(e){return {invoke(t,r){return D(t,r,e)},invokeSync(t,r){return ye(t,r,e)}}}function qt(e,t,r){return ye(e,t,r)}function he(e){return {messageId:e.id,enqueuedAt:e.enqueuedAt,attempt:e.attempt,request:e.body}}function Ot(e){return {...he(e),leaseToken:e.leaseToken,leaseExpiresAt:e.leaseExpiresAt}}function Qt(e){return {...he(e),reason:e.reason}}function H(e){return {enqueueRequest(t){return e.enqueue(t).id},enqueueRequestIfAbsent:e.enqueueIfAbsent?(t,r)=>{let n=e.enqueueIfAbsent(t,r);return n?n.id:null}:void 0,leaseRequests(t){return e.lease(t).map(Ot)},ackRequest(t,r){return e.ack(t,r)},nackRequest(t,r,n){return e.nack(t,r,n)},peekActive(){return e.peekActive().map(he)},peekDeadLetter(){return e.peekDeadLetter().map(Qt)}}}function C(e,t){if(process.platform!=="win32"){a.renameSync(e,t);return}let r=[10,20,40,80,160];for(let n=0;n<=r.length;n++)try{a.renameSync(e,t);return}catch(o){let s=o.code;if((s==="EPERM"||s==="EBUSY")&&n<r.length){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,r[n]);continue}throw o}}function U(e){function t(o){return y.join(e,...o.split("/"))}function r(o){return y.relative(e,o).replace(/\\/g,"/")}function n(o,s){if(a.existsSync(o))for(let u of a.readdirSync(o,{withFileTypes:true})){let l=y.join(o,u.name);if(u.isDirectory()){n(l,s);continue}u.isFile()&&s.push(r(l));}}return {read(o){let s=t(o);if(!a.existsSync(s))return null;try{return a.readFileSync(s,"utf-8")}catch{return null}},write(o,s){let u=t(o),l=`${u}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(u),{recursive:true}),a.writeFileSync(l,s,"utf-8"),C(l,u);},exists(o){return a.existsSync(t(o))},remove(o){let s=t(o);try{a.existsSync(s)&&a.unlinkSync(s);}catch{}},readBytes(o){let s=t(o);if(!a.existsSync(s))return null;try{return new Uint8Array(a.readFileSync(s))}catch{return null}},writeBytes(o,s){let u=t(o),l=`${u}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(u),{recursive:true}),a.writeFileSync(l,Buffer.from(s)),C(l,u);},listKeys(o){let s=[];n(e,s);let u=s.sort();return o?u.filter(l=>l.startsWith(o)):u},stat(o){let s=t(o);if(!a.existsSync(s))return null;try{let u=a.statSync(s);return {key:o,size:Number(u.size||0),updatedAt:new Date(u.mtimeMs).toISOString()}}catch{return null}},keyRef(o){return {kind:"fs-path",value:t(o)}}}}function we(){return {read(e){if(!a.existsSync(e))return null;try{return a.readFileSync(e,"utf-8")}catch{return null}},write(e,t){let r=`${e}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(e),{recursive:true}),a.writeFileSync(r,t,"utf-8"),C(r,e);},exists(e){return a.existsSync(e)},remove(e){try{a.existsSync(e)&&a.unlinkSync(e);}catch{}},readBytes(e){if(!a.existsSync(e))return null;try{return new Uint8Array(a.readFileSync(e))}catch{return null}},writeBytes(e,t){let r=`${e}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(e),{recursive:true}),a.writeFileSync(r,Buffer.from(t)),C(r,e);},stat(e){if(!a.existsSync(e))return null;try{let t=a.statSync(e);return {key:e,size:Number(t.size||0),updatedAt:new Date(t.mtimeMs).toISOString()}}catch{return null}},listKeys(e){return []}}}function K(e,t){let r=`${e}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(e),{recursive:true}),a.writeFileSync(r,JSON.stringify(t,null,2),"utf-8"),C(r,e);}function N(e){if(!a.existsSync(e))return null;try{return JSON.parse(a.readFileSync(e,"utf-8"))}catch{return null}}function V(e){return a.existsSync(e)?a.readdirSync(e).filter(t=>t.endsWith(".json")).sort().map(t=>y.join(e,t)):[]}function z(e){return {id:e.id,body:e.body,enqueuedAt:e.enqueuedAt,attempt:e.attempt}}function _t(e){return {...z(e),leaseToken:String(e.leaseToken||""),leaseExpiresAt:String(e.leaseExpiresAt||"")}}function Jt(e){return {...z(e),reason:e.reason}}function _(e){let t=y.join(e,"active"),r=y.join(e,"leased"),n=y.join(e,"done"),o=y.join(e,"dead");for(let c of [t,r,n,o])a.mkdirSync(c,{recursive:true});function s(c){let d=String(c.enqueuedAt||new Date().toISOString()).replace(/[:.]/g,"-");return y.join(t,`${d}-${c.id}.json`)}function u(c){return y.join(r,`${c}.json`)}function l(c){return y.join(n,`${c}.json`)}function g(c){return y.join(o,`${c}.json`)}function i(){let c=Date.now();for(let d of V(r)){let f=N(d);if(!f?.leaseExpiresAt)continue;let m=Date.parse(f.leaseExpiresAt);if(Number.isNaN(m)||m>c)continue;let S={id:f.id,body:f.body,enqueuedAt:f.enqueuedAt,attempt:f.attempt};K(s(S),S);try{a.unlinkSync(d);}catch{}}}return {enqueue(c){let d={id:randomUUID(),body:c,enqueuedAt:new Date().toISOString(),attempt:0};return K(s(d),d),z(d)},enqueueIfAbsent(c,d){i();for(let m of [t,r])for(let S of V(m))if(N(S)?.dedupKey===d)return null;let f={id:randomUUID(),body:c,enqueuedAt:new Date().toISOString(),attempt:0,dedupKey:d};return K(s(f),f),z(f)},lease(c){i();let d=Math.max(1,Math.floor(c?.max??1)),f=Math.max(1,Math.floor(c?.visibilityMs??6e4)),m=[];for(let S of V(t)){if(m.length>=d)break;let h=N(S);if(!h)continue;let k=u(h.id);try{C(S,k);}catch{continue}let p={...h,attempt:(Number(h.attempt)||0)+1,leaseToken:randomUUID(),leaseExpiresAt:new Date(Date.now()+f).toISOString()};K(k,p),m.push(_t(p));}return m},ack(c,d){let f=u(c),m=N(f);if(!m||m.leaseToken!==d)return false;try{C(f,l(c));}catch{return false}return true},nack(c,d,f){let m=u(c),S=N(m);if(!S||S.leaseToken!==d)return false;let h={id:S.id,body:S.body,enqueuedAt:S.enqueuedAt,attempt:S.attempt};f?.dead?(h.reason=f.reason,K(g(c),h)):K(s(h),h);try{a.unlinkSync(m);}catch{}return true},peekActive(c){return i(),V(t).map(d=>N(d)).filter(d=>!!d).map(z)},peekDeadLetter(c){return V(o).map(d=>N(d)).filter(d=>!!d).map(Jt)}}}var Se="__scratch-marker",Re="__scratch-config.json",Dt=1440*60*1e3,Ht=720*60*1e3,Kt=500;function He(e,t){if(!e)return t;let r=e.replace(/[^A-Za-z0-9._-]/g,"_");return r.length>0?r:t}function G(e){a.mkdirSync(e,{recursive:true});let t=y.join(e,Se),r=y.join(e,Re),n=!a.existsSync(t);if(n)try{a.writeFileSync(t,`scratch-store
|
|
3
|
+
`,o=Z.get(e);if(o&&!o.socket.destroyed){o.ready?o.socket.write(n):o.queue.push(n);return}let s=vt(e),u=Te.createConnection(s);o={socket:u,ready:false,queue:[n]},Z.set(e,o),u.on("connect",()=>{o.ready=true;for(let l of o.queue)u.write(l);o.queue.length=0;}),u.on("error",l=>{r?.(`[named-pipe publish] ${s}: ${l instanceof Error?l.message:String(l)}`),Z.delete(e);}),u.on("close",()=>{Z.delete(e);});}function Le(){return {executeSync(e,t,r){return je({command:e,args:t,cwd:r?.cwd,timeoutMs:r?.timeout,env:r?.env},{encoding:r?.encoding,input:r?.input})},executeAsync(e,t,r){wt({command:e,args:t},r);},resolveInvocation(e,t){let r=kt({command:e,args:t});return {cmd:r.command,args:r.args??[]}},splitCommand:Me}}function fe(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:n=>e.workerStore.nackRequest(r.messageId,r.leaseToken,n)}))},async handle(t){await e.handleRequest(t.args,t);},onError:e.onError}}function pe(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:n=>e.queueStorage.nack(r.id,r.leaseToken,n)}))},handle:e.handleMessage,onError:e.onError}}async function Qe(e,t){try{await e.handle(t.message,t),await t.ack();}catch(r){let n=t.attempt>=Math.max(1,Math.floor(e.maxAttempts??5));await t.nack({dead:n,reason:r instanceof Error?r.message:String(r)}),e.onError?.(r,t);}}function Oe(e){let t=Math.max(1,Math.floor(e.pollIntervalMs??250)),r=Math.max(1,Math.floor(e.visibilityMs??6e4)),n=Math.max(1,Math.floor(e.concurrency??1)),o=false,s=false;async function u(){if(!(o||s)){s=true;try{let g=await e.lease({max:n,visibilityMs:r});for(let i of g)await Qe(e,i);}finally{s=false;}}}let l=setInterval(()=>{u();},t);return typeof l.unref=="function"&&l.unref(),u(),()=>{o=true,clearInterval(l);}}async function bt(e){let t=Math.max(1,Math.floor(e.visibilityMs??6e4)),r=Math.max(1,Math.floor(e.concurrency??1)),n=await e.lease({max:r,visibilityMs:t});for(let o of n)await Qe(e,o);return n.length}async function ee(e,t){let r=Math.max(1,Math.floor(t?.maxPasses??256)),n=0;for(let o=0;o<r;o+=1){let s=await bt(e);if(n+=s,s<=0)return n}throw new Error(`drainQueueLaneToIdle exceeded ${r} passes for lane "${e.id}"`)}function At(e){let r=(Array.isArray(e)?e:e.lanes).map(n=>Oe(n));return ()=>{for(let n of r)n();}}var Tt=createRequire(import.meta.url);function Bt(e){return typeof e=="object"?e:b$1(e)}function _e(e){let t=y.basename(String(e||"").trim());if(!t)throw new Error(`resolveYamlFlowCliPath: expected non-empty cli file name, got ${JSON.stringify(e)}`);let r=y.dirname(Tt.resolve("yaml-flow/package.json")),n=t.replace(/\.[^.]+$/,""),o=y.join(r,"cli","bundled",`${n}.mjs`);if(a.existsSync(o))return o;let s=y.join(r,"cli","node",t);if(a.existsSync(s))return s;throw new Error(`resolveYamlFlowCliPath: could not find ${t} under cli/bundled or cli/node in ${r}`)}function $(e){let t=Bt(e);return t.kind==="yaml-flow-cli"?_e(t.value):t.value}function It(e,t){let r=$(e);switch(r){case "source-cli-task-executor":{let n=y.join(t,"source-cli-task-executor.js");if(a.existsSync(n))return {command:process.execPath,args:[n]};let o=y.join(t,"source-cli-task-executor.ts"),s=y.join(t,"..","..","node_modules","tsx","dist","cli.mjs"),u=y.join(t,"..","..","node_modules",".bin","tsx"),l=a.existsSync(s)?s:u;return a.existsSync(o)&&a.existsSync(l)?{command:process.execPath,args:[l,o]}:{command:process.execPath,args:[n]}}case "board-live-cards":{let{cmd:n,args:o}=$e(t,"_",[]);return {command:n,args:o}}default:throw new Error(`resolveBuiltIn: unknown built-in name "${r}". Supported: source-cli-task-executor, board-live-cards`)}}function Ct(e,t){if(e.howToRun==="built-in"){let{command:n,args:o}=It(e.whatToRun,t);return {command:n,baseArgs:o}}let r=(typeof e.whatToRun=="object",$(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 te(e,t){return Ct(e,t)}var ge=new Map;function Mt(e,t){let r=String(e||"").trim();if(!r)throw new Error("registerInProcessExecutionHandler: key is required");ge.set(r,t);}function Ft(e){let t=String(e||"").trim();t&&ge.delete(t);}function Ne(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),n=r[r.length-1];return JSON.parse(n)}}function Je(e,t){return {...t,whatToRun:$(e.whatToRun),...e.extra?{extra:e.extra}:{}}}function me(e,t,r="invokeExecutionRef"){return a$1(e,t,r)}function De(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 n=e,o=n.status==="success"?"success":n.status==="fail"?"failure":n.status,s=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:n.data===void 0?{}:{stdout:n.data};return {result:o,data:s,...typeof n.error=="string"?{error:n.error}:{},...t||{}}}return {result:"success",data:e&&typeof e=="object"&&!Array.isArray(e)?e:{stdout:e},...t||{}}}function j(e){return {result:"failure",data:{error:e}}}function L(e,t,r){let n=r?.label??"invokeExecutionRefSync",o=r?.cliDir??r?.cwd??process.cwd(),s;try{s=me(e.argsMassaging,Je(e,t),n);}catch(d){let f=d instanceof Error?d.message:String(d);return j(f)}let u;try{u=te(e,o);}catch(d){let f=d instanceof Error?d.message:String(d);return j(`[${n}] ref resolution failed: ${f}`)}let l=[...u.baseArgs,...s.cmdArgs??[]],g=JSON.stringify(s.stdin??t),i=Le(),c;try{c=i.executeSync(u.command,l,{timeout:r?.timeoutMs??3e4,encoding:"utf-8",cwd:r?.cwd,input:g});}catch(d){let f=d,m=(f.stderr?String(f.stderr):"").trim(),S=typeof f.status=="number"?f.status:"unknown",h=m||f.message;return j(`[${n}] ref exited with status ${S}${h?`: ${h}`:""}`)}try{return De(Ne(c))}catch{return {result:"success",data:{stdout:c.trim()}}}}async function We(e,t,r){let n=r?.label??"invokeExecutionRef",o;try{o=me(e.argsMassaging,Je(e,t),n);}catch(d){let f=d instanceof Error?d.message:String(d);return j(f)}let s=$(e.whatToRun),u=o.headers?{"Content-Type":"application/json",...o.headers}:{"Content-Type":"application/json"},l=o.url??s,g;if(e.howToRun==="http:get"){let d=o.body&&typeof o.body=="object"&&!Array.isArray(o.body)?o.body:t,f=new URLSearchParams(Object.entries(d).filter(([,m])=>m!=null).map(([m,S])=>[m,String(S)]));f.size>0&&(l=`${l}${l.includes("?")?"&":"?"}${f.toString()}`);}else g=JSON.stringify(o.body??t);let i={method:e.howToRun==="http:get"?"GET":"POST",headers:u,body:g},c=0;for(;;)try{let d=await fetch(l,i);if(!d.ok){let h=await d.text().catch(()=>"");return j(`[${n}] HTTP ${d.status}${h?`: ${h}`:""}`)}let f={};d.headers.forEach((h,w)=>{f[w]=h;});let m=new Uint8Array(await d.arrayBuffer());if(m.byteLength===0)return {result:"success",data:{},headers:f};let S=new TextDecoder().decode(m);try{return De(Ne(S),{headers:f})}catch{return {result:"success",data:{stdout:S},headers:f}}}catch(d){let f=d?.cause,m=f&&typeof f=="object"&&"code"in f?String(f.code||""):"";if((m==="ECONNRESET"||m==="UND_ERR_SOCKET")&&c===0){c+=1;continue}let h=d instanceof Error?d.message:String(d),w=f instanceof Error?`${f.name}: ${f.message}${m?` [${m}]`:""}`:f?String(f):"",p=o.url??s??"",x=`${h}${w?` (cause: ${w})`:""}${p?` url=${p}`:""}`;return j(`[${n}] ${x}`)}}async function jt(e,t,r){let n=r?.label??"invokeExecutionRef",o=$(e.whatToRun).trim();if(!o)return j(`[${n}] in-process-loop requires a non-empty handler key`);let s=ge.get(o);if(!s)return j(`[${n}] no in-process handler registered for: ${o}`);try{return await s(e,t,r)}catch(u){let l=u instanceof Error?u.message:String(u);return j(`[${n}] ${l}`)}}var $t={"local-node":async(e,t,r)=>L(e,t,r),"local-python":async(e,t,r)=>L(e,t,r),"local-process":async(e,t,r)=>L(e,t,r),"built-in":async(e,t,r)=>L(e,t,r),"http:post":We,"http:get":We,"in-process-loop":jt},Pt={"local-node":L,"local-python":L,"local-process":L,"built-in":L};async function H(e,t,r){let n=r?.transports?.[e.howToRun]??$t[e.howToRun];return n?n(e,t,r):j(`[${r?.label??"invokeExecutionRef"}] unsupported howToRun: ${e.howToRun}`)}function ye(e,t,r){let n=r?.syncTransports?.[e.howToRun]??Pt[e.howToRun];return n?n(e,t,r):j(`[${r?.label??"invokeExecutionRefSync"}] unsupported sync howToRun: ${e.howToRun}`)}function qt(e){return {invoke(t,r){return H(t,r,e)},invokeSync(t,r){return ye(t,r,e)}}}function Lt(e,t,r){return ye(e,t,r)}function he(e){return {messageId:e.id,enqueuedAt:e.enqueuedAt,attempt:e.attempt,request:e.body}}function Qt(e){return {...he(e),leaseToken:e.leaseToken,leaseExpiresAt:e.leaseExpiresAt}}function Ot(e){return {...he(e),reason:e.reason}}function K(e){return {enqueueRequest(t){return e.enqueue(t).id},enqueueRequestIfAbsent:e.enqueueIfAbsent?(t,r)=>{let n=e.enqueueIfAbsent(t,r);return n?n.id:null}:void 0,leaseRequests(t){return e.lease(t).map(Qt)},ackRequest(t,r){return e.ack(t,r)},nackRequest(t,r,n){return e.nack(t,r,n)},peekActive(){return e.peekActive().map(he)},peekDeadLetter(){return e.peekDeadLetter().map(Ot)}}}function C(e,t){if(process.platform!=="win32"){a.renameSync(e,t);return}let r=[10,20,40,80,160];for(let n=0;n<=r.length;n++)try{a.renameSync(e,t);return}catch(o){let s=o.code;if((s==="EPERM"||s==="EBUSY")&&n<r.length){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,r[n]);continue}throw o}}function N(e){function t(o){return y.join(e,...o.split("/"))}function r(o){return y.relative(e,o).replace(/\\/g,"/")}function n(o,s){if(a.existsSync(o))for(let u of a.readdirSync(o,{withFileTypes:true})){let l=y.join(o,u.name);if(u.isDirectory()){n(l,s);continue}u.isFile()&&s.push(r(l));}}return {read(o){let s=t(o);if(!a.existsSync(s))return null;try{return a.readFileSync(s,"utf-8")}catch{return null}},write(o,s){let u=t(o),l=`${u}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(u),{recursive:true}),a.writeFileSync(l,s,"utf-8"),C(l,u);},exists(o){return a.existsSync(t(o))},remove(o){let s=t(o);try{a.existsSync(s)&&a.unlinkSync(s);}catch{}},readBytes(o){let s=t(o);if(!a.existsSync(s))return null;try{return new Uint8Array(a.readFileSync(s))}catch{return null}},writeBytes(o,s){let u=t(o),l=`${u}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(u),{recursive:true}),a.writeFileSync(l,Buffer.from(s)),C(l,u);},listKeys(o){let s=[];n(e,s);let u=s.sort();return o?u.filter(l=>l.startsWith(o)):u},stat(o){let s=t(o);if(!a.existsSync(s))return null;try{let u=a.statSync(s);return {key:o,size:Number(u.size||0),updatedAt:new Date(u.mtimeMs).toISOString()}}catch{return null}},keyRef(o){return {kind:"fs-path",value:t(o)}}}}function ke(){return {read(e){if(!a.existsSync(e))return null;try{return a.readFileSync(e,"utf-8")}catch{return null}},write(e,t){let r=`${e}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(e),{recursive:true}),a.writeFileSync(r,t,"utf-8"),C(r,e);},exists(e){return a.existsSync(e)},remove(e){try{a.existsSync(e)&&a.unlinkSync(e);}catch{}},readBytes(e){if(!a.existsSync(e))return null;try{return new Uint8Array(a.readFileSync(e))}catch{return null}},writeBytes(e,t){let r=`${e}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(e),{recursive:true}),a.writeFileSync(r,Buffer.from(t)),C(r,e);},stat(e){if(!a.existsSync(e))return null;try{let t=a.statSync(e);return {key:e,size:Number(t.size||0),updatedAt:new Date(t.mtimeMs).toISOString()}}catch{return null}},listKeys(e){return []}}}function U(e,t){let r=`${e}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(e),{recursive:true}),a.writeFileSync(r,JSON.stringify(t,null,2),"utf-8"),C(r,e);}function _(e){if(!a.existsSync(e))return null;try{return JSON.parse(a.readFileSync(e,"utf-8"))}catch{return null}}function V(e){return a.existsSync(e)?a.readdirSync(e).filter(t=>t.endsWith(".json")).sort().map(t=>y.join(e,t)):[]}function z(e){return {id:e.id,body:e.body,enqueuedAt:e.enqueuedAt,attempt:e.attempt}}function Nt(e){return {...z(e),leaseToken:String(e.leaseToken||""),leaseExpiresAt:String(e.leaseExpiresAt||"")}}function Jt(e){return {...z(e),reason:e.reason}}function J(e){let t=y.join(e,"active"),r=y.join(e,"leased"),n=y.join(e,"done"),o=y.join(e,"dead");for(let c of [t,r,n,o])a.mkdirSync(c,{recursive:true});function s(c){let d=String(c.enqueuedAt||new Date().toISOString()).replace(/[:.]/g,"-");return y.join(t,`${d}-${c.id}.json`)}function u(c){return y.join(r,`${c}.json`)}function l(c){return y.join(n,`${c}.json`)}function g(c){return y.join(o,`${c}.json`)}function i(){let c=Date.now();for(let d of V(r)){let f=_(d);if(!f?.leaseExpiresAt)continue;let m=Date.parse(f.leaseExpiresAt);if(Number.isNaN(m)||m>c)continue;let S={id:f.id,body:f.body,enqueuedAt:f.enqueuedAt,attempt:f.attempt};U(s(S),S);try{a.unlinkSync(d);}catch{}}}return {enqueue(c){let d={id:randomUUID(),body:c,enqueuedAt:new Date().toISOString(),attempt:0};return U(s(d),d),z(d)},enqueueIfAbsent(c,d){i();for(let m of [t,r])for(let S of V(m))if(_(S)?.dedupKey===d)return null;let f={id:randomUUID(),body:c,enqueuedAt:new Date().toISOString(),attempt:0,dedupKey:d};return U(s(f),f),z(f)},lease(c){i();let d=Math.max(1,Math.floor(c?.max??1)),f=Math.max(1,Math.floor(c?.visibilityMs??6e4)),m=[];for(let S of V(t)){if(m.length>=d)break;let h=_(S);if(!h)continue;let w=u(h.id);try{C(S,w);}catch{continue}let p={...h,attempt:(Number(h.attempt)||0)+1,leaseToken:randomUUID(),leaseExpiresAt:new Date(Date.now()+f).toISOString()};U(w,p),m.push(Nt(p));}return m},ack(c,d){let f=u(c),m=_(f);if(!m||m.leaseToken!==d)return false;try{C(f,l(c));}catch{return false}return true},nack(c,d,f){let m=u(c),S=_(m);if(!S||S.leaseToken!==d)return false;let h={id:S.id,body:S.body,enqueuedAt:S.enqueuedAt,attempt:S.attempt};f?.dead?(h.reason=f.reason,U(g(c),h)):U(s(h),h);try{a.unlinkSync(m);}catch{}return true},peekActive(c){return i(),V(t).map(d=>_(d)).filter(d=>!!d).map(z)},peekDeadLetter(c){return V(o).map(d=>_(d)).filter(d=>!!d).map(Jt)}}}var Se="__scratch-marker",Re="__scratch-config.json",Dt=1440*60*1e3,Ht=720*60*1e3,Kt=500;function He(e,t){if(!e)return t;let r=e.replace(/[^A-Za-z0-9._-]/g,"_");return r.length>0?r:t}function G(e){a.mkdirSync(e,{recursive:true});let t=y.join(e,Se),r=y.join(e,Re),n=!a.existsSync(t);if(n)try{a.writeFileSync(t,`scratch-store
|
|
4
4
|
${new Date().toISOString()}
|
|
5
|
-
`,"utf-8");}catch{}function o(){if(!a.existsSync(r))return {};try{let i=a.readFileSync(r,"utf-8"),c=JSON.parse(i);return c&&typeof c=="object"&&!Array.isArray(c)?c:{}}catch{return {}}}function s(i){let c=`${r}.${process.pid}.${randomUUID()}.tmp`;try{a.writeFileSync(c,JSON.stringify(i,null,2),"utf-8"),C(c,r);}catch{}}if(n){let i=o();typeof i["retention.lastSweepAt"]!="number"&&(i["retention.lastSweepAt"]=Date.now(),s(i));}function u(){if(!a.existsSync(t))return;let i=o(),c=typeof i["retention.maxAgeMs"]=="number"?i["retention.maxAgeMs"]:Dt,d=typeof i["retention.sweepIntervalMs"]=="number"?i["retention.sweepIntervalMs"]:Ht;if(c<=0||d<=0)return;let f=typeof i["retention.lastSweepAt"]=="number"?i["retention.lastSweepAt"]:0,m=Date.now();if(m-f<d)return;i["retention.lastSweepAt"]=m,s(i);let S=m;try{let h=a.readdirSync(e,{withFileTypes:!0});for(let
|
|
5
|
+
`,"utf-8");}catch{}function o(){if(!a.existsSync(r))return {};try{let i=a.readFileSync(r,"utf-8"),c=JSON.parse(i);return c&&typeof c=="object"&&!Array.isArray(c)?c:{}}catch{return {}}}function s(i){let c=`${r}.${process.pid}.${randomUUID()}.tmp`;try{a.writeFileSync(c,JSON.stringify(i,null,2),"utf-8"),C(c,r);}catch{}}if(n){let i=o();typeof i["retention.lastSweepAt"]!="number"&&(i["retention.lastSweepAt"]=Date.now(),s(i));}function u(){if(!a.existsSync(t))return;let i=o(),c=typeof i["retention.maxAgeMs"]=="number"?i["retention.maxAgeMs"]:Dt,d=typeof i["retention.sweepIntervalMs"]=="number"?i["retention.sweepIntervalMs"]:Ht;if(c<=0||d<=0)return;let f=typeof i["retention.lastSweepAt"]=="number"?i["retention.lastSweepAt"]:0,m=Date.now();if(m-f<d)return;i["retention.lastSweepAt"]=m,s(i);let S=m;try{let h=a.readdirSync(e,{withFileTypes:!0});for(let w of h){if(Date.now()-S>Kt)break;if(!w.isFile()||w.name===Se||w.name===Re)continue;let p=y.join(e,w.name);try{let x=a.statSync(p);if(m-x.mtimeMs>c)try{a.unlinkSync(p);}catch{}}catch{}}}catch{}}function l(i,c){let d=He(i,"scratch"),f=He(c,".json"),m=f.startsWith(".")?f:`.${f}`,S=`${d}-${Date.now()}-${randomUUID().slice(0,8)}${m}`;return y.join(e,S)}function g(i,c){let d=`${i}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(i),{recursive:true}),a.writeFileSync(d,c,"utf-8"),C(d,i);}return {read(i){if(!a.existsSync(i))return null;try{return a.readFileSync(i,"utf-8")}catch{return null}},write(i,c){g(i,c);try{u();}catch{}},exists(i){return a.existsSync(i)},remove(i){try{a.existsSync(i)&&a.unlinkSync(i);}catch{}},readBytes(i){if(!a.existsSync(i))return null;try{return new Uint8Array(a.readFileSync(i))}catch{return null}},writeBytes(i,c){let d=`${i}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(i),{recursive:true}),a.writeFileSync(d,Buffer.from(c)),C(d,i);try{u();}catch{}},stat(i){if(!a.existsSync(i))return null;try{let c=a.statSync(i);return {key:i,size:Number(c.size||0),updatedAt:new Date(c.mtimeMs).toISOString()}}catch{return null}},listKeys(i){try{let c=a.readdirSync(e,{withFileTypes:!0}),d=[];for(let f of c){if(!f.isFile()||f.name===Se||f.name===Re)continue;let m=y.join(e,f.name);(!i||m.startsWith(i))&&d.push(m);}return d.sort()}catch{return []}},getUniqueKey(i,c){return l(i,c)},create(i,c,d){let f=l(c,d);g(f,i);try{u();}catch{}return f},keyRef(i){return {kind:"fs-path",value:i}},config:{get(i){return o()[i]??null},set(i,c){let d=o();c==null?delete d[i]:d[i]=c,s(d);}}}}var Ut="__archive-marker",Vt="__archive-config.json",re="streams",ne="blobs",zt=500;function Ke(e){let t=e.replace(/[^A-Za-z0-9._-]/g,"_");if(!t)throw new Error("Archive segment name cannot be empty after sanitization");return t}function oe(e){a.mkdirSync(e,{recursive:true}),a.mkdirSync(y.join(e,re),{recursive:true}),a.mkdirSync(y.join(e,ne),{recursive:true});let t=y.join(e,Ut),r=y.join(e,Vt);if(!a.existsSync(t))try{a.writeFileSync(t,`archive-store
|
|
6
6
|
${new Date().toISOString()}
|
|
7
|
-
`,"utf-8");}catch{}function n(){if(!a.existsSync(r))return {};try{let u=a.readFileSync(r,"utf-8"),l=JSON.parse(u);return l&&typeof l=="object"&&!Array.isArray(l)?l:{}}catch{return {}}}function o(u){let l=`${r}.${process.pid}.${randomUUID()}.tmp`;try{a.writeFileSync(l,JSON.stringify(u,null,2),"utf-8"),C(l,r);}catch{}}function s(){if(!a.existsSync(t))return;let u=n(),l=typeof u["retention.maxAgeMs"]=="number"?u["retention.maxAgeMs"]:0,g=typeof u["retention.sweepIntervalMs"]=="number"?u["retention.sweepIntervalMs"]:0;if(l<=0||g<=0)return;let i=typeof u["retention.lastSweepAt"]=="number"?u["retention.lastSweepAt"]:0,c=Date.now();if(c-i<g)return;u["retention.lastSweepAt"]=c,o(u);let d=c,f=m=>{let S;try{S=a.readdirSync(m,{withFileTypes:!0});}catch{return}for(let h of S){if(Date.now()-d>zt)return;let
|
|
7
|
+
`,"utf-8");}catch{}function n(){if(!a.existsSync(r))return {};try{let u=a.readFileSync(r,"utf-8"),l=JSON.parse(u);return l&&typeof l=="object"&&!Array.isArray(l)?l:{}}catch{return {}}}function o(u){let l=`${r}.${process.pid}.${randomUUID()}.tmp`;try{a.writeFileSync(l,JSON.stringify(u,null,2),"utf-8"),C(l,r);}catch{}}function s(){if(!a.existsSync(t))return;let u=n(),l=typeof u["retention.maxAgeMs"]=="number"?u["retention.maxAgeMs"]:0,g=typeof u["retention.sweepIntervalMs"]=="number"?u["retention.sweepIntervalMs"]:0;if(l<=0||g<=0)return;let i=typeof u["retention.lastSweepAt"]=="number"?u["retention.lastSweepAt"]:0,c=Date.now();if(c-i<g)return;u["retention.lastSweepAt"]=c,o(u);let d=c,f=m=>{let S;try{S=a.readdirSync(m,{withFileTypes:!0});}catch{return}for(let h of S){if(Date.now()-d>zt)return;let w=y.join(m,h.name);if(h.isDirectory()){f(w);continue}if(h.isFile())try{let p=a.statSync(w);if(c-p.mtimeMs>l)try{a.unlinkSync(w);}catch{}}catch{}}};f(y.join(e,re)),f(y.join(e,ne));}return {stream(u){let l=Ke(u),g=y.join(e,re,`${l}.jsonl`),i=we(g);return {append(c){let d=i.append(c);try{s();}catch{}return d},readAll:()=>i.readAll(),readAfter:c=>i.readAfter(c),clear:()=>{i.clear&&i.clear();}}},blob(u){let l=Ke(u),g=y.join(e,ne,l);a.mkdirSync(g,{recursive:true});let i=N(g);return {read:c=>i.read(c),write:(c,d)=>{i.write(c,d);try{s();}catch{}},exists:c=>i.exists(c),remove:c=>i.remove(c),readBytes:i.readBytes?c=>i.readBytes(c):void 0,writeBytes:i.writeBytes?(c,d)=>{i.writeBytes(c,d);try{s();}catch{}}:void 0,listKeys:c=>i.listKeys(c),stat:i.stat?c=>i.stat(c):void 0}},listStreams(u){let l=y.join(e,re);try{return a.readdirSync(l,{withFileTypes:!0}).filter(g=>g.isFile()&&g.name.endsWith(".jsonl")).map(g=>g.name.slice(0,-6)).filter(g=>!u||g.startsWith(u)).sort()}catch{return []}},listBlobs(u){let l=y.join(e,ne);try{return a.readdirSync(l,{withFileTypes:!0}).filter(g=>g.isDirectory()).map(g=>g.name).filter(g=>!u||g.startsWith(u)).sort()}catch{return []}},config:{get(u){return n()[u]??null},set(u,l){let g=n();l==null?delete g[u]:g[u]=l,o(g);}}}}function se(e){function t(n){return y.join(e,...n.split("/"))+".json"}function r(n,o,s,u){if(a.existsSync(n))for(let l of a.readdirSync(n,{withFileTypes:true})){let g=o?`${o}/${l.name}`:l.name;if(l.isDirectory()){r(y.join(n,l.name),g,s,u);continue}if(!l.isFile()||!l.name.endsWith(".json"))continue;let i=g.replace(/\.json$/,"");(!s||i.startsWith(s))&&u.push(i);}}return {read(n){let o=t(n);if(!a.existsSync(o))return null;try{return JSON.parse(a.readFileSync(o,"utf-8"))}catch{return null}},write(n,o){let s=t(n),u=`${s}.${process.pid}.${randomUUID()}.tmp`;a.mkdirSync(y.dirname(s),{recursive:true}),a.writeFileSync(u,JSON.stringify(o,null,2),"utf-8"),C(u,s);},delete(n){let o=t(n);try{a.existsSync(o)&&a.unlinkSync(o);}catch{}},listKeys(n){let o=[];return r(e,"",n,o),o.sort()}}}function we(e){function t(){if(!a.existsSync(e))return [];let r=a.readFileSync(e,"utf-8").trim();return r?r.split(`
|
|
8
8
|
`).filter(Boolean).map(n=>JSON.parse(n)):[]}return {append(r){let n={id:randomUUID(),payload:r};return a.mkdirSync(y.dirname(e),{recursive:true}),a.appendFileSync(e,JSON.stringify(n)+`
|
|
9
9
|
`,"utf-8"),n},readAll(){return t()},readAfter(r){let n=t();if(!r)return {entries:n,newCursor:n.length>0?n[n.length-1].id:null};let o=n.findIndex(u=>u.id===r),s=o===-1?n:n.slice(o+1);return {entries:s,newCursor:s.length>0?s[s.length-1].id:r}},clear(){a.existsSync(e)&&a.truncateSync(e,0);}}}function xe(e){if(e==null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return `[${e.map(xe).join(",")}]`;let t=e;return `{${Object.keys(t).sort().map(n=>`${JSON.stringify(n)}:${xe(t[n])}`).join(",")}}`}function Ue(e){return createHash("sha256").update(xe(e)).digest("hex")}function Ve(e){let t=y.join(e,"board-journal.jsonl");return {readAllEntries(){if(!a.existsSync(t))return [];let r=a.readFileSync(t,"utf-8").trim();return r?r.split(`
|
|
10
10
|
`).filter(Boolean).map(n=>JSON.parse(n)):[]},appendEntry(r){a.appendFileSync(t,JSON.stringify(r)+`
|
|
11
|
-
`,"utf-8");},generateId(){return randomUUID()}}}function ze(e){return {tryAcquire(){try{if(!a.existsSync(e)){a.mkdirSync(y.dirname(e),{recursive:!0});try{a.writeFileSync(e,"{}",{flag:"wx"});}catch{}}return lockSync(e,{retries:0})}catch{return null}}}}function
|
|
11
|
+
`,"utf-8");},generateId(){return randomUUID()}}}function ze(e){return {tryAcquire(){try{if(!a.existsSync(e)){a.mkdirSync(y.dirname(e),{recursive:!0});try{a.writeFileSync(e,"{}",{flag:"wx"});}catch{}}return lockSync(e,{retries:0})}catch{return null}}}}function Lr(){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=$(s);}catch{r="";}if(!r)return {dispatched:false,error:"createNodeSpawnInvocationAdapter: could not resolve executable path from whatToRun"};let n={...t},o=Buffer.from(JSON.stringify(n)).toString("base64");try{return spawn(process.execPath,[r,"--boardId",String(t.boardId??""),"--cardId",String(t.cardId??""),"--extraEncJson",o],{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=$(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 Yt=".board.lock";function Ye(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 Zt(e,t){return typeof e=="string"?{cliDir:e,opts:t}:{cliDir:void 0,opts:e}}function Xt(e,t){return typeof e=="string"?{cliDir:e,opts:t}:{cliDir:void 0,opts:e}}function Ze(e){if(e)return e;let t=Ce(import.meta.url),r=[t,b(t,"..","cli","node"),b(t,"..","..","cli","node")];for(let n of r)try{return Pe(n),n}catch{}throw new Error(`createFsBoardPlatformAdapter: could not resolve a public CLI directory from module dir ${t}`)}function er(e,t,r){let{cliDir:n,opts:o}=Zt(t,r),s=e.value,u,l=null,g$1,i,c,d=null,f;function m(){return f||(f=Ze(n)),f}let S=o?.callbackTransport??g(o?.notifyChannel),h;function w(){if(o?.suppressSpawn||l)return;let p=fe({id:"task-executor",workerStore:h.boardWorkerStore(),handleRequest:async(x,B)=>{let v=await H(B.ref,B.args,{cliDir:m(),cwd:process.cwd(),label:"fsBoardAdapter.boardWorker"});if(v.result!=="success"){let R=typeof v.data?.error=="string"?v.data.error:v.error;throw new Error(R||v.result)}}});l=ee(p).catch(x=>{o?.onWarn?.(`[board-worker] in-process queue drain failed: ${x instanceof Error?x.message:String(x)}`);}).finally(()=>{l=null,h.boardWorkerStore().peekActive().length>0&&w();});}return h={kvStorage:p=>se(b(s,`.${p}`)),blobStorage:p=>p?N(b(s,p)):N(s),scratchStorage:()=>G(b(s,".tmp")),scratchStorageForRef:p=>G(b$1(p).value),archiveFactory:()=>oe(b(s,"archive")),archiveFactoryForRef:p=>oe(b$1(p).value),journalAdapter:()=>Ve(s),boardWorkerStore:()=>(u||(u=K(J(b(s,".board-worker-queue")))),u),chatAgentStore:()=>(g$1||(g$1=K(J(b(s,".chat-agent-queue")))),g$1),processAccumulatedStore:()=>(i||(i=J(b(s,".process-accumulated-queue"))),i),lock:ze(b(s,Yt)),callbackTransport:S,async dispatchExecution(p,x){let B=!!x.output?.ref;if(p.howToRun==="queue-storage")try{let R=u??K(J(b(s,".board-worker-queue")));u||(u=R);let E=typeof p.extra?.boardId=="string"?p.extra.boardId:void 0;if(B)return R.enqueueRequest({boardId:E,ref:p,args:x}),{dispatched:!0};let M=x.source_def?.bindTo??X().slice(0,8),k=G(b(s,".tmp")),I=k.create(JSON.stringify(x,null,2),`exec-in-${M}`,".json"),D=k.getUniqueKey(`exec-out-${M}`,".json"),Q=k.getUniqueKey(`exec-err-${M}`,".txt"),ae=a$2(k.keyRef(I)),Y=a$2(k.keyRef(D)),ie=a$2(k.keyRef(Q));return R.enqueueRequest({boardId:E,ref:p,args:{subcommand:"run-source-fetch",inRef:ae,outRef:Y,errRef:ie}}),{dispatched:!0}}catch(R){return {dispatched:false,error:R instanceof Error?R.message:String(R)}}if(B&&(p.howToRun==="http:post"||p.howToRun==="in-process-loop"))try{if(p.howToRun==="http:post"){let M=$(p.whatToRun),k=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...x,...p.extra?{extra:p.extra}:{}})});if(!k.ok){let I=await k.text().catch(()=>"");return {dispatched:!1,error:`HTTP ${k.status}: ${I}`}}return {dispatched:!0}}let R=await H(p,x,{cwd:process.cwd(),label:"dispatchExecution.directHostedWorker"});return R.result==="success"?{dispatched:!0}:{dispatched:!1,error:(typeof R.data?.error=="string"?R.data.error:R.error)||R.result}}catch(R){return {dispatched:false,error:R instanceof Error?R.message:String(R)}}let v=p.howToRun==="local-node"||p.howToRun==="local-process"||p.howToRun==="local-python"||p.howToRun==="built-in";if(o?.suppressSpawn&&v)return {dispatched:false};try{let R=x.source_def?.bindTo??X().slice(0,8),E=G(b(s,".tmp")),M=E.create(JSON.stringify(x,null,2),`exec-in-${R}`,".json"),k=E.getUniqueKey(`exec-out-${R}`,".json"),I=E.getUniqueKey(`exec-err-${R}`,".txt"),D=a$2(E.keyRef(M)),Q=a$2(E.keyRef(k)),ae=a$2(E.keyRef(I)),Y=u??K(J(b(s,".board-worker-queue")));u||(u=Y);let ie=typeof p.extra?.boardId=="string"?p.extra.boardId:void 0;return Y.enqueueRequest({boardId:ie,ref:p,args:{subcommand:"run-source-fetch",inRef:D,outRef:Q,errRef:ae}}),w(),{dispatched:!0}}catch(R){let E=R instanceof Error?R.message:String(R);try{let M=oe(b(s,"archive")),k=new Date().toISOString().replace(/[:.]/g,"-"),I=x.source_def?.bindTo??"unknown";M.blob("exec-failures").write(`${k}-${I}.json`,JSON.stringify({error:E,args:x,ref:p,at:new Date().toISOString()},null,2));}catch{}return {dispatched:false,error:E}}},supportsDirectSourceOutput(p){return p.howToRun==="queue-storage"||p.howToRun==="http:post"||p.howToRun==="in-process-loop"},resolveBlob(p){let x=Be(p.value)?ke().read(p.value):N(s).read(p.value);if(x===null)throw new Error(`resolveBlob: blob not found: ::${p.kind}::${p.value}`);return x},hashFn:Ue,genId:()=>Ie(`${Date.now()}-${Math.random()}`).slice(0,32),kvStorageForRef:p=>se(b$1(p).value),requestProcessAccumulated(){if(o?.suppressSpawn||d)return;let p=this,x=c??=y$1(e,p),B=pe({id:"process-accumulated",queueStorage:p.processAccumulatedStore(),handleMessage:async()=>{let v=await x.processAccumulatedEvents({});if(v.status!=="success")throw new Error(v.error||`processAccumulatedEvents returned ${v.status}`)}});d=ee(B).catch(v=>{o?.onWarn?.(`[process-accumulated] in-process queue drain failed: ${v instanceof Error?v.message:String(v)}`);}).finally(()=>{d=null,p.processAccumulatedStore().peekActive().length>0&&p.requestProcessAccumulated?.();});},publishBoardChangeNotifications(p){if(!o?.notifyChannel||p.length===0)return;let x=p.map(B=>({id:X(),ts:new Date().toISOString(),boardRef:a$2(e),notification:B}));qe(o.notifyChannel,x,o.onWarn);},onWarn:o?.onWarn},h}function Qr(e,t,r){let{cliDir:n,opts:o}=Xt(t,r),s,u=()=>(s||(s=Ze(n)),s);return {...er(e,n,o),async invokeExecutor(g,i,c){if(g.howToRun==="queue-storage")throw new Error("queue-storage does not support inline executor request/response");if(g.howToRun==="http:post"||g.howToRun==="http:get"||g.howToRun==="in-process-loop"){let h=await H(g,{subcommand:i,...c?.input!==void 0?{input:c.input}:{},...g.extra?{extra:g.extra}:{}},{cwd:process.cwd(),timeoutMs:c?.timeout??3e4,label:`invokeExecutor:${i}`});if(h.result!=="success"){let w=typeof h.data?.error=="string"?h.data.error:h.error;throw new Error(w||`executor request failed: ${h.result}`)}return typeof h.data?.stdout=="string"?h.data.stdout:JSON.stringify(h.data??{})}let{command:d,baseArgs:f}=te(g,u()),m=g.extra?["--extra",Buffer.from(JSON.stringify(g.extra)).toString("base64")]:[],S=[...f,i,...m];return await new Promise((h,w)=>{let p=spawn(d,S,{cwd:process.cwd(),stdio:"pipe",windowsHide:true,shell:process.platform==="win32"&&/\.(cmd|bat)$/i.test(d)}),x=[],B=[],v=false,R=null,E=k=>{v||(v=true,R&&clearTimeout(R),w(k));},M=k=>{v||(v=true,R&&clearTimeout(R),h(k));};p.stdout.on("data",k=>{x.push(Buffer.from(k));}),p.stderr.on("data",k=>{B.push(Buffer.from(k));}),p.on("error",k=>{let I=k;I.stdout=Buffer.concat(x).toString("utf-8"),I.stderr=Buffer.concat(B).toString("utf-8"),E(I);}),p.on("close",k=>{let I=Buffer.concat(x).toString("utf-8"),D=Buffer.concat(B).toString("utf-8");if(k===0){M(I);return}let Q=new Error(D.trim()||`executor exited with status ${k}`);Q.stdout=I,Q.stderr=D,E(Q);}),c?.timeout&&c.timeout>0&&(R=setTimeout(()=>{p.kill();let k=new Error(`executor timed out after ${c.timeout}ms`);k.stdout=Buffer.concat(x).toString("utf-8"),k.stderr=Buffer.concat(B).toString("utf-8"),E(k);},c.timeout)),c?.input!==void 0?p.stdin.end(c.input):p.stdin.end();})},validateSchema(g){let i=d(g);return {ok:i.errors.length===0,errors:i.errors}},absoluteBlob:ke()}}function Or(e,t={}){let r=t.chatsSubdir??"chats",n=t.kvSubdir??".kv",o=n?[n,"chat"]:["chat"],s=r&&!Ye(e,r)?b(e,r):e,u=se(b(e,...o));return a$3(l=>{let i=`${String(l).replace(/[^a-zA-Z0-9_-]/g,"_")}.jsonl`,c=b(s,i);return we(c)},u)}function Wr(e,t={}){let r=t.filesSubdir??"files",n=r&&!Ye(e,r)?b(e,r):e;return c(N(n))}function _r(e){try{let t=JSON.parse(Buffer.from(e,"base64url").toString());return typeof t.br=="string"?t.br:null}catch{return null}}export{te as buildLocalBaseSpec,fe as createBoardWorkerQueueLane,K as createBoardWorkerStore,qt as createExecutionRefInvoker,N as createFsBlobStorage,Or as createFsBoardChatStorage,Wr as createFsBoardFileArtifactsStore,Qr as createFsBoardNonCorePlatformAdapter,er as createFsBoardPlatformAdapter,J as createFsQueueStorage,Lr as createNodeSpawnInvocationAdapter,pe as createQueueStorageLane,_r as decodeBoardRefFromToken,ee as drainQueueLaneToIdle,me as evaluateArgsMassaging,H as invokeExecutionRef,ye as invokeExecutionRefSync,Lt as invokeRefSync,Mt as registerInProcessExecutionHandler,$ as resolveWhatToRunValue,_e as resolveYamlFlowCliPath,Oe as startQueueLaneRunner,At as startQueueLaneRunners,Ft as unregisterInProcessExecutionHandler};//# sourceMappingURL=board-live-cards-node.js.map
|
|
12
12
|
//# sourceMappingURL=board-live-cards-node.js.map
|
|
@@ -503,4 +503,4 @@ interface BoardLiveCardsNonCorePublic {
|
|
|
503
503
|
}
|
|
504
504
|
declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter): BoardLiveCardsNonCorePublic;
|
|
505
505
|
|
|
506
|
-
export { type
|
|
506
|
+
export { type BoardChangeNotification as B, type CommandInput as C, EMPTY_CONFIG as E, type LiveCard as L, type StateSnapshotReadView as S, type CommandResult as a, type CardAdminStore as b, type BoardLiveCardsPublic as c, type BoardNonCorePlatformAdapter as d, type BoardPlatformAdapter as e, type BoardWorkerRequest as f, type BoardLiveCardsNonCorePublic as g, type BoardStatusObject as h, type BoardCallbackTransport as i, type CardChecksumIndex as j, type CardUpsertValidation as k, type CardIndex as l, type BoardWorkerStore as m, BOARD_GRAPH_KEY as n, type BoardWorkerDeadLetterRequest as o, type BoardWorkerLeasedRequest as p, type BoardWorkerQueuedRequest as q, SNAPSHOT_SCHEMA_VERSION_V1 as r, createBoardLiveCardsNonCorePublic as s, createBoardLiveCardsPublic as t, createBoardWorkerStore as u, createCardStore as v, createHttpBoardCallbackTransport as w, createInProcessBoardCallbackTransport as x, createLocalNodeBoardCallbackTransport as y };
|
package/lib/{board-live-cards-public-wkNmBIRC.d.cts → board-live-cards-public-LlVUQPL2.d.cts}
RENAMED
|
@@ -503,4 +503,4 @@ interface BoardLiveCardsNonCorePublic {
|
|
|
503
503
|
}
|
|
504
504
|
declare function createBoardLiveCardsNonCorePublic(baseRef: KindValueRef, adapter: BoardNonCorePlatformAdapter): BoardLiveCardsNonCorePublic;
|
|
505
505
|
|
|
506
|
-
export { type
|
|
506
|
+
export { type BoardChangeNotification as B, type CommandInput as C, EMPTY_CONFIG as E, type LiveCard as L, type StateSnapshotReadView as S, type CommandResult as a, type CardAdminStore as b, type BoardLiveCardsPublic as c, type BoardNonCorePlatformAdapter as d, type BoardPlatformAdapter as e, type BoardWorkerRequest as f, type BoardLiveCardsNonCorePublic as g, type BoardStatusObject as h, type BoardCallbackTransport as i, type CardChecksumIndex as j, type CardUpsertValidation as k, type CardIndex as l, type BoardWorkerStore as m, BOARD_GRAPH_KEY as n, type BoardWorkerDeadLetterRequest as o, type BoardWorkerLeasedRequest as p, type BoardWorkerQueuedRequest as q, SNAPSHOT_SCHEMA_VERSION_V1 as r, createBoardLiveCardsNonCorePublic as s, createBoardLiveCardsPublic as t, createBoardWorkerStore as u, createCardStore as v, createHttpBoardCallbackTransport as w, createInProcessBoardCallbackTransport as x, createLocalNodeBoardCallbackTransport as y };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { a as KindValueRef } from './storage-interface-BFiD3kyB.cjs';
|
|
2
|
+
import { C as CommandInput, a as CommandResult, h as BoardStatusObject } from './board-live-cards-public-LlVUQPL2.cjs';
|
|
3
|
+
import { A as AsyncBoardPlatformAdapter } from './board-platform-adapter-async-BfHmHdx2.cjs';
|
|
4
|
+
|
|
5
|
+
interface AsyncBoardLiveCardsPublic {
|
|
6
|
+
init(input: CommandInput): Promise<CommandResult>;
|
|
7
|
+
status(input: CommandInput): Promise<CommandResult<BoardStatusObject>>;
|
|
8
|
+
getCardStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
9
|
+
storeRef: string;
|
|
10
|
+
}>>;
|
|
11
|
+
getOutputsStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
12
|
+
storeRef: string;
|
|
13
|
+
}>>;
|
|
14
|
+
getScratchStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
15
|
+
storeRef: string | null;
|
|
16
|
+
}>>;
|
|
17
|
+
getArchiveStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
18
|
+
storeRef: string | null;
|
|
19
|
+
}>>;
|
|
20
|
+
getChatStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
21
|
+
storeRef: string | null;
|
|
22
|
+
}>>;
|
|
23
|
+
getArtifactsStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
24
|
+
storeRef: string | null;
|
|
25
|
+
}>>;
|
|
26
|
+
getConfig(input: CommandInput): Promise<CommandResult<{
|
|
27
|
+
value: unknown;
|
|
28
|
+
}>>;
|
|
29
|
+
getOutputsDataObject(input: CommandInput): Promise<CommandResult>;
|
|
30
|
+
getAllOutputsDataObjects(input: CommandInput): Promise<CommandResult<Record<string, unknown>>>;
|
|
31
|
+
getOutputsComputedValues(input: CommandInput): Promise<CommandResult>;
|
|
32
|
+
getAllOutputsComputedValues(input: CommandInput): Promise<CommandResult<Record<string, unknown>>>;
|
|
33
|
+
getOutputsFetchedSources(input: CommandInput): Promise<CommandResult<Record<string, string>>>;
|
|
34
|
+
getAllOutputsFetchedSources(input: CommandInput): Promise<CommandResult<Record<string, Record<string, string>>>>;
|
|
35
|
+
addCardFiles(input: CommandInput): Promise<CommandResult<{
|
|
36
|
+
cardId: string;
|
|
37
|
+
files_added: Array<{
|
|
38
|
+
idx: number;
|
|
39
|
+
entry: unknown;
|
|
40
|
+
}>;
|
|
41
|
+
notified: true;
|
|
42
|
+
}>>;
|
|
43
|
+
cardRefreshedNotify(input: CommandInput): Promise<CommandResult>;
|
|
44
|
+
removeCard(input: CommandInput): Promise<CommandResult>;
|
|
45
|
+
retrigger(input: CommandInput): Promise<CommandResult>;
|
|
46
|
+
upsertCard(input: CommandInput): Promise<CommandResult>;
|
|
47
|
+
processAccumulatedEvents(input: CommandInput): Promise<CommandResult>;
|
|
48
|
+
taskFailed(input: CommandInput): Promise<CommandResult>;
|
|
49
|
+
taskProgress(input: CommandInput): Promise<CommandResult>;
|
|
50
|
+
sourceDataFetched(input: CommandInput): Promise<CommandResult>;
|
|
51
|
+
sourceDataFetchFailure(input: CommandInput): Promise<CommandResult>;
|
|
52
|
+
}
|
|
53
|
+
declare function createAsyncBoardLiveCardsPublic(baseRef: KindValueRef, adapter: AsyncBoardPlatformAdapter): AsyncBoardLiveCardsPublic;
|
|
54
|
+
|
|
55
|
+
export { type AsyncBoardLiveCardsPublic as A, createAsyncBoardLiveCardsPublic as c };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { a as KindValueRef } from './storage-interface-BFiD3kyB.js';
|
|
2
|
+
import { C as CommandInput, a as CommandResult, h as BoardStatusObject } from './board-live-cards-public-JNRKfBZy.js';
|
|
3
|
+
import { A as AsyncBoardPlatformAdapter } from './board-platform-adapter-async-DYahVzIK.js';
|
|
4
|
+
|
|
5
|
+
interface AsyncBoardLiveCardsPublic {
|
|
6
|
+
init(input: CommandInput): Promise<CommandResult>;
|
|
7
|
+
status(input: CommandInput): Promise<CommandResult<BoardStatusObject>>;
|
|
8
|
+
getCardStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
9
|
+
storeRef: string;
|
|
10
|
+
}>>;
|
|
11
|
+
getOutputsStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
12
|
+
storeRef: string;
|
|
13
|
+
}>>;
|
|
14
|
+
getScratchStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
15
|
+
storeRef: string | null;
|
|
16
|
+
}>>;
|
|
17
|
+
getArchiveStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
18
|
+
storeRef: string | null;
|
|
19
|
+
}>>;
|
|
20
|
+
getChatStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
21
|
+
storeRef: string | null;
|
|
22
|
+
}>>;
|
|
23
|
+
getArtifactsStoreRef(input: CommandInput): Promise<CommandResult<{
|
|
24
|
+
storeRef: string | null;
|
|
25
|
+
}>>;
|
|
26
|
+
getConfig(input: CommandInput): Promise<CommandResult<{
|
|
27
|
+
value: unknown;
|
|
28
|
+
}>>;
|
|
29
|
+
getOutputsDataObject(input: CommandInput): Promise<CommandResult>;
|
|
30
|
+
getAllOutputsDataObjects(input: CommandInput): Promise<CommandResult<Record<string, unknown>>>;
|
|
31
|
+
getOutputsComputedValues(input: CommandInput): Promise<CommandResult>;
|
|
32
|
+
getAllOutputsComputedValues(input: CommandInput): Promise<CommandResult<Record<string, unknown>>>;
|
|
33
|
+
getOutputsFetchedSources(input: CommandInput): Promise<CommandResult<Record<string, string>>>;
|
|
34
|
+
getAllOutputsFetchedSources(input: CommandInput): Promise<CommandResult<Record<string, Record<string, string>>>>;
|
|
35
|
+
addCardFiles(input: CommandInput): Promise<CommandResult<{
|
|
36
|
+
cardId: string;
|
|
37
|
+
files_added: Array<{
|
|
38
|
+
idx: number;
|
|
39
|
+
entry: unknown;
|
|
40
|
+
}>;
|
|
41
|
+
notified: true;
|
|
42
|
+
}>>;
|
|
43
|
+
cardRefreshedNotify(input: CommandInput): Promise<CommandResult>;
|
|
44
|
+
removeCard(input: CommandInput): Promise<CommandResult>;
|
|
45
|
+
retrigger(input: CommandInput): Promise<CommandResult>;
|
|
46
|
+
upsertCard(input: CommandInput): Promise<CommandResult>;
|
|
47
|
+
processAccumulatedEvents(input: CommandInput): Promise<CommandResult>;
|
|
48
|
+
taskFailed(input: CommandInput): Promise<CommandResult>;
|
|
49
|
+
taskProgress(input: CommandInput): Promise<CommandResult>;
|
|
50
|
+
sourceDataFetched(input: CommandInput): Promise<CommandResult>;
|
|
51
|
+
sourceDataFetchFailure(input: CommandInput): Promise<CommandResult>;
|
|
52
|
+
}
|
|
53
|
+
declare function createAsyncBoardLiveCardsPublic(baseRef: KindValueRef, adapter: AsyncBoardPlatformAdapter): AsyncBoardLiveCardsPublic;
|
|
54
|
+
|
|
55
|
+
export { type AsyncBoardLiveCardsPublic as A, createAsyncBoardLiveCardsPublic as c };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkJJL5VOQZ_cjs=require('./chunk-JJL5VOQZ.cjs');require('./chunk-U2N6MCD5.cjs'),require('./chunk-SFVO2LB2.cjs'),require('./chunk-G4XXRHL2.cjs'),require('./chunk-LODXIALE.cjs'),require('./chunk-IXZG74EW.cjs'),require('./chunk-HWYMZK3N.cjs'),require('./chunk-UJ7ZTV4J.cjs'),require('./chunk-YMEIPKLW.cjs'),require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"BOARD_GRAPH_KEY",{enumerable:true,get:function(){return chunkJJL5VOQZ_cjs.n}});Object.defineProperty(exports,"EMPTY_CONFIG",{enumerable:true,get:function(){return chunkJJL5VOQZ_cjs.u}});Object.defineProperty(exports,"SNAPSHOT_SCHEMA_VERSION_V1",{enumerable:true,get:function(){return chunkJJL5VOQZ_cjs.m}});Object.defineProperty(exports,"createBoardLiveCardsNonCorePublic",{enumerable:true,get:function(){return chunkJJL5VOQZ_cjs.z}});Object.defineProperty(exports,"createBoardLiveCardsPublic",{enumerable:true,get:function(){return chunkJJL5VOQZ_cjs.y}});//# sourceMappingURL=board-live-cards-public.cjs.map
|
|
2
2
|
//# sourceMappingURL=board-live-cards-public.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import './storage-interface-BFiD3kyB.cjs';
|
|
2
|
-
export {
|
|
2
|
+
export { n as BOARD_GRAPH_KEY, B as BoardChangeNotification, g as BoardLiveCardsNonCorePublic, c as BoardLiveCardsPublic, d as BoardNonCorePlatformAdapter, e as BoardPlatformAdapter, C as CommandInput, a as CommandResult, E as EMPTY_CONFIG, r as SNAPSHOT_SCHEMA_VERSION_V1, s as createBoardLiveCardsNonCorePublic, t as createBoardLiveCardsPublic } from './board-live-cards-public-LlVUQPL2.cjs';
|
|
3
3
|
import './execution-refs.cjs';
|
|
4
4
|
import './types-BBhqYGhE.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import './storage-interface-BFiD3kyB.js';
|
|
2
|
-
export {
|
|
2
|
+
export { n as BOARD_GRAPH_KEY, B as BoardChangeNotification, g as BoardLiveCardsNonCorePublic, c as BoardLiveCardsPublic, d as BoardNonCorePlatformAdapter, e as BoardPlatformAdapter, C as CommandInput, a as CommandResult, E as EMPTY_CONFIG, r as SNAPSHOT_SCHEMA_VERSION_V1, s as createBoardLiveCardsNonCorePublic, t as createBoardLiveCardsPublic } from './board-live-cards-public-JNRKfBZy.js';
|
|
3
3
|
import './execution-refs.js';
|
|
4
4
|
import './types-BBhqYGhE.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{n as BOARD_GRAPH_KEY,u as EMPTY_CONFIG,m as SNAPSHOT_SCHEMA_VERSION_V1,z as createBoardLiveCardsNonCorePublic,y as createBoardLiveCardsPublic}from'./chunk-
|
|
1
|
+
export{n as BOARD_GRAPH_KEY,u as EMPTY_CONFIG,m as SNAPSHOT_SCHEMA_VERSION_V1,z as createBoardLiveCardsNonCorePublic,y as createBoardLiveCardsPublic}from'./chunk-JH37NJGP.js';import'./chunk-XQRNDX4Q.js';import'./chunk-BQS3EIEK.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';import'./chunk-JMDHDY6M.js';import'./chunk-3KC6LBOG.js';import'./chunk-MNEOJWPS.js';import'./chunk-KBELAKIY.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 chunkASR44K7H_cjs=require('./chunk-ASR44K7H.cjs');require('./chunk-EZENHAVZ.cjs'),require('./chunk-7FGPOGRV.cjs'),require('./chunk-LPXVVMQT.cjs'),require('./chunk-7ICPAABP.cjs'),require('./chunk-KAWQPLIE.cjs'),require('./chunk-NM6O35RY.cjs'),require('./chunk-272IYUKT.cjs');var chunkCPAXTVBQ_cjs=require('./chunk-CPAXTVBQ.cjs');require('./chunk-NJJ7WEDT.cjs'),require('./chunk-GL2OHR2E.cjs'),require('./chunk-J6EGN6S4.cjs'),require('./chunk-PBCDDO4V.cjs'),require('./chunk-JJL5VOQZ.cjs'),require('./chunk-U2N6MCD5.cjs'),require('./chunk-SFVO2LB2.cjs'),require('./chunk-G4XXRHL2.cjs'),require('./chunk-LODXIALE.cjs'),require('./chunk-PBOQ4HYB.cjs'),require('./chunk-IXZG74EW.cjs'),require('./chunk-HWYMZK3N.cjs'),require('./chunk-UJ7ZTV4J.cjs'),require('./chunk-YMEIPKLW.cjs'),require('./chunk-GYQXDNNI.cjs'),require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"createMultiBoardServerRuntime",{enumerable:true,get:function(){return chunkASR44K7H_cjs.b}});Object.defineProperty(exports,"createSingleBoardServerRuntime",{enumerable:true,get:function(){return chunkASR44K7H_cjs.a}});Object.defineProperty(exports,"createHostedBoardQueueLaneRegistry",{enumerable:true,get:function(){return chunkCPAXTVBQ_cjs.a}});//# sourceMappingURL=board-live-cards-server-runtime.cjs.map
|
|
2
2
|
//# sourceMappingURL=board-live-cards-server-runtime.cjs.map
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
export { A as Awaitable,
|
|
2
|
-
export { HostedBoardQueueLaneRegistryOptions, createHostedBoardQueueLaneRegistry
|
|
3
|
-
export { A as AsyncBoardLiveCardsPublic
|
|
1
|
+
export { A as Awaitable, B as BoardContextConfig, c as BoardRuntimeNonCorePublic, d as BoardRuntimePlatformAdapter, e as BoardRuntimePublic, C as ChatHandlerFlowRunner, D as DescribeEnvelope, H as HostedBoardQueueLaneTuning, I as InvocationAdapter, a as MultiBoardRuntime, M as MultiBoardRuntimeOptions, N as NotificationTransport, Q as QueueLaneRuntimeTuning, R as RuntimeLogger, f as RuntimeRequest, g as RuntimeResponse, b as SingleBoardRuntime, S as SingleBoardRuntimeOptions } from './types-Ba8H5_Wo.cjs';
|
|
2
|
+
export { HostedBoardQueueLaneRegistryOptions, createHostedBoardQueueLaneRegistry } from './server-jobs-queue-runner/index.cjs';
|
|
3
|
+
export { A as AsyncBoardLiveCardsPublic } from './board-live-cards-public-async-Di9QB141.cjs';
|
|
4
|
+
export { A as AsyncBoardPlatformAdapter } from './board-platform-adapter-async-BfHmHdx2.cjs';
|
|
4
5
|
export { B as BlobStorage, K as KVStorage, a as KindValueRef } from './storage-interface-BFiD3kyB.cjs';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
6
|
+
export { B as BoardChangeNotification, c as BoardLiveCardsPublic, d as BoardNonCorePlatformAdapter, e as BoardPlatformAdapter, f as BoardWorkerRequest, C as CommandInput, a as CommandResult } from './board-live-cards-public-LlVUQPL2.cjs';
|
|
7
|
+
export { C as ChatStorage } from './chat-storage-lib-B9Q34Dyv.cjs';
|
|
7
8
|
export { ExecutionRef } from './execution-refs.cjs';
|
|
8
|
-
|
|
9
|
+
export { createMultiBoardServerRuntime, createSingleBoardServerRuntime } from './server-runtime/index.cjs';
|
|
10
|
+
import './artifacts-store-lib-D9nMkVcE.cjs';
|
|
11
|
+
import './queue-lane-registry-PaZuFpwp.cjs';
|
|
9
12
|
import './types-BBhqYGhE.cjs';
|
|
13
|
+
import './storage-async-interface-BRR4eBjx.cjs';
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
export { A as Awaitable,
|
|
2
|
-
export { HostedBoardQueueLaneRegistryOptions, createHostedBoardQueueLaneRegistry
|
|
3
|
-
export { A as AsyncBoardLiveCardsPublic
|
|
1
|
+
export { A as Awaitable, B as BoardContextConfig, c as BoardRuntimeNonCorePublic, d as BoardRuntimePlatformAdapter, e as BoardRuntimePublic, C as ChatHandlerFlowRunner, D as DescribeEnvelope, H as HostedBoardQueueLaneTuning, I as InvocationAdapter, a as MultiBoardRuntime, M as MultiBoardRuntimeOptions, N as NotificationTransport, Q as QueueLaneRuntimeTuning, R as RuntimeLogger, f as RuntimeRequest, g as RuntimeResponse, b as SingleBoardRuntime, S as SingleBoardRuntimeOptions } from './types-SO5OZm4s.js';
|
|
2
|
+
export { HostedBoardQueueLaneRegistryOptions, createHostedBoardQueueLaneRegistry } from './server-jobs-queue-runner/index.js';
|
|
3
|
+
export { A as AsyncBoardLiveCardsPublic } from './board-live-cards-public-async-fwd1QI82.js';
|
|
4
|
+
export { A as AsyncBoardPlatformAdapter } from './board-platform-adapter-async-DYahVzIK.js';
|
|
4
5
|
export { B as BlobStorage, K as KVStorage, a as KindValueRef } from './storage-interface-BFiD3kyB.js';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
6
|
+
export { B as BoardChangeNotification, c as BoardLiveCardsPublic, d as BoardNonCorePlatformAdapter, e as BoardPlatformAdapter, f as BoardWorkerRequest, C as CommandInput, a as CommandResult } from './board-live-cards-public-JNRKfBZy.js';
|
|
7
|
+
export { C as ChatStorage } from './chat-storage-lib-DB9iSai2.js';
|
|
7
8
|
export { ExecutionRef } from './execution-refs.js';
|
|
8
|
-
|
|
9
|
+
export { createMultiBoardServerRuntime, createSingleBoardServerRuntime } from './server-runtime/index.js';
|
|
10
|
+
import './artifacts-store-lib-DSSMqVL2.js';
|
|
11
|
+
import './queue-lane-registry-PaZuFpwp.js';
|
|
9
12
|
import './types-BBhqYGhE.js';
|
|
13
|
+
import './storage-async-interface-DhlOVPSp.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{b as createMultiBoardServerRuntime,a as createSingleBoardServerRuntime}from'./chunk-76C7N4YT.js';import'./chunk-QJVR3FWQ.js';import'./chunk-NTICU4OK.js';import'./chunk-O7NOHKVR.js';import'./chunk-WHDEBJLT.js';import'./chunk-SGV7PU4H.js';import'./chunk-XYN5D3GL.js';import'./chunk-ZJ5M5COT.js';export{a as createHostedBoardQueueLaneRegistry}from'./chunk-YGALANRO.js';import'./chunk-6APH25VI.js';import'./chunk-VXJHBWK3.js';import'./chunk-PRKRXAVN.js';import'./chunk-HEEDJEKM.js';import'./chunk-JH37NJGP.js';import'./chunk-XQRNDX4Q.js';import'./chunk-BQS3EIEK.js';import'./chunk-VGT3TRQG.js';import'./chunk-WDPOGXTY.js';import'./chunk-ZCNN6XPV.js';import'./chunk-JMDHDY6M.js';import'./chunk-3KC6LBOG.js';import'./chunk-MNEOJWPS.js';import'./chunk-KBELAKIY.js';import'./chunk-76ON3V7R.js';import'./chunk-FW4363Y4.js';//# 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 chunkS6DRP2HX_cjs=require('../chunk-S6DRP2HX.cjs');require('../chunk-G4XXRHL2.cjs'),require('../chunk-LODXIALE.cjs'),require('../chunk-IXZG74EW.cjs'),require('../chunk-
|
|
1
|
+
'use strict';var chunkS6DRP2HX_cjs=require('../chunk-S6DRP2HX.cjs');require('../chunk-G4XXRHL2.cjs'),require('../chunk-LODXIALE.cjs'),require('../chunk-IXZG74EW.cjs'),require('../chunk-HWYMZK3N.cjs'),require('../chunk-UJ7ZTV4J.cjs'),require('../chunk-GNFE24S7.cjs');Object.defineProperty(exports,"LocalStorageService",{enumerable:true,get:function(){return chunkS6DRP2HX_cjs.a}});Object.defineProperty(exports,"buildBrowserArtifactsFromRuntime",{enumerable:true,get:function(){return chunkS6DRP2HX_cjs.e}});Object.defineProperty(exports,"createBoardLiveGraphRuntime",{enumerable:true,get:function(){return chunkS6DRP2HX_cjs.b}});Object.defineProperty(exports,"selectAllLiveCardModels",{enumerable:true,get:function(){return chunkS6DRP2HX_cjs.d}});Object.defineProperty(exports,"selectLiveCardModel",{enumerable:true,get:function(){return chunkS6DRP2HX_cjs.c}});//# sourceMappingURL=index.cjs.map
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{a as LocalStorageService,e as buildBrowserArtifactsFromRuntime,b as createBoardLiveGraphRuntime,d as selectAllLiveCardModels,c as selectLiveCardModel}from'../chunk-YGKDQLYP.js';import'../chunk-VGT3TRQG.js';import'../chunk-WDPOGXTY.js';import'../chunk-JMDHDY6M.js';import'../chunk-
|
|
1
|
+
export{a as LocalStorageService,e as buildBrowserArtifactsFromRuntime,b as createBoardLiveGraphRuntime,d as selectAllLiveCardModels,c as selectLiveCardModel}from'../chunk-YGKDQLYP.js';import'../chunk-VGT3TRQG.js';import'../chunk-WDPOGXTY.js';import'../chunk-JMDHDY6M.js';import'../chunk-3KC6LBOG.js';import'../chunk-MNEOJWPS.js';import'../chunk-FW4363Y4.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { i as BoardCallbackTransport, B as BoardChangeNotification } from './board-live-cards-public-LlVUQPL2.cjs';
|
|
2
|
+
import { ExecutionRef } from './execution-refs.cjs';
|
|
3
|
+
import { a as KindValueRef } from './storage-interface-BFiD3kyB.cjs';
|
|
4
|
+
import { c as AsyncKVStorage, a as AsyncBlobStorage, f as AsyncScratchStorage, A as AsyncArchiveFactory, b as AsyncJournalStorage, e as AsyncQueueStorage, d as AsyncAtomicRelayLock } from './storage-async-interface-BRR4eBjx.cjs';
|
|
5
|
+
|
|
6
|
+
interface AsyncBoardWorkerRequest {
|
|
7
|
+
boardId?: string;
|
|
8
|
+
ref: ExecutionRef;
|
|
9
|
+
args: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
interface AsyncBoardWorkerQueuedRequest {
|
|
12
|
+
messageId: string;
|
|
13
|
+
enqueuedAt: string;
|
|
14
|
+
attempt: number;
|
|
15
|
+
request: AsyncBoardWorkerRequest;
|
|
16
|
+
}
|
|
17
|
+
interface AsyncBoardWorkerLeasedRequest extends AsyncBoardWorkerQueuedRequest {
|
|
18
|
+
leaseToken: string;
|
|
19
|
+
leaseExpiresAt: string;
|
|
20
|
+
}
|
|
21
|
+
interface AsyncBoardWorkerDeadLetterRequest extends AsyncBoardWorkerQueuedRequest {
|
|
22
|
+
reason?: string;
|
|
23
|
+
}
|
|
24
|
+
interface AsyncBoardWorkerStore {
|
|
25
|
+
enqueueRequest(request: AsyncBoardWorkerRequest): Promise<string>;
|
|
26
|
+
leaseRequests(opts?: {
|
|
27
|
+
max?: number;
|
|
28
|
+
visibilityMs?: number;
|
|
29
|
+
}): Promise<AsyncBoardWorkerLeasedRequest[]>;
|
|
30
|
+
ackRequest(messageId: string, leaseToken: string): Promise<boolean>;
|
|
31
|
+
nackRequest(messageId: string, leaseToken: string, opts?: {
|
|
32
|
+
dead?: boolean;
|
|
33
|
+
reason?: string;
|
|
34
|
+
}): Promise<boolean>;
|
|
35
|
+
peekActive(): Promise<AsyncBoardWorkerQueuedRequest[]>;
|
|
36
|
+
peekDeadLetter(): Promise<AsyncBoardWorkerDeadLetterRequest[]>;
|
|
37
|
+
}
|
|
38
|
+
interface AsyncBoardConfigStore {
|
|
39
|
+
readTaskExecutorRef(): Promise<ExecutionRef | undefined>;
|
|
40
|
+
writeTaskExecutorRef(ref: ExecutionRef): Promise<void>;
|
|
41
|
+
readChatHandlerFlow(): Promise<unknown>;
|
|
42
|
+
writeChatHandlerFlow(flow: unknown): Promise<void>;
|
|
43
|
+
readCardStoreRef(): Promise<string | null>;
|
|
44
|
+
writeCardStoreRef(ref: string): Promise<void>;
|
|
45
|
+
readOutputsStoreRef(): Promise<string | null>;
|
|
46
|
+
writeOutputsStoreRef(ref: string): Promise<void>;
|
|
47
|
+
readScratchStoreRef(): Promise<string | null>;
|
|
48
|
+
writeScratchStoreRef(ref: string): Promise<void>;
|
|
49
|
+
readArchiveStoreRef(): Promise<string | null>;
|
|
50
|
+
writeArchiveStoreRef(ref: string): Promise<void>;
|
|
51
|
+
readChatStoreRef(): Promise<string | null>;
|
|
52
|
+
writeChatStoreRef(ref: string): Promise<void>;
|
|
53
|
+
readArtifactsStoreRef(): Promise<string | null>;
|
|
54
|
+
writeArtifactsStoreRef(ref: string): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
interface AsyncBoardPlatformAdapter {
|
|
57
|
+
kvStorage(namespace: string): AsyncKVStorage;
|
|
58
|
+
kvStorageForRef(ref: string): AsyncKVStorage;
|
|
59
|
+
blobStorage(namespace: string): AsyncBlobStorage;
|
|
60
|
+
scratchStorage(): AsyncScratchStorage;
|
|
61
|
+
scratchStorageForRef(ref: string): AsyncScratchStorage;
|
|
62
|
+
archiveFactory(): AsyncArchiveFactory;
|
|
63
|
+
archiveFactoryForRef(ref: string): AsyncArchiveFactory;
|
|
64
|
+
journalStorage(): AsyncJournalStorage;
|
|
65
|
+
boardWorkerStore(): AsyncBoardWorkerStore;
|
|
66
|
+
chatAgentStore(): AsyncBoardWorkerStore;
|
|
67
|
+
processAccumulatedStore(): AsyncQueueStorage;
|
|
68
|
+
lock: AsyncAtomicRelayLock;
|
|
69
|
+
callbackTransport?: BoardCallbackTransport;
|
|
70
|
+
dispatchExecution(ref: ExecutionRef, args: Record<string, unknown>): Promise<{
|
|
71
|
+
dispatched: boolean;
|
|
72
|
+
error?: string;
|
|
73
|
+
}>;
|
|
74
|
+
supportsDirectSourceOutput?(ref: ExecutionRef): boolean;
|
|
75
|
+
resolveBlob(ref: KindValueRef): Promise<string>;
|
|
76
|
+
hashFn(value: unknown): string;
|
|
77
|
+
genId(): string;
|
|
78
|
+
requestProcessAccumulated?(): void | Promise<void>;
|
|
79
|
+
publishBoardChangeNotifications?(notifications: BoardChangeNotification[]): void | Promise<void>;
|
|
80
|
+
warn?: (msg: string) => void;
|
|
81
|
+
}
|
|
82
|
+
interface HostedFetchResponseLike {
|
|
83
|
+
ok: boolean;
|
|
84
|
+
status: number;
|
|
85
|
+
text(): Promise<string>;
|
|
86
|
+
}
|
|
87
|
+
interface HostedFetchLike {
|
|
88
|
+
(input: string, init: {
|
|
89
|
+
method: string;
|
|
90
|
+
headers: Record<string, string>;
|
|
91
|
+
body: string;
|
|
92
|
+
}): Promise<HostedFetchResponseLike>;
|
|
93
|
+
}
|
|
94
|
+
interface HostedAsyncBoardPlatformAdapterOptions {
|
|
95
|
+
boardId?: string;
|
|
96
|
+
kvStorage(namespace: string): AsyncKVStorage;
|
|
97
|
+
kvStorageForRef(ref: string): AsyncKVStorage;
|
|
98
|
+
blobStorage(namespace: string): AsyncBlobStorage;
|
|
99
|
+
scratchStorage(): AsyncScratchStorage;
|
|
100
|
+
scratchStorageForRef(ref: string): AsyncScratchStorage;
|
|
101
|
+
archiveFactory(): AsyncArchiveFactory;
|
|
102
|
+
archiveFactoryForRef(ref: string): AsyncArchiveFactory;
|
|
103
|
+
journalStorage(): AsyncJournalStorage;
|
|
104
|
+
queueStorage?: AsyncQueueStorage;
|
|
105
|
+
boardWorkerStore?: AsyncBoardWorkerStore;
|
|
106
|
+
chatAgentQueueStorage?: AsyncQueueStorage;
|
|
107
|
+
chatAgentStore?: AsyncBoardWorkerStore;
|
|
108
|
+
processAccumulatedQueueStorage?: AsyncQueueStorage;
|
|
109
|
+
processAccumulatedStore?: AsyncQueueStorage;
|
|
110
|
+
lock: AsyncAtomicRelayLock;
|
|
111
|
+
callbackTransport?: BoardCallbackTransport;
|
|
112
|
+
fetch?: HostedFetchLike;
|
|
113
|
+
dispatchExecution?: (ref: ExecutionRef, args: Record<string, unknown>) => Promise<{
|
|
114
|
+
dispatched: boolean;
|
|
115
|
+
error?: string;
|
|
116
|
+
}>;
|
|
117
|
+
supportsDirectSourceOutput?: (ref: ExecutionRef) => boolean;
|
|
118
|
+
resolveBlob?: (ref: KindValueRef) => Promise<string>;
|
|
119
|
+
hashFn: (value: unknown) => string;
|
|
120
|
+
genId: () => string;
|
|
121
|
+
requestProcessAccumulated?: () => void | Promise<void>;
|
|
122
|
+
publishBoardChangeNotifications?: (notifications: BoardChangeNotification[]) => void | Promise<void>;
|
|
123
|
+
onWarn?: (msg: string) => void;
|
|
124
|
+
}
|
|
125
|
+
declare function createAsyncBoardWorkerStore(queue: AsyncQueueStorage): AsyncBoardWorkerStore;
|
|
126
|
+
declare function createAsyncBoardConfigStore(kv: AsyncKVStorage): AsyncBoardConfigStore;
|
|
127
|
+
declare function createHostedAsyncBoardPlatformAdapter(options: HostedAsyncBoardPlatformAdapterOptions): AsyncBoardPlatformAdapter;
|
|
128
|
+
|
|
129
|
+
export { type AsyncBoardPlatformAdapter as A, type HostedAsyncBoardPlatformAdapterOptions as H, type AsyncBoardConfigStore as a, type AsyncBoardWorkerDeadLetterRequest as b, type AsyncBoardWorkerLeasedRequest as c, type AsyncBoardWorkerQueuedRequest as d, type AsyncBoardWorkerRequest as e, type AsyncBoardWorkerStore as f, type HostedFetchLike as g, type HostedFetchResponseLike as h, createAsyncBoardConfigStore as i, createAsyncBoardWorkerStore as j, createHostedAsyncBoardPlatformAdapter as k };
|