workspai 0.65.0 → 0.67.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/README.md +28 -23
- package/contracts/agent-customization-pack.v1.json +4 -2
- package/contracts/analyze-last-run.v1.json +9 -1
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +117 -0
- package/contracts/extension-cli-compatibility.v1.json +6 -0
- package/contracts/published-contract-catalog.v1.json +30 -0
- package/contracts/runtime-command-surface.v1.json +100 -2
- package/contracts/workspace-activity-board.v1.json +114 -0
- package/contracts/workspace-activity-event.v1.json +132 -0
- package/contracts/workspace-activity-monitor-fleet.v1.json +18 -0
- package/contracts/workspace-activity-monitor-snapshot.v1.json +161 -0
- package/contracts/workspace-intelligence/agent-bootstrap-receipt.v1.json +17 -0
- package/contracts/workspace-intelligence/mcp-design.v1.json +49 -2
- package/contracts/workspace-intelligence/project-agent-entry.v1.json +3 -0
- package/contracts/workspace-intelligence/project-context-agent.v1.json +49 -7
- package/contracts/workspace-intelligence/project-knowledge-graph-reference.v1.json +51 -0
- package/contracts/workspace-intelligence/workspace-intelligence-benchmark.v1.json +196 -0
- package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +97 -2
- package/contracts/workspace-intelligence/workspace-skills-index.v1.json +34 -0
- package/contracts/workspace-intelligence-architecture.v1.json +17 -0
- package/contracts/workspace-intelligence-chain.v1.json +17 -0
- package/dist/analyze-IC2KRVCG.js +1 -0
- package/dist/{artifact-remediation-plan-XIQNI35L.js → artifact-remediation-plan-GFFHC2ZU.js} +1 -1
- package/dist/autopilot-release-RECEZAZI.js +1 -0
- package/dist/capabilities-command-X4WZIJNR.js +1 -0
- package/dist/chunk-2LIVMG5C.js +2 -0
- package/dist/chunk-2M62CU3O.js +2 -0
- package/dist/chunk-2MTJWPQ4.js +1 -0
- package/dist/chunk-2MVIRJJR.js +1 -0
- package/dist/chunk-2RPFCBS4.js +1 -0
- package/dist/chunk-3O7LZPKA.js +4 -0
- package/dist/chunk-3OGPTLI2.js +1 -0
- package/dist/{chunk-6TBTMWNA.js → chunk-4RV4JVGR.js} +1 -1
- package/dist/{chunk-YYQEWAES.js → chunk-4WVOAX2V.js} +1 -1
- package/dist/{chunk-N4QQADXX.js → chunk-5EVDW7JM.js} +1 -1
- package/dist/{chunk-J3X56S7L.js → chunk-5ME4W4LN.js} +1 -1
- package/dist/chunk-5OA33JH2.js +2 -0
- package/dist/chunk-5TY74LLW.js +2 -0
- package/dist/chunk-6254CWUY.js +49 -0
- package/dist/{chunk-D5YJOQYK.js → chunk-6E2Y3XGT.js} +1 -1
- package/dist/chunk-ARUFY5W3.js +1 -0
- package/dist/chunk-B4IVVTMQ.js +2 -0
- package/dist/{chunk-HDNATYW7.js → chunk-BHFRP7TV.js} +1 -1
- package/dist/{chunk-KTN2ARZJ.js → chunk-BHM6RHTA.js} +3 -3
- package/dist/chunk-BRYJTW6S.js +2 -0
- package/dist/{chunk-HCFWT42C.js → chunk-BUYLM6QV.js} +1 -1
- package/dist/chunk-CPR2CMOY.js +1 -0
- package/dist/{chunk-XGE2FDI4.js → chunk-CZVT7T2X.js} +1 -1
- package/dist/chunk-EHCKITR4.js +2 -0
- package/dist/chunk-ENZPM52J.js +1 -0
- package/dist/chunk-FPDH3N3A.js +7 -0
- package/dist/{chunk-PXWKMPPI.js → chunk-FX5J6JCK.js} +1 -1
- package/dist/chunk-FY4X2VOE.js +39 -0
- package/dist/chunk-GIQ4SDRJ.js +1 -0
- package/dist/chunk-H77ZNH5O.js +1 -0
- package/dist/{chunk-2RL6RRT2.js → chunk-HQLBO23O.js} +50 -50
- package/dist/chunk-HYE5UHPV.js +2 -0
- package/dist/{chunk-D65FCQIO.js → chunk-IKUFNK46.js} +1 -1
- package/dist/{chunk-WRQWVSBJ.js → chunk-IQQMFRWM.js} +1 -1
- package/dist/chunk-JCGSIDMC.js +2 -0
- package/dist/chunk-KENOAC2Q.js +13 -0
- package/dist/chunk-KQ2TMI26.js +97 -0
- package/dist/chunk-L5Q2S5GY.js +3 -0
- package/dist/chunk-LPCZHKD5.js +1 -0
- package/dist/chunk-N4QFNOAI.js +1 -0
- package/dist/chunk-NMXGSVMD.js +1 -0
- package/dist/{chunk-GQSRNUCU.js → chunk-NVND4727.js} +3 -3
- package/dist/{chunk-W6FHVXNL.js → chunk-OCNPOYMA.js} +1 -1
- package/dist/chunk-PSYQ6IJA.js +12 -0
- package/dist/{chunk-VRGEPPUB.js → chunk-QMQBX3RV.js} +1 -1
- package/dist/{chunk-YUGKQ44M.js → chunk-SLFOUSRW.js} +1 -1
- package/dist/chunk-SRLWHOLF.js +1 -0
- package/dist/chunk-SVYY55IS.js +157 -0
- package/dist/chunk-SX6A656X.js +1 -0
- package/dist/{chunk-X6TNBARH.js → chunk-TABXSDTR.js} +2 -2
- package/dist/chunk-THIG2YQP.js +681 -0
- package/dist/chunk-TP7VKEUF.js +1 -0
- package/dist/chunk-U5ENEDJA.js +7 -0
- package/dist/chunk-UTV4DTNM.js +1 -0
- package/dist/chunk-VI4ZRAY6.js +1 -0
- package/dist/chunk-VQZ5PI5J.js +1 -0
- package/dist/chunk-VWBMDGPY.js +9 -0
- package/dist/chunk-XDPTAV2T.js +2 -0
- package/dist/chunk-XWKGZRHN.js +1 -0
- package/dist/chunk-Y35VLVF6.js +5 -0
- package/dist/{chunk-VYDURWN7.js → chunk-Y4Z6CEII.js} +1 -1
- package/dist/chunk-YYY2WXOH.js +1 -0
- package/dist/chunk-ZGHJIQXL.js +1 -0
- package/dist/chunk-ZI2E7P6O.js +4 -0
- package/dist/{create-ALT2ME6H.js → create-72ITVZXV.js} +1 -1
- package/dist/{demo-kit-QHIDCSBI.js → demo-kit-5UQH2OXC.js} +1 -1
- package/dist/{doctor-RW4R3O5C.js → doctor-CVYUESRQ.js} +1 -1
- package/dist/{dotnet-webapi-clean-AVHPJG7Y.js → dotnet-webapi-clean-YEHYIGOT.js} +1 -1
- package/dist/{goal-lifecycle-VYOKS6E6.js → goal-lifecycle-H55AGFCB.js} +1 -1
- package/dist/goal-pack-6OBZOPCD.js +1 -0
- package/dist/{gofiber-standard-47S2GYAO.js → gofiber-standard-C44IIQYH.js} +1 -1
- package/dist/{gogin-standard-EWB4XNOI.js → gogin-standard-X7VKACVR.js} +1 -1
- package/dist/index.d.ts +20 -2
- package/dist/index.js +177 -177
- package/dist/live-command-5VXPR43F.js +15 -0
- package/dist/{pipeline-U4N2DVD7.js → pipeline-SKYOXWHW.js} +1 -1
- package/dist/{project-agent-entry-YAQCHIMP.js → project-agent-entry-5IUBEREI.js} +1 -1
- package/dist/project-intelligence-lens-LQCN65P2.js +1 -0
- package/dist/{project-test-coverage-4S7MEQ6T.js → project-test-coverage-KD4LLFGV.js} +1 -1
- package/dist/{pythonRapidkitExec-VAW5XE4Z.js → pythonRapidkitExec-44ORGQ4R.js} +1 -1
- package/dist/{rust-axum-M5X4ZC4Z.js → rust-axum-JKZTZDRZ.js} +1 -1
- package/dist/{springboot-standard-Y5ADLZMQ.js → springboot-standard-PI4FLTAN.js} +1 -1
- package/dist/verified-goal-HN7G532B.js +1 -0
- package/dist/{workspace-HGUZWNAB.js → workspace-5W7FYGDQ.js} +1 -1
- package/dist/{workspace-agent-sync-GEN3KBAX.js → workspace-agent-sync-OZCDQORK.js} +1 -1
- package/dist/{workspace-archive-ZBCKJHXS.js → workspace-archive-NOSGRKRZ.js} +1 -1
- package/dist/{workspace-context-4WIWFW26.js → workspace-context-L65BR5L6.js} +1 -1
- package/dist/{workspace-contract-7DXK4GF5.js → workspace-contract-JYHNEJPV.js} +1 -1
- package/dist/workspace-explain-SUBK6FLO.js +1 -0
- package/dist/workspace-explain-contract-WMREJWHF.js +1 -0
- package/dist/{workspace-feedback-RQ4TGJW6.js → workspace-feedback-MWGCT5R2.js} +1 -1
- package/dist/{workspace-foundation-J3NNRMI3.js → workspace-foundation-VIB3PXNH.js} +1 -1
- package/dist/{workspace-graph-stream-PQI7OGCE.js → workspace-graph-stream-45JHE4MG.js} +1 -1
- package/dist/workspace-graph-token-efficiency-NPECU6Y5.js +1 -0
- package/dist/{workspace-history-SYCDK7FO.js → workspace-history-JKW3VJO3.js} +1 -1
- package/dist/{workspace-intelligence-6FS26JOQ.js → workspace-intelligence-3C47PK4L.js} +1 -1
- package/dist/workspace-intelligence-benchmark-SRDIHX3X.js +1 -0
- package/dist/workspace-intelligence-evaluation-OJIQS5SN.js +1 -0
- package/dist/{workspace-intelligence-runner-XYUPCSLN.js → workspace-intelligence-runner-OWN5ZI6W.js} +1 -1
- package/dist/{workspace-intelligence-runtime-registry-IW6J53LO.js → workspace-intelligence-runtime-registry-UKFB3BI7.js} +1 -1
- package/dist/workspace-knowledge-graph-AKG5NUU6.js +1 -0
- package/dist/{workspace-knowledge-graph-contract-L3CLAM2M.js → workspace-knowledge-graph-contract-X52KXBXJ.js} +1 -1
- package/dist/{workspace-knowledge-graph-query-FZXSPWGK.js → workspace-knowledge-graph-query-DXA4CROE.js} +1 -1
- package/dist/workspace-knowledge-graph-snapshot-SNI5K2RL.js +1 -0
- package/dist/{workspace-marker-7NHMDIRL.js → workspace-marker-XGAWZZDX.js} +1 -1
- package/dist/workspace-mcp-serve-PK226GMV.js +3 -0
- package/dist/workspace-model-R4ISKDB2.js +1 -0
- package/dist/{workspace-onboarding-X3PWRIIS.js → workspace-onboarding-Y5RPEFUD.js} +1 -1
- package/dist/{workspace-python-engine-state-J4QKW55K.js → workspace-python-engine-state-BE4A3BL5.js} +1 -1
- package/dist/{workspace-readme-G7TZ3V5T.js → workspace-readme-PL5V3UDH.js} +2 -2
- package/dist/{workspace-registry-summary-LJN4WHIZ.js → workspace-registry-summary-STGUGROG.js} +1 -1
- package/dist/workspace-repair-engine-FNLL5ZDK.js +3 -0
- package/dist/workspace-run-GFBFGUFM.js +1 -0
- package/dist/{workspace-verify-USRRIM2F.js → workspace-verify-AXVX3PF3.js} +1 -1
- package/dist/{workspace-watch-43YZPLF7.js → workspace-watch-RLBEJKXE.js} +1 -1
- package/docs/DEVELOPMENT.md +19 -0
- package/docs/README.md +19 -16
- package/docs/SETUP.md +10 -0
- package/docs/agent-entry.md +22 -7
- package/docs/ci-workflows.md +1 -1
- package/docs/commands-reference.md +58 -8
- package/docs/contracts/ARTIFACT_CATALOG.md +64 -44
- package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +1 -0
- package/docs/contracts/NAMING_AND_COEXISTENCE.md +20 -18
- package/docs/contracts/README.md +7 -3
- package/docs/real-world-qualification.md +19 -3
- package/docs/workspace-intelligence-benchmark.md +82 -0
- package/docs/workspace-knowledge-graph.md +95 -27
- package/docs/workspace-live-activity.md +209 -0
- package/docs/workspace-operations.md +32 -9
- package/package.json +4 -2
- package/dist/analyze-5PDVWECJ.js +0 -1
- package/dist/autopilot-release-JVIJCTKX.js +0 -1
- package/dist/capabilities-command-LHM3XIS6.js +0 -1
- package/dist/chunk-2647BYBC.js +0 -1
- package/dist/chunk-27UR373Z.js +0 -1
- package/dist/chunk-2C5ZBVBI.js +0 -2
- package/dist/chunk-6JWNDWOA.js +0 -1
- package/dist/chunk-CCDGHPEJ.js +0 -2
- package/dist/chunk-DFG33SBR.js +0 -2
- package/dist/chunk-FY4IIAIF.js +0 -1
- package/dist/chunk-HEZZ72V4.js +0 -94
- package/dist/chunk-HN7P4T3B.js +0 -681
- package/dist/chunk-ILIBOMYL.js +0 -1
- package/dist/chunk-J7QYANXK.js +0 -8
- package/dist/chunk-JD3A5QM6.js +0 -2
- package/dist/chunk-JQLJBK5N.js +0 -1
- package/dist/chunk-KLSSPJTV.js +0 -1
- package/dist/chunk-L22EABIC.js +0 -7
- package/dist/chunk-LNXIMF3O.js +0 -1
- package/dist/chunk-MDTI3UEB.js +0 -1
- package/dist/chunk-MOSXTVPU.js +0 -1
- package/dist/chunk-MYJQGGIU.js +0 -5
- package/dist/chunk-NOV6723U.js +0 -1
- package/dist/chunk-NYEAMMUL.js +0 -1
- package/dist/chunk-NZ3WZYD5.js +0 -1
- package/dist/chunk-O5B2L3R2.js +0 -1
- package/dist/chunk-OWB5KWSS.js +0 -13
- package/dist/chunk-P5PSZQPB.js +0 -2
- package/dist/chunk-QCKWQFCD.js +0 -1
- package/dist/chunk-QI3HG6IG.js +0 -144
- package/dist/chunk-SWGSFLTC.js +0 -1
- package/dist/chunk-THIOE2PB.js +0 -2
- package/dist/chunk-U5FCQTVL.js +0 -4
- package/dist/chunk-UXEO5QCF.js +0 -33
- package/dist/chunk-VR6XMUF3.js +0 -2
- package/dist/chunk-VVJK5NFY.js +0 -2
- package/dist/chunk-VXKWWX7S.js +0 -8
- package/dist/chunk-W322YDHS.js +0 -49
- package/dist/chunk-WPRLXKWC.js +0 -8
- package/dist/chunk-Y5YAP4F3.js +0 -2
- package/dist/chunk-YN5X2FTP.js +0 -1
- package/dist/chunk-YOCN7GF4.js +0 -1
- package/dist/goal-pack-YWPI43QL.js +0 -1
- package/dist/project-intelligence-lens-MRQR2LQW.js +0 -1
- package/dist/verified-goal-WM34TTGE.js +0 -1
- package/dist/workspace-explain-TE2LGOAV.js +0 -1
- package/dist/workspace-explain-contract-V2IVSROX.js +0 -1
- package/dist/workspace-graph-token-efficiency-2I4X374C.js +0 -1
- package/dist/workspace-intelligence-evaluation-CQDKOYZZ.js +0 -1
- package/dist/workspace-knowledge-graph-SWCKDTPF.js +0 -1
- package/dist/workspace-knowledge-graph-snapshot-M572JRB4.js +0 -1
- package/dist/workspace-mcp-serve-IBMTFQDY.js +0 -3
- package/dist/workspace-model-ZL6WCICX.js +0 -1
- package/dist/workspace-repair-engine-NX7I632M.js +0 -3
- package/dist/workspace-run-6GT5OBQ5.js +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {i,g,l,e,f,c,d,j,k as k$1}from'./chunk-ZI2E7P6O.js';import lt from'path';import rt from'fs';var P={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",cyan:"\x1B[36m",brightCyan:"\x1B[96m",green:"\x1B[32m",yellow:"\x1B[33m",red:"\x1B[31m",magenta:"\x1B[35m"},Wt={planned:"\u25CB",running:"\u25C9",succeeded:"\u2713",warned:"!",blocked:"\u2298",failed:"\xD7",cancelled:"\xD7",skipped:"\u2013","rolled-back":"\u21B6"},Vt={planned:"o",running:"*",succeeded:"+",warned:"!",blocked:"#",failed:"x",cancelled:"x",skipped:"-","rolled-back":"~"};function ut(t){return t.replace(/\x1b\[[0-?]*[ -/]*[@-~]/g,"")}function k(t){return ut(t).replace(/[\u0000-\u001f\u007f-\u009f]/g," ")}function N(t){return [...ut(t)].length}function W(t,e){let n=k(t),o=[...n];return o.length<=e?n:e<=0?"":e===1?"\u2026":`${o.slice(0,e-1).join("")}\u2026`}function x(t,e){return N(t)<=e?t:W(ut(t),e)}function Dt(t,e){return t==="running"?e%2===0?P.brightCyan:P.cyan:t==="succeeded"?P.green:t==="warned"||t==="blocked"?P.yellow:t==="failed"||t==="cancelled"?P.red:t==="rolled-back"?P.magenta:P.dim}function O(t,e,n,o){return n?`${Dt(e,o)}${t}${P.reset}`:t}function H(t,e){return e?`${P.bold}${P.brightCyan}${t}${P.reset}`:t}function U(t,e){return (e?Vt:Wt)[t]}function et(t,e){let n=t.durationMs??Math.max(0,e-Date.parse(t.startedAt));if(n<1e3)return `${n}ms`;let o=Math.floor(n/1e3);if(o<60)return `${o}s`;let r=Math.floor(o/60);return r<60?`${r}m ${o%60}s`:`${Math.floor(r/60)}h ${r%60}m`}function z(t){let e=t.progress;return e?e.percent!==void 0?`${Math.round(e.percent)}%`:e.completed!==void 0&&e.total!==void 0?`${e.completed}/${e.total}`:e.iteration!==void 0&&e.iterations!==void 0?`${e.iteration}/${e.iterations}`:"":""}function J(t,e){return t.attempt&&t.attempt>1?`${e?"R":"\u21BB"}${t.attempt}`:""}function It(t,e,n){let o=N(t),r=N(e);return o+r+1>n?x(`${t} ${e}`,n):`${t}${" ".repeat(n-o-r)}${e}`}var nt={planned:"QUEUE",running:"RUN",succeeded:"DONE",warned:"WARN",blocked:"BLOCK",failed:"FAIL",cancelled:"STOP",skipped:"SKIP","rolled-back":"ROLL"};function tt(t,e,n,o){return o?"+":n?{left:"\u252B",right:"\u2523",top:"\u253B",bottom:"\u2533"}[t]:e==="planned"||e==="skipped"?{left:"\u2524",right:"\u251C",top:"\u2534",bottom:"\u252C"}[t]:{left:"\u2525",right:"\u251D",top:"\u2537",bottom:"\u252F"}[t]}function jt(t,e,n){let o=W(e,Math.max(3,Math.floor(n*.6))),r=Math.max(0,n-N(o)-(o?1:0)),s=W(t,r);return `${s}${" ".repeat(Math.max(0,n-N(s)-N(o)))}${o}`}function Mt(t,e,n,o,r){let s=Array.from({length:Math.max(0,o-2)},()=>n);return r&&s.length>0&&(s[Math.floor(s.length/2)]=r),`${t}${s.join("")}${e}`}function Ut(t,e,n,o){let r=t.status==="running",s=n.ascii?{topLeft:"+",topRight:"+",bottomLeft:"+",bottomRight:"+",horizontal:"-",vertical:"|"}:r?{topLeft:"\u250F",topRight:"\u2513",bottomLeft:"\u2517",bottomRight:"\u251B",horizontal:"\u2501",vertical:"\u2503"}:{topLeft:"\u250C",topRight:"\u2510",bottomLeft:"\u2514",bottomRight:"\u2518",horizontal:"\u2500",vertical:"\u2502"},i=z(t),d=J(t,n.ascii),a=[nt[t.status],d,i].filter(Boolean).join(" "),c=Mt(s.topLeft,s.topRight,s.horizontal,e,o.top?tt("top",o.top,r,n.ascii):void 0),u=`${o.left?tt("left",o.left,r,n.ascii):s.vertical}${jt(k(t.label),a,e-2)}${o.right?tt("right",o.right,r,n.ascii):s.vertical}`,f=Mt(s.bottomLeft,s.bottomRight,s.horizontal,e,o.bottom?tt("bottom",o.bottom,r,n.ascii):void 0);return [c,u,f].map(l=>O(l,t.status,n.color,n.frame))}function _t(t,e,n,o,r,s){let i=Math.max(2,s),d=r?"-":"\u2501",a=r?".":"\u2504";if(t==="running"&&o){let c=r?"=":"\u254D",u=Array.from({length:i},()=>d),f=n%i;return u[e==="right"?f:i-f-1]=c,u.join("")}return t==="planned"||t==="skipped"?a.repeat(i):t==="blocked"||t==="warned"?(r?"~":"\u2505").repeat(i):t==="failed"||t==="cancelled"?(r?"=":"\u254D").repeat(i):d.repeat(i)}function Ct(t,e,n,o=7){return t?O(_t(t.status,e,n.frame,n.motion,n.ascii,o),t.status,n.color,n.frame):" ".repeat(o)}function zt(t,e,n,o){let r=t?.status??"planned",s=r==="running"&&o.motion,i=r==="planned"||r==="skipped"?o.ascii?":":"\u250A":r==="blocked"||r==="warned"?o.ascii?"~":"\u250B":o.ascii?"|":"\u2503",d=o.ascii?":":"\u254F";return [s&&o.frame%2===0?d:i,s&&o.frame%2===1?d:i].map(c=>O(`${" ".repeat(Math.max(0,e))}${c}`.padEnd(n),r,o.color,o.frame))}function Ft(t,e,n){let o=e>=132?9:7,r=t.nodes.length<=2?Math.min(32,e):e>=132?19:e>=100?17:15,s=Math.max(1,Math.floor((e+o)/(r+o))),i=[];for(let a=0;a<t.nodes.length;a+=s)i.push(t.nodes.slice(a,a+s));let d=[];return i.forEach((a,c)=>{let u=c%2===0?"right":"left",f=u==="right"?a:[...a].reverse(),l=i[c+1],h=i[c-1],g=h?j(t,h.at(-1)?.id??"",a[0]?.id??""):void 0,A=l?j(t,a.at(-1)?.id??"",l[0]?.id??""):void 0,y=(p,R)=>u==="right"?j(t,p.id,R.id):j(t,R.id,p.id),T=f.map((p,R)=>{let $=R>0?y(f[R-1],p):void 0,M=R<f.length-1?y(p,f[R+1]):void 0;return Ut(p,r,n,{...$?{left:$.status}:{},...M?{right:M.status}:{},...g&&p.id===a[0]?.id?{top:g.status}:{},...A&&p.id===a.at(-1)?.id?{bottom:A.status}:{}})});for(let p=0;p<3;p+=1){let R="";f.forEach(($,M)=>{if(R+=T[M][p],M>=f.length-1)return;if(p!==1){R+=" ".repeat(o);return}let C=f[M+1],v=u==="right"?j(t,$.id,C.id):j(t,C.id,$.id);R+=Ct(v,u,n,o);}),d.push(x(R,e));}if(!l)return;let I=A,w=f.length*r+(f.length-1)*o,L=u==="right"?Math.max(0,w-Math.ceil(r/2)):Math.floor(r/2);d.push(...zt(I,L,e,n));}),d}function Gt(t,e){let n=z(t),o=J(t,e.ascii),r=`${U(t.status,e.ascii)} ${k(t.label)}${o?` ${o}`:""}${n?` ${n}`:""}`;return O(`[${r}]`,t.status,e.color,e.frame)}function Yt(t,e,n,o){if(t.nodes.length===0)return [];let r=[],s="",i=0;for(let[d,a]of t.nodes.entries()){let c=Gt(a,o),u=t.nodes[d-1],f=u?j(t,u.id,a.id):void 0,l=u?Ct(f,"right",o,7):"",h=`${s?l:""}${c}`;if(s&&N(s)+N(h)>e){if(r.push(x(s,e)),r.length>=n)break;s=`${o.ascii?"> ":"\u21B3 "}${c}`;}else s+=h;i=d+1;}if(r.length<n&&s&&r.push(x(s,e)),i<t.nodes.length&&r.length>0){let d=` \u2026 +${t.nodes.length-i}`;r[r.length-1]=x(`${r.at(-1)}${d}`,e);}return r.slice(0,n)}function Kt(t,e,n,o){if(t.length===0)return;let r=e>=130?3:e>=92?2:1,s=t.slice(0,r),i="ALSO ACTIVE ",d=s.map(c=>{let u=W(c.commandLabel.replace(/^workspai\s+/,""),24),f=o?`${W(c.locationLabel,20)} \xB7 `:"";return O(`[${U("running",n.ascii)} ${f}${u} \xB7 ${c.run.runId.slice(0,8)}]`,"running",n.color,n.frame)}),a=t.length-s.length;return x(`${i}${d.join(" ")}${a>0?` +${a}`:""}`,e)}function qt(t){let e=t.map(n=>n.status);for(let n of ["failed","cancelled","blocked","warned","running"])if(e.includes(n))return n;return e.length>0&&e.every(n=>n==="succeeded")?"succeeded":e.some(n=>n==="succeeded")?"running":e[0]??"planned"}function Ht(t,e,n){let o=[...new Set(t.nodes.map(i=>i.group).filter(Boolean))];if(o.length<2)return;let r=n.ascii?" > ":" \u2501 ",s=o.map((i,d)=>{let a=qt(t.nodes.filter(c=>c.group===i));return O(`${String(d+1).padStart(2,"0")} ${W(i,14)}`,a,n.color,n.frame)});return x(`PHASES ${s.join(r)}`,e)}function Tt(t){return [...t.nodes].reverse().find(e=>e.status==="running")??[...t.nodes].reverse().find(e=>["failed","blocked","warned","cancelled"].includes(e.status))??[...t.nodes].sort((e,n)=>n.updatedAt.localeCompare(e.updatedAt))[0]}function Jt(t){if(t<1e3)return `${t}ms`;let e=Math.floor(t/1e3);if(e<60)return `${e}s`;let n=Math.floor(e/60);return n<60?`${n}m ${e%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function Xt(t,e,n,o){let r=Tt(t);if(!r||e<24)return [];let s=o.ascii?"-":"\u2500",i=o.ascii?"|":"\u2502",d=e-2,a=r.attempt??0,c=r.attempts.at(-1)?.startedAt??r.updatedAt,u=r.durationMs??(r.status==="running"?Math.max(0,n-Date.parse(c)):void 0),f=[H("INSPECT",o.color),k(r.label),"",`STATE ${nt[r.status]}`,`PHASE ${r.group??"GENERAL"}`,`ATTEMPT ${a>0?`${a}/${Math.max(a,r.attempts.length)}`:"\u2014"}`,`PROGRESS ${z(r)||"\u2014"}`,`ELAPSED ${u===void 0?"\u2014":Jt(u)}`,"",`TOUCHES ${t.run.touches.length}`,`ARTIFACTS ${t.run.artifacts.length}`,`WARNINGS ${t.warningCount}`],l=o.ascii?{tl:"+",tr:"+",bl:"+",br:"+"}:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518"};return [`${l.tl}${s.repeat(d)}${l.tr}`,...f.map(h=>{let g=x(h,d);return `${i}${g}${" ".repeat(Math.max(0,d-N(g)))}${i}`}),`${l.bl}${s.repeat(d)}${l.br}`]}function Qt(t,e,n,o=3){return Array.from({length:Math.max(t.length,e.length)},(r,s)=>{let i=x(t[s]??"",n);return `${i}${" ".repeat(Math.max(0,n-N(i))+o)}${e[s]??""}`})}function Zt(t,e,n,o,r){let s=[...t.runs.filter(l=>l.active),...t.runs.filter(l=>!l.active&&l.run.runId===e)].filter((l,h,g)=>g.findIndex(A=>A.run.runId===l.run.runId)===h);if(s.length===0)return [];let i=s.slice(0,n>=110?4:2),d=Math.max(12,Math.min(28,Math.floor(n*.24))),a=Math.max(14,Math.min(30,Math.floor(n*.27))),c=Math.max(10,Math.min(20,Math.floor(n*.18))),u=`FLEET ${"LOCATION".padEnd(d)} ${"COMMAND".padEnd(a)} ${"ACTIVE BLOCK".padEnd(c)} STATE`,f=[H(x(u,n),r.color)];for(let l of i){let h=Tt(l),g=l.run.runId===e?r.ascii?">":"\u25C6":" ",A=l.commandLabel.replace(/^workspai\s+/,""),y=`${g} ${W(l.locationLabel,d).padEnd(d)} ${W(A,a).padEnd(a)} ${W(h?.label??"\u2014",c).padEnd(c)} ${nt[l.run.status]} \xB7 ${et(l.run,o)}`;f.push(O(x(y,n),l.run.status,r.color,r.frame));}return s.length>i.length&&f.push(x(` +${s.length-i.length} more runs`,n)),f}function te(t,e,n,o,r,s){let i=r.ascii?">":"\u25C6",d=s?`${W(t.locationLabel,28)} `:"",a=`RUN ${t.run.runId.slice(0,8).toUpperCase()} ${d}${k(t.commandLabel)}`,c=t.warningCount>0?` \xB7 !${t.warningCount}`:"",u=`${nt[t.run.status]} \xB7 ${et(t.run,o)}${c}`,f=O(It(a,u,Math.max(0,n-2)),t.run.status,r.color,r.frame);return `${H(i,r.color)} ${f}`}function ee(t,e,n){let o=[x(`Workspai Live | ${k(t.scopeLabel)} | ${t.activeRunCount} active | ${t.failedRunCount} failed`,e)];t.runs.length===0&&o.push("WAITING");for(let r of t.runs){o.push(x(`RUN ${r.run.status.toUpperCase()} | ${k(r.commandLabel)} | ${r.run.runId.slice(0,8)} | ${et(r.run,n)}`,e));for(let s of r.nodes)o.push(x(` BLOCK ${s.status.toUpperCase()} | ${k(s.label)}${J(s,true)?` | ATTEMPT ${s.attempt}`:""}${z(s)?` | ${z(s)}`:""}`,e));}return o.join(`
|
|
2
|
+
`)}function F(t,e={}){if(e.classic)return ne(t,e);let n=Math.max(20,e.width??process.stdout.columns??100),o=Math.max(1,e.height??process.stdout.rows??28),r=e.now??Date.now(),s=e.frame??0,i$1=e.ascii??(process.env.WORKSPAI_LIVE_ASCII==="1"||process.env.TERM==="dumb"),d=e.color??(process.stdout.isTTY&&process.env.NO_COLOR===void 0&&process.env.TERM!=="dumb"),a=e.motion??(process.env.WORKSPAI_LIVE_REDUCED_MOTION!=="1"&&process.env.CI!=="true"),c=i(t,{selectedRunId:e.selectedRunId,activeOnly:e.activeOnly,maxRuns:e.maxRuns});if(e.accessible)return ee(c,n,r);let u={ascii:i$1,color:d,frame:s,motion:a},f=H("WORKSPAI LIVE",d),l=x(k(c.scopeLabel),Math.max(8,Math.floor(n/3))),g=`${c.global?`${c.scopeCount} SCOPES `:""}${U("running",i$1)} ${c.activeRunCount} ACTIVE ${U("succeeded",i$1)} ${c.healthyRunCount} ${U("warned",i$1)} ${c.warningRunCount} ${U("failed",i$1)} ${c.failedRunCount}`,A=i$1?"-".repeat(n):"\u2501".repeat(n),y=[It(`${f} ${l}`,g,n),O(A,"planned",d,s)],T=x(e.replay?`${e.replay.paused?"PAUSED":"PLAY"} ${e.replay.index}/${e.replay.total} \xB7 ${e.replay.speed}x SPACE PLAY/PAUSE ${i$1?"<>":"\u2190\u2192"} STEP Q CLOSE`:`${i$1?"^v":"\u2191\u2193"} SELECT ENTER FOCUS I INSPECT F ACTIVE Q CLOSE`,n),I=e.interactive?o>=8?[O(A,"planned",d,s),T]:o>=3?[T]:[]:[];if(c.runs.length===0)y.push("",H(`${i$1?"*":"\u25C7"} WAITING FOR WORKSPAI ACTIVITY`,d));else {let w=c.runs.find(K=>K.run.runId===c.selectedRunId)??c.runs[0],L=e.focused?[]:c.runs.filter(K=>K.run.runId!==w.run.runId&&K.active);c.global&&!e.focused&&y.push(...Zt(c,w.run.runId,n,r,u)),y.push(te(w,true,n,r,u,c.global));let p=e.inspector!==false&&n>=132,R=p?Math.min(34,Math.floor(n*.25)):0,$=p?n-R-3:n,M=Ht(w,$,u),C=[...M?[M]:[],...Ft(w,$,u)],v=p?Xt(w,R,r,u):[],Q=p?Qt(C,v,$):C,G=Kt(L,n,u,c.global),Z=G&&!c.global?1:0,Y=Math.max(0,o-I.length-y.length-Z),D=n>=72&&o>=14&&Q.length<=Y;G&&!c.global&&y.length+I.length<o&&y.push(G),y.push(...D?Q:Y>0?Yt(w,n,Math.min(3,Y),u):[]);}return c.diagnostics.length>0&&y.length+I.length<o&&y.push(O(`! ${c.diagnostics.length} DIAGNOSTIC`,"warned",d,s)),y.push(...I),y.slice(0,o).map(w=>x(w,n)).join(`
|
|
3
|
+
`)}function ne(t,e={}){let n=Math.max(20,e.width??process.stdout.columns??100),o=e.now??Date.now(),r=e.ascii??false,s=i(t,{maxRuns:e.maxRuns}),i$1=s.runs.map(c=>c.run),d=s.activeRunCount,a=[x(`Workspai Live \xB7 ${k(s.scopeLabel)} \xB7 ${d} active run${d===1?"":"s"}`,n),(r?"-":"\u2500").repeat(Math.min(n,100))];i$1.length===0&&a.push("Waiting for Workspai commands in this project or workspace\u2026");for(let[c,u]of i$1.entries()){c>0&&a.push("");let f=k(u.command.length>0?`workspai ${u.command.join(" ")}`:u.runId);a.push(x(`${U(u.status,r)} ${f} \xB7 ${u.runId.slice(0,8)} \xB7 ${et(u,o)}`,n));for(let l of u.blocks.slice(0,18))a.push(x(` ${U(l.status,r)} ${k(l.label)}${J(l,r)?` ${J(l,r)}`:""}${z(l)?` ${z(l)}`:""}`,n));}return a.join(`
|
|
4
|
+
`)}var Lt={github:{width:1280,height:720},linkedin:{width:1200,height:627},x:{width:1600,height:900},square:{width:1080,height:1080},wide:{width:1600,height:900}},re={obsidian:{background:"#070b12",surface:"#0d1420",surfaceRaised:"#121c2b",grid:"#1d2a3b",text:"#edf6ff",muted:"#8090a5",cyan:"#20d9ff",green:"#27e0a3",yellow:"#f4d35e",red:"#ff667d",violet:"#b89cff"},light:{background:"#f4f7fb",surface:"#ffffff",surfaceRaised:"#eef3f9",grid:"#d9e2ee",text:"#102033",muted:"#617187",cyan:"#007fa3",green:"#087f5b",yellow:"#a16a00",red:"#c92a42",violet:"#6741d9"},mono:{background:"#080808",surface:"#111111",surfaceRaised:"#181818",grid:"#303030",text:"#f4f4f4",muted:"#9a9a9a",cyan:"#f4f4f4",green:"#d8d8d8",yellow:"#bdbdbd",red:"#ffffff",violet:"#c9c9c9"}};function V(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/g," ")}function ot(t,e){let n=[...t];return n.length<=e?t:`${n.slice(0,e-1).join("")}\u2026`}function X(t,e){return t==="running"?e.cyan:t==="succeeded"?e.green:t==="warned"||t==="blocked"?e.yellow:t==="failed"||t==="cancelled"?e.red:t==="rolled-back"?e.violet:e.muted}function ft(t){return {planned:"QUEUE",running:"RUNNING",succeeded:"COMPLETE",warned:"WARNING",blocked:"BLOCKED",failed:"FAILED",cancelled:"CANCELLED",skipped:"SKIPPED","rolled-back":"ROLLED BACK"}[t]}function oe(t){if(t<1e3)return `${t}ms`;let e=Math.floor(t/1e3);if(e<60)return `${e}s`;let n=Math.floor(e/60);return n<60?`${n}m ${e%60}s`:`${Math.floor(n/60)}h ${n%60}m`}function Et(t){return t.progress?.percent!==void 0?`${Math.round(t.progress.percent)}%`:t.progress?.completed!==void 0&&t.progress.total!==void 0?`${t.progress.completed}/${t.progress.total}`:""}function ie(t){return [...t].reverse().find(e=>e.status==="running")??[...t].reverse().find(e=>["failed","blocked","warned"].includes(e.status))??[...t].sort((e,n)=>n.updatedAt.localeCompare(e.updatedAt))[0]}function se(t,e){if(!e)return `workspai ${t.join(" ")}`.trim();let n=t[0]?.match(/^[a-z][a-z0-9-]*$/i)?.[0]??"command",r=new Set(["workspace","doctor","goal","graph","model","context"]).has(n)?t[1]?.match(/^[a-z][a-z0-9-]*$/i)?.[0]:void 0;return `workspai ${[n,r].filter(Boolean).join(" ")}`}function ae(t,e={}){let n=e.preset??"github",o=e.theme??"obsidian",{width:r,height:s}=Lt[n],i$1=re[o],d=i(t,{selectedRunId:e.runId,maxRuns:50}),a=d.runs.find(m=>m.run.runId===d.selectedRunId)??d.runs[0],c=e.now??Date.parse(t.generatedAt),u=Math.round(r*.045),f=28,l=Math.max(250,Math.round(r*.24)),h=r-u*2-l-f,g=u,A=g+h+f,y=184,T=s-54,I=30,w=34,L=Math.max(2,Math.min(5,Math.floor((h+I)/180))),p=Math.floor((h-I*(L-1))/L),R=Math.max(1,Math.ceil((a?.nodes.length??0)/L)),$=Math.max(48,Math.min(64,Math.floor((T-y-w*(R-1))/R))),M=[...new Set(a?.nodes.map(m=>m.group).filter(Boolean)??[])],C=new Map;a?.nodes.forEach((m,b)=>{let S=Math.floor(b/L),E=b%L,_=S%2===0?E:L-E-1;C.set(m.id,{x:g+_*(p+I),y:y+S*($+w)});});let v=a?ie(a.nodes):void 0,Q=e.redact?"workspace / project":d.scopeLabel,G=e.redact?"workspace / project":a?.locationLabel,Z=a?se(a.run.command,e.redact===true):"Waiting for activity",Y=a?a.run.durationMs??Math.max(0,c-Date.parse(a.run.startedAt)):0,D=[`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${s}" viewBox="0 0 ${r} ${s}" role="img" aria-labelledby="title description">`,'<title id="title">Workspai Live execution board</title>',`<desc id="description">${V(Z)} execution graph with ${a?.nodes.length??0} blocks.</desc>`,"<defs>",`<pattern id="grid" width="28" height="28" patternUnits="userSpaceOnUse"><path d="M 28 0 L 0 0 0 28" fill="none" stroke="${i$1.grid}" stroke-width="1" opacity="0.28"/></pattern>`,...["planned","running","succeeded","warned","blocked","failed","cancelled","skipped","rolled-back"].map(m=>`<marker id="arrow-${m}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="${X(m,i$1)}"/></marker>`),'<filter id="glow"><feGaussianBlur stdDeviation="3" result="blur"/><feMerge><feMergeNode in="blur"/><feMergeNode in="SourceGraphic"/></feMerge></filter>',"</defs>",`<rect width="${r}" height="${s}" fill="${i$1.background}"/>`,`<rect width="${r}" height="${s}" fill="url(#grid)"/>`,`<text x="${u}" y="58" fill="${i$1.cyan}" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="17" font-weight="700" letter-spacing="2">WORKSPAI LIVE</text>`,`<text x="${u}" y="91" fill="${i$1.text}" font-family="Inter,ui-sans-serif,system-ui,sans-serif" font-size="27" font-weight="650">${V(ot(Z,62))}</text>`,`<text x="${u}" y="118" fill="${i$1.muted}" font-family="Inter,ui-sans-serif,system-ui,sans-serif" font-size="14">${V(ot(G??Q,72))}</text>`,`<text x="${r-u}" y="61" text-anchor="end" fill="${a?X(a.run.status,i$1):i$1.muted}" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="14" font-weight="700">${a?ft(a.run.status):"STANDBY"} \xB7 ${oe(Y)}</text>`,`<line x1="${u}" y1="143" x2="${r-u}" y2="143" stroke="${i$1.grid}" stroke-width="2"/>`];if(M.length>1){let m=Math.min(132,Math.floor((h-12*(M.length-1))/M.length));M.forEach((b,S)=>{let E=g+S*(m+12);D.push(`<rect x="${E}" y="156" width="${m}" height="20" rx="10" fill="${i$1.surfaceRaised}" stroke="${i$1.grid}"/>`,`<text x="${E+m/2}" y="170" text-anchor="middle" fill="${i$1.muted}" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="10" font-weight="700" letter-spacing="1">${V(b)}</text>`);});}for(let m of a?.edges??[]){let b=C.get(m.fromBlockId),S=C.get(m.toBlockId);if(!b||!S)continue;let E=b.x+p/2,_=b.y+$/2,it=S.x+p/2,pt=S.y+$/2,q=Math.abs(pt-_)<2,st=q?it>E?b.x+p:b.x:E,at=q?_:b.y+$,ct=q?it>E?S.x:S.x+p:it,dt=q?pt:S.y,ht=(at+dt)/2,Bt=q?`M ${st} ${at} L ${ct} ${dt}`:`M ${st} ${at} L ${st} ${ht} L ${ct} ${ht} L ${ct} ${dt}`,Nt=X(m.status,i$1);D.push(`<path d="${Bt}" fill="none" stroke="${Nt}" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" ${m.status==="planned"?'stroke-dasharray="5 7"':""} marker-end="url(#arrow-${m.status})" opacity="${m.status==="planned"?"0.55":"0.9"}"/>`);}for(let m of a?.nodes??[]){let b=C.get(m.id);if(!b)continue;let S=X(m.status,i$1),E=m.attempt&&m.attempt>1?` \xB7 R${m.attempt}`:"",_=Et(m);D.push(`<g${m.status==="running"?' filter="url(#glow)"':""}>`,`<rect x="${b.x}" y="${b.y}" width="${p}" height="${$}" rx="8" fill="${i$1.surface}" stroke="${S}" stroke-width="${m.status==="running"?3:1.5}"/>`,`<rect x="${b.x}" y="${b.y}" width="4" height="${$}" rx="2" fill="${S}"/>`,`<text x="${b.x+15}" y="${b.y+25}" fill="${i$1.text}" font-family="Inter,ui-sans-serif,system-ui,sans-serif" font-size="13" font-weight="650">${V(ot(m.label,Math.max(10,Math.floor(p/8))))}</text>`,`<text x="${b.x+15}" y="${b.y+45}" fill="${S}" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="10" font-weight="700">${ft(m.status)}${V(E)}${_?` \xB7 ${V(_)}`:""}</text>`,"</g>");}return D.push(`<rect x="${A}" y="156" width="${l}" height="${Math.max(250,s-210)}" rx="12" fill="${i$1.surface}" stroke="${i$1.grid}" stroke-width="1.5"/>`,`<text x="${A+24}" y="191" fill="${i$1.cyan}" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="12" font-weight="700" letter-spacing="1.5">INSPECT</text>`,`<text x="${A+24}" y="224" fill="${i$1.text}" font-family="Inter,ui-sans-serif,system-ui,sans-serif" font-size="19" font-weight="650">${V(ot(v?.label??"No active block",24))}</text>`),[["STATE",v?ft(v.status):"STANDBY"],["PHASE",v?.group??"GENERAL"],["ATTEMPT",v?.attempt?String(v.attempt):"\u2014"],["PROGRESS",v&&Et(v)||"\u2014"],["TOUCHES",String(a?.run.touches.length??0)],["ARTIFACTS",String(a?.run.artifacts.length??0)],["WARNINGS",String(a?.warningCount??0)]].forEach(([m,b],S)=>{let E=273+S*45;D.push(`<text x="${A+24}" y="${E}" fill="${i$1.muted}" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="10" font-weight="700" letter-spacing="1">${m}</text>`,`<text x="${A+l-24}" y="${E}" text-anchor="end" fill="${m==="STATE"&&v?X(v.status,i$1):i$1.text}" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="12" font-weight="700">${V(b)}</text>`);}),D.push(`<text x="${u}" y="${s-24}" fill="${i$1.muted}" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="10" letter-spacing="1">EVENT-DRIVEN \xB7 DETERMINISTIC \xB7 LOCAL-FIRST</text>`,`<text x="${r-u}" y="${s-24}" text-anchor="end" fill="${i$1.muted}" font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="10">${e.redact?"PRODUCT-SAFE CAPTURE":V(a?.run.runId.slice(0,8).toUpperCase()??"NO RUN")}</text>`,"</svg>"),`${D.join(`
|
|
5
|
+
`)}
|
|
6
|
+
`}function kt(t,e){let n=e.preset??"github",o=lt.resolve(e.outputPath);if(lt.extname(o).toLowerCase()!==".svg")throw new Error("Activity capture output must use the .svg extension.");rt.mkdirSync(lt.dirname(o),{recursive:true,mode:448});let r=ae(t,e),s=`${o}.${process.pid}.tmp`;try{rt.writeFileSync(s,r,{encoding:"utf8",mode:384}),rt.renameSync(s,o);}finally{try{rt.unlinkSync(s);}catch(i){if(i.code!=="ENOENT")throw i}}return {outputPath:o,...Lt[n],bytes:Buffer.byteLength(r)}}function mt(t,e={}){return e.projection!=="board"?t:i(t,{selectedRunId:e.runId,maxRuns:Math.max(1,Math.min(50,e.maxRuns??6))})}function de(t){return JSON.stringify(t.schemaVersion==="workspace-activity-monitor-fleet.v1"?{...t,generatedAt:"",scopes:t.scopes.map(e=>({...e,generatedAt:""}))}:{...t,generatedAt:""})}function Ot(t,e,n={}){let o=Math.max(1,n.height??process.stdout.rows??28),r=e.split(`
|
|
7
|
+
`).slice(0,o),s=Math.min(o,Math.max(t.length,r.length)),i=n.force?"\x1B[2J":"",d=n.force===true;for(let a=0;a<s;a+=1){let c=r[a]??"";!n.force&&t[a]===c||(d=true,i+=`\x1B[${a+1};1H\x1B[2K${c}`);}return d&&(i+=`\x1B[${Math.min(o,r.length+1)};1H`),{output:i,lines:r}}function ue(t,e,n){return k$1(i(t,{selectedRunId:e.selectedRunId,activeOnly:e.activeOnly,maxRuns:n}))}function gt(t,e,n){let o=i(t,{selectedRunId:e.selectionPinned?e.selectedRunId:void 0,activeOnly:e.activeOnly,maxRuns:n});e.selectedRunId=o.selectedRunId;}function Pt(t,e,n,o){let r=ue(e,n,o);if(r.length===0)return;let s=Math.max(0,r.indexOf(n.selectedRunId??""));n.selectedRunId=r[(s+t+r.length)%r.length],n.selectionPinned=true,n.dirty=true;}function le(t){let e=process.stdin;if(!e.isTTY||typeof e.setRawMode!="function")return null;let n=e.isRaw,o=e.isPaused(),r=s=>{let i=s.toString();if(i===""||i.toLowerCase()==="q"){t.stop();return}if(i==="\x1B[A"||i==="\x1B[D"||i.toLowerCase()==="k"){Pt(-1,t.snapshot(),t.state,t.maxRuns);return}if(i==="\x1B[B"||i==="\x1B[C"||i.toLowerCase()==="j"){Pt(1,t.snapshot(),t.state,t.maxRuns);return}if(i==="\r"||i===`
|
|
8
|
+
`){t.state.focused=!t.state.focused,t.state.focused&&(t.state.selectionPinned=true),t.state.dirty=true;return}if(i.toLowerCase()==="f"){t.state.activeOnly=!t.state.activeOnly,gt(t.snapshot(),t.state,t.maxRuns),t.state.dirty=true;return}(i===" "||i.toLowerCase()==="i")&&(t.state.inspector=!t.state.inspector,t.state.dirty=true);};return e.setRawMode(true),e.resume(),e.on("data",r),()=>{e.removeListener("data",r),e.setRawMode(n===true),o&&e.pause();}}async function fe(t){let e=c({targetPath:t.targetPath,runId:t.runId,maxRuns:t.maxRuns});if(e.events.length===0)throw new Error(`No activity journal found for run ${t.runId}.`);let n=h=>d({resolvedScope:e.resolvedScope,events:e.events,eventCount:h+1,diagnostics:e.diagnostics}),o=n(e.events.length-1);if(t.options.once||t.options.json||t.options.accessible||t.options.classic||!process.stdout.isTTY||!process.stdin.isTTY)return process.stdout.write(t.options.json?`${JSON.stringify(mt(o,t.options),null,2)}
|
|
9
|
+
`:`${F(o,{width:process.stdout.columns,height:process.stdout.rows,maxRuns:t.maxRuns,selectedRunId:t.runId,color:t.options.color,motion:false,ascii:t.options.ascii,accessible:t.options.accessible,classic:t.options.classic})}
|
|
10
|
+
`),o;let r=0,s=false,i=false,d$1=true,a=[],c$1=process.stdin,u=c$1.isRaw,f=c$1.isPaused(),l=h=>{let g=h.toString();g===""||g.toLowerCase()==="q"?i=true:g===" "?s=!s:g==="\x1B[C"||g==="."?(r=Math.min(e.events.length-1,r+1),s=true):(g==="\x1B[D"||g===",")&&(r=Math.max(0,r-1),s=true),d$1=true;};c$1.setRawMode(true),c$1.resume(),c$1.on("data",l),process.stdout.write("\x1B[?1049h\x1B[?25l");try{for(;!i;){r>=e.events.length-1&&!s&&(s=true,d$1=true);let h=n(r);if(d$1){let T=F(h,{width:process.stdout.columns,height:process.stdout.rows,maxRuns:t.maxRuns,selectedRunId:t.runId,focused:true,frame:r,color:t.options.color,motion:t.options.motion,ascii:t.options.ascii,accessible:t.options.accessible,classic:t.options.classic,inspector:true,interactive:true,replay:{index:r+1,total:e.events.length,paused:s,speed:t.speed}}),I=Ot(a,T,{force:a.length===0,height:process.stdout.rows});I.output&&process.stdout.write(I.output),a=I.lines,d$1=false;}if(s||r>=e.events.length-1){s=r>=e.events.length-1?true:s,await new Promise(T=>setTimeout(T,50));continue}let g=Date.parse(e.events[r]?.timestamp??""),A=Date.parse(e.events[r+1]?.timestamp??""),y=Math.max(30,Math.min(1e3,(A-g)/t.speed||30));await new Promise(T=>setTimeout(T,y)),r+=1,d$1=true;}}finally{c$1.removeListener("data",l),c$1.setRawMode(u===true),f&&c$1.pause(),process.stdout.write("\x1B[0m\x1B[?25h\x1B[?1049l");}return n(r)}async function Se(t){let e$1=lt.resolve(t.targetPath??process.cwd()),n=Math.max(1,Math.min(50,t.maxRuns??6)),o=Math.max(1,Math.min(50,t.maxScopes??12)),r=Math.max(100,Math.min(5e3,t.refreshMs??250)),s=Math.max(.25,Math.min(64,t.replaySpeed??4));if(t.replayRunId){if(t.global)throw new Error("--replay cannot be combined with --global.");return fe({targetPath:e$1,runId:t.replayRunId,speed:s,maxRuns:n,options:t})}t.global||g({targetPath:e$1});let i$1=()=>t.global?e({runId:t.runId,maxRuns:n,maxScopes:o}):f({targetPath:e$1,runId:t.runId,maxRuns:n}),d=i$1(),a=!!(process.stdout.isTTY&&process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&!t.json&&!t.accessible),c={selectedRunId:t.runId,selectionPinned:!!t.runId,focused:!!t.runId,activeOnly:false,inspector:true,dirty:true},u=0,f$1=()=>({width:process.stdout.columns,height:process.stdout.rows,maxRuns:n,selectedRunId:c.selectedRunId,focused:c.focused,activeOnly:c.activeOnly,frame:u,color:t.color,motion:t.motion,ascii:t.ascii,accessible:t.accessible,classic:t.classic,interactive:a,inspector:c.inspector});if(gt(d,c,n),t.capturePath){let $=kt(d,{outputPath:t.capturePath,runId:c.selectedRunId,preset:t.capturePreset,theme:t.captureTheme,redact:t.captureRedact});return process.stdout.write(`${JSON.stringify({kind:"workspai.live.capture",...$},null,t.json?2:0)}
|
|
11
|
+
`),d}if(t.once)return t.json?process.stdout.write(`${JSON.stringify(mt(d,t),null,2)}
|
|
12
|
+
`):process.stdout.write(`${F(d,f$1())}
|
|
13
|
+
`),d;let l$1=false,h,g$1=()=>{l$1=true,h?.();},A=$=>new Promise(M=>{let C=setTimeout(()=>{h=void 0,M();},$);h=()=>{clearTimeout(C),h=void 0,M();};});process.once("SIGINT",g$1),process.once("SIGTERM",g$1);let y=true,T=()=>{y=true,c.dirty=true;};process.stdout.on("resize",T);let I=a?le({snapshot:()=>d,state:c,maxRuns:n,stop:g$1}):null;a&&process.stdout.write("\x1B[?1049h\x1B[?25l");let w="",L=[],p=0,R=a&&t.motion!==false&&process.env.WORKSPAI_LIVE_REDUCED_MOTION!=="1"&&process.env.CI!=="true";try{for(;!l$1;){let $=Date.now();if((p===0||$-p>=r)&&(d=i$1(),gt(d,c,n),p=$,c.dirty=true),a){let C=F(d,f$1()),v=Ot(L,C,{force:y,height:process.stdout.rows});v.output&&process.stdout.write(v.output),L=v.lines,y=false,c.dirty=false,u+=1;}else {let C=JSON.stringify(mt(d,t)),v=de(d);v!==w&&(process.stdout.write(t.json?`${C}
|
|
14
|
+
`:`${F(d,f$1())}
|
|
15
|
+
`),w=v);}let M=R&&l(i(d,{selectedRunId:c.selectedRunId,activeOnly:c.activeOnly,maxRuns:n}));l$1||await A(M?Math.min(r,125):r);}}finally{I?.(),process.removeListener("SIGINT",g$1),process.removeListener("SIGTERM",g$1),process.stdout.removeListener("resize",T),a&&process.stdout.write("\x1B[0m\x1B[?25h\x1B[?1049l");}return d}export{de as activitySnapshotComparisonKey,mt as projectLiveJsonOutput,Ot as renderActivityScreenDiff,Se as runLiveCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-BHFRP7TV.js';import {r}from'./chunk-KQ2TMI26.js';import {a as a$2}from'./chunk-VWBMDGPY.js';import {c as c$1}from'./chunk-LPCWROQ3.js';import {a as a$3}from'./chunk-3O7LZPKA.js';import {g}from'./chunk-HQLBO23O.js';import {f,e as e$1}from'./chunk-SX6A656X.js';import {a}from'./chunk-QMQBX3RV.js';import {c as c$3}from'./chunk-X7FYEKLI.js';import {d as d$1,a as a$1,e as e$2}from'./chunk-XDPTAV2T.js';import {e,i,h}from'./chunk-ZGHJIQXL.js';import c$2 from'chalk';import d from'path';import G from'fs-extra';function L(s){return s===0?"pass":s===2?"warn":"fail"}async function _(s){try{let a=G.readJsonSync(s),i=a.policyProfile,t=c$3(a).filter(n=>n.status==="blocking").map(n=>`${n.projectName}: ${n.message}`);return {policyProfile:typeof i?.name=="string"?i.name:void 0,blockers:[...new Set(t)].slice(0,12)}}catch{return {blockers:[]}}}function j(s){return s.some(a=>a.status==="fail")?"blocked":s.some(a=>a.status==="warn")?"needs-attention":"ready"}function V(s,a){if(a)return 3;let i=s.some(n=>n.status==="fail"),t=s.some(n=>n.status==="warn");return i?1:t?2:0}function K(s,a){return s===2&&!a?0:s}async function J(s){let a=await g(s,true),i=false;try{let{syncWorkspaceContract:t}=await import('./workspace-contract-JYHNEJPV.js');await t({workspacePath:s}),i=true;}catch{i=false;}return {sync:a,contractSynced:i}}async function U(s={}){let a$4=d.resolve(s.workspacePath??process.cwd()),i$1=a(a$4);if(!i$1)throw new Error("No Workspai workspace found in current directory or parents");let t=[],n=[],u=false,m,w,g,h$1=Date.now();try{let{sync:e,contractSynced:r}=await J(i$1),o=e.workspaceFound&&(e.added.length>0||e.skipped>=0)||e.workspaceFound?"pass":"warn";t.push({name:"sync",status:o,durationMs:Date.now()-h$1,summary:e.workspaceFound?`registry sync complete (${e.added.length} added, ${e.skipped} existing)${r?", contract synced":""}`:"workspace not registered in global registry; contract sync attempted"}),e.workspaceFound||n.push("workspace registry entry missing \u2014 run workspai create workspace or register manually");}catch(e){u=true,t.push({name:"sync",status:"fail",durationMs:Date.now()-h$1,summary:`sync failed: ${e instanceof Error?e.message:String(e)}`}),n.push("workspace sync stage failed");}let P=Date.now();try{let e$1=await r({workspace:true,json:true,quiet:true,strict:s.strict===true,ci:s.strict!==true}),r$1=L(e$1),o=await d$1(i$1,e.doctor)??a$1(i$1,e.doctor),l=await _(o);t.push({name:"doctor",status:r$1,durationMs:Date.now()-P,summary:r$1==="pass"?"doctor workspace passed":r$1==="warn"?"doctor workspace reported warnings":"doctor workspace did not pass",exitCode:e$1,evidencePath:o,policyProfile:l.policyProfile,blockers:l.blockers}),r$1==="fail"?n.push(...l.blockers.length>0?l.blockers.map(O=>`doctor: ${O}`):["doctor workspace gate failed"]):r$1==="warn"&&n.push("doctor workspace reported warnings");}catch(e){u=true,t.push({name:"doctor",status:"fail",durationMs:Date.now()-P,summary:`doctor failed: ${e instanceof Error?e.message:String(e)}`}),n.push("doctor workspace stage failed");}if(s.skipAnalyze)t.push({name:"analyze",status:"skipped",durationMs:0,summary:"analyze stage skipped"});else {let e=Date.now();try{let r=await a$2({workspacePath:i$1,json:true,strict:s.strict===true});m=d.isAbsolute(r.enterpriseControls.evidencePath)?r.enterpriseControls.evidencePath:d.join(i$1,r.enterpriseControls.evidencePath);let o=r.summary.verdict==="blocked"?"fail":r.summary.verdict==="needs-attention"?"warn":"pass";t.push({name:"analyze",status:o,durationMs:Date.now()-e,summary:`analyze verdict: ${r.summary.verdict} (score ${r.summary.score}/100)`,evidencePath:m}),o==="fail"?n.push("analyze reported blocked verdict"):o==="warn"&&n.push("analyze reported needs-attention verdict");}catch(r){u=true,t.push({name:"analyze",status:"fail",durationMs:Date.now()-e,summary:`analyze failed: ${r instanceof Error?r.message:String(r)}`}),n.push("analyze stage failed");}}let k=Date.now();try{let e=await a$3({startPath:i$1,writeReport:true,skipVerify:s.skipVerify===true});w=e.evidencePath;let r=e.overallStatus==="pass"?"pass":e.overallStatus==="warn"?"warn":"fail";t.push({name:"readiness",status:r,durationMs:Date.now()-k,summary:`readiness overall: ${e.overallStatus}`,evidencePath:e.evidencePath}),r==="fail"?n.push(...e.blockingReasons.map(o=>`readiness: ${o}`)):r==="warn"&&n.push(...e.gates.filter(o=>o.status==="warn").map(o=>`readiness warn: ${o.gate}: ${o.summary}`));}catch(e){u=true,t.push({name:"readiness",status:"fail",durationMs:Date.now()-k,summary:`readiness failed: ${e instanceof Error?e.message:String(e)}`}),n.push("readiness stage failed");}if(s.skipAutopilot)t.push({name:"autopilot",status:"skipped",durationMs:0,summary:"autopilot stage skipped"});else {let e=Date.now(),r=s.autopilotMode??"audit";try{let o=await c({workspacePath:i$1,mode:r,json:true,skipPipelineStages:true});g=o.artifacts.reportPath;let l=o.summary.verdict==="approved"?"pass":o.summary.verdict==="partial"?"warn":"fail";t.push({name:"autopilot",status:l,durationMs:Date.now()-e,summary:`autopilot ${r}: ${o.summary.verdict}`,exitCode:o.summary.exitCode,evidencePath:g}),l!=="pass"&&n.push(...o.blockingReasons.slice(0,5));}catch(o){u=true,t.push({name:"autopilot",status:"fail",durationMs:Date.now()-e,summary:`autopilot failed: ${o instanceof Error?o.message:String(o)}`}),n.push("autopilot release stage failed");}}let N=j(t),S=V(t,u),I=d.join(i$1,i.pipelineLastRun),p={schemaVersion:h.pipelineLastRun.schemaVersion,generatedAt:new Date().toISOString(),workspacePath:i$1,summary:{verdict:N,exitCode:S,stagesPassed:t.filter(e=>e.status==="pass").length,stagesWarn:t.filter(e=>e.status==="warn").length,stagesFailed:t.filter(e=>e.status==="fail").length},stages:t,blockingReasons:[...new Set(n)],artifacts:{reportPath:I,analyzeEvidencePath:m,readinessEvidencePath:w,autopilotEvidencePath:g}};if(s.writeReport!==false){let e=f(p,{commandId:"workspacePipeline",exitCode:S,generatedAt:p.generatedAt,blockers:p.blockingReasons,runId:e$1()});await e$2(i$1,i.pipelineLastRun,e);}if(s.writeReport!==false&&s.noAgentSync!==true&&process.env.RAPIDKIT_NO_AGENT_SYNC!=="1"&&s.agentSync!==false)try{let{syncWorkspaceAgentGrounding:e}=await import('./workspace-agent-sync-OZCDQORK.js'),r=await e({workspacePath:i$1,write:true,refreshContext:true,strict:false});p.agentGrounding={indexPath:r.indexPath,writtenFiles:r.writtenFiles,blockers:r.blockers};}catch{}return p}async function ue(s){let a;try{a=await U(s);}catch(t){let n=t instanceof Error?t.message:String(t);s.json?console.log(JSON.stringify(c$1({operation:"pipeline",code:"pipeline.failed",message:n}),null,2)):console.log(c$2.red(`Pipeline failed: ${n}`)),process.exit(1);}if(s.json)console.log(JSON.stringify(a,null,2));else {console.log(c$2.bold.cyan(`
|
|
2
2
|
\u{1F517} Workspai Governance Pipeline
|
|
3
3
|
`)),console.log(c$2.bold(`Workspace: ${c$2.cyan(d.basename(a.workspacePath))}`)),console.log(c$2.gray(`Path: ${a.workspacePath}`)),console.log(c$2.white(`Verdict: ${a.summary.verdict} Exit: ${a.summary.exitCode} (${a.summary.stagesPassed} pass / ${a.summary.stagesWarn} warn / ${a.summary.stagesFailed} fail)`));for(let t of a.stages){let n=t.status==="pass"?c$2.green("PASS"):t.status==="warn"?c$2.yellow("WARN"):t.status==="skipped"?c$2.gray("SKIP"):c$2.red("FAIL");console.log(` - ${t.name}: ${n} ${t.summary}`);}if(a.blockingReasons.length>0){console.log(c$2.bold(`
|
|
4
4
|
Blocking reasons:`));for(let t of a.blockingReasons.slice(0,8))console.log(c$2.gray(` \u2022 ${t}`));}console.log(c$2.gray(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as AGENT_BOOTSTRAP_RECEIPT_SCHEMA_VERSION,f as AGENT_ENTRY_HOST_IDS,g as PROJECT_AGENT_ADAPTER_ENTRY_FILES,b as PROJECT_AGENT_ENTRY_RELATIVE_PATH,a as PROJECT_AGENT_ENTRY_SCHEMA_VERSION,e as WORKSPAI_AGENT_ENTRY_END,d as WORKSPAI_AGENT_ENTRY_START,j as buildAgentBootstrapReceipt,i as buildProjectAgentEntryManifest,h as normalizeAgentEntryHost}from'./chunk-
|
|
1
|
+
export{c as AGENT_BOOTSTRAP_RECEIPT_SCHEMA_VERSION,f as AGENT_ENTRY_HOST_IDS,g as PROJECT_AGENT_ADAPTER_ENTRY_FILES,b as PROJECT_AGENT_ENTRY_RELATIVE_PATH,a as PROJECT_AGENT_ENTRY_SCHEMA_VERSION,e as WORKSPAI_AGENT_ENTRY_END,d as WORKSPAI_AGENT_ENTRY_START,j as buildAgentBootstrapReceipt,i as buildProjectAgentEntryManifest,h as normalizeAgentEntryHost}from'./chunk-2M62CU3O.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as PROJECT_CONTEXT_AGENT_SCHEMA_VERSION,c as PROJECT_GROUNDING_MODE_VALUES,g as PROJECT_PORTABLE_GROUNDING_SKILL_PATH,e as WORKSPAI_PROJECT_GROUNDING_END,d as WORKSPAI_PROJECT_GROUNDING_START,f as WORKSPAI_PROJECT_SKILL_MARKER,i as buildProjectContextAgent,j as resolveProjectPortableSkillTransactionPaths,m as resolveWorkspaceProjectLensTargets,h as selectBoundedProjectLensEntities,k as syncProjectIntelligenceLens,l as syncWorkspaceProjectLenses}from'./chunk-SVYY55IS.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as PROJECT_TEST_COVERAGE_ARTIFACT,a as PROJECT_TEST_COVERAGE_SCHEMA,d as collectProjectTestCoverage,c as inspectProjectTestCoverageCapability}from'./chunk-
|
|
1
|
+
export{b as PROJECT_TEST_COVERAGE_ARTIFACT,a as PROJECT_TEST_COVERAGE_SCHEMA,d as collectProjectTestCoverage,c as inspectProjectTestCoverageCapability}from'./chunk-H77ZNH5O.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{k as __test__,b as checkRapidkitCoreAvailable,c as checkRapidkitCoreVersionCompatible,i as getCachedCoreTopLevelCommands,h as getCoreTopLevelCommands,j as getModulesCatalog,d as resolveRapidkitPython,e as runCoreRapidkit,g as runCoreRapidkitCapture,f as runCoreRapidkitStreamed}from'./chunk-
|
|
1
|
+
export{k as __test__,b as checkRapidkitCoreAvailable,c as checkRapidkitCoreVersionCompatible,i as getCachedCoreTopLevelCommands,h as getCoreTopLevelCommands,j as getModulesCatalog,d as resolveRapidkitPython,e as runCoreRapidkit,g as runCoreRapidkitCapture,f as runCoreRapidkitStreamed}from'./chunk-FY4X2VOE.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-TABXSDTR.js';import {b as b$1,a}from'./chunk-TQEMLBAG.js';import {promises}from'fs';import t from'path';import d from'chalk';import {execa}from'execa';var f="3000";function w(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").replace(/-+/g,"-")||"axum-api"}function k(e,i){return `[package]
|
|
2
2
|
name = "${e}"
|
|
3
3
|
version = "0.1.0"
|
|
4
4
|
edition = "2021"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b,c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-
|
|
1
|
+
import {b,c}from'./chunk-IBJEQHJR.js';import {h as h$1}from'./chunk-TABXSDTR.js';import {b as b$1,a}from'./chunk-TQEMLBAG.js';import {promises}from'fs';import g from'path';import i from'chalk';import R from'ora';import {execa}from'execa';var x="21",j="3.5.0",M="2.8.9";function f(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,".").replace(/^\.+|\.+$/g,"").replace(/\.{2,}/g,".").split(".").map(p=>p.replace(/^[^a-z]+/,"").replace(/[^a-z0-9]/g,"")).filter(Boolean).join(".")}function h(e,t){return e.replace(/[\r\n\t]+/g," ").trim()||t}function E(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")}function T(e,t){let s=f(e)||"com.workspai.apps",p=f(t)||"service";return `${s}.${p}`}function A(e){return e.replace(/\./g,"/")}function P(){return JSON.stringify({engine:"npm",runtime:"java"},null,2)}function C(e,t){return JSON.stringify({kit_name:"springboot.standard",runtime:"java",module_support:false,project_name:e.project_name,artifact_id:e.artifact_id,group_id:e.group_id,package_name:e.package_name,app_version:e.app_version,created_by:"workspai",workspai_version:t,rapidkit_version:t,created_at:new Date().toISOString()},null,2)}function D(e){return `<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
3
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
4
4
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {c}from'./chunk-N4QFNOAI.js';import {d as d$1}from'./chunk-H77ZNH5O.js';import {a as a$2}from'./chunk-Y35VLVF6.js';import {a as a$1}from'./chunk-3O7LZPKA.js';import {q as q$1}from'./chunk-TP7VKEUF.js';import {a as a$3}from'./chunk-GR6442P7.js';import {e as e$1,d}from'./chunk-XDPTAV2T.js';import {a}from'./chunk-AFIFZTOY.js';import {e,f}from'./chunk-ZGHJIQXL.js';import {createHash}from'crypto';import u from'path';import v from'fs-extra';var W="workspai.verified-goal.v1",A=f.verifiedGoalStatus,V=e.verifiedGoalStatus,J="contracts/workspace-intelligence/verified-goal.v1.json",$="contracts/workspace-intelligence/verified-goal-status.v1.json";function H(e,t,a){if(t.kind==="workspace")return true;let r=u.resolve(e,a.path);return t.kind==="project"?a.name===t.projectName||r===u.resolve(t.projectPath):t.projects.some(i=>i.projectName===a.name||u.resolve(i.projectPath)===r)}function x(e){return Array.isArray(e)?`[${e.map(x).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[a])=>t.localeCompare(a)).map(([t,a])=>`${JSON.stringify(t)}:${x(a)}`).join(",")}}`:JSON.stringify(e)}function K(e){return createHash("sha256").update(x(e)).digest("hex")}var ae=["package.json","package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","pyproject.toml","requirements.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock","go.mod","go.sum","Cargo.toml","Cargo.lock","pom.xml","build.gradle","build.gradle.kts","gradle.lockfile","packages.lock.json","Directory.Packages.props","composer.json","composer.lock","Gemfile","Gemfile.lock","mix.exs","mix.lock","deps.edn","project.clj","build.sbt"],re=new Set(ae.map(e=>e.toLowerCase())),se=new Set([".git",".hg",".svn",".workspai",".venv","venv",".tox",".mypy_cache",".pytest_cache","__pycache__","node_modules","vendor","pods","dist","build","out","target","bin","obj","coverage",".coverage",".next",".nuxt",".svelte-kit"]),F=1e5;function ne(e){return re.has(e.toLowerCase())||/\.(?:csproj|fsproj|vbproj)$/i.test(e)}async function ie(e){let t=[e],a=[],r=0;for(;t.length>0;){let i=t.shift();if(i===void 0)break;let o=await v.readdir(i,{withFileTypes:true});if(o.sort((n,s)=>n.name.localeCompare(s.name)),r+=o.length,r>F)throw new Error(`Dependency safety baseline exceeded ${F} filesystem entries under ${e}. Narrow the project boundary before creating this goal.`);for(let n of o){let s=u.join(i,n.name);if(n.isDirectory()){!se.has(n.name.toLowerCase())&&!a$3(n.name)&&t.push(s);continue}n.isFile()&&ne(n.name)&&a.push(s);}}return a}function oe(e){return /^(?:package\.json|package-lock\.json|npm-shrinkwrap\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb?)$/i.test(e)?"node":/^(?:pyproject\.toml|requirements\.txt|Pipfile(?:\.lock)?|poetry\.lock|uv\.lock)$/i.test(e)?"python":/^go\.(?:mod|sum)$/i.test(e)?"go":/^Cargo\.(?:toml|lock)$/i.test(e)?"rust":/^(?:pom\.xml|build\.gradle(?:\.kts)?|gradle\.lockfile)$/i.test(e)?"jvm":/^(?:Directory\.Packages\.props|packages\.lock\.json)$/i.test(e)?"dotnet":/^composer\.(?:json|lock)$/i.test(e)?"php":/^Gemfile(?:\.lock)?$/i.test(e)?"ruby":/^mix\.(?:exs|lock)$/i.test(e)?"elixir":/^(?:deps\.edn|project\.clj)$/i.test(e)?"clojure":/^build\.sbt$/i.test(e)?"scala":/\.(?:csproj|fsproj|vbproj)$/i.test(e)?"dotnet":"unknown"}function z(e){try{let t=JSON.parse(e),a={};for(let r of ["dependencies","devDependencies","peerDependencies","optionalDependencies"]){let i=t[r];if(!(!i||typeof i!="object"||Array.isArray(i)))for(let[o,n]of Object.entries(i))typeof n=="string"&&(a[`${r}:${o}`]=n);}return a}catch{return}}async function U(e,t){let r=(await q$1({workspacePath:e,includeAbsolutePaths:true})).projects.filter(o=>H(e,t,o)),i=new Map;for(let o of r){let n=u.resolve(e,o.path),s=await ie(n);for(let c of s){let g=u.basename(c),f=await v.readFile(c,"utf8"),p=u.relative(e,c).split(u.sep).join("/");i.set(p,{path:p,ecosystem:oe(g),sha256:createHash("sha256").update(f).digest("hex"),...g==="package.json"?{dependencies:z(f)??{}}:{}});}}return {manifests:[...i.values()].sort((o,n)=>o.path.localeCompare(n.path))}}function O(e){let a=e.replace(/^(?:workspace:|npm:[^@]+@)/,"").match(/(?:^|[^\d])(\d+)(?:\.\d+)?(?:\.\d+)?/);return a?Number(a[1]):null}function S(e){return /(?:^|\/)(?:package-lock\.json|npm-shrinkwrap\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb?|poetry\.lock|uv\.lock|Pipfile\.lock|go\.sum|Cargo\.lock|gradle\.lockfile|packages\.lock\.json|composer\.lock|Gemfile\.lock|mix\.lock)$/i.test(e)}async function ce(e){let t=e.dependencySafetyBaseline;if(!t)return k({id:"change-policy",label:"Change safety policy",status:"missing",expected:"dependency manifest safety baseline",actual:"baseline unavailable"});let a=[],r=await U(e.workspace.path,e.scope),i=new Map(r.manifests.map(s=>[s.path,s])),o=new Map(t.manifests.map(s=>[s.path,s])),n=new Set;for(let s of t.manifests){let c=i.get(s.path);(!c||c.sha256!==s.sha256)&&n.add(s.path);}for(let s of r.manifests)o.has(s.path)||n.add(s.path);for(let s of r.manifests)!o.has(s.path)&&!S(s.path)&&a.push(`${s.path} was added after the safety baseline`);for(let s of t.manifests){let c=i.get(s.path);if(!c){a.push(`${s.path} was removed`);continue}if(c.sha256===s.sha256)continue;if(s.dependencies){let p=await v.readFile(u.join(e.workspace.path,s.path),"utf8"),m=z(p);if(!m){a.push(`${s.path} is not valid dependency JSON`);continue}for(let[d,l]of Object.entries(s.dependencies)){let h=m[d];if(!h){a.push(`${d.replace(/^[^:]+:/,"")} was removed`);continue}if(h===l)continue;let G=O(l),R=O(h);(G===null||R===null||G!==R||/(?:latest|\*)/i.test(h))&&a.push(`${d.replace(/^[^:]+:/,"")} changed outside its proven major range (${l} \u2192 ${h})`);}continue}if(S(s.path))continue;let g=u.posix.dirname(s.path);[...i.values()].some(p=>{let m=u.posix.dirname(p.path);return p.ecosystem===s.ecosystem&&(m===g||g.startsWith(`${m}/`))&&S(p.path)&&n.has(p.path)})||a.push(`${s.path} changed without a matching reconciled ${s.ecosystem} lockfile`);}return k({id:"change-policy",label:"Change safety policy",status:a.length===0?"passed":"blocked",expected:"no force, removal, unbounded, or major dependency changes",actual:a.length===0?"manifest changes are within proven bounds":a.join("; ")})}function E(e,t){if(!/^[a-z0-9][a-z0-9._-]{7,95}$/i.test(t))throw new Error(`Invalid verified goal id: ${t}`);let a=u.join(e,".workspai","goals",t);return {directory:a,goal:u.join(a,"goal.json"),status:u.join(a,"status.json"),latestReport:u.join(e,V)}}function le(e){return {workspacePath:u.resolve(e.workspace.path),kind:e.kind,scope:e.scope,target:e.criteria.kind==="test-coverage"?e.criteria.minimumPercent:null,...e.criteria.kind==="test-coverage"&&e.criteria.runtime?{runtime:e.criteria.runtime}:{},constraints:e.constraints}}async function C(e,t){await v.ensureDir(u.dirname(e));let a=`${e}.${process.pid}.${Date.now()}.tmp`;await v.writeJson(a,t,{spaces:2}),await v.rename(a,e);}async function ue(e,t){let a=t?.trim();if(!a||a==="workspace")return {scope:{kind:"workspace"}};let r=a.startsWith("projects:")?"projects:":a.startsWith("project:")&&a.slice(8).includes(",")?"project:":null,i=a.startsWith("project:")?a.slice(8).trim():r?a.slice(r.length).trim():a;if(!i)throw new Error("Project goal scope must name a project.");let o=await q$1({workspacePath:e,includeAbsolutePaths:true});if(r){let g=i.split(",").map(p=>p.trim()).filter(Boolean);if(g.length<2||new Set(g).size!==g.length)throw new Error("A project-set goal scope must name at least two unique projects.");return {scope:{kind:"project-set",projects:g.map(p=>{let m=o.projects.filter(d=>d.name===p||d.path===p);if(m.length!==1)throw new Error(m.length===0?`Project goal scope was not found: ${p}`:`Project goal scope is ambiguous: ${p}`);return m[0]}).map(p=>({projectName:p.name,projectPath:u.resolve(e,p.path)})).sort((p,m)=>p.projectName.localeCompare(m.projectName))}}}let n=o.projects.filter(g=>{let f=u.resolve(e,g.path);return g.name===i||g.path===i||f===u.resolve(i)});if(n.length!==1)throw new Error(n.length===0?`Project goal scope was not found: ${i}`:`Project goal scope is ambiguous: ${i}`);let s=n[0],c=u.resolve(e,s.path);return {project:s,scope:{kind:"project",projectName:s.name,projectPath:c}}}function Y(e,t,a){return e===null?"unavailable":a==="minimum"?e>=t?"satisfied":"unsatisfied":e<=t?"satisfied":"unsatisfied"}async function X(e){if(!e)return null;try{let t=await v.readJson(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}function de(e){return Array.isArray(e.projects)?e.projects.filter(t=>!!t&&typeof t=="object"&&!Array.isArray(t)):e.project&&typeof e.project=="object"&&!Array.isArray(e.project)?[e.project]:[]}function pe(e){let t=e.dependencyAudit;return t&&typeof t=="object"&&!Array.isArray(t)?t:null}async function Q(e$1,t){let a=await d(e$1,e.doctor),r=await X(a);if(!r)return {measuredAt:new Date().toISOString(),value:null,target:0,unit:"blocking-vulnerabilities",status:"unavailable",evidencePaths:[],message:"Fresh Doctor dependency evidence is not available."};let i=de(r).filter(c=>{if(t.kind==="workspace")return true;let g=typeof c.name=="string"?c.name:typeof c.projectName=="string"?c.projectName:"",f=typeof c.path=="string"?u.resolve(c.path):typeof c.projectPath=="string"?u.resolve(c.projectPath):"";return t.kind==="project"?g===t.projectName||f===u.resolve(t.projectPath):t.projects.some(p=>p.projectName===g||u.resolve(p.projectPath)===f)}),o=i.map(pe).filter(c=>c!==null),n=o.map(c=>c.blockingFindingCount).filter(c=>Number.isInteger(c)&&Number(c)>=0),s=i.length>0&&n.length===i.length?n.reduce((c,g)=>c+g,0):null;return {measuredAt:(()=>{let c=o.map(g=>g.generatedAt).filter(g=>typeof g=="string").sort();return c[c.length-1]??new Date().toISOString()})(),value:s,target:0,unit:"blocking-vulnerabilities",status:Y(s,0,"maximum"),evidencePaths:a?[a]:[],message:s===null?"Doctor did not publish complete dependency audit counts for the selected scope.":`${s} blocking dependency vulnerability finding(s) remain.`}}async function Z(e){let t=await a$1({startPath:e,writeReport:false}),a=t.gates.filter(i=>i.status==="pass").length,r=t.gates.length;return {measuredAt:t.generatedAt,value:a,target:r,unit:"gates",status:t.overallStatus==="pass"?"satisfied":"unsatisfied",evidencePaths:[...new Set(t.gates.map(i=>i.evidencePath).filter(i=>typeof i=="string"))],message:t.overallStatus==="pass"?"All release readiness gates pass.":`${r-a} release readiness gate(s) still require work.`}}async function B(e){let t=await d$1({projectPath:e.projectPath,target:e.target,run:e.run,runtime:e.runtime}),r=t.metrics[t.target.metric]?.percent??null;return {executionStatus:t.status,measurement:{measuredAt:t.generatedAt,value:r,target:e.target,unit:"percent",status:Y(r,e.target,"minimum"),evidencePaths:[t.artifactPaths.project],message:t.status==="failed"?"The runtime-native coverage test command failed.":r===null?"Machine-readable coverage evidence is unavailable.":`${t.target.metric} coverage is ${r}% (target ${e.target}%).`}}}async function ee(e){if(e.scope.kind==="project"){if(!e.scope.projectPath)throw new Error("Coverage goal project scope does not have a project path.");return B({projectPath:e.scope.projectPath,target:e.target,run:e.run,runtime:e.runtime})}let t=await q$1({workspacePath:e.workspacePath,includeAbsolutePaths:true});if(t.projects.length===0)return {executionStatus:"unavailable",measurement:{measuredAt:new Date().toISOString(),value:null,target:e.target,unit:"percent",status:"unavailable",evidencePaths:[],message:"The workspace does not contain a registered project to measure."}};let a=t.projects.filter(l=>H(e.workspacePath,e.scope,l)),r=e.runtime,i=r?a.filter(l=>l.runtimeCandidates.includes(r)):a;if(i.length===0)return {executionStatus:"unavailable",measurement:{measuredAt:new Date().toISOString(),value:null,target:e.target,unit:"percent",status:"unavailable",evidencePaths:[],message:`The selected scope does not contain the ${e.runtime} coverage runtime.`}};let o=[];for(let l of i)o.push({projectName:l.name,result:await B({projectPath:u.resolve(e.workspacePath,l.path),target:e.target,run:e.run,runtime:e.runtime})});let n=o.filter(l=>l.result.executionStatus==="failed"),s=o.filter(l=>l.result.measurement.status==="unavailable"),c=o.filter(l=>l.result.measurement.status==="unsatisfied"),g=o.map(l=>l.result.measurement.value).filter(l=>l!==null),f=g.length===o.length&&g.length>0?Math.min(...g):null,p=n.length>0?"failed":s.length>0?"unavailable":c.length>0?"below-target":"passed",m=o.map(l=>l.result.measurement.measuredAt).sort(),d=[...n.map(l=>`${l.projectName}: coverage command failed`),...s.map(l=>`${l.projectName}: coverage unavailable`),...c.map(l=>`${l.projectName}: ${l.result.measurement.value??"unknown"}%`)];return {executionStatus:p,measurement:{measuredAt:m[m.length-1]??new Date().toISOString(),value:f,target:e.target,unit:"percent",status:p==="passed"?"satisfied":p==="below-target"?"unsatisfied":"unavailable",evidencePaths:[...new Set(o.flatMap(l=>l.result.measurement.evidencePaths))],message:p==="passed"?`Every registered project has at least ${e.target}% test coverage.`:`Workspace coverage is not verified: ${d.join("; ")}.`}}}function ge(e){let t=e.scope.kind==="project"?`project ${e.scope.projectName??"selected project"}`:e.scope.kind==="project-set"?`projects ${e.scope.projects.map(a=>a.projectName).join(", ")}`:"workspace";return e.kind==="release-readiness"?`Prepare the ${t} for release.`:e.kind==="dependency-security"?`Resolve blocking dependency vulnerabilities in the ${t} without unsafe changes.`:`Raise ${e.runtime?`${e.runtime} `:""}${t} test coverage to ${e.target??80}% without breaking its build.`}function me(e,t,a){return e==="release-readiness"?{kind:e,readiness:"pass",workspaceVerify:"ready"}:e==="dependency-security"?{kind:e,maximumBlockingVulnerabilities:0,requireFreshAudit:true}:{kind:e,metric:"auto",minimumPercent:t,...a?{runtime:a}:{}}}async function fe(e){return e.kind==="release-readiness"?Z(e.workspacePath):e.kind==="dependency-security"?Q(e.workspacePath,e.scope):(await ee({workspacePath:e.workspacePath,scope:e.scope,target:e.target,run:false,runtime:e.runtime})).measurement}async function Ee(e){let t=u.resolve(e.workspacePath),a$1=Math.max(0,Math.min(100,Math.round(e.target??80))),{scope:r}=await ue(t,e.scope),i={workspacePath:u.resolve(t),kind:e.kind,scope:r,target:e.kind==="test-coverage"?a$1:null,...e.kind==="test-coverage"&&e.runtime?{runtime:e.runtime}:{},constraints:{allowBreakingChanges:e.allowBreakingChanges===true,allowForce:e.allowForce===true,requireBuild:e.requireBuild!==false,requireTests:e.requireTests!==false}},o=K(i),n=`goal-${e.kind}-${o.slice(0,16)}`,s=E(t,n);if(await v.pathExists(s.goal)){let{goal:m,status:d}=await te(t,n);if(m.fingerprint===o)return {goal:m,status:d,resumed:d.state!=="verified"}}let c=new Date().toISOString(),g=await fe({workspacePath:t,kind:e.kind,scope:r,target:a$1,runtime:e.runtime}),f={schemaVersion:W,id:n,fingerprint:o,createdAt:c,updatedAt:c,workspace:{name:u.basename(t),path:t},scope:r,kind:e.kind,summary:ge({kind:e.kind,scope:r,target:a$1,runtime:e.runtime}),constraints:i.constraints,criteria:me(e.kind,a$1,e.runtime),baseline:g,...e.kind==="dependency-security"?{dependencySafetyBaseline:await U(t,r)}:{},artifactPaths:{goal:s.goal,status:s.status,latestReport:s.latestReport}},p={schemaVersion:A,goalId:n,goalFingerprint:o,workspacePath:t,updatedAt:c,state:"planned",attempt:0,progress:g,checks:[],blockingReasons:[],evidencePaths:g.evidencePaths,nextActions:e.kind==="test-coverage"?["Add focused tests for the lowest-coverage source paths.","Run verified goal checks."]:e.kind==="dependency-security"?["Inspect the fresh project dependency audit.","Apply only compatible non-force dependency repairs.","Reconcile the lockfile, test, build, and verify again."]:["Inspect the current remediation plan and failing release gates.","Repair the next causal blocker, then verify again."],artifactPath:s.status};return a(f,J,"Verified goal"),a(p,$,"Verified goal status"),await C(s.goal,f),await C(s.status,p),await e$1(t,V,p),{goal:f,status:p,resumed:false}}async function te(e,t){let a$1=E(u.resolve(e),t),r=await v.readJson(a$1.goal),i=await v.readJson(a$1.status);a(r,J,"Verified goal"),a(i,$,"Verified goal status");let o=u.resolve(e),n=u.resolve(r.artifactPaths.goal)===u.resolve(a$1.goal)&&u.resolve(r.artifactPaths.status)===u.resolve(a$1.status)&&u.resolve(r.artifactPaths.latestReport)===u.resolve(a$1.latestReport);if(r.schemaVersion!==W||i.schemaVersion!==A||r.id!==i.goalId||r.fingerprint!==i.goalFingerprint||r.fingerprint!==K(le(r))||u.resolve(r.workspace.path)!==o||u.resolve(i.workspacePath)!==o||!n)throw new Error(`Verified goal artifacts are inconsistent: ${t}`);return {goal:r,status:i}}function k(e){return {...e,message:e.message??`${e.label}: ${e.actual}; expected ${e.expected}.`}}async function q(e){let t=[],a=e.goal.scope.kind==="project"?[`project:${e.goal.scope.projectName}`]:e.goal.scope.kind==="project-set"?e.goal.scope.projects.map(r=>`project:${r.projectName}`):[void 0];for(let r of ["test","build"]){if(r==="test"&&e.includeTests===false)continue;if(!(r==="test"?e.goal.constraints.requireTests:e.goal.constraints.requireBuild)){t.push(k({id:r,label:`${r} validation`,status:"skipped",expected:"not required",actual:"skipped by goal contract"}));continue}if(!e.run){t.push(k({id:r,label:`${r} validation`,status:"missing",expected:"fresh passed evidence",actual:"execution disabled"}));continue}let o=false;for(let n of a){let s=await a$2({workspacePath:e.goal.workspace.path,stage:r,scope:n,parallel:false,continueOnError:false,strict:true,json:true,enforceGates:false}),c=n?.replace(/^project:/,"");if(t.push(k({id:c?`${r}:${c}`:r,label:c?`${r} validation \xB7 ${c}`:`${r} validation`,status:s.summary.exitCode===0?"passed":"failed",expected:"exit 0",actual:`exit ${s.summary.exitCode}`,evidencePath:u.join(e.goal.workspace.path,".workspai","reports","workspace-run-last.json")})),s.summary.exitCode!==0){o=true;break}}if(o)break}return t}async function Ge(e$2){let t=u.resolve(e$2.workspacePath),{goal:a$1,status:r}=await te(t,e$2.goalId),i=e$2.run!==false,o=[],n;if(i&&e$2.runIntelligence!==false){let d=await c({workspacePath:t,strict:true,agent:"generic"}),l=d.exitCode===0||d.exitCode===2,h=a$1.kind==="release-readiness";o.push(k({id:"workspace-intelligence-chain",label:"Workspace Intelligence chain",status:d.exitCode===0||d.exitCode===2&&!h?"passed":d.exitCode===2?"blocked":"failed",expected:"passed",actual:d.exitCode===2&&l&&!h?`${d.status}; canonical evidence refreshed for goal-scoped verification`:d.status,evidencePath:u.join(t,e.intelligenceRun)}));}if(a$1.kind==="release-readiness"){n=await Z(t),o.push(k({id:"release-readiness",label:"Release readiness",status:n.status==="satisfied"?"passed":"blocked",expected:"all gates pass",actual:n.message,evidencePath:u.join(t,e.readiness)}));let d$1=await d(t,e.verify),l=await X(d$1),h=l?.summary&&typeof l.summary=="object"&&!Array.isArray(l.summary)?String(l.summary.verdict??"missing"):"missing";o.push(k({id:"workspace-verify",label:"Workspace verification",status:h==="ready"?"passed":h==="missing"?"missing":"blocked",expected:"ready",actual:h,evidencePath:u.join(t,e.verify)}));}else if(a$1.kind==="dependency-security")n=await Q(t,a$1.scope),o.push(k({id:"dependency-audit",label:"Dependency security audit",status:n.status==="satisfied"?"passed":n.status==="unavailable"?"missing":"blocked",expected:"0 blocking vulnerabilities",actual:n.message,evidencePath:n.evidencePaths[0]})),o.push(a$1.constraints.allowBreakingChanges||a$1.constraints.allowForce?k({id:"change-policy",label:"Change safety policy",status:"blocked",expected:"breaking and force changes disabled",actual:`allowBreakingChanges=${a$1.constraints.allowBreakingChanges}, allowForce=${a$1.constraints.allowForce}`}):await ce(a$1)),n.status==="satisfied"&&o.push(...await q({goal:a$1,run:i}));else {let d=a$1.criteria.kind==="test-coverage"?a$1.criteria.minimumPercent:a$1.baseline.target;if(d===null)throw new Error("Coverage goal does not have a valid target.");let l=await ee({workspacePath:t,scope:a$1.scope,target:d,run:i,runtime:a$1.criteria.kind==="test-coverage"?a$1.criteria.runtime:void 0});n=l.measurement,o.push(k({id:"coverage",label:"Test coverage",status:n.status==="satisfied"?"passed":n.status==="unavailable"?"missing":"blocked",expected:`at least ${d}%`,actual:n.message,evidencePath:n.evidencePaths[0]})),o.push(k({id:"test",label:"Coverage test execution",status:l.executionStatus==="failed"?"failed":l.executionStatus==="unavailable"?"missing":"passed",expected:"runtime-native coverage test command completed",actual:l.executionStatus==="failed"?"coverage test command failed":l.executionStatus==="unavailable"?"coverage execution evidence unavailable":"coverage evidence produced by the test runner",evidencePath:n.evidencePaths[0]})),n.status==="satisfied"&&o.push(...await q({goal:a$1,run:i,includeTests:false}));}let s=o.filter(d=>d.status==="blocked"||d.status==="failed"||d.status==="missing").map(d=>d.message),c$1=[...new Set([...n.evidencePaths,...o.map(d=>d.evidencePath).filter(d=>typeof d=="string")])],g=n.status==="satisfied"&&o.every(d=>d.status==="passed"||d.status==="skipped"),f=E(t,a$1.id),p=g?[]:a$1.kind==="test-coverage"?["Inspect low-coverage files from the coverage artifact.","Add focused tests and verify again."]:a$1.kind==="dependency-security"?["Use fresh audit candidates and compatible package-manager repairs.","Reconcile lockfiles before running verified goal checks again."]:["Repair the first blocking readiness gate and verify the goal again."],m={schemaVersion:A,goalId:a$1.id,goalFingerprint:a$1.fingerprint,workspacePath:t,updatedAt:new Date().toISOString(),state:g?"verified":o.some(d=>d.status==="failed")?"failed":"blocked",attempt:r.attempt+1,progress:n,checks:o,blockingReasons:s,evidencePaths:c$1,nextActions:p,artifactPath:f.status};return a(m,$,"Verified goal status"),await C(f.status,m),await e$1(t,V,m),m}export{V as VERIFIED_GOAL_LAST_RUN_REPORT_PATH,W as VERIFIED_GOAL_SCHEMA_VERSION,A as VERIFIED_GOAL_STATUS_SCHEMA_VERSION,Ee as planVerifiedGoal,te as readVerifiedGoal,Ge as verifyVerifiedGoal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as captureWorkspaceRegistrationStrict,k as createProject,j as createWorkspace,m as createWorkspaceShareBundle,l as listWorkspaces,a as normalizeWorkspaceEntry,i as registerProjectInWorkspace,h as registerProjectInWorkspaceStrict,f as registerWorkspace,b as registerWorkspaceStrict,d as restoreWorkspaceRegistrationStrict,g as syncWorkspaceProjects,e as unregisterWorkspaceStrict}from'./chunk-
|
|
1
|
+
export{c as captureWorkspaceRegistrationStrict,k as createProject,j as createWorkspace,m as createWorkspaceShareBundle,l as listWorkspaces,a as normalizeWorkspaceEntry,i as registerProjectInWorkspace,h as registerProjectInWorkspaceStrict,f as registerWorkspace,b as registerWorkspaceStrict,d as restoreWorkspaceRegistrationStrict,g as syncWorkspaceProjects,e as unregisterWorkspaceStrict}from'./chunk-HQLBO23O.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as AGENT_CUSTOMIZATION_PACK_REPORT_PATH,e as AGENT_CUSTOMIZATION_PACK_SCHEMA,f as AGENT_REPORTS_INDEX_PATH,d as AGENT_REPORTS_INDEX_SCHEMA,h as AGENT_REPORT_CATALOG,i as buildCanonicalAgentReportReadOrder,j as buildWorkspaceAgentReportsIndex,k as parseAgentGroundingTargets,l as syncWorkspaceAgentGrounding}from'./chunk-
|
|
1
|
+
export{g as AGENT_CUSTOMIZATION_PACK_REPORT_PATH,e as AGENT_CUSTOMIZATION_PACK_SCHEMA,f as AGENT_REPORTS_INDEX_PATH,d as AGENT_REPORTS_INDEX_SCHEMA,h as AGENT_REPORT_CATALOG,i as buildCanonicalAgentReportReadOrder,j as buildWorkspaceAgentReportsIndex,k as parseAgentGroundingTargets,l as syncWorkspaceAgentGrounding}from'./chunk-6254CWUY.js';export{f as AGENT_GROUNDING_DOC_PATH,g as LEGACY_AGENT_GROUNDING_DOC_PATH,L as LEGACY_COPILOT_GROUNDING_SKILL_PATH,x as LEGACY_COPILOT_WORKSPACE_INSTRUCTIONS_PATH,N as LEGACY_COPILOT_WORKSPACE_INTELLIGENCE_SKILL_PATH,m as LEGACY_CURSOR_GROUNDING_RULE_PATH,T as LEGACY_MCP_DESIGN_REPORT_PATH,V as LEGACY_VSCODE_AGENT_HOOKS_PATH,K as WORKSPAI_COPILOT_GROUNDING_SKILL_PATH,w as WORKSPAI_COPILOT_WORKSPACE_INSTRUCTIONS_PATH,M as WORKSPAI_COPILOT_WORKSPACE_INTELLIGENCE_SKILL_PATH,j as WORKSPAI_CURSOR_DIAGNOSE_RULE_PATH,i as WORKSPAI_CURSOR_EVIDENCE_RULE_PATH,h as WORKSPAI_CURSOR_GROUNDING_RULE_PATH,l as WORKSPAI_CURSOR_RELEASE_RULE_PATH,k as WORKSPAI_CURSOR_REPAIR_RULE_PATH,S as WORKSPAI_MCP_DESIGN_REPORT_PATH,U as WORKSPAI_VSCODE_AGENT_HOOKS_PATH,n as WORKSPAI_WINDSURF_RULES_PATH}from'./chunk-SLFOUSRW.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{f as WORKSPACE_ARCHIVE_KIND,e as WORKSPACE_ARCHIVE_MANIFEST_PATH,h as assertSafeRemoteArchiveUrl,o as doctorWorkspaceArchive,l as exportWorkspaceArchive,p as hydrateWorkspaceArchive,m as inspectWorkspaceArchive,g as isPrivateAddress,j as isSafeArchiveEntryName,i as sanitizeWorkspaceArchiveName,k as shouldExcludeWorkspaceArchivePath,n as verifyWorkspaceArchive}from'./chunk-
|
|
1
|
+
export{f as WORKSPACE_ARCHIVE_KIND,e as WORKSPACE_ARCHIVE_MANIFEST_PATH,h as assertSafeRemoteArchiveUrl,o as doctorWorkspaceArchive,l as exportWorkspaceArchive,p as hydrateWorkspaceArchive,m as inspectWorkspaceArchive,g as isPrivateAddress,j as isSafeArchiveEntryName,i as sanitizeWorkspaceArchiveName,k as shouldExcludeWorkspaceArchivePath,n as verifyWorkspaceArchive}from'./chunk-BHM6RHTA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as WORKSPACE_CONTEXT_AGENT_REPORT_PATH,a as WORKSPACE_CONTEXT_SCHEMA_VERSION,c as buildWorkspaceAgentContext,d as writeWorkspaceAgentContext}from'./chunk-
|
|
1
|
+
export{b as WORKSPACE_CONTEXT_AGENT_REPORT_PATH,a as WORKSPACE_CONTEXT_SCHEMA_VERSION,c as buildWorkspaceAgentContext,d as writeWorkspaceAgentContext}from'./chunk-JCGSIDMC.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as WORKSPACE_CONTRACT_PATH,i as WORKSPACE_CONTRACT_SCHEMA_VERSION,h as WORKSPACE_CONTRACT_VERIFY_REPORT_PATH,j as WORKSPACE_CONTRACT_VERIFY_SCHEMA_VERSION,k as WorkspaceContractVerificationError,m as buildWorkspaceContract,q as buildWorkspaceContractGraph,l as discoverProjectJsonFiles,p as readWorkspaceContract,o as syncWorkspaceContract,r as verifyWorkspaceContract,n as writeWorkspaceContract,s as writeWorkspaceContractVerifyEvidence}from'./chunk-
|
|
1
|
+
export{g as WORKSPACE_CONTRACT_PATH,i as WORKSPACE_CONTRACT_SCHEMA_VERSION,h as WORKSPACE_CONTRACT_VERIFY_REPORT_PATH,j as WORKSPACE_CONTRACT_VERIFY_SCHEMA_VERSION,k as WorkspaceContractVerificationError,m as buildWorkspaceContract,q as buildWorkspaceContractGraph,l as discoverProjectJsonFiles,p as readWorkspaceContract,o as syncWorkspaceContract,r as verifyWorkspaceContract,n as writeWorkspaceContract,s as writeWorkspaceContractVerifyEvidence}from'./chunk-EHCKITR4.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as buildWorkspaceExplain,a as resolveWorkspaceExplainArtifactPath,c as writeWorkspaceExplainReport}from'./chunk-KENOAC2Q.js';export{c as WORKSPACE_EXPLAIN_REPORT_PATH,e as WORKSPACE_TRACE_REPORT_PATH,d as WORKSPACE_WHY_REPORT_PATH}from'./chunk-SLFOUSRW.js';export{e as WORKSPACE_MODEL_DIFF_REPORT_PATH}from'./chunk-BRYJTW6S.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as WORKSPACE_EXPLAIN_SCHEMA_VERSION,b as WORKSPACE_EXPLAIN_TARGETS,e as isWorkspaceExplainReport,c as parseWorkspaceExplainTarget,d as resolveWorkspaceTraceTarget}from'./chunk-FX5J6JCK.js';export{c as WORKSPACE_EXPLAIN_REPORT_PATH,e as WORKSPACE_TRACE_REPORT_PATH,d as WORKSPACE_WHY_REPORT_PATH}from'./chunk-SLFOUSRW.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-ICGWHIMK.js';import {b as b$1,f,j}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-ICGWHIMK.js';import {b as b$1,f,j}from'./chunk-5EVDW7JM.js';import o from'path';async function m(r){let t=o.resolve(r.workspacePath),n=b(r.payload);if(!n)return {ok:false,error:"Invalid agent-action-outcome payload",historyPath:o.join(t,b$1)};let c=f(n),p=o.join(t,b$1);return await j(t,c,{retention:r.retention}),{ok:true,entry:c,historyPath:p}}function l(r){let t=r.trim();if(!t)return null;try{return JSON.parse(t)}catch{return null}}async function h(){let r=[];for await(let t of process.stdin)r.push(typeof t=="string"?Buffer.from(t):t);return Buffer.concat(r).toString("utf8")}export{l as parseFeedbackStdinPayload,h as readStdinAll,m as recordWorkspaceFeedback};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {c as c$1}from'./chunk-
|
|
1
|
+
import {c as c$1}from'./chunk-THIG2YQP.js';import {a}from'./chunk-2LIVMG5C.js';import c from'path';import u from'fs-extra';async function W(t,r){let o=await a(t),d=o?.name||c.basename(t),n,i=c.join(t,".python-version");if(await u.pathExists(i)){let a=(await u.readFile(i,"utf-8")).trim();a&&(n=a);}let e=r?.profile||"polyglot",m=e==="python-only"||e==="polyglot"||e==="enterprise",f=r?.installMethod||o?.metadata?.npm?.installMethod||(m?"poetry":"venv"),s=await c$1(t,{workspaceName:d,installMethod:f,pythonVersion:n,profile:e,writeMarker:true,writeGitignore:true,onlyIfMissing:!r?.force}),{publishWorkspaceRegistrySummary:y}=await import('./workspace-registry-summary-STGUGROG.js');return await y(t),{workspacePath:t,created:s,status:s.length>0?"passed":"skipped"}}export{W as ensureWorkspaceFoundation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-PSYQ6IJA.js';import {a}from'./chunk-AFIFZTOY.js';import {d,c}from'./chunk-EWZZUQBR.js';import g from'crypto';import H from'path';var M="workspace-graph-stream.v1";function w(o){return c({...o,generatedAt:"<ignored>",proofs:o.proofs.map(s=>({...s,observedAt:"<ignored>"}))})}function f(o){return "observedAt"in o?{...o,observedAt:"<ignored>"}:o}function u(o,s){let e=new Map(o.map(r=>[r.id,r])),a=new Map(s.map(r=>[r.id,r])),i=s.filter(r=>!e.has(r.id)),p=s.filter(r=>{let t=e.get(r.id);return t?c(f(t))!==c(f(r)):false}),d=o.filter(r=>!a.has(r.id)).map(r=>r.id);return {added:i,updated:p,removed:d}}function E(o,s){let e=new Map(o.map(a=>[a.id,a]));return s.filter(a=>{let i=e.get(a.id);return !i||c(i)!==c(a)})}function I(o){return a(o,"contracts/workspace-intelligence/workspace-graph-stream.v1.json","Workspace graph stream event"),o}var R=class{previous=null;revision=0;generation=0;workspaceId;sessionId;now;nextCorrelationId;constructor(s){this.workspaceId=`workspace:${g.createHash("sha256").update(H.resolve(s.workspacePath)).digest("hex")}`,this.sessionId=s.sessionId??g.randomUUID(),this.now=s.now??(()=>new Date),this.nextCorrelationId=s.correlationId??(()=>g.randomUUID());}publish(s,e){b(e,s);let a=this.now().toISOString(),i=d(s),p=w(e),d$1=this.nextCorrelationId(),r={schemaVersion:M,workspaceId:this.workspaceId,sessionId:this.sessionId,generation:this.generation,modelHash:i,graphHash:p,generatedAt:a,causationId:d$1,correlationId:d$1};if(!this.previous){let S=I({...r,type:"graph.snapshot",revision:this.revision,payload:{graph:e,reason:"initial"}});return this.previous=e,S}let t=this.previous,W=this.revision,b$1=t.source.hash,y=w(t);this.revision+=1,this.generation+=1;let c$1=u(t.entities,e.entities),h=u(t.relations,e.relations),l=u(t.proofs,e.proofs),G=c(t.quality)!==c(e.quality),A=I({...r,generation:this.generation,type:"graph.delta",baseRevision:W,baseModelHash:b$1,baseGraphHash:y,revision:this.revision,payload:{entitiesAdded:c$1.added,entitiesUpdated:c$1.updated,entitiesRemoved:c$1.removed,relationsAdded:h.added,relationsUpdated:h.updated,relationsRemoved:h.removed,proofsAdded:l.added,proofsUpdated:l.updated,proofsRemoved:l.removed,providersUpdated:E(t.providers,e.providers),quality:G?e.quality:null,diagnostics:e.diagnostics}});return this.previous=e,A}};export{M as WORKSPACE_GRAPH_STREAM_SCHEMA_VERSION,R as WorkspaceGraphStreamPublisher};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as WORKSPACE_GRAPH_TOKEN_EFFICIENCY_SCHEMA_VERSION,b as buildWorkspaceGraphTokenEfficiencyReport}from'./chunk-2RPFCBS4.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as DEFAULT_HISTORY_RETENTION,b as WORKSPACE_HISTORY_PATH,a as WORKSPACE_HISTORY_SCHEMA_VERSION,i as appendHistoryEntry,f as historyEntryFromAgentAction,g as historyEntryFromDoctorFixResult,e as historyEntryFromVerify,d as normalizeHistoryEntry,h as readWorkspaceHistory,j as recordWorkspaceHistory}from'./chunk-
|
|
1
|
+
export{c as DEFAULT_HISTORY_RETENTION,b as WORKSPACE_HISTORY_PATH,a as WORKSPACE_HISTORY_SCHEMA_VERSION,i as appendHistoryEntry,f as historyEntryFromAgentAction,g as historyEntryFromDoctorFixResult,e as historyEntryFromVerify,d as normalizeHistoryEntry,h as readWorkspaceHistory,j as recordWorkspaceHistory}from'./chunk-5EVDW7JM.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{g as WORKSPACE_IMPACT_REPORT_PATH,f as WORKSPACE_IMPACT_SCHEMA_VERSION,e as WORKSPACE_MODEL_DIFF_REPORT_PATH,c as WORKSPACE_MODEL_DIFF_SCHEMA_VERSION,d as WORKSPACE_MODEL_SNAPSHOT_REPORT_PATH,b as WORKSPACE_MODEL_SNAPSHOT_SCHEMA_VERSION,p as buildWorkspaceImpact,k as buildWorkspaceModelSnapshot,m as diffWorkspaceModel,i as isGitDiffSource,h as migrateLegacyWorkspaceModelSnapshot,j as parseGitDiffRef,o as workspaceVerificationPlan,q as writeWorkspaceImpact,n as writeWorkspaceModelDiff,l as writeWorkspaceModelSnapshot}from'./chunk-
|
|
1
|
+
export{g as WORKSPACE_IMPACT_REPORT_PATH,f as WORKSPACE_IMPACT_SCHEMA_VERSION,e as WORKSPACE_MODEL_DIFF_REPORT_PATH,c as WORKSPACE_MODEL_DIFF_SCHEMA_VERSION,d as WORKSPACE_MODEL_SNAPSHOT_REPORT_PATH,b as WORKSPACE_MODEL_SNAPSHOT_SCHEMA_VERSION,p as buildWorkspaceImpact,k as buildWorkspaceModelSnapshot,m as diffWorkspaceModel,i as isGitDiffSource,h as migrateLegacyWorkspaceModelSnapshot,j as parseGitDiffRef,o as workspaceVerificationPlan,q as writeWorkspaceImpact,n as writeWorkspaceModelDiff,l as writeWorkspaceModelSnapshot}from'./chunk-BRYJTW6S.js';export{d as hashWorkspaceModel}from'./chunk-EWZZUQBR.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{c as WORKSPACE_INTELLIGENCE_BENCHMARK_CONTRACT_PATH,b as WORKSPACE_INTELLIGENCE_BENCHMARK_REPORT_PATH,a as WORKSPACE_INTELLIGENCE_BENCHMARK_SCHEMA_VERSION,d as WORKSPACE_INTELLIGENCE_BENCHMARK_SUITES,g as buildWorkspaceIntelligenceBenchmark,e as classifyWorkspaceEvaluationProvenance,f as trustedMeasuredEvaluationReduction,h as writeWorkspaceIntelligenceBenchmark}from'./chunk-SRLWHOLF.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{e as WORKSPACE_EVALUATION_LAST_RUN_PATH,d as WORKSPACE_EVALUATION_LIVE_PATH,k as appendWorkspaceEvaluationEvent,n as assertWorkspaceEvaluationSourceTaxonomy,m as compareWorkspaceEvaluations,h as createWorkspaceEvaluation,l as finalizeWorkspaceEvaluation,g as normalizeWorkspaceEvaluationEvent,j as readWorkspaceEvaluation,f as summarizeWorkspaceEvaluation,i as writeWorkspaceEvaluation}from'./chunk-CPR2CMOY.js';
|
package/dist/{workspace-intelligence-runner-XYUPCSLN.js → workspace-intelligence-runner-OWN5ZI6W.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as WORKSPACE_INTELLIGENCE_RUN_REPORT_PATH,b as WORKSPACE_INTELLIGENCE_RUN_SCHEMA_VERSION,c as runWorkspaceIntelligenceChain}from'./chunk-
|
|
1
|
+
export{a as WORKSPACE_INTELLIGENCE_RUN_REPORT_PATH,b as WORKSPACE_INTELLIGENCE_RUN_SCHEMA_VERSION,c as runWorkspaceIntelligenceChain}from'./chunk-N4QFNOAI.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{j as WORKSPACE_INTELLIGENCE_ADDITIONAL_PRODUCERS,e as WORKSPACE_INTELLIGENCE_ARTIFACTS,f as WORKSPACE_INTELLIGENCE_ARTIFACT_SCHEMAS,g as WORKSPACE_INTELLIGENCE_ARTIFACT_SCHEMA_CONTRACTS,k as WORKSPACE_INTELLIGENCE_COMMAND_SIGNATURES,o as WORKSPACE_INTELLIGENCE_PREFLIGHT_ARTIFACTS,n as WORKSPACE_INTELLIGENCE_PREFLIGHT_IDS,l as WORKSPACE_INTELLIGENCE_ROOT_COMMANDS,p as WORKSPACE_INTELLIGENCE_RUNTIME_STEPS,m as WORKSPACE_INTELLIGENCE_STEP_IDS,i as WORKSPACE_SUPPLEMENTAL_ARTIFACTS,h as WORKSPACE_SUPPLEMENTAL_ARTIFACT_CONTRACTS,q as workspaceIntelligenceRuntimeStep}from'./chunk-
|
|
1
|
+
export{j as WORKSPACE_INTELLIGENCE_ADDITIONAL_PRODUCERS,e as WORKSPACE_INTELLIGENCE_ARTIFACTS,f as WORKSPACE_INTELLIGENCE_ARTIFACT_SCHEMAS,g as WORKSPACE_INTELLIGENCE_ARTIFACT_SCHEMA_CONTRACTS,k as WORKSPACE_INTELLIGENCE_COMMAND_SIGNATURES,o as WORKSPACE_INTELLIGENCE_PREFLIGHT_ARTIFACTS,n as WORKSPACE_INTELLIGENCE_PREFLIGHT_IDS,l as WORKSPACE_INTELLIGENCE_ROOT_COMMANDS,p as WORKSPACE_INTELLIGENCE_RUNTIME_STEPS,m as WORKSPACE_INTELLIGENCE_STEP_IDS,i as WORKSPACE_SUPPLEMENTAL_ARTIFACTS,h as WORKSPACE_SUPPLEMENTAL_ARTIFACT_CONTRACTS,q as workspaceIntelligenceRuntimeStep}from'./chunk-ZGHJIQXL.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as WORKSPACE_KNOWLEDGE_GRAPH_REPORT_PATH,b as assertWorkspaceKnowledgeGraphSourceBinding,e as buildWorkspaceKnowledgeGraph,c as computeWorkspaceKnowledgeGraphInputFingerprint,f as knowledgeEntityId,d as workspaceKnowledgeGraphInputsMatchLiveState}from'./chunk-PSYQ6IJA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{f as WORKSPACE_KNOWLEDGE_CONFIDENCE_LEVELS,d as WORKSPACE_KNOWLEDGE_DERIVATIONS,b as WORKSPACE_KNOWLEDGE_ENTITY_KINDS,g as WORKSPACE_KNOWLEDGE_FRESHNESS_LEVELS,a as WORKSPACE_KNOWLEDGE_GRAPH_SCHEMA_VERSION,c as WORKSPACE_KNOWLEDGE_RELATION_KINDS,e as WORKSPACE_KNOWLEDGE_TRUST_LEVELS}from'./chunk-
|
|
1
|
+
export{f as WORKSPACE_KNOWLEDGE_CONFIDENCE_LEVELS,d as WORKSPACE_KNOWLEDGE_DERIVATIONS,b as WORKSPACE_KNOWLEDGE_ENTITY_KINDS,g as WORKSPACE_KNOWLEDGE_FRESHNESS_LEVELS,a as WORKSPACE_KNOWLEDGE_GRAPH_SCHEMA_VERSION,c as WORKSPACE_KNOWLEDGE_RELATION_KINDS,e as WORKSPACE_KNOWLEDGE_TRUST_LEVELS}from'./chunk-6E2Y3XGT.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as WORKSPACE_KNOWLEDGE_SEARCH_SCHEMA_VERSION,e as queryKnowledgeEntities,c as queryKnowledgeEvidence,d as queryKnowledgePath,b as resolveKnowledgeTarget,f as searchKnowledgeGraph}from'./chunk-
|
|
1
|
+
export{a as WORKSPACE_KNOWLEDGE_SEARCH_SCHEMA_VERSION,e as queryKnowledgeEntities,c as queryKnowledgeEvidence,d as queryKnowledgePath,b as resolveKnowledgeTarget,f as searchKnowledgeGraph}from'./chunk-2MVIRJJR.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{a as readWorkspaceKnowledgeGraphSnapshot}from'./chunk-ENZPM52J.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{d as createNpmWorkspaceMarker,e as isValidWorkspaceMarker,a as readWorkspaceMarker,c as updateWorkspaceMetadata,b as writeWorkspaceMarker}from'./chunk-
|
|
1
|
+
export{d as createNpmWorkspaceMarker,e as isValidWorkspaceMarker,a as readWorkspaceMarker,c as updateWorkspaceMetadata,b as writeWorkspaceMarker}from'./chunk-2LIVMG5C.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {b}from'./chunk-KENOAC2Q.js';import {d,c as c$2,f as f$1,e as e$2}from'./chunk-2MVIRJJR.js';import {c as c$1,e as e$1}from'./chunk-FX5J6JCK.js';import {c as c$3,b as b$3}from'./chunk-SLFOUSRW.js';import {b as b$2}from'./chunk-JCGSIDMC.js';import {d as d$2}from'./chunk-YYY2WXOH.js';import {b as b$1}from'./chunk-PSYQ6IJA.js';import {l}from'./chunk-TP7VKEUF.js';import {h}from'./chunk-EHCKITR4.js';import {d as d$1}from'./chunk-XDPTAV2T.js';import {a}from'./chunk-AFIFZTOY.js';import {e,g as g$1}from'./chunk-ZGHJIQXL.js';import {w}from'./chunk-VQZ5PI5J.js';import k from'path';import F from'readline';import R from'fs-extra';var D=e.agentIndex,U=new Map(Object.keys(e).flatMap(e$1=>{let t=g$1[e$1];return t?[[e[e$1],t]]:[]}));function z(e,t){return e.kind!==t.kind?false:e.kind==="project"&&t.kind==="project"?e.project.toLowerCase()===t.project.toLowerCase():e.kind==="blocker"&&t.kind==="blocker"?e.blockerId===t.blockerId:e.kind==="trace"&&t.kind==="trace"?e.diffRef===t.diffRef:true}var B={type:"object",properties:{data:true,error:{type:"object",properties:{code:{type:"string"},message:{type:"string"}},required:["code","message"],additionalProperties:false}},oneOf:[{required:["data"]},{required:["error"]}],additionalProperties:false},X={readOnlyHint:true,destructiveHint:false,idempotentHint:true,openWorldHint:false},K=[{name:"getWorkspaceModel",description:"Read workspace-model.json",inputSchema:{type:"object",properties:{}}},{name:"getWorkspaceKnowledgeGraph",description:"Read the current proof-backed workspace knowledge graph artifact",inputSchema:{type:"object",properties:{}}},{name:"getWorkspaceEvaluation",description:"Read the live or finalized provenance-aware model usage and verified-outcome report",inputSchema:{type:"object",properties:{live:{type:"boolean",description:"Read the live report instead of the finalized last-run report"}}}},{name:"queryWorkspaceEntities",description:"List workspace knowledge entities, optionally filtered by kind",inputSchema:{type:"object",properties:{kind:{type:"string",description:"Optional entity kind"}}}},{name:"searchWorkspaceGraph",description:"Return bounded, proof-carrying workspace context matching a text query",inputSchema:{type:"object",properties:{query:{type:"string",description:"Text, path, symbol, service, or concept to find"},kind:{type:"string",description:"Optional entity kind filter"},projectId:{type:"string",description:"Optional canonical project id filter"},limit:{type:"integer",minimum:1,maximum:100,default:12}},required:["query"]}},{name:"getWorkspaceGraphEvidence",description:"Resolve portable evidence for a knowledge graph entity or relation",inputSchema:{type:"object",properties:{query:{type:"string"}},required:["query"]}},{name:"findWorkspaceGraphPath",description:"Find a shortest proof-carrying path between two workspace entities",inputSchema:{type:"object",properties:{from:{type:"string"},to:{type:"string"}},required:["from","to"]}},{name:"getEvidenceIndex",description:"Read agent reports INDEX.json",inputSchema:{type:"object",properties:{}}},{name:"getBlockers",description:"Aggregate blocking reasons from verify, explain, and contract-verify reports",inputSchema:{type:"object",properties:{}}},{name:"getSafeCommands",description:"Read safe commands from workspace-context-agent.json",inputSchema:{type:"object",properties:{}}},{name:"getProjectContext",description:"Read scoped project context from workspace-context-agent.json",inputSchema:{type:"object",properties:{project:{type:"string",description:"Optional project name; defaults to active scope"}}}},{name:"getArtifact",description:"Read one workspace-relative artifact path",inputSchema:{type:"object",properties:{relativePath:{type:"string"}},required:["relativePath"]}},{name:"listOperationalSkills",description:"Read workspace-skills-index.json",inputSchema:{type:"object",properties:{}}},{name:"getWorkspaceExplain",description:"Build or read workspace explain report",inputSchema:{type:"object",properties:{target:{type:"string",description:"release-blocked | project:<name> | blocker:<id> | trace:<diffRef> | <project>"}}}}].map(e=>({...e,title:e.name.replace(/([a-z])([A-Z])/g,"$1 $2"),inputSchema:{...e.inputSchema,additionalProperties:false},outputSchema:B,annotations:X}));function Y(e){let t=e.trim().replace(/\\/g,"/");return t.length>0&&!k.isAbsolute(t)&&!t.split("/").includes("..")&&(t.startsWith(".workspai/")||t.startsWith(".rapidkit/"))}async function c(e$1,t){if(!Y(t))throw new Error(`Unsafe artifact path: ${t}`);let n=await d$1(e$1,t)??k.join(e$1,t);if(!await R.pathExists(n))return null;let r=await R.readJson(n),o=w(t),p=U.get(o);if(p&&a(r,p,`MCP artifact ${o}`),o===e.knowledgeGraph){let s=k.join(e$1,l);if(!await R.pathExists(s))throw new Error("Workspace knowledge graph cannot be consumed without its source model.");let u=await R.readJson(s);b$1(r,u);}return r}async function Z(e){let t=[],n=new Set,o=((await c(e,d$2))?.blockingReasons??[]).filter(i=>typeof i=="string"&&i.trim().length>0);if(o.length>0){t.push({artifact:d$2,reasons:o});for(let i of o)n.add(i);}let p=await c(e,c$3);if(e$1(p)){let i=(p.blockingReasons??[]).filter(l=>typeof l=="string"&&l.trim().length>0);if(i.length>0){t.push({artifact:c$3,reasons:i});for(let l of i)n.add(l);}}let s=await c(e,h),u=(s?.violations??[]).filter(i=>typeof i=="string"&&i.trim().length>0);if(u.length>0||String(s?.status??"").toLowerCase()==="failed"){let i=u.length>0?u:["Workspace contract verification failed"];t.push({artifact:h,reasons:i});for(let l of i)n.add(l);}return {blockingReasons:[...n],sources:t}}async function V(e$3,t,n){switch(t){case "getWorkspaceModel":return c(e$3,l);case "getWorkspaceKnowledgeGraph":return c(e$3,e.knowledgeGraph);case "getWorkspaceEvaluation":return c(e$3,n.live===true?e.evaluationLive:e.evaluationLastRun);case "queryWorkspaceEntities":{let r=await c(e$3,e.knowledgeGraph);if(!r)return null;let o=String(n.kind??"").trim();return {schemaVersion:r.schemaVersion,generatedAt:r.generatedAt,entities:e$2(r,o||void 0)}}case "searchWorkspaceGraph":{let r=await c(e$3,e.knowledgeGraph);if(!r)return null;let o=typeof n.limit=="number"?n.limit:Number(n.limit??12);return f$1(r,{query:String(n.query??""),...typeof n.kind=="string"&&n.kind.trim()?{kind:n.kind.trim()}:{},...typeof n.projectId=="string"&&n.projectId.trim()?{projectId:n.projectId.trim()}:{},limit:Number.isFinite(o)?o:12,projection:"agent"})}case "getWorkspaceGraphEvidence":{let r=await c(e$3,e.knowledgeGraph);return r?c$2(r,String(n.query??"")):null}case "findWorkspaceGraphPath":{let r=await c(e$3,e.knowledgeGraph);return r?d(r,String(n.from??""),String(n.to??"")):null}case "getEvidenceIndex":return c(e$3,D);case "getBlockers":return Z(e$3);case "getSafeCommands":return {safeCommands:(await c(e$3,b$2))?.safeCommands??[]};case "getProjectContext":{let r=await c(e$3,b$2);if(!r)return null;let o=String(n.project??"").trim(),p=r.scope?.activeProject??void 0,s=o||p,u=Array.isArray(r.projects)?r.projects:[],i=s&&u.find(l=>typeof l.name=="string"&&l.name.toLowerCase()===s.toLowerCase());return {workspace:r.workspace??null,scope:r.scope??null,validation:r.validation??null,project:i??null,safeCommands:r.safeCommands??[]}}case "getArtifact":{let r=String(n.relativePath??"").trim();return c(e$3,r)}case "listOperationalSkills":return c(e$3,b$3);case "getWorkspaceExplain":{let r=String(n.target??"release-blocked").trim(),o=c$1(r);if(!o)throw new Error(`Invalid explain target: ${r}`);let p=await c(e$3,c$3);return e$1(p)&&z(p.target,o)?p:b({workspacePath:e$3,target:o})}default:throw new Error(`Unknown tool: ${t}`)}}var $="2026-07-28",H=["2024-11-05","2025-03-26","2025-06-18","2025-11-25"],J={name:"workspai-workspace-mcp",version:"1.0.0"};function Q(e){let t=e.params?._meta;if(!t||typeof t!="object"||Array.isArray(t))return;let n=t["io.modelcontextprotocol/protocolVersion"];return typeof n=="string"?n:void 0}function ee(e,t){return !t||!e||typeof e!="object"||Array.isArray(e)?e:{...e,_meta:{...e._meta??{},"io.modelcontextprotocol/serverInfo":J}}}function f(e,t,n=false){process.stdout.write(`${JSON.stringify({jsonrpc:"2.0",id:e??null,result:ee(t,n)})}
|
|
2
|
+
`);}function g(e,t,n=-32e3){process.stdout.write(`${JSON.stringify({jsonrpc:"2.0",id:e??null,error:{code:n,message:t}})}
|
|
3
|
+
`);}function te(e){let t={data:e};return {content:[{type:"text",text:JSON.stringify(t,null,2)}],structuredContent:t,isError:false}}function j(e,t){return {content:[{type:"text",text:t}],structuredContent:{error:{code:e,message:t}},isError:true}}function ne(e,t){for(let n of e.inputSchema.required??[])if(!(n in t))return `Missing required argument: ${n}`;for(let[n,r]of Object.entries(t)){let o=e.inputSchema.properties[n];if(!o)return `Unknown argument for ${e.name}: ${n}`;if(o.type==="string"&&typeof r!="string")return `Argument ${n} must be a string`;if(o.type==="boolean"&&typeof r!="boolean")return `Argument ${n} must be a boolean`;if(o.type==="integer"&&(!Number.isInteger(r)||typeof r!="number"))return `Argument ${n} must be an integer`;if(typeof r=="number"){if(typeof o.minimum=="number"&&r<o.minimum)return `Argument ${n} must be at least ${o.minimum}`;if(typeof o.maximum=="number"&&r>o.maximum)return `Argument ${n} must be at most ${o.maximum}`}}return null}async function Se(e){let t=k.resolve(e.workspacePath),n=F.createInterface({input:process.stdin,terminal:false});for await(let r of n){let o=r.trim();if(!o)continue;let p;try{p=JSON.parse(o);}catch{g(null,"Invalid JSON-RPC request",-32700);continue}let{id:s,method:u,params:i}=p,l=Q(p)===$;try{if(u==="server/discover"){f(s,{resultType:"complete",supportedVersions:[$],capabilities:{tools:{listChanged:false}},instructions:"Use bounded Workspai graph search before requesting complete workspace artifacts."},true);continue}if(u==="initialize"){let a=typeof i?.protocolVersion=="string"?i.protocolVersion:void 0,y=H.includes(a)?a:H.at(-1);f(s,{protocolVersion:y,capabilities:{tools:{listChanged:false}},serverInfo:J});continue}if(u==="notifications/initialized")continue;if(u==="tools/list"){f(s,{tools:K.map(a=>({name:a.name,title:a.title,description:a.description,inputSchema:a.inputSchema,outputSchema:a.outputSchema,annotations:a.annotations}))},l);continue}if(u==="tools/call"){let a=String(i?.name??""),y=K.find(m=>m.name===a);if(!y){g(s,`Unknown tool: ${a}`,-32602);continue}if(i?.arguments!==void 0&&(!i.arguments||typeof i.arguments!="object"||Array.isArray(i.arguments))){g(s,"Tool arguments must be an object",-32602);continue}let O=i?.arguments&&typeof i.arguments=="object"?i.arguments:{},_=ne(y,O);if(_){f(s,j("invalid_arguments",_),l);continue}try{let m=await V(t,a,O);f(s,m==null?j("artifact_not_found",`${a} returned no current workspace data`):te(m),l);}catch(m){f(s,j("tool_execution_failed",m instanceof Error?m.message:String(m)),l);}continue}g(s,`Unsupported method: ${u??"unknown"}`,-32601);}catch(a){g(s,a instanceof Error?a.message:String(a));}}}async function Ee(e,t,n={}){return V(k.resolve(e),t,n)}export{K as WORKSPACE_MCP_READ_TOOLS,Ee as invokeMcpToolForTest,Se as runWorkspaceMcpServe};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{l as WORKSPACE_MODEL_REPORT_PATH,k as WORKSPACE_MODEL_SCHEMA_VERSION,q as buildWorkspaceModel,r as buildWorkspaceModelCached,p as buildWorkspaceModelFacts,s as buildWorkspaceModelIncremental,n as createWorkspaceModelBuildProvenance,o as validateWorkspaceModelStrict,m as workspaceModelProjectTopology,t as writeWorkspaceModel}from'./chunk-TP7VKEUF.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as finalizeWorkspaceOnboarding,a as syncWorkspaceConsumerArtifacts}from'./chunk-
|
|
1
|
+
export{b as finalizeWorkspaceOnboarding,a as syncWorkspaceConsumerArtifacts}from'./chunk-VI4ZRAY6.js';
|
package/dist/{workspace-python-engine-state-J4QKW55K.js → workspace-python-engine-state-BE4A3BL5.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a,b}from'./chunk-
|
|
1
|
+
import {a,b}from'./chunk-2LIVMG5C.js';import {t,q}from'./chunk-VQZ5PI5J.js';import l from'fs-extra';function c(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}async function m(n,e,o){let s=(await Promise.all(t(n,e).map(async r=>({candidate:r,exists:await l.pathExists(r)})))).find(({exists:r})=>r)?.candidate;if(!s)return false;let t$1=q(n,e),a=c(await l.readJson(s));return await l.outputJson(t$1,o(a),{spaces:2}),await l.appendFile(t$1,`
|
|
2
2
|
`,"utf-8"),true}async function M(n,e){let o=e.now??new Date().toISOString(),s=e.installMethod==="pip"?"venv":e.installMethod;await m(n,"workspace.json",a=>{let r=c(a.engine),i=c(r.python_core);return delete a.bootstrap_note,delete i.reason,{...a,engine:{...r,install_method:s,python_version:e.pythonVersion??r.python_version??null,python_core:{...i,status:"installed",installed_at:o,...e.coreVersion?{version:e.coreVersion}:{}}}}}),await m(n,"toolchain.lock",a=>{let r=c(a.runtime),i=c(r.python),d=c(i.core);return delete d.reason,{...a,generated_at:o,runtime:{...r,python:{...i,version:e.pythonVersion??i.version??null,install_method:s,core:{...d,status:"installed",installed_at:o,...e.coreVersion?{version:e.coreVersion}:{}}}}}});let t=await a(n);if(t){let a={...t.metadata?.python??{}};delete a.coreReason,t.metadata={...t.metadata,python:{...a,coreStatus:"installed",...e.coreVersion?{coreVersion:e.coreVersion}:{},...e.pythonVersion?{pythonVersion:e.pythonVersion}:{},...e.venvPath?{venvPath:e.venvPath}:{}},npm:{...t.metadata?.npm??{},packageVersion:t.metadata?.npm?.packageVersion??t.version,installMethod:s,lastUsedAt:o}},await b(n,t);}}export{M as markWorkspacePythonEngineInstalled};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-
|
|
1
|
+
import {b as b$1}from'./chunk-3OGPTLI2.js';import {h as h$1}from'./chunk-XDPTAV2T.js';import g from'path';import i from'fs-extra';var l="README.md",h="<!-- workspai:workspace-intelligence:start -->",c="<!-- workspai:workspace-intelligence:end -->",m={minimal:"A lightweight workspace boundary that adds runtimes only when you need them.","node-only":"A Node.js-focused workspace with shared evidence and agent grounding.","python-only":"A Python-focused workspace with shared evidence and agent grounding.","go-only":"A Go-focused workspace with shared evidence and agent grounding.","java-only":"A Java-focused workspace with shared evidence and agent grounding.","dotnet-only":"A .NET-focused workspace with shared evidence and agent grounding.",polyglot:"A multi-runtime workspace for projects that share contracts, evidence, and agents.",enterprise:"A governed multi-runtime workspace with the complete evidence, policy, and agent surface."};function w(e){return e?.trim()||"minimal"}async function u(e){let n=g.join(e,".workspai","workspace.json");return await i.pathExists(n)?await i.readJson(n).catch(()=>({})):{}}function f(e){let n=e.engine;if(!n)return;if(n.python_core?.status==="skipped")return "Optional Python engine: not installed";if(n.python_version)return `Optional Python engine: Python ${n.python_version} via ${n.install_method||"local environment"}`}function y(e){let n=w(e.profile),r=b$1().presentations.standard.nodes.map(s=>s.label).join(" \u2192 "),a=e.projectCount===1?"project":"projects",t=m[n]??"A governed workspace with shared evidence for developers, tools, CI, IDEs, and AI agents.";return `${h}
|
|
2
2
|
# ${e.workspaceName}
|
|
3
3
|
|
|
4
4
|
This is a **Workspai Workspace Intelligence** workspace. It gives every registered project one shared, evidence-backed view for developers, CI, IDEs, and AI agents.
|
|
@@ -74,4 +74,4 @@ ${c}`}function v(e){return e.includes("# Workspai Workspace")&&e.includes("This
|
|
|
74
74
|
`:"")}`.trimEnd()}if(!e.trim()||v(e))return n;let a=n.replace(/^# .+$/m,"## Workspace Intelligence");return `${e.trimEnd()}
|
|
75
75
|
|
|
76
76
|
${a}`}async function b(e){let n=await u(e.workspacePath),o=y({workspaceName:e.workspaceName,profile:e.profile,projectCount:e.projectCount,engineSummary:f(n)}),r=g.join(e.workspacePath,l),a=await i.pathExists(r)?await i.readFile(r,"utf-8"):"",t=`${j(a,o)}
|
|
77
|
-
`;return t!==a&&await
|
|
77
|
+
`;return t!==a&&await h$1(e.workspacePath,l,t),r}export{c as WORKSPACE_README_MANAGED_END,h as WORKSPACE_README_MANAGED_START,l as WORKSPACE_README_PATH,y as renderWorkspaceReadmeManagedBlock,b as syncWorkspaceReadme};
|
package/dist/{workspace-registry-summary-LJN4WHIZ.js → workspace-registry-summary-STGUGROG.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as WORKSPACE_REGISTRY_SUMMARY_RELATIVE_PATH,b as WORKSPACE_REGISTRY_SUMMARY_SCHEMA_VERSION,f as buildWorkspaceRegistrySummary,g as formatWorkspaceRegistrySyncSummary,e as publishWorkspaceRegistrySummary,d as readWorkspaceRegistrySummary,c as resolveWorkspaceRegisteredProjects}from'./chunk-
|
|
1
|
+
export{a as WORKSPACE_REGISTRY_SUMMARY_RELATIVE_PATH,b as WORKSPACE_REGISTRY_SUMMARY_SCHEMA_VERSION,f as buildWorkspaceRegistrySummary,g as formatWorkspaceRegistrySyncSummary,e as publishWorkspaceRegistrySummary,d as readWorkspaceRegistrySummary,c as resolveWorkspaceRegisteredProjects}from'./chunk-ARUFY5W3.js';
|