workspai 0.68.0 → 0.69.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 +38 -18
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +459 -0
- package/contracts/extension-cli-compatibility.v1.json +11 -0
- package/contracts/published-contract-catalog.v1.json +55 -0
- package/contracts/runtime-command-surface.v1.json +282 -0
- package/contracts/workspace-intelligence/architecture-change-lease.v1.json +50 -0
- package/contracts/workspace-intelligence/architecture-surprise-report.v1.json +46 -0
- package/contracts/workspace-intelligence/change-operation-result.v1.json +43 -0
- package/contracts/workspace-intelligence/decision-checkpoint.v1.json +18 -0
- package/contracts/workspace-intelligence/decision-event.v1.json +134 -0
- package/contracts/workspace-intelligence/decision-transaction.v1.json +29 -0
- package/contracts/workspace-intelligence/goal-index.v1.json +13 -0
- package/contracts/workspace-intelligence/goal-pack.v1.json +2 -1
- package/contracts/workspace-intelligence/predicted-architecture-change.v1.json +34 -0
- package/contracts/workspace-intelligence/proof-carrying-change-capsule-export.v1.json +14 -0
- package/contracts/workspace-intelligence/proof-carrying-change-capsule-validation.v1.json +16 -0
- package/contracts/workspace-intelligence/proof-carrying-change-capsule.v1.json +62 -0
- package/contracts/workspace-intelligence/proof-carrying-change-list.v1.json +80 -0
- package/contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json +9 -1
- package/dist/analyze-GPYPXXRT.js +1 -0
- package/dist/{artifact-remediation-plan-I7IKC5MR.js → artifact-remediation-plan-JHHZ4L24.js} +1 -1
- package/dist/autopilot-release-FL47VMF7.js +1 -0
- package/dist/capabilities-command-MYSLJIYS.js +1 -0
- package/dist/chunk-2LZWBUJD.js +1 -0
- package/dist/{chunk-7DDEMDG2.js → chunk-37ZLNFV5.js} +2 -2
- package/dist/{chunk-OFYY4725.js → chunk-3G5FF2JZ.js} +1 -1
- package/dist/chunk-3HFFKW4Q.js +2 -0
- package/dist/{chunk-BHM6RHTA.js → chunk-3WHE7V4M.js} +1 -1
- package/dist/chunk-A3MYO55A.js +3 -0
- package/dist/chunk-ABMB6MJT.js +1 -0
- package/dist/chunk-AD4ZY3RF.js +12 -0
- package/dist/chunk-BM2F5C4J.js +1 -0
- package/dist/chunk-COICGD62.js +1 -0
- package/dist/{chunk-4WVOAX2V.js → chunk-DWL3PPLA.js} +1 -1
- package/dist/{chunk-3Z4SVBMR.js → chunk-EBEAJIBI.js} +1 -1
- package/dist/chunk-EBQS5T7Q.js +7 -0
- package/dist/{chunk-5OV2WXAR.js → chunk-EG6EZ7HW.js} +1 -1
- package/dist/chunk-ERVWW5HX.js +1 -0
- package/dist/chunk-EZPLMAW2.js +1 -0
- package/dist/chunk-FIK343LI.js +1 -0
- package/dist/chunk-GSSJJS5M.js +6 -0
- package/dist/{chunk-TMRCPT7S.js → chunk-GYN6RPNU.js} +1 -1
- package/dist/{chunk-6E2Y3XGT.js → chunk-HCFOVANQ.js} +1 -1
- package/dist/chunk-I3UCODXU.js +1 -0
- package/dist/{chunk-3BMYMZQB.js → chunk-IGJA6GBQ.js} +1 -1
- package/dist/{chunk-FX5J6JCK.js → chunk-IVYPC36J.js} +1 -1
- package/dist/chunk-K33JJVQZ.js +2 -0
- package/dist/{chunk-KDY4X7SQ.js → chunk-M37ALD4V.js} +1 -1
- package/dist/{chunk-3XF7O66C.js → chunk-MAWHHHU3.js} +5 -5
- package/dist/chunk-MBICKDYP.js +1 -0
- package/dist/{chunk-QMQBX3RV.js → chunk-MGL6DBOR.js} +1 -1
- package/dist/chunk-MHQHRMKU.js +5 -0
- package/dist/{chunk-2C5XJBYI.js → chunk-N2Q4MSSP.js} +64 -64
- package/dist/chunk-N4B2M44I.js +1 -0
- package/dist/chunk-NSH7TTSV.js +1 -0
- package/dist/chunk-O5XQP5E7.js +1 -0
- package/dist/chunk-ODK4LCEL.js +1 -0
- package/dist/chunk-OU3BBWH5.js +49 -0
- package/dist/chunk-OZXCNVGW.js +2 -0
- package/dist/{chunk-SLFOUSRW.js → chunk-QYEQVNBF.js} +1 -1
- package/dist/chunk-RVOW3BHQ.js +2 -0
- package/dist/chunk-TKXRP2B4.js +1 -0
- package/dist/chunk-UNXG3ZFV.js +1 -0
- package/dist/chunk-UW4SESKD.js +2 -0
- package/dist/{chunk-2MTJWPQ4.js → chunk-V52R2W2Q.js} +1 -1
- package/dist/chunk-V6TIT6M3.js +157 -0
- package/dist/chunk-VNKAISFE.js +8 -0
- package/dist/chunk-W6WRT77T.js +1 -0
- package/dist/chunk-WHR5SL33.js +4 -0
- package/dist/{chunk-IXXQMD34.js → chunk-WZ5V5U2K.js} +1 -1
- package/dist/chunk-XPGCFVGC.js +4 -0
- package/dist/chunk-YKY4JFCF.js +1 -0
- package/dist/{chunk-VIN7NJW3.js → chunk-YWZBGSFE.js} +3 -3
- package/dist/chunk-YZL7ZY7J.js +2 -0
- package/dist/{create-U5PQHOZ4.js → create-GWBQ74ZI.js} +1 -1
- package/dist/doctor-OQAXSMEM.js +1 -0
- package/dist/goal-lifecycle-YWBVQ2DF.js +1 -0
- package/dist/goal-pack-KUXPZVNO.js +1 -0
- package/dist/index.d.ts +35 -2
- package/dist/index.js +239 -239
- package/dist/pipeline-PGB5TEV3.js +5 -0
- package/dist/{project-agent-entry-MH7364BE.js → project-agent-entry-H3JAGNLS.js} +1 -1
- package/dist/{project-intelligence-lens-ZCCHUKVI.js → project-intelligence-lens-7NMKHV5N.js} +1 -1
- package/dist/{project-test-coverage-JPWTBSSJ.js → project-test-coverage-3DKZKLWY.js} +1 -1
- package/dist/proof-carrying-change-QFH7WI2E.js +1 -0
- package/dist/verified-goal-7XHRWYSE.js +1 -0
- package/dist/{workspace-B33BFZZ3.js → workspace-TJHCETBV.js} +1 -1
- package/dist/{workspace-agent-sync-T3MJO2MX.js → workspace-agent-sync-Z35NTXCB.js} +1 -1
- package/dist/{workspace-archive-NOSGRKRZ.js → workspace-archive-OSMU3CK6.js} +1 -1
- package/dist/{workspace-context-KOCEP4MJ.js → workspace-context-KNJQUJWC.js} +1 -1
- package/dist/{workspace-contract-MQ3QE52V.js → workspace-contract-VIUQT5SZ.js} +1 -1
- package/dist/workspace-explain-HM6GMK26.js +1 -0
- package/dist/workspace-explain-contract-KV7RTEJU.js +1 -0
- package/dist/{workspace-feedback-3YLIUFQ7.js → workspace-feedback-YSPEGCON.js} +1 -1
- package/dist/{workspace-foundation-O7O3QIS4.js → workspace-foundation-PLXFPI3J.js} +1 -1
- package/dist/{workspace-graph-stream-XTGGBD7D.js → workspace-graph-stream-FNRQ2FTB.js} +1 -1
- package/dist/workspace-graph-token-efficiency-WNAFAN2F.js +1 -0
- package/dist/{workspace-history-7HDZZ4G5.js → workspace-history-HDDFG6LH.js} +1 -1
- package/dist/{workspace-intelligence-TFEQBPUP.js → workspace-intelligence-QLSD5EEV.js} +1 -1
- package/dist/{workspace-intelligence-benchmark-PLVUBGWO.js → workspace-intelligence-benchmark-S5OXVNLC.js} +1 -1
- package/dist/{workspace-intelligence-evaluation-OJIQS5SN.js → workspace-intelligence-evaluation-QDSOOUHH.js} +1 -1
- package/dist/{workspace-intelligence-runner-6ZAV6RO4.js → workspace-intelligence-runner-4EW4T2OW.js} +1 -1
- package/dist/workspace-intelligence-runtime-registry-ZLPF7BAY.js +1 -0
- package/dist/{workspace-knowledge-graph-AUXYL3L6.js → workspace-knowledge-graph-EEOW5VAJ.js} +1 -1
- package/dist/workspace-knowledge-graph-change-overlay-FIIAFLO6.js +1 -0
- package/dist/{workspace-knowledge-graph-contract-X52KXBXJ.js → workspace-knowledge-graph-contract-FVX5T7SU.js} +1 -1
- package/dist/{workspace-knowledge-graph-query-A7TKONWY.js → workspace-knowledge-graph-query-WHCGPBGS.js} +1 -1
- package/dist/workspace-knowledge-graph-snapshot-X347REDB.js +1 -0
- package/dist/workspace-mcp-serve-NQ42PE2I.js +3 -0
- package/dist/{workspace-model-GVXNLSQM.js → workspace-model-NCOOY5LC.js} +1 -1
- package/dist/{workspace-onboarding-ECZ2KJ2A.js → workspace-onboarding-JNC7ZFMR.js} +1 -1
- package/dist/{workspace-readme-6N5Y2ZSJ.js → workspace-readme-OV2ADTLW.js} +2 -2
- package/dist/{workspace-registry-summary-5SFBTRGQ.js → workspace-registry-summary-ONT4VOJX.js} +1 -1
- package/dist/{workspace-repair-engine-CKJCTWKX.js → workspace-repair-engine-WMJCYWO4.js} +2 -2
- package/dist/workspace-run-3S35MDX6.js +1 -0
- package/dist/{workspace-verify-D3QTMAUI.js → workspace-verify-MLABQUWK.js} +1 -1
- package/dist/{workspace-watch-XYJEW2Z2.js → workspace-watch-MJOG5AZ3.js} +1 -1
- package/docs/README.md +2 -0
- package/docs/ci-workflows.md +1 -1
- package/docs/commands-reference.md +23 -0
- package/docs/contracts/ARTIFACT_CATALOG.md +37 -18
- package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +17 -0
- package/docs/contracts/PROOF_CARRYING_CHANGE_CONTRACT_PLAN.md +65 -0
- package/docs/proof-carrying-change.implementation.v1.json +118 -0
- package/docs/proof-carrying-change.md +202 -0
- package/package.json +1 -1
- package/dist/analyze-JDEWUBC6.js +0 -1
- package/dist/autopilot-release-OELUFNLL.js +0 -1
- package/dist/capabilities-command-RAAYENQ6.js +0 -1
- package/dist/chunk-2KX6KHEC.js +0 -1
- package/dist/chunk-3KU3YUWD.js +0 -2
- package/dist/chunk-3NF3M3RE.js +0 -1
- package/dist/chunk-3OGPTLI2.js +0 -1
- package/dist/chunk-5ME4W4LN.js +0 -1
- package/dist/chunk-5XUAAQSV.js +0 -5
- package/dist/chunk-5YZ2W57R.js +0 -8
- package/dist/chunk-7DZNZ3GM.js +0 -3
- package/dist/chunk-BG6IX6HA.js +0 -1
- package/dist/chunk-BMAFHX6A.js +0 -1
- package/dist/chunk-BUYLM6QV.js +0 -1
- package/dist/chunk-C2VTO5WT.js +0 -2
- package/dist/chunk-CPR2CMOY.js +0 -1
- package/dist/chunk-CSZPE637.js +0 -2
- package/dist/chunk-DFVG4DDZ.js +0 -6
- package/dist/chunk-EHLGPLIU.js +0 -1
- package/dist/chunk-FPDH3N3A.js +0 -7
- package/dist/chunk-GVQKAINC.js +0 -49
- package/dist/chunk-IKUFNK46.js +0 -2
- package/dist/chunk-JYMO7QXQ.js +0 -1
- package/dist/chunk-KY2GOSO5.js +0 -1
- package/dist/chunk-LEOFD3W5.js +0 -12
- package/dist/chunk-LPCZHKD5.js +0 -1
- package/dist/chunk-N5HPMATQ.js +0 -1
- package/dist/chunk-P3622IM5.js +0 -4
- package/dist/chunk-Q7UGDNSM.js +0 -1
- package/dist/chunk-RVAOJOXA.js +0 -2
- package/dist/chunk-TCLKGPXF.js +0 -2
- package/dist/chunk-W5VKBDSD.js +0 -157
- package/dist/chunk-WRZSQDZV.js +0 -1
- package/dist/chunk-Y4Z6CEII.js +0 -1
- package/dist/chunk-ZEEV5J4I.js +0 -1
- package/dist/chunk-ZGHJIQXL.js +0 -1
- package/dist/doctor-D7YI7LSA.js +0 -1
- package/dist/goal-lifecycle-BMS6GSIU.js +0 -1
- package/dist/goal-pack-RBSVQMMX.js +0 -1
- package/dist/pipeline-QOMXH2EK.js +0 -5
- package/dist/verified-goal-XUXU2X5H.js +0 -1
- package/dist/workspace-explain-DTFCKYXK.js +0 -1
- package/dist/workspace-explain-contract-WMREJWHF.js +0 -1
- package/dist/workspace-graph-token-efficiency-5LJKQU2J.js +0 -1
- package/dist/workspace-intelligence-runtime-registry-UKFB3BI7.js +0 -1
- package/dist/workspace-knowledge-graph-change-overlay-XG6FC4IX.js +0 -1
- package/dist/workspace-knowledge-graph-snapshot-GPBDAKAU.js +0 -1
- package/dist/workspace-mcp-serve-TDUXJUAA.js +0 -3
- package/dist/workspace-run-ZZ5WHL7W.js +0 -1
package/dist/chunk-W5VKBDSD.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import {g,b,i as i$1,d as d$1,e as e$1,f}from'./chunk-RVAOJOXA.js';import {c}from'./chunk-FPDH3N3A.js';import {c as c$1}from'./chunk-X7FYEKLI.js';import {d as d$2,b as b$1,a as a$1}from'./chunk-3RBUSW7H.js';import {a}from'./chunk-AFIFZTOY.js';import {d}from'./chunk-EWZZUQBR.js';import {h,e,i}from'./chunk-ZGHJIQXL.js';import {u,h as h$1,g as g$1}from'./chunk-VQZ5PI5J.js';import be from'crypto';import ne from'fs';import y from'fs/promises';import l from'path';import {execa}from'execa';import X from'fs-extra';async function Q(e,t){let[n,o]=await Promise.all([X.realpath(e).catch(()=>null),X.realpath(t).catch(()=>null)]);if(!n||!o)return null;let s=l.relative(n,o);return !s||l.isAbsolute(s)||s===".."||s.startsWith(`..${l.sep}`)?null:(await X.stat(o).catch(()=>null))?.isFile()?o:null}var Ne=h.projectContextAgent.schemaVersion,ft=["managed","local","off"],se="<!-- WORKSPAI:PROJECT-GROUNDING:START -->",ve="<!-- WORKSPAI:PROJECT-GROUNDING:END -->",ee="<!-- WORKSPAI:GENERATED-PROJECT-SKILL -->",B=".agents/skills/workspai-grounding/SKILL.md";function he(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}async function A(e){try{return JSON.parse(await y.readFile(e,"utf8"))}catch(t){return null}}function W(e){return e.replace(/\\/g,"/").replace(/^\.\/+/,"")}function _(e,t,n){let o=e.replace(/\\/g,"/"),s=/^[A-Za-z]:\//.test(o);if(!l.isAbsolute(e)&&!s)return W(o);if(s&&process.platform!=="win32")return null;let a=l.resolve(e),i=l.relative(n,a);if(i&&!i.startsWith("..")&&!l.isAbsolute(i))return W(i);let c=l.relative(t,a);return c&&!c.startsWith("..")&&!l.isAbsolute(c)?`workspace:${W(c)}`:null}function I(e,t,n){return [[n,"project:"],[n.replace(/\\/g,"/"),"project:"],[t,"workspace:"],[t.replace(/\\/g,"/"),"workspace:"]].reduce((s,[a,i])=>a.length>0?s.split(a).join(i):s,e)}function Ae(e,t){return he(e?.adoption)?.mode==="linked"?"adopted":he(e?.import)?"imported":t}function xe(e){if(!e.model)return null;let t=W(e.relativePath);return e.model.projects.find(n=>n.name===e.projectName||W(n.path)===t)??null}function U(e,t){e[t]=(e[t]??0)+1;}var fe=["project","language","service","api","endpoint","schema","protocol","runtime-unit","lifecycle-stage","database","queue","container","deployment","pipeline","environment","test-suite","owner","decision","document","package","file","module","symbol"],te=48,re=12*1024;function Le(e,t=te,n=re){let o={language:12,api:8,service:8,endpoint:8,schema:8,protocol:8,"runtime-unit":12,"lifecycle-stage":12,file:4,module:4,symbol:4},s=new Map,a={};for(let u of e)U(a,u.kind);for(let u of fe)s.set(u,e.filter(k=>k.kind===u).sort((k,f)=>k.label.localeCompare(f.label)||k.id.localeCompare(f.id)).slice(0,o[u]??6));let i=[],c={},h=0,p=0,d=true;for(;i.length<t&&d;){d=false;for(let u of fe){let k=s.get(u)?.[p];if(!k)continue;let f=Buffer.byteLength(JSON.stringify(k));if(!(h+f>n)&&(i.push(k),h+=f,U(c,u),d=true,i.length>=t))break}p+=1;}let m=Object.fromEntries(Object.entries(a).map(([u,k])=>[u,k-(c[u]??0)]).filter(([,u])=>u>0).sort(([u],[k])=>u.localeCompare(k)));return {entities:i,selectedBytes:h,selectedByKind:c,omittedByKind:m}}function $e(e,t){if(!e)return {entityCount:0,relationCount:0,proofCount:0,entitiesByKind:{},relationsByKind:{},languages:{},semantic:{protocolConceptCount:0,protocolImplementationBindings:0,equivalenceBindings:0,generationBindings:0,runtimeUnitCount:0,lifecycleStageCount:0,runtimeCoverage:[]},projection:{mode:"stratified-byte-bounded",maxEntities:te,byteBudget:re,selectedBytes:0,eligibleCount:0,selectedCount:0,omittedCount:0,selectedByKind:{},omittedByKind:{}},relatedProjects:[],proofArtifacts:[],entities:[],relations:[],proofs:[],topology:{status:"unavailable",dependencies:[],dependents:[]},diagnostics:[]};let n=e.entities.find(r=>r.kind==="project"&&(r.id===t||r.label===t||r.projectId===t)),o=new Set(e.entities.filter(r=>r.projectId===t||r.id===n?.id||r.kind==="project"&&r.label===t).map(r=>r.id));n&&o.add(n.id);let s=e.relations.filter(r=>o.has(r.from)||o.has(r.to)),a=new Set(o);for(let r of s)a.add(r.from),a.add(r.to);let i=e.entities.filter(r=>a.has(r.id)),c=new Set,h={},p={},d={},m=new Set(i.filter(r=>r.kind==="language").map(r=>r.attributes.language).filter(r=>typeof r=="string"));for(let r of i){U(h,r.kind);let w=typeof r.attributes.language=="string"?r.attributes.language:void 0;if(w&&r.kind==="language")d[w]={fileCount:typeof r.attributes.fileCount=="number"?r.attributes.fileCount:0,symbolCount:d[w]?.symbolCount??0,generatedFileCount:typeof r.attributes.generatedFileCount=="number"?r.attributes.generatedFileCount:0};else if(w&&(r.kind==="file"||r.kind==="symbol")){let b=d[w]??{fileCount:0,symbolCount:0,generatedFileCount:0};r.kind==="file"&&!m.has(w)?(b.fileCount+=1,r.attributes.generated===true&&(b.generatedFileCount+=1)):r.kind==="symbol"&&(b.symbolCount+=1),d[w]=b;}for(let b of r.proofIds)c.add(b);}for(let r of s){U(p,r.kind);for(let w of r.proofIds)c.add(w);}let u=e.proofs.filter(r=>c.has(r.id)),k=[...new Set(e.entities.filter(r=>a.has(r.id)&&r.projectId&&r.projectId!==t).map(r=>r.projectId))].sort(),f=e.diagnostics.filter(r=>(!r.entityIds||r.entityIds.length===0)&&(!r.relationIds||r.relationIds.length===0)||r.entityIds?.some(w=>a.has(w))||r.relationIds?.some(w=>s.some(b=>b.id===w))).map(r=>({code:r.code,severity:r.severity,message:r.message,...r.recommendation?{recommendation:r.recommendation}:{}})),j=(r,w)=>({project:w,kind:r.kind,source:r.source,confidence:r.confidence,evidence:[...new Set(r.evidence.map(b=>b.file.replace(/\\/g,"/")))].sort()}),P=e.projectTopology.edges.filter(r=>r.from===t).map(r=>j(r,r.to)).sort((r,w)=>`${r.project}:${r.kind}`.localeCompare(`${w.project}:${w.kind}`)),S=e.projectTopology.edges.filter(r=>r.to===t).map(r=>j(r,r.from)).sort((r,w)=>`${r.project}:${r.kind}`.localeCompare(`${w.project}:${w.kind}`)),N=Le(i),T=N.entities,L=i.filter(r=>r.kind==="runtime-unit"),E=new Set(T.map(r=>r.id)),$=[...s].sort((r,w)=>{let b=Number(E.has(r.from)||E.has(r.to));return Number(E.has(w.from)||E.has(w.to))-b||r.id.localeCompare(w.id)}).slice(0,16),D=new Set([...T.flatMap(r=>r.proofIds),...$.flatMap(r=>r.proofIds)]),g=u.filter(r=>D.has(r.id)).sort((r,w)=>r.id.localeCompare(w.id)).slice(0,16);return {entityCount:i.length,relationCount:s.length,proofCount:u.length,entitiesByKind:h,relationsByKind:p,languages:Object.fromEntries(Object.entries(d).sort(([r],[w])=>r.localeCompare(w))),semantic:{protocolConceptCount:h.protocol??0,protocolImplementationBindings:p["implements-protocol"]??0,equivalenceBindings:p["equivalent-to"]??0,generationBindings:(p["generated-from"]??0)+(p["generated-by"]??0),runtimeUnitCount:L.length,lifecycleStageCount:h["lifecycle-stage"]??0,runtimeCoverage:[...new Set(L.map(r=>r.attributes.runtime).filter(r=>typeof r=="string"))].sort()},projection:{mode:"stratified-byte-bounded",maxEntities:te,byteBudget:re,selectedBytes:N.selectedBytes,eligibleCount:i.length,selectedCount:T.length,omittedCount:Math.max(0,i.length-T.length),selectedByKind:Object.fromEntries(Object.entries(N.selectedByKind).sort(([r],[w])=>r.localeCompare(w))),omittedByKind:N.omittedByKind},relatedProjects:k,proofArtifacts:[...new Set(g.map(r=>r.artifact))].sort().slice(0,24),entities:T,relations:$,proofs:g,topology:{status:P.length>0||S.length>0?"proven":e.projectTopology.nodes.some(r=>r.id===t)?"unproven":"unavailable",dependencies:P,dependents:S},diagnostics:f}}function Ee(e,t,n){return Array.isArray(e)?e.map(o=>typeof o=="string"?I(o,t,n):o):typeof e=="string"?I(e,t,n):e}function Ge(e,t,n){return {id:e.id,kind:e.kind,label:I(e.label,t,n),attributes:Object.fromEntries(Object.entries(e.attributes).map(([o,s])=>[o,Ee(s,t,n)])),proofIds:[...e.proofIds].sort()}}function We(e,t,n){let o=(...a)=>e.filter(i=>a.includes(i.kind)).map(i=>Ge(i,t,n)).slice(0,4),s=[];for(let a of e){for(let[i,c]of Object.entries(a.attributes))if(/(?:^|[-_.])ports?(?:$|[-_.])/i.test(i)&&(s.push({entityId:a.id,label:I(a.label,t,n),attribute:i,value:Ee(c,t,n)}),s.length>=8))break;if(s.length>=8)break}return {services:o("service"),packages:o("package"),protocols:o("protocol"),runtimeUnits:o("runtime-unit"),lifecycleStages:o("lifecycle-stage"),apis:o("api"),endpoints:o("endpoint"),dataStores:o("database","queue"),deployments:o("container","deployment","environment"),pipelines:o("pipeline"),tests:o("test-suite"),owners:o("owner"),decisions:o("decision"),ports:s}}function Oe(e,t,n){let o=_(e.artifact,t,n);return o?{id:e.id,provider:e.provider,artifact:o,...e.pointer?{pointer:I(e.pointer,t,n)}:{},...e.line!==void 0?{line:e.line}:{},derivation:e.derivation,trust:e.trust,confidence:e.confidence,freshness:e.freshness}:null}async function Ke(e,t,n){let o=[],s=await A(l.join(e,".workspai","reports","INDEX.json"));if(Array.isArray(s?.blockers))for(let d of s.blockers)typeof d=="string"&&(d.startsWith(`${n}:`)||d.includes(`project:${n}`)||d.includes(`project ${n}`))&&o.push({source:"workspace-report-index",severity:"error",message:I(d,e,t)});let a=await A(l.join(e,".workspai","reports","doctor-project-last-run.json")),i=await A(l.join(e,".workspai","reports","doctor-last-run.json")),c=i?.projects?.find(d=>d.name===n),p=[...a?.project&&(a.projectName===n||a.project.name===n)?[{generatedAt:a.generatedAt,project:a.project}]:[],...c?[{generatedAt:i?.generatedAt,project:c}]:[]].sort((d,m)=>{let u=typeof d.generatedAt=="string"&&Date.parse(d.generatedAt)||0;return (typeof m.generatedAt=="string"&&Date.parse(m.generatedAt)||0)-u})[0];if(p)for(let d of c$1({project:p.project}))o.push({source:"doctor-project",severity:d.status==="blocking"?"error":"warning",message:I(d.message,e,t),...d.id?{code:d.id}:{}});return [...new Map(o.map(d=>[`${d.source}:${d.code??""}:${d.message}`,d])).values()].slice(0,32)}function oe(e,t=[]){return typeof e=="string"?/^[A-Za-z]:[\\/]/.test(e)||/(?:^|[\s("'`])[A-Za-z]:[\\/]/.test(e)||/(?:^|[\s("'`])\/(?:Users|home|private|var|opt|srv|mnt|Volumes|tmp)\//.test(e)||t.some(n=>n.length>0&&(e.includes(n)||e.includes(n.replace(/\\/g,"/")))):Array.isArray(e)?e.some(n=>oe(n,t)):e&&typeof e=="object"?Object.values(e).some(n=>oe(n,t)):false}function _e(e){return be.createHash("sha256").update(JSON.stringify(e)).digest("hex")}async function Fe(e$1){let t=l.resolve(e$1.workspacePath),n=l.resolve(e$1.projectPath),o=u(n,"project.json").find(g=>ne.existsSync(g)),s=o?await A(o):null,a$1=await A(l.join(t,".workspai","workspace.contract.json")),i$1=l.resolve(n),c=a$1?.projects?.find(g=>g.externalPath?l.resolve(g.externalPath)===i$1:!g.relativePath||g.relativePath.startsWith("external/")?false:l.resolve(t,g.relativePath)===i$1)??a$1?.projects?.find(g=>g.slug===e$1.projectName||g.slug===l.basename(n)),h=e$1.projectName??(typeof s?.name=="string"?s.name:void 0)??c?.slug??l.basename(n),p=c?.relativePath??(()=>{let g=W(l.relative(t,n));return !g||g.startsWith("..")?`external/${h}`:g})(),d$1=await A(l.join(t,e.model)),m=await A(l.join(t,e.knowledgeGraph)),u$1=d$1?d(d$1):void 0,k=!!(u$1&&m?.source.hash===u$1),f=xe({model:d$1,projectName:h,relativePath:p}),j=$e(k?m:null,h),P=await Ke(t,n,h),S=j.proofs.map(g=>g.freshness),N=m?!k||S.includes("stale")?"stale":S.includes("unknown")?"unknown":"fresh":"missing",T=d$1?d$1.factFreshness?.status??"unknown":"missing",L=[...d$1?[]:[{code:"project.context.model-missing",severity:"warning",message:"The canonical Workspace Model has not been generated yet. Refresh workspace intelligence before relying on project topology."}],...d$1&&!f?[{code:"project.context.project-not-materialized",severity:"warning",message:"The project is registered in the workspace contract but is not present in the current Workspace Model."}]:[],...m?[]:[{code:"project.context.graph-missing",severity:"warning",message:"The Workspace Knowledge Graph has not been generated yet. Run the workspace intelligence loop to build proof-backed relationships."}],...m&&!k?[{code:"project.context.graph-model-mismatch",severity:"warning",message:"The persisted Knowledge Graph does not match the current Workspace Model and was excluded from this project lens."}]:[]],E=Ae(s,e$1.relationship??c?.relationship??"managed"),$={schemaVersion:Ne,generatedAt:(e$1.now??new Date).toISOString(),workspace:{name:a$1?.workspace?.name??d$1?.workspace.name??l.basename(t),...a$1?.workspace?.profile||d$1?.workspace.profile?{profile:a$1?.workspace?.profile??d$1?.workspace.profile}:{},relationship:E,contract:`workspace:${i.workspaceContract}`,projectKnowledgeGraph:i.projectKnowledgeGraphReference,model:`workspace:${e.model}`,knowledgeGraph:`workspace:${e.knowledgeGraph}`,index:`workspace:${e.agentIndex}`,context:`workspace:${e.agentContext}`,skillsIndex:`workspace:${e.skillsIndex}`,boundedGraphSearch:`workspai workspace graph search <task-query> --scope project:${h} --limit 12 --json`,access:{localBinding:i.projectWorkspaceLink,canonicalEvidenceAvailableAtGeneration:true,identityIsFilesystemPath:false,resolverCommand:"workspai project workspace status --json",portableUriScheme:"workspace:",resolvedPathPolicy:"runtime-private-never-persist"}},project:{name:h,relativePath:p,...f?.kind?{kind:f.kind}:{},...f?.runtime||c?.runtime?{runtime:f?.runtime??c?.runtime}:{},...f?.runtimeCandidates?.length?{runtimeCandidates:[...f.runtimeCandidates].sort()}:{},...f?.framework||c?.framework?{framework:f?.framework??c?.framework}:{},...f?.kit||c?.kit?{kit:f?.kit??c?.kit}:{},...f?.supportTier?{supportTier:f.supportTier}:{},...f?.governance?{governance:f.governance}:{},commands:{supported:[...f?.commands.supported??[]].sort(),unsupported:[...f?.commands.unsupported??[]].sort(),fleetStages:[...f?.commands.fleetStages??[]].sort()},importantFiles:[...new Set((f?.importantFiles??[]).map(g=>_(g,t,n)).filter(g=>g!==null))].sort()},intelligence:{...d$1?.generatedAt?{modelGeneratedAt:d$1.generatedAt}:{},...m?.generatedAt?{graphGeneratedAt:m.generatedAt}:{},...m?.source.hash?{graphModelHash:m.source.hash}:{},entityCount:j.entityCount,relationCount:j.relationCount,proofCount:j.proofCount,entitiesByKind:j.entitiesByKind,relationsByKind:j.relationsByKind,languages:j.languages,semantic:j.semantic,projection:{...j.projection,continuationCommand:`workspai workspace graph search <task-query> --scope project:${h} --limit 12 --json`},relatedProjects:j.relatedProjects,freshness:{model:T,graph:N,graphMatchesModel:k},topology:{...j.topology,dependencies:j.topology.dependencies.map(g=>({...g,evidence:g.evidence.map(r=>_(r,t,n)).filter(r=>r!==null)})),dependents:j.topology.dependents.map(g=>({...g,evidence:g.evidence.map(r=>_(r,t,n)).filter(r=>r!==null)}))},surfaces:We(j.entities,t,n),diagnostics:[...L,...j.diagnostics].map(g=>({...g,message:I(g.message,t,n),...g.recommendation?{recommendation:I(g.recommendation,t,n)}:{}}))},evidence:{readOrder:[b,".workspai/PROJECT-GROUNDING.md",i.projectContextAgent,"AGENTS.md","workspace:.workspai/goals/index.json",`workspace:${i.goalPackLastRun}`,"workspace:.workspai/reports/workspace-skills-index.json",`command:workspai workspace graph search <task-query> --scope project:${h} --limit 12 --json`],projectProofArtifacts:[...new Set(j.proofArtifacts.map(g=>_(g,t,n)).filter(g=>g!==null))],relations:j.relations.map(g=>({id:g.id,from:g.from,to:g.to,kind:g.kind,derivation:g.derivation,trust:g.trust,confidence:g.confidence,proofIds:[...g.proofIds].sort()})),proofs:j.proofs.map(g=>Oe(g,t,n)).filter(g=>g!==null)},blockers:P,agentRouting:{enforcement:"required",mandatoryPreflight:{command:"workspai agent bootstrap --for-agent generic --strict --json",successCondition:"ready"},workspaceLocator:{command:"workspai project workspace status --json",successCondition:"resolved",outputClassification:"machine-local",persistence:"forbidden",disclosure:"forbidden",portableUriScheme:"workspace:"},workspaceEvidenceRequiredFor:["repository-analysis","architecture-analysis","change-impact","cross-project-change","contract-change","infrastructure-change","release-readiness"],requiredReadOrder:[b,"command:workspai agent bootstrap --for-agent generic --strict --json","command:workspai project workspace status --json",i.projectContextAgent,"workspace:.workspai/reports/workspace-skills-index.json",`command:workspai workspace graph search ${JSON.stringify(h)} --scope ${JSON.stringify(`project:${h}`)} --limit 12 --json`],degradedMode:{allowCompleteArchitectureClaims:false,requireDisclosure:true}},commands:{refresh:"workspai workspace intelligence run --for-agent generic --strict --json",verify:"workspai workspace verify --strict --json",graphSearch:`workspai workspace graph search ${JSON.stringify(h)} --scope ${JSON.stringify(`project:${h}`)} --limit 12 --json`,doctor:"workspai doctor project --json",workspaceStatus:"workspai project workspace status --json"}};if(oe($,[t,n]))throw new Error("Project context lens rejected a non-portable absolute path.");let D={...$,integrity:{algorithm:"sha256",...u$1?{modelHash:u$1}:{},payloadHash:_e($),portable:true,absolutePathsEmitted:false}};return a(D,"contracts/workspace-intelligence/project-context-agent.v1.json","Project context agent"),D}function Be(e){let t=e.intelligence.relatedProjects.length>0?e.intelligence.relatedProjects.map(s=>`\`${s}\``).join(", "):"No proven cross-project relation is currently available.",n=e.intelligence.diagnostics.length>0?e.intelligence.diagnostics.slice(0,8).map(s=>`- **${s.severity} \xB7 ${s.code}:** ${s.message}`).join(`
|
|
2
|
-
`):"- No project-scoped graph diagnostic is currently recorded.",o=e.blockers.length>0?e.blockers.slice(0,12).map(s=>`- **${s.severity}${s.code?` \xB7 ${s.code}`:""}:** ${s.message}`).join(`
|
|
3
|
-
`):"- No current project-scoped blocker is recorded.";return `# Workspai project grounding
|
|
4
|
-
|
|
5
|
-
This project is adopted into the **${e.workspace.name}** Workspai workspace.
|
|
6
|
-
That value is the canonical workspace identity, not its filesystem path. Workspai
|
|
7
|
-
commands launched here resolve the machine-local workspace automatically.
|
|
8
|
-
|
|
9
|
-
## Mandatory first contact
|
|
10
|
-
|
|
11
|
-
Do not begin broad repository discovery, architecture claims, planning, or mutation
|
|
12
|
-
until this sequence is complete:
|
|
13
|
-
|
|
14
|
-
1. Read \`${b}\` to discover the portable protocol.
|
|
15
|
-
2. Run \`workspai agent bootstrap --for-agent generic --strict --json\`.
|
|
16
|
-
3. Follow the receipt's \`requiredReadOrder\` exactly.
|
|
17
|
-
4. Read \`.workspai/reports/project-context-agent.json\`.
|
|
18
|
-
5. If the receipt reports an active Goal, read its immutable Goal Pack and agent
|
|
19
|
-
handoff before choosing or expanding work.
|
|
20
|
-
6. Read the compact workspace Skills index and load only a matching playbook.
|
|
21
|
-
7. Query the bounded Workspace Graph with the user's actual task before opening broad
|
|
22
|
-
source, then inspect only returned proof paths and targeted live files.
|
|
23
|
-
|
|
24
|
-
Receipt policy:
|
|
25
|
-
|
|
26
|
-
- \`ready\`: continue with bounded evidence and targeted source inspection.
|
|
27
|
-
- \`degraded\`: disclose the limitation and do not claim complete architecture or verification.
|
|
28
|
-
- \`blocked\`: stop governed claims, execute \`nextActions\`, and rerun bootstrap.
|
|
29
|
-
|
|
30
|
-
## Workspace location and portable paths
|
|
31
|
-
|
|
32
|
-
- \`${e.workspace.name}\` is an identity, not a directory name to guess.
|
|
33
|
-
- Project-local paths begin with \`.workspai/\`.
|
|
34
|
-
- Canonical workspace paths begin with \`workspace:\`.
|
|
35
|
-
- Resolve the exact local workspace root only when direct file access is necessary by
|
|
36
|
-
running \`workspai project workspace status --json\` from this project.
|
|
37
|
-
- The resolver's absolute paths are machine-local runtime data. Never persist or copy
|
|
38
|
-
them into answers, shared logs, commits, prompts, telemetry, or portable artifacts.
|
|
39
|
-
|
|
40
|
-
## Authority boundary
|
|
41
|
-
|
|
42
|
-
The Workspace Model owns canonical project identity and its compact \`projectTopology\`.
|
|
43
|
-
The Workspace Knowledge Graph is a separate, proof-backed enrichment containing
|
|
44
|
-
files, symbols, APIs, infrastructure, tests, owners, and decisions. Do not treat
|
|
45
|
-
an unproven topology edge as proof that two projects are independent. Live source owns
|
|
46
|
-
exact implementation. CLI evidence owns Goal, readiness, repair, and verification claims.
|
|
47
|
-
Repository-authored instructions remain authoritative for source changes after this
|
|
48
|
-
entry gate; Workspai preserves rather than replaces them.
|
|
49
|
-
|
|
50
|
-
## Knowledge Graph routing
|
|
51
|
-
|
|
52
|
-
- Project graph reference: \`${e.workspace.projectKnowledgeGraph}\`. It integrity-binds
|
|
53
|
-
this project to its exact canonical projection without duplicating the full graph.
|
|
54
|
-
- Workspace aggregate: \`${e.workspace.knowledgeGraph}\`. Resolve it through the
|
|
55
|
-
workspace binding only for cross-project or workspace-wide consumption.
|
|
56
|
-
- Default agent path: use the bounded graph-search command below; resolve the canonical
|
|
57
|
-
graph only when the task explicitly requires full graph interchange.
|
|
58
|
-
|
|
59
|
-
## Project
|
|
60
|
-
|
|
61
|
-
- Name: \`${e.project.name}\`
|
|
62
|
-
- Workspace-relative identity: \`${e.project.relativePath}\`
|
|
63
|
-
- Runtime: \`${e.project.runtime??"unknown"}\`
|
|
64
|
-
- Framework: \`${e.project.framework??"unknown"}\`
|
|
65
|
-
- Relationship: \`${e.workspace.relationship}\`
|
|
66
|
-
- Related projects: ${t}
|
|
67
|
-
- Topology status: \`${e.intelligence.topology.status}\`
|
|
68
|
-
- Model freshness: \`${e.intelligence.freshness.model}\`
|
|
69
|
-
- Knowledge Graph freshness: \`${e.intelligence.freshness.graph}\`
|
|
70
|
-
|
|
71
|
-
## Current evidence coverage
|
|
72
|
-
|
|
73
|
-
- Project-scoped entities: ${e.intelligence.entityCount}
|
|
74
|
-
- Project-scoped relations: ${e.intelligence.relationCount}
|
|
75
|
-
- Portable proofs: ${e.intelligence.proofCount}
|
|
76
|
-
|
|
77
|
-
${n}
|
|
78
|
-
|
|
79
|
-
## Current project blockers
|
|
80
|
-
|
|
81
|
-
${o}
|
|
82
|
-
|
|
83
|
-
## Safe commands from this project
|
|
84
|
-
|
|
85
|
-
\`\`\`bash
|
|
86
|
-
${e.commands.workspaceStatus}
|
|
87
|
-
${e.commands.doctor}
|
|
88
|
-
${e.commands.graphSearch}
|
|
89
|
-
${e.commands.verify}
|
|
90
|
-
\`\`\`
|
|
91
|
-
|
|
92
|
-
The machine-local workspace binding lives only in
|
|
93
|
-
\`.workspai/workspace-link.local.json\`, which is gitignored. Portable grounding files
|
|
94
|
-
never publish its value.
|
|
95
|
-
`}function Me(e){return `# Workspai agent entry gate (mandatory)
|
|
96
|
-
|
|
97
|
-
- Project: \`${e.project.name}\`
|
|
98
|
-
- Workspace identity: \`${e.workspace.name}\` (logical name, not a filesystem path)
|
|
99
|
-
- Entry contract: \`${b}\`
|
|
100
|
-
|
|
101
|
-
Before broad repository discovery, architecture claims, planning, or mutation:
|
|
102
|
-
|
|
103
|
-
1. Read \`${b}\`.
|
|
104
|
-
2. Run \`workspai agent bootstrap --for-agent generic --strict --json\`.
|
|
105
|
-
3. Follow the receipt's \`requiredReadOrder\` exactly.
|
|
106
|
-
4. If a Goal is active, read its immutable Goal Pack and handoff before acting.
|
|
107
|
-
5. Read the compact workspace Skills index and load only a matching playbook.
|
|
108
|
-
6. Query the bounded Workspace Graph with the user's task, then inspect only returned proofs and targeted live source.
|
|
109
|
-
|
|
110
|
-
Receipt policy: \`ready\` may proceed; \`degraded\` must disclose limitations and may not claim complete architecture or verification; \`blocked\` must stop governed claims, execute \`nextActions\`, and rerun bootstrap.
|
|
111
|
-
|
|
112
|
-
\`workspace:\` paths belong to the canonical workspace, not this project's \`.workspai\` directory. Resolve their machine-local root at runtime with \`workspai project workspace status --json\`. That output is machine-local: never copy it into answers, shared logs, commits, or portable artifacts.
|
|
113
|
-
|
|
114
|
-
Authority: Workspai evidence owns identity, topology, goals, readiness, and verification. Live source and repository-authored rules own exact implementation and source conventions.`}function ke(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(e,t){return new RegExp(`${ke(e)}[\\s\\S]*?${ke(t)}`,"m")}function Ce(e){let t=e.replace(q(se,ve),"");return d$2(t)?.includes("# Workspai project boundary")&&(t=t.replace(q(a$1,b$1),"")),t.replace(/\n{3,}/g,`
|
|
115
|
-
|
|
116
|
-
`).trim()}function De(e,t){let n=Ce(e),o=`${se}
|
|
117
|
-
${t.trim()}
|
|
118
|
-
${ve}`;return n?`${o}
|
|
119
|
-
|
|
120
|
-
${n}
|
|
121
|
-
`:`${o}
|
|
122
|
-
`}async function x(e,t){await y.mkdir(l.dirname(e),{recursive:true});let n=`${e}.${process.pid}.${be.randomUUID()}.tmp`;try{await y.writeFile(n,t,"utf8");try{await y.rename(n,e);}catch(o){let s=o.code;if(s!=="EEXIST"&&s!=="EPERM")throw o;await X.move(n,e,{overwrite:true});}}finally{await y.rm(n,{force:true}).catch(()=>{});}}async function F(e,t){let n=l.resolve(e),o=await y.realpath(n).catch(()=>n),s=l.resolve(t),a=l.relative(n,s);if(!a||a===".."||a.startsWith(`..${l.sep}`)||l.isAbsolute(a))throw new Error("Project agent output path must remain inside the project.");let i=a.split(l.sep),c=n;for(let[h,p]of i.entries()){c=l.join(c,p);let d=await y.lstat(c).catch(u=>{if(u.code==="ENOENT")return null;throw u});if(!d)return l.join(c,...i.slice(h+1));let m=h===i.length-1;if(d.isSymbolicLink()){if(m)throw new Error(`Project agent output is blocked by authored state: ${a}`);let u=await y.realpath(c),k=l.relative(o,u),f=await y.stat(u);if(k===".."||k.startsWith(`..${l.sep}`)||l.isAbsolute(k)||!f.isDirectory())throw new Error(`Project agent output is blocked by authored state: ${a}`);c=u;continue}if(m?!d.isFile():!d.isDirectory())throw new Error(`Project agent output is blocked by authored state: ${a}`)}return c}async function kt(e$1){let t=l.join(e$1.projectPath,".agents","skills");try{await F(e$1.projectPath,l.join(t,"workspai-grounding","SKILL.md"));}catch{return []}let n=await A(l.join(e$1.workspacePath,e.skillsIndex)),o=new Set([B,...(n?.skills??[]).map(i=>`.agents/skills/${i.skillId}/SKILL.md`)]),s=await y.readdir(t,{withFileTypes:true}).catch(i=>{if(i.code==="ENOENT")return [];throw i});for(let i of s)i.isDirectory()&&i.name.startsWith("workspai-")&&o.add(`.agents/skills/${i.name}/SKILL.md`);let a=[];for(let i of o){let c=l.join(e$1.projectPath,i);a.push(await F(e$1.projectPath,c));}return a}function Je(e,t){let n=t?.skillId??"workspai-grounding",o=t?.title??"Workspai project grounding",s=t?`workspace:${t.path}`:null;return ["---",`name: ${n}`,`description: ${JSON.stringify(`${o} through the Workspai project intelligence contract`)}`,"---","",ee,"",`# ${o}`,"",`This is a portable project entry for \`${e.project.name}\`. It contains no machine-local workspace path.`,"","## Workflow","",`1. Read \`${b}\`.`,"2. Run `workspai agent bootstrap --for-agent generic --strict --json`.","3. Continue only when the receipt permits it and follow its bounded `requiredReadOrder`.",...s?[`4. Resolve and follow the canonical Skill \`${s}\` listed in \`workspace:.workspai/reports/workspace-skills-index.json\`.`,`5. Query the graph with \`workspai workspace graph search <task-query> --scope project:${e.project.name} --limit 12 --json\` before broad source inspection.`]:["4. Load only the matching canonical Skill from `workspace:.workspai/reports/workspace-skills-index.json`.",`5. Query the graph with \`workspai workspace graph search <task-query> --scope project:${e.project.name} --limit 12 --json\` before broad source inspection.`],"","Repository-authored instructions and live source remain authoritative for exact implementation.",""].join(`
|
|
123
|
-
`)}async function we(e$1){let t=l.join(e$1.projectPath,".agents","skills"),n=await A(l.join(e$1.workspacePath,e.skillsIndex)),o=e$1.context?[{relativePath:B,skill:void 0},...(n?.skills??[]).map(p=>({relativePath:`.agents/skills/${p.skillId}/SKILL.md`,skill:p}))]:[],s=new Set(o.map(p=>p.relativePath)),a=[],i=[],c=[];try{await F(e$1.projectPath,l.join(t,"workspai-grounding","SKILL.md"));}catch(p){return {availableFiles:a,writtenFiles:i,authoredCollisions:c,reason:String(p)}}if(e$1.mode==="managed"&&e$1.context)for(let p of o){let d=l.join(e$1.projectPath,p.relativePath),m=await F(e$1.projectPath,d),u=await y.readFile(m,"utf8").catch(f=>{if(f.code==="ENOENT")return "";throw f});if(u&&!u.includes(ee)){a.push(p.relativePath),c.push(p.relativePath);continue}let k=Je(e$1.context,p.skill);k!==u&&await x(m,k),a.push(p.relativePath),i.push(p.relativePath);}let h=await y.readdir(t,{withFileTypes:true}).catch(p=>{if(p.code==="ENOENT")return [];throw p});for(let p of h){if(!p.isDirectory()||!p.name.startsWith("workspai-"))continue;let d=`.agents/skills/${p.name}/SKILL.md`;if(e$1.mode==="managed"&&s.has(d))continue;let m=l.join(e$1.projectPath,d),u=await F(e$1.projectPath,m);(await y.readFile(u,"utf8").catch(()=>"")).includes(ee)&&await y.rm(l.dirname(u),{recursive:true,force:true});}return {availableFiles:a,writtenFiles:i,authoredCollisions:c}}async function Re(e,t){let n;try{n=await execa("git",["rev-parse","--show-toplevel"],{cwd:e,reject:false});}catch{return false}if(n?.exitCode!==0)return false;let o=n.stdout.trim();if(!o)return false;let s,a;try{[s,a]=await Promise.all([y.realpath(l.resolve(o)),y.realpath(e)]);}catch{return false}let i=l.resolve(a,t),c=l.relative(s,i).replace(/\\/g,"/");if(!c||l.isAbsolute(c)||c===".."||c.startsWith("../"))return false;let h;try{h=await execa("git",["cat-file","-e",`HEAD:${c}`],{cwd:s,reject:false});}catch{return false}if(h?.exitCode!==0)return false;let p;try{p=await execa("git",["ls-files","--deleted","--error-unmatch","--",`:(top)${c}`],{cwd:s,reject:false});}catch{return false}return p?.exitCode===0}async function ye(e,t){let n=l.join(e,".gitignore"),o=await y.readFile(n,"utf8").catch(c=>{if(c.code==="ENOENT")return "";throw c}),s=[g$1,h$1,b],a=o.split(/\r?\n/).filter(c=>c.trim()!=="# Workspai local project grounding"&&!s.includes(c.trim()));for(;a.length>0&&a[a.length-1]==="";)a.pop();t==="local"&&(a.length>0&&a.push(""),a.push("# Workspai local project grounding",...s));let i=a.length>0?`${a.join(`
|
|
124
|
-
`)}
|
|
125
|
-
`:"";i!==o&&await x(n,i);}var M=[{host:"claude",relativePath:"CLAUDE.md",importFromAgents:"@AGENTS.md",importFromGrounding:"@.workspai/PROJECT-GROUNDING.md"},{host:"gemini",relativePath:"GEMINI.md",importFromAgents:"@./AGENTS.md",importFromGrounding:"@./.workspai/PROJECT-GROUNDING.md"},{host:"qwen",relativePath:"QWEN.md",importFromAgents:"@AGENTS.md",importFromGrounding:"@.workspai/PROJECT-GROUNDING.md"},{host:"amazon-q",relativePath:".amazonq/rules/workspai-agent-entry.md",importFromAgents:"",importFromGrounding:""}];if(M.length!==g.length||M.some((e,t)=>e.relativePath!==g[t]))throw new Error("Project agent adapter paths must match the portable entry contract.");async function Ue(e,t){let n=t.split("/").slice(0,-1),o=e;for(let s of n){o=l.join(o,s);let a=await y.lstat(o).catch(i=>{if(i.code==="ENOENT")return null;throw i});if(!a)return null;if(a.isSymbolicLink()||!a.isDirectory())return l.relative(e,o).split(l.sep).join("/")}return null}function qe(e){let t=e.agentsAvailable?e.adapter.importFromAgents:e.adapter.importFromGrounding;return t?`${e.importAlreadyPresent?"":`${t}
|
|
126
|
-
|
|
127
|
-
`}# Workspai host binding \xB7 ${e.adapter.host}
|
|
128
|
-
|
|
129
|
-
The imported Workspai entry gate is mandatory. Validate this host with
|
|
130
|
-
\`workspai agent bootstrap --for-agent ${e.adapter.host} --strict --json\`, then follow
|
|
131
|
-
the receipt's \`requiredReadOrder\`, Goal handoff, bounded Graph queries, proof paths,
|
|
132
|
-
status policy, workspace locator privacy policy, and authority boundary. Do not repeat
|
|
133
|
-
the imported instructions or replace repository-authored source rules.`:`# Workspai entry for ${e.adapter.host}
|
|
134
|
-
|
|
135
|
-
Before broad repository discovery, architecture claims, planning, or mutation:
|
|
136
|
-
|
|
137
|
-
1. Read \`${b}\`.
|
|
138
|
-
2. Run \`workspai agent bootstrap --for-agent ${e.adapter.host} --strict --json\`.
|
|
139
|
-
3. Follow \`requiredReadOrder\`, any active Goal handoff, bounded Graph queries, and returned proof paths.
|
|
140
|
-
|
|
141
|
-
Receipt policy: \`ready\` may proceed; \`degraded\` must disclose limitations; \`blocked\` must execute \`nextActions\` and rerun bootstrap before governed claims.
|
|
142
|
-
|
|
143
|
-
The workspace name is a logical identity, not a path. Resolve \`workspace:\` URIs at runtime with \`workspai project workspace status --json\`; its absolute paths are machine-local and must never be copied into shared output or portable artifacts. Live source owns exact implementation; Workspai evidence owns identity, topology, goals, readiness, and verification. Repository-authored rules remain authoritative for source changes after this entry gate.`}async function je(e){let t=await Ue(e.projectPath,e.adapter.relativePath);if(t)return {reason:`${e.adapter.relativePath} has an unsafe repository-authored parent at ${t}.`};let n=l.join(e.projectPath,e.adapter.relativePath),o=n,s=await y.lstat(n).catch(m=>{if(m.code==="ENOENT")return null;throw m});if(s?.isSymbolicLink()){let m=await Q(e.projectPath,n);if(!m)return {reason:`${e.adapter.relativePath} is a symbolic link without a safe repository-local file target.`};let u=await y.readFile(m,"utf8");if(e.agentsAvailable&&u.includes(se)){let f=`${u.replace(q(d$1,e$1),"").replace(/\n{3,}/g,`
|
|
144
|
-
|
|
145
|
-
`).trimEnd()}
|
|
146
|
-
`;return f!==u&&await x(m,f),{path:e.adapter.relativePath}}if(u.includes(d$1))return {path:e.adapter.relativePath};o=m;}let a=s?.isFile()===true,i=await y.readFile(o,"utf8").catch(m=>{if(m.code==="ENOENT")return "";throw m});if(e.mode==="managed"&&!a&&await Re(e.projectPath,e.adapter.relativePath))return {reason:`${e.adapter.relativePath} has an authored tracked deletion.`};let c=i.replace(q(d$1,e$1),"").replace(/\n{3,}/g,`
|
|
147
|
-
|
|
148
|
-
`).trim(),h=!!(e.agentsAvailable&&e.adapter.importFromAgents&&c.split(/\r?\n/u).some(m=>m.trim()===e.adapter.importFromAgents)),p=e.mode==="managed"?[c,`${d$1}
|
|
149
|
-
${qe({...e,importAlreadyPresent:h}).trim()}
|
|
150
|
-
${e$1}`].filter(Boolean).join(`
|
|
151
|
-
|
|
152
|
-
`):c;if(!p)return a&&!s?.isSymbolicLink()&&await y.rm(o,{force:true}),{};let d=`${p.trimEnd()}
|
|
153
|
-
`;return d!==i&&await x(o,d),e.mode==="managed"?{path:e.adapter.relativePath}:{}}function He(e){let t={id:"generic",discovery:"portable-fallback",entryFiles:[g$1],status:"ready",managed:e.mode==="managed"},o=["codex","kimi","grok","copilot","cursor","windsurf"].map(i=>({id:i,discovery:"native",entryFiles:["AGENTS.md",...["codex","kimi","grok"].includes(i)&&e.portableSkillsAvailable?[B]:[]],status:e.agentsAvailable?["codex","kimi","grok"].includes(i)&&!e.portableSkillsAvailable?"blocked":["codex","kimi","grok"].includes(i)&&e.portableGroundingAuthoredCollision?"degraded":"ready":"blocked",managed:e.mode==="managed"&&e.agentsAvailable&&(!["codex","kimi","grok"].includes(i)||e.portableSkillsAvailable&&!e.portableGroundingAuthoredCollision),...e.agentsAvailable?["codex","kimi","grok"].includes(i)&&!e.portableSkillsAvailable?{reason:e.portableSkillsReason??"The provider-neutral project Skill projection could not be generated safely."}:["codex","kimi","grok"].includes(i)&&e.portableGroundingAuthoredCollision?{reason:"An authored Skill occupies the Workspai grounding path; it was preserved and AGENTS.md remains the fallback entry."}:{}:{reason:"AGENTS.md could not be managed without overriding authored repository state."}})),s=M.map(i=>{let c=e.adapters.get(i.host);return {id:i.host,discovery:"adapter",entryFiles:[i.relativePath],status:c?.path?"ready":e.mode==="managed"?"blocked":"degraded",managed:!!c?.path,...c?.path?{}:{reason:c?.reason??"Provider adapter generation is disabled by the project grounding policy."}}}),a=[t,...o,...s];return f.map(i=>a.find(c=>c.id===i))}async function Pe(e,t,n){let o=l.join(e,"AGENTS.md"),s=await y.lstat(o).catch(d=>{if(d.code==="ENOENT")return null;throw d}),a=s?.isSymbolicLink()?await Q(e,o):o;if(!a)return;let i=s?.isFile()===true||s?.isSymbolicLink()===true,c=await y.readFile(a,"utf8").catch(d=>{if(d.code==="ENOENT")return "";throw d});if(t==="managed"&&!n)throw new Error("Managed project grounding requires a project context.");if(t==="managed"&&!i&&await Re(e,"AGENTS.md"))return;let h=t==="managed"&&n?De(c,Me(n)):Ce(c);if(!h){i&&!s?.isSymbolicLink()&&await y.rm(a,{force:true});return}let p=`${h.trimEnd()}
|
|
154
|
-
`;return p!==c&&await x(a,p),t==="managed"?o:void 0}async function ze(e){let t=e.mode??"managed",n=l.resolve(e.workspacePath),o=l.resolve(e.projectPath);if(t==="off"){let P=u(o,"project.json").find(E=>ne.existsSync(E)),S=P?await A(P):null,N=e.projectName??(typeof S?.name=="string"?S.name:void 0)??l.basename(o),T=Ae(S,e.relationship??"managed"),L=await c({workspacePath:n,projectPath:o,projectName:N,relationship:T,now:e.now});return await ye(o,t),await Pe(o,t),await we({workspacePath:n,projectPath:o,mode:t}),await Promise.all(M.map(E=>je({projectPath:o,adapter:E,mode:t,agentsAvailable:false}))),await Promise.all([y.rm(l.join(o,h$1),{force:true}),y.rm(l.join(o,g$1),{force:true}),y.rm(l.join(o,b),{force:true}),y.rm(l.join(o,i.projectKnowledgeGraphReference),{force:true})]),{mode:t,projectPath:o,linkPath:L.linkPath,writtenFiles:[i.projectWorkspaceLink]}}let s=await Fe(e),a=s.workspace.relationship,i$2=await c({workspacePath:n,projectPath:o,projectName:s.project.name,relationship:a,workspaceName:s.workspace.name,relativePath:s.project.relativePath,now:e.now});await ye(o,t);let c$1=await Pe(o,t,s),h=new Map;for(let P of M)h.set(P.host,await je({projectPath:o,adapter:P,mode:t,agentsAvailable:!!c$1}));let p=await we({workspacePath:n,projectPath:o,mode:t,context:s}),d=He({mode:t,agentsAvailable:!!c$1,portableSkillsAvailable:p.availableFiles.includes(B),portableGroundingAuthoredCollision:p.authoredCollisions.includes(B),...p.reason?{portableSkillsReason:p.reason}:{},adapters:h}),m=l.join(o,h$1),u$1=l.join(o,g$1),k=l.join(o,b),f=i$1({context:s,hosts:d});await x(m,`${JSON.stringify(s,null,2)}
|
|
155
|
-
`),await x(u$1,`${Be(s).trimEnd()}
|
|
156
|
-
`),await x(k,`${JSON.stringify(f,null,2)}
|
|
157
|
-
`);let j=[i.projectWorkspaceLink,h$1,g$1,b];c$1&&j.push("AGENTS.md");for(let P of h.values())P.path&&j.push(P.path);return j.push(...p.writtenFiles),{mode:t,projectPath:o,linkPath:i$2.linkPath,groundingPath:u$1,contextPath:m,agentEntryPath:k,agentsPath:c$1,hostCoverage:d,writtenFiles:j}}async function wt(e){let t=l.resolve(e.workspacePath),n=e.mode??"managed",o=await Ve(t),s=[],a=[];for(let i of o.resolved)try{s.push(await ze({workspacePath:t,projectPath:i.projectPath,projectName:i.name,relationship:i.relationship,mode:n,now:e.now}));}catch(c){a.push({name:i.name,reason:c instanceof Error?c.message:String(c)});}return {workspacePath:t,mode:n,projects:s,skipped:[...o.skipped,...a]}}async function Ve(e){let t=l.resolve(e),n=await A(l.join(t,".workspai","workspace.contract.json")),o=[],s=[];for(let a of n?.projects??[]){let i=a.slug??a.relativePath??"unknown-project",c=typeof a.externalPath=="string"?l.resolve(a.externalPath):typeof a.relativePath=="string"&&!a.relativePath.startsWith("external/")?l.resolve(t,a.relativePath):null;if(!c||!ne.existsSync(c)){s.push({name:i,reason:"project path is unavailable on this machine"});continue}o.push({name:i,projectPath:c,relationship:a.relationship??"managed"});}return {resolved:o,skipped:s}}export{Q as a,Ne as b,ft as c,se as d,ve as e,ee as f,B as g,Le as h,Fe as i,kt as j,ze as k,wt as l,Ve as m};
|
package/dist/chunk-WRZSQDZV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b,c,d as d$1}from'./chunk-OFYY4725.js';import {c as c$2}from'./chunk-EHLGPLIU.js';import {a as a$3}from'./chunk-X7FYEKLI.js';import {c as c$1,d as d$5}from'./chunk-BUYLM6QV.js';import {a as a$1,b as b$1}from'./chunk-PYCJWW4B.js';import {p,a,o,g,d as d$4,f as f$1}from'./chunk-3KU3YUWD.js';import {q,m as m$1,d as d$6}from'./chunk-2KX6KHEC.js';import {d as d$3}from'./chunk-TCLKGPXF.js';import {d as d$2,e as e$1}from'./chunk-C2VTO5WT.js';import {a as a$2}from'./chunk-AFIFZTOY.js';import {d}from'./chunk-EWZZUQBR.js';import {f,e,i,g as g$1,h}from'./chunk-ZGHJIQXL.js';import m from'path';import v from'fs-extra';var fe="rapidkit-blocker-resolution-v1";function pe(e){let t=e.blockers.map(s=>s.trim()).filter(Boolean).slice(0,12),r=e.stderrTail?.trim().slice(-400)??"";return d$6({blockers:t,exitCode:e.exitCode??null,stderrTail:r})}function we(e){let t=e.trim().toLowerCase();return t?t.includes("missing evidence")||t.includes(": missing")||t.includes("artifact missing")||t.includes("not found on disk")?"artifact-missing":t.includes("policy.")||t.includes("contract")?"config-fixable":t.includes("impact")||t.includes("untracked")||t.includes("grounding")?"semantic-attention":t.includes("failed")||t.includes("blocked")||t.includes(": fail")?"command-failed-repeat":"config-fixable":"unresolvable-without-human"}function me(e){let t=we(e.reason),r=pe({blockers:[e.reason]}),s=t==="artifact-missing"?[{actionKind:"run-once",detail:e.sourceCommand?`Run the source command once: ${e.sourceCommand}`:"Run the mapped workspace intelligence command once to generate the missing artifact.",...e.sourceCommand?{}:{studioActionId:"run-analyze"}}]:t==="semantic-attention"?[{actionKind:"commit-files",detail:"Review workspace-level grounding files (AGENTS.md, agent-sync outputs) and commit or refresh the impact baseline."},{actionKind:"refresh-baseline",detail:"Refresh snapshot + diff + impact before re-running verify."}]:[{actionKind:"edit-file",detail:"Apply the smallest safe file or policy fix for this blocker before re-running verification.",studioActionId:"fix-lens"}];return {schemaVersion:fe,blockerId:e.blockerId,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,resolutionClass:t,blockerSignature:r,commandRetryHint:t==="artifact-missing"?e.sourceCommand?`Run the source command once: ${e.sourceCommand}, then verify.`:"Run the source command once, then verify.":"Do not re-run the same failing command; fix the source issue first, then verify.",fixHints:s,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}}function Re(e){let t=e.toLowerCase();return t.includes("stale")||t.includes("missing evidence")||t.includes("no projects")||t.includes("projects.empty")||t.includes("projects discovered")||t.includes("projects.missing")||t.includes("not yet run")||t.includes("doctor-last-run")||t.includes("doctor-project-last-run")||t.includes("doctor-remediation-plan-last-run")||t.includes("doctor-fix-result-last-run")||t.includes("pipeline-last-run")||t.includes("release-readiness")||t.includes("analyze-last-run")||t.includes("analyze reported")||t.includes("analyze verdict")||t.includes("analyze needs attention")||t.includes("toolchain.lock")||t.includes("not pinned")||t.includes("readiness:")||t.includes("env:")||t.includes("workspace-run-last")||t.includes("pre-project")||t.includes("before adding projects")||t.includes("workspace.projects.missing")||t.includes("no backend projects")||t.includes("index.json")||t.includes("workspace-intelligence-history")||t.includes("validation warning")||t.includes("workspace model validation")||t.includes("workspace.marker")||t.includes("no project roots")||t.includes("no infrastructure services")||t.includes("infra/overrides")||t.includes("infra dependencies")||t.includes("contract verify")||t.includes("contract inspect")||t.includes("publish verify evidence")}function Ce(e){return e.length===0||e.every(t=>Re(t))}function ge(e){return e.projectCount>0||e.policyErrorCount>0?{verdict:e.verdict,exitCode:e.exitCode}:e.verdict==="blocked"&&Ce(e.blockingReasons)?{verdict:"needs-attention",exitCode:1}:{verdict:e.verdict,exitCode:e.exitCode}}function tt(e,t){let r=t&&t!=="ready"?` (${t.replace(/-/g," ")})`:"";return e===0?`Workspace scaffold ready${r} \u2014 add your first project to continue.`:`Workspace scaffold${r}: ${e} pre-project signal(s) \u2014 add your first project to continue.`}var ye=f.verify,G=e.verify;function Ae(e,t){return m.isAbsolute(t)?t:m.join(e,t)}async function ke(e){let t=await v.readJson(e);if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Workspace impact input is not a JSON object: ${e}`);let r=t;if(r.schemaVersion!==f$1)throw new Error(`Unsupported workspace impact schema: ${String(r.schemaVersion)}`);a$2(t,"contracts/workspace-intelligence/workspace-impact.v1.json",`Workspace impact ${e}`);let s=r;a$2(s.diff,"contracts/workspace-intelligence/workspace-model-diff.v1.json",`Embedded workspace diff in ${e}`);let i=[];s.summary.affectedProjects!==s.affectedProjects.length&&i.push("summary.affectedProjects does not match affectedProjects.length"),s.summary.workspaceItems!==s.workspaceImpact.length&&i.push("summary.workspaceItems does not match workspaceImpact.length"),s.summary.recommendedCommands!==s.verificationPlan.length&&i.push("summary.recommendedCommands does not match verificationPlan.length"),s.summary.blastRadius.directlyAffected!==s.affectedProjects.length&&i.push("blastRadius.directlyAffected does not match affectedProjects.length"),s.summary.blastRadius.transitivelyAffected!==s.transitiveImpact.length&&i.push("blastRadius.transitivelyAffected does not match transitiveImpact.length");let o=s.transitiveImpact.reduce((u,d)=>Math.max(u,d.distance??0),0);s.summary.blastRadius.maxDistance!==o&&i.push("blastRadius.maxDistance does not match transitive impact distances");let k=m$1(s.diff.currentModel)?.edges.length??0;if(s.summary.blastRadius.graphEdges!==k&&i.push("blastRadius.graphEdges does not match the embedded model graph"),s.summary.changed!==s.diff.summary.changed&&i.push("summary.changed does not match embedded diff summary"),s.fromRef!==s.diff.fromRef&&i.push("fromRef does not match embedded diff fromRef"),s.workspace.name!==s.diff.currentModel.workspace.name&&i.push("workspace.name does not match the embedded model"),s.diff.toHash!==d(s.diff.currentModel)&&i.push("embedded diff current-model hash does not match toHash"),i.length>0)throw new Error(`Workspace impact semantic integrity failed: ${i.join("; ")} (${e})`);return s}function Ee(e){let t=new Set,r=[];for(let s of e){let i=`${s.scope}:${s.project??""}:${s.display}`;t.has(i)||(t.add(i),r.push(s));}return r}function Se(e,t){if(!e||e==="workspace")return true;let r=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return t.scope==="workspace"?true:(t.project??"").trim().toLowerCase()===r}function We(e$1,t){if(e$1.id==="workspace.doctor")return m.join(t,e.doctor);if(e$1.id==="workspace.contract.verify")return m.join(t,e.contractVerify);if(e$1.id==="workspace.readiness")return m.join(t,e.readiness);if(e$1.id==="workspace.analyze")return m.join(t,".workspai","reports","analyze-last-run.json");if(e$1.id==="workspace.pipeline")return m.join(t,".workspai","reports","pipeline-last-run.json");if(e$1.id==="workspace.doctor-fix")return m.join(t,".workspai","reports","doctor-fix-result-last-run.json");if(e$1.id.startsWith("project.")&&e$1.id.includes("."))return m.join(t,".workspai","reports","workspace-run-last.json")}function C(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function je(e){if(!c$1(e,"workspace"))return {status:"fail",message:"Doctor evidence contract is missing or unsupported."};try{d$5(e);}catch(s){return {status:"fail",message:`Doctor evidence semantic validation failed: ${s instanceof Error?s.message:String(s)}`}}let t=a$3(e);return t.hasSystemErrors||t.blockingFindings>0?{status:"fail",message:`Doctor evidence reports ${t.blockingFindings} canonical blocking finding(s).`}:t.advisoryFindings+t.unknownFindings+t.contradictionCount+t.missingDiagnosisProjects>0||t.staleEvidence||t.unknownFreshness||t.minimumDiagnosisCompleteness<100?{status:"warn",message:`Doctor evidence needs attention (${t.advisoryFindings} advisory, ${t.unknownFindings} unknown, ${t.contradictionCount} contradictory; ${t.minimumDiagnosisCompleteness}% complete).`}:{status:"pass",message:"Canonical Doctor evidence is complete, fresh, and healthy."}}function xe(e){let t=typeof e.overallStatus=="string"?e.overallStatus:"unknown";return t==="fail"?{status:"fail",message:"Release readiness evidence reports blocking failures."}:t==="warn"?{status:"warn",message:"Release readiness evidence reports warnings."}:t==="pass"?{status:"pass",message:"Release readiness evidence passed."}:{status:"warn",message:`Release readiness evidence status is ${t}.`}}function Pe(e){let t=typeof e.status=="string"?e.status:"unknown";return t==="failed"||t==="fail"?{status:"fail",message:"Workspace contract verify evidence failed."}:t==="passed"||t==="pass"?{status:"pass",message:"Workspace contract verify evidence passed."}:{status:"warn",message:`Workspace contract verify evidence status is ${t}.`}}function Ie(e){let t=C(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Analyze evidence reports blocking findings."}:r==="needs-attention"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is ready."}}function Ve(e){let t=e.schemaVersion===h.doctorFixResult.schemaVersion?e:e.fixResult;if(!t||typeof t!="object"||Array.isArray(t))return {status:"skipped",message:"Doctor fix result not present; run doctor workspace --fix --json to record fixes."};let r=t,s=Array.isArray(r.remainingBlockers)?r.remainingBlockers:[];if(s.length>0)return {status:"fail",message:`Doctor fix result reports ${s.length} remaining blocker(s).`};let i=Array.isArray(r.appliedFixes)?r.appliedFixes:[];return i.length===0?{status:"pass",message:"Doctor fix result recorded with no remaining blockers."}:{status:"pass",message:`Doctor fix result recorded ${i.length} applied fix(es) with no remaining blockers.`}}async function Fe(e,t){let r=await d$2(e,i.doctorRemediationPlan);if(!r)return false;try{let s=C(await v.readJson(r));if(!s||(Array.isArray(s.steps)?s.steps:[]).length>0)return false;let o=typeof s.generatedAt=="string"?s.generatedAt:void 0;if(!o||!t)return true;let k=Date.parse(o),u=Date.parse(t);return !Number.isFinite(k)||!Number.isFinite(u)?true:k>=u}catch{return false}}function $e(e){return e.id.endsWith(".init")?"init":e.id.endsWith(".test")?"test":e.id.endsWith(".build")?"build":e.id.endsWith(".start")?"start":null}function Oe(e){let t=C(e.summary),r=typeof t?.verdict=="string"?t.verdict:void 0;return r==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:r==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:r==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function De(e,t,r){let s=$e(t),i=c$2(e,s??void 0);if(!i)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let o=i.stage;if(s&&o!==s)return {status:"missing",message:`Workspace run evidence is for stage "${o}", expected "${s}".`};let k=Array.isArray(i.projects)?i.projects:[],u=t.project?.toLowerCase();if(!u)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let d=k.find(g=>{let c=C(g);if(!c)return false;let n=typeof c.projectName=="string"?c.projectName.toLowerCase():"",a=["projectPath","relativePath","path"].map(f=>c[f]).filter(f=>typeof f=="string"&&f.trim().length>0).map(f=>f.replace(/\\/g,"/").toLowerCase());return n===u||a.some(f=>f.endsWith(`/${u}`)||f===u)});if(d){let g=R(i.generatedAt,r,`Workspace run evidence for ${t.project??t.id}`);if(g)return {status:"fail",message:g};let c=C(d),n=typeof c?.status=="string"?c.status:"unknown";return n==="failed"?{status:"fail",message:`Workspace run evidence failed for ${t.project}.`}:n==="passed"?{status:"pass",message:`Workspace run evidence passed for ${t.project}.`}:n==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${t.project}.`}:{status:"warn",message:`Workspace run evidence status is ${n} for ${t.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${t.project}.`}}function R(e,t,r){if(!t)return null;if(typeof e!="string"||e.trim().length===0)return `${r} is stale: missing generatedAt timestamp (required after impact ${t}).`;let s=Date.parse(e),i=Date.parse(t);return Number.isFinite(s)?Number.isFinite(i)&&s<i?`${r} is stale: generated at ${e}, before impact ${t}.`:null:`${r} is stale: invalid generatedAt timestamp (required after impact ${t}).`}function Be(e){if(e.id==="workspace.doctor")return g$1.doctor;if(e.id==="workspace.readiness")return g$1.readiness;if(e.id==="workspace.contract.verify")return g$1.contractVerify;if(e.id==="workspace.analyze")return g$1.analyze;if(e.id==="workspace.pipeline")return "contracts/pipeline-last-run.v1.json"}async function _e(e,t,r,s){let i=We(e,t),o=i?m.relative(t,i).split(m.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!r)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"skipped",required:e.required,message:"Workspace contract is not present; contract verify skipped."};let k=i?await d$2(t,o??""):null;if(!i||!k)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:o,message:o?`Missing evidence report: ${o}`:"No evidence mapping exists for this command."};let u;try{u=await v.readJson(k);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is unreadable JSON: ${n instanceof Error?n.message:String(n)}`}}let d=C(u);if(!d)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:"Evidence report is not a JSON object."};let g=Be(e);if(g)try{a$2(d,g,`${e.label} evidence`);}catch(n){return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:o,message:`Evidence report is invalid: ${n instanceof Error?n.message:String(n)}`}}let c;if(e.id==="workspace.doctor"){let n=R(d.generatedAt,s,"Doctor evidence");n?c={status:"fail",message:n}:c=je(d);}else if(e.id==="workspace.readiness"){let n=R(d.generatedAt,s,"Release readiness evidence");n?c={status:"fail",message:n}:c=xe(d);}else if(e.id==="workspace.contract.verify"){let n=R(d.generatedAt,s,"Workspace contract verify evidence");n?c={status:"fail",message:n}:c=Pe(d);}else if(e.id==="workspace.analyze"){let n=R(d.generatedAt,s,"Analyze evidence");n?c={status:"fail",message:n}:c=Ie(d);}else if(e.id==="workspace.pipeline"){let n=R(d.generatedAt,s,"Pipeline evidence");n?c={status:"fail",message:n}:c=Oe(d);}else if(e.id==="workspace.doctor-fix"){let n=d.schemaVersion===h.doctorFixResult.schemaVersion?d:d.fixResult,a=C(n),f=typeof a?.generatedAt=="string"?a.generatedAt:void 0,y=R(f,s,"Doctor fix result");y?c={status:"fail",message:y}:await Fe(t,f)?c={status:"skipped",message:"No current doctor remediation steps are pending."}:c=Ve(d);}else if(e.id.startsWith("project."))c=De(d,e,s);else {let n=R(d.generatedAt,s,"Evidence report");n?c={status:"fail",message:n}:c={status:"pass",message:"Evidence report is present."};}return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:c.status,required:e.required,evidencePath:o,message:c.message}}function Ne(e,t={blockingReasons:[],needsAttention:false}){let r=e.filter(n=>n.status==="pass").length,s=e.filter(n=>n.status==="warn").length,i=e.filter(n=>n.status==="fail").length,o=e.filter(n=>n.status==="missing").length,k=e.filter(n=>n.status==="skipped").length,u=e.filter(n=>n.required&&(n.status==="fail"||n.status==="missing")).map(n=>`${n.id}: ${n.message}`),d=e.filter(n=>n.required&&n.status==="missing").length,g="ready",c=0;return u.length>0||t.blockingReasons.length>0?(g="blocked",c=2):(s>0||e.some(n=>!n.required&&n.status==="fail")||d>0||t.needsAttention)&&(g="needs-attention",c=1),{verdict:g,exitCode:c,stepsPassed:r,stepsWarn:s,stepsFailed:i,stepsMissing:o,stepsSkipped:k}}function He(e,t){let r=x(e.affectedProjects.map(a=>a.project?.name).filter(a=>typeof a=="string")),s=new Set(r.map(a=>a.toLowerCase())),i=x(e.transitiveImpact.map(a=>a.project?.name).filter(a=>typeof a=="string").filter(a=>!s.has(a.toLowerCase()))),o=new Map;for(let a of t){if(a.scope!=="project"||!a.project)continue;let f=a.project.toLowerCase(),y=o.get(f)??[];y.push(a),o.set(f,y);}let k=[],u=[],d=[],g=[],c=false,n=(a,f)=>{let y=o.get(a.toLowerCase())??[];if(y.length===0){d.push(a);return}let P=y.filter(p=>p.status==="fail"),b=P.filter(p=>p.required),I=y.filter(p=>p.status==="missing"),E=I.filter(p=>p.required),V=y.some(p=>p.status==="pass"||p.status==="warn");if(b.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has failed verification evidence (${b.map(p=>p.id).join(", ")}).`);return}if(P.length>0){u.push(a),c=true;return}if(E.length>0){u.push(a),g.push(`graph.subgraph.${a}: ${f} has missing required verification evidence (${E.map(p=>p.id).join(", ")}).`);return}if(I.length>0){u.push(a),c=true;return}if(V){k.push(a);return}d.push(a);};for(let a of r)n(a,"directly-changed");for(let a of i)n(a,"transitive dependent");return {subgraph:{totalProjects:r.length+i.length,directlyChanged:r,transitiveDependents:i,covered:x(k),uncovered:x(u),unverifiable:x(d)},blockingReasons:g,needsAttention:c}}function x(e){return [...new Set(e)].sort((t,r)=>t.localeCompare(r))}async function Me(e$1){let t=m.resolve(e$1.workspacePath);if(e$1.fromImpactPath){let o=Ae(t,e$1.fromImpactPath);return {impact:await ke(o),fromImpactRef:m.relative(t,o).split(m.sep).join("/"),impactFromDisk:true}}let r=m.join(t,g);if(await v.pathExists(r))return {impact:await ke(r),fromImpactRef:g,impactFromDisk:true};let s=m.join(t,d$4);if(await v.pathExists(s))return {impact:await p({workspacePath:t,fromPath:d$4,scope:e$1.scope,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now}),fromImpactRef:d$4,impactFromDisk:false};let i=await q({workspacePath:t,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now});return {impact:{schemaVersion:f$1,generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",diffRef:e.diff,workspace:{name:i.workspace.name,profile:i.workspace.profile,type:i.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0,blastRadius:{directlyAffected:0,transitivelyAffected:0,maxDistance:0,graphEdges:m$1(i)?.edges.length??0}},affectedProjects:[],transitiveImpact:[],criticalPathHotspots:[],workspaceImpact:[],verificationPlan:[],agentBrief:{headline:"Baseline workspace verify run.",bullets:["No impact report or snapshot was available; baseline gates were evaluated."],unsafeAssumptions:["Do not claim runtime verification passed unless evidence exists."]},diff:{schemaVersion:f.diff,generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",toRef:e.model,fromHash:"baseline",toHash:"baseline",summary:{changed:false,addedProjects:0,removedProjects:0,changedProjects:0,workspaceChanges:0,validationChanges:0,gitChangedFiles:0},git:{available:false,dirty:false,changedFiles:0,untrackedFiles:0,deletedFiles:0},changes:[],currentModel:i}},impactFromDisk:false}}function Te(e,t){if(t)return e.generatedAt}async function bt(e){let t=m.resolve(e.workspacePath),{impact:r,fromImpactRef:s,impactFromDisk:i}=await Me(e),o$1=r.diff.currentModel,k=i?await q({workspacePath:t,includeAbsolutePaths:e.includeAbsolutePaths,includeEvidence:e.includeEvidence,observableScanDepth:e.observableScanDepth,now:e.now}):o$1,u=[];if(i){let l=await p({workspacePath:t,fromPath:r.diff.fromRef,diff:r.diff,scope:e.scope,now:e.now}),W=[r.affectedProjects,r.transitiveImpact,r.verificationPlan],A=[l.affectedProjects,l.transitiveImpact,l.verificationPlan];JSON.stringify(W)!==JSON.stringify(A)&&u.push("workspace.impact: Persisted impact semantics do not match the impact re-derived from the embedded diff. Regenerate diff and impact.");}i&&d(k)!==r.diff.toHash&&u.push("workspace.impact: Impact evidence is stale because the current workspace model no longer matches the embedded model. Regenerate diff and impact.");let d$2=r.diff.git;if(i&&d$2?.available){let l=a(t,{ref:d$2.ref}),W=r.diff.changes.filter(h=>h.type.startsWith("git.")).map(h=>`${h.type}:${h.target.replace(/^git:/,"")}`).sort(),A=[...l.changedFiles.map(h=>`git.file.changed:${h}`),...l.untrackedFiles.map(h=>`git.untracked:${h}`),...l.deletedFiles.map(h=>`git.deleted:${h}`)].sort();(!l.available||l.commit!==d$2.commit||JSON.stringify(A)!==JSON.stringify(W))&&u.push("workspace.impact: Impact evidence is stale because Git changes no longer match the diff observation. Regenerate diff and impact.");}let g=Te(r,i),c$1=Ee([...o(),...r.verificationPlan]).filter(l=>Se(e.scope,l)),n=[];for(let l of c$1)n.push(await _e(l,t,o$1.contracts.exists===true,g));let a$2=He(r,n),f=a$1(m$1(o$1)??{nodes:[],edges:[]}),y=b(o$1),P=await Ke(t),b$2=c(y,P?.freshness?.projectHashes),I={verdict:b$2.verdict,baseline:b$2.baseline,changed:b$2.changed,added:b$2.added,removed:b$2.removed,projectHashes:d$1(y)},E=b$1(f),V=o$1.policies?.mode??"warn",p$1=await Le(o$1,t),B=qe(V,p$1),S=Ne(n,{blockingReasons:[...a$2.blockingReasons,...E,...B.blockingReasons,...u],needsAttention:a$2.needsAttention||B.needsAttention}),he=n.filter(l=>l.status==="missing"&&l.evidencePath).map(l=>l.evidencePath),_=[...n.filter(l=>l.required&&(l.status==="fail"||l.status==="missing")).map(l=>`${l.id}: ${l.message}`),...a$2.blockingReasons,...E,...B.blockingReasons,...u],ve=p$1.filter(l=>l.severity==="error").length,be=o$1.summary?.projectCount??o$1.projects.length,U=ge({projectCount:be,verdict:S.verdict,exitCode:S.exitCode,blockingReasons:_,policyErrorCount:ve});S.verdict=U.verdict,S.exitCode=U.exitCode;let Y=Array.from(new Set(_.map(l=>l.trim()).filter(Boolean))).slice(0,12).map((l,W)=>{let A=n.find(h=>l.startsWith(`${h.id}:`));return me({reason:l,blockerId:`blocker-${W+1}`,sourceCommand:A?.command.display,sourceArtifact:A?.evidencePath,verifyCommand:"npx workspai workspace verify --from-impact .workspai/reports/workspace-impact-last-run.json --json",verifyArtifact:G})});return {schemaVersion:ye,generatedAt:(e.now??new Date).toISOString(),workspacePath:t,mode:"evidence",fromImpactRef:s,scope:e.scope,impact:{changed:r.summary.changed,risk:r.summary.risk,affectedProjects:r.summary.affectedProjects,recommendedCommands:r.summary.recommendedCommands},summary:S,steps:n,missingEvidence:he,blockingReasons:_,...Y.length>0?{resolutionHints:Y}:{},verificationPlan:c$1,affectedSubgraph:a$2.subgraph,graphIntegrity:f,freshness:I,policyMode:V,policyViolations:p$1}}async function Le(e$1,t){let r=[];for(let i of e$1.validation?.issues??[])r.push({source:"model",severity:i.severity,code:i.code,message:i.message,target:i.target});let s=await d$2(t,e.contractVerify);try{if(s&&await v.pathExists(s)){let i=await v.readJson(s);if(Array.isArray(i.violations))for(let o of i.violations)typeof o=="string"&&o.trim().length>0&&r.push({source:"contract",severity:"error",code:"contract.violation",message:o});}}catch{}return r.sort((i,o)=>i.source!==o.source?i.source.localeCompare(o.source):i.code!==o.code?i.code.localeCompare(o.code):i.message.localeCompare(o.message))}function qe(e,t){let r=t.filter(s=>s.severity==="error");return e==="enforce"&&r.length>0?{blockingReasons:r.map(s=>`policy.${s.code}: ${s.message}`),needsAttention:false}:{blockingReasons:[],needsAttention:r.length>0}}async function Ke(e){let t=m.join(e,G);try{if(!await v.pathExists(t))return null;let r=await v.readJson(t);return r&&r.schemaVersion===ye?r:null}catch{return null}}async function wt(e,t){return e$1(t,G,d$3(e))}function ze(e,t){let r=t?.strict?"strict":"default",s=[];if(e.summary.verdict==="blocked")return s.push(...e.blockingReasons),s.length===0&&s.push("verify verdict is blocked."),{passed:false,mode:r,exitCode:2,reasons:s};if(r==="strict"){if(e.summary.verdict!=="ready"&&s.push(`verify verdict is ${e.summary.verdict} (strict requires ready).`),e.freshness.verdict==="stale"){let i=[...e.freshness.changed,...e.freshness.added].slice(0,5);s.push(`freshness is stale${i.length>0?`: ${i.join(", ")}`:""} (strict requires fresh).`);}if(s.length>0)return {passed:false,mode:r,exitCode:1,reasons:s}}return {passed:true,mode:r,exitCode:0,reasons:s}}function Rt(e,t){return ze(e,t).exitCode}export{fe as a,tt as b,ye as c,G as d,He as e,bt as f,wt as g,ze as h,Rt as i};
|
package/dist/chunk-Y4Z6CEII.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {h as h$1}from'./chunk-ZGHJIQXL.js';import o from'path';var h=h$1.artifactRemediationPlan.schemaVersion;function c(t){return t.replace(/\\/g,"/")}function P(t,r){return t.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^[-_.]+|[-_.]+$/g,"").slice(0,80)||r}function p(t,r){let e=c(o.relative(t,r));return !e||e.startsWith("..")?true:e.split("/").filter(Boolean).some(a=>a==="..")}function A(t){let r=c(o.relative(t.workspacePath,t.projectPath)),e=p(t.workspacePath,t.projectPath),a=P(t.projectName,o.basename(t.projectPath)),n=e?`external/${a}`:r||a;return {relativePath:r||n,contractRelativePath:n,isExternal:e}}export{h as a,A as b};
|
package/dist/chunk-ZEEV5J4I.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import p from'path';import m from'fs-extra';var y=new Set([".git",".workspai",".rapidkit",".venv","node_modules","target","dist","build","coverage","vendor"]),x=new Set(["test","tests","__tests__","spec","specs"]);function f(n){let t=n.toLowerCase();return t.endsWith(".rs")?"rust":t.endsWith(".go")?"go":t.endsWith(".py")?"python":/\.(?:test|spec)\.[cm]?[jt]sx?$/.test(t)?"node":t.endsWith(".java")?"java":t.endsWith(".kt")||t.endsWith(".kts")?"kotlin":t.endsWith(".exs")?"elixir":t.endsWith(".php")?"php":t.endsWith(".rb")?"ruby":t.endsWith(".cs")?"dotnet":t.endsWith(".c")?"c":/\.(?:cc|cpp|cxx)$/.test(t)?"cpp":null}function g(n,t){return t&&f(n)?true:/(?:^test[_-].+|[_-]test|\.test|\.spec|tests?)\.(?:rs|go|py|[cm]?[jt]sx?|java|kts?|exs|php|rb|cs|c|cc|cpp|cxx)$/i.test(n)}async function w(n,t={}){let h=t.maxDepth??6,u=t.maxEntries??5e3,c=new Set,r=false,a=0;try{let s=(await m.readJson(p.join(n,"package.json")))?.scripts?.test;typeof s=="string"&&s.trim()&&(r=true,c.add("node"));}catch{}let d=[{dir:n,depth:0,insideTestDirectory:false}];for(;d.length>0&&a<u;){let i=d.shift();if(!i)break;let s;try{s=await m.readdir(i.dir,{withFileTypes:true});}catch{continue}for(let e of s){if(a+=1,a>u)break;if(y.has(e.name))continue;let l=p.join(i.dir,e.name);if(e.isDirectory()){let o=i.insideTestDirectory||x.has(e.name.toLowerCase());o&&(r=true),i.depth<h&&!e.name.startsWith(".")&&d.push({dir:l,depth:i.depth+1,insideTestDirectory:o});continue}if(e.isFile()){if(g(e.name,i.insideTestDirectory)){r=true;let o=f(e.name);o&&c.add(o);}/^(?:pytest\.ini|tox\.ini|noxfile\.py|phpunit\.xml(?:\.dist)?|\.rspec)$/i.test(e.name)&&(r=true),/^(?:vitest|jest|playwright|cypress)\.config\.[cm]?[jt]s$/i.test(e.name)&&(r=true,c.add("node"));}}}return {detected:r,runtimeFamilies:[...c].sort()}}export{w as a};
|
package/dist/chunk-ZGHJIQXL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="workspai.doctor-capabilities.v1",k="universal-doctor-capabilities-v1",t="workspai.doctor-validation.v1",w="doctor-disease-corpus-v1";var o={model:".workspai/reports/workspace-model.json",knowledgeGraph:".workspai/reports/workspace-knowledge-graph.json",snapshot:".workspai/reports/workspace-model-snapshot.json",diff:".workspai/reports/workspace-model-diff-last-run.json",impact:".workspai/reports/workspace-impact-last-run.json",analyze:".workspai/reports/analyze-last-run.json",doctor:".workspai/reports/doctor-last-run.json",contractVerify:".workspai/reports/workspace-contract-verify-last-run.json",readiness:".workspai/reports/release-readiness-last-run.json",verify:".workspai/reports/workspace-verify-last-run.json",history:".workspai/reports/workspace-intelligence-history.json",agentContext:".workspai/reports/workspace-context-agent.json",agentIndex:".workspai/reports/INDEX.json",agentCustomizationPack:".workspai/reports/agent-customization-pack.json",skillsIndex:".workspai/reports/workspace-skills-index.json",agents:"AGENTS.md",explain:".workspai/reports/workspace-explain-last-run.json",intelligenceRun:".workspai/reports/workspace-intelligence-run-last-run.json",evaluationLive:".workspai/reports/workspace-intelligence-evaluation-live.json",evaluationLastRun:".workspai/reports/workspace-intelligence-evaluation-last-run.json",verifiedGoalStatus:".workspai/reports/verified-goal-last-run.json",repairTransaction:".workspai/reports/workspace-repair-last-run.json"},s={model:"workspace-model.v1",knowledgeGraph:"workspace-knowledge-graph.v1",snapshot:"workspace-model-snapshot.v1",diff:"workspace-model-diff.v1",impact:"workspace-impact.v1",analyze:"rapidkit-analyze-v1",doctor:"doctor-workspace-evidence-v1",contractVerify:"workspace-contract-verify.v1",readiness:"release-readiness-v1",verify:"workspace-verify.v1",history:"workspace-intelligence-history.v1",agentContext:"workspace-context.v1",agentIndex:"rapidkit-agent-reports-index.v1",agentCustomizationPack:"rapidkit-agent-customization-pack.v1",skillsIndex:"workspace-skills-index.v1",agents:null,explain:"workspace-explain.v1",intelligenceRun:"workspace-intelligence-run.v1",evaluationLive:"workspace-intelligence-evaluation.v1",evaluationLastRun:"workspace-intelligence-evaluation.v1",verifiedGoalStatus:"workspai.verified-goal-status.v1",repairTransaction:"workspai.workspace-repair-transaction.v1"},c={model:"contracts/workspace-intelligence/workspace-model.v1.json",knowledgeGraph:"contracts/workspace-intelligence/workspace-knowledge-graph.v1.json",snapshot:"contracts/workspace-intelligence/workspace-model-snapshot.v1.json",diff:"contracts/workspace-intelligence/workspace-model-diff.v1.json",impact:"contracts/workspace-intelligence/workspace-impact.v1.json",analyze:"contracts/analyze-last-run.v1.json",doctor:"contracts/doctor-workspace-evidence.v1.json",contractVerify:"contracts/workspace-intelligence/workspace-contract-verify.v1.json",readiness:"contracts/release-readiness.v1.json",verify:"contracts/workspace-intelligence/workspace-verify.v1.json",history:"contracts/workspace-intelligence/workspace-intelligence-history.v1.json",agentContext:"contracts/workspace-intelligence/workspace-context.v1.json",agentIndex:"contracts/workspace-intelligence/agent-reports-index.v1.json",agentCustomizationPack:"contracts/workspace-intelligence/agent-customization-pack-report.v1.json",skillsIndex:"contracts/workspace-intelligence/workspace-skills-index.v1.json",agents:null,explain:"contracts/workspace-intelligence/workspace-explain.v1.json",intelligenceRun:"contracts/workspace-intelligence/workspace-intelligence-run.v1.json",evaluationLive:"contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json",evaluationLastRun:"contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json",verifiedGoalStatus:"contracts/workspace-intelligence/verified-goal-status.v1.json",repairTransaction:"contracts/workspace-intelligence/workspace-repair-transaction.v1.json"},l={goalIndex:{artifactPath:".workspai/goals/index.json",schemaVersion:"workspai.goal-index.v1",contractPath:"contracts/workspace-intelligence/goal-index.v1.json",producerCommands:[["goal"]]},projectWorkspaceLink:{artifactPath:".workspai/workspace-link.local.json",schemaVersion:"project-workspace-link.v1",contractPath:"contracts/project-workspace-link.v1.json",producerCommands:[["adopt"],["import"],["project","workspace","relink"],["workspace","sync"]]},projectContextAgent:{artifactPath:".workspai/reports/project-context-agent.json",schemaVersion:"project-context-agent.v1",contractPath:"contracts/workspace-intelligence/project-context-agent.v1.json",producerCommands:[["adopt"],["import"],["workspace","sync"],["workspace","agent-sync","--write"]]},projectKnowledgeGraphReference:{artifactPath:".workspai/reports/project-knowledge-graph-reference.json",schemaVersion:"project-knowledge-graph-reference.v1",contractPath:"contracts/workspace-intelligence/project-knowledge-graph-reference.v1.json",producerCommands:[["adopt"],["import"],["workspace","model"],["workspace","sync"],["workspace","intelligence","run"]]},projectAgentEntry:{artifactPath:".workspai/agent-entry.v1.json",schemaVersion:"workspai.agent-entry.v1",contractPath:"contracts/workspace-intelligence/project-agent-entry.v1.json",producerCommands:[["adopt"],["import"],["workspace","sync"],["workspace","agent-sync","--write"]]},workspaceContract:{artifactPath:".workspai/workspace.contract.json",schemaVersion:1,contractPath:"contracts/workspace-contract.v1.json",producerCommands:[["workspace","sync"],["workspace","contract","sync"]]},workspaceModelCache:{artifactPath:".workspai/cache/workspace-model.v1.json",schemaVersion:"workspace-model-cache.v1",contractPath:"contracts/workspace-model-cache.v1.json",producerCommands:[["workspace","model"]]},workspaceRegistry:{artifactPath:".workspai/workspace-registry.v1.json",schemaVersion:"workspace-registry.v1",contractPath:"contracts/workspace-registry.v1.json",producerCommands:[["workspace","sync"]]},compatibilityMatrix:{artifactPath:".workspai/compatibility-matrix.json",schemaVersion:"rapidkit.compatibility-matrix.v1",contractPath:"contracts/compatibility-matrix.v1.json",producerCommands:[["bootstrap"]]},doctorWorkspaceCache:{artifactPath:".workspai/reports/doctor-workspace-cache.json",schemaVersion:"doctor-workspace-cache-v2",contractPath:"contracts/doctor-workspace-cache.v2.json",producerCommands:[["doctor","workspace"]]},doctorCapabilities:{artifactPath:".workspai/reports/doctor-capabilities.json",schemaVersion:r,contractPath:"contracts/workspace-intelligence/doctor-capabilities.v1.json",producerCommands:[["doctor","capabilities","--write"]]},doctorValidation:{artifactPath:".workspai/reports/doctor-validation-last-run.json",schemaVersion:t,contractPath:"contracts/workspace-intelligence/doctor-validation.v1.json",producerCommands:[["doctor","capabilities","--validate","--write"]]},bootstrapCompliance:{artifactPath:".workspai/reports/bootstrap-compliance.latest.json",schemaVersion:"bootstrap-compliance.v1",contractPath:"contracts/bootstrap-compliance.v1.json",producerCommands:[["bootstrap"]]},mirrorOps:{artifactPath:".workspai/reports/mirror-ops.latest.json",schemaVersion:"mirror-ops.v1",contractPath:"contracts/mirror-ops.v1.json",producerCommands:[["mirror","status"]]},transparencyEvidence:{artifactPath:".workspai/reports/transparency-evidence.latest.json",schemaVersion:"transparency-evidence.v1",contractPath:"contracts/transparency-evidence.v1.json",producerCommands:[["mirror","sync"]]},workspaceShareBundle:{artifactPath:".workspai/reports/share-bundle.json",schemaVersion:"1.1",schemaVersionField:"schema_version",contractPath:"contracts/workspace-share-bundle.v1.json",producerCommands:[["workspace","share"]]},doctorProject:{artifactPath:".workspai/reports/doctor-project-last-run.json",schemaVersion:"doctor-project-evidence-v1",contractPath:"contracts/doctor-project-evidence.v1.json",producerCommands:[["doctor","project"]]},doctorReceipt:{artifactPath:".workspai/reports/doctor-receipt-last-run.json",schemaVersion:"workspai.doctor-receipt.v1",contractPath:"contracts/workspace-intelligence/doctor-receipt.v1.json",producerCommands:[["doctor","workspace"],["doctor","project"]]},projectTestCoverage:{artifactPath:".workspai/reports/project-test-coverage-last-run.json",schemaVersion:"workspai.project-test-coverage.v1",contractPath:"contracts/project-test-coverage.v1.json",producerCommands:[["project","coverage"]]},goalPackLastRun:{artifactPath:".workspai/reports/goal-pack-last-run.json",schemaVersion:"workspai.goal-pack.v1",contractPath:"contracts/workspace-intelligence/goal-pack.v1.json",producerCommands:[["goal"]]},doctorRemediationPlan:{artifactPath:".workspai/reports/doctor-remediation-plan-last-run.json",schemaVersion:"doctor-remediation-plan-v2",contractPath:"contracts/doctor-remediation-plan.v2.json",producerCommands:[["workspace","remediation-plan"]]},artifactRemediationPlan:{artifactPath:".workspai/reports/artifact-remediation-plan-last-run.json",schemaVersion:"artifact-remediation-plan-v1",contractPath:"contracts/artifact-remediation-plan.v1.json",producerCommands:[["workspace","remediation-plan"]]},doctorFixResult:{artifactPath:".workspai/reports/doctor-fix-result-last-run.json",schemaVersion:"rapidkit-doctor-fix-result-v1",contractPath:"contracts/workspace-intelligence/doctor-fix-result.v1.json",producerCommands:[["doctor","workspace"]]},pipelineLastRun:{artifactPath:".workspai/reports/pipeline-last-run.json",schemaVersion:"rapidkit-pipeline-v1",contractPath:"contracts/pipeline-last-run.v1.json",producerCommands:[["pipeline"]]},autopilotReleaseLastRun:{artifactPath:".workspai/reports/autopilot-release-last-run.json",schemaVersion:"autopilot-release-v1",contractPath:"contracts/autopilot-release.v1.json",producerCommands:[["autopilot","release"]]},autopilotReleaseAlias:{artifactPath:".workspai/reports/autopilot-release.json",schemaVersion:"autopilot-release-v1",contractPath:"contracts/autopilot-release.v1.json",producerCommands:[["autopilot","release"]]},workspaceRunLast:{artifactPath:".workspai/reports/workspace-run-last.json",schemaVersion:"workspace-run-v1",contractPath:"contracts/workspace-run-last.v1.json",producerCommands:[["workspace","run"]]},workspaiMcpDesign:{artifactPath:".workspai/reports/workspai-mcp-design.json",schemaVersion:"workspai-mcp-design.v1",contractPath:"contracts/workspace-intelligence/mcp-design.v1.json",producerCommands:[["workspace","agent-sync","--write"]]},workspaceIntelligenceBenchmark:{artifactPath:".workspai/reports/workspace-intelligence-benchmark-last-run.json",schemaVersion:"workspace-intelligence-benchmark.v1",contractPath:"contracts/workspace-intelligence/workspace-intelligence-benchmark.v1.json",producerCommands:[["workspace","graph","benchmark-suite","--write"]]},legacyMcpDesign:{artifactPath:".workspai/reports/rapidkit-mcp-design.json",schemaVersion:"workspai-mcp-design.v1",contractPath:"contracts/workspace-intelligence/mcp-design.v1.json",producerCommands:[["workspace","agent-sync","--write"]]},workspaceWhy:{artifactPath:".workspai/reports/workspace-why-last-run.json",schemaVersion:s.explain,contractPath:c.explain,producerCommands:[["workspace","why"]]},workspaceTrace:{artifactPath:".workspai/reports/workspace-trace-last-run.json",schemaVersion:s.explain,contractPath:c.explain,producerCommands:[["workspace","trace"]]},agentHooks:{artifactPath:".vscode/workspai-agent-hooks.json",schemaVersion:"workspai-agent-hooks.v1",contractPath:"contracts/workspace-intelligence/agent-hooks.v1.json",producerCommands:[["workspace","agent-sync"]]},infraPlan:{artifactPath:".workspai/reports/infra-plan.json",schemaVersion:"rapidkit.infra-plan.v1",contractPath:"contracts/infra-plan.v1.json",producerCommands:[["infra","plan"]]}},h=Object.freeze(Object.fromEntries(Object.entries(l).map(([a,n])=>[a,n.artifactPath]))),u={[o.intelligenceRun]:[["workspace","intelligence","run"]],[o.snapshot]:[["workspace","snapshot"]],[o.history]:[["workspace","feedback","record","--json"]],[o.evaluationLive]:[["workspace","eval","init"],["workspace","eval","record","--json"]],[o.evaluationLastRun]:[["workspace","eval","report","--json"]],[o.verifiedGoalStatus]:[["workspace","goal","plan"],["workspace","goal","verify"]],[o.repairTransaction]:[["workspace","repair","plan"],["workspace","repair","propose"],["workspace","repair","approve"],["workspace","repair","decide"],["workspace","repair","execute"],["workspace","repair","resume"],["workspace","repair","rollback"],["workspace","repair","cancel"]]},j={analyze:"analyze",workspace:"workspace <action> [subaction] [key] [value]",doctor:"doctor [scope]",readiness:"readiness"},f=["analyze","readiness","doctor","workspace"],C=["model","diff","impact","doctor-evidence","contract-evidence","analyze-evidence","readiness-evidence","verify","context","agent-sync","explain"],P=["sync","baseline"],y={sync:[".workspai/workspace.contract.json",".workspai/workspace-registry.v1.json"],baseline:[o.snapshot]},e=o,d={model:{command:["workspace","model","--json","--write"],produces:[e.model,e.knowledgeGraph]},diff:{command:["workspace","diff","--from",e.snapshot,"--json"],produces:[e.diff]},impact:{command:["workspace","impact","--from",e.diff,"--json"],produces:[e.impact]},"doctor-evidence":{command:["doctor","workspace","--json"],produces:[e.doctor]},"contract-evidence":{command:["workspace","contract","verify","--strict","--json"],produces:[e.contractVerify]},"analyze-evidence":{command:["analyze","--json"],produces:[e.analyze]},"readiness-evidence":{command:["readiness","--json","--skip-verify"],produces:[e.readiness]},verify:{command:["workspace","verify","--from-impact",e.impact,"--json"],produces:[e.verify,e.history]},context:{command:["workspace","context","--for-agent","--json","--write","--no-agent-sync"],produces:[e.agentContext]},"agent-sync":{command:["workspace","agent-sync","--write","--json","--preset","enterprise"],produces:[e.agentIndex,e.agentCustomizationPack,e.skillsIndex,e.agents]},explain:{command:["workspace","explain","release-blocked","--json","--write"],produces:[e.explain]}};function I(a){return d[a]}export{r as a,k as b,t as c,w as d,o as e,s as f,c as g,l as h,h as i,u as j,j as k,f as l,C as m,P as n,y as o,d as p,I as q};
|
package/dist/doctor-D7YI7LSA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as DOCTOR_WORKSPACE_REPORT_PATH,n as applyEnvKeyAddFix,j as applyFileAppendFix,k as applyFileCopyFix,i as applyFileCreateFix,m as applyJsonEditFix,o as applyMakefileTargetFix,h as applyPackageScriptFix,f as assertOperationPathInsideProject,g as assertOperationPathInsideProjectResolved,e as buildRepairOperationIdentity,q as computeDoctorFixAwareExitCode,p as computeDoctorGateExitCode,l as decodeJsonPointerSegment,d as parseInternalRepairCommand,c as parsePackageScriptFix,b as resolveDoctorPolicyProfile,r as runDoctor}from'./chunk-2C5XJBYI.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{f as GOAL_INDEX_PATH,e as GOAL_INDEX_SCHEMA_VERSION,k as buildGoalLifecycleResult,l as inspectGoalLifecycle,p as linkGoalRepairTransaction,n as prepareGoalVerification,m as transitionGoalLifecycle,o as verifyGoalLifecycle}from'./chunk-JYMO7QXQ.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {c}from'./chunk-BG6IX6HA.js';import {c as c$4}from'./chunk-3Z4SVBMR.js';import {j,i,d as d$1,f as f$2,c as c$3,e as e$1,h}from'./chunk-JYMO7QXQ.js';export{b as GOAL_AGENT_HANDOFF_SCHEMA_VERSION,f as GOAL_INDEX_PATH,e as GOAL_INDEX_SCHEMA_VERSION,g as GOAL_LIFECYCLE_RESULT_SCHEMA_VERSION,d as GOAL_PACK_LAST_RUN_PATH,a as GOAL_PACK_SCHEMA_VERSION,c as GOAL_PLAN_RESULT_SCHEMA_VERSION}from'./chunk-JYMO7QXQ.js';import {f as f$3}from'./chunk-BMAFHX6A.js';import {b}from'./chunk-FPDH3N3A.js';import {a as a$1}from'./chunk-3NF3M3RE.js';import {b as b$1}from'./chunk-LEOFD3W5.js';import {c as c$2,f as f$1}from'./chunk-C2VTO5WT.js';import {a}from'./chunk-AFIFZTOY.js';import {d,c as c$1}from'./chunk-EWZZUQBR.js';import {f,e}from'./chunk-ZGHJIQXL.js';import C from'path';import _ from'fs-extra';var ve=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/,ye=/(?:^|\s)(?:\/(?:home|Users|private|var|tmp|mnt|opt|srv|root|workspace|workspaces|data|Volumes|etc|usr|run|dev|proc|sys)\/[^\s]+|[A-Za-z]:[\\/][^\s]+|\\\\[^\\\s]+\\[^\s]+)/,Pe=/(?:-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----|\b(?:github_pat_|gh[pousr]_|glpat-|npm_|xox[baprs]-|sk-(?:proj-)?)[A-Za-z0-9_-]{12,}|\b(?:AKIA|ASIA)[A-Z0-9]{16}\b|\bAIza[A-Za-z0-9_-]{20,}|\bBearer\s+[A-Za-z0-9._~+/-]{16,}|[a-z][a-z0-9+.-]*:\/\/[^\s:/]+:[^\s@/]+@|\b(?:password|passwd|secret|token|api[_-]?key)\s*[:=]\s*[^\s]{6,})/i,je=[{category:"test-coverage",patterns:[/\b(?:test\s+)?coverage\b/i,/\bcoverage\s+(?:to|above|at least)\b/i]},{category:"dependency-security",patterns:[/\b(?:dependency|dependencies|package|packages)\b.*\b(?:security|vulnerab|audit)\b/i,/\b(?:security|vulnerab|audit)\b.*\b(?:dependency|dependencies|package|packages)\b/i]},{category:"release-readiness",patterns:[/\brelease[ -]readiness\b/i,/\bready (?:this |the )?(?:workspace|project) for release\b/i,/\bprepare (?:this |the )?(?:workspace|project) for release\b/i,/\bprepare\b[^\n]{0,80}\bfor release\b/i]},{category:"defect-repair",patterns:[/\b(?:fix|repair|resolve|debug)\b.*\b(?:bug|error|failure|issue|regression)\b/i]},{category:"performance",patterns:[/\b(?:performance|latency|throughput|cpu|optimi[sz]e|faster|slower)\b/i,/\b(?:memory\s+(?:allocation|consumption|footprint|leak|pressure|usage)|out[ -]of[ -]memory|heap|ram)\b/i]},{category:"refactor",patterns:[/\b(?:refactor|restructure|decouple|extract|simplify|cleanup|clean up)\b/i]},{category:"documentation",patterns:[/\b(?:document|documentation|readme|guide|tutorial|docs)\b/i]},{category:"feature-change",patterns:[/\b(?:add|build|create|enforce|enhance|harden|implement|improve|introduce|support)\b/i]},{category:"system-understanding",patterns:[/\b(?:understand|explain|map|find|where|how|architecture|analy[sz]e|search)\b/i]}];function Ge(e){if(typeof e!="string")throw new Error("Goal intent must be text.");let t=e.trim().replace(/\s+/g," ");if(!t)throw new Error("Goal intent cannot be empty.");if(t.length>2e3)throw new Error("Goal intent exceeds the 2000 character safety limit.");if(ve.test(t))throw new Error("Goal intent contains unsupported control characters.");if(ye.test(t))throw new Error("Goal intent contains a machine-local absolute path. Use a workspace-relative path or project scope.");if(Pe.test(t))throw new Error("Goal intent appears to contain secret material and was not persisted.");return t}function Ce(e){let t=e.match(/\b(?:coverage\D{0,24})?((?:100(?:\.0+)?|\d{1,2}(?:\.\d+)?))\s*(?:%|percent(?:age)?(?:\s+points?)?)/i);if(!t||!/coverage/i.test(e))return null;let n=Number(t[1]);return Number.isFinite(n)&&n>=0&&n<=100?n:null}var ne=[{runtime:"cpp",patterns:[/\bc\+\+/i,/\bcpp\b/i]},{runtime:"dotnet",patterns:[/\.net\b/i,/\bdotnet\b/i,/\bc#/i,/\bcsharp\b/i]},{runtime:"node",patterns:[/\bnode(?:\.js)?\b/i,/\btypescript\b/i,/\bjavascript\b/i,/\b(?:js|ts)\b/i]},{runtime:"python",patterns:[/\bpython\b/i,/\bpytest\b/i]},{runtime:"go",patterns:[/\bgolang\b/i,/\bgo(?:\s+(?:test|coverage|tests))\b/i]},{runtime:"java",patterns:[/\bjava\b/i,/\bjunit\b/i,/\bjacoco\b/i]},{runtime:"rust",patterns:[/\brust\b/i,/\bcargo\b/i]},{runtime:"php",patterns:[/\bphp\b/i,/\bphpunit\b/i]},{runtime:"ruby",patterns:[/\bruby\b/i,/\brspec\b/i]},{runtime:"kotlin",patterns:[/\bkotlin\b/i]},{runtime:"scala",patterns:[/\bscala\b/i]},{runtime:"clojure",patterns:[/\bclojure\b/i]},{runtime:"elixir",patterns:[/\belixir\b/i]},{runtime:"deno",patterns:[/\bdeno\b/i]},{runtime:"bun",patterns:[/\bbun\b/i]},{runtime:"c",patterns:[/\bc(?:\s+(?:test|coverage|tests|code))\b/i]}];function Ae(e){return ne.filter(t=>t.patterns.some(n=>n.test(e))).map(t=>t.runtime)}function K(e,t={}){let n=Ge(e),r=je.filter(u=>u.patterns.some(j=>j.test(n))).map(u=>u.category),a=r.some(u=>u!=="feature-change")?r.filter(u=>u!=="feature-change"):r,s=a[0]??"feature-change",l=Ce(n),d=Ae(n),p=d.length===0&&t.selectedCoverageRuntime?[t.selectedCoverageRuntime]:d,m=[...new Set((t.availableCoverageRuntimes??[]).filter(u=>ne.some(j=>j.runtime===u)))].sort(),b=[];return a.length>1&&a[0]!=="test-coverage"&&b.push(`The intent also contains signals for: ${a.slice(1).join(", ")}.`),s==="test-coverage"&&l===null&&b.push("A numeric test coverage target is required for machine verification."),s==="test-coverage"&&p.length>1&&b.push(`The Goal names multiple coverage runtimes: ${p.join(", ")}. Select one runtime per Goal.`),s==="test-coverage"&&p.length===0&&m.length>1&&b.push(`Coverage scope is ambiguous across detected runtimes: ${m.join(", ")}. Name one runtime or language in the Goal.`),s==="test-coverage"&&p.length===1&&m.length>0&&!m.includes(p[0])&&b.push(`The requested ${p[0]} coverage runtime is not present in the selected scope. Detected runtimes: ${m.join(", ")}.`),{original:n,normalized:n.toLocaleLowerCase("en-US"),statement:n.replace(/[.!?]+$/,""),category:s,confidence:a.length===1?"high":a.length>1?"medium":"low",ambiguities:b,...l===null?{}:{requestedTarget:{metric:"test-coverage-percent",operator:"at-least",value:l,...p.length===1?{runtime:p[0]}:{}}}}}function oe(e){let t={"test-coverage":["test suite coverage configuration instrumentation","CI tests LCOV Cobertura JaCoCo LLVM coverage"],"dependency-security":["dependency manifest lockfile security audit vulnerability"],"release-readiness":["release pipeline readiness gates build test deploy"],"defect-repair":["failure error test implementation call path"],"feature-change":["API implementation module dependency tests"],refactor:["module dependency ownership implementation tests"],performance:["performance benchmark latency throughput runtime"],documentation:["documentation README guide architecture decision"],"system-understanding":["architecture service API dependency ownership"]};return [...new Set([e.statement,...t[e.category]])].slice(0,3)}var ae="contracts/workspace-intelligence/goal-pack.v1.json",se="contracts/workspace-intelligence/goal-agent-handoff.v1.json",Re="contracts/workspace-intelligence/goal-plan-result.v1.json",pe="contracts/workspace-intelligence/goal-index.v1.json",ue=new Set(["node","bun","deno","python","go","java","dotnet","rust","php","ruby","elixir","clojure","scala","kotlin","c","cpp"]);function Se(e,t){let n=e.match(/[A-Za-z0-9][A-Za-z0-9+#.%_-]*/g)??[],r=new Set(t.map(m=>m.toLocaleLowerCase("en-US").replace(/[^a-z0-9]/g,"")).filter(Boolean)),a=[];for(let m=0;m<n.length;){let b=0;for(let u=Math.min(4,n.length-m);u>=1;u-=1){let j=n.slice(m,m+u).join("").toLocaleLowerCase("en-US").replace(/[^a-z0-9]/g,"");if(r.has(j)){b=u;break}}if(b>0){m+=b;continue}a.push(n[m]),m+=1;}let s=a.findIndex((m,b)=>{let u=m.toLocaleLowerCase("en-US"),j=a[b+1]?.toLocaleLowerCase("en-US");return u==="without"&&["breaking","changing","modifying","removing"].includes(j??"")||u==="while"&&["keeping","maintaining","preserving"].includes(j??"")}),l=s>=2?a.slice(0,s):a,d=l.length>=2?l.join(" "):e;if(s<2)return [d];let p=a.slice(s).filter(m=>!["without","while","breaking","changing","modifying","removing","keeping","maintaining","preserving"].includes(m.toLocaleLowerCase("en-US")));return p.length>0?[d,p.join(" ")]:[d]}function ie(e){return e.split(C.sep).join("/")}function V(e,t){return C.resolve(t.absolutePath??C.join(e,t.path))}function ce(e){let t=e.requested.trim().replace(/^project:/,"");if(!t)throw new Error("Project goal scope must name a project.");let n=C.isAbsolute(t)?C.resolve(t):null,r=e.model.projects.filter(a=>a.name===t||ie(a.path)===ie(t)||n!==null&&V(e.workspacePath,a)===n);if(r.length!==1)throw new Error(r.length===0?`Project goal scope was not found in the canonical model: ${t}`:`Project goal scope is ambiguous in the canonical model: ${t}`);return r[0]}async function Ee(e){let t=await a$1(e);if(t.status==="miss")throw new Error(`Canonical model and live graph evidence are required (${t.reason}). Run \`workspai workspace intelligence run --for-agent generic --strict --json\` or retry with --refresh.`);let{model:n,graph:r}=t;return a(n,"contracts/workspace-intelligence/workspace-model.v1.json","Goal source model"),a(r,"contracts/workspace-intelligence/workspace-knowledge-graph.v1.json","Goal source graph"),b$1(r,n),{model:n,graph:r}}function le(e){let t=e.scope.trim();if(t==="workspace")return {kind:"workspace",projects:e.model.projects.map(r=>r.name).sort(),selectionSource:e.selectionSource,resolution:"selected"};let n=t.startsWith("projects:")?"projects:":t.startsWith("project:")&&t.slice(8).includes(",")?"project:":null;if(n){let r=t.slice(n.length).split(",").map(l=>l.trim()).filter(Boolean);if(r.length<2)throw new Error("A project-set Goal scope must name at least two projects.");let a=r.map(l=>ce({workspacePath:e.workspacePath,model:e.model,requested:l})),s=[...new Set(a.map(l=>l.name))].sort();if(s.length!==r.length)throw new Error("A project-set Goal scope must not contain duplicate projects.");return {kind:"project-set",projects:s,selectionSource:e.selectionSource,resolution:"selected"}}if(t)return {kind:"project",projects:[ce({workspacePath:e.workspacePath,model:e.model,requested:t}).name],selectionSource:e.selectionSource,resolution:"selected"};throw new Error("Goal scope cannot be empty.")}async function Ie(e){if(e.explicitScope?.trim())return {scope:le({workspacePath:e.workspacePath,model:e.model,scope:e.explicitScope,selectionSource:"explicit"}),selectionRequired:false};if(e.invocationProjectPath){let t=C.resolve(e.invocationProjectPath),n=e.model.projects.filter(r=>V(e.workspacePath,r)===t);if(n.length!==1)throw new Error("The invocation project is not represented uniquely in the canonical workspace model. Refresh intelligence or pass --scope explicitly.");return {scope:{kind:"project",projects:[n[0].name],selectionSource:"invocation-project",resolution:"selected"},selectionRequired:false}}if(e.model.projects.length===1)return {scope:{kind:"project",projects:[e.model.projects[0].name],selectionSource:"single-project-workspace",resolution:"selected"},selectionRequired:false};if(e.selectScope){let t=await e.selectScope({workspaceName:e.model.workspace.name,projects:e.model.projects.map(r=>({name:r.name,runtime:r.runtime,runtimeCandidates:[...r.runtimeCandidates].sort(),framework:r.framework})).sort((r,a)=>r.name.localeCompare(a.name))}),n=t.kind==="workspace"?"workspace":t.projects.length===1?`project:${t.projects[0]}`:`projects:${t.projects.join(",")}`;return {scope:le({workspacePath:e.workspacePath,model:e.model,scope:n,selectionSource:"interactive"}),selectionRequired:false}}return {scope:{kind:"workspace",projects:e.model.projects.map(t=>t.name).sort(),selectionSource:"workspace",resolution:"selection-required"},selectionRequired:true}}function xe(e,t){if(t.kind==="workspace")return {entities:e.quality.entityCount,relationships:e.quality.relationCount,proofs:e.quality.proofCount,unresolved:e.quality.unknownCount,proofCoveragePercent:Number((e.quality.relationProofCoverageRatio*100).toFixed(2))};let n=new Set(t.projects),r=e.entities.filter(p=>p.projectId!==void 0&&n.has(p.projectId)),a=new Set(r.map(p=>p.id)),s=e.relations.filter(p=>a.has(p.from)||a.has(p.to)),l=new Set([...r.flatMap(p=>p.proofIds),...s.flatMap(p=>p.proofIds)]),d=s.filter(p=>p.proofIds.length>0).length;return {entities:r.length,relationships:s.length,proofs:l.size,unresolved:s.length-d,proofCoveragePercent:s.length===0?100:Number((d/s.length*100).toFixed(2))}}function Te(e){let t=new Map;for(let r of e){let a=t.get(r.kind)??[];a.push(r),t.set(r.kind,a);}let n=[];for(let r=0;[...t.values()].some(a=>r<a.length);r+=1)for(let a of t.values()){let s=a[r];s&&n.push(s);}return n}async function _e(e$1){let t=C.join(e$1.workspacePath,e.intelligenceRun),n=await _.readJson(t).catch(()=>null),a=(Array.isArray(n?.stages)?n.stages:[]).filter(o=>o.status==="blocked"||o.status==="failed").map(o=>String(o.id??"unknown")).sort(),s=n?.status,l={status:s==="passed"?"passed":s==="blocked"||s==="failed"?"blocked":"unknown",artifact:e.intelligenceRun,blockedStages:a},d={status:"not-applicable",runtime:null,runtimeChoices:[],runner:null,existingEvidence:[],prerequisites:[]};if(e$1.intent.category==="test-coverage"){let o=e$1.intent.requestedTarget?.runtime;if(e$1.intent.ambiguities.some(P=>P.startsWith("Coverage scope is ambiguous")||P.startsWith("The Goal names multiple coverage runtimes")||P.startsWith("The selected projects do not share a common canonical coverage runtime")||P.startsWith("The requested ")))d={status:"requires-setup",runtime:o??null,runtimeChoices:e$1.coverageRuntimeChoices,runner:null,existingEvidence:[],prerequisites:["Select exactly one detected runtime or language for this coverage Goal."]};else {let P=o?e$1.projects.filter(c=>c.runtimeCandidates.includes(o)):e$1.projects,i=await Promise.all(P.map(async c=>({project:c,capability:await c$4(V(e$1.workspacePath,c),o??(ue.has(c.runtime)?c.runtime:"unknown"))}))),h=i.map(c=>c.capability.status);d={status:h.includes("unsupported")?"unsupported":h.includes("requires-setup")?"requires-setup":"available",runtime:i.length===1?i[0].capability.runtime:[...new Set(i.map(c=>c.capability.runtime))].join(","),runtimeChoices:e$1.coverageRuntimeChoices,runner:i.length===1?i[0].capability.runner:[...new Set(i.flatMap(c=>c.capability.runner?[c.capability.runner]:[]))].join(",")||null,existingEvidence:i.flatMap(c=>c.capability.existingEvidence.map(A=>({project:c.project.name,...A}))).filter((c,A,w)=>w.findIndex(k=>k.project===c.project&&k.path===c.path&&k.sha256===c.sha256)===A).sort((c,A)=>c.project.localeCompare(A.project)||c.path.localeCompare(A.path)),prerequisites:[...new Set(i.flatMap(c=>c.capability.prerequisites))].sort()};}}let p=oe(e$1.intent),m=[...Se(p[0],e$1.projects.map(o=>o.name)),...p.slice(1)].filter((o,y,P)=>P.indexOf(o)===y).slice(0,3),b=m.map((o,y)=>{let P=o.match(/[A-Za-z0-9][A-Za-z0-9+#.%_-]*/g)?.length??0,i=y===0&&P>=4?2:1,h=e$1.projects.map(w=>{let k=G=>f$3(e$1.graph,{query:o,projectId:w.name,...G?{kind:G}:{},limit:60,relationsPerEntity:0,minimumTermMatches:i}).entities,S=k(),de=[...new Set(e$1.graph.entities.filter(G=>G.projectId===w.name||G.projectId===void 0&&G.identity.scope==="workspace").map(G=>G.kind))].flatMap(G=>k(G).slice(0,8)),U=[...S,...de];return U.filter((G,me)=>U.findIndex(ge=>ge.id===G.id)===me)}),c=[],A=new Set;for(let w=0;h.some(k=>w<k.length);w+=1)for(let k of h){let S=k[w];!S||A.has(S.id)||(A.add(S.id),c.push(S));}return Te(c)}),u={"test-coverage":["test-suite"],"dependency-security":["package","module"],"release-readiness":["pipeline","deployment","lifecycle-stage"],"defect-repair":["test-suite","lifecycle-stage"],"feature-change":["project","runtime-unit","api","package","module","test-suite"],refactor:["package","module","api","test-suite"],performance:["lifecycle-stage","test-suite","pipeline"],documentation:["document","decision"],"system-understanding":["project","service","api","package","protocol"]},j=new Set(e$1.projects.map(o=>o.name)),v=e$1.graph.entities.filter(o=>o.proofIds.length>0&&(!o.projectId||j.has(o.projectId))&&u[e$1.intent.category].includes(o.kind)).sort((o,y)=>u[e$1.intent.category].indexOf(o.kind)-u[e$1.intent.category].indexOf(y.kind)||o.label.localeCompare(y.label)),f=[],M=new Set,E=o=>{!o||f.length>=20||M.has(o.id)||(M.add(o.id),f.push(o));},I=(e$1.intent.statement.match(/[A-Za-z][A-Za-z0-9+#.-]{1,}/g)??[]).length>=2,g=I?b[0]??[]:[];for(let o of g.slice(0,12))E(o);if(!I)for(let o of v)E(o);for(let o=0;f.length<20&&b.slice(1).some(y=>o<y.length);o+=1)for(let y of b.slice(1))E(y[o]);if(I)for(let o of v)E(o);for(let o of g.slice(12))E(o);let x=f.map(o=>({entityId:o.id,kind:o.kind,label:o.label,proofIds:o.proofIds.slice(0,12)})),L=b[0]?.length??0;return {workspaceIntelligence:l,measurement:d,retrieval:{status:I&&L>=3?"grounded":x.length>0?"partial":"empty",strategy:"deterministic-category-v1",queries:m,anchors:x}}}async function Le(e){let t=C.join(e,f$2);if(!await _.pathExists(t))return {schemaVersion:e$1,generatedAt:new Date(0).toISOString(),activeGoalId:null,goals:[]};let n=await _.readJson(t);a(n,pe,"Goal index");try{i(n);}catch(r){let a=h(n);if(!(a!==null&&r instanceof Error&&r.message==="Goal index is inconsistent: activeGoalId must identify the only selected actionable lifecycle entry.")||!a)throw r;return a}return n}function Ne(e,t,n){let r=e.goals.find(l=>l.id===t.id),a=t.state==="ready-to-plan",s={id:t.id,fingerprint:t.fingerprint,objective:t.intent.statement,category:t.intent.category,state:t.state,lifecycle:r?.lifecycle==="cancelled"?"cancelled":a?"active":"planned",scope:t.scope,createdAt:r?.createdAt??t.generatedAt,updatedAt:n,goalPack:t.artifacts.goalPack,agentHandoff:t.artifacts.agentHandoff,...r?.verifiedGoalId?{verifiedGoalId:r.verifiedGoalId}:{},...r?.repairTransactionId?{repairTransactionId:r.repairTransactionId}:{},...r?.repairTransactionIds?{repairTransactionIds:r.repairTransactionIds}:{},...r?.verificationReceipt?{verificationReceipt:r.verificationReceipt}:{}};return {schemaVersion:e$1,generatedAt:n,activeGoalId:s.lifecycle==="active"?t.id:e.activeGoalId===t.id?null:e.activeGoalId,goals:[...e.goals.filter(l=>l.id!==t.id).map(l=>s.lifecycle==="active"&&l.lifecycle==="active"?{...l,lifecycle:"planned",updatedAt:n}:l),s].sort((l,d)=>l.id.localeCompare(d.id))}}async function et(e$1){let t=b({startPath:C.resolve(e$1.startPath),explicitWorkspacePath:e$1.workspacePath,strict:true,requireProjectMembership:true});if(!t)throw new Error("No canonical Workspai workspace could be resolved.");let n=C.resolve(t.workspacePath);e$1.refresh&&await c({workspacePath:n,strict:false,agent:"generic"});let{model:r,graph:a$1}=await Ee(n),s=await Ie({workspacePath:n,invocationProjectPath:t.projectPath,model:r,explicitScope:e$1.scope,selectScope:e$1.selectScope}),l=s.scope,d$2=r.projects.filter(i=>l.projects.includes(i.name));if(d$2.length===0)throw new Error("A Goal Pack requires at least one registered project in its selected scope.");let p=e$1.maxAttempts??5;if(!Number.isInteger(p)||p<1||p>25)throw new Error("--max-attempts must be an integer from 1 to 25.");let m=new Date().toISOString(),b$1=d(r),u=d$2.map(i=>({name:i.name,runtimes:[...new Set(i.runtimeCandidates.filter(h=>ue.has(h)))].sort()})),j$1=[...new Set(u.flatMap(i=>i.runtimes))].sort(),v=u.length<=1?j$1:u[0].runtimes.filter(i=>u.every(h=>h.runtimes.includes(i))),f$3=K(e$1.intent,{availableCoverageRuntimes:v,...e$1.runtime?{selectedCoverageRuntime:e$1.runtime}:v.length===1?{selectedCoverageRuntime:v[0]}:{}});if(e$1.runtime&&!v.includes(e$1.runtime)){let i=e$1.runtime,h=u.filter(c=>!c.runtimes.includes(i)).map(c=>c.name);throw new Error(d$2.length>1&&h.length>0?`--runtime ${e$1.runtime} is not canonical for every project in the selected Goal scope. Missing from: ${h.join(", ")}. Split the projects into runtime-compatible Goal scopes.`:`--runtime ${e$1.runtime} is not present in the canonical Workspace Model for the selected Goal scope. Available runtimes: ${v.join(", ")||"none"}.`)}if(e$1.runtime&&f$3.category!=="test-coverage")throw new Error("--runtime is valid only for a test-coverage Goal.");if(e$1.runtime&&f$3.requestedTarget?.runtime&&f$3.requestedTarget.runtime!==e$1.runtime)throw new Error(`--runtime ${e$1.runtime} conflicts with the ${f$3.requestedTarget.runtime} runtime named in the Goal intent.`);if(!s.selectionRequired&&f$3.category==="test-coverage"&&f$3.requestedTarget&&!f$3.requestedTarget.runtime&&v.length>1&&!e$1.runtime&&e$1.selectCoverageRuntime){let i=await e$1.selectCoverageRuntime({workspaceName:r.workspace.name,scope:l,projects:d$2.map(h=>({name:h.name,runtime:h.runtime,runtimeCandidates:[...h.runtimeCandidates].sort()})),runtimes:v});if(!v.includes(i))throw new Error("The selected coverage runtime is outside the canonical Goal scope.");f$3=K(e$1.intent,{availableCoverageRuntimes:v,selectedCoverageRuntime:i});}!s.selectionRequired&&f$3.category==="test-coverage"&&d$2.length>1&&v.length===0&&(f$3={...f$3,ambiguities:[`The selected projects do not share a common canonical coverage runtime: ${u.map(i=>`${i.name} (${i.runtimes.join(", ")||"none"})`).join("; ")}. Split them into runtime-compatible Goal scopes so every selected project is verified.`,...f$3.ambiguities]}),s.selectionRequired&&(f$3={...f$3,ambiguities:[`Goal scope is unresolved across ${l.projects.length} registered projects: ${l.projects.join(", ")}. Select one project, multiple projects, or the entire workspace.`,...f$3.ambiguities]});let M=await _e({workspacePath:n,projects:d$2,graph:a$1,intent:f$3,coverageRuntimeChoices:v}),E={generatedAt:m,intent:f$3,workspaceName:r.workspace.name,scope:l,sourceBinding:{model:{artifact:e.model,schemaVersion:f.model,hashAlgorithm:"sha256",hashSemantics:"workspace-model-structural-v1",hash:b$1,generatedAt:r.generatedAt},graph:{artifact:e.knowledgeGraph,schemaVersion:f.knowledgeGraph,hashAlgorithm:"sha256",hashSemantics:"canonical-json-v1",hash:c$1(a$1),generatedAt:a$1.generatedAt,modelHash:a$1.source.hash,...a$1.source.inputs?.hash?{inputHash:a$1.source.inputs.hash}:{}}},preflight:M,baseline:{projectCount:d$2.length,runtimes:[...new Set(d$2.flatMap(i=>i.runtimeCandidates))].sort(),frameworks:[...new Set(d$2.map(i=>i.framework))].sort(),graph:xe(a$1,l)},maxAttempts:p,consumer:e$1.consumer??"generic"},I={digestCanonical:c$1},{goalPack:g,handoff:x}=j(E,I);a(g,ae,"Goal Pack"),a(x,se,"Goal agent handoff");let L=false,o=async()=>{let i=C.join(n,g.artifacts.goalPack),h=C.join(n,g.artifacts.agentHandoff),[c,A]=await Promise.all([_.pathExists(i),_.pathExists(h)]);if(c!==A)throw new Error(`Goal Pack instance is incomplete and cannot be resumed: ${g.id}`);if(!c)return;let[w,k]=await Promise.all([_.readJson(i),_.readJson(h)]);a(w,ae,"Persisted Goal Pack"),a(k,se,"Persisted goal agent handoff");let S=j({...E,generatedAt:w.generatedAt,sourceBinding:w.sourceBinding},I);if(w.id!==g.id||k.goalId!==g.id||c$1(w)!==c$1(S.goalPack)||c$1(k)!==c$1(S.handoff))throw new Error(`Goal Pack instance failed immutable integrity validation: ${g.id}`);g=w,x=k,L=true;};if(e$1.dryRun)await o();else {let i$1=`.workspai/goals/${g.id}/publication`;await c$2(n,i$1,async()=>{await o();let h=Ne(await Le(n),g,new Date().toISOString());a(h,pe,"Goal index"),i(h),await f$1(n,d$1,L?[{relativePath:d$1,payload:g},{relativePath:f$2,payload:h}]:[{relativePath:g.artifacts.goalPack,payload:g},{relativePath:g.artifacts.agentHandoff,payload:x},{relativePath:d$1,payload:g},{relativePath:f$2,payload:h}]);});}let y=[g.artifacts.goalPack,g.artifacts.agentHandoff,d$1,f$2],P={schemaVersion:c$3,result:g.state==="needs-confirmation"?"needs-confirmation":g.state==="blocked"?"blocked":g.state==="needs-evidence"?"needs-evidence":"planned",resolution:{source:t.source,invocationScope:t.projectPath?"project":"workspace"},goalPack:g,agentHandoff:x,writtenArtifacts:e$1.dryRun?[]:L?[d$1,f$2]:y,dryRun:e$1.dryRun===true,resumed:L};return a(P,Re,"Goal plan result"),P}export{et as planGoalPack};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import {c}from'./chunk-5YZ2W57R.js';import {r}from'./chunk-2C5XJBYI.js';import {a as a$2}from'./chunk-VIN7NJW3.js';import {c as c$1}from'./chunk-LPCWROQ3.js';import {a as a$3}from'./chunk-P3622IM5.js';import {g}from'./chunk-3XF7O66C.js';import {f,e as e$1}from'./chunk-KY2GOSO5.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-C2VTO5WT.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-MQ3QE52V.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-T3MJO2MX.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
|
-
\u{1F517} Workspai Governance Pipeline
|
|
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
|
-
Blocking reasons:`));for(let t of a.blockingReasons.slice(0,8))console.log(c$2.gray(` \u2022 ${t}`));}console.log(c$2.gray(`
|
|
5
|
-
Evidence: ${a.artifacts.reportPath}`)),a.agentGrounding?.writtenFiles.length&&console.log(c$2.gray(`Agent grounding: ${a.agentGrounding.writtenFiles.length} file(s) synced (INDEX + AGENTS.md + Copilot/Cursor/Claude hooks)`));}let i=K(a.summary.exitCode,s.strict===true);i!==0&&process.exit(i);}export{K as pipelineProcessExitCode,U as runPipeline,ue as runPipelineCommand};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {c}from'./chunk-BG6IX6HA.js';import {d as d$1}from'./chunk-3Z4SVBMR.js';import {a as a$2}from'./chunk-5XUAAQSV.js';import {a as a$1}from'./chunk-P3622IM5.js';import {q as q$1}from'./chunk-2KX6KHEC.js';import {a as a$3}from'./chunk-GR6442P7.js';import {e as e$1,d}from'./chunk-C2VTO5WT.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 +0,0 @@
|
|
|
1
|
-
export{b as buildWorkspaceExplain,a as resolveWorkspaceExplainArtifactPath,c as writeWorkspaceExplainReport}from'./chunk-7DDEMDG2.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-3KU3YUWD.js';
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
export{a as WORKSPACE_GRAPH_TOKEN_EFFICIENCY_SCHEMA_VERSION,b as buildWorkspaceGraphTokenEfficiencyReport}from'./chunk-3BMYMZQB.js';
|
|
@@ -1 +0,0 @@
|
|
|
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';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-FB7SCXAZ.js';import {createHash}from'crypto';function f(n){return Array.isArray(n)?`[${n.map(f).join(",")}]`:n&&typeof n=="object"?`{${Object.entries(n).sort(([r],[d])=>r.localeCompare(d)).map(([r,d])=>`${JSON.stringify(r)}:${f(d)}`).join(",")}}`:JSON.stringify(n)}function y(n){return createHash("sha256").update(f({entities:n.entities,relations:n.relations,proofs:n.proofs.map(({observedAt:r,freshness:d,...t})=>t)})).digest("hex")}function A(n,r){return [...new Set([...Object.keys(n),...Object.keys(r)])].filter(d=>f(n[d])!==f(r[d])).sort()}function h(n,r){let d=new Map(n.map(a=>[a.id,a])),t=new Map(r.map(a=>[a.id,a])),s=r.filter(a=>!d.has(a.id)),o=n.filter(a=>!t.has(a.id)),g=[];for(let[a,i]of d){let c=t.get(a);if(!c)continue;let p=A(i,c);p.length>0&&g.push({id:a,before:i,after:c,changedFields:p});}return {added:[...s].sort((a,i)=>a.id.localeCompare(i.id)),removed:[...o].sort((a,i)=>a.id.localeCompare(i.id)),changed:g.sort((a,i)=>a.id.localeCompare(i.id))}}function K(n){return {...n,observedAt:"1970-01-01T00:00:00.000Z",freshness:"fresh"}}function C(n,r){let d=h(n.map(K),r.map(K)),t=new Map(n.map(o=>[o.id,o])),s=new Map(r.map(o=>[o.id,o]));return {added:d.added.map(o=>s.get(o.id)??o),removed:d.removed.map(o=>t.get(o.id)??o),changed:d.changed.map(o=>({id:o.id,before:t.get(o.id),after:s.get(o.id),changedFields:o.changedFields}))}}function W(n,r){let d=new Set(r);return n.proofs.filter(t=>d.has(t.id)).map(t=>t.artifact)}function O(n,r,d=new Date){let t=h(n.entities,r.entities),s=h(n.relations,r.relations),o=C(n.proofs,r.proofs),g=new Set([...t.added.map(e=>e.id),...t.removed.map(e=>e.id),...t.changed.map(e=>e.id)]),a$1=[...s.added,...s.removed,...s.changed.flatMap(e=>[e.before,e.after].filter(Boolean))];for(let e of a$1)g.add(e.from),g.add(e.to);let i=new Set(g);for(let e of [...n.relations,...r.relations])(g.has(e.from)||g.has(e.to))&&(i.add(e.from),i.add(e.to));let c=new Set([...o.added.map(e=>e.id),...o.removed.map(e=>e.id),...o.changed.map(e=>e.id)]);for(let e of [...t.added,...t.removed])e.proofIds.forEach(l=>c.add(l));for(let e of t.changed)e.before?.proofIds.forEach(l=>c.add(l)),e.after?.proofIds.forEach(l=>c.add(l));for(let e of a$1)e.proofIds.forEach(l=>c.add(l));let p=[...new Set([...W(n,c),...W(r,c),...o.added.map(e=>e.artifact),...o.removed.map(e=>e.artifact),...o.changed.flatMap(e=>[e.before?.artifact,e.after?.artifact])])].filter(e=>!!e).sort(),m=t.removed.length+s.removed.length+o.removed.length,w=m+t.added.length+t.changed.length+s.added.length+s.changed.length+o.added.length+o.removed.length+o.changed.length,u=w===0?"none":m>0||i.size>=10?"high":i.size>=5||w>=5?"medium":"low";return {schemaVersion:a,generatedAt:d.toISOString(),workspace:r.workspace,base:{schemaVersion:n.schemaVersion,generatedAt:n.generatedAt,fingerprint:y(n)},head:{schemaVersion:r.schemaVersion,generatedAt:r.generatedAt,fingerprint:y(r)},entities:t,relations:s,proofs:o,impactedEntityIds:[...i].sort(),changedArtifacts:p,summary:{entityAdds:t.added.length,entityRemovals:t.removed.length,entityChanges:t.changed.length,relationAdds:s.added.length,relationRemovals:s.removed.length,relationChanges:s.changed.length,proofAdds:o.added.length,proofRemovals:o.removed.length,proofChanges:o.changed.length,impactedEntities:i.size,changedArtifacts:p.length,risk:u}}}export{O as buildWorkspaceKnowledgeGraphChangeOverlay};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as readWorkspaceKnowledgeGraphSnapshot}from'./chunk-3NF3M3RE.js';
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import {b}from'./chunk-7DDEMDG2.js';import {d,c as c$2,f as f$1,e as e$2}from'./chunk-BMAFHX6A.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-CSZPE637.js';import {d as d$2}from'./chunk-WRZSQDZV.js';import {b as b$1}from'./chunk-LEOFD3W5.js';import {l}from'./chunk-2KX6KHEC.js';import {h}from'./chunk-TCLKGPXF.js';import {d as d$1}from'./chunk-C2VTO5WT.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as runWorkspaceStage}from'./chunk-5XUAAQSV.js';export{a as WORKSPACE_RUN_LAST_REPORT_FILENAME}from'./chunk-EHLGPLIU.js';
|