yaml-flow 8.5.3 → 8.6.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/asset-integrity.json +3 -3
- package/examples/board/demo-shell-with-server.html +2 -2
- package/examples/board/doc.html +2 -2
- package/examples/board/server/board-server.js +266 -5
- package/examples/board/server/board-worker/task-executor.js +166 -51
- package/examples/board/server/chat-flow/copilot-chat/assistant.js +25 -12
- package/examples/board/server/chat-flow/copilot-chat/probe.js +7 -0
- package/examples/board/server/chat-flow/copilot-chat/shared.js +97 -0
- package/examples/board/server/chat-flow/flow-steps.json +109 -51
- package/examples/board/server-config.json +1 -0
- package/examples/board/test/server-http-test.js +870 -67
- package/examples/board-local/demo-shell-localstorage.html +3 -3
- package/lib/{artifacts-store-lib-D-k-E8Vy.d.ts → artifacts-store-lib-C1rtrkxm.d.ts} +1 -1
- package/lib/{artifacts-store-lib-CVgtQrNZ.d.cts → artifacts-store-lib-CLOtsiav.d.cts} +1 -1
- package/lib/artifacts-store-public.cjs +1 -1
- package/lib/artifacts-store-public.d.cts +3 -3
- package/lib/artifacts-store-public.d.ts +3 -3
- package/lib/artifacts-store-public.js +1 -1
- package/lib/batch/index.cjs +1 -1
- package/lib/batch/index.js +1 -1
- package/lib/board-live-cards-mcp.cjs +1 -1
- package/lib/board-live-cards-mcp.d.cts +35 -15
- package/lib/board-live-cards-mcp.d.ts +35 -15
- package/lib/board-live-cards-mcp.js +1 -1
- package/lib/board-live-cards-node.cjs +8 -16
- package/lib/board-live-cards-node.d.cts +32 -12
- package/lib/board-live-cards-node.d.ts +32 -12
- package/lib/board-live-cards-node.js +8 -16
- package/lib/{board-live-cards-public-BGS22cMb.d.ts → board-live-cards-public-CBVjm327.d.ts} +59 -24
- package/lib/{board-live-cards-public-B13InXhC.d.cts → board-live-cards-public-CPJy-aGW.d.cts} +59 -24
- package/lib/board-live-cards-public.cjs +1 -2
- package/lib/board-live-cards-public.d.cts +2 -2
- package/lib/board-live-cards-public.d.ts +2 -2
- package/lib/board-live-cards-public.js +1 -2
- package/lib/board-live-cards-server-runtime.cjs +1 -7
- package/lib/board-live-cards-server-runtime.d.cts +5 -5
- package/lib/board-live-cards-server-runtime.d.ts +5 -5
- package/lib/board-live-cards-server-runtime.js +1 -7
- package/lib/board-livegraph-runtime/index.cjs +1 -2
- package/lib/board-livegraph-runtime/index.js +1 -2
- package/lib/board-worker-adapter.cjs +21 -7
- package/lib/board-worker-adapter.d.cts +17 -2
- package/lib/board-worker-adapter.d.ts +17 -2
- package/lib/board-worker-adapter.js +21 -7
- package/lib/card-compute/index.cjs +1 -9
- package/lib/card-compute/index.js +1 -9
- package/lib/card-store-public.cjs +1 -1
- package/lib/card-store-public.d.cts +2 -2
- package/lib/card-store-public.d.ts +2 -2
- package/lib/card-store-public.js +1 -1
- package/lib/card-validation.cjs +1 -9
- package/lib/card-validation.js +1 -9
- package/lib/{chat-storage-lib-CJn7a6OH.d.ts → chat-storage-lib-Bce-xx6l.d.ts} +1 -1
- package/lib/{chat-storage-lib-0imhRX3l.d.cts → chat-storage-lib-CKylihjm.d.cts} +1 -1
- package/lib/chat-store-public.cjs +1 -1
- package/lib/chat-store-public.d.cts +3 -3
- package/lib/chat-store-public.d.ts +3 -3
- package/lib/chat-store-public.js +1 -1
- package/lib/chunk-2MZUYY65.cjs +2 -0
- package/lib/chunk-5DB54ZX2.cjs +2 -0
- package/lib/chunk-5EA2ESS4.cjs +16 -0
- package/lib/chunk-6APH25VI.js +2 -0
- package/lib/chunk-76ON3V7R.js +2 -0
- package/lib/chunk-7BKNHFNH.js +2 -0
- package/lib/chunk-CWREBRXS.js +3 -0
- package/lib/chunk-DAXACY63.js +2 -0
- package/lib/chunk-FW4363Y4.js +2 -0
- package/lib/chunk-FZ2SBU5M.js +3 -0
- package/lib/chunk-G4XXRHL2.cjs +3 -0
- package/lib/chunk-GNFE24S7.cjs +2 -0
- package/lib/chunk-GYQXDNNI.cjs +2 -0
- package/lib/chunk-H5KD3JPY.cjs +2 -0
- package/lib/chunk-HLJH7LGW.js +16 -0
- package/lib/chunk-I4WH5U5D.cjs +2 -0
- package/lib/chunk-IXZG74EW.cjs +2 -0
- package/lib/chunk-JAL25FGA.cjs +2 -0
- package/lib/chunk-JM5EKT57.js +2 -0
- package/lib/chunk-JMDHDY6M.js +2 -0
- package/lib/chunk-KBELAKIY.js +2 -0
- package/lib/chunk-KHJABJ45.cjs +3 -0
- package/lib/chunk-KLRUISRY.cjs +2 -0
- package/lib/chunk-KNFFDVLD.cjs +2 -0
- package/lib/chunk-LBMEVV4U.js +2 -0
- package/lib/chunk-LDAP75GN.js +2 -0
- package/lib/chunk-LODXIALE.cjs +2 -0
- package/lib/chunk-LVNQCE5X.cjs +3 -0
- package/lib/chunk-M7EQRS6W.js +3 -0
- package/lib/chunk-MNEOJWPS.js +10 -0
- package/lib/chunk-NJJ7WEDT.cjs +2 -0
- package/lib/chunk-NMZ6XNLB.cjs +3 -0
- package/lib/chunk-OPNGCSXJ.js +2 -0
- package/lib/chunk-P64UKI3L.cjs +8 -0
- package/lib/chunk-P7ZCDICS.cjs +2 -0
- package/lib/chunk-Q6H7NINN.cjs +5 -0
- package/lib/chunk-Q6VSL327.js +8 -0
- package/lib/chunk-QWBNDVUA.js +5 -0
- package/lib/chunk-S6DRP2HX.cjs +2 -0
- package/lib/chunk-UJ7ZTV4J.cjs +10 -0
- package/lib/chunk-UVE65IPR.cjs +3 -0
- package/lib/chunk-VCCTAUIG.js +2 -0
- package/lib/chunk-VGT3TRQG.js +3 -0
- package/lib/chunk-VLBB3D6B.js +3 -0
- package/lib/chunk-WDPOGXTY.js +2 -0
- package/lib/chunk-X3LC4LII.js +2 -0
- package/lib/chunk-YGKDQLYP.js +2 -0
- package/lib/chunk-YMEIPKLW.cjs +2 -0
- package/lib/config/index.cjs +1 -1
- package/lib/config/index.js +1 -1
- package/lib/continuous-event-graph/index.cjs +1 -2
- package/lib/continuous-event-graph/index.js +1 -2
- package/lib/event-graph/index.cjs +1 -22
- package/lib/event-graph/index.js +1 -22
- package/lib/execution-refs.cjs +1 -2
- package/lib/execution-refs.d.cts +3 -2
- package/lib/execution-refs.d.ts +3 -2
- package/lib/execution-refs.js +1 -2
- package/lib/index.cjs +2 -24
- package/lib/index.d.cts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -24
- package/lib/server-runtime/index.cjs +1 -7
- package/lib/server-runtime/index.d.cts +6 -6
- package/lib/server-runtime/index.d.ts +6 -6
- package/lib/server-runtime/index.js +1 -7
- package/lib/step-machine/index.cjs +1 -11
- package/lib/step-machine/index.js +1 -11
- package/lib/step-machine-public/index.cjs +1 -4
- package/lib/step-machine-public/index.d.cts +1 -1
- package/lib/step-machine-public/index.d.ts +1 -1
- package/lib/step-machine-public/index.js +1 -4
- package/lib/{storage-interface-B2WD9D5n.d.cts → storage-interface-Ct-C4tlz.d.cts} +28 -1
- package/lib/{storage-interface-B2WD9D5n.d.ts → storage-interface-Ct-C4tlz.d.ts} +28 -1
- package/lib/stores/index.cjs +1 -2
- package/lib/stores/index.d.cts +1 -1
- package/lib/stores/index.d.ts +1 -1
- package/lib/stores/index.js +1 -2
- package/lib/stores/kv.cjs +1 -2
- package/lib/stores/kv.d.cts +1 -1
- package/lib/stores/kv.d.ts +1 -1
- package/lib/stores/kv.js +1 -2
- package/lib/stores/memory.cjs +1 -1
- package/lib/stores/memory.js +1 -1
- package/lib/{types-30R357js.d.ts → types-BuK2UMxk.d.ts} +4 -4
- package/lib/{types-CIgsh56O.d.cts → types-DRl0Hy_p.d.cts} +4 -4
- package/package.json +2 -16
- package/cli/board-live-cards-lib-COi4bSpk.d.ts +0 -322
- package/cli/browser-api/board-live-cards-browser-adapter.d.ts +0 -36
- package/cli/browser-api/board-live-cards-browser-adapter.js +0 -4
- package/cli/browser-api/card-store-browser-api.d.ts +0 -25
- package/cli/browser-api/card-store-browser-api.js +0 -2
- package/cli/browser-api/jsonata-sync.cjs +0 -7623
- package/cli/bundled/artifacts-store-cli.mjs +0 -12
- package/cli/bundled/batch-runner-cli.mjs +0 -3
- package/cli/bundled/board-live-cards-cli.mjs +0 -29
- package/cli/bundled/card-store-cli.mjs +0 -154
- package/cli/bundled/chat-store-cli.mjs +0 -16
- package/cli/bundled/jsonata-sync.cjs +0 -7623
- package/cli/bundled/step-machine-cli.mjs +0 -150
- package/cli/execution-interface-BCIhu1gO.d.ts +0 -442
- package/cli/types-H3EMBPY2.d.ts +0 -398
- package/examples/board/server/README-mcp-api.md +0 -690
- package/examples/board/test/server-http-mcp-test.js +0 -1280
- package/lib/board-livegraph-runtime/jsonata-sync.cjs +0 -7623
- package/lib/card-compute/jsonata-sync.cjs +0 -7623
- package/lib/continuous-event-graph/jsonata-sync.cjs +0 -7623
- package/lib/server-runtime/jsonata-sync.cjs +0 -7623
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
<title>Example Board Demo (LocalStorage Runtime)</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="../../browser/favicon.svg" />
|
|
8
8
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
|
|
9
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.
|
|
9
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.6.1/browser/compute-jsonata.js"></script>
|
|
10
10
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
11
11
|
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
|
12
12
|
<script src="https://cdn.jsdelivr.net/npm/dompurify/dist/purify.min.js"></script>
|
|
13
13
|
<script src="https://cdn.jsdelivr.net/npm/leader-line/leader-line.min.js"></script>
|
|
14
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.
|
|
15
|
-
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.
|
|
14
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.6.1/browser/live-cards.js"></script>
|
|
15
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.6.1/browser/board-livecards-localstorage.js"></script>
|
|
16
16
|
</head>
|
|
17
17
|
<body class="bg-light">
|
|
18
18
|
<div class="container-fluid py-3">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';var chunkP7ZCDICS_cjs=require('./chunk-P7ZCDICS.cjs');require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"createArtifactsStorePublic",{enumerable:true,get:function(){return chunkP7ZCDICS_cjs.a}});//# sourceMappingURL=artifacts-store-public.cjs.map
|
|
2
2
|
//# sourceMappingURL=artifacts-store-public.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as CommandInput, C as CommandResult } from './board-live-cards-public-
|
|
2
|
-
import { A as ArtifactInfo, a as ArtifactsStore } from './artifacts-store-lib-
|
|
3
|
-
import './storage-interface-
|
|
1
|
+
import { a as CommandInput, C as CommandResult } from './board-live-cards-public-CPJy-aGW.cjs';
|
|
2
|
+
import { A as ArtifactInfo, a as ArtifactsStore } from './artifacts-store-lib-CLOtsiav.cjs';
|
|
3
|
+
import './storage-interface-Ct-C4tlz.cjs';
|
|
4
4
|
import './execution-refs.cjs';
|
|
5
5
|
import './types-BBhqYGhE.cjs';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as CommandInput, C as CommandResult } from './board-live-cards-public-
|
|
2
|
-
import { A as ArtifactInfo, a as ArtifactsStore } from './artifacts-store-lib-
|
|
3
|
-
import './storage-interface-
|
|
1
|
+
import { a as CommandInput, C as CommandResult } from './board-live-cards-public-CBVjm327.js';
|
|
2
|
+
import { A as ArtifactInfo, a as ArtifactsStore } from './artifacts-store-lib-C1rtrkxm.js';
|
|
3
|
+
import './storage-interface-Ct-C4tlz.js';
|
|
4
4
|
import './execution-refs.js';
|
|
5
5
|
import './types-BBhqYGhE.js';
|
|
6
6
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export{a as createArtifactsStorePublic}from'./chunk-X3LC4LII.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=artifacts-store-public.js.map
|
|
2
2
|
//# sourceMappingURL=artifacts-store-public.js.map
|
package/lib/batch/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';var chunkKLRUISRY_cjs=require('../chunk-KLRUISRY.cjs');require('../chunk-GNFE24S7.cjs');Object.defineProperty(exports,"batch",{enumerable:true,get:function(){return chunkKLRUISRY_cjs.a}});//# sourceMappingURL=index.cjs.map
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/lib/batch/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
export{a as batch}from'../chunk-7BKNHFNH.js';import'../chunk-FW4363Y4.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var module$1=require('module');require('ajv-formats');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;var ae=module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('board-live-cards-mcp.cjs', document.baseURI).href)));ae("./jsonata-sync.cjs");var de=module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('board-live-cards-mcp.cjs', document.baseURI).href))),B=de("./jsonata-sync.cjs"),K=B;function D(e,r){if(!r||!e)return;let s=r.split("."),t=e;for(let a=0;a<s.length;a++){if(t==null)return;t=t[s[a]];}return t}function z(e,r,s){let t=r.split("."),a=e;for(let c=0;c<t.length-1;c++)(a[t[c]]==null||typeof a[t[c]]!="object")&&(a[t[c]]={}),a=a[t[c]];a[t[t.length-1]]=s;}async function ce(e,r){if(!e?.compute?.length)return e;e.card_data||(e.card_data={}),e.computed_values={},e._sourcesData=r?.sourcesData??{};let s=e.requires??{},t={card_data:e.card_data,requires:s,expects_data:s,fetched_sources:e._sourcesData,data:e.computed_values,computed_values:e.computed_values};for(let a of e.compute)try{let c=await B(a.expr).evaluate(t);z(e.computed_values,a.bindTo,c),t.computed_values=e.computed_values;}catch{}return e}function ue(e,r){if(!e?.compute?.length)return {ok:true,node:e};e.card_data||(e.card_data={}),e.computed_values={},e._sourcesData=r?.sourcesData??{};let s=e.requires??{},t={card_data:e.card_data,requires:s,expects_data:s,fetched_sources:e._sourcesData,data:e.computed_values,computed_values:e.computed_values},a=[];for(let c of e.compute)try{let l=K(c.expr).evaluate(t);z(e.computed_values,c.bindTo,l),t.computed_values=e.computed_values;}catch(l){let g=l instanceof Error?l.message:String(l);a.push({bindTo:c.bindTo,error:g});}return a.length>0?{ok:true,node:e,errors:a}:{ok:true,node:e}}async function pe(e,r,s){let t={...s??{},card_data:r.card_data??{},requires:r.requires??{},fetched_sources:r._sourcesData??{},computed_values:r.computed_values??{}};return B(e).evaluate(t)}function le(e,r){return r.startsWith("fetched_sources.")?D(e._sourcesData??{},r.slice(16)):D(e,r)}var V=new Set(["metric","table","editable-table","chart","form","filter","list","notes","todo","alert","narrative","badge","text","markdown","ref","custom","actions"]),fe=new Set(["id","meta","requires","provides","view","card_data","compute","source_defs"]);function me(e){let r=[];if(!e||typeof e!="object"||Array.isArray(e))return {ok:false,errors:["Node must be a non-null object"]};let s=e;(typeof s.id!="string"||!s.id)&&r.push("id: required, must be a non-empty string");for(let t of Object.keys(s))fe.has(t)||r.push(`Unknown top-level key: "${t}"`);if((s.card_data==null||typeof s.card_data!="object"||Array.isArray(s.card_data))&&r.push("card_data: required, must be an object"),s.meta!=null)if(typeof s.meta!="object"||Array.isArray(s.meta))r.push("meta: must be an object");else {let t=s.meta;t.title!=null&&typeof t.title!="string"&&r.push("meta.title: must be a string"),t.tags!=null&&!Array.isArray(t.tags)&&r.push("meta.tags: must be an array");}if(s.requires!=null&&!Array.isArray(s.requires)&&r.push("requires: must be an array of strings"),s.provides!=null&&(Array.isArray(s.provides)?s.provides.forEach((t,a)=>{if(!t||typeof t!="object"||Array.isArray(t))r.push(`provides[${a}]: must be an object with bindTo and ref`);else {let c=t;(typeof c.bindTo!="string"||!c.bindTo)&&r.push(`provides[${a}]: missing required "bindTo" string`),(typeof c.ref!="string"||!c.ref)&&r.push(`provides[${a}]: missing required "ref" string`);}}):r.push("provides: must be an array of { bindTo, ref } bindings")),s.compute!=null&&(Array.isArray(s.compute)?s.compute.forEach((t,a)=>{if(!t||typeof t!="object"||Array.isArray(t))r.push(`compute[${a}]: must be a compute step object`);else {let c=t;(typeof c.bindTo!="string"||!c.bindTo)&&r.push(`compute[${a}]: missing required "bindTo" property`),(typeof c.expr!="string"||!c.expr)&&r.push(`compute[${a}]: missing required "expr" string (JSONata expression)`);}}):r.push("compute: must be an array of compute steps")),s.source_defs!=null)if(!Array.isArray(s.source_defs))r.push("source_defs: must be an array");else {let t=new Set,a=new Set;s.source_defs.forEach((c,l)=>{if(!c||typeof c!="object"||Array.isArray(c))r.push(`source_defs[${l}]: must be an object`);else {let g=c;typeof g.bindTo!="string"||!g.bindTo?r.push(`source_defs[${l}]: missing required "bindTo" property`):(t.has(g.bindTo)&&r.push(`source_defs[${l}]: bindTo "${g.bindTo}" is not unique across source_defs`),t.add(g.bindTo)),typeof g.outputFile!="string"||!g.outputFile?r.push(`source_defs[${l}]: missing required "outputFile" property`):(a.has(g.outputFile)&&r.push(`source_defs[${l}]: outputFile "${g.outputFile}" is not unique across source_defs`),a.add(g.outputFile)),g.optionalForCompletionGating!=null&&typeof g.optionalForCompletionGating!="boolean"&&r.push(`source_defs[${l}]: optionalForCompletionGating must be a boolean`);}});}if(s.view!=null)if(typeof s.view!="object"||Array.isArray(s.view))r.push("view: must be an object");else {let t=s.view;!Array.isArray(t.elements)||t.elements.length===0?r.push("view.elements: required, must be a non-empty array"):t.elements.forEach((a,c)=>{if(!a||typeof a!="object"){r.push(`view.elements[${c}]: must be an object`);return}!a.kind||typeof a.kind!="string"?r.push(`view.elements[${c}].kind: required, must be a string`):V.has(a.kind)||r.push(`view.elements[${c}].kind: unknown kind "${a.kind}". Valid: ${[...V].join(", ")}`),a.data!=null&&(typeof a.data!="object"||Array.isArray(a.data))&&r.push(`view.elements[${c}].data: must be an object`);}),t.layout!=null&&(typeof t.layout!="object"||Array.isArray(t.layout))&&r.push("view.layout: must be an object"),t.features!=null&&(typeof t.features!="object"||Array.isArray(t.features))&&r.push("view.features: must be an object");}return {ok:r.length===0,errors:r}}async function ge(e,r){if(!e||e.length===0)return [];let s={card_data:r.card_data??{},requires:r.requires??{}};return Promise.all(e.map(async t=>{let a={};if(t.projections&&typeof t.projections=="object"&&!Array.isArray(t.projections)){for(let[c,l]of Object.entries(t.projections))if(typeof l=="string"&&l.trim().length>0)try{a[c]=await B(l).evaluate(s);}catch{a[c]=void 0;}}return {...t,_projections:a}}))}function ye(e,r){if(!e||e.length===0)return [];let s={card_data:r.card_data??{},requires:r.requires??{}};return e.map(t=>{let a={};if(t.projections&&typeof t.projections=="object"&&!Array.isArray(t.projections)){for(let[c,l]of Object.entries(t.projections))if(typeof l=="string"&&l.trim().length>0)try{a[c]=K(l).evaluate(s);}catch{a[c]=void 0;}}return {...t,_projections:a}})}var W={run:ce,runSync:ue,eval:pe,resolve:le,validate:me,enrichSources:ge,enrichSourcesSync:ye};function k(e,r){if(e?.status==="success")return Object.prototype.hasOwnProperty.call(e,"data")?e.data:void 0;throw e?.status==="fail"||e?.status==="error"?new Error(e.error||`${r} failed`):new Error(`${r} returned an unexpected response`)}function we(e,r){if(e?.status==="success"&&Object.prototype.hasOwnProperty.call(e,"data"))return e.data;throw e?.status==="success"?new Error(`${r} returned success without data`):e?.status==="fail"||e?.status==="error"?new Error(e.error||`${r} failed`):new Error(`${r} returned an unexpected response`)}function d(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function b(e){return Array.isArray(e)?e:[]}function N(e,r){if(typeof r!="string"||r.length===0)return;let s=e,t=r;t.startsWith("fetched_sources.")&&(s=d(e).fetched_sources,t=t.slice(16));for(let a of t.split(".")){if(s==null||typeof s!="object")return;s=s[a];}return s}function O(e,r){let s=d(e.view),t=b(s.elements);return {layout:s.layout,features:s.features,elements:t.map((a,c)=>{let l=d(a),g=d(l.data),j=typeof l.visible=="string"?!!N(r,l.visible):true,I=typeof g.bind=="string"?g.bind:void 0,x=typeof g.maxRows=="number"?g.maxRows:void 0,q=I?N(r,I):void 0,U={id:typeof l.id=="string"&&l.id?l.id:`element-${c}`,kind:l.kind,label:l.label,visible:j};return q!==void 0&&(U.resolved=Array.isArray(q)&&typeof x=="number"?q.slice(0,x):q),U})}}function J(e,r){let s=typeof e.id=="string"&&e.id?e.id:"card",t=b(e.provides),a=t.length>0?t:[{bindTo:s,ref:"card_data"}],c={};for(let l of a){let g=d(l),j=typeof g.bindTo=="string"?g.bindTo:"",I=typeof g.ref=="string"?g.ref:"";if(!j||!I)continue;let x=N(r,I);x!==void 0&&(c[j]=x);}return c}function be(e){if(typeof e!="string"||!e.trim())return null;let r=/^(file uploaded|AI generated|AI geneterated):\s*.*?#(\d+)\s*$/i.exec(e.trim());if(!r)return null;let s=Number.parseInt(r[2],10);return !Number.isInteger(s)||s<0?null:s}function Ce(e){return {"card-content":e}}function $(e,r){let s=k(e.get({params:{id:r}}),"cardStore.get"),t=Array.isArray(s?.cards)?s.cards:[];if(t.length===0)throw new Error(`Card "${r}" not found`);return t[0]}function $e(e){let{board:r,nonCore:s,cardStore:t,chatStore:a,uploadCardFile:c,buildFileDownloadUrl:l,readFetchedSourceJsonByRef:g}=e;function j(n){if(Array.isArray(n.bytes))return new Uint8Array(n.bytes.map(o=>Math.max(0,Math.min(255,Number(o)||0))));if(typeof n.text=="string")return new TextEncoder().encode(n.text);if(typeof n.base64=="string"){let o=String(n.base64).replace(/-/g,"+").replace(/_/g,"/"),i=o+"=".repeat((4-o.length%4)%4),m=atob(i);return Uint8Array.from(m,u=>u.charCodeAt(0))}throw new Error("file entry requires bytes, text, or base64")}function I(){let n=d(k(s.describeTaskExecutorCapabilities({}),"describeTaskExecutorCapabilities"));return {version:n.version,commonSourceFields:d(n.commonSourceDefFields),sourceKinds:d(n.sourceKinds)}}function x(){let n=d(k(r.status({}),"status")),o=d(n.summary),i=b(n.cards);return {meta:d(n.meta),summary:{card_count:typeof o.card_count=="number"?o.card_count:0,completed:typeof o.completed=="number"?o.completed:0,eligible:typeof o.eligible=="number"?o.eligible:0,pending:typeof o.pending=="number"?o.pending:0,blocked:typeof o.blocked=="number"?o.blocked:0,in_progress:typeof o.in_progress=="number"?o.in_progress:0,failed:typeof o.failed=="number"?o.failed:0,unresolved:typeof o.unresolved=="number"?o.unresolved:0},cards:i.map(m=>{let u=d(m);return {"card-id":typeof u.name=="string"?u.name:null,status:u.status??null,error:u.error??null,requires:b(u.requires),requires_satisfied:b(u.requires_satisfied),requires_missing:b(u.requires_missing),provides_declared:b(u.provides_declared),provides_runtime:b(u.provides_runtime)}})}}function q(n){let o=String(n.cardId||"").trim();if(!o)throw new Error("inspectCardDefinitionAndRuntime requires cardId");let i=d(k(r.status({}),"status")),u=b(i.cards).map(d).find(f=>f.name===o);if(!u)throw new Error(`card "${o}" not found in board status`);let p=d($(t,o)),y=b(u.requires_satisfied).filter(f=>typeof f=="string"&&!!f),_=b(u.provides_runtime).filter(f=>typeof f=="string"&&!!f),C=Object.fromEntries(y.map(f=>[f,k(r.getOutputsDataObject({params:{key:f}}),`getOutputsDataObject(${f})`)])),R=Object.fromEntries(_.map(f=>[f,k(r.getOutputsDataObject({params:{key:f}}),`getOutputsDataObject(${f})`)])),v=d(k(r.getOutputsComputedValues({params:{key:o}}),"getOutputsComputedValues")),A=k(r.getOutputsFetchedSources({params:{key:o}}),"getOutputsFetchedSources"),h=b(p.source_defs).map(d),S={};for(let f of h)typeof f.bindTo=="string"&&typeof f.outputFile=="string"&&(S[f.outputFile]=f.bindTo);let w={};for(let[f,E]of Object.entries(A)){let M=S[f]??f;if(!g||typeof E!="string"){w[M]=null;continue}try{w[M]=g({cardId:o,ref:E});}catch{w[M]=null;}}let T={card_data:d(p.card_data),requires:C,fetched_sources:w,computed_values:v};return {cardId:o,card_status_in_board:u,card_definition_and_static_data:p,refs_for_fetched_source_files:A,runtime_data:{requires:C,provides:R,computed_values:v,rendered_view:O(p,T)}}}function U(n){let o=String(n.cardId||"").trim();if(!o)throw new Error("inspectChatMessagesOnCards requires cardId");let i=typeof n.turnId=="string"?n.turnId:"",m=n.allTurns===true,u=typeof n.tailTurnsBeforeId=="string"?n.tailTurnsBeforeId:"",p=m?void 0:n.lastUserTurns??(i?void 0:1),y=n.tail,_={...p===void 0?{}:{tailTurns:p},...i?{turnId:i}:{},...m?{allTurns:true}:{},...u?{tailTurnsBeforeId:u}:{}},C=Object.keys(_).length>0?{params:{cardId:o},body:_}:{params:{cardId:o}},R=k(a.readAll(C),"chatStore.readAll"),v=d($(t,o)),A=b(d(v.card_data).files).map((w,T)=>({idx:T,stored_name:d(w).stored_name})).filter(w=>typeof w.stored_name=="string"&&w.stored_name.length>0),S=(Array.isArray(R.records)?R.records:[]).map(w=>{let f=d(w.payload),E={...w},M=typeof w?.role=="string"?w.role:typeof f.role=="string"?String(f.role):"",oe=typeof w?.text=="string"?w.text:typeof f.text=="string"?String(f.text):"";if(M==="system"){let F=be(oe);if(F!==null&&A.some(L=>L.idx===F)){let L=`Retrieve using inspect-file-contents --card-id ${o} --file-idx ${F}`;E.retrieval_hint=L,Object.keys(f).length>0&&typeof w.role!="string"&&(E.payload={...f,retrieval_hint:L});}}return E});return {cardId:o,messages:typeof y=="number"&&y>=0?S.slice(-y):S}}function G(n){let o=String(n.cardId||"").trim(),i=Number(n.fileIdx);if(!o)throw new Error("inspectFileContents requires cardId");if(!Number.isInteger(i)||i<0)throw new Error("inspectFileContents requires fileIdx to be a non-negative integer");let m=d($(t,o)),u=b(d(m.card_data).files).map(d);if(i>=u.length)throw new Error(`attachment index ${i} is out of range for card "${o}"`);let p=u[i],y=typeof p.stored_name=="string"?p.stored_name:null;return {cardId:o,fileIdx:i,downloadUrl:l({cardId:o,fileIdx:i,storedName:y}),...typeof p.name=="string"?{name:p.name}:{},...typeof p.stored_name=="string"?{stored_name:p.stored_name}:{},...typeof p.mime_type=="string"?{mime_type:p.mime_type}:{},...typeof p.size=="number"?{size:p.size}:{},...typeof p.uploaded_at=="string"?{uploaded_at:p.uploaded_at}:{}}}function P(n){return s.validateCardPreflight({body:Ce(n.candidateCardContent)})}function H(n){if(!n.mockRequires||typeof n.mockRequires!="object"||Array.isArray(n.mockRequires))throw new Error("preflightMaterializeCandidateCard requires mockRequires");if(!n.mockFetchedSources||typeof n.mockFetchedSources!="object"||Array.isArray(n.mockFetchedSources))throw new Error("preflightMaterializeCandidateCard requires mockFetchedSources");let o=s.evalCardCompute({body:{"card-content":n.candidateCardContent,"mock-requires":n.mockRequires,"mock-fetched-sources":n.mockFetchedSources}});if(o.status!=="success")return o;let i=d(we(o,"evalCardCompute")),m=d(n.candidateCardContent),u={card_data:d(m.card_data),requires:d(n.mockRequires),fetched_sources:d(n.mockFetchedSources),computed_values:d(i.computed_values)};return {status:"success",data:{cardId:typeof i.cardId=="string"?i.cardId:typeof m.id=="string"?m.id:"(unknown)",ok:i.ok===true,computed_values:d(i.computed_values),errors:b(i.errors).map(p=>{let y=d(p);return {bindTo:typeof y.bindTo=="string"?y.bindTo:"",error:typeof y.error=="string"?y.error:""}}),provides_outputs:J(m,u),rendered_view:O(m,u)}}}function Y(n){return s.probeSourcePreflight({params:{sourceIdx:n.sourceIdx},body:{"card-content":n.candidateCardContent,"mock-projections":n.mockProjections}})}function Q(n){return s.runSourcePreflight({params:{sourceIdx:n.sourceIdx},body:{"card-content":n.candidateCardContent,"mock-projections":n.mockProjections}})}function X(n){let o=String(n.cardId||"").trim();if(!o)throw new Error("preflightRunSingleSourceInLiveCard requires cardId");if(!n.mockRequires||typeof n.mockRequires!="object"||Array.isArray(n.mockRequires))throw new Error("preflightRunSingleSourceInLiveCard requires mockRequires");let i=d($(t,o)),m=b(i.source_defs).filter(p=>!!p&&typeof p=="object"&&!Array.isArray(p)),u={};if(n.sourceIdx>=0&&n.sourceIdx<m.length){let p=m[n.sourceIdx],y=W.enrichSourcesSync([p],{card_data:d(i.card_data),requires:n.mockRequires});Array.isArray(y)&&y.length>0&&(u=d(y[0]._projections));}return s.runSourcePreflight({params:{sourceIdx:n.sourceIdx},body:{"card-content":i,"mock-requires":n.mockRequires,"mock-projections":u}})}function Z(n){let o=d(k(s.simulateCardCycle({body:{"card-content":n.candidateCardContent,"mock-requires":n.mockRequires}}),"simulateCardCycle")),i=d(n.candidateCardContent),m=d(o.validation),u=b(o.source_probes),p=b(o.projection_errors),y=d(o.fetched_sources),_=b(o.compute_errors),C=d(o.computed_values),R={card_data:d(i.card_data),requires:n.mockRequires,fetched_sources:y,computed_values:C},v=[];for(let A of b(m.issues))typeof A=="string"&&A&&v.push(A);for(let A of u){let h=d(A),S=typeof h.bindTo=="string"?h.bindTo:"source",w=typeof h.error=="string"?h.error:"";w&&v.push(`${S}: ${w}`);}for(let A of p){let h=d(A),S=typeof h.bindTo=="string"?h.bindTo:"source",w=typeof h.key=="string"?h.key:"projection",T=typeof h.error=="string"?h.error:"projection failed";v.push(`${S}.${w}: ${T}`);}for(let A of _){let h=d(A),S=typeof h.bindTo=="string"?h.bindTo:"compute",w=typeof h.error=="string"?h.error:"compute failed";v.push(`${S}: ${w}`);}return {status:"success",data:{cardId:typeof o.cardId=="string"?o.cardId:"(unknown)",ok:o.ok===true,issues:v,provides_outputs:J(i,R),rendered_view:O(i,R)}}}function ee(n){let o=String(n.cardId||"").trim();if(!o)throw new Error("manageReadCard requires cardId");let i=k(t.get({params:{id:o}}),"cardStore.get");return Array.isArray(i.cards)?i.cards:[]}function re(n){let o=String(n.cardId||"").trim(),i=String(n.role||"").trim(),m=typeof n.text=="string"?n.text:"",u=typeof n.turn=="string"?n.turn:"";if(!o)throw new Error("manageAddChatEntryAndAnyAttachments requires cardId");if(!i)throw new Error("manageAddChatEntryAndAnyAttachments requires role");let p=b(n.files).map(_=>{let C=d(_),R=String(C.file_name??C.fileName??C.name??"").trim(),v=String(C.content_type??C.contentType??"application/octet-stream");if(!R)throw new Error("file entry requires file_name");return c({cardId:o,fileName:R,contentType:v,bytes:j(C)}).file});p.forEach((_,C)=>{let R=i==="assistant"?`AI generated: ${String(_.name||"")} as ${String(_.stored_name||"")} #${C}`:`file uploaded: ${String(_.name||"")} as ${String(_.stored_name||"")} #${C}`;k(a.append({params:{cardId:o},body:{role:"system",text:R,files:[],turn:u}}),"chatStore.append(system attachment message)");});let y=k(a.append({params:{cardId:o},body:{role:i,text:m,files:p,turn:u}}),"chatStore.append");return {status:"success",data:{cardId:o,id:String(y.id),role:i,turn:u,files:p}}}function te(n){let o=String(n.cardId||"").trim(),i=d(n.candidateCardContent);if(!o)throw new Error("manageUpsertCard requires cardId");if(typeof i.id!="string"||!i.id.trim())throw new Error("candidateCardContent.id must be a non-empty string");if(i.id!==o)throw new Error(`candidateCardContent.id must match cardId (${o})`);let m=P({candidateCardContent:i}),u=d(m),p=d(u.data);if(u.status!=="success"||p.isValid!==true)return {status:"fail",step:"validate",validation:m};let y=null;try{y=$(t,o);}catch{y=null;}let _=t.set({body:i});k(_,"cardStore.set");let C;try{C=r.upsertCard({params:{cardId:o,restart:!0}}),k(C,"upsertCard");}catch(v){try{y&&t.set({body:y});}catch{}throw v}let R=null;try{R=r.cardRefreshedNotify({params:{cardId:o}}),k(R,"cardRefreshedNotify");}catch{R=null;}return {status:"success",data:{validation:m,card_saved:null,board_result:C,refresh_notify:R}}}function ne(n){let o=String(n.cardId||"").trim();if(!o)throw new Error("manageRemoveCard requires cardId");let i=r.removeCard({params:{id:o}});k(i,"removeCard");let m=t.del({params:{id:o}});return k(m,"cardStore.del"),{status:"success",data:{board_result:i,store_result:m}}}return {discoverSourceKinds:I,inspectBoardRuntimeStatus:x,inspectCardDefinitionAndRuntime:q,inspectChatMessagesOnCards:U,inspectFileContents:G,preflightValidateCandidateCardDefinition:P,preflightMaterializeCandidateCard:H,preflightProbeSingleSourceInCandidateCard:Y,preflightRunSingleSourceInCandidateCard:Q,preflightRunSingleSourceInLiveCard:X,preflightRunOneCycleWithCandidateCard:Z,manageReadCard:ee,manageAddChatEntryAndAnyAttachments:re,manageUpsertCard:te,manageRemoveCard:ne}}exports.createBoardLiveCardsMcp=$e;//# sourceMappingURL=board-live-cards-mcp.cjs.map
|
|
1
|
+
'use strict';var chunkKNFFDVLD_cjs=require('./chunk-KNFFDVLD.cjs');require('./chunk-IXZG74EW.cjs'),require('./chunk-NMZ6XNLB.cjs'),require('./chunk-UJ7ZTV4J.cjs'),require('./chunk-GNFE24S7.cjs');Object.defineProperty(exports,"createBoardLiveCardsMcp",{enumerable:true,get:function(){return chunkKNFFDVLD_cjs.a}});//# sourceMappingURL=board-live-cards-mcp.cjs.map
|
|
2
2
|
//# sourceMappingURL=board-live-cards-mcp.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as CommandResult, L as LiveCard } from './board-live-cards-public-
|
|
1
|
+
import { C as CommandResult, L as LiveCard } from './board-live-cards-public-CPJy-aGW.cjs';
|
|
2
2
|
import { CardStorePublic } from './card-store-public.cjs';
|
|
3
3
|
import { ChatStorePublic } from './chat-store-public.cjs';
|
|
4
|
-
import { C as ChatRecord } from './chat-storage-lib-
|
|
5
|
-
import './storage-interface-
|
|
4
|
+
import { C as ChatRecord } from './chat-storage-lib-CKylihjm.cjs';
|
|
5
|
+
import './storage-interface-Ct-C4tlz.cjs';
|
|
6
6
|
import './execution-refs.cjs';
|
|
7
7
|
import './types-BBhqYGhE.cjs';
|
|
8
8
|
|
|
@@ -173,10 +173,10 @@ interface BoardLiveCardsMcpBoardDeps {
|
|
|
173
173
|
}): CommandResult;
|
|
174
174
|
}
|
|
175
175
|
interface BoardLiveCardsMcpNonCoreDeps {
|
|
176
|
-
describeTaskExecutorCapabilities(input: {}): CommandResult
|
|
176
|
+
describeTaskExecutorCapabilities(input: {}): Promise<CommandResult>;
|
|
177
177
|
validateCardPreflight(input: {
|
|
178
178
|
body: unknown;
|
|
179
|
-
}): CommandResult
|
|
179
|
+
}): Promise<CommandResult>;
|
|
180
180
|
evalCardCompute(input: {
|
|
181
181
|
body: unknown;
|
|
182
182
|
}): CommandResult<{
|
|
@@ -193,16 +193,16 @@ interface BoardLiveCardsMcpNonCoreDeps {
|
|
|
193
193
|
sourceIdx: number;
|
|
194
194
|
};
|
|
195
195
|
body: unknown;
|
|
196
|
-
}): CommandResult
|
|
196
|
+
}): Promise<CommandResult>;
|
|
197
197
|
runSourcePreflight(input: {
|
|
198
198
|
params: {
|
|
199
199
|
sourceIdx: number;
|
|
200
200
|
};
|
|
201
201
|
body: unknown;
|
|
202
|
-
}): CommandResult
|
|
202
|
+
}): Promise<CommandResult>;
|
|
203
203
|
simulateCardCycle(input: {
|
|
204
204
|
body: unknown;
|
|
205
|
-
}): CommandResult
|
|
205
|
+
}): Promise<CommandResult>;
|
|
206
206
|
}
|
|
207
207
|
interface BoardLiveCardsMcpDeps {
|
|
208
208
|
board: BoardLiveCardsMcpBoardDeps;
|
|
@@ -229,7 +229,7 @@ interface BoardLiveCardsMcpDeps {
|
|
|
229
229
|
}): unknown | null;
|
|
230
230
|
}
|
|
231
231
|
interface BoardLiveCardsMcp {
|
|
232
|
-
discoverSourceKinds(): BoardLiveCardsMcpDiscoverSourceKindsResult
|
|
232
|
+
discoverSourceKinds(): Promise<BoardLiveCardsMcpDiscoverSourceKindsResult>;
|
|
233
233
|
inspectBoardRuntimeStatus(): BoardLiveCardsMcpBoardStatusResult;
|
|
234
234
|
inspectCardDefinitionAndRuntime(args: {
|
|
235
235
|
cardId: string;
|
|
@@ -248,7 +248,7 @@ interface BoardLiveCardsMcp {
|
|
|
248
248
|
}): BoardLiveCardsMcpFileDownloadDescriptor;
|
|
249
249
|
preflightValidateCandidateCardDefinition(args: {
|
|
250
250
|
candidateCardContent: UnknownRecord;
|
|
251
|
-
}): unknown
|
|
251
|
+
}): Promise<unknown>;
|
|
252
252
|
preflightMaterializeCandidateCard(args: {
|
|
253
253
|
candidateCardContent: UnknownRecord;
|
|
254
254
|
mockRequires: UnknownRecord;
|
|
@@ -258,21 +258,21 @@ interface BoardLiveCardsMcp {
|
|
|
258
258
|
candidateCardContent: UnknownRecord;
|
|
259
259
|
mockProjections: UnknownRecord;
|
|
260
260
|
sourceIdx: number;
|
|
261
|
-
}): unknown
|
|
261
|
+
}): Promise<unknown>;
|
|
262
262
|
preflightRunSingleSourceInCandidateCard(args: {
|
|
263
263
|
candidateCardContent: UnknownRecord;
|
|
264
264
|
mockProjections: UnknownRecord;
|
|
265
265
|
sourceIdx: number;
|
|
266
|
-
}): unknown
|
|
266
|
+
}): Promise<unknown>;
|
|
267
267
|
preflightRunSingleSourceInLiveCard(args: {
|
|
268
268
|
cardId: string;
|
|
269
269
|
sourceIdx: number;
|
|
270
270
|
mockRequires: UnknownRecord;
|
|
271
|
-
}): unknown
|
|
271
|
+
}): Promise<unknown>;
|
|
272
272
|
preflightRunOneCycleWithCandidateCard(args: {
|
|
273
273
|
candidateCardContent: UnknownRecord;
|
|
274
274
|
mockRequires: UnknownRecord;
|
|
275
|
-
}): BoardLiveCardsMcpPreflightRunOneCycleResult
|
|
275
|
+
}): Promise<BoardLiveCardsMcpPreflightRunOneCycleResult>;
|
|
276
276
|
manageReadCard(args: {
|
|
277
277
|
cardId: string;
|
|
278
278
|
}): LiveCard[];
|
|
@@ -286,10 +286,30 @@ interface BoardLiveCardsMcp {
|
|
|
286
286
|
manageUpsertCard(args: {
|
|
287
287
|
cardId: string;
|
|
288
288
|
candidateCardContent: UnknownRecord;
|
|
289
|
-
}): BoardLiveCardsMcpManageUpsertCardResult
|
|
289
|
+
}): Promise<BoardLiveCardsMcpManageUpsertCardResult>;
|
|
290
290
|
manageRemoveCard(args: {
|
|
291
291
|
cardId: string;
|
|
292
292
|
}): unknown;
|
|
293
|
+
adminReadCard(args: {
|
|
294
|
+
cardId: string;
|
|
295
|
+
}): LiveCard[];
|
|
296
|
+
adminUpsertCard(args: {
|
|
297
|
+
cardId: string;
|
|
298
|
+
candidateCardContent: UnknownRecord;
|
|
299
|
+
}): Promise<BoardLiveCardsMcpManageUpsertCardResult>;
|
|
300
|
+
getChatProcessing(args: {
|
|
301
|
+
cardId: string;
|
|
302
|
+
}): {
|
|
303
|
+
cardId: string;
|
|
304
|
+
active: boolean;
|
|
305
|
+
};
|
|
306
|
+
setChatProcessing(args: {
|
|
307
|
+
cardId: string;
|
|
308
|
+
active: boolean;
|
|
309
|
+
}): {
|
|
310
|
+
cardId: string;
|
|
311
|
+
active: boolean;
|
|
312
|
+
};
|
|
293
313
|
}
|
|
294
314
|
declare function createBoardLiveCardsMcp(deps: BoardLiveCardsMcpDeps): BoardLiveCardsMcp;
|
|
295
315
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as CommandResult, L as LiveCard } from './board-live-cards-public-
|
|
1
|
+
import { C as CommandResult, L as LiveCard } from './board-live-cards-public-CBVjm327.js';
|
|
2
2
|
import { CardStorePublic } from './card-store-public.js';
|
|
3
3
|
import { ChatStorePublic } from './chat-store-public.js';
|
|
4
|
-
import { C as ChatRecord } from './chat-storage-lib-
|
|
5
|
-
import './storage-interface-
|
|
4
|
+
import { C as ChatRecord } from './chat-storage-lib-Bce-xx6l.js';
|
|
5
|
+
import './storage-interface-Ct-C4tlz.js';
|
|
6
6
|
import './execution-refs.js';
|
|
7
7
|
import './types-BBhqYGhE.js';
|
|
8
8
|
|
|
@@ -173,10 +173,10 @@ interface BoardLiveCardsMcpBoardDeps {
|
|
|
173
173
|
}): CommandResult;
|
|
174
174
|
}
|
|
175
175
|
interface BoardLiveCardsMcpNonCoreDeps {
|
|
176
|
-
describeTaskExecutorCapabilities(input: {}): CommandResult
|
|
176
|
+
describeTaskExecutorCapabilities(input: {}): Promise<CommandResult>;
|
|
177
177
|
validateCardPreflight(input: {
|
|
178
178
|
body: unknown;
|
|
179
|
-
}): CommandResult
|
|
179
|
+
}): Promise<CommandResult>;
|
|
180
180
|
evalCardCompute(input: {
|
|
181
181
|
body: unknown;
|
|
182
182
|
}): CommandResult<{
|
|
@@ -193,16 +193,16 @@ interface BoardLiveCardsMcpNonCoreDeps {
|
|
|
193
193
|
sourceIdx: number;
|
|
194
194
|
};
|
|
195
195
|
body: unknown;
|
|
196
|
-
}): CommandResult
|
|
196
|
+
}): Promise<CommandResult>;
|
|
197
197
|
runSourcePreflight(input: {
|
|
198
198
|
params: {
|
|
199
199
|
sourceIdx: number;
|
|
200
200
|
};
|
|
201
201
|
body: unknown;
|
|
202
|
-
}): CommandResult
|
|
202
|
+
}): Promise<CommandResult>;
|
|
203
203
|
simulateCardCycle(input: {
|
|
204
204
|
body: unknown;
|
|
205
|
-
}): CommandResult
|
|
205
|
+
}): Promise<CommandResult>;
|
|
206
206
|
}
|
|
207
207
|
interface BoardLiveCardsMcpDeps {
|
|
208
208
|
board: BoardLiveCardsMcpBoardDeps;
|
|
@@ -229,7 +229,7 @@ interface BoardLiveCardsMcpDeps {
|
|
|
229
229
|
}): unknown | null;
|
|
230
230
|
}
|
|
231
231
|
interface BoardLiveCardsMcp {
|
|
232
|
-
discoverSourceKinds(): BoardLiveCardsMcpDiscoverSourceKindsResult
|
|
232
|
+
discoverSourceKinds(): Promise<BoardLiveCardsMcpDiscoverSourceKindsResult>;
|
|
233
233
|
inspectBoardRuntimeStatus(): BoardLiveCardsMcpBoardStatusResult;
|
|
234
234
|
inspectCardDefinitionAndRuntime(args: {
|
|
235
235
|
cardId: string;
|
|
@@ -248,7 +248,7 @@ interface BoardLiveCardsMcp {
|
|
|
248
248
|
}): BoardLiveCardsMcpFileDownloadDescriptor;
|
|
249
249
|
preflightValidateCandidateCardDefinition(args: {
|
|
250
250
|
candidateCardContent: UnknownRecord;
|
|
251
|
-
}): unknown
|
|
251
|
+
}): Promise<unknown>;
|
|
252
252
|
preflightMaterializeCandidateCard(args: {
|
|
253
253
|
candidateCardContent: UnknownRecord;
|
|
254
254
|
mockRequires: UnknownRecord;
|
|
@@ -258,21 +258,21 @@ interface BoardLiveCardsMcp {
|
|
|
258
258
|
candidateCardContent: UnknownRecord;
|
|
259
259
|
mockProjections: UnknownRecord;
|
|
260
260
|
sourceIdx: number;
|
|
261
|
-
}): unknown
|
|
261
|
+
}): Promise<unknown>;
|
|
262
262
|
preflightRunSingleSourceInCandidateCard(args: {
|
|
263
263
|
candidateCardContent: UnknownRecord;
|
|
264
264
|
mockProjections: UnknownRecord;
|
|
265
265
|
sourceIdx: number;
|
|
266
|
-
}): unknown
|
|
266
|
+
}): Promise<unknown>;
|
|
267
267
|
preflightRunSingleSourceInLiveCard(args: {
|
|
268
268
|
cardId: string;
|
|
269
269
|
sourceIdx: number;
|
|
270
270
|
mockRequires: UnknownRecord;
|
|
271
|
-
}): unknown
|
|
271
|
+
}): Promise<unknown>;
|
|
272
272
|
preflightRunOneCycleWithCandidateCard(args: {
|
|
273
273
|
candidateCardContent: UnknownRecord;
|
|
274
274
|
mockRequires: UnknownRecord;
|
|
275
|
-
}): BoardLiveCardsMcpPreflightRunOneCycleResult
|
|
275
|
+
}): Promise<BoardLiveCardsMcpPreflightRunOneCycleResult>;
|
|
276
276
|
manageReadCard(args: {
|
|
277
277
|
cardId: string;
|
|
278
278
|
}): LiveCard[];
|
|
@@ -286,10 +286,30 @@ interface BoardLiveCardsMcp {
|
|
|
286
286
|
manageUpsertCard(args: {
|
|
287
287
|
cardId: string;
|
|
288
288
|
candidateCardContent: UnknownRecord;
|
|
289
|
-
}): BoardLiveCardsMcpManageUpsertCardResult
|
|
289
|
+
}): Promise<BoardLiveCardsMcpManageUpsertCardResult>;
|
|
290
290
|
manageRemoveCard(args: {
|
|
291
291
|
cardId: string;
|
|
292
292
|
}): unknown;
|
|
293
|
+
adminReadCard(args: {
|
|
294
|
+
cardId: string;
|
|
295
|
+
}): LiveCard[];
|
|
296
|
+
adminUpsertCard(args: {
|
|
297
|
+
cardId: string;
|
|
298
|
+
candidateCardContent: UnknownRecord;
|
|
299
|
+
}): Promise<BoardLiveCardsMcpManageUpsertCardResult>;
|
|
300
|
+
getChatProcessing(args: {
|
|
301
|
+
cardId: string;
|
|
302
|
+
}): {
|
|
303
|
+
cardId: string;
|
|
304
|
+
active: boolean;
|
|
305
|
+
};
|
|
306
|
+
setChatProcessing(args: {
|
|
307
|
+
cardId: string;
|
|
308
|
+
active: boolean;
|
|
309
|
+
}): {
|
|
310
|
+
cardId: string;
|
|
311
|
+
active: boolean;
|
|
312
|
+
};
|
|
293
313
|
}
|
|
294
314
|
declare function createBoardLiveCardsMcp(deps: BoardLiveCardsMcpDeps): BoardLiveCardsMcp;
|
|
295
315
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {createRequire}from'module';import'ajv-formats';var ae=createRequire(import.meta.url);ae("./jsonata-sync.cjs");var de=createRequire(import.meta.url),B=de("./jsonata-sync.cjs"),K=B;function D(e,r){if(!r||!e)return;let s=r.split("."),t=e;for(let a=0;a<s.length;a++){if(t==null)return;t=t[s[a]];}return t}function z(e,r,s){let t=r.split("."),a=e;for(let c=0;c<t.length-1;c++)(a[t[c]]==null||typeof a[t[c]]!="object")&&(a[t[c]]={}),a=a[t[c]];a[t[t.length-1]]=s;}async function ce(e,r){if(!e?.compute?.length)return e;e.card_data||(e.card_data={}),e.computed_values={},e._sourcesData=r?.sourcesData??{};let s=e.requires??{},t={card_data:e.card_data,requires:s,expects_data:s,fetched_sources:e._sourcesData,data:e.computed_values,computed_values:e.computed_values};for(let a of e.compute)try{let c=await B(a.expr).evaluate(t);z(e.computed_values,a.bindTo,c),t.computed_values=e.computed_values;}catch{}return e}function ue(e,r){if(!e?.compute?.length)return {ok:true,node:e};e.card_data||(e.card_data={}),e.computed_values={},e._sourcesData=r?.sourcesData??{};let s=e.requires??{},t={card_data:e.card_data,requires:s,expects_data:s,fetched_sources:e._sourcesData,data:e.computed_values,computed_values:e.computed_values},a=[];for(let c of e.compute)try{let l=K(c.expr).evaluate(t);z(e.computed_values,c.bindTo,l),t.computed_values=e.computed_values;}catch(l){let g=l instanceof Error?l.message:String(l);a.push({bindTo:c.bindTo,error:g});}return a.length>0?{ok:true,node:e,errors:a}:{ok:true,node:e}}async function pe(e,r,s){let t={...s??{},card_data:r.card_data??{},requires:r.requires??{},fetched_sources:r._sourcesData??{},computed_values:r.computed_values??{}};return B(e).evaluate(t)}function le(e,r){return r.startsWith("fetched_sources.")?D(e._sourcesData??{},r.slice(16)):D(e,r)}var V=new Set(["metric","table","editable-table","chart","form","filter","list","notes","todo","alert","narrative","badge","text","markdown","ref","custom","actions"]),fe=new Set(["id","meta","requires","provides","view","card_data","compute","source_defs"]);function me(e){let r=[];if(!e||typeof e!="object"||Array.isArray(e))return {ok:false,errors:["Node must be a non-null object"]};let s=e;(typeof s.id!="string"||!s.id)&&r.push("id: required, must be a non-empty string");for(let t of Object.keys(s))fe.has(t)||r.push(`Unknown top-level key: "${t}"`);if((s.card_data==null||typeof s.card_data!="object"||Array.isArray(s.card_data))&&r.push("card_data: required, must be an object"),s.meta!=null)if(typeof s.meta!="object"||Array.isArray(s.meta))r.push("meta: must be an object");else {let t=s.meta;t.title!=null&&typeof t.title!="string"&&r.push("meta.title: must be a string"),t.tags!=null&&!Array.isArray(t.tags)&&r.push("meta.tags: must be an array");}if(s.requires!=null&&!Array.isArray(s.requires)&&r.push("requires: must be an array of strings"),s.provides!=null&&(Array.isArray(s.provides)?s.provides.forEach((t,a)=>{if(!t||typeof t!="object"||Array.isArray(t))r.push(`provides[${a}]: must be an object with bindTo and ref`);else {let c=t;(typeof c.bindTo!="string"||!c.bindTo)&&r.push(`provides[${a}]: missing required "bindTo" string`),(typeof c.ref!="string"||!c.ref)&&r.push(`provides[${a}]: missing required "ref" string`);}}):r.push("provides: must be an array of { bindTo, ref } bindings")),s.compute!=null&&(Array.isArray(s.compute)?s.compute.forEach((t,a)=>{if(!t||typeof t!="object"||Array.isArray(t))r.push(`compute[${a}]: must be a compute step object`);else {let c=t;(typeof c.bindTo!="string"||!c.bindTo)&&r.push(`compute[${a}]: missing required "bindTo" property`),(typeof c.expr!="string"||!c.expr)&&r.push(`compute[${a}]: missing required "expr" string (JSONata expression)`);}}):r.push("compute: must be an array of compute steps")),s.source_defs!=null)if(!Array.isArray(s.source_defs))r.push("source_defs: must be an array");else {let t=new Set,a=new Set;s.source_defs.forEach((c,l)=>{if(!c||typeof c!="object"||Array.isArray(c))r.push(`source_defs[${l}]: must be an object`);else {let g=c;typeof g.bindTo!="string"||!g.bindTo?r.push(`source_defs[${l}]: missing required "bindTo" property`):(t.has(g.bindTo)&&r.push(`source_defs[${l}]: bindTo "${g.bindTo}" is not unique across source_defs`),t.add(g.bindTo)),typeof g.outputFile!="string"||!g.outputFile?r.push(`source_defs[${l}]: missing required "outputFile" property`):(a.has(g.outputFile)&&r.push(`source_defs[${l}]: outputFile "${g.outputFile}" is not unique across source_defs`),a.add(g.outputFile)),g.optionalForCompletionGating!=null&&typeof g.optionalForCompletionGating!="boolean"&&r.push(`source_defs[${l}]: optionalForCompletionGating must be a boolean`);}});}if(s.view!=null)if(typeof s.view!="object"||Array.isArray(s.view))r.push("view: must be an object");else {let t=s.view;!Array.isArray(t.elements)||t.elements.length===0?r.push("view.elements: required, must be a non-empty array"):t.elements.forEach((a,c)=>{if(!a||typeof a!="object"){r.push(`view.elements[${c}]: must be an object`);return}!a.kind||typeof a.kind!="string"?r.push(`view.elements[${c}].kind: required, must be a string`):V.has(a.kind)||r.push(`view.elements[${c}].kind: unknown kind "${a.kind}". Valid: ${[...V].join(", ")}`),a.data!=null&&(typeof a.data!="object"||Array.isArray(a.data))&&r.push(`view.elements[${c}].data: must be an object`);}),t.layout!=null&&(typeof t.layout!="object"||Array.isArray(t.layout))&&r.push("view.layout: must be an object"),t.features!=null&&(typeof t.features!="object"||Array.isArray(t.features))&&r.push("view.features: must be an object");}return {ok:r.length===0,errors:r}}async function ge(e,r){if(!e||e.length===0)return [];let s={card_data:r.card_data??{},requires:r.requires??{}};return Promise.all(e.map(async t=>{let a={};if(t.projections&&typeof t.projections=="object"&&!Array.isArray(t.projections)){for(let[c,l]of Object.entries(t.projections))if(typeof l=="string"&&l.trim().length>0)try{a[c]=await B(l).evaluate(s);}catch{a[c]=void 0;}}return {...t,_projections:a}}))}function ye(e,r){if(!e||e.length===0)return [];let s={card_data:r.card_data??{},requires:r.requires??{}};return e.map(t=>{let a={};if(t.projections&&typeof t.projections=="object"&&!Array.isArray(t.projections)){for(let[c,l]of Object.entries(t.projections))if(typeof l=="string"&&l.trim().length>0)try{a[c]=K(l).evaluate(s);}catch{a[c]=void 0;}}return {...t,_projections:a}})}var W={run:ce,runSync:ue,eval:pe,resolve:le,validate:me,enrichSources:ge,enrichSourcesSync:ye};function k(e,r){if(e?.status==="success")return Object.prototype.hasOwnProperty.call(e,"data")?e.data:void 0;throw e?.status==="fail"||e?.status==="error"?new Error(e.error||`${r} failed`):new Error(`${r} returned an unexpected response`)}function we(e,r){if(e?.status==="success"&&Object.prototype.hasOwnProperty.call(e,"data"))return e.data;throw e?.status==="success"?new Error(`${r} returned success without data`):e?.status==="fail"||e?.status==="error"?new Error(e.error||`${r} failed`):new Error(`${r} returned an unexpected response`)}function d(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function b(e){return Array.isArray(e)?e:[]}function N(e,r){if(typeof r!="string"||r.length===0)return;let s=e,t=r;t.startsWith("fetched_sources.")&&(s=d(e).fetched_sources,t=t.slice(16));for(let a of t.split(".")){if(s==null||typeof s!="object")return;s=s[a];}return s}function O(e,r){let s=d(e.view),t=b(s.elements);return {layout:s.layout,features:s.features,elements:t.map((a,c)=>{let l=d(a),g=d(l.data),j=typeof l.visible=="string"?!!N(r,l.visible):true,I=typeof g.bind=="string"?g.bind:void 0,x=typeof g.maxRows=="number"?g.maxRows:void 0,q=I?N(r,I):void 0,U={id:typeof l.id=="string"&&l.id?l.id:`element-${c}`,kind:l.kind,label:l.label,visible:j};return q!==void 0&&(U.resolved=Array.isArray(q)&&typeof x=="number"?q.slice(0,x):q),U})}}function J(e,r){let s=typeof e.id=="string"&&e.id?e.id:"card",t=b(e.provides),a=t.length>0?t:[{bindTo:s,ref:"card_data"}],c={};for(let l of a){let g=d(l),j=typeof g.bindTo=="string"?g.bindTo:"",I=typeof g.ref=="string"?g.ref:"";if(!j||!I)continue;let x=N(r,I);x!==void 0&&(c[j]=x);}return c}function be(e){if(typeof e!="string"||!e.trim())return null;let r=/^(file uploaded|AI generated|AI geneterated):\s*.*?#(\d+)\s*$/i.exec(e.trim());if(!r)return null;let s=Number.parseInt(r[2],10);return !Number.isInteger(s)||s<0?null:s}function Ce(e){return {"card-content":e}}function $(e,r){let s=k(e.get({params:{id:r}}),"cardStore.get"),t=Array.isArray(s?.cards)?s.cards:[];if(t.length===0)throw new Error(`Card "${r}" not found`);return t[0]}function $e(e){let{board:r,nonCore:s,cardStore:t,chatStore:a,uploadCardFile:c,buildFileDownloadUrl:l,readFetchedSourceJsonByRef:g}=e;function j(n){if(Array.isArray(n.bytes))return new Uint8Array(n.bytes.map(o=>Math.max(0,Math.min(255,Number(o)||0))));if(typeof n.text=="string")return new TextEncoder().encode(n.text);if(typeof n.base64=="string"){let o=String(n.base64).replace(/-/g,"+").replace(/_/g,"/"),i=o+"=".repeat((4-o.length%4)%4),m=atob(i);return Uint8Array.from(m,u=>u.charCodeAt(0))}throw new Error("file entry requires bytes, text, or base64")}function I(){let n=d(k(s.describeTaskExecutorCapabilities({}),"describeTaskExecutorCapabilities"));return {version:n.version,commonSourceFields:d(n.commonSourceDefFields),sourceKinds:d(n.sourceKinds)}}function x(){let n=d(k(r.status({}),"status")),o=d(n.summary),i=b(n.cards);return {meta:d(n.meta),summary:{card_count:typeof o.card_count=="number"?o.card_count:0,completed:typeof o.completed=="number"?o.completed:0,eligible:typeof o.eligible=="number"?o.eligible:0,pending:typeof o.pending=="number"?o.pending:0,blocked:typeof o.blocked=="number"?o.blocked:0,in_progress:typeof o.in_progress=="number"?o.in_progress:0,failed:typeof o.failed=="number"?o.failed:0,unresolved:typeof o.unresolved=="number"?o.unresolved:0},cards:i.map(m=>{let u=d(m);return {"card-id":typeof u.name=="string"?u.name:null,status:u.status??null,error:u.error??null,requires:b(u.requires),requires_satisfied:b(u.requires_satisfied),requires_missing:b(u.requires_missing),provides_declared:b(u.provides_declared),provides_runtime:b(u.provides_runtime)}})}}function q(n){let o=String(n.cardId||"").trim();if(!o)throw new Error("inspectCardDefinitionAndRuntime requires cardId");let i=d(k(r.status({}),"status")),u=b(i.cards).map(d).find(f=>f.name===o);if(!u)throw new Error(`card "${o}" not found in board status`);let p=d($(t,o)),y=b(u.requires_satisfied).filter(f=>typeof f=="string"&&!!f),_=b(u.provides_runtime).filter(f=>typeof f=="string"&&!!f),C=Object.fromEntries(y.map(f=>[f,k(r.getOutputsDataObject({params:{key:f}}),`getOutputsDataObject(${f})`)])),R=Object.fromEntries(_.map(f=>[f,k(r.getOutputsDataObject({params:{key:f}}),`getOutputsDataObject(${f})`)])),v=d(k(r.getOutputsComputedValues({params:{key:o}}),"getOutputsComputedValues")),A=k(r.getOutputsFetchedSources({params:{key:o}}),"getOutputsFetchedSources"),h=b(p.source_defs).map(d),S={};for(let f of h)typeof f.bindTo=="string"&&typeof f.outputFile=="string"&&(S[f.outputFile]=f.bindTo);let w={};for(let[f,E]of Object.entries(A)){let M=S[f]??f;if(!g||typeof E!="string"){w[M]=null;continue}try{w[M]=g({cardId:o,ref:E});}catch{w[M]=null;}}let T={card_data:d(p.card_data),requires:C,fetched_sources:w,computed_values:v};return {cardId:o,card_status_in_board:u,card_definition_and_static_data:p,refs_for_fetched_source_files:A,runtime_data:{requires:C,provides:R,computed_values:v,rendered_view:O(p,T)}}}function U(n){let o=String(n.cardId||"").trim();if(!o)throw new Error("inspectChatMessagesOnCards requires cardId");let i=typeof n.turnId=="string"?n.turnId:"",m=n.allTurns===true,u=typeof n.tailTurnsBeforeId=="string"?n.tailTurnsBeforeId:"",p=m?void 0:n.lastUserTurns??(i?void 0:1),y=n.tail,_={...p===void 0?{}:{tailTurns:p},...i?{turnId:i}:{},...m?{allTurns:true}:{},...u?{tailTurnsBeforeId:u}:{}},C=Object.keys(_).length>0?{params:{cardId:o},body:_}:{params:{cardId:o}},R=k(a.readAll(C),"chatStore.readAll"),v=d($(t,o)),A=b(d(v.card_data).files).map((w,T)=>({idx:T,stored_name:d(w).stored_name})).filter(w=>typeof w.stored_name=="string"&&w.stored_name.length>0),S=(Array.isArray(R.records)?R.records:[]).map(w=>{let f=d(w.payload),E={...w},M=typeof w?.role=="string"?w.role:typeof f.role=="string"?String(f.role):"",oe=typeof w?.text=="string"?w.text:typeof f.text=="string"?String(f.text):"";if(M==="system"){let F=be(oe);if(F!==null&&A.some(L=>L.idx===F)){let L=`Retrieve using inspect-file-contents --card-id ${o} --file-idx ${F}`;E.retrieval_hint=L,Object.keys(f).length>0&&typeof w.role!="string"&&(E.payload={...f,retrieval_hint:L});}}return E});return {cardId:o,messages:typeof y=="number"&&y>=0?S.slice(-y):S}}function G(n){let o=String(n.cardId||"").trim(),i=Number(n.fileIdx);if(!o)throw new Error("inspectFileContents requires cardId");if(!Number.isInteger(i)||i<0)throw new Error("inspectFileContents requires fileIdx to be a non-negative integer");let m=d($(t,o)),u=b(d(m.card_data).files).map(d);if(i>=u.length)throw new Error(`attachment index ${i} is out of range for card "${o}"`);let p=u[i],y=typeof p.stored_name=="string"?p.stored_name:null;return {cardId:o,fileIdx:i,downloadUrl:l({cardId:o,fileIdx:i,storedName:y}),...typeof p.name=="string"?{name:p.name}:{},...typeof p.stored_name=="string"?{stored_name:p.stored_name}:{},...typeof p.mime_type=="string"?{mime_type:p.mime_type}:{},...typeof p.size=="number"?{size:p.size}:{},...typeof p.uploaded_at=="string"?{uploaded_at:p.uploaded_at}:{}}}function P(n){return s.validateCardPreflight({body:Ce(n.candidateCardContent)})}function H(n){if(!n.mockRequires||typeof n.mockRequires!="object"||Array.isArray(n.mockRequires))throw new Error("preflightMaterializeCandidateCard requires mockRequires");if(!n.mockFetchedSources||typeof n.mockFetchedSources!="object"||Array.isArray(n.mockFetchedSources))throw new Error("preflightMaterializeCandidateCard requires mockFetchedSources");let o=s.evalCardCompute({body:{"card-content":n.candidateCardContent,"mock-requires":n.mockRequires,"mock-fetched-sources":n.mockFetchedSources}});if(o.status!=="success")return o;let i=d(we(o,"evalCardCompute")),m=d(n.candidateCardContent),u={card_data:d(m.card_data),requires:d(n.mockRequires),fetched_sources:d(n.mockFetchedSources),computed_values:d(i.computed_values)};return {status:"success",data:{cardId:typeof i.cardId=="string"?i.cardId:typeof m.id=="string"?m.id:"(unknown)",ok:i.ok===true,computed_values:d(i.computed_values),errors:b(i.errors).map(p=>{let y=d(p);return {bindTo:typeof y.bindTo=="string"?y.bindTo:"",error:typeof y.error=="string"?y.error:""}}),provides_outputs:J(m,u),rendered_view:O(m,u)}}}function Y(n){return s.probeSourcePreflight({params:{sourceIdx:n.sourceIdx},body:{"card-content":n.candidateCardContent,"mock-projections":n.mockProjections}})}function Q(n){return s.runSourcePreflight({params:{sourceIdx:n.sourceIdx},body:{"card-content":n.candidateCardContent,"mock-projections":n.mockProjections}})}function X(n){let o=String(n.cardId||"").trim();if(!o)throw new Error("preflightRunSingleSourceInLiveCard requires cardId");if(!n.mockRequires||typeof n.mockRequires!="object"||Array.isArray(n.mockRequires))throw new Error("preflightRunSingleSourceInLiveCard requires mockRequires");let i=d($(t,o)),m=b(i.source_defs).filter(p=>!!p&&typeof p=="object"&&!Array.isArray(p)),u={};if(n.sourceIdx>=0&&n.sourceIdx<m.length){let p=m[n.sourceIdx],y=W.enrichSourcesSync([p],{card_data:d(i.card_data),requires:n.mockRequires});Array.isArray(y)&&y.length>0&&(u=d(y[0]._projections));}return s.runSourcePreflight({params:{sourceIdx:n.sourceIdx},body:{"card-content":i,"mock-requires":n.mockRequires,"mock-projections":u}})}function Z(n){let o=d(k(s.simulateCardCycle({body:{"card-content":n.candidateCardContent,"mock-requires":n.mockRequires}}),"simulateCardCycle")),i=d(n.candidateCardContent),m=d(o.validation),u=b(o.source_probes),p=b(o.projection_errors),y=d(o.fetched_sources),_=b(o.compute_errors),C=d(o.computed_values),R={card_data:d(i.card_data),requires:n.mockRequires,fetched_sources:y,computed_values:C},v=[];for(let A of b(m.issues))typeof A=="string"&&A&&v.push(A);for(let A of u){let h=d(A),S=typeof h.bindTo=="string"?h.bindTo:"source",w=typeof h.error=="string"?h.error:"";w&&v.push(`${S}: ${w}`);}for(let A of p){let h=d(A),S=typeof h.bindTo=="string"?h.bindTo:"source",w=typeof h.key=="string"?h.key:"projection",T=typeof h.error=="string"?h.error:"projection failed";v.push(`${S}.${w}: ${T}`);}for(let A of _){let h=d(A),S=typeof h.bindTo=="string"?h.bindTo:"compute",w=typeof h.error=="string"?h.error:"compute failed";v.push(`${S}: ${w}`);}return {status:"success",data:{cardId:typeof o.cardId=="string"?o.cardId:"(unknown)",ok:o.ok===true,issues:v,provides_outputs:J(i,R),rendered_view:O(i,R)}}}function ee(n){let o=String(n.cardId||"").trim();if(!o)throw new Error("manageReadCard requires cardId");let i=k(t.get({params:{id:o}}),"cardStore.get");return Array.isArray(i.cards)?i.cards:[]}function re(n){let o=String(n.cardId||"").trim(),i=String(n.role||"").trim(),m=typeof n.text=="string"?n.text:"",u=typeof n.turn=="string"?n.turn:"";if(!o)throw new Error("manageAddChatEntryAndAnyAttachments requires cardId");if(!i)throw new Error("manageAddChatEntryAndAnyAttachments requires role");let p=b(n.files).map(_=>{let C=d(_),R=String(C.file_name??C.fileName??C.name??"").trim(),v=String(C.content_type??C.contentType??"application/octet-stream");if(!R)throw new Error("file entry requires file_name");return c({cardId:o,fileName:R,contentType:v,bytes:j(C)}).file});p.forEach((_,C)=>{let R=i==="assistant"?`AI generated: ${String(_.name||"")} as ${String(_.stored_name||"")} #${C}`:`file uploaded: ${String(_.name||"")} as ${String(_.stored_name||"")} #${C}`;k(a.append({params:{cardId:o},body:{role:"system",text:R,files:[],turn:u}}),"chatStore.append(system attachment message)");});let y=k(a.append({params:{cardId:o},body:{role:i,text:m,files:p,turn:u}}),"chatStore.append");return {status:"success",data:{cardId:o,id:String(y.id),role:i,turn:u,files:p}}}function te(n){let o=String(n.cardId||"").trim(),i=d(n.candidateCardContent);if(!o)throw new Error("manageUpsertCard requires cardId");if(typeof i.id!="string"||!i.id.trim())throw new Error("candidateCardContent.id must be a non-empty string");if(i.id!==o)throw new Error(`candidateCardContent.id must match cardId (${o})`);let m=P({candidateCardContent:i}),u=d(m),p=d(u.data);if(u.status!=="success"||p.isValid!==true)return {status:"fail",step:"validate",validation:m};let y=null;try{y=$(t,o);}catch{y=null;}let _=t.set({body:i});k(_,"cardStore.set");let C;try{C=r.upsertCard({params:{cardId:o,restart:!0}}),k(C,"upsertCard");}catch(v){try{y&&t.set({body:y});}catch{}throw v}let R=null;try{R=r.cardRefreshedNotify({params:{cardId:o}}),k(R,"cardRefreshedNotify");}catch{R=null;}return {status:"success",data:{validation:m,card_saved:null,board_result:C,refresh_notify:R}}}function ne(n){let o=String(n.cardId||"").trim();if(!o)throw new Error("manageRemoveCard requires cardId");let i=r.removeCard({params:{id:o}});k(i,"removeCard");let m=t.del({params:{id:o}});return k(m,"cardStore.del"),{status:"success",data:{board_result:i,store_result:m}}}return {discoverSourceKinds:I,inspectBoardRuntimeStatus:x,inspectCardDefinitionAndRuntime:q,inspectChatMessagesOnCards:U,inspectFileContents:G,preflightValidateCandidateCardDefinition:P,preflightMaterializeCandidateCard:H,preflightProbeSingleSourceInCandidateCard:Y,preflightRunSingleSourceInCandidateCard:Q,preflightRunSingleSourceInLiveCard:X,preflightRunOneCycleWithCandidateCard:Z,manageReadCard:ee,manageAddChatEntryAndAnyAttachments:re,manageUpsertCard:te,manageRemoveCard:ne}}export{$e as createBoardLiveCardsMcp};//# sourceMappingURL=board-live-cards-mcp.js.map
|
|
1
|
+
export{a as createBoardLiveCardsMcp}from'./chunk-VCCTAUIG.js';import'./chunk-JMDHDY6M.js';import'./chunk-VLBB3D6B.js';import'./chunk-MNEOJWPS.js';import'./chunk-FW4363Y4.js';//# sourceMappingURL=board-live-cards-mcp.js.map
|
|
2
2
|
//# sourceMappingURL=board-live-cards-mcp.js.map
|