yaml-flow 8.11.6 → 8.11.8
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/localstorage-storage.js +1 -1
- package/browser/asset-integrity.json +6 -6
- package/browser/board-sse-state.js +2 -0
- package/browser/live-cards.schema.json +4 -0
- package/browser/server-runtime-controlface.js +4 -4
- package/examples/board/cards/card-rebalance-sim.json +4 -1
- package/examples/board-container/board-container-lifecycle-example.js +67 -0
- package/lib/board-container-lifecycle-D5gz6kB1.d.cts +57 -0
- package/lib/board-container-lifecycle-D5gz6kB1.d.ts +57 -0
- package/lib/board-live-cards-mcp.cjs +1 -1
- package/lib/board-live-cards-mcp.js +1 -1
- package/lib/board-live-cards-node.cjs +8 -8
- package/lib/board-live-cards-node.d.cts +24 -9
- package/lib/board-live-cards-node.d.ts +24 -9
- package/lib/board-live-cards-node.js +8 -8
- package/lib/{board-live-cards-public-async-U98IXUBx.d.ts → board-live-cards-public-async-D72v-MTi.d.ts} +1 -1
- package/lib/{board-live-cards-public-async-Cl0M3j5P.d.cts → board-live-cards-public-async-DtgoCVRv.d.cts} +1 -1
- package/lib/board-live-cards-public.cjs +1 -1
- package/lib/board-live-cards-public.d.cts +4 -4
- package/lib/board-live-cards-public.d.ts +4 -4
- 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 +3 -3
- package/lib/board-live-cards-server-runtime.d.ts +3 -3
- 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-ByBRFn1G.d.ts → board-platform-adapter-async-CVvZYqNy.d.ts} +2 -2
- package/lib/{board-platform-adapter-async-DjBwE0m9.d.cts → board-platform-adapter-async-O7EUvJ3W.d.cts} +2 -2
- package/lib/card-compute/index.cjs +1 -1
- package/lib/card-compute/index.d.cts +6 -0
- package/lib/card-compute/index.d.ts +6 -0
- package/lib/card-compute/index.js +1 -1
- package/lib/card-store-public.cjs +1 -1
- package/lib/card-store-public.js +1 -1
- package/lib/card-validation.cjs +1 -1
- package/lib/card-validation.js +1 -1
- package/lib/{chunk-NOAERAOE.cjs → chunk-36KKCQVE.cjs} +2 -2
- package/lib/chunk-3DWVFRQD.cjs +3 -0
- package/lib/chunk-3SLSRX6Q.js +3 -0
- package/lib/{chunk-EHREWADE.js → chunk-4NWVZ7AW.js} +2 -2
- package/lib/chunk-543ZEGP7.cjs +2 -0
- package/lib/{chunk-YAPTL2MP.cjs → chunk-6SPWFJRG.cjs} +2 -2
- package/lib/chunk-73LKIKD3.cjs +2 -0
- package/lib/{chunk-7UJQMFVS.js → chunk-AN7MLI7X.js} +2 -2
- package/lib/{chunk-CODPG5MY.js → chunk-BA25VGJP.js} +3 -3
- package/lib/chunk-BRYV6CDD.js +3 -0
- package/lib/{chunk-WRMOGPRG.cjs → chunk-CSHNTZW4.cjs} +2 -2
- package/lib/chunk-EGZPROOH.cjs +3 -0
- package/lib/{chunk-GHUW6P4G.cjs → chunk-ESTFYRHF.cjs} +2 -2
- package/lib/chunk-F3A3ZNF6.js +2 -0
- package/lib/{chunk-52XPRCZC.cjs → chunk-HOS2ZUFZ.cjs} +2 -2
- package/lib/chunk-JOQWJ3VR.cjs +2 -0
- package/lib/chunk-MRESV3MD.js +2 -0
- package/lib/chunk-MRIFSG7L.cjs +3 -0
- package/lib/{chunk-6M3RIGUH.js → chunk-NN52BT3Q.js} +2 -2
- package/lib/{chunk-ZWXZ5DBX.cjs → chunk-OR6B2H2Y.cjs} +3 -3
- package/lib/{chunk-6MD6FVE3.js → chunk-PEJRTZU3.js} +2 -2
- package/lib/{chunk-I3ZOFU3F.js → chunk-PIPXFUEA.js} +2 -2
- package/lib/chunk-REZO2QJD.js +3 -0
- package/lib/{chunk-23PEDGFN.js → chunk-ROIYEFSE.js} +2 -2
- package/lib/{chunk-BQJVCCFU.cjs → chunk-U5BGE52X.cjs} +2 -2
- package/lib/chunk-UJQ7IML5.js +2 -0
- package/lib/chunk-YOY2JM5N.js +2 -0
- package/lib/chunk-ZV35WD6K.cjs +2 -0
- package/lib/cloud-storage.cjs +1 -1
- package/lib/cloud-storage.d.cts +2 -2
- package/lib/cloud-storage.d.ts +2 -2
- 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/firestore-storage/index.cjs +1 -1
- package/lib/firestore-storage/index.d.cts +1 -1
- package/lib/firestore-storage/index.d.ts +1 -1
- package/lib/firestore-storage/index.js +1 -1
- package/lib/index.cjs +2 -2
- package/lib/index.d.cts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/localstorage-storage/index.cjs +1 -1
- package/lib/localstorage-storage/index.d.cts +1 -1
- package/lib/localstorage-storage/index.d.ts +1 -1
- package/lib/localstorage-storage/index.js +1 -1
- package/lib/server-jobs-queue-runner/index.cjs +1 -1
- package/lib/server-jobs-queue-runner/index.d.cts +3 -3
- package/lib/server-jobs-queue-runner/index.d.ts +3 -3
- package/lib/server-jobs-queue-runner/index.js +1 -1
- package/lib/server-runtime/index.cjs +1 -1
- package/lib/server-runtime/index.d.cts +4 -4
- package/lib/server-runtime/index.d.ts +4 -4
- package/lib/server-runtime/index.js +1 -1
- package/lib/server-runtime-agentface/index.d.cts +3 -3
- package/lib/server-runtime-agentface/index.d.ts +3 -3
- package/lib/server-runtime-controlface/index.cjs +1 -1
- package/lib/server-runtime-controlface/index.d.cts +3 -3
- package/lib/server-runtime-controlface/index.d.ts +3 -3
- 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 +5 -5
- package/lib/server-runtime-core/index.d.ts +5 -5
- package/lib/server-runtime-core/index.js +1 -1
- package/lib/server-runtime-watchers/index.d.cts +5 -5
- package/lib/server-runtime-watchers/index.d.ts +5 -5
- package/lib/server-runtime-webhooks/index.d.cts +3 -3
- package/lib/server-runtime-webhooks/index.d.ts +3 -3
- package/lib/{sse-hub-D_QHswxL.d.ts → sse-hub-BGQWPQJP.d.ts} +1 -1
- package/lib/{sse-hub-XO6crN9o.d.cts → sse-hub-DViWG1m-.d.cts} +1 -1
- package/lib/{types-B8Yieskx.d.ts → types-D5rknZ9j.d.ts} +2 -2
- package/lib/{types-gTf9pAyC.d.cts → types-VIrQZ8CW.d.cts} +2 -2
- package/package.json +1 -1
- package/schema/live-cards.schema.json +4 -0
- package/lib/chunk-2LGCYN35.js +0 -2
- package/lib/chunk-5RUSICUC.cjs +0 -3
- package/lib/chunk-ATOQP3BD.js +0 -2
- package/lib/chunk-CPJXGK2T.cjs +0 -2
- package/lib/chunk-HOSD6UHA.js +0 -3
- package/lib/chunk-J7KE7SPA.cjs +0 -2
- package/lib/chunk-QBEQL4TL.cjs +0 -2
- package/lib/chunk-QEHKMLHA.cjs +0 -3
- package/lib/chunk-QKWQ4HRE.js +0 -3
- package/lib/chunk-WE7JOO4T.cjs +0 -3
- package/lib/chunk-WGYS2L4V.js +0 -2
- package/lib/chunk-YT76JNKE.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
var LocalStorageStorage=(function(exports){'use strict';var A="b64:";function fe(r){let t=new TextEncoder().encode(r),n=globalThis.Buffer,o;if(n)o=n.from(t).toString("base64");else if(typeof btoa=="function"){let e="";for(let s of t)e+=String.fromCharCode(s);o=btoa(e);}else throw new Error("No base64 encoder available in this runtime");return o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function ge(r){let t=r.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-r.length%4)%4),n=globalThis.Buffer;if(n)return n.from(t,"base64").toString("utf8");if(typeof atob=="function"){let o=atob(t),e=new Uint8Array(o.length);for(let s=0;s<o.length;s+=1)e[s]=o.charCodeAt(s);return new TextDecoder().decode(e)}throw new Error("No base64 decoder available in this runtime")}function h(r){return `${A}${fe(JSON.stringify(r))}`}function v(r){if(!r.startsWith(A))throw new Error(`Invalid ref format (expected ${A}<base64url(json)>): ${r}`);let t;try{t=JSON.parse(ge(r.slice(A.length)));}catch{throw new Error(`Invalid ref format (malformed base64url/json): ${r}`)}if(!t||typeof t!="object")throw new Error(`Invalid ref format (expected object payload): ${r}`);let n=t;if(typeof n.kind!="string"||typeof n.value!="string")throw new Error(`Invalid ref format (payload must contain string kind/value): ${r}`);return {kind:n.kind,value:n.value}}function B(r){return {messageId:r.id,enqueuedAt:r.enqueuedAt,attempt:r.attempt,request:r.body}}function Se(r){return typeof r=="string"?r.startsWith("b64:")?v(r).value:r:r.value}function K(r){return {async enqueueRequest(t){return (await r.enqueue(t)).id},async leaseRequests(t){return (await r.lease(t)).map(n=>({...B(n),leaseToken:n.leaseToken,leaseExpiresAt:n.leaseExpiresAt}))},ackRequest(t,n){return r.ack(t,n)},nackRequest(t,n,o){return r.nack(t,n,o)},async peekActive(){return (await r.peekActive()).map(B)},async peekDeadLetter(){return (await r.peekDeadLetter()).map(t=>({...B(t),reason:t.reason}))}}}function q(r){let t=r.callbackTransport,n=r.resolveBlob??(async e=>{let s=await r.blobStorage("").read(e.value);if(s==null)throw new Error(`Blob not found for ref ${e.kind}:${e.value}`);return s});async function o(e,s){if(e.howToRun==="queue-storage")return r.queueStoreRef?(await K(r.queueStorageForRef(r.queueStoreRef,"task-executor")).enqueueRequest({boardId:typeof e.extra?.boardId=="string"?e.extra.boardId:r.boardId,ref:e,args:s}),{dispatched:true}):{dispatched:false,error:"queue-storage dispatch requires queueStoreRef"};if(e.howToRun==="http:post"){let u=r.fetch??globalThis.fetch;if(!u)return {dispatched:false,error:"http:post dispatch requires fetch support"};let a=await u(Se(e.whatToRun),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...s,...e.extra?{extra:e.extra}:{}})});if(!a.ok){let c=await a.text().catch(()=>"");return {dispatched:false,error:`HTTP ${a.status}: ${c}`}}return {dispatched:true}}return {dispatched:false,error:`Unsupported hosted async transport "${e.howToRun}"`}}return {kvStorage:r.kvStorage,kvStorageForRef:r.kvStorageForRef,blobStorage:r.blobStorage,blobStorageForRef:r.blobStorageForRef,chatStorageForRef:r.chatStorageForRef,queueStorageForRef:r.queueStorageForRef,scratchStorage:r.scratchStorage,scratchStorageForRef:r.scratchStorageForRef,archiveFactory:r.archiveFactory,archiveFactoryForRef:r.archiveFactoryForRef,journalStorage:r.journalStorage,journalStorageForRef:r.journalStorageForRef,lock:r.lock,get callbackTransport(){return t},set callbackTransport(e){t=e;},dispatchExecution:(e,s)=>r.dispatchExecution?.(e,s)??o(e,s),supportsDirectSourceOutput:r.supportsDirectSourceOutput,resolveBlob:n,hashFn:r.hashFn,genId:r.genId,requestProcessAccumulated:r.requestProcessAccumulated,publishBoardChangeNotifications:r.publishBoardChangeNotifications,warn:r.onWarn}}function N(r){if(r==null||typeof r!="object")return JSON.stringify(r);if(Array.isArray(r))return `[${r.map(N).join(",")}]`;let t=r;return `{${Object.keys(t).sort().map(o=>`${JSON.stringify(o)}:${N(t[o])}`).join(",")}}`}function I(r,t){let n=t>>>0;for(let o=0;o<r.length;o++)n^=r.charCodeAt(o),n=Math.imul(n,16777619)>>>0;return n}function X(r){let t=N(r),n=I(t,2166136261),o=I(t,3735928559),e=I(t,19088743),s=I(t,4277009102);return [n,o,e,s].map(u=>u.toString(16).padStart(8,"0")).join("")}function _(r){function t(s){return `${r}:blob:${s}`}let n=new TextEncoder;function o(s){if(typeof btoa=="function"){let u="";for(let a=0;a<s.length;a++)u+=String.fromCharCode(s[a]);return btoa(u)}return ""}function e(s){if(typeof atob=="function"){let u=atob(s),a=new Uint8Array(u.length);for(let c=0;c<u.length;c++)a[c]=u.charCodeAt(c);return a}return new Uint8Array}return {read(s){return globalThis.localStorage.getItem(t(s))},write(s,u){globalThis.localStorage.setItem(t(s),u);},exists(s){return globalThis.localStorage.getItem(t(s))!==null},remove(s){globalThis.localStorage.removeItem(t(s));},readBytes(s){let u=globalThis.localStorage.getItem(t(s));if(u===null)return null;try{let a=JSON.parse(u);if(a&&a.__kind==="bytes-b64"&&typeof a.data=="string")return e(a.data)}catch{}return n.encode(u)},writeBytes(s,u){let a=JSON.stringify({__kind:"bytes-b64",data:o(u)});globalThis.localStorage.setItem(t(s),a);},listKeys(s){let u=t(s??""),a=[];for(let c=0;c<globalThis.localStorage.length;c++){let l=globalThis.localStorage.key(c);l&&l.startsWith(u)&&a.push(l.slice(t("").length));}return a.sort()},stat(s){let u=globalThis.localStorage.getItem(t(s));if(u===null)return null;let a=n.encode(u).byteLength;try{let c=JSON.parse(u);c&&c.__kind==="bytes-b64"&&typeof c.data=="string"&&(a=e(c.data).byteLength);}catch{}return {key:s,size:a}},renameKey(s,u){let a=globalThis.localStorage.getItem(t(s));return a===null?false:(globalThis.localStorage.setItem(t(u),a),globalThis.localStorage.removeItem(t(s)),true)}}}var Ge=":scratch-marker",Ue=":scratch-config",P=":scratch:",He=1440*60*1e3,Qe=720*60*1e3,ze=200;function z(r,t){if(!r)return t;let n=r.replace(/[^A-Za-z0-9._-]/g,"_");return n.length>0?n:t}function Z(r){let t=`${r}${Ge}`,n=`${r}${Ue}`,o=i=>`${r}${P}${i}`,e=i=>`${r}${P}${i}:__ts`,s=globalThis.localStorage.getItem(t)===null;if(s)try{globalThis.localStorage.setItem(t,`scratch-store
|
|
2
|
-
${new Date().toISOString()}`);}catch{}function u(){let i=globalThis.localStorage.getItem(n);if(i===null)return {};try{let d=JSON.parse(i);return d&&typeof d=="object"&&!Array.isArray(d)?d:{}}catch{return {}}}function a(i){try{globalThis.localStorage.setItem(n,JSON.stringify(i));}catch{}}if(s){let i=u();typeof i["retention.lastSweepAt"]!="number"&&(i["retention.lastSweepAt"]=Date.now(),a(i));}function c(){if(globalThis.localStorage.getItem(t)===null)return;let i=u(),d=typeof i["retention.maxAgeMs"]=="number"?i["retention.maxAgeMs"]:He,f=typeof i["retention.sweepIntervalMs"]=="number"?i["retention.sweepIntervalMs"]:Qe;if(d<=0||f<=0)return;let m=typeof i["retention.lastSweepAt"]=="number"?i["retention.lastSweepAt"]:0,p=Date.now();if(p-m<f)return;i["retention.lastSweepAt"]=p,a(i);let y=p,S=`${r}${P}`,k=[];for(let
|
|
2
|
+
${new Date().toISOString()}`);}catch{}function u(){let i=globalThis.localStorage.getItem(n);if(i===null)return {};try{let d=JSON.parse(i);return d&&typeof d=="object"&&!Array.isArray(d)?d:{}}catch{return {}}}function a(i){try{globalThis.localStorage.setItem(n,JSON.stringify(i));}catch{}}if(s){let i=u();typeof i["retention.lastSweepAt"]!="number"&&(i["retention.lastSweepAt"]=Date.now(),a(i));}function c(){if(globalThis.localStorage.getItem(t)===null)return;let i=u(),d=typeof i["retention.maxAgeMs"]=="number"?i["retention.maxAgeMs"]:He,f=typeof i["retention.sweepIntervalMs"]=="number"?i["retention.sweepIntervalMs"]:Qe;if(d<=0||f<=0)return;let m=typeof i["retention.lastSweepAt"]=="number"?i["retention.lastSweepAt"]:0,p=Date.now();if(p-m<f)return;i["retention.lastSweepAt"]=p,a(i);let y=p,S=`${r}${P}`,k=[];for(let b=0;b<globalThis.localStorage.length;b++){let C=globalThis.localStorage.key(b);C&&C.startsWith(S)&&!C.endsWith(":__ts")&&k.push(C);}for(let b of k){if(Date.now()-y>ze)break;let C=globalThis.localStorage.getItem(`${b}:__ts`),O=C===null?0:Number(C);if(Number.isFinite(O)&&O>0&&p-O>d){try{globalThis.localStorage.removeItem(b);}catch{}try{globalThis.localStorage.removeItem(`${b}:__ts`);}catch{}}}}function l(i,d){let f=z(i,"scratch"),m=z(d,".json"),p=m.startsWith(".")?m:`.${m}`,y=Math.random().toString(36).slice(2,10);return `${f}-${Date.now()}-${y}${p}`}function g(i,d){globalThis.localStorage.setItem(o(i),d),globalThis.localStorage.setItem(e(i),String(Date.now()));}return {read(i){return globalThis.localStorage.getItem(o(i))},write(i,d){g(i,d);try{c();}catch{}},exists(i){return globalThis.localStorage.getItem(o(i))!==null},remove(i){try{globalThis.localStorage.removeItem(o(i));}catch{}try{globalThis.localStorage.removeItem(e(i));}catch{}},readBytes(i){let d=globalThis.localStorage.getItem(o(i));return d===null?null:new TextEncoder().encode(d)},writeBytes(i,d){let f="";for(let m=0;m<d.length;m++)f+=String.fromCharCode(d[m]);g(i,f);try{c();}catch{}},stat(i){let d=globalThis.localStorage.getItem(o(i));if(d===null)return null;let f=globalThis.localStorage.getItem(e(i)),m=f===null?null:Number(f);return {key:i,size:new TextEncoder().encode(d).byteLength,updatedAt:m!==null&&Number.isFinite(m)?new Date(m).toISOString():void 0}},listKeys(i){let d=`${r}${P}`,f=[];for(let m=0;m<globalThis.localStorage.length;m++){let p=globalThis.localStorage.key(m);if(p&&p.startsWith(d)&&!p.endsWith(":__ts")){let y=p.slice(d.length);(!i||y.startsWith(i))&&f.push(y);}}return f.sort()},getUniqueKey(i,d){return l(i,d)},create(i,d,f){let m=l(d,f);g(m,i);try{c();}catch{}return m},keyRef(i){return {kind:"local-storage-scratch",value:i,extra:{prefix:r}}},renameKey(i,d){let f=globalThis.localStorage.getItem(o(i));if(f===null)return false;g(d,f);try{globalThis.localStorage.removeItem(o(i));}catch{}try{globalThis.localStorage.removeItem(e(i));}catch{}return true},config:{get(i){return u()[i]??null},set(i,d){let f=u();d==null?delete f[i]:f[i]=d,a(f);}}}}var We=":archive-marker",Ye=":archive-config",F=":archive:stream:",W=":archive:blob:";function Y(r){let t=r.replace(/[^A-Za-z0-9._-]/g,"_");if(!t)throw new Error("Archive segment name cannot be empty after sanitization");return t}function ee(r){let t=`${r}${We}`,n=`${r}${Ye}`,o=a=>`${r}${F}${a}`;if(globalThis.localStorage.getItem(t)===null)try{globalThis.localStorage.setItem(t,`archive-store
|
|
3
3
|
${new Date().toISOString()}`);}catch{}function e(){let a=globalThis.localStorage.getItem(n);if(a===null)return {};try{let c=JSON.parse(a);return c&&typeof c=="object"&&!Array.isArray(c)?c:{}}catch{return {}}}function s(a){try{globalThis.localStorage.setItem(n,JSON.stringify(a));}catch{}}function u(){if(globalThis.localStorage.getItem(t)===null)return;let a=e(),c=typeof a["retention.maxAgeMs"]=="number"?a["retention.maxAgeMs"]:0,l=typeof a["retention.sweepIntervalMs"]=="number"?a["retention.sweepIntervalMs"]:0;if(c<=0||l<=0)return;let g=typeof a["retention.lastSweepAt"]=="number"?a["retention.lastSweepAt"]:0,i=Date.now();if(i-g<l)return;a["retention.lastSweepAt"]=i,s(a);let d=`${r}${F}`;for(let f=0;f<globalThis.localStorage.length;f++){let m=globalThis.localStorage.key(f);if(!m||!m.startsWith(d))continue;let p=globalThis.localStorage.getItem(m);if(p)try{let y=JSON.parse(p),S=y.filter(k=>typeof k.__ts!="number"||i-k.__ts<=c);S.length!==y.length&&globalThis.localStorage.setItem(m,JSON.stringify(S));}catch{}}}return {stream(a){let c=Y(a),l=o(c);function g(){let d=globalThis.localStorage.getItem(l);if(!d)return [];try{return JSON.parse(d)}catch{return []}}function i(d){try{globalThis.localStorage.setItem(l,JSON.stringify(d));}catch{}}return {append(d){let f={id:globalThis.crypto.randomUUID(),payload:d,__ts:Date.now()},m=g();m.push(f),i(m);try{u();}catch{}return {id:f.id,payload:f.payload}},readAll(){return g().map(d=>({id:d.id,payload:d.payload}))},readAfter(d){let f=g();if(!d){let S=f.map(k=>({id:k.id,payload:k.payload}));return {entries:S,newCursor:S.length>0?S[S.length-1].id:null}}let m=f.findIndex(S=>S.id===d),y=(m===-1?f:f.slice(m+1)).map(S=>({id:S.id,payload:S.payload}));return {entries:y,newCursor:y.length>0?y[y.length-1].id:d}},clear(){try{globalThis.localStorage.removeItem(l);}catch{}}}},blob(a){let c=Y(a),l=_(`${r}${W}${c}`);return {read:g=>l.read(g),write:(g,i)=>{l.write(g,i);try{u();}catch{}},exists:g=>l.exists(g),remove:g=>l.remove(g),readBytes:l.readBytes?g=>l.readBytes(g):void 0,writeBytes:l.writeBytes?(g,i)=>{l.writeBytes(g,i);try{u();}catch{}}:void 0,listKeys:g=>l.listKeys(g),stat:l.stat?g=>l.stat(g):void 0,renameKey:(g,i)=>l.renameKey(g,i)}},listStreams(a){let c=`${r}${F}`,l=[];for(let g=0;g<globalThis.localStorage.length;g++){let i=globalThis.localStorage.key(g);if(!i||!i.startsWith(c))continue;let d=i.slice(c.length);(!a||d.startsWith(a))&&l.push(d);}return l.sort()},listBlobs(a){let c=`${r}${W}`,l=new Set;for(let g=0;g<globalThis.localStorage.length;g++){let i=globalThis.localStorage.key(g);if(!i||!i.startsWith(c))continue;let d=i.slice(c.length),f=d.indexOf(":"),m=f===-1?d:d.slice(0,f);(!a||m.startsWith(a))&&l.add(m);}return Array.from(l).sort()},config:{get(a){return e()[a]??null},set(a,c){let l=e();c==null?delete l[a]:l[a]=c,s(l);}}}}function te(r){function t(n){return `${r}:kv:${n}`}return {read(n){let o=globalThis.localStorage.getItem(t(n));if(o===null)return null;try{return JSON.parse(o)}catch{return null}},write(n,o){globalThis.localStorage.setItem(t(n),JSON.stringify(o));},delete(n){globalThis.localStorage.removeItem(t(n));},listKeys(n){let o=t(n??""),e=[];for(let s=0;s<globalThis.localStorage.length;s++){let u=globalThis.localStorage.key(s);u!==null&&u.startsWith(o)&&e.push(u.slice(t("").length));}return e}}}function re(r){function t(){let o=globalThis.localStorage.getItem(r);if(!o)return [];try{return JSON.parse(o)}catch{return []}}function n(o){globalThis.localStorage.setItem(r,JSON.stringify(o));}return {readAllEntries(){return t()},appendEntry(o){let e=t();e.push(o),n(e);},generateId(){return globalThis.crypto.randomUUID()}}}function ne(r){return String(r).replace(/[^a-zA-Z0-9_-]/g,"_")}function oe(r){let t=r.payload??{};return {id:r.id,role:typeof t.role=="string"?t.role:"system",text:typeof t.text=="string"?t.text:"",files:Array.isArray(t.files)?t.files:[],turn:typeof t.turn=="string"?t.turn:"",updated_at:typeof t.updated_at=="string"?t.updated_at:""}}function se(r,t){let n=e=>`chats/${ne(e)}/processing`,o=e=>`chats/${ne(e)}/config`;return {async append(e,s,u,a=[],c=""){return (await r(e).append({role:s,text:u,files:a,turn:c,updated_at:new Date().toISOString()})).id},async readAll(e){return (await r(e).readAll()).map(oe)},async readAfter(e,s){let u=await r(e).readAfter(s);return {records:u.entries.map(oe),cursor:u.newCursor}},async clear(e){await r(e).clear?.();},async setProcessing(e,s){s?await t.write(n(e),true):await t.delete(n(e));},async isProcessing(e){return await t.read(n(e))===true},async getConfig(e){return await t.read(o(e))??{}},async setConfig(e,s){let u=await t.read(o(e))??{};await t.write(o(e),{...u,...s});}}}function Xe(){let r=false;return {async tryAcquire(){return r?null:(r=true,()=>{r=false;})}}}function Ze(){let r=new Map,t=new Map,n=new Map;return {async enqueue(o){let e={id:globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,body:o,enqueuedAt:new Date().toISOString(),attempt:0};return r.set(e.id,e),e},async enqueueMany(o){let e=[];for(let s of o)e.push(await this.enqueue(s));return e},async enqueueIfAbsent(o,e){for(let u of r.values())if(u.dedupKey===e)return null;for(let u of t.values())if(u.dedupKey===e)return null;let s={id:globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,body:o,enqueuedAt:new Date().toISOString(),attempt:0,dedupKey:e};return r.set(s.id,s),s},async stage(o,e){let s=e?.dedupKey;if(s){for(let a of r.values())if(a.dedupKey===s)return null;for(let a of t.values())if(a.dedupKey===s)return null}let u={id:globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,body:o,enqueuedAt:new Date().toISOString(),attempt:0,...s?{dedupKey:s}:{}};return t.set(u.id,u),u},async commitStaged(o){let e=t.get(o);return e?(t.delete(o),r.set(o,{...e,enqueuedAt:new Date().toISOString(),attempt:0}),true):false},async discardStaged(o,e){let s=t.get(o);return s?(t.delete(o),n.set(o,{...s,reason:e}),true):false},async peekStaged(o=""){return Array.from(t.values()).filter(e=>!o||e.id.startsWith(o)).map(e=>({id:e.id,body:e.body,enqueuedAt:e.enqueuedAt,attempt:e.attempt}))},async lease(o){let e=Math.max(1,Math.floor(o?.max??1)),s=Math.max(1,Math.floor(o?.visibilityMs??6e4)),u=Date.now();for(let c of r.values())c.leaseExpiresAt&&Date.parse(c.leaseExpiresAt)<=u&&(delete c.leaseToken,delete c.leaseExpiresAt);let a=[];for(let c of r.values()){if(a.length>=e)break;c.leaseToken||(c.attempt+=1,c.leaseToken=globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random().toString(36).slice(2,10)}`,c.leaseExpiresAt=new Date(Date.now()+s).toISOString(),a.push({id:c.id,body:c.body,enqueuedAt:c.enqueuedAt,attempt:c.attempt,leaseToken:c.leaseToken,leaseExpiresAt:c.leaseExpiresAt}));}return a},async ack(o,e){let s=r.get(o);return !s||s.leaseToken!==e?false:(r.delete(o),true)},async nack(o,e,s){let u=r.get(o);return !u||u.leaseToken!==e?false:(delete u.leaseToken,delete u.leaseExpiresAt,s?.dead&&(r.delete(o),n.set(o,{...u,reason:s.reason})),true)},async peekActive(o=""){return Array.from(r.values()).filter(e=>!e.leaseToken).filter(e=>!o||e.id.startsWith(o)).map(e=>({id:e.id,body:e.body,enqueuedAt:e.enqueuedAt,attempt:e.attempt}))},async peekDeadLetter(o=""){return Array.from(n.values()).filter(e=>!o||e.id.startsWith(o)).map(e=>({id:e.id,body:e.body,enqueuedAt:e.enqueuedAt,attempt:e.attempt,reason:e.reason}))}}}function D(r){let t=te(r);return {async read(n){return t.read(n)},async write(n,o){t.write(n,o);},async delete(n){t.delete(n);},async listKeys(n){return t.listKeys(n)}}}function ae(r){let t=_(r);return {async read(n){return t.read(n)},async write(n,o){t.write(n,o);},async exists(n){return t.exists(n)},async remove(n){t.remove(n);},async readBytes(n){return t.readBytes?.(n)??null},async writeBytes(n,o){await t.writeBytes?.(n,o);},async listKeys(n){return t.listKeys(n)},async stat(n){return t.stat?.(n)??null},async renameKey(n,o){let e=await t.read(n);return e==null?false:(t.write(o,e),t.remove(n),true)}}}function ie(r){let t=Z(r);return {async read(n){return t.read(n)},async write(n,o){t.write(n,o);},async exists(n){return t.exists(n)},async remove(n){t.remove(n);},async readBytes(n){return t.readBytes?.(n)??null},async writeBytes(n,o){await t.writeBytes?.(n,o);},async listKeys(n){return t.listKeys(n)},async stat(n){return t.stat?.(n)??null},async getUniqueKey(n,o){return t.getUniqueKey(n,o)},async create(n,o,e){return t.create(n,o,e)},keyRef(n){return t.keyRef(n)},async renameKey(n,o){let e=t.read(n);return e==null?false:(t.write(o,e),t.remove(n),true)},config:{async get(n){return t.config.get(n)},async set(n,o){t.config.set(n,o);}}}}function L(r){let t=re(r);function n(o){return {id:o.id,payload:o.event}}return {async append(o){let e={id:t.generateId(),event:o};return t.appendEntry(e),n(e)},async readAll(){return t.readAllEntries().map(n)},async readAfter(o){let e=t.readAllEntries().map(n);if(!o)return {entries:e,newCursor:e.length>0?e[e.length-1].id:null};let s=e.findIndex(a=>a.id===o),u=s===-1?e:e.slice(s+1);return {entries:u,newCursor:u.length>0?u[u.length-1].id:o}}}}function ue(r){let t=ee(r);return {stream(n){let o=t.stream(n);return {async append(e){return o.append(e)},async readAll(){return o.readAll()},async readAfter(e){return o.readAfter(e)},async clear(){o.clear?.();}}},blob(n){let o=t.blob(n);return {async read(e){return o.read(e)},async write(e,s){o.write(e,s);},async exists(e){return o.exists(e)},async remove(e){o.remove(e);},async readBytes(e){return o.readBytes?.(e)??null},async writeBytes(e,s){await o.writeBytes?.(e,s);},async listKeys(e){return o.listKeys(e)},async stat(e){return o.stat?.(e)??null},async renameKey(e,s){let u=o.read(e);return u==null?false:(o.write(s,u),o.remove(e),true)}}},async listStreams(n){return t.listStreams(n)},async listBlobs(n){return t.listBlobs(n)},config:{async get(n){return t.config.get(n)},async set(n,o){t.config.set(n,o);}}}}function ce(r){return String(r||"").trim()}function et(r){return String(r).replace(/[^a-zA-Z0-9_-]/g,"_")}function de(r){return {kind:"local-storage",value:ce(r)}}function R(r){return h(de(r))}function le(r){let t=`boards:${r}`;return {baseRef:de(t),boardRuntimeStoreRef:R(`${t}:runtime-board`),cardStoreRef:R(`${t}:cards`),outputsStoreRef:R(`${t}:runtime-out`),queueStoreRef:R(`${t}:runtime`),scratchStoreRef:R(`${t}:scratch`),chatStoreRef:R(`${t}:chat`),artifactsStoreRef:R(`${t}:files`),fetchedSourcesStoreRef:R(`${t}:sources`)}}function w(r,t){try{let n=v(r);if(n?.kind==="local-storage"&&n.value)return ce(n.value)}catch{}return t}function tt(r,t={}){let n=le(r),o=new Map;return q({boardId:r,kvStorage(e){return D(`${n.baseRef.value}:${e||"root"}`)},kvStorageForRef(e){return D(w(e,`${n.baseRef.value}:root`))},blobStorage(e){return ae(e?`${n.baseRef.value}:${e}`:n.baseRef.value)},blobStorageForRef(e){return ae(w(e,n.baseRef.value))},chatStorageForRef(e){let s=w(e,`${n.baseRef.value}:chat`);return se(u=>L(`${s}:journal:${et(u)}`),D(s))},queueStoreRef:n.queueStoreRef,queueStorageForRef(e,s){let u=`${w(e,`${n.baseRef.value}:runtime`)}:queue:${s}`,a=o.get(u);return a||(a=Ze(),o.set(u,a)),a},scratchStorage(){return ie(`${n.baseRef.value}:scratch`)},scratchStorageForRef(e){return ie(w(e,`${n.baseRef.value}:scratch`))},archiveFactory(){return ue(`${n.baseRef.value}:archive`)},archiveFactoryForRef(e){return ue(w(e,`${n.baseRef.value}:archive`))},journalStorage(){return L(`${n.baseRef.value}:journal`)},journalStorageForRef(e){return L(`${w(e,`${n.baseRef.value}:runtime-board`)}:journal`)},lock:Xe(),resolveBlob:async e=>{let s=e?.kind==="local-storage"?e:null;if(!s?.value)throw new Error(`Unsupported localStorage ref: ${h(e)}`);let u=_(s.value),a=await Promise.resolve(u.read(""));if(a===null)throw new Error(`Blob not found: ${h(e)}`);try{let c=JSON.parse(a);if(c?.__kind==="bytes-b64"&&typeof c.data=="string"){let l=await Promise.resolve(u.readBytes?.(""));if(l)return new TextDecoder().decode(l)}}catch{}return a},hashFn:X,genId:()=>(globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random().toString(36).slice(2,10)}`).replace(/-/g,""),requestProcessAccumulated:t.requestProcessAccumulated,publishBoardChangeNotifications:t.publishBoardChangeNotifications,onWarn:e=>console.warn(`[localstorage-board-adapter:${r}] ${e}`)})}function oo(r,t={}){return {refs:{...le(r),...t.refs??{}},boardAdapter:tt(r,t)}}exports.createLocalStorageBoardAdapter=tt;exports.createLocalStorageBoardRefs=le;exports.createLocalStorageBoardRuntimeBundle=oo;exports.makeLocalStorageRef=de;exports.serializeLocalStorageRef=R;return exports;})({});//# sourceMappingURL=localstorage-storage.js.map
|
|
4
4
|
//# sourceMappingURL=localstorage-storage.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
"generatedAt": "2026-06-
|
|
2
|
+
"generatedAt": "2026-06-23T10:50:44.282Z",
|
|
3
3
|
"algorithm": "sha256",
|
|
4
4
|
"files": {
|
|
5
5
|
"browser/server-runtime-controlface.js": {
|
|
6
|
-
"sha256": "sha256-
|
|
7
|
-
"bytes":
|
|
6
|
+
"sha256": "sha256-JmRXr1hkpRxa8zmBR98ECFBbFIPZfwOAuEUchM2Es2I=",
|
|
7
|
+
"bytes": 191470
|
|
8
8
|
},
|
|
9
9
|
"browser/adapters/firestore-storage.js": {
|
|
10
10
|
"sha256": "sha256-dAP2RFjTHpzcEpvcixRvM139mcUc9Lg1W6T9/CwaRvA=",
|
|
11
11
|
"bytes": 17562
|
|
12
12
|
},
|
|
13
13
|
"browser/adapters/localstorage-storage.js": {
|
|
14
|
-
"sha256": "sha256-
|
|
14
|
+
"sha256": "sha256-ieCOIqBFozOLd2evr2mOe3yRE9w5m4mDYDxwBDFPxow=",
|
|
15
15
|
"bytes": 22195
|
|
16
16
|
},
|
|
17
17
|
"browser/adapters/firebase-storage.js": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"bytes": 4872
|
|
20
20
|
},
|
|
21
21
|
"browser/live-cards.schema.json": {
|
|
22
|
-
"sha256": "sha256-
|
|
23
|
-
"bytes":
|
|
22
|
+
"sha256": "sha256-PfMjxafr5Oh84hAPutBckBjtcDWu/aKv3TJmv0xSQtU=",
|
|
23
|
+
"bytes": 17804
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var BoardSseState=(function(exports){'use strict';function A(t){if(!t||typeof t!="object")return false;let r=t;return r.kind==="notification-batch"&&Array.isArray(r.notifications)}function w(t){let r=t.category??x(t.kind);return r==="board-output"||r==="card-store"}function B(t){let r=t.category??x(t.kind);return r==="chat-store"||r==="hosted-runtime"}function x(t){switch(t){case "computed_values":case "data_object":case "status":return "board-output";case "card_refreshed":case "card_removed":return "card-store";case "card_chats":case "chat_messages":return "chat-store";case "chat_processing":case "card_watchparty":return "hosted-runtime";case "message_enqueued":return "queue-storage"}}function W(t){if(!t||typeof t!="object")return false;let r=t;return typeof r.kind=="string"&&r.kind.length>0&&r.kind!=="notification-batch"}function D(t){return A(t)?t.notifications:W(t)?[t]:[]}function R(t){return JSON.parse(JSON.stringify(t))}function C(t,r){if(t===r)return true;try{return JSON.stringify(t)===JSON.stringify(r)}catch{return false}}function E(t){return t==="running"||t==="in-progress"?"loading":t==="failed"?"error":"fresh"}function j(t,r,u,s){if(!t||!Array.isArray(r)||r.length===0)return t;let n=t.modelsById,g=t.cardIds,h=t.cardWatchParties||{},m=t.pendingComputedValues||{},_=false,l=false,b={};for(let a of g){let i=n[a],e=i&&i.requires;if(e&&typeof e=="object")for(let o of Object.keys(e))(b[o]=b[o]||[]).push(a);}function y(){_||(n={...n},_=true);}function k(a){if(a.kind!=="card_watchparty"||!a.cardId||!a.channel)return;let i=h[a.cardId]||{},e=Array.isArray(i[a.channel])?i[a.channel]:[],o=e;if(a.clear){if(e.length===0)return;o=[];}else if(a.replace){let c=Number.isFinite(Number(a.sentAtMs))?Number(a.sentAtMs):0,p={payload:a.payload,ts:c};if(e.length===1&&e[0]?.ts===p.ts&&C(e[0]?.payload,p.payload))return;o=[p];}else {let c={payload:a.payload,ts:Number.isFinite(Number(a.sentAtMs))?Number(a.sentAtMs):0};o=[...e,c];}h={...h,[a.cardId]:{...i,[a.channel]:o}},l=true;}for(let a of r)if(!(!a||!a.kind)){if(a.kind==="card_watchparty"){k(a);continue}if(B(a)){if(a.kind==="card_chats"){let i=a.cardId,e=n[i];if(!e)continue;let o=Array.isArray(a.messages)?a.messages:e.card_chats?.messages??[],c=typeof a.receiving=="boolean"?a.receiving:e.card_chats?.receiving??false,p=typeof a.processing=="boolean"?a.processing:e.card_chats?.processing??false,d={messages:o,receiving:c,processing:p};if(C(e.card_chats,d))continue;y(),n[i]={...e,card_chats:d},l=true;}else if(a.kind==="chat_messages"){let i=a.cardId,e=n[i];if(!e)continue;let o=Array.isArray(a.messages)?a.messages:[],c=e.card_chats||{receiving:false,processing:false},p={messages:o,receiving:c.receiving,processing:!!c.processing};if(C(e.card_chats,p))continue;y(),n[i]={...e,card_chats:p},l=true;}else if(a.kind==="chat_processing"){let i=a.cardId,e=n[i];if(!e)continue;let o=e.card_chats||{messages:[],receiving:false},c={messages:o.messages,receiving:o.receiving,processing:a.active===true};if(C(e.card_chats,c))continue;y(),n[i]={...e,card_chats:c},l=true;}continue}if(w(a)){if(a.kind==="computed_values"){let i=a.cardId,e=n[i],o=a.values||{};if(!e){let c=m[i];if(C(c,o))continue;m={...m,[i]:R(o)},l=true;continue}if(C(e.computed_values,o))continue;y(),n[i]={...e,computed_values:o},l=true;}else if(a.kind==="data_object"){let i=a.key,e=a.payload,o=b[i]||[];for(let c of o){let p=n[c];if(!p)continue;let d=p.requires||{};C(d[i],e)||(y(),n[c]={...p,requires:{...d,[i]:e}},l=true);}}else if(a.kind==="card_refreshed"){let i=a.cardId,e=null,o=n[i],c=a.card;if(o&&c&&typeof c=="object"&&!Array.isArray(c)){let d=c,v=d.card_data&&typeof d.card_data=="object"&&!Array.isArray(d.card_data)?d.card_data:o.card_data,P=d.requires&&typeof d.requires=="object"&&!Array.isArray(d.requires)?d.requires:o.requires,q=d.computed_values&&typeof d.computed_values=="object"&&!Array.isArray(d.computed_values)?d.computed_values:o.computed_values,V=d.runtime_state&&typeof d.runtime_state=="object"&&!Array.isArray(d.runtime_state)?d.runtime_state:o.runtime_state;e={...o,card:c,card_data:v,requires:P,computed_values:q,runtime_state:V};}if(!e)try{let d=s();d&&(e=u(d,i));}catch{}if(!e)continue;let p=m[i];if(p!==void 0&&!C(e.computed_values,p)&&(e={...e,computed_values:R(p)}),o&&C(o.card,e.card)&&C(o.card_data,e.card_data)&&C(o.requires,e.requires)&&C(o.computed_values,e.computed_values)&&C(o.runtime_state,e.runtime_state))continue;y(),n[i]=e,g.includes(i)||(g=[...g,i]),Object.prototype.hasOwnProperty.call(m,i)&&(m={...m},delete m[i]),l=true;}else if(a.kind==="card_removed"){let i=a.cardId;if(!n[i])continue;if(y(),delete n[i],g=g.filter(e=>e!==i),Object.prototype.hasOwnProperty.call(h,i)){let e={...h};delete e[i],h=e;}Object.prototype.hasOwnProperty.call(m,i)&&(m={...m},delete m[i]),l=true;}else if(a.kind==="status"){let i=a.status?.cards??[];for(let e of i){let o=e?.name;if(!o||!n[o])continue;let c=n[o],p=E(e.status),d={...c.card_data||{},status:p,lastRun:e.runtime?.last_transition_at??null,...e.error?.message?{error:e.error.message}:{}};e.error?.message||delete d.error;let v={task_status:e.status??null,card_status:p,runtime:e.runtime?R(e.runtime):{},error:e.error?R(e.error):null,blocked_by:Array.isArray(e.blocked_by)?R(e.blocked_by):[],requires_missing:Array.isArray(e.requires_missing)?R(e.requires_missing):[]};C(c.card_data,d)&&C(c.runtime_state,v)||(y(),n[o]={...c,card_data:d,runtime_state:v},l=true);}}}}return l?{payload:t.payload,cardIds:g,modelsById:n,cardWatchParties:h,pendingComputedValues:m}:t}var f=Object.freeze({}),N=Object.freeze([]);function T(t=null){return {boardInfo:{boardId:t,boardInfo:null},boardStatus:{summary:null,cardRuntimesById:f},boardDataObjects:f,boardCardComputedValues:f,cardDefinitionsAndData:f,cardChatViews:f,cardWatchParties:f}}function I(t=null){return t?{messages:t?.messages??N,processing:!!t?.processing,receiving:!!t?.receiving}:{messages:N,processing:false,receiving:false}}function O({chatState:t=null}={}){return {chatState:t??I()}}function S(t){return Array.isArray(t)?t.filter(Boolean).map(String):N}function F(t,r){let u=new Map;for(let s of t?.cards??[]){let n=typeof s?.name=="string"?s.name.trim():"";!n||u.has(n)||u.set(n,{id:n,meta:{title:n},requires:S(s?.requires),provides:S(s?.provides_declared??s?.provides_runtime),source_defs:N,card_data:f});}for(let s of Object.keys(r??f)){let n=typeof s=="string"?s.trim():"";!n||u.has(n)||u.set(n,{id:n,meta:{title:n},requires:N,provides:N,source_defs:N,card_data:f});}return [...u.values()]}function J(t,r){let u={};for(let n of r?.cards??[])u[n.name]=n;let s={};for(let n of t){let g=u[n.id]??{};s[n.id]={status:g.status??"",runtime:g.runtime??f};}return {summary:r?.summary??null,cardRuntimesById:s}}function L(t,r){return Object.fromEntries(t.map(u=>[u.id,r?.[u.id]?.computed_values??f]))}function z(t){return Object.fromEntries(t.map(r=>[r.id,{cardContent:r,cardData:r?.card_data??f}]))}function H(t,r){let u={},s=new Set([...Object.keys(r??f),...Object.keys(t??f)]);for(let n of s){let g=t?.[n]??null;u[n]=O({chatState:I(g)});}return u}function Q(t,r=null){let u=Array.isArray(t.cardDefinitions)&&t.cardDefinitions.length>0?t.cardDefinitions:F(t.statusSnapshot,t.cardRuntimeById),s=z(u);return {boardInfo:{boardId:t.boardId??null,boardInfo:t.boardInfo??null},boardStatus:J(u,t.statusSnapshot),boardDataObjects:t.dataObjectsByToken??f,boardCardComputedValues:L(u,t.cardRuntimeById),cardDefinitionsAndData:s,cardChatViews:H(t.cardChatsByCardId,s),cardWatchParties:r?.cardWatchParties??f}}function M(t,r){let u=t?.cardDefinitionsAndData?.[r]??null,s=t?.boardStatus?.cardRuntimesById?.[r]??null,n=t?.boardCardComputedValues?.[r]??f,g=u?.cardContent??null,h={};for(let m of S(g?.requires))h[m]=Object.prototype.hasOwnProperty.call(t?.boardDataObjects??f,m)?t.boardDataObjects[m]:null;return {id:r,card:g,card_data:u?.cardData??f,requires:h,computed_values:n,runtime_state:{task_status:s?.status??null,runtime:s?.runtime??f},card_chats:t?.cardChatViews?.[r]?.chatState??null}}function Y(t){let r=Object.keys(t?.cardDefinitionsAndData??f),u=Object.fromEntries(r.map(s=>[s,M(t,s)]));return {payload:t,cardIds:r,modelsById:u,cardWatchParties:t?.cardWatchParties??f}}function K(t,r,u,s){let n={},g={},h={},m={};for(let _ of r.cardIds){let l=r.modelsById[_];if(!l)continue;let b=t?.cardDefinitionsAndData?.[_]??null,y=l.card??b?.cardContent??null,k=l.card_data??f;n[_]=b&&b.cardContent===y&&b.cardData===k?b:{cardContent:y,cardData:k};let a=t?.boardCardComputedValues?.[_]??f,i=l.computed_values??f;g[_]=a===i?a:i;let e=t?.cardChatViews?.[_]??null,o=l.card_chats??I();h[_]=e&&e.chatState===o?e:O({chatState:o});let c=t?.boardStatus?.cardRuntimesById?.[_]??{status:"",runtime:f},p=l.runtime_state?.runtime??c.runtime,d=l.runtime_state?.task_status??c.status;m[_]=c.status===d&&c.runtime===p?c:{status:d,runtime:p};}return {...t,boardStatus:{summary:s,cardRuntimesById:m},boardDataObjects:u,boardCardComputedValues:g,cardDefinitionsAndData:n,cardChatViews:h,cardWatchParties:r.cardWatchParties??f}}function rt(t,r){if(Array.isArray(r?.cardDefinitions))return Q(r,t);let u=D(r);if(u.length===0)return t;let s=t??T(),n=s.boardDataObjects??f,g=s.boardStatus?.summary??null,h=[];for(let y of u)y.kind==="data_object"&&y.key?(n===(t?.boardDataObjects??f)&&(n={...n}),n[y.key]=y.payload):y.kind==="status"&&y.status&&"summary"in y.status&&(g=y.status.summary??null),h.push(y);let m=Y(s),_=h.length>0?j(m,h,(y,k)=>M(y,k),()=>s):m,l=K(s,_,n,g);return !(l.boardStatus!==s.boardStatus||l.boardDataObjects!==s.boardDataObjects||l.boardCardComputedValues!==s.boardCardComputedValues||l.cardDefinitionsAndData!==s.cardDefinitionsAndData||l.cardChatViews!==s.cardChatViews||l.cardWatchParties!==s.cardWatchParties)&&t?t:l}exports.EMPTY_ARRAY=N;exports.EMPTY_OBJECT=f;exports.applyBoardSseFrame=rt;exports.createEmptyBoardSnapshot=T;return exports;})({});//# sourceMappingURL=board-sse-state.js.map
|
|
2
|
+
//# sourceMappingURL=board-sse-state.js.map
|