yaml-flow 8.4.25 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/asset-integrity.json +3 -3
- package/cli/browser-api/board-live-cards-browser-adapter.d.ts +1 -1
- package/cli/browser-api/board-live-cards-browser-adapter.js +1 -1
- package/cli/bundled/board-live-cards-cli.mjs +14 -14
- package/cli/bundled/chat-store-cli.mjs +6 -6
- package/cli/{types-juH2nFpz.d.ts → types-D2s3VzyY.d.ts} +3 -2
- package/examples/board/demo-shell-with-server.html +2 -2
- package/examples/board/doc.html +2 -2
- package/examples/board/server/board-server.js +4 -0
- package/examples/board/server/chat-flow/copilot-chat/assistant.js +4 -2
- package/examples/board/server/chat-flow/flow-steps.json +9 -8
- package/examples/board/test/server-http-mcp-test.js +791 -0
- package/examples/board/test/server-http-test.js +7 -7
- package/examples/board-local/demo-shell-localstorage.html +3 -3
- package/lib/artifacts-store-public.d.cts +1 -1
- package/lib/artifacts-store-public.d.ts +1 -1
- package/lib/board-live-cards-mcp.cjs +2 -0
- package/lib/board-live-cards-mcp.d.cts +259 -0
- package/lib/board-live-cards-mcp.d.ts +259 -0
- package/lib/board-live-cards-mcp.js +2 -0
- package/lib/board-live-cards-node.cjs +14 -14
- package/lib/board-live-cards-node.d.cts +8 -6
- package/lib/board-live-cards-node.d.ts +8 -6
- package/lib/board-live-cards-node.js +14 -14
- package/lib/{board-live-cards-public-B4RcYPC_.d.cts → board-live-cards-public-CvkDfZQ7.d.cts} +1 -1
- package/lib/{board-live-cards-public-ydXuA4zh.d.ts → board-live-cards-public-DdVhH4M-.d.ts} +1 -1
- package/lib/board-live-cards-public.cjs +1 -1
- package/lib/board-live-cards-public.d.cts +1 -1
- package/lib/board-live-cards-public.d.ts +1 -1
- package/lib/board-live-cards-public.js +1 -1
- package/lib/board-live-cards-server-runtime.cjs +5 -4
- 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 +5 -4
- package/lib/card-store-public.d.cts +1 -1
- package/lib/card-store-public.d.ts +1 -1
- package/lib/{chat-storage-lib-B1wU27y3.d.cts → chat-storage-lib-0imhRX3l.d.cts} +2 -1
- package/lib/{chat-storage-lib-DsF4kPon.d.ts → chat-storage-lib-CJn7a6OH.d.ts} +2 -1
- package/lib/chat-store-public.cjs +1 -1
- package/lib/chat-store-public.d.cts +2 -2
- package/lib/chat-store-public.d.ts +2 -2
- package/lib/chat-store-public.js +1 -1
- package/lib/server-runtime/index.cjs +5 -4
- package/lib/server-runtime/index.d.cts +4 -4
- package/lib/server-runtime/index.d.ts +4 -4
- package/lib/server-runtime/index.js +5 -4
- package/lib/{types-BpfMamGs.d.cts → types-NM_d_1oZ.d.cts} +3 -2
- package/lib/{types-DwPRb-PY.d.ts → types-QNI__eAf.d.ts} +3 -2
- package/package.json +10 -2
- package/browser/board-livecards-localstorage.js +0 -10
|
@@ -565,7 +565,7 @@ try {
|
|
|
565
565
|
const subRes = await httpJson('POST', `${BASE}/cards/${CHAT_CARD_ID}/chats/subscribe-sse`, { clientId: chatSseClientId });
|
|
566
566
|
assert(subRes.status === 200, `chat subscribe returned ${subRes.status}`);
|
|
567
567
|
|
|
568
|
-
const t2Before = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats`);
|
|
568
|
+
const t2Before = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats?all-turns=true`);
|
|
569
569
|
assert(t2Before.status === 200, `T3 pre chats returned ${t2Before.status}`);
|
|
570
570
|
const t2BeforeMessages = Array.isArray(t2Before.data?.messages) ? t2Before.data.messages : [];
|
|
571
571
|
const t2BeforeCount = t2BeforeMessages.length;
|
|
@@ -590,7 +590,7 @@ try {
|
|
|
590
590
|
}, 45_000, 'T3 ordered lifecycle');
|
|
591
591
|
assert(!!t2Lifecycle, 'T3 ordered lifecycle not observed');
|
|
592
592
|
|
|
593
|
-
const t2After = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats`);
|
|
593
|
+
const t2After = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats?all-turns=true`);
|
|
594
594
|
assert(t2After.status === 200, `T3 post chats returned ${t2After.status}`);
|
|
595
595
|
const t2AfterMessages = Array.isArray(t2After.data?.messages) ? t2After.data.messages : [];
|
|
596
596
|
const t2NewMessages = t2AfterMessages.slice(t2BeforeCount);
|
|
@@ -613,7 +613,7 @@ try {
|
|
|
613
613
|
console.log('\n=== T3a: skipped (--skip-t3a) ===');
|
|
614
614
|
} else {
|
|
615
615
|
console.log('\n=== T3a: non-probe chat protocol (expect paris) ===');
|
|
616
|
-
const t2aBefore = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats`);
|
|
616
|
+
const t2aBefore = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats?all-turns=true`);
|
|
617
617
|
assert(t2aBefore.status === 200, `T3a pre chats returned ${t2aBefore.status}`);
|
|
618
618
|
const t2aBeforeMessages = Array.isArray(t2aBefore.data?.messages) ? t2aBefore.data.messages : [];
|
|
619
619
|
const t2aBeforeCount = t2aBeforeMessages.length;
|
|
@@ -641,7 +641,7 @@ try {
|
|
|
641
641
|
}, 240_000, 'T3a assistant response with paris');
|
|
642
642
|
assert(!!t2aAssistant, 'T3a assistant response with paris not observed on SSE');
|
|
643
643
|
|
|
644
|
-
const t2aAfter = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats`);
|
|
644
|
+
const t2aAfter = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats?all-turns=true`);
|
|
645
645
|
assert(t2aAfter.status === 200, `T3a post chats returned ${t2aAfter.status}`);
|
|
646
646
|
const t2aAfterMessages = Array.isArray(t2aAfter.data?.messages) ? t2aAfter.data.messages : [];
|
|
647
647
|
const t2aNewMessages = t2aAfterMessages.slice(t2aBeforeCount);
|
|
@@ -657,7 +657,7 @@ try {
|
|
|
657
657
|
console.log('\n=== T3b: skipped (--skip-t3b) ===');
|
|
658
658
|
} else {
|
|
659
659
|
console.log('\n=== T3b: probe-echo chat with file upload protocol ===');
|
|
660
|
-
const t2bBefore = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats`);
|
|
660
|
+
const t2bBefore = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats?all-turns=true`);
|
|
661
661
|
assert(t2bBefore.status === 200, `T3b pre chats returned ${t2bBefore.status}`);
|
|
662
662
|
const t2bBeforeMessages = Array.isArray(t2bBefore.data?.messages) ? t2bBefore.data.messages : [];
|
|
663
663
|
const t2bBeforeCount = t2bBeforeMessages.length;
|
|
@@ -671,7 +671,7 @@ try {
|
|
|
671
671
|
const uploadedFile = t2bUploadRes.data?.file;
|
|
672
672
|
assert(uploadedFile && typeof uploadedFile === 'object', 'T3b upload response missing file metadata');
|
|
673
673
|
|
|
674
|
-
const t2bAfterUpload = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats`);
|
|
674
|
+
const t2bAfterUpload = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats?all-turns=true`);
|
|
675
675
|
assert(t2bAfterUpload.status === 200, `T3b chats after upload returned ${t2bAfterUpload.status}`);
|
|
676
676
|
const t2bUploadMessages = Array.isArray(t2bAfterUpload.data?.messages) ? t2bAfterUpload.data.messages : [];
|
|
677
677
|
const t2bUploadNewMessages = t2bUploadMessages.slice(t2bBeforeCount);
|
|
@@ -717,7 +717,7 @@ try {
|
|
|
717
717
|
}, 60_000, 'T3b ordered lifecycle');
|
|
718
718
|
assert(!!t2bLifecycle, 'T3b ordered lifecycle not observed');
|
|
719
719
|
|
|
720
|
-
const t2bAfter = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats`);
|
|
720
|
+
const t2bAfter = await httpGet(`${BASE}/cards/${CHAT_CARD_ID}/chats?all-turns=true`);
|
|
721
721
|
assert(t2bAfter.status === 200, `T3b post chats returned ${t2bAfter.status}`);
|
|
722
722
|
const t2bAfterMessages = Array.isArray(t2bAfter.data?.messages) ? t2bAfter.data.messages : [];
|
|
723
723
|
const t2bNewMessages = t2bAfterMessages.slice(t2bSendBaseline);
|
|
@@ -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.5.0/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.5.0/browser/live-cards.js"></script>
|
|
15
|
+
<script src="https://cdn.jsdelivr.net/npm/yaml-flow@8.5.0/browser/board-livecards-localstorage.js"></script>
|
|
16
16
|
</head>
|
|
17
17
|
<body class="bg-light">
|
|
18
18
|
<div class="container-fluid py-3">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as CommandInput, C as CommandResult } from './board-live-cards-public-CvkDfZQ7.cjs';
|
|
2
2
|
import { A as ArtifactInfo, a as ArtifactsStore } from './artifacts-store-lib-CVgtQrNZ.cjs';
|
|
3
3
|
import './storage-interface-B2WD9D5n.cjs';
|
|
4
4
|
import './execution-refs.cjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as CommandInput, C as CommandResult } from './board-live-cards-public-DdVhH4M-.js';
|
|
2
2
|
import { A as ArtifactInfo, a as ArtifactsStore } from './artifacts-store-lib-D-k-E8Vy.js';
|
|
3
3
|
import './storage-interface-B2WD9D5n.js';
|
|
4
4
|
import './execution-refs.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';function m(a,i){if(a?.status==="success")return Object.prototype.hasOwnProperty.call(a,"data")?a.data:void 0;throw a?.status==="fail"||a?.status==="error"?new Error(a.error||`${i} failed`):new Error(`${i} returned an unexpected response`)}function d(a){return a&&typeof a=="object"&&!Array.isArray(a)?a:{}}function C(a){return Array.isArray(a)?a:[]}function F(a,i){if(typeof i!="string"||i.length===0)return;let c=a,p=i;p.startsWith("fetched_sources.")&&(c=d(a).fetched_sources,p=p.slice(16));for(let x of p.split(".")){if(c==null||typeof c!="object")return;c=c[x];}return c}function G(a,i){let c=d(a.view),p=C(c.elements);return {layout:c.layout,features:c.features,elements:p.map((x,T)=>{let k=d(x),v=d(k.data),q=typeof k.visible=="string"?!!F(i,k.visible):true,A=typeof v.bind=="string"?v.bind:void 0,M=A?F(i,A):void 0,I={id:typeof k.id=="string"&&k.id?k.id:`element-${T}`,kind:k.kind,label:k.label,visible:q};return A&&(I.bind=A),Array.isArray(v.columns)&&(I.columns=v.columns),typeof v.maxRows=="number"&&(I.maxRows=v.maxRows),M!==void 0&&(I.resolved=Array.isArray(M)&&typeof I.maxRows=="number"?M.slice(0,I.maxRows):M),I})}}function Q(a){if(typeof a!="string"||!a.trim())return null;let i=/^(file uploaded|AI generated|AI geneterated):\s*.*?#(\d+)\s*$/i.exec(a.trim());if(!i)return null;let c=Number.parseInt(i[2],10);return !Number.isInteger(c)||c<0?null:c}function X(a){return {"card-content":a}}function O(a,i){let c=m(a.get({params:{id:i}}),"cardStore.get"),p=Array.isArray(c?.cards)?c.cards:[];if(p.length===0)throw new Error(`Card "${i}" not found`);return p[0]}function Z(a){let{board:i,nonCore:c,cardStore:p,chatStore:x,uploadCardFile:T,buildFileDownloadUrl:k,readFetchedSourceJsonByRef:v}=a;function q(r){if(Array.isArray(r.bytes))return new Uint8Array(r.bytes.map(e=>Math.max(0,Math.min(255,Number(e)||0))));if(typeof r.text=="string")return new TextEncoder().encode(r.text);if(typeof r.base64=="string"){let e=String(r.base64).replace(/-/g,"+").replace(/_/g,"/"),n=e+"=".repeat((4-e.length%4)%4),f=atob(n);return Uint8Array.from(f,o=>o.charCodeAt(0))}throw new Error("file entry requires bytes, text, or base64")}function A(){let r=d(m(c.describeTaskExecutorCapabilities({}),"describeTaskExecutorCapabilities"));return {version:r.version,commonSourceFields:d(r.commonSourceDefFields),sourceKinds:d(r.sourceKinds)}}function M(){let r=d(m(i.status({}),"status")),e=d(r.summary),n=C(r.cards);return {meta:d(r.meta),summary:{card_count:typeof e.card_count=="number"?e.card_count:0,completed:typeof e.completed=="number"?e.completed:0,eligible:typeof e.eligible=="number"?e.eligible:0,pending:typeof e.pending=="number"?e.pending:0,blocked:typeof e.blocked=="number"?e.blocked:0,in_progress:typeof e.in_progress=="number"?e.in_progress:0,failed:typeof e.failed=="number"?e.failed:0,unresolved:typeof e.unresolved=="number"?e.unresolved:0},cards:n.map(f=>{let o=d(f);return {"card-id":typeof o.name=="string"?o.name:null,status:o.status??null,error:o.error??null,requires:C(o.requires),requires_satisfied:C(o.requires_satisfied),requires_missing:C(o.requires_missing),provides_declared:C(o.provides_declared),provides_runtime:C(o.provides_runtime)}})}}function I(r){let e=String(r.cardId||"").trim();if(!e)throw new Error("inspectCardDefinitionAndRuntime requires cardId");let n=d(m(i.status({}),"status")),o=C(n.cards).map(d).find(s=>s.name===e);if(!o)throw new Error(`card "${e}" not found in board status`);let t=d(O(p,e)),g=C(o.requires_satisfied).filter(s=>typeof s=="string"&&!!s),b=C(o.provides_runtime).filter(s=>typeof s=="string"&&!!s),l=Object.fromEntries(g.map(s=>[s,m(i.getOutputsDataObject({params:{key:s}}),`getOutputsDataObject(${s})`)])),w=Object.fromEntries(b.map(s=>[s,m(i.getOutputsDataObject({params:{key:s}}),`getOutputsDataObject(${s})`)])),_=d(m(i.getOutputsComputedValues({params:{key:e}}),"getOutputsComputedValues")),U=m(i.getOutputsFetchedSources({params:{key:e}}),"getOutputsFetchedSources"),L=C(t.source_defs).map(d),u={};for(let s of L)typeof s.bindTo=="string"&&typeof s.outputFile=="string"&&(u[s.outputFile]=s.bindTo);let h={};for(let[s,B]of Object.entries(U)){let y=u[s]??s;if(!v||typeof B!="string"){h[y]=null;continue}try{h[y]=v({cardId:e,ref:B});}catch{h[y]=null;}}let R={card_data:d(t.card_data),requires:l,fetched_sources:h,computed_values:_};return {cardId:e,card_status_in_board:o,card_definition_and_static_data:t,refs_for_fetched_source_files:U,runtime_data:{requires:l,provides:w,computed_values:_,rendered_view:G(t,R)}}}function j(r){let e=String(r.cardId||"").trim();if(!e)throw new Error("inspectChatMessagesOnCards requires cardId");let n=typeof r.turnId=="string"?r.turnId:"",f=r.allTurns===true,o=typeof r.tailTurnsBeforeId=="string"?r.tailTurnsBeforeId:"",t=f?void 0:r.lastUserTurns??(n?void 0:1),g=r.tail,b=t===void 0?{params:{cardId:e}}:{params:{cardId:e},body:{lastUserTurns:t}},l=m(x.readAll(b),"chatStore.readAll"),w=d(O(p,e)),_=C(d(w.card_data).files).map((u,h)=>({idx:h,stored_name:d(u).stored_name})).filter(u=>typeof u.stored_name=="string"&&u.stored_name.length>0),U=(Array.isArray(l.records)?l.records:[]).filter(u=>n?typeof u?.turn=="string"?u.turn===n:n==="":true);if(o){if(t===void 0||!Number.isInteger(t)||t<=0)throw new Error("inspectChatMessagesOnCards requires tail-turns when tail-turns-before-id is provided");let u=new Map,h=[];for(let y of Array.isArray(l.records)?l.records:[]){let S=typeof y?.turn=="string"?y.turn:"";u.has(S)||(u.set(S,[]),h.push(S)),u.get(S).push(y);}let R=h.findIndex(y=>y===o),s=Math.max(0,R-t);U=(R===-1?[]:h.slice(s,R)).flatMap(y=>u.get(y)??[]);}let L=U.map(u=>{let R=d(u.payload),s={...u},B=typeof u?.role=="string"?u.role:typeof R.role=="string"?String(R.role):"",y=typeof u?.text=="string"?u.text:typeof R.text=="string"?String(R.text):"";if(B==="system"){let S=Q(y);if(S!==null&&_.some(D=>D.idx===S)){let D=`Retrieve using inspect-file-contents --card-id ${e} --file-idx ${S}`;s.retrieval_hint=D,Object.keys(R).length>0&&typeof u.role!="string"&&(s.payload={...R,retrieval_hint:D});}}return s});return {cardId:e,messages:typeof g=="number"&&g>=0?L.slice(-g):L}}function P(r){let e=String(r.cardId||"").trim(),n=Number(r.fileIdx);if(!e)throw new Error("inspectFileContents requires cardId");if(!Number.isInteger(n)||n<0)throw new Error("inspectFileContents requires fileIdx to be a non-negative integer");let f=d(O(p,e)),o=C(d(f.card_data).files).map(d);if(n>=o.length)throw new Error(`attachment index ${n} is out of range for card "${e}"`);let t=o[n],g=typeof t.stored_name=="string"?t.stored_name:null;return {cardId:e,fileIdx:n,downloadUrl:k({cardId:e,fileIdx:n,storedName:g}),...typeof t.name=="string"?{name:t.name}:{},...typeof t.stored_name=="string"?{stored_name:t.stored_name}:{},...typeof t.mime_type=="string"?{mime_type:t.mime_type}:{},...typeof t.size=="number"?{size:t.size}:{},...typeof t.uploaded_at=="string"?{uploaded_at:t.uploaded_at}:{}}}function E(r){return c.validateCardPreflight({body:X(r.candidateCardContent)})}function $(r){return c.evalCardCompute({body:{"card-content":r.candidateCardContent,"mock-requires":r.mockRequires,"mock-fetched-sources":r.mockFetchedSources}})}function N(r){return c.probeSourcePreflight({params:{sourceIdx:r.sourceIdx},body:{"card-content":r.candidateCardContent,"mock-projections":r.mockProjections}})}function V(r){return c.runSourcePreflight({params:{sourceIdx:r.sourceIdx},body:{"card-content":r.candidateCardContent,"mock-projections":r.mockProjections}})}function K(r){return c.simulateCardCycle({body:{"card-content":r.candidateCardContent,"mock-requires":r.mockRequires}})}function z(r){let e=String(r.cardId||"").trim();if(!e)throw new Error("manageReadCard requires cardId");let n=m(p.get({params:{id:e}}),"cardStore.get");return Array.isArray(n.cards)?n.cards:[]}function W(r){let e=String(r.cardId||"").trim(),n=String(r.role||"").trim(),f=typeof r.text=="string"?r.text:"",o=typeof r.turn=="string"?r.turn:"";if(!e)throw new Error("manageAddChatEntryAndAnyAttachments requires cardId");if(!n)throw new Error("manageAddChatEntryAndAnyAttachments requires role");let t=C(r.files).map(b=>{let l=d(b),w=String(l.file_name??l.fileName??l.name??"").trim(),_=String(l.content_type??l.contentType??"application/octet-stream");if(!w)throw new Error("file entry requires file_name");return T({cardId:e,fileName:w,contentType:_,bytes:q(l)}).file});t.forEach((b,l)=>{let w=n==="assistant"?`AI generated: ${String(b.name||"")} as ${String(b.stored_name||"")} #${l}`:`file uploaded: ${String(b.name||"")} as ${String(b.stored_name||"")} #${l}`;m(x.append({params:{cardId:e},body:{role:"system",text:w,files:[],turn:o}}),"chatStore.append(system attachment message)");});let g=m(x.append({params:{cardId:e},body:{role:n,text:f,files:t,turn:o}}),"chatStore.append");return {status:"success",data:{cardId:e,id:String(g.id),role:n,turn:o,files:t}}}function J(r){let e=String(r.cardId||"").trim(),n=d(r.candidateCardContent);if(!e)throw new Error("manageUpsertCard requires cardId");if(typeof n.id!="string"||!n.id.trim())throw new Error("candidateCardContent.id must be a non-empty string");if(n.id!==e)throw new Error(`candidateCardContent.id must match cardId (${e})`);let f=E({candidateCardContent:n}),o=d(f),t=d(o.data);if(o.status!=="success"||t.isValid!==true)return {status:"fail",step:"validate",validation:f};let g=null;try{g=O(p,e);}catch{g=null;}let b=p.set({body:n});m(b,"cardStore.set");let l;try{l=i.upsertCard({params:{cardId:e,restart:!0}}),m(l,"upsertCard");}catch(_){try{g&&p.set({body:g});}catch{}throw _}let w=null;try{w=i.cardRefreshedNotify({params:{cardId:e}}),m(w,"cardRefreshedNotify");}catch{w=null;}return {status:"success",data:{validation:f,card_saved:null,board_result:l,refresh_notify:w}}}function H(r){let e=String(r.cardId||"").trim();if(!e)throw new Error("manageDeprecate requires cardId");let n=i.removeCard({params:{id:e}});return m(n,"removeCard"),n}return {discoverSourceKinds:A,inspectBoardRuntimeStatus:M,inspectCardDefinitionAndRuntime:I,inspectChatMessagesOnCards:j,inspectFileContents:P,preflightValidateCandidateCardDefinition:E,preflightMaterializeCandidateCard:$,preflightProbeSingleSourceInCandidateCard:N,preflightRunSingleSourceInCandidateCard:V,preflightRunOneCycleWithCandidateCard:K,manageReadCard:z,manageAddChatEntryAndAnyAttachments:W,manageUpsertCard:J,manageDeprecate:H}}exports.createBoardLiveCardsMcp=Z;//# sourceMappingURL=board-live-cards-mcp.cjs.map
|
|
2
|
+
//# sourceMappingURL=board-live-cards-mcp.cjs.map
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { L as LiveCard, C as CommandResult } from './board-live-cards-public-CvkDfZQ7.cjs';
|
|
2
|
+
import { CardStorePublic } from './card-store-public.cjs';
|
|
3
|
+
import { ChatStorePublic } from './chat-store-public.cjs';
|
|
4
|
+
import { C as ChatRecord } from './chat-storage-lib-0imhRX3l.cjs';
|
|
5
|
+
import './storage-interface-B2WD9D5n.cjs';
|
|
6
|
+
import './execution-refs.cjs';
|
|
7
|
+
import './types-BBhqYGhE.cjs';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* board-live-cards-mcp.ts
|
|
11
|
+
*
|
|
12
|
+
* Platform-free MCP-oriented facade for board-live-cards.
|
|
13
|
+
*
|
|
14
|
+
* This layer preserves the wrapper-script-visible tool semantics while using
|
|
15
|
+
* the existing public library surfaces instead of shelling out to CLIs.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
type UnknownRecord = Record<string, unknown>;
|
|
19
|
+
interface BoardLiveCardsMcpFileDownloadDescriptor {
|
|
20
|
+
cardId: string;
|
|
21
|
+
fileIdx: number;
|
|
22
|
+
downloadUrl: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
stored_name?: string;
|
|
25
|
+
mime_type?: string;
|
|
26
|
+
size?: number;
|
|
27
|
+
uploaded_at?: string;
|
|
28
|
+
}
|
|
29
|
+
interface BoardLiveCardsMcpDiscoverSourceKindsResult {
|
|
30
|
+
version?: unknown;
|
|
31
|
+
commonSourceFields: UnknownRecord;
|
|
32
|
+
sourceKinds: UnknownRecord;
|
|
33
|
+
}
|
|
34
|
+
interface BoardLiveCardsMcpBoardStatusCard {
|
|
35
|
+
'card-id': string | null;
|
|
36
|
+
status: unknown;
|
|
37
|
+
error: unknown;
|
|
38
|
+
requires: unknown[];
|
|
39
|
+
requires_satisfied: unknown[];
|
|
40
|
+
requires_missing: unknown[];
|
|
41
|
+
provides_declared: unknown[];
|
|
42
|
+
provides_runtime: unknown[];
|
|
43
|
+
}
|
|
44
|
+
interface BoardLiveCardsMcpBoardStatusResult {
|
|
45
|
+
meta: UnknownRecord;
|
|
46
|
+
summary: {
|
|
47
|
+
card_count: number;
|
|
48
|
+
completed: number;
|
|
49
|
+
eligible: number;
|
|
50
|
+
pending: number;
|
|
51
|
+
blocked: number;
|
|
52
|
+
in_progress: number;
|
|
53
|
+
failed: number;
|
|
54
|
+
unresolved: number;
|
|
55
|
+
};
|
|
56
|
+
cards: BoardLiveCardsMcpBoardStatusCard[];
|
|
57
|
+
}
|
|
58
|
+
interface BoardLiveCardsMcpRenderedViewElement {
|
|
59
|
+
id: string;
|
|
60
|
+
kind: unknown;
|
|
61
|
+
label: unknown;
|
|
62
|
+
visible: boolean;
|
|
63
|
+
bind?: string;
|
|
64
|
+
columns?: unknown[];
|
|
65
|
+
maxRows?: number;
|
|
66
|
+
resolved?: unknown;
|
|
67
|
+
}
|
|
68
|
+
interface BoardLiveCardsMcpRenderedView {
|
|
69
|
+
layout: unknown;
|
|
70
|
+
features: unknown;
|
|
71
|
+
elements: BoardLiveCardsMcpRenderedViewElement[];
|
|
72
|
+
}
|
|
73
|
+
interface BoardLiveCardsMcpInspectCardDefinitionAndRuntimeResult {
|
|
74
|
+
cardId: string;
|
|
75
|
+
card_status_in_board: UnknownRecord;
|
|
76
|
+
card_definition_and_static_data: UnknownRecord;
|
|
77
|
+
refs_for_fetched_source_files: Record<string, string>;
|
|
78
|
+
runtime_data: {
|
|
79
|
+
requires: Record<string, unknown>;
|
|
80
|
+
provides: Record<string, unknown>;
|
|
81
|
+
computed_values: UnknownRecord;
|
|
82
|
+
rendered_view: BoardLiveCardsMcpRenderedView;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
interface BoardLiveCardsMcpInspectChatMessagesResult {
|
|
86
|
+
cardId: string;
|
|
87
|
+
messages: Array<ChatRecord & {
|
|
88
|
+
retrieval_hint?: string;
|
|
89
|
+
payload?: UnknownRecord;
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
interface BoardLiveCardsMcpManageUpsertCardFailureResult {
|
|
93
|
+
status: 'fail';
|
|
94
|
+
step: 'validate';
|
|
95
|
+
validation: unknown;
|
|
96
|
+
}
|
|
97
|
+
interface BoardLiveCardsMcpManageUpsertCardSuccessResult {
|
|
98
|
+
status: 'success';
|
|
99
|
+
data: {
|
|
100
|
+
validation: unknown;
|
|
101
|
+
card_saved: unknown;
|
|
102
|
+
board_result: unknown;
|
|
103
|
+
refresh_notify: unknown;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
type BoardLiveCardsMcpManageUpsertCardResult = BoardLiveCardsMcpManageUpsertCardFailureResult | BoardLiveCardsMcpManageUpsertCardSuccessResult;
|
|
107
|
+
interface BoardLiveCardsMcpManageAddChatEntryAndAnyAttachmentsResult {
|
|
108
|
+
status: 'success';
|
|
109
|
+
data: {
|
|
110
|
+
cardId: string;
|
|
111
|
+
id: string;
|
|
112
|
+
role: string;
|
|
113
|
+
turn: string;
|
|
114
|
+
files: Array<Record<string, unknown>>;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
interface BoardLiveCardsMcpBoardDeps {
|
|
118
|
+
status(input: {}): CommandResult;
|
|
119
|
+
getOutputsDataObject(input: {
|
|
120
|
+
params: {
|
|
121
|
+
key: string;
|
|
122
|
+
};
|
|
123
|
+
}): CommandResult;
|
|
124
|
+
getOutputsComputedValues(input: {
|
|
125
|
+
params: {
|
|
126
|
+
key: string;
|
|
127
|
+
};
|
|
128
|
+
}): CommandResult;
|
|
129
|
+
getOutputsFetchedSources(input: {
|
|
130
|
+
params: {
|
|
131
|
+
key: string;
|
|
132
|
+
};
|
|
133
|
+
}): CommandResult<Record<string, string>>;
|
|
134
|
+
removeCard(input: {
|
|
135
|
+
params: {
|
|
136
|
+
id: string;
|
|
137
|
+
};
|
|
138
|
+
}): CommandResult;
|
|
139
|
+
cardRefreshedNotify(input: {
|
|
140
|
+
params: {
|
|
141
|
+
cardId: string;
|
|
142
|
+
};
|
|
143
|
+
}): CommandResult;
|
|
144
|
+
upsertCard(input: {
|
|
145
|
+
params: {
|
|
146
|
+
cardId: string;
|
|
147
|
+
restart?: boolean;
|
|
148
|
+
};
|
|
149
|
+
}): CommandResult;
|
|
150
|
+
}
|
|
151
|
+
interface BoardLiveCardsMcpNonCoreDeps {
|
|
152
|
+
describeTaskExecutorCapabilities(input: {}): CommandResult;
|
|
153
|
+
validateCardPreflight(input: {
|
|
154
|
+
body: unknown;
|
|
155
|
+
}): CommandResult;
|
|
156
|
+
evalCardCompute(input: {
|
|
157
|
+
body: unknown;
|
|
158
|
+
}): CommandResult;
|
|
159
|
+
probeSourcePreflight(input: {
|
|
160
|
+
params: {
|
|
161
|
+
sourceIdx: number;
|
|
162
|
+
};
|
|
163
|
+
body: unknown;
|
|
164
|
+
}): CommandResult;
|
|
165
|
+
runSourcePreflight(input: {
|
|
166
|
+
params: {
|
|
167
|
+
sourceIdx: number;
|
|
168
|
+
};
|
|
169
|
+
body: unknown;
|
|
170
|
+
}): CommandResult;
|
|
171
|
+
simulateCardCycle(input: {
|
|
172
|
+
body: unknown;
|
|
173
|
+
}): CommandResult;
|
|
174
|
+
}
|
|
175
|
+
interface BoardLiveCardsMcpDeps {
|
|
176
|
+
board: BoardLiveCardsMcpBoardDeps;
|
|
177
|
+
nonCore: BoardLiveCardsMcpNonCoreDeps;
|
|
178
|
+
cardStore: CardStorePublic;
|
|
179
|
+
chatStore: ChatStorePublic;
|
|
180
|
+
uploadCardFile(args: {
|
|
181
|
+
cardId: string;
|
|
182
|
+
fileName: string;
|
|
183
|
+
contentType: string;
|
|
184
|
+
bytes: Uint8Array;
|
|
185
|
+
}): {
|
|
186
|
+
ok: true;
|
|
187
|
+
file: Record<string, unknown>;
|
|
188
|
+
};
|
|
189
|
+
buildFileDownloadUrl(args: {
|
|
190
|
+
cardId: string;
|
|
191
|
+
fileIdx: number;
|
|
192
|
+
storedName?: string | null;
|
|
193
|
+
}): string;
|
|
194
|
+
readFetchedSourceJsonByRef?(args: {
|
|
195
|
+
cardId: string;
|
|
196
|
+
ref: string;
|
|
197
|
+
}): unknown | null;
|
|
198
|
+
}
|
|
199
|
+
interface BoardLiveCardsMcp {
|
|
200
|
+
discoverSourceKinds(): BoardLiveCardsMcpDiscoverSourceKindsResult;
|
|
201
|
+
inspectBoardRuntimeStatus(): BoardLiveCardsMcpBoardStatusResult;
|
|
202
|
+
inspectCardDefinitionAndRuntime(args: {
|
|
203
|
+
cardId: string;
|
|
204
|
+
}): BoardLiveCardsMcpInspectCardDefinitionAndRuntimeResult;
|
|
205
|
+
inspectChatMessagesOnCards(args: {
|
|
206
|
+
cardId: string;
|
|
207
|
+
lastUserTurns?: number;
|
|
208
|
+
tail?: number;
|
|
209
|
+
turnId?: string;
|
|
210
|
+
allTurns?: boolean;
|
|
211
|
+
tailTurnsBeforeId?: string;
|
|
212
|
+
}): BoardLiveCardsMcpInspectChatMessagesResult;
|
|
213
|
+
inspectFileContents(args: {
|
|
214
|
+
cardId: string;
|
|
215
|
+
fileIdx: number;
|
|
216
|
+
}): BoardLiveCardsMcpFileDownloadDescriptor;
|
|
217
|
+
preflightValidateCandidateCardDefinition(args: {
|
|
218
|
+
candidateCardContent: UnknownRecord;
|
|
219
|
+
}): unknown;
|
|
220
|
+
preflightMaterializeCandidateCard(args: {
|
|
221
|
+
candidateCardContent: UnknownRecord;
|
|
222
|
+
mockRequires: UnknownRecord;
|
|
223
|
+
mockFetchedSources: UnknownRecord;
|
|
224
|
+
}): unknown;
|
|
225
|
+
preflightProbeSingleSourceInCandidateCard(args: {
|
|
226
|
+
candidateCardContent: UnknownRecord;
|
|
227
|
+
mockProjections: UnknownRecord;
|
|
228
|
+
sourceIdx: number;
|
|
229
|
+
}): unknown;
|
|
230
|
+
preflightRunSingleSourceInCandidateCard(args: {
|
|
231
|
+
candidateCardContent: UnknownRecord;
|
|
232
|
+
mockProjections: UnknownRecord;
|
|
233
|
+
sourceIdx: number;
|
|
234
|
+
}): unknown;
|
|
235
|
+
preflightRunOneCycleWithCandidateCard(args: {
|
|
236
|
+
candidateCardContent: UnknownRecord;
|
|
237
|
+
mockRequires: UnknownRecord;
|
|
238
|
+
}): unknown;
|
|
239
|
+
manageReadCard(args: {
|
|
240
|
+
cardId: string;
|
|
241
|
+
}): LiveCard[];
|
|
242
|
+
manageAddChatEntryAndAnyAttachments(args: {
|
|
243
|
+
cardId: string;
|
|
244
|
+
role: string;
|
|
245
|
+
text?: string;
|
|
246
|
+
turn?: string;
|
|
247
|
+
files?: unknown[];
|
|
248
|
+
}): BoardLiveCardsMcpManageAddChatEntryAndAnyAttachmentsResult;
|
|
249
|
+
manageUpsertCard(args: {
|
|
250
|
+
cardId: string;
|
|
251
|
+
candidateCardContent: UnknownRecord;
|
|
252
|
+
}): BoardLiveCardsMcpManageUpsertCardResult;
|
|
253
|
+
manageDeprecate(args: {
|
|
254
|
+
cardId: string;
|
|
255
|
+
}): unknown;
|
|
256
|
+
}
|
|
257
|
+
declare function createBoardLiveCardsMcp(deps: BoardLiveCardsMcpDeps): BoardLiveCardsMcp;
|
|
258
|
+
|
|
259
|
+
export { type BoardLiveCardsMcp, type BoardLiveCardsMcpBoardDeps, type BoardLiveCardsMcpBoardStatusCard, type BoardLiveCardsMcpBoardStatusResult, type BoardLiveCardsMcpDeps, type BoardLiveCardsMcpDiscoverSourceKindsResult, type BoardLiveCardsMcpFileDownloadDescriptor, type BoardLiveCardsMcpInspectCardDefinitionAndRuntimeResult, type BoardLiveCardsMcpInspectChatMessagesResult, type BoardLiveCardsMcpManageAddChatEntryAndAnyAttachmentsResult, type BoardLiveCardsMcpManageUpsertCardFailureResult, type BoardLiveCardsMcpManageUpsertCardResult, type BoardLiveCardsMcpManageUpsertCardSuccessResult, type BoardLiveCardsMcpNonCoreDeps, type BoardLiveCardsMcpRenderedView, type BoardLiveCardsMcpRenderedViewElement, createBoardLiveCardsMcp };
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { L as LiveCard, C as CommandResult } from './board-live-cards-public-DdVhH4M-.js';
|
|
2
|
+
import { CardStorePublic } from './card-store-public.js';
|
|
3
|
+
import { ChatStorePublic } from './chat-store-public.js';
|
|
4
|
+
import { C as ChatRecord } from './chat-storage-lib-CJn7a6OH.js';
|
|
5
|
+
import './storage-interface-B2WD9D5n.js';
|
|
6
|
+
import './execution-refs.js';
|
|
7
|
+
import './types-BBhqYGhE.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* board-live-cards-mcp.ts
|
|
11
|
+
*
|
|
12
|
+
* Platform-free MCP-oriented facade for board-live-cards.
|
|
13
|
+
*
|
|
14
|
+
* This layer preserves the wrapper-script-visible tool semantics while using
|
|
15
|
+
* the existing public library surfaces instead of shelling out to CLIs.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
type UnknownRecord = Record<string, unknown>;
|
|
19
|
+
interface BoardLiveCardsMcpFileDownloadDescriptor {
|
|
20
|
+
cardId: string;
|
|
21
|
+
fileIdx: number;
|
|
22
|
+
downloadUrl: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
stored_name?: string;
|
|
25
|
+
mime_type?: string;
|
|
26
|
+
size?: number;
|
|
27
|
+
uploaded_at?: string;
|
|
28
|
+
}
|
|
29
|
+
interface BoardLiveCardsMcpDiscoverSourceKindsResult {
|
|
30
|
+
version?: unknown;
|
|
31
|
+
commonSourceFields: UnknownRecord;
|
|
32
|
+
sourceKinds: UnknownRecord;
|
|
33
|
+
}
|
|
34
|
+
interface BoardLiveCardsMcpBoardStatusCard {
|
|
35
|
+
'card-id': string | null;
|
|
36
|
+
status: unknown;
|
|
37
|
+
error: unknown;
|
|
38
|
+
requires: unknown[];
|
|
39
|
+
requires_satisfied: unknown[];
|
|
40
|
+
requires_missing: unknown[];
|
|
41
|
+
provides_declared: unknown[];
|
|
42
|
+
provides_runtime: unknown[];
|
|
43
|
+
}
|
|
44
|
+
interface BoardLiveCardsMcpBoardStatusResult {
|
|
45
|
+
meta: UnknownRecord;
|
|
46
|
+
summary: {
|
|
47
|
+
card_count: number;
|
|
48
|
+
completed: number;
|
|
49
|
+
eligible: number;
|
|
50
|
+
pending: number;
|
|
51
|
+
blocked: number;
|
|
52
|
+
in_progress: number;
|
|
53
|
+
failed: number;
|
|
54
|
+
unresolved: number;
|
|
55
|
+
};
|
|
56
|
+
cards: BoardLiveCardsMcpBoardStatusCard[];
|
|
57
|
+
}
|
|
58
|
+
interface BoardLiveCardsMcpRenderedViewElement {
|
|
59
|
+
id: string;
|
|
60
|
+
kind: unknown;
|
|
61
|
+
label: unknown;
|
|
62
|
+
visible: boolean;
|
|
63
|
+
bind?: string;
|
|
64
|
+
columns?: unknown[];
|
|
65
|
+
maxRows?: number;
|
|
66
|
+
resolved?: unknown;
|
|
67
|
+
}
|
|
68
|
+
interface BoardLiveCardsMcpRenderedView {
|
|
69
|
+
layout: unknown;
|
|
70
|
+
features: unknown;
|
|
71
|
+
elements: BoardLiveCardsMcpRenderedViewElement[];
|
|
72
|
+
}
|
|
73
|
+
interface BoardLiveCardsMcpInspectCardDefinitionAndRuntimeResult {
|
|
74
|
+
cardId: string;
|
|
75
|
+
card_status_in_board: UnknownRecord;
|
|
76
|
+
card_definition_and_static_data: UnknownRecord;
|
|
77
|
+
refs_for_fetched_source_files: Record<string, string>;
|
|
78
|
+
runtime_data: {
|
|
79
|
+
requires: Record<string, unknown>;
|
|
80
|
+
provides: Record<string, unknown>;
|
|
81
|
+
computed_values: UnknownRecord;
|
|
82
|
+
rendered_view: BoardLiveCardsMcpRenderedView;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
interface BoardLiveCardsMcpInspectChatMessagesResult {
|
|
86
|
+
cardId: string;
|
|
87
|
+
messages: Array<ChatRecord & {
|
|
88
|
+
retrieval_hint?: string;
|
|
89
|
+
payload?: UnknownRecord;
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
interface BoardLiveCardsMcpManageUpsertCardFailureResult {
|
|
93
|
+
status: 'fail';
|
|
94
|
+
step: 'validate';
|
|
95
|
+
validation: unknown;
|
|
96
|
+
}
|
|
97
|
+
interface BoardLiveCardsMcpManageUpsertCardSuccessResult {
|
|
98
|
+
status: 'success';
|
|
99
|
+
data: {
|
|
100
|
+
validation: unknown;
|
|
101
|
+
card_saved: unknown;
|
|
102
|
+
board_result: unknown;
|
|
103
|
+
refresh_notify: unknown;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
type BoardLiveCardsMcpManageUpsertCardResult = BoardLiveCardsMcpManageUpsertCardFailureResult | BoardLiveCardsMcpManageUpsertCardSuccessResult;
|
|
107
|
+
interface BoardLiveCardsMcpManageAddChatEntryAndAnyAttachmentsResult {
|
|
108
|
+
status: 'success';
|
|
109
|
+
data: {
|
|
110
|
+
cardId: string;
|
|
111
|
+
id: string;
|
|
112
|
+
role: string;
|
|
113
|
+
turn: string;
|
|
114
|
+
files: Array<Record<string, unknown>>;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
interface BoardLiveCardsMcpBoardDeps {
|
|
118
|
+
status(input: {}): CommandResult;
|
|
119
|
+
getOutputsDataObject(input: {
|
|
120
|
+
params: {
|
|
121
|
+
key: string;
|
|
122
|
+
};
|
|
123
|
+
}): CommandResult;
|
|
124
|
+
getOutputsComputedValues(input: {
|
|
125
|
+
params: {
|
|
126
|
+
key: string;
|
|
127
|
+
};
|
|
128
|
+
}): CommandResult;
|
|
129
|
+
getOutputsFetchedSources(input: {
|
|
130
|
+
params: {
|
|
131
|
+
key: string;
|
|
132
|
+
};
|
|
133
|
+
}): CommandResult<Record<string, string>>;
|
|
134
|
+
removeCard(input: {
|
|
135
|
+
params: {
|
|
136
|
+
id: string;
|
|
137
|
+
};
|
|
138
|
+
}): CommandResult;
|
|
139
|
+
cardRefreshedNotify(input: {
|
|
140
|
+
params: {
|
|
141
|
+
cardId: string;
|
|
142
|
+
};
|
|
143
|
+
}): CommandResult;
|
|
144
|
+
upsertCard(input: {
|
|
145
|
+
params: {
|
|
146
|
+
cardId: string;
|
|
147
|
+
restart?: boolean;
|
|
148
|
+
};
|
|
149
|
+
}): CommandResult;
|
|
150
|
+
}
|
|
151
|
+
interface BoardLiveCardsMcpNonCoreDeps {
|
|
152
|
+
describeTaskExecutorCapabilities(input: {}): CommandResult;
|
|
153
|
+
validateCardPreflight(input: {
|
|
154
|
+
body: unknown;
|
|
155
|
+
}): CommandResult;
|
|
156
|
+
evalCardCompute(input: {
|
|
157
|
+
body: unknown;
|
|
158
|
+
}): CommandResult;
|
|
159
|
+
probeSourcePreflight(input: {
|
|
160
|
+
params: {
|
|
161
|
+
sourceIdx: number;
|
|
162
|
+
};
|
|
163
|
+
body: unknown;
|
|
164
|
+
}): CommandResult;
|
|
165
|
+
runSourcePreflight(input: {
|
|
166
|
+
params: {
|
|
167
|
+
sourceIdx: number;
|
|
168
|
+
};
|
|
169
|
+
body: unknown;
|
|
170
|
+
}): CommandResult;
|
|
171
|
+
simulateCardCycle(input: {
|
|
172
|
+
body: unknown;
|
|
173
|
+
}): CommandResult;
|
|
174
|
+
}
|
|
175
|
+
interface BoardLiveCardsMcpDeps {
|
|
176
|
+
board: BoardLiveCardsMcpBoardDeps;
|
|
177
|
+
nonCore: BoardLiveCardsMcpNonCoreDeps;
|
|
178
|
+
cardStore: CardStorePublic;
|
|
179
|
+
chatStore: ChatStorePublic;
|
|
180
|
+
uploadCardFile(args: {
|
|
181
|
+
cardId: string;
|
|
182
|
+
fileName: string;
|
|
183
|
+
contentType: string;
|
|
184
|
+
bytes: Uint8Array;
|
|
185
|
+
}): {
|
|
186
|
+
ok: true;
|
|
187
|
+
file: Record<string, unknown>;
|
|
188
|
+
};
|
|
189
|
+
buildFileDownloadUrl(args: {
|
|
190
|
+
cardId: string;
|
|
191
|
+
fileIdx: number;
|
|
192
|
+
storedName?: string | null;
|
|
193
|
+
}): string;
|
|
194
|
+
readFetchedSourceJsonByRef?(args: {
|
|
195
|
+
cardId: string;
|
|
196
|
+
ref: string;
|
|
197
|
+
}): unknown | null;
|
|
198
|
+
}
|
|
199
|
+
interface BoardLiveCardsMcp {
|
|
200
|
+
discoverSourceKinds(): BoardLiveCardsMcpDiscoverSourceKindsResult;
|
|
201
|
+
inspectBoardRuntimeStatus(): BoardLiveCardsMcpBoardStatusResult;
|
|
202
|
+
inspectCardDefinitionAndRuntime(args: {
|
|
203
|
+
cardId: string;
|
|
204
|
+
}): BoardLiveCardsMcpInspectCardDefinitionAndRuntimeResult;
|
|
205
|
+
inspectChatMessagesOnCards(args: {
|
|
206
|
+
cardId: string;
|
|
207
|
+
lastUserTurns?: number;
|
|
208
|
+
tail?: number;
|
|
209
|
+
turnId?: string;
|
|
210
|
+
allTurns?: boolean;
|
|
211
|
+
tailTurnsBeforeId?: string;
|
|
212
|
+
}): BoardLiveCardsMcpInspectChatMessagesResult;
|
|
213
|
+
inspectFileContents(args: {
|
|
214
|
+
cardId: string;
|
|
215
|
+
fileIdx: number;
|
|
216
|
+
}): BoardLiveCardsMcpFileDownloadDescriptor;
|
|
217
|
+
preflightValidateCandidateCardDefinition(args: {
|
|
218
|
+
candidateCardContent: UnknownRecord;
|
|
219
|
+
}): unknown;
|
|
220
|
+
preflightMaterializeCandidateCard(args: {
|
|
221
|
+
candidateCardContent: UnknownRecord;
|
|
222
|
+
mockRequires: UnknownRecord;
|
|
223
|
+
mockFetchedSources: UnknownRecord;
|
|
224
|
+
}): unknown;
|
|
225
|
+
preflightProbeSingleSourceInCandidateCard(args: {
|
|
226
|
+
candidateCardContent: UnknownRecord;
|
|
227
|
+
mockProjections: UnknownRecord;
|
|
228
|
+
sourceIdx: number;
|
|
229
|
+
}): unknown;
|
|
230
|
+
preflightRunSingleSourceInCandidateCard(args: {
|
|
231
|
+
candidateCardContent: UnknownRecord;
|
|
232
|
+
mockProjections: UnknownRecord;
|
|
233
|
+
sourceIdx: number;
|
|
234
|
+
}): unknown;
|
|
235
|
+
preflightRunOneCycleWithCandidateCard(args: {
|
|
236
|
+
candidateCardContent: UnknownRecord;
|
|
237
|
+
mockRequires: UnknownRecord;
|
|
238
|
+
}): unknown;
|
|
239
|
+
manageReadCard(args: {
|
|
240
|
+
cardId: string;
|
|
241
|
+
}): LiveCard[];
|
|
242
|
+
manageAddChatEntryAndAnyAttachments(args: {
|
|
243
|
+
cardId: string;
|
|
244
|
+
role: string;
|
|
245
|
+
text?: string;
|
|
246
|
+
turn?: string;
|
|
247
|
+
files?: unknown[];
|
|
248
|
+
}): BoardLiveCardsMcpManageAddChatEntryAndAnyAttachmentsResult;
|
|
249
|
+
manageUpsertCard(args: {
|
|
250
|
+
cardId: string;
|
|
251
|
+
candidateCardContent: UnknownRecord;
|
|
252
|
+
}): BoardLiveCardsMcpManageUpsertCardResult;
|
|
253
|
+
manageDeprecate(args: {
|
|
254
|
+
cardId: string;
|
|
255
|
+
}): unknown;
|
|
256
|
+
}
|
|
257
|
+
declare function createBoardLiveCardsMcp(deps: BoardLiveCardsMcpDeps): BoardLiveCardsMcp;
|
|
258
|
+
|
|
259
|
+
export { type BoardLiveCardsMcp, type BoardLiveCardsMcpBoardDeps, type BoardLiveCardsMcpBoardStatusCard, type BoardLiveCardsMcpBoardStatusResult, type BoardLiveCardsMcpDeps, type BoardLiveCardsMcpDiscoverSourceKindsResult, type BoardLiveCardsMcpFileDownloadDescriptor, type BoardLiveCardsMcpInspectCardDefinitionAndRuntimeResult, type BoardLiveCardsMcpInspectChatMessagesResult, type BoardLiveCardsMcpManageAddChatEntryAndAnyAttachmentsResult, type BoardLiveCardsMcpManageUpsertCardFailureResult, type BoardLiveCardsMcpManageUpsertCardResult, type BoardLiveCardsMcpManageUpsertCardSuccessResult, type BoardLiveCardsMcpNonCoreDeps, type BoardLiveCardsMcpRenderedView, type BoardLiveCardsMcpRenderedViewElement, createBoardLiveCardsMcp };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function m(a,i){if(a?.status==="success")return Object.prototype.hasOwnProperty.call(a,"data")?a.data:void 0;throw a?.status==="fail"||a?.status==="error"?new Error(a.error||`${i} failed`):new Error(`${i} returned an unexpected response`)}function d(a){return a&&typeof a=="object"&&!Array.isArray(a)?a:{}}function C(a){return Array.isArray(a)?a:[]}function F(a,i){if(typeof i!="string"||i.length===0)return;let c=a,p=i;p.startsWith("fetched_sources.")&&(c=d(a).fetched_sources,p=p.slice(16));for(let x of p.split(".")){if(c==null||typeof c!="object")return;c=c[x];}return c}function G(a,i){let c=d(a.view),p=C(c.elements);return {layout:c.layout,features:c.features,elements:p.map((x,T)=>{let k=d(x),v=d(k.data),q=typeof k.visible=="string"?!!F(i,k.visible):true,A=typeof v.bind=="string"?v.bind:void 0,M=A?F(i,A):void 0,I={id:typeof k.id=="string"&&k.id?k.id:`element-${T}`,kind:k.kind,label:k.label,visible:q};return A&&(I.bind=A),Array.isArray(v.columns)&&(I.columns=v.columns),typeof v.maxRows=="number"&&(I.maxRows=v.maxRows),M!==void 0&&(I.resolved=Array.isArray(M)&&typeof I.maxRows=="number"?M.slice(0,I.maxRows):M),I})}}function Q(a){if(typeof a!="string"||!a.trim())return null;let i=/^(file uploaded|AI generated|AI geneterated):\s*.*?#(\d+)\s*$/i.exec(a.trim());if(!i)return null;let c=Number.parseInt(i[2],10);return !Number.isInteger(c)||c<0?null:c}function X(a){return {"card-content":a}}function O(a,i){let c=m(a.get({params:{id:i}}),"cardStore.get"),p=Array.isArray(c?.cards)?c.cards:[];if(p.length===0)throw new Error(`Card "${i}" not found`);return p[0]}function Z(a){let{board:i,nonCore:c,cardStore:p,chatStore:x,uploadCardFile:T,buildFileDownloadUrl:k,readFetchedSourceJsonByRef:v}=a;function q(r){if(Array.isArray(r.bytes))return new Uint8Array(r.bytes.map(e=>Math.max(0,Math.min(255,Number(e)||0))));if(typeof r.text=="string")return new TextEncoder().encode(r.text);if(typeof r.base64=="string"){let e=String(r.base64).replace(/-/g,"+").replace(/_/g,"/"),n=e+"=".repeat((4-e.length%4)%4),f=atob(n);return Uint8Array.from(f,o=>o.charCodeAt(0))}throw new Error("file entry requires bytes, text, or base64")}function A(){let r=d(m(c.describeTaskExecutorCapabilities({}),"describeTaskExecutorCapabilities"));return {version:r.version,commonSourceFields:d(r.commonSourceDefFields),sourceKinds:d(r.sourceKinds)}}function M(){let r=d(m(i.status({}),"status")),e=d(r.summary),n=C(r.cards);return {meta:d(r.meta),summary:{card_count:typeof e.card_count=="number"?e.card_count:0,completed:typeof e.completed=="number"?e.completed:0,eligible:typeof e.eligible=="number"?e.eligible:0,pending:typeof e.pending=="number"?e.pending:0,blocked:typeof e.blocked=="number"?e.blocked:0,in_progress:typeof e.in_progress=="number"?e.in_progress:0,failed:typeof e.failed=="number"?e.failed:0,unresolved:typeof e.unresolved=="number"?e.unresolved:0},cards:n.map(f=>{let o=d(f);return {"card-id":typeof o.name=="string"?o.name:null,status:o.status??null,error:o.error??null,requires:C(o.requires),requires_satisfied:C(o.requires_satisfied),requires_missing:C(o.requires_missing),provides_declared:C(o.provides_declared),provides_runtime:C(o.provides_runtime)}})}}function I(r){let e=String(r.cardId||"").trim();if(!e)throw new Error("inspectCardDefinitionAndRuntime requires cardId");let n=d(m(i.status({}),"status")),o=C(n.cards).map(d).find(s=>s.name===e);if(!o)throw new Error(`card "${e}" not found in board status`);let t=d(O(p,e)),g=C(o.requires_satisfied).filter(s=>typeof s=="string"&&!!s),b=C(o.provides_runtime).filter(s=>typeof s=="string"&&!!s),l=Object.fromEntries(g.map(s=>[s,m(i.getOutputsDataObject({params:{key:s}}),`getOutputsDataObject(${s})`)])),w=Object.fromEntries(b.map(s=>[s,m(i.getOutputsDataObject({params:{key:s}}),`getOutputsDataObject(${s})`)])),_=d(m(i.getOutputsComputedValues({params:{key:e}}),"getOutputsComputedValues")),U=m(i.getOutputsFetchedSources({params:{key:e}}),"getOutputsFetchedSources"),L=C(t.source_defs).map(d),u={};for(let s of L)typeof s.bindTo=="string"&&typeof s.outputFile=="string"&&(u[s.outputFile]=s.bindTo);let h={};for(let[s,B]of Object.entries(U)){let y=u[s]??s;if(!v||typeof B!="string"){h[y]=null;continue}try{h[y]=v({cardId:e,ref:B});}catch{h[y]=null;}}let R={card_data:d(t.card_data),requires:l,fetched_sources:h,computed_values:_};return {cardId:e,card_status_in_board:o,card_definition_and_static_data:t,refs_for_fetched_source_files:U,runtime_data:{requires:l,provides:w,computed_values:_,rendered_view:G(t,R)}}}function j(r){let e=String(r.cardId||"").trim();if(!e)throw new Error("inspectChatMessagesOnCards requires cardId");let n=typeof r.turnId=="string"?r.turnId:"",f=r.allTurns===true,o=typeof r.tailTurnsBeforeId=="string"?r.tailTurnsBeforeId:"",t=f?void 0:r.lastUserTurns??(n?void 0:1),g=r.tail,b=t===void 0?{params:{cardId:e}}:{params:{cardId:e},body:{lastUserTurns:t}},l=m(x.readAll(b),"chatStore.readAll"),w=d(O(p,e)),_=C(d(w.card_data).files).map((u,h)=>({idx:h,stored_name:d(u).stored_name})).filter(u=>typeof u.stored_name=="string"&&u.stored_name.length>0),U=(Array.isArray(l.records)?l.records:[]).filter(u=>n?typeof u?.turn=="string"?u.turn===n:n==="":true);if(o){if(t===void 0||!Number.isInteger(t)||t<=0)throw new Error("inspectChatMessagesOnCards requires tail-turns when tail-turns-before-id is provided");let u=new Map,h=[];for(let y of Array.isArray(l.records)?l.records:[]){let S=typeof y?.turn=="string"?y.turn:"";u.has(S)||(u.set(S,[]),h.push(S)),u.get(S).push(y);}let R=h.findIndex(y=>y===o),s=Math.max(0,R-t);U=(R===-1?[]:h.slice(s,R)).flatMap(y=>u.get(y)??[]);}let L=U.map(u=>{let R=d(u.payload),s={...u},B=typeof u?.role=="string"?u.role:typeof R.role=="string"?String(R.role):"",y=typeof u?.text=="string"?u.text:typeof R.text=="string"?String(R.text):"";if(B==="system"){let S=Q(y);if(S!==null&&_.some(D=>D.idx===S)){let D=`Retrieve using inspect-file-contents --card-id ${e} --file-idx ${S}`;s.retrieval_hint=D,Object.keys(R).length>0&&typeof u.role!="string"&&(s.payload={...R,retrieval_hint:D});}}return s});return {cardId:e,messages:typeof g=="number"&&g>=0?L.slice(-g):L}}function P(r){let e=String(r.cardId||"").trim(),n=Number(r.fileIdx);if(!e)throw new Error("inspectFileContents requires cardId");if(!Number.isInteger(n)||n<0)throw new Error("inspectFileContents requires fileIdx to be a non-negative integer");let f=d(O(p,e)),o=C(d(f.card_data).files).map(d);if(n>=o.length)throw new Error(`attachment index ${n} is out of range for card "${e}"`);let t=o[n],g=typeof t.stored_name=="string"?t.stored_name:null;return {cardId:e,fileIdx:n,downloadUrl:k({cardId:e,fileIdx:n,storedName:g}),...typeof t.name=="string"?{name:t.name}:{},...typeof t.stored_name=="string"?{stored_name:t.stored_name}:{},...typeof t.mime_type=="string"?{mime_type:t.mime_type}:{},...typeof t.size=="number"?{size:t.size}:{},...typeof t.uploaded_at=="string"?{uploaded_at:t.uploaded_at}:{}}}function E(r){return c.validateCardPreflight({body:X(r.candidateCardContent)})}function $(r){return c.evalCardCompute({body:{"card-content":r.candidateCardContent,"mock-requires":r.mockRequires,"mock-fetched-sources":r.mockFetchedSources}})}function N(r){return c.probeSourcePreflight({params:{sourceIdx:r.sourceIdx},body:{"card-content":r.candidateCardContent,"mock-projections":r.mockProjections}})}function V(r){return c.runSourcePreflight({params:{sourceIdx:r.sourceIdx},body:{"card-content":r.candidateCardContent,"mock-projections":r.mockProjections}})}function K(r){return c.simulateCardCycle({body:{"card-content":r.candidateCardContent,"mock-requires":r.mockRequires}})}function z(r){let e=String(r.cardId||"").trim();if(!e)throw new Error("manageReadCard requires cardId");let n=m(p.get({params:{id:e}}),"cardStore.get");return Array.isArray(n.cards)?n.cards:[]}function W(r){let e=String(r.cardId||"").trim(),n=String(r.role||"").trim(),f=typeof r.text=="string"?r.text:"",o=typeof r.turn=="string"?r.turn:"";if(!e)throw new Error("manageAddChatEntryAndAnyAttachments requires cardId");if(!n)throw new Error("manageAddChatEntryAndAnyAttachments requires role");let t=C(r.files).map(b=>{let l=d(b),w=String(l.file_name??l.fileName??l.name??"").trim(),_=String(l.content_type??l.contentType??"application/octet-stream");if(!w)throw new Error("file entry requires file_name");return T({cardId:e,fileName:w,contentType:_,bytes:q(l)}).file});t.forEach((b,l)=>{let w=n==="assistant"?`AI generated: ${String(b.name||"")} as ${String(b.stored_name||"")} #${l}`:`file uploaded: ${String(b.name||"")} as ${String(b.stored_name||"")} #${l}`;m(x.append({params:{cardId:e},body:{role:"system",text:w,files:[],turn:o}}),"chatStore.append(system attachment message)");});let g=m(x.append({params:{cardId:e},body:{role:n,text:f,files:t,turn:o}}),"chatStore.append");return {status:"success",data:{cardId:e,id:String(g.id),role:n,turn:o,files:t}}}function J(r){let e=String(r.cardId||"").trim(),n=d(r.candidateCardContent);if(!e)throw new Error("manageUpsertCard requires cardId");if(typeof n.id!="string"||!n.id.trim())throw new Error("candidateCardContent.id must be a non-empty string");if(n.id!==e)throw new Error(`candidateCardContent.id must match cardId (${e})`);let f=E({candidateCardContent:n}),o=d(f),t=d(o.data);if(o.status!=="success"||t.isValid!==true)return {status:"fail",step:"validate",validation:f};let g=null;try{g=O(p,e);}catch{g=null;}let b=p.set({body:n});m(b,"cardStore.set");let l;try{l=i.upsertCard({params:{cardId:e,restart:!0}}),m(l,"upsertCard");}catch(_){try{g&&p.set({body:g});}catch{}throw _}let w=null;try{w=i.cardRefreshedNotify({params:{cardId:e}}),m(w,"cardRefreshedNotify");}catch{w=null;}return {status:"success",data:{validation:f,card_saved:null,board_result:l,refresh_notify:w}}}function H(r){let e=String(r.cardId||"").trim();if(!e)throw new Error("manageDeprecate requires cardId");let n=i.removeCard({params:{id:e}});return m(n,"removeCard"),n}return {discoverSourceKinds:A,inspectBoardRuntimeStatus:M,inspectCardDefinitionAndRuntime:I,inspectChatMessagesOnCards:j,inspectFileContents:P,preflightValidateCandidateCardDefinition:E,preflightMaterializeCandidateCard:$,preflightProbeSingleSourceInCandidateCard:N,preflightRunSingleSourceInCandidateCard:V,preflightRunOneCycleWithCandidateCard:K,manageReadCard:z,manageAddChatEntryAndAnyAttachments:W,manageUpsertCard:J,manageDeprecate:H}}export{Z as createBoardLiveCardsMcp};//# sourceMappingURL=board-live-cards-mcp.js.map
|
|
2
|
+
//# sourceMappingURL=board-live-cards-mcp.js.map
|