workspai 0.67.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-activity-board.v1.json +6 -0
- package/contracts/workspace-activity-event.v1.json +31 -1
- package/contracts/workspace-activity-monitor-snapshot.v1.json +35 -2
- 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/contracts/workspace-intelligence/workspace-knowledge-search.v1.json +1 -0
- package/dist/analyze-GPYPXXRT.js +1 -0
- package/dist/{artifact-remediation-plan-GFFHC2ZU.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-25AWHAB5.js +2 -0
- package/dist/chunk-2LZWBUJD.js +1 -0
- package/dist/{chunk-KENOAC2Q.js → chunk-37ZLNFV5.js} +2 -2
- package/dist/{chunk-CZVT7T2X.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-NVND4727.js → chunk-46QH3ZVI.js} +1 -1
- package/dist/{chunk-B4IVVTMQ.js → chunk-64XWHDZ3.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-5OA33JH2.js → chunk-D5LLTUTY.js} +1 -1
- package/dist/{chunk-4WVOAX2V.js → chunk-DWL3PPLA.js} +1 -1
- package/dist/{chunk-H77ZNH5O.js → chunk-EBEAJIBI.js} +1 -1
- package/dist/chunk-EBQS5T7Q.js +7 -0
- package/dist/{chunk-VI4ZRAY6.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-SRLWHOLF.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-2RPFCBS4.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-L5Q2S5GY.js → chunk-KFTJVVJR.js} +1 -1
- package/dist/chunk-LDBULT2T.js +4 -0
- package/dist/{chunk-THIG2YQP.js → chunk-M37ALD4V.js} +1 -1
- package/dist/{chunk-HQLBO23O.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-KQ2TMI26.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-TABXSDTR.js → chunk-PKKSRXUS.js} +1 -1
- 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-W37NOQVG.js +1 -0
- package/dist/chunk-W6WRT77T.js +1 -0
- package/dist/chunk-WHR5SL33.js +4 -0
- package/dist/{chunk-HYE5UHPV.js → chunk-WZ5V5U2K.js} +1 -1
- package/dist/chunk-XPGCFVGC.js +4 -0
- package/dist/chunk-YKY4JFCF.js +1 -0
- package/dist/{chunk-VWBMDGPY.js → chunk-YWZBGSFE.js} +3 -3
- package/dist/chunk-YZL7ZY7J.js +2 -0
- package/dist/{create-72ITVZXV.js → create-GWBQ74ZI.js} +1 -1
- package/dist/{demo-kit-5UQH2OXC.js → demo-kit-RKTHTXHJ.js} +1 -1
- package/dist/doctor-OQAXSMEM.js +1 -0
- package/dist/{dotnet-webapi-clean-YEHYIGOT.js → dotnet-webapi-clean-XL4IBUQV.js} +1 -1
- package/dist/goal-lifecycle-YWBVQ2DF.js +1 -0
- package/dist/goal-pack-KUXPZVNO.js +1 -0
- package/dist/{gofiber-standard-C44IIQYH.js → gofiber-standard-OHHMCNMJ.js} +1 -1
- package/dist/{gogin-standard-X7VKACVR.js → gogin-standard-BAZXPOKL.js} +1 -1
- package/dist/index.d.ts +35 -2
- package/dist/index.js +239 -239
- package/dist/{live-command-5VXPR43F.js → live-command-GNAASZ7U.js} +1 -1
- package/dist/pipeline-PGB5TEV3.js +5 -0
- package/dist/{project-agent-entry-5IUBEREI.js → project-agent-entry-H3JAGNLS.js} +1 -1
- package/dist/{project-intelligence-lens-LQCN65P2.js → project-intelligence-lens-7NMKHV5N.js} +1 -1
- package/dist/{project-test-coverage-KD4LLFGV.js → project-test-coverage-3DKZKLWY.js} +1 -1
- package/dist/proof-carrying-change-QFH7WI2E.js +1 -0
- package/dist/{rust-axum-JKZTZDRZ.js → rust-axum-CCJ6UCBW.js} +1 -1
- package/dist/{springboot-standard-PI4FLTAN.js → springboot-standard-M5JQEJML.js} +1 -1
- package/dist/verified-goal-7XHRWYSE.js +1 -0
- package/dist/{workspace-5W7FYGDQ.js → workspace-TJHCETBV.js} +1 -1
- package/dist/{workspace-agent-sync-OZCDQORK.js → workspace-agent-sync-Z35NTXCB.js} +1 -1
- package/dist/{workspace-archive-NOSGRKRZ.js → workspace-archive-OSMU3CK6.js} +1 -1
- package/dist/{workspace-context-L65BR5L6.js → workspace-context-KNJQUJWC.js} +1 -1
- package/dist/{workspace-contract-JYHNEJPV.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-MWGCT5R2.js → workspace-feedback-YSPEGCON.js} +1 -1
- package/dist/{workspace-foundation-VIB3PXNH.js → workspace-foundation-PLXFPI3J.js} +1 -1
- package/dist/{workspace-graph-stream-45JHE4MG.js → workspace-graph-stream-FNRQ2FTB.js} +1 -1
- package/dist/workspace-graph-token-efficiency-WNAFAN2F.js +1 -0
- package/dist/{workspace-history-JKW3VJO3.js → workspace-history-HDDFG6LH.js} +1 -1
- package/dist/{workspace-intelligence-3C47PK4L.js → workspace-intelligence-QLSD5EEV.js} +1 -1
- package/dist/{workspace-intelligence-benchmark-SRDIHX3X.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-OWN5ZI6W.js → workspace-intelligence-runner-4EW4T2OW.js} +1 -1
- package/dist/workspace-intelligence-runtime-registry-ZLPF7BAY.js +1 -0
- package/dist/{workspace-knowledge-graph-AKG5NUU6.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-DXA4CROE.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-R4ISKDB2.js → workspace-model-NCOOY5LC.js} +1 -1
- package/dist/{workspace-onboarding-Y5RPEFUD.js → workspace-onboarding-JNC7ZFMR.js} +1 -1
- package/dist/{workspace-readme-PL5V3UDH.js → workspace-readme-OV2ADTLW.js} +2 -2
- package/dist/{workspace-registry-summary-STGUGROG.js → workspace-registry-summary-ONT4VOJX.js} +1 -1
- package/dist/{workspace-repair-engine-FNLL5ZDK.js → workspace-repair-engine-WMJCYWO4.js} +2 -2
- package/dist/workspace-run-3S35MDX6.js +1 -0
- package/dist/{workspace-verify-AXVX3PF3.js → workspace-verify-MLABQUWK.js} +1 -1
- package/dist/{workspace-watch-RLBEJKXE.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 +26 -1
- 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/contracts/README.md +1 -1
- package/docs/proof-carrying-change.implementation.v1.json +118 -0
- package/docs/proof-carrying-change.md +202 -0
- package/docs/workspace-knowledge-graph.md +1 -0
- package/docs/workspace-live-activity.md +18 -4
- package/package.json +1 -1
- package/dist/analyze-IC2KRVCG.js +0 -1
- package/dist/autopilot-release-RECEZAZI.js +0 -1
- package/dist/capabilities-command-X4WZIJNR.js +0 -1
- package/dist/chunk-2M62CU3O.js +0 -2
- package/dist/chunk-2MVIRJJR.js +0 -1
- package/dist/chunk-3O7LZPKA.js +0 -4
- package/dist/chunk-3OGPTLI2.js +0 -1
- package/dist/chunk-4RV4JVGR.js +0 -6
- package/dist/chunk-5EVDW7JM.js +0 -1
- package/dist/chunk-5ME4W4LN.js +0 -1
- package/dist/chunk-5TY74LLW.js +0 -2
- package/dist/chunk-6254CWUY.js +0 -49
- package/dist/chunk-ARUFY5W3.js +0 -1
- package/dist/chunk-BHFRP7TV.js +0 -8
- package/dist/chunk-BRYJTW6S.js +0 -2
- package/dist/chunk-BUYLM6QV.js +0 -1
- package/dist/chunk-CPR2CMOY.js +0 -1
- package/dist/chunk-EHCKITR4.js +0 -2
- package/dist/chunk-ENZPM52J.js +0 -1
- package/dist/chunk-FPDH3N3A.js +0 -7
- package/dist/chunk-GIQ4SDRJ.js +0 -1
- package/dist/chunk-IKUFNK46.js +0 -2
- package/dist/chunk-IQQMFRWM.js +0 -3
- package/dist/chunk-JCGSIDMC.js +0 -2
- package/dist/chunk-LPCZHKD5.js +0 -1
- package/dist/chunk-N4QFNOAI.js +0 -1
- package/dist/chunk-OCNPOYMA.js +0 -1
- package/dist/chunk-PSYQ6IJA.js +0 -12
- package/dist/chunk-SVYY55IS.js +0 -157
- package/dist/chunk-SX6A656X.js +0 -1
- package/dist/chunk-TP7VKEUF.js +0 -1
- package/dist/chunk-UTV4DTNM.js +0 -1
- package/dist/chunk-XDPTAV2T.js +0 -2
- package/dist/chunk-Y35VLVF6.js +0 -5
- package/dist/chunk-Y4Z6CEII.js +0 -1
- package/dist/chunk-YYY2WXOH.js +0 -1
- package/dist/chunk-ZEEV5J4I.js +0 -1
- package/dist/chunk-ZGHJIQXL.js +0 -1
- package/dist/chunk-ZI2E7P6O.js +0 -4
- package/dist/doctor-CVYUESRQ.js +0 -1
- package/dist/goal-lifecycle-H55AGFCB.js +0 -1
- package/dist/goal-pack-6OBZOPCD.js +0 -1
- package/dist/pipeline-SKYOXWHW.js +0 -5
- package/dist/verified-goal-HN7G532B.js +0 -1
- package/dist/workspace-explain-SUBK6FLO.js +0 -1
- package/dist/workspace-explain-contract-WMREJWHF.js +0 -1
- package/dist/workspace-graph-token-efficiency-NPECU6Y5.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-SNI5K2RL.js +0 -1
- package/dist/workspace-mcp-serve-PK226GMV.js +0 -3
- package/dist/workspace-run-GFBFGUFM.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {l,f,e as e$2,g as g$1}from'./chunk-
|
|
1
|
+
import {l,f,e as e$2,g as g$1}from'./chunk-WZ5V5U2K.js';import {b as b$4}from'./chunk-EG6EZ7HW.js';import {b as b$7,a as a$3}from'./chunk-D5LLTUTY.js';import {b as b$2}from'./chunk-B6FJ6RG6.js';import {a as a$2}from'./chunk-I3UCODXU.js';import {e,g,h as h$1,c as c$1,i as i$1,f as f$1,b as b$6,d as d$4}from'./chunk-46QH3ZVI.js';import {g as g$2}from'./chunk-UW4SESKD.js';import {d as d$1,b as b$1}from'./chunk-2LIVMG5C.js';import {h,e as e$1,b as b$3,d as d$2}from'./chunk-PKKSRXUS.js';import {a}from'./chunk-TQEMLBAG.js';import {i,b as b$5,k as k$1,j,m,t,s as s$1,q}from'./chunk-RGNCL5OB.js';import {b,a as a$1,c,d as d$3}from'./chunk-VQZ5PI5J.js';import {promises}from'fs';import*as k from'fs-extra';import d from'path';import s from'chalk';import {execa}from'execa';function ct(e){let n=e.projectCount??0,t=n===1?"project":"projects",o=e.pythonEngine==="installed"?`Python ${e.pythonVersion||"3.10+"} \xB7 ${e.installMethod||"local environment"}`:e.pythonEngine==="skipped"?"Python engine not installed":"Runtime-neutral foundation";return ["","\u2713 Workspace ready",`${e.workspaceName} \xB7 ${e.profile} \xB7 ${n} registered ${t}`,`Location ${e.workspacePath}`,`Runtime ${o}`,...e.note?[`Note ${e.note}`]:[],"","Workspace Intelligence"," \u2713 Contract and project registry"," \u2713 Canonical model and proof-backed graph"," \u2713 Agent context, grounding, and evidence index","","Next",` ${g$1(e.workspacePath)}`," npx workspai create"," npx workspai workspace intelligence run --for-agent generic --strict --json","","Evidence .workspai/reports/INDEX.json","Guide README.md",""]}function B(e){let n=ct(e);for(let t of n)t==="\u2713 Workspace ready"?console.log(s.green.bold(t)):t==="Workspace Intelligence"||t==="Next"?console.log(s.cyan.bold(t)):t.startsWith(" \u2713")?console.log(s.green(t)):t.startsWith("Location")||t.startsWith("Runtime")?console.log(s.gray(t)):console.log(t);}function T(){return i()}var pt="transactions";function dt(){return d.join(q(),pt)}async function He(){let e=dt();return await b$7(e),a$3({journalDirectory:e})}async function Ue(e){for(let n of s$1())await e.captureFile(n);}async function se(e){let n=await He();try{return await Ue(n),await n.captureOwnedTree(e),n}catch(t){return F(n,t)}}async function ut(e){let n=await He();try{await Ue(n),await n.captureOwnedTree(d.join(e,a$1)),await n.captureOwnedTree(d.join(e,".venv"));let t=[c,".gitignore",d.join(a$1,"workspace.json"),d.join(a$1,"toolchain.lock"),d.join(a$1,"policies.yml"),d.join(a$1,"cache-config.yml"),g$2,a$2,"pyproject.toml","poetry.toml","poetry.lock","rapidkit","rapidkit.cmd","README.md",".rapidkit-global"];for(let o of t)await n.captureFile(d.join(e,o));return n}catch(t){return F(n,t)}}async function J(e){await e.commit(),e.journalPath&&await promises.rm(d.dirname(e.journalPath),{recursive:true,force:true}).catch(n=>e$1.debug(`Could not remove committed lifecycle journal: ${n}`));}async function F(e,n){try{await e.rollback();}catch(t){throw new AggregateError([n,t],"Workspace lifecycle failed and rollback was incomplete.")}throw n}async function Q(e,n,t,o,a){let l=d$1(n,h(),t,a?.pythonEngine?{coreStatus:a.pythonEngine,...a.pythonEngineReason?{coreReason:a.pythonEngineReason}:{},...o?{pythonVersion:o}:{}}:void 0);o&&!a?.pythonEngine&&(l.metadata||(l.metadata={}),l.metadata.python={pythonVersion:o}),await b$1(e,l);}async function H(e){await k.outputFile(d.join(e,".gitignore"),`.venv/
|
|
2
2
|
__pycache__/
|
|
3
3
|
*.pyc
|
|
4
4
|
.env
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {c}from'./chunk-
|
|
1
|
+
import {c}from'./chunk-N4B2M44I.js';import {a}from'./chunk-A5FBGRJA.js';import {a as a$2}from'./chunk-NMXGSVMD.js';import {b}from'./chunk-K33JJVQZ.js';import {t as t$1,s}from'./chunk-ODK4LCEL.js';import {h}from'./chunk-PKKSRXUS.js';import {a as a$1}from'./chunk-TQEMLBAG.js';import {q,r,s as s$1}from'./chunk-RGNCL5OB.js';import {u,t}from'./chunk-VQZ5PI5J.js';import {promises}from'fs';import {randomUUID}from'crypto';import n from'path';import p from'chalk';import le from'fs-extra';import N from'ora';import {execa}from'execa';var de=3e4,me=45e3;async function ge(e){try{let r=await execa("git",["rev-parse","--show-toplevel"],{cwd:e,env:a$1()});return r.stdout.trim()?n.resolve(e,r.stdout.trim()):null}catch{return null}}async function re(e,r,t){if(await ge(e)){r.warn("Git initialization skipped because target is already inside a git worktree");return}r.start("Initializing git repository...");try{await execa("git",["init"],{cwd:e,env:a$1()}),await execa("git",["add","."],{cwd:e,env:a$1()}),await execa("git",["-c","user.name=Workspai","-c","user.email=workspai@localhost","commit","-m",t],{cwd:e,env:a$1()}),r.succeed("Git repository initialized");}catch{r.warn("Could not initialize git repository");}}function G(e){let r=a(e.path),t=Array.isArray(e.projects)?e.projects:[],o=[],a$1=new Set;for(let s of t){if(!s||typeof s.name!="string"||typeof s.path!="string")continue;let i=a(s.path);a$1.has(i)||(a$1.add(i),o.push({name:s.name,path:i}));}return {name:e.name,path:r,mode:e.mode,projects:o}}function I(e){let r=[],t=new Set;for(let o of e.workspaces||[]){if(!o||typeof o.name!="string"||typeof o.path!="string")continue;let a=G(o);t.has(a.path)||(t.add(a.path),r.push(a));}return {workspaces:r}}async function ue(e){let r;try{r=await promises.readFile(e,"utf8");}catch(t){if(t.code==="ENOENT")return {workspaces:[]};throw t}try{let t=JSON.parse(r);if(!t||!Array.isArray(t.workspaces))throw new Error("missing workspaces array");return I(t)}catch(t){throw new Error(`Workspace registry is invalid: ${e}`,{cause:t})}}async function ke(e){let r;try{r=await promises.readFile(e,"utf8");}catch(o){if(o.code==="ENOENT")return {workspaces:[]};throw o}let t;try{t=JSON.parse(r);}catch(o){throw new Error(`Workspace registry is invalid: ${e}`,{cause:o})}if(!t||typeof t!="object"||!Array.isArray(t.workspaces))throw new Error(`Workspace registry is invalid: ${e}`);for(let o of t.workspaces)if(!o||typeof o.name!="string"||typeof o.path!="string"||o.mode!==void 0&&typeof o.mode!="string"||o.projects!==void 0&&!Array.isArray(o.projects)||Array.isArray(o.projects)&&o.projects.some(a=>!a||typeof a.name!="string"||typeof a.path!="string"))throw new Error(`Workspace registry contains an invalid entry: ${e}`);return I(t)}async function z(){let e={workspaces:[]},r=new Set;for(let t of s$1()){let o=await ue(t);for(let a of o.workspaces)r.has(a.path)||(r.add(a.path),e.workspaces.push(a));}return e}async function oe(e=s$1()){let r={workspaces:[]},t=new Set;for(let o of e){let a=await ke(o);for(let s of a.workspaces)t.has(s.path)||(t.add(s.path),r.workspaces.push(s));}return r}function fe(e){let r=e?.code;return process.platform==="win32"&&(r==="EPERM"||r==="EINVAL"||r==="ENOSYS")}async function ae(e){try{await e.sync();}catch(r){if(!fe(r))throw r}}async function X(e,r){let t=n.dirname(e);await promises.mkdir(t,{recursive:true});let o=`${n.basename(e)}.`,a=Date.now();for(let i of await promises.readdir(t)){if(!i.startsWith(o)||!i.endsWith(".tmp"))continue;let c=n.join(t,i),d=await promises.stat(c).catch(()=>null);d&&a-d.mtimeMs>3e4&&await promises.rm(c,{force:true}).catch(()=>{});}let s=await promises.readFile(e,"utf8").catch(()=>null);if(s!==null){let i=false;try{let c=JSON.parse(s);i=Array.isArray(c.workspaces);}catch{i=false;}if(!i){let c=`${e}.corrupt-${Date.now()}`;await promises.copyFile(e,c);}}await se(e,`${JSON.stringify(I(r),null,2)}
|
|
2
2
|
`);}async function se(e,r){let t=n.dirname(e);await promises.mkdir(t,{recursive:true});let o=`${e}.${process.pid}.${randomUUID()}.tmp`;try{await promises.writeFile(o,r);let a=await promises.open(o,"r");try{await ae(a);}finally{await a.close();}try{await promises.rename(o,e);}catch(s){let i=s.code;if(i!=="EEXIST"&&i!=="EPERM")throw s;await le.move(o,e,{overwrite:true});}}finally{await promises.rm(o,{force:true}).catch(()=>{});}}async function Z(e){try{return {exists:true,content:await promises.readFile(e)}}catch(r){if(r.code==="ENOENT")return {exists:false};throw r}}async function ee(e,r){if(!r.exists){await promises.rm(e,{force:true});return}await se(e,r.content);}async function we(e,r){let t=n.join(e,"workspaces.json.lock"),o=randomUUID();await promises.mkdir(e,{recursive:true});let a=Date.now(),s;for(;!s;)try{s=await promises.open(t,"wx"),await s.writeFile(`${JSON.stringify({pid:process.pid,lockId:o,createdAt:new Date().toISOString()})}
|
|
3
|
-
`),await ae(s);}catch(i){if(i.code!=="EEXIST")throw i;let c=await promises.stat(t).catch(()=>null);if(c&&Date.now()-c.mtimeMs>de){let d=await promises.readFile(t,"utf8").then(g=>JSON.parse(g)).catch(()=>null),u=Number(d?.pid),f=false;if(Number.isInteger(u)&&u>0)try{process.kill(u,0),f=true;}catch(g){f=g.code==="EPERM";}if(!f){await promises.rm(t,{force:true}).catch(()=>{});continue}}if(Date.now()-a>me)throw new Error(`Timed out waiting for workspace registry lock: ${t}`);await new Promise(d=>setTimeout(d,25));}try{return await r()}finally{await s.close().catch(()=>{}),await promises.readFile(t,"utf8").then(c=>JSON.parse(c).lockId===o).catch(()=>false)&&await promises.rm(t,{force:true}).catch(()=>{});}}async function S(e){let r$1=q(),t=n.join(r$1,"workspaces.json"),o=n.join(r(),"workspaces.json"),a=[...new Set(s())];return we(r$1,async()=>{let[s,i]=await Promise.all([Z(t),Z(o)]),c=await oe(a);await e(c);let d=I(c);try{await X(t,d),await X(o,d);}catch(u){let g=(await Promise.allSettled([ee(t,s),ee(o,i)])).filter(k=>k.status==="rejected").map(k=>k.reason);throw g.length>0?new AggregateError([u,...g],"Workspace registry transaction failed and could not be fully restored"):u}return d})}async function ie(e,r){let t=a(e);await S(o=>{let a=o.workspaces.find(s=>s.path===t);if(a){a.name=r,a.mode=a.mode||"full",a.projects=Array.isArray(a.projects)?a.projects:[];return}o.workspaces.push({name:r,path:t,mode:"full",projects:[]});});}async function He(e){let r=a(e),o=(await oe()).workspaces.find(a=>a.path===r);return o?{...o,projects:o.projects.map(a=>({...a}))}:null}async function Ke(e,r){let t=a(e);await S(o=>{let a=o.workspaces.findIndex(i=>i.path===t);if(!r){a>=0&&o.workspaces.splice(a,1);return}let s=G(r);a>=0?o.workspaces[a]=s:o.workspaces.push(s);});}async function qe(e){let r=a(e);await S(t=>{t.workspaces=t.workspaces.filter(o=>o.path!==r);});}async function he(e,r){try{await ie(e,r);}catch{console.warn(p.gray("Note: Could not register workspace in shared registry"));}}async function Qe(e,r=false){let t=a(e),o={workspacePath:t,workspaceFound:false,added:[],skipped:0};try{let a$1=await z(),s=a$1.workspaces.find(k=>k.path===t);if(!s){if(await he(t,n.basename(n.resolve(e))),a$1=await z(),s=a$1.workspaces.find(k=>k.path===t),!s)return r||console.log("\u26A0\uFE0F Workspace could not be registered in registry"),o;r||console.log("\u2714 Registered workspace in shared registry");}Array.isArray(s.projects)||(s.projects=[]);let i=0,c=0,d=[],u$1=[],f=[e],g=new Set;for(;f.length>0;){let k=f.shift();if(!k||g.has(k))continue;g.add(k);let w=await promises.readdir(k,{withFileTypes:true});for(let h of w){if(!h.isDirectory()||h.name.startsWith(".")||["node_modules","dist","build","target","coverage","htmlcov"].includes(h.name))continue;let v=n.join(k,h.name),y=a(v);try{let x=false;for(let P of [...u(y,"context.json"),...u(y,"project.json")])try{await promises.access(P),x=true;break}catch{}if(x){let P=n.basename(y),m=s.projects.some($=>$.path===y);u$1.push({name:P,path:y}),m?c++:(s.projects.push({name:P,path:y}),i++,d.push(y),r||console.log(`\u2714 Added: ${n.relative(e,y)}`));continue}}catch{}f.push(v);}}return await S(k=>{let w=k.workspaces.find(y=>y.path===t);if(!w)return;let h=`${t}${n.sep}`,v=(w.projects||[]).filter(y=>y.path!==t&&!y.path.startsWith(h));w.projects=G({...w,projects:[...v,...u$1]}).projects;}),i>0?r||console.log(`
|
|
3
|
+
`),await ae(s);}catch(i){if(i.code!=="EEXIST")throw i;let c=await promises.stat(t).catch(()=>null);if(c&&Date.now()-c.mtimeMs>de){let d=await promises.readFile(t,"utf8").then(g=>JSON.parse(g)).catch(()=>null),u=Number(d?.pid),f=false;if(Number.isInteger(u)&&u>0)try{process.kill(u,0),f=true;}catch(g){f=g.code==="EPERM";}if(!f){await promises.rm(t,{force:true}).catch(()=>{});continue}}if(Date.now()-a>me)throw new Error(`Timed out waiting for workspace registry lock: ${t}`);await new Promise(d=>setTimeout(d,25));}try{return await r()}finally{await s.close().catch(()=>{}),await promises.readFile(t,"utf8").then(c=>JSON.parse(c).lockId===o).catch(()=>false)&&await promises.rm(t,{force:true}).catch(()=>{});}}async function S(e){let r$1=q(),t=n.join(r$1,"workspaces.json"),o=n.join(r(),"workspaces.json"),a=[...new Set(s$1())];return we(r$1,async()=>{let[s,i]=await Promise.all([Z(t),Z(o)]),c=await oe(a);await e(c);let d=I(c);try{await X(t,d),await X(o,d);}catch(u){let g=(await Promise.allSettled([ee(t,s),ee(o,i)])).filter(k=>k.status==="rejected").map(k=>k.reason);throw g.length>0?new AggregateError([u,...g],"Workspace registry transaction failed and could not be fully restored"):u}return d})}async function ie(e,r){let t=a(e);await S(o=>{let a=o.workspaces.find(s=>s.path===t);if(a){a.name=r,a.mode=a.mode||"full",a.projects=Array.isArray(a.projects)?a.projects:[];return}o.workspaces.push({name:r,path:t,mode:"full",projects:[]});});}async function He(e){let r=a(e),o=(await oe()).workspaces.find(a=>a.path===r);return o?{...o,projects:o.projects.map(a=>({...a}))}:null}async function Ke(e,r){let t=a(e);await S(o=>{let a=o.workspaces.findIndex(i=>i.path===t);if(!r){a>=0&&o.workspaces.splice(a,1);return}let s=G(r);a>=0?o.workspaces[a]=s:o.workspaces.push(s);});}async function qe(e){let r=a(e);await S(t=>{t.workspaces=t.workspaces.filter(o=>o.path!==r);});}async function he(e,r){try{await ie(e,r);}catch{console.warn(p.gray("Note: Could not register workspace in shared registry"));}}async function Qe(e,r=false){let t=a(e),o={workspacePath:t,workspaceFound:false,added:[],skipped:0};try{let a$1=await z(),s=a$1.workspaces.find(k=>k.path===t);if(!s){if(await he(t,n.basename(n.resolve(e))),a$1=await z(),s=a$1.workspaces.find(k=>k.path===t),!s)return r||console.log("\u26A0\uFE0F Workspace could not be registered in registry"),o;r||console.log("\u2714 Registered workspace in shared registry");}Array.isArray(s.projects)||(s.projects=[]);let i=0,c=0,d=[],u$1=[],f=[e],g=new Set;for(;f.length>0;){let k=f.shift();if(!k||g.has(k))continue;g.add(k);let w=await promises.readdir(k,{withFileTypes:true});for(let h of w){if(!h.isDirectory()||h.name.startsWith(".")||["node_modules","dist","build","target","coverage","htmlcov"].includes(h.name))continue;let v=n.join(k,h.name),y=a(v);try{let x=false;for(let P of [...u(y,"context.json"),...u(y,"project.json")])try{await promises.access(P),x=true;break}catch{}if(x){let P=n.basename(y),m=s.projects.some($=>$.path===y);u$1.push({name:P,path:y}),m?c++:(s.projects.push({name:P,path:y}),i++,d.push(y),r||console.log(`\u2714 Added: ${n.relative(e,y)}`));continue}}catch{}f.push(v);}}return await S(k=>{let w=k.workspaces.find(y=>y.path===t);if(!w)return;let h=`${t}${n.sep}`,v=(w.projects||[]).filter(y=>y.path!==t&&!y.path.startsWith(h));w.projects=G({...w,projects:[...v,...u$1]}).projects;}),i>0?r||console.log(`
|
|
4
4
|
\u2705 Synced ${i} project(s) to registry`):r||console.log(`
|
|
5
|
-
\u2705 All projects already registered (${c} found)`),{workspacePath:t,workspaceFound:true,added:d,skipped:c}}catch(a){return r||console.error("\u274C Failed to sync projects:",a.message),o}}async function ye(e,r,t){let o=a(e),a$1=a(t);await S(s=>{let i=s.workspaces.find(u=>u.path===o);if(!i)throw new Error(`Workspace is not registered: ${o}`);i.projects=Array.isArray(i.projects)?i.projects:[];let c=i.projects.findIndex(u=>u.path===a$1||u.name===r),d={name:r,path:a$1};c>=0?i.projects[c]=d:i.projects.push(d);});}async function Xe(e,r,t){try{await ye(e,r,t);}catch{}}async function Ze(e,r){let t=N("Creating Workspai workspace...").start();try{await promises.mkdir(e,{recursive:true}),await promises.mkdir(n.join(e,".workspai"),{recursive:true});let o={workspace_name:r.name,author:r.author,rapidkit_version:h(),created_at:new Date().toISOString(),type:"workspace"};await promises.writeFile(n.join(e,".workspai","config.json"),JSON.stringify(o,null,2));let{syncWorkspaceFoundationFiles:a}=await import('./create-
|
|
5
|
+
\u2705 All projects already registered (${c} found)`),{workspacePath:t,workspaceFound:true,added:d,skipped:c}}catch(a){return r||console.error("\u274C Failed to sync projects:",a.message),o}}async function ye(e,r,t){let o=a(e),a$1=a(t);await S(s=>{let i=s.workspaces.find(u=>u.path===o);if(!i)throw new Error(`Workspace is not registered: ${o}`);i.projects=Array.isArray(i.projects)?i.projects:[];let c=i.projects.findIndex(u=>u.path===a$1||u.name===r),d={name:r,path:a$1};c>=0?i.projects[c]=d:i.projects.push(d);});}async function Xe(e,r,t){try{await ye(e,r,t);}catch{}}async function Ze(e,r){let t=N("Creating Workspai workspace...").start();try{await promises.mkdir(e,{recursive:true}),await promises.mkdir(n.join(e,".workspai"),{recursive:true});let o={workspace_name:r.name,author:r.author,rapidkit_version:h(),created_at:new Date().toISOString(),type:"workspace"};await promises.writeFile(n.join(e,".workspai","config.json"),JSON.stringify(o,null,2));let{syncWorkspaceFoundationFiles:a}=await import('./create-GWBQ74ZI.js');await a(e,{workspaceName:r.name,installMethod:"venv",writeMarker:true,writeGitignore:false,onlyIfMissing:true});let s=$e();await promises.writeFile(n.join(e,"rapidkit"),s),await promises.chmod(n.join(e,"rapidkit"),493);let i=je();await promises.writeFile(n.join(e,"rapidkit.cmd"),i);let c=ve(r.name);await promises.writeFile(n.join(e,"README.md"),c),await promises.writeFile(n.join(e,".gitignore"),`# Workspai workspace
|
|
6
6
|
.env
|
|
7
7
|
.env.*
|
|
8
8
|
!.env.example
|
|
@@ -17,7 +17,7 @@ Thumbs.db
|
|
|
17
17
|
|
|
18
18
|
# Logs
|
|
19
19
|
*.log
|
|
20
|
-
`),await _e(e),t.succeed("Workspace created!"),r.skipGit||await re(e,N(),"Initial commit: Workspai workspace"),await ie(e,r.name);let{publishWorkspaceRegistrySummary:u}=await import('./workspace-registry-summary-
|
|
20
|
+
`),await _e(e),t.succeed("Workspace created!"),r.skipGit||await re(e,N(),"Initial commit: Workspai workspace"),await ie(e,r.name);let{publishWorkspaceRegistrySummary:u}=await import('./workspace-registry-summary-ONT4VOJX.js');await u(e),console.log(`
|
|
21
21
|
${p.green("\u2728 Workspai workspace created successfully!")}
|
|
22
22
|
|
|
23
23
|
${p.bold("\u{1F4C2} Workspace structure:")}
|
|
@@ -663,4 +663,4 @@ ${p.gray("\u{1F4A1} Tip: Install globally (npm i -g workspai) to use without npx
|
|
|
663
663
|
\u{1F4E6} Registered Workspai Workspaces:
|
|
664
664
|
`));for(let g of d.workspaces)console.log(p.cyan(` ${g.name}`)),console.log(p.gray(` Path: ${g.path}`)),console.log(p.gray(` Projects: ${g.projects?.length||0}`)),console.log();c>0&&console.log(p.gray(`Cleaned ${c} stale workspace entr${c===1?"y":"ies"}.`)),console.log(p.gray(`Total: ${d.workspaces.length} workspace(s)
|
|
665
665
|
`));}catch(a){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:t,workspaces:[],summary:{total:0,missing:0,registryExists:true,registryValid:false},error:{code:"workspace.registry.read_failed",message:a.message}},null,2));return}console.error(p.red(`
|
|
666
|
-
\u274C Failed to read workspace registry`)),console.error(p.gray(String(a)));}}function Re(e){if(!e||typeof e!="object"||Array.isArray(e))return [];let r=e.projects;return Array.isArray(r)?r.filter(t=>!!t&&typeof t=="object"&&!Array.isArray(t)):[]}function Se(e,r){if(r||!e||typeof e!="object"||Array.isArray(e))return e;let t=structuredClone(e);return Array.isArray(t.projects)&&(t.projects=t.projects.map(o=>{if(!o||typeof o!="object"||Array.isArray(o))return o;let a={...o};return delete a.externalPath,a})),t}async function xe(e){try{let r=await promises.readFile(e,"utf8");return JSON.parse(r)}catch{return null}}async function B(e){for(let r of e){let t=await xe(r);if(t!==null)return t}return null}function Ee(e){return c(e)}async function We(e){return a$2(e,{skipDirs:new Set(["node_modules","dist","build","target","coverage","htmlcov"]),includeHiddenDirs:false,descendIntoMatchedProjects:true})}async function J(e){try{return (await promises.readdir(e,{withFileTypes:true})).filter(t=>t.isFile()&&t.name.toLowerCase().endsWith(".json")).map(t=>t.name).sort((t,o)=>t.localeCompare(o))}catch{return []}}async function rt(e,r){let t$
|
|
666
|
+
\u274C Failed to read workspace registry`)),console.error(p.gray(String(a)));}}function Re(e){if(!e||typeof e!="object"||Array.isArray(e))return [];let r=e.projects;return Array.isArray(r)?r.filter(t=>!!t&&typeof t=="object"&&!Array.isArray(t)):[]}function Se(e,r){if(r||!e||typeof e!="object"||Array.isArray(e))return e;let t=structuredClone(e);return Array.isArray(t.projects)&&(t.projects=t.projects.map(o=>{if(!o||typeof o!="object"||Array.isArray(o))return o;let a={...o};return delete a.externalPath,a})),t}async function xe(e){try{let r=await promises.readFile(e,"utf8");return JSON.parse(r)}catch{return null}}async function B(e){for(let r of e){let t=await xe(r);if(t!==null)return t}return null}function Ee(e){return c(e)}async function We(e){return a$2(e,{skipDirs:new Set(["node_modules","dist","build","target","coverage","htmlcov"]),includeHiddenDirs:false,descendIntoMatchedProjects:true})}async function J(e){try{return (await promises.readdir(e,{withFileTypes:true})).filter(t=>t.isFile()&&t.name.toLowerCase().endsWith(".json")).map(t=>t.name).sort((t,o)=>t.localeCompare(o))}catch{return []}}async function rt(e,r){let t$2=r?.includePaths===true,o=r?.includeDoctorEvidence!==false,a=r?.includeBlueprint!==false,s$1=n.resolve(e),i=await B(t(s$1,"workspace.json")),c=typeof i?.workspace_name=="string"&&i.workspace_name.trim()||n.basename(s$1),d=typeof i?.profile=="string"?i.profile:void 0,u$1=typeof i?.rapidkit_version=="string"?i.rapidkit_version:void 0,f=await B(t(s$1,"workspace.contract.json")),g=Se(f,t$2),k=await We(s$1),w=new Map;for(let m of k)w.set(n.resolve(m),{projectPath:n.resolve(m)});for(let m of Re(f)){let $=typeof m.externalPath=="string"?m.externalPath.trim():"",j=typeof m.relativePath=="string"?m.relativePath.trim():"";if(!$&&!j)continue;let b=n.resolve(s$1,$||j),R=w.get(b);w.set(b,{projectPath:b,name:typeof m.slug=="string"&&m.slug.trim()?m.slug.trim():R?.name,relativePath:j||R?.relativePath,runtime:typeof m.runtime=="string"&&m.runtime.trim()?m.runtime.trim():R?.runtime,kit:typeof m.kit=="string"&&m.kit.trim()?m.kit.trim():R?.kit,modules:Array.isArray(m.modules)?m.modules.filter(L=>typeof L=="string"):R?.modules});}let h=[];for(let m of w.values()){let $=m.projectPath,j=await B(u($,"project.json")),b=m.relativePath||n.relative(s$1,$)||".",R=n.dirname(u($,n.join("reports","placeholder"))[0]),L=n.dirname(u($,n.join("reports","placeholder"))[1]),D={name:m.name||n.basename($),relative_path:b,runtime:typeof j?.runtime=="string"?j.runtime:m.runtime,kit_name:typeof j?.kit_name=="string"?j.kit_name:m.kit,modules:Array.isArray(j?.modules)?j.modules.filter(E=>typeof E=="string"):m.modules};if(t$2&&(D.absolute_path=$),o){let E=await B([n.join(R,"doctor-last-run.json"),n.join(L,"doctor-last-run.json")]);Ee(E)&&(D.doctor_report=E);}let M=[...await J(R),...await J(L)].filter((E,ce,pe)=>pe.indexOf(E)===ce);M.length>0&&(D.reports=M),h.push(D);}let v=t(s$1,"reports"),y=[...await J(v[0]),...await J(v[1])].filter((m,$,j)=>j.indexOf(m)===$),x={schema_version:s.workspaceShareBundle.schemaVersion,generated_at:new Date().toISOString(),generated_by:"workspai",workspace:{name:c,relative_root:".",profile:d,rapidkit_version:u$1,...t$2?{absolute_root:s$1}:{}},summary:{project_count:h.length,doctor_evidence_included:o,contract_included:!!g},reports:{workspace:y},projects:h,...g?{contract:g}:{}};a&&(x.blueprint={schema_version:"rapidkit.workspace-blueprint.v1",purpose:"portable-reproducibility",workspace:{name:c,profile:d},projects:h.map(m=>({name:m.name,relative_path:m.relative_path,runtime:m.runtime,kit_name:m.kit_name,modules:m.modules??[],recreate_commands:[...m.kit_name?[`npx workspai create project ${m.kit_name} ${m.name} --yes --skip-install`]:[],`cd ${m.relative_path}`,"npx workspai init","npx workspai test"]})),recommended_commands:["npx workspai workspace contract verify --strict","npx workspai doctor workspace","npx workspai workspace run init --json","npx workspai workspace run test --strict --json","npx workspai readiness --strict --json"]});let P=r?.outputPath?n.resolve(r.outputPath):n.join(v[0],"share-bundle.json");return r?.outputPath||b(t$1.workspaceShareBundle,x),await promises.mkdir(n.dirname(P),{recursive:true}),await promises.writeFile(P,JSON.stringify(x,null,2),"utf8"),P}export{G as a,ie as b,He as c,Ke as d,qe as e,he as f,Qe as g,ye as h,Xe as i,Ze as j,et as k,tt as l,rt as m};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b,d}from'./chunk-AD4ZY3RF.js';import {f}from'./chunk-OZXCNVGW.js';import {p,q}from'./chunk-ODK4LCEL.js';import A from'fs-extra';function t(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function S(e){let s=t(e);return !!(s&&s.schemaVersion===q.model&&t(s.workspace)&&Array.isArray(s.projects)&&(t(s.projectTopology)||t(s.graph)))}function W(e){let s=t(e);return !!(s&&s.schemaVersion===q.knowledgeGraph&&t(s.source)&&t(s.workspace)&&Array.isArray(s.entities)&&Array.isArray(s.relations)&&Array.isArray(s.proofs)&&Array.isArray(s.providers)&&t(s.quality))}async function g(e){try{return await A.readJson(e)}catch{return null}}async function I(e){let[s,i]=await Promise.all([f(e,p.model),f(e,p.knowledgeGraph)]);if(!s)return {status:"miss",reason:"missing-model"};if(!i)return {status:"miss",reason:"missing-graph"};let[n,o]=await Promise.all([g(s),g(i)]);if(!S(n))return {status:"miss",reason:"invalid-model"};if(!W(o))return {status:"miss",reason:"invalid-graph"};if(o.proofs.some(r=>r.freshness==="stale"))return {status:"miss",reason:"stale-proof"};try{b(o,n);}catch{return {status:"miss",reason:"source-mismatch"}}let a=o.source.inputs;if(!a)return {status:"miss",reason:"missing-input-fingerprint"};let f$1=a.scopes.filter(r=>r.kind==="workspace"),m=a.scopes.filter(r=>r.kind==="project"),k=n.projects.map(r=>r.name).sort(),w=m.map(r=>r.id).sort(),y=new Set(m.map(r=>r.fileLimit));if(a.schemaVersion!=="workspace-knowledge-graph-inputs.v1"||a.strategy!=="hybrid-git-content-v2"||a.hashAlgorithm!=="sha256"||f$1.length!==1||y.size>1||JSON.stringify(k)!==JSON.stringify(w))return {status:"miss",reason:"invalid-input-fingerprint"};let u;try{u=await d({workspacePath:e,projects:n.projects.map(r=>({id:r.name,path:r.path,...r.absolutePath?{absolutePath:r.absolutePath}:{}})),expected:a});}catch{return {status:"miss",reason:"input-scan-failed"}}return u?{status:"hit",model:n,graph:o,modelPath:s,graphPath:i}:{status:"miss",reason:"live-input-mismatch"}}export{I as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-EBQS5T7Q.js';import {c,d,a,b as b$1}from'./chunk-VQZ5PI5J.js';import n from'fs';import o from'path';function _(t){return b({startPath:t})?.workspacePath??null}function k(t){let s=o.resolve(t),p=n.existsSync(o.join(s,c))||n.existsSync(o.join(s,d))||n.existsSync(o.join(s,a,"workspace.json"))||n.existsSync(o.join(s,b$1,"workspace.json")),A=n.existsSync(o.join(s,a,"project.json"))||n.existsSync(o.join(s,a,"context.json"))||n.existsSync(o.join(s,b$1,"project.json"))||n.existsSync(o.join(s,b$1,"context.json"));return p&&!A}export{_ as a,k as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import {c as c$1,b as b$1}from'./chunk-WCJU3CFG.js';import {d,b,e}from'./chunk-ERVWW5HX.js';import {a}from'./chunk-TKXRP2B4.js';import {d as d$2}from'./chunk-S5KTATOU.js';import {a as a$1}from'./chunk-NMXGSVMD.js';import {q as q$1,z as z$1,u as u$1}from'./chunk-KFTJVVJR.js';import {k,m,g,f as f$1}from'./chunk-U5ENEDJA.js';import {f}from'./chunk-OZXCNVGW.js';import {p,t}from'./chunk-ODK4LCEL.js';import {a as a$2}from'./chunk-TQEMLBAG.js';import {c,d as d$1}from'./chunk-25AWHAB5.js';import {e as e$1,g as g$1}from'./chunk-RGNCL5OB.js';import {u,q,t as t$1}from'./chunk-VQZ5PI5J.js';import J from'fs';import w from'path';import T from'chalk';import {execa}from'execa';var ct={"python-fastapi":{runtime:"python",framework:"FastAPI",markers:["pyproject.toml","fastapi"],commands:{init:"python -m pip install -e .",test:"pytest",build:"python -m build",start:"uvicorn main:app --reload"},errorPatterns:{setup:["ModuleNotFoundError","No module named","pip: command not found"],"test-failure":["FAILED","ERROR","test session started"],dependency:["ImportError","missing.*dependency"],runtime:["TypeError","AttributeError","ValueError"],timeout:["timeout","Timeout","timed out"],unknown:[]},healthCheck:{stage:"start",type:"http",value:"http://localhost:8000/docs"},validation:{command:"python -m pip list | grep fastapi",error:"FastAPI not installed"}},"python-django":{runtime:"python",framework:"Django",markers:["manage.py","django"],commands:{init:"python manage.py migrate",test:"python manage.py test",build:"python manage.py collectstatic --noinput",start:"python manage.py runserver 0.0.0.0:8000"},errorPatterns:{setup:["ModuleNotFoundError","ProgrammingError.*migrate"],"test-failure":["FAILED","ERROR","Ran.*test"],dependency:["ImportError","missing.*dependency"],runtime:["DatabaseError","ImproperlyConfigured"],timeout:["timeout","Timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:8e3},dependencies:["init"]},"node-nestjs":{runtime:"node",framework:"NestJS",markers:["package.json","@nestjs/core"],commands:{init:"npm install",test:"npm run test",build:"npm run build",start:"npm run start"},errorPatterns:{setup:["npm ERR!","ENOENT","not found"],"test-failure":["Tests.*failed","FAIL","fail.*test"],dependency:["Cannot find module","ERR_MODULE_NOT_FOUND"],runtime:["TypeError","Error: ","ReferenceError"],timeout:["timeout","TIMEOUT"],unknown:[]},healthCheck:{stage:"start",type:"port",value:3e3}},"node-express":{runtime:"node",framework:"Express",markers:["package.json","express"],commands:{init:"npm install",test:"npm run test",build:"npm run build",start:"npm start"},errorPatterns:{setup:["npm ERR!","ENOENT"],"test-failure":["failed","FAIL"],dependency:["Cannot find module"],runtime:["Error","TypeError"],timeout:["timeout"],unknown:[]}},"go-fiber":{runtime:"go",framework:"Fiber",markers:["go.mod","fiber"],commands:{init:"go mod download && go mod tidy",test:"go test ./...",build:"go build -o app .",start:"./app"},errorPatterns:{setup:["go: .*not found","cannot find","go mod tidy"],"test-failure":["FAIL","--- FAIL"],dependency:["missing.*module"],runtime:["panic","fatal","Error"],timeout:["timeout","context deadline"],unknown:[]},dependencies:["init"]},"go-gin":{runtime:"go",framework:"Gin",markers:["go.mod","gin-gonic"],commands:{init:"go mod download && go mod tidy",test:"go test ./...",build:"go build -o app .",start:"./app"},errorPatterns:{setup:["go: .*not found"],"test-failure":["FAIL"],dependency:["missing.*module"],runtime:["panic"],timeout:["timeout"],unknown:[]}},"java-springboot":{runtime:"java",framework:"Spring Boot",markers:["pom.xml","build.gradle","spring-boot"],commands:{init:"mvn dependency:go-offline",test:"mvn test",build:"mvn package -DskipTests",start:"mvn spring-boot:run"},errorPatterns:{setup:["\\[ERROR\\]","BUILD FAILURE","missing dependencies"],"test-failure":["\\[ERROR\\] Tests run:","BUILD FAILURE"],dependency:["missing.*dependency"],runtime:["Exception","Error","NullPointerException"],timeout:["timeout","Timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:8080}},"php-laravel":{runtime:"php",framework:"Laravel",markers:["composer.json","artisan","app/Models"],commands:{init:"composer install && php artisan migrate:fresh --seed",test:"php artisan test",build:"php artisan config:cache && php artisan route:cache && php artisan view:cache",start:"php artisan serve --host=0.0.0.0 --port=8000"},errorPatterns:{setup:["Composer.*lock","Fatal error","Class.*not found"],"test-failure":["FAILED","Tests.*failed"],dependency:["Class.*not found","require.*failed"],runtime:["Fatal error","Exception","Error"],timeout:["timeout","Timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:8e3},dependencies:["init"]},"php-symfony":{runtime:"php",framework:"Symfony",markers:["composer.json","symfony.lock","bin/console"],commands:{init:"composer install && php bin/console doctrine:database:create",test:"php bin/phpunit",build:"php bin/console cache:clear --env=prod",start:"symfony serve --no-tls"},errorPatterns:{setup:["Composer.*error","Fatal error"],"test-failure":["FAILED","failure"],dependency:["Class.*not found"],runtime:["Fatal error","Exception"],timeout:["timeout"],unknown:[]},dependencies:["init"]},"rust-actix":{runtime:"rust",framework:"Actix-web",markers:["Cargo.toml","actix"],commands:{init:"cargo fetch",test:"cargo test",build:"cargo build --release",start:"cargo run --release"},errorPatterns:{setup:["error: .*could not find","failed.*download"],"test-failure":["test result:","FAILED"],dependency:["can.t find.*crate"],runtime:["error\\[E","thread.*panicked"],timeout:["timeout"],unknown:[]},validation:{command:"cargo --version",error:"Rust/Cargo not installed"}},"rust-axum":{runtime:"rust",framework:"Axum",markers:["Cargo.toml","axum"],commands:{init:"cargo fetch",test:"cargo test",build:"cargo build --release",start:"cargo run --release"},errorPatterns:{setup:["error: .*could not find"],"test-failure":["test result:","FAILED"],dependency:["can.t find.*crate"],runtime:["error\\[E"],timeout:["timeout"],unknown:[]}},"rust-rocket":{runtime:"rust",framework:"Rocket",markers:["Cargo.toml","rocket"],commands:{init:"cargo fetch",test:"cargo test",build:"cargo build --release",start:"cargo run --release"},errorPatterns:{setup:["error: .*could not find"],"test-failure":["FAILED"],dependency:["can.t find"],runtime:["error\\[E"],timeout:["timeout"],unknown:[]}},"dotnet-aspnetcore":{runtime:"dotnet",framework:"ASP.NET Core",markers:[".csproj",".sln","Program.cs"],commands:{init:"dotnet restore",test:"dotnet test",build:"dotnet build -c Release",start:"dotnet run"},errorPatterns:{setup:["error CS","CSPROJ.*not found","NuGet.*restore"],"test-failure":["Failed:.*test","FAILED"],dependency:["error NU1101"],runtime:["error CS","Exception"],timeout:["timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:5e3}},"elixir-phoenix":{runtime:"elixir",framework:"Phoenix",markers:["mix.exs","phoenix"],commands:{init:"mix setup",test:"mix test",build:"mix compile --all-warnings",start:"mix phx.server"},errorPatterns:{setup:["\\*\\* \\(.*Error\\)","Mix.InstallError"],"test-failure":["\\d+\\sfailed","FAILED"],dependency:["dependencies are not available"],runtime:["\\*\\* \\(","RuntimeError"],timeout:["timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:4e3},dependencies:["init"]},"ruby-rails":{runtime:"ruby",framework:"Rails",markers:["Gemfile","config/application.rb","bin/rails"],commands:{init:"bundle install && rails db:prepare",test:"rails test",build:"rails assets:precompile",start:"rails server --binding=0.0.0.0 --port=3000"},errorPatterns:{setup:["Bundler::.*Error","Gem::.*Error"],"test-failure":["failures,","error,","FAILED"],dependency:["Could not find.*gem"],runtime:["Error","Exception","NoMethodError"],timeout:["timeout"],unknown:[]},healthCheck:{stage:"start",type:"port",value:3e3},dependencies:["init"]},"ruby-sinatra":{runtime:"ruby",framework:"Sinatra",markers:["Gemfile","app.rb","sinatra"],commands:{init:"bundle install",test:"rspec",build:`echo "Sinatra apps don't require build"`,start:"ruby app.rb"},errorPatterns:{setup:["Bundler.*Error","Gem.*Error"],"test-failure":["failure","FAILED"],dependency:["Could not find.*gem"],runtime:["Error","NoMethodError"],timeout:["timeout"],unknown:[]}}},dt={init:{python:["pip install -e .","poetry install","pip install -r requirements.txt"],node:["npm install","pnpm install","yarn install"],go:["go mod download && go mod tidy","go get ./..."],java:["mvn dependency:go-offline","gradle dependencies"],php:["composer install"],rust:["cargo fetch"],dotnet:["dotnet restore"],c:["cmake -S . -B build"],cpp:["cmake -S . -B build"],elixir:["mix deps.get"],ruby:["bundle install"],clojure:["clojure -P"],scala:["sbt update"],kotlin:["./gradlew dependencies","gradle dependencies"],deno:[],bun:["bun install"],"jvm-generic":["mvn dependency:go-offline","gradle dependencies"],unknown:[]},test:{python:["pytest","python -m unittest","python -m pytest"],node:["npm test","npm run test"],go:["go test ./...","make test"],java:["mvn test","gradle test"],php:["php artisan test","phpunit","pest"],rust:["cargo test"],dotnet:["dotnet test"],c:["ctest --test-dir build --output-on-failure"],cpp:["ctest --test-dir build --output-on-failure"],elixir:["mix test"],ruby:["rspec","ruby -m minitest"],clojure:["clojure -X:test"],scala:["sbt test"],kotlin:["./gradlew test","gradle test"],deno:["deno task test","deno test"],bun:["bun test","bun run test"],"jvm-generic":["mvn test","gradle test"],unknown:[]},build:{python:["python -m build","python setup.py build"],node:["npm run build"],go:["go build -o app .","go build ./..."],java:["mvn package -DskipTests","gradle build -x test"],php:['echo "PHP build: typically no build step"'],rust:["cargo build --release"],dotnet:["dotnet build -c Release"],c:["cmake --build build"],cpp:["cmake --build build"],elixir:["mix compile"],ruby:["gem build *.gemspec"],clojure:[],scala:["sbt compile"],kotlin:["./gradlew build","gradle build"],deno:["deno task build"],bun:["bun run build"],"jvm-generic":["mvn package -DskipTests","gradle build"],unknown:[]},start:{python:["python app.py","python main.py","uvicorn main:app --reload"],node:["npm start","node index.js","node src/index.js"],go:["./app","go run main.go","go run ./..."],java:["mvn spring-boot:run","gradle bootRun","java -jar target/*.jar"],php:["php -S 0.0.0.0:8000","php artisan serve"],rust:["cargo run --release","./target/release/app"],dotnet:["dotnet run"],c:[],cpp:[],elixir:["mix phx.server","iex -S mix"],ruby:["rails server","ruby app.rb","bundle exec puma"],clojure:["clojure -M:run"],scala:["sbt run"],kotlin:["./gradlew run","gradle run"],deno:["deno task start","deno task dev"],bun:["bun run start","bun run dev"],"jvm-generic":["java -jar *.jar","gradle run"],unknown:[]}};function oe(e,r){if(r){let t=r.trim().toLowerCase().replace(/[_.\s]+/g,"-"),n=f$1(r),s=`${e}-${n==="gofiber"?"fiber":n==="gogin"?"gin":n==="dotnet"?"aspnetcore":n!=="unknown"?n:t==="fiber"?"fiber":t==="aspnetcore"||t==="asp-net-core"?"aspnetcore":t}`;return ct[s]}}function Be(e,r,t){if(r){let n=oe(e,r);if(n&&n.commands[t])return n.commands[t]}if(["init","test","build","start"].includes(t)){let n=dt[t]?.[e]??[];return n.length>0?n[0]:void 0}}var lt={test:"test",build:"build",start:"start"};function fe(e){if(e.stage==="init")return e.runtime==="node"?c$1(e.projectPath):Be(e.runtime,e.framework,e.stage);if(e.runtime==="node"){let r=lt[e.stage];if(r){let t=u$1(e.projectPath,r,{framework:e.framework});if(t)return b$1(e.projectPath,t.scriptName)}}return Be(e.runtime,e.framework,e.stage)}function pt(e){let r=k(e).map(t=>t==="python"?"python":t==="node"||t==="bun"?"node":t==="go"?"go":t==="java"?"java":t==="php"?"php":t==="rust"?"rust":t==="dotnet"?"dotnet":t==="elixir"?"elixir":t==="ruby"?"ruby":t==="clojure"||t==="scala"||t==="kotlin"?"jvm-generic":null).filter(t=>t!==null).filter((t,n,o)=>o.indexOf(t)===n);return {primary:r.length>0?r[0]:"unknown",secondary:r.slice(1)}}function ze(e){return pt(e).primary}function ge(e,r){if(!e)return "unknown";r||(r={setup:["ModuleNotFoundError","No module named","npm ERR!","error:","not found"],"test-failure":["FAILED","FAIL","failed"],dependency:["cannot find module","import.*error"],runtime:["Exception","Error:","panic","TypeError"],timeout:["timeout","Timeout","deadline exceeded"],unknown:[]});for(let[t,n]of Object.entries(r))for(let o of n)if(new RegExp(o,"i").test(e))return t;return "unknown"}async function se(e,r){let t=e.split(/[&|;]\s*/)[0].trim().split(/\s+/)[0];if(["echo","cd","pwd","test","true","false","exit"].includes(t))return {valid:true};if(t.includes("/")||t.includes("\\")){let o=w.isAbsolute(t)?t:w.resolve(r??process.cwd(),t);try{return await J.promises.access(o,process.platform==="win32"?J.constants.F_OK:J.constants.X_OK),{valid:true}}catch{return {valid:false,reason:`Command '${t}' not found or not executable in '${r??process.cwd()}'`}}}try{let o=process.platform==="win32"?"where":"which";if((await execa(o,[t],{reject:false})).exitCode===0)return {valid:true}}catch{}return {valid:false,reason:`Command '${t}' not found or not executable`}}function Ve(e,r,t){if(!r)return e;let n=typeof r=="object"&&!Array.isArray(r)&&("dev"in r||"staging"in r||"prod"in r||"default"in r)&&!Object.keys(r).some(o=>["init","test","build","start"].includes(o))?r:{};return t&&typeof n[t]=="string"?n[t]:typeof n.default=="string"?n.default:e}async function Je(e,r){if(!e)return {healthy:true};switch(e.type){case "port":{let t=e.value;try{let n=await import('net');return new Promise(o=>{let s=new n.Socket,u=5e3;s.setTimeout(u),s.on("connect",()=>{s.destroy(),o({healthy:true,reason:`Port ${t} is listening`});}),s.on("timeout",()=>{s.destroy(),o({healthy:false,reason:`Port ${t} timeout after ${u}ms`});}),s.on("error",c=>{s.destroy(),o({healthy:false,reason:`Port ${t} error: ${String(c)}`});}),s.connect(t,"localhost");})}catch(n){return {healthy:false,reason:`Port check error: ${n instanceof Error?n.message:String(n)}`}}}case "http":{let t=e.value,n;try{let o=new AbortController;n=setTimeout(()=>o.abort(),5e3);let s=await fetch(t,{method:"GET",signal:o.signal});return {healthy:s.status===200,reason:`HTTP ${s.status}`,metadata:{status:s.status}}}catch(o){return {healthy:false,reason:`HTTP check error: ${o instanceof Error?o.message:String(o)}`}}finally{n&&clearTimeout(n);}}case "log":{let t=e.value;if(!r)return {healthy:true};try{let n=[w.join(r,".workspai","last-run.log"),w.join(r,".rapidkit","last-run.log")].find(o=>J.existsSync(o));if(n){let o=J.readFileSync(n,"utf-8"),s=new RegExp(t,"i");return {healthy:s.test(o),reason:s.test(o)?"Log pattern found":"Log pattern not found"}}return {healthy:true,reason:"No log file to check"}}catch(n){return {healthy:false,reason:`Log check error: ${n instanceof Error?n.message:String(n)}`}}}case "command":{let t=e.value;try{let n=await execa(t,[],{cwd:r,reject:false,shell:true});return {healthy:n.exitCode===0,reason:n.exitCode===0?"Health check passed":"Health check failed",metadata:{exitCode:n.exitCode}}}catch(n){return {healthy:false,reason:`Command check error: ${n instanceof Error?n.message:String(n)}`}}}default:return {healthy:true}}}var qe={init:"init",test:"test",build:"build",start:"start"};function mt(e){return e in qe?qe[e]:null}function ft(e,r){let n=q$1(e)?.contextJson?.commands;if(!n||typeof n!="object"||Array.isArray(n))return;let o=n[r];if(typeof o=="string"&&o.trim().length>0)return o.trim();if(o&&typeof o=="object"&&!Array.isArray(o)){let s=o,u=s.default??s.dev;if(typeof u=="string"&&u.trim().length>0)return u.trim()}}function Ye(e,r,t=z$1(e)){let n=mt(r);if(!n)return ft(e,r)?{supported:true}:{supported:false,reason:`Workspace stage "${r}" is not part of the Workspai fleet contract.`};if(!t.projectRoot)return {supported:false,reason:"No Workspai project metadata was detected for this target."};let o=t.commandMap[n];if(!o||o.status!=="supported"){let s=t.runtimeSupportTier==="observed"||t.frameworkSupportTier==="observed";return {supported:false,reason:o?.reason??`Command "${n}" is not supported for this project runtime/framework.`,shouldFail:!s}}return {supported:true}}var gt=new Set(["init","test","build","start"]),yt=new Set([".git","node_modules",".workspai",".rapidkit",".venv","dist","build","coverage","htmlcov"]);async function z(e){try{return await J.promises.access(e,J.constants.F_OK),true}catch{return false}}async function ht(e){for(let r of e)if(await z(r))return true;return false}async function kt(e,r,t){if(r==="python"){let o=[w.join(e,".workspai","cli.py"),w.join(e,".rapidkit","cli.py")];for(let s of o)if(await z(s))return {valid:true};return {valid:false,reason:"Project-local .workspai/cli.py is missing. Run `workspai init` in this project first."}}let n=t.trim().split(/\s+/)[0];if(n&&["npm","npx","pnpm","yarn"].includes(n)){let o=e$1(n);if((await execa(o.command,[...o.prefixArgs,"--version"],{reject:false,env:g$1()})).exitCode===0)return {valid:true}}return se(t,e)}async function ae(e){let r=await J.promises.readFile(e,"utf-8");return JSON.parse(r)}function I(e){return e.replace(/\\/g,"/")}function bt(e){let r=e?.trim();return r?r.startsWith("project:")?r.slice(8).trim()||null:r:null}async function wt(e){let r=w.join(e,p.model);if(await z(r))try{let n=((await ae(r)).projects??[]).map(o=>typeof o.path=="string"?w.resolve(e,o.path):null).filter(o=>!!o).filter((o,s,u)=>u.indexOf(o)===s).filter(o=>J.existsSync(o));if(n.length>0)return n.sort()}catch{}return a$1(e,{skipDirs:yt,includeHiddenDirs:false,descendIntoMatchedProjects:false,isProjectDir:async(t,n)=>await ht([...u(t,"context.json"),...u(t,"project.json")])?true:w.resolve(t)===w.resolve(n)?false:k(t).length>0})}async function rt(e){for(let r of [w.join(".workspai","project.json"),w.join(".workspai","context.json"),w.join(".rapidkit","project.json"),w.join(".rapidkit","context.json")]){let t=w.join(e,r);if(await z(t))try{let n=await ae(t),o=n.name??n.projectName??n.slug;if(typeof o=="string"&&o.trim())return o.trim()}catch{}}return null}async function xt(e,r,t){let n=bt(t);if(!n)return {projects:r,normalizedScope:null};let o=I(n).toLowerCase(),s=[];for(let u of r){let c=I(w.relative(e,u)),m=w.basename(u),f=await rt(u);[c,m,f].filter(i=>typeof i=="string"&&i.length>0).map(i=>I(i).toLowerCase()).includes(o)&&s.push(u);}if(s.length===0)throw new Error(`Workspace run scope did not match any project: ${t}`);return {projects:s,normalizedScope:n}}async function vt(e,r,t){let n=await execa("git",["diff","--name-only",`${t}...HEAD`],{cwd:e,reject:false,env:a$2()});if(n.exitCode!==0)return new Set(r);let o=n.stdout.split(/\r?\n/).map(u=>u.trim()).filter(u=>u.length>0).map(u=>I(u));if(o.length===0)return new Set;let s=new Set;for(let u of r){let c=I(w.relative(e,u));if(!c||c===".")continue;let m=`${c}/`;o.some(f=>f===c||f.startsWith(m))&&s.add(u);}return s}async function Rt(e,r,t$1){let n=await f(e,t.workspaceContract)??q(e,"workspace.contract.json");if(await z(n))try{let d=await St(e,r,t$1,n);if(d.graphStatus!=="missing")return d}catch{return {expanded:t$1,graphStatus:"invalid",expansionDepth:0}}let o=await f(e,".workspai/workspace-dependency-graph.json")??q(e,"workspace-dependency-graph.json");if(!await z(o))return {expanded:t$1,graphStatus:"missing",expansionDepth:0};let s;try{s=await ae(o);}catch{return {expanded:t$1,graphStatus:"invalid",expansionDepth:0}}let u=new Set(r.map(d=>w.resolve(d))),c=new Map;if(!s||typeof s!="object"||Array.isArray(s))return {expanded:t$1,graphStatus:"invalid",expansionDepth:0};let m=Array.isArray(s.projects)?s.projects:[];for(let d of m){if(!d||typeof d!="object"||Array.isArray(d))continue;let i=d,l=typeof i.path=="string"?i.path:"",h=w.resolve(e,l);if(!u.has(h))continue;let k=Array.isArray(i.dependsOn)?i.dependsOn.filter(S=>typeof S=="string"):[];for(let S of k){let g=w.resolve(e,S);u.has(g)&&(c.has(g)||c.set(g,new Set),c.get(g)?.add(h));}}let f$1=d$2(c,t$1);return {expanded:f$1.reached,graphStatus:"loaded",expansionDepth:f$1.added}}async function St(e,r,t,n){let o=await ae(n);if(!o||typeof o!="object"||Array.isArray(o))return {expanded:t,graphStatus:"invalid",expansionDepth:0};let s=o,u=Array.isArray(s.projects)?s.projects:null;if(!u)return {expanded:t,graphStatus:"invalid",expansionDepth:0};let c=new Map,m=new Map;for(let h of r){let k=I(w.relative(e,h));m.set(k,w.resolve(h));}let f=new Map,d=new Map,i=new Map;for(let h of u){if(!h||typeof h!="object"||Array.isArray(h))continue;let k=h,S=typeof k.slug=="string"?k.slug:"",g=typeof k.relativePath=="string"?I(k.relativePath):S,y=m.get(g);!S||!y||c.set(S,y);}for(let h of u){if(!h||typeof h!="object"||Array.isArray(h))continue;let k=h,S=typeof k.slug=="string"?k.slug:"",g=c.get(S);if(!g)continue;let y=k.contracts&&typeof k.contracts=="object"&&!Array.isArray(k.contracts)?k.contracts:{},P=Array.isArray(y.dependsOn)?y.dependsOn.filter(R=>typeof R=="string"):[],$=Array.isArray(y.publishes)?y.publishes.filter(R=>typeof R=="string"):[],L=Array.isArray(y.consumes)?y.consumes.filter(R=>typeof R=="string"):[];for(let R of P){let E=c.get(R);E&&(i.has(E)||i.set(E,new Set),i.get(E)?.add(g));}for(let R of $)f.has(R)||f.set(R,new Set),f.get(R)?.add(g);for(let R of L)d.has(R)||d.set(R,new Set),d.get(R)?.add(g);}for(let[h,k]of f.entries()){let S=d.get(h);if(S)for(let g of k){i.has(g)||i.set(g,new Set);for(let y of S)y!==g&&i.get(g)?.add(y);}}let l=d$2(i,t);return {expanded:l.reached,graphStatus:"loaded",expansionDepth:l.added}}async function Ct(e,r){if(typeof r=="boolean")return r;let t=t$1(e,"policies.yml").find(s=>J.existsSync(s))??q(e,"policies.yml");if(!await z(t))return true;let n="";try{n=await J.promises.readFile(t,"utf-8");}catch{return true}let o=n.match(/^[\t ]*rules\.enforce_workspace_run_gates:\s*(true|false)\s*(?:#.*)?$/m);return o?o[1]==="true":true}function Et(e){let r=process.env.RAPIDKIT_WORKSPACE_RUN_STAGE_TIMEOUT_MS;if(r){let t=Number.parseInt(r,10);if(Number.isFinite(t)&&t>0)return t}return e==="init"?12e4:9e4}function jt(e){let r=e.trim();if(!/^\.\.?[\\/]/.test(r)||/[&|;<>()$`"']/.test(r))return null;let[t,...n]=r.split(/\s+/);return t?{file:t,args:n}:null}function Xe(e,r){let t=Number.parseInt(process.env[e]??"",10);return Number.isFinite(t)&&t>0?t:r}function ye(e){return new Promise(r=>setTimeout(r,e))}async function Pt(e){let r=process.argv[1];if(e.useRapidkitWrapper&&!r)return {exitCode:1,stdout:"",stderr:"Workspai entrypoint is unavailable for startup verification.",healthStatus:{healthy:false,reason:"Workspai entrypoint is unavailable."}};let t=e.useRapidkitWrapper&&r?execa(process.execPath,[r,"start"],{cwd:e.projectPath,reject:false,timeout:e.timeoutMs,env:{...process.env,RAPIDKIT_WORKSPACE_RUN_CHILD:"1"}}):execa(e.finalCommand,[],{cwd:e.projectPath,reject:false,shell:true,timeout:e.timeoutMs}),n=Promise.resolve(t).then(d=>({kind:"exit",result:d}),d=>({kind:"error",error:d})),o=Xe("WORKSPAI_WORKSPACE_RUN_STARTUP_GRACE_MS",2e3),s=await Promise.race([n,ye(o).then(()=>({kind:"alive"}))]);if(s.kind==="error"){let d=typeof s.error=="object"&&s.error!==null&&"timedOut"in s.error&&!!s.error.timedOut;return {exitCode:d?124:1,stdout:"",stderr:s.error instanceof Error?s.error.message:String(s.error),timedOut:d,healthStatus:{healthy:false,reason:"The start command failed before readiness."}}}if(s.kind==="exit"){let d=Number(s.result.exitCode??0);return {exitCode:d,stdout:String(s.result.stdout??""),stderr:String(s.result.stderr??""),healthStatus:{healthy:d===0,reason:d===0?"The start command completed successfully.":`The start command exited with code ${d} before readiness.`}}}let u=oe(e.runtime,e.framework)?.healthCheck,c=u?{healthy:false,reason:"The configured health check has not passed yet."}:{healthy:true,reason:`The service remained alive for ${o}ms (bounded startup smoke).`};if(u){let d=Xe("WORKSPAI_WORKSPACE_RUN_STARTUP_HEALTH_TIMEOUT_MS",15e3),i=Date.now()+d;for(;Date.now()<i;){let l=await Je(u,e.projectPath);if(c={healthy:l.healthy,reason:l.reason},l.healthy)break;if((await Promise.race([n,ye(350).then(()=>({kind:"alive"}))])).kind!=="alive"){c={healthy:false,reason:"The service exited before its configured health check passed."};break}}}try{t.kill?.("SIGTERM",{forceKillAfterDelay:1e3});}catch{try{t.kill?.();}catch{}}let m=await Promise.race([n,ye(2e3).then(()=>({kind:"alive"}))]),f=m.kind==="exit"?m.result:void 0;return {exitCode:c.healthy?0:1,stdout:String(f?.stdout??""),stderr:String(f?.stderr??""),healthStatus:c}}async function he(e,r,t){let n=process.argv[1];if(!n)return {exitCode:1,stdout:"",stderr:"RapidKit entrypoint is unavailable for nested workspace-run execution."};try{let o=await execa(process.execPath,[n,...e],{cwd:r,reject:false,timeout:t,env:{...process.env,RAPIDKIT_WORKSPACE_RUN_CHILD:"1"}});return {exitCode:Number(o.exitCode??1),stdout:o.stdout,stderr:o.stderr}}catch(o){return {exitCode:typeof o=="object"&&o!==null&&"timedOut"in o&&!!o.timedOut?124:1,stdout:typeof o=="object"&&o!==null&&"stdout"in o?String(o.stdout??""):"",stderr:typeof o=="object"&&o!==null&&"stderr"in o?String(o.stderr??""):o instanceof Error?o.message:String(o)}}}function At(e){return e==="node"||e==="go"||e==="java"||e==="python"||e==="dotnet"||e==="rust"||e==="php"}function Ft(){return process.env.VITEST==="true"||process.env.VITEST==="1"||process.env.NODE_ENV==="test"}function Ot(e,r=8){if(e.length<=r)return e.join(`
|
|
2
|
+
`);let t=3;return [...e.slice(0,t),...e.slice(-(r-t))].join(`
|
|
3
|
+
`)}function Dt(e){let r=/(?:\bnot found\b|\bno such\b|\bmissing\b|\bfailed\b|\berror\b|\bexception\b|\bcannot\b|\bdenied\b|\btimeout\b|\btimed out\b|\benoent\b|\beacces\b|\beperm\b)/i;return [...e].reverse().find(t=>r.test(t))??e.at(-1)}async function Tt(e){let r=process.cwd();try{process.chdir(e);let{handleInitCommand:t}=await import('./index.js');return {exitCode:await t(["init"]),stdout:"",stderr:""}}finally{process.chdir(r);}}async function Qe(e){let r=i=>{let l=g(i);return l==="node"||l==="bun"?"node":l==="python"?"python":l==="go"?"go":l==="java"?"java":l==="php"?"php":l==="ruby"?"ruby":l==="rust"?"rust":l==="dotnet"?"dotnet":l==="elixir"?"elixir":l==="clojure"||l==="scala"||l==="kotlin"?"jvm-generic":ze(e)},t=i=>{if(!i)return;let l=f$1(i);if(new Set(["fastapi","django","flask","nestjs","express","fastify","koa","gofiber","gogin","echo","springboot","laravel","symfony","rails","sinatra","dotnet","actix","axum","rocket","phoenix"]).has(l))return l},n=q$1(e),o=n?.detection??m(e,n?.projectJson??null),s=n?.contextJson,u=r(o.runtime),c=t(o.key),m$1={},f=new Set(["init","test","build","start"]);if(s?.commands&&typeof s.commands=="object")for(let[i,l]of Object.entries(s.commands))typeof l=="string"&&f.has(i)&&(m$1[i]=l);let d;if(s?.commandEnvironments&&typeof s.commandEnvironments=="object"){let i=s.commandEnvironments;d={dev:typeof i.dev=="string"?i.dev:void 0,staging:typeof i.staging=="string"?i.staging:void 0,prod:typeof i.prod=="string"?i.prod:void 0,default:typeof i.default=="string"?i.default:void 0};}return {runtime:u,framework:c,commandOverrides:Object.keys(m$1).length>0?m$1:void 0,environmentCommandVariants:d,environment:typeof s?.environment=="string"?s.environment:void 0}}async function Ze(e,r,t,n,o,s,u){let c=!o?.[r]&&At(t),m;if(o&&o[r]?m=o[r]:c?m=`rapidkit ${r}`:m=fe({projectPath:e,runtime:t,framework:n,stage:r}),!m)return {exitCode:127,command:`<stage not supported for ${t}>`,message:`No stage command found for runtime '${t}' and framework '${n||"unknown"}'`,errorCategory:"runtime"};let f=Ve(m,s,u);if(!f)return {exitCode:127,command:m,message:"Failed to resolve stage command",errorCategory:"runtime"};let d=fe({projectPath:e,runtime:t,framework:n,stage:r});if(c){if(d){let v=c?await kt(e,t,d):await se(d,e);if(!v.valid)return {exitCode:127,command:f,message:v.reason||"Command not available",errorCategory:"setup"}}}else {let v=await se(f,e);if(!v.valid)return {exitCode:127,command:f,message:v.reason||"Command not available",errorCategory:"setup"}}let i=0,l="",h="",k,S,g=Et(r),y=Date.now();try{let v=r==="start"?await Pt({projectPath:e,finalCommand:f,useRapidkitWrapper:c,runtime:t,framework:n,timeoutMs:g}):c?r==="init"&&Ft()?await Tt(e):await he([r],e,g):await(async()=>{let A=jt(f);return A?execa(A.file,A.args,{cwd:e,reject:false,timeout:g,forceKillAfterDelay:1e3}):execa(f,[],{cwd:e,reject:false,shell:true,timeout:g,forceKillAfterDelay:1e3})})();if(i=Number(v.exitCode??0),l=v.stdout,h=v.stderr,S=r==="start"?v.healthStatus:void 0,i!==0){let A=`${l}
|
|
4
|
+
${h}`,G=Date.now()-y;k=i===124||ge(A)==="timeout"||i===143&&G>=Math.floor(g*.8)?"timeout":ge(A);}}catch(v){let A=typeof v=="object"&&v!==null&&"timedOut"in v&&!!v.timedOut;return {exitCode:A?124:1,command:f,message:A?`Stage timed out after ${g}ms`:v instanceof Error?v.message:"Command execution failed",errorCategory:A?"timeout":"runtime"}}let P=`${l}
|
|
5
|
+
${h}`.split(/\r?\n/).map(v=>v.trim()).filter(Boolean),$=Ot(P),L=Dt(P),R=Date.now()-y,E=i===124||k==="timeout"||i===143&&R>=Math.floor(g*.8),O=i===0?void 0:E?"timeout":k,M=i===0||!O?void 0:{category:O,exitCode:i,command:f,timedOut:E,timeoutMs:g,...$?{outputExcerpt:$}:{}};return {exitCode:i,command:f,errorCategory:O,healthStatus:S,failureDiagnostic:M,message:E?`Stage timed out after ${g}ms`:i!==0?L?`Stage failed with exit code ${i}: ${L}`:`Stage failed with exit code ${i}`:void 0}}function et(e){try{return JSON.parse(e)}catch{return null}}function Wt(e){switch(e){case "dotnet":return "Install .NET 8+ SDK, then rerun `npx workspai setup dotnet` or `npx workspai init`.";case "go":return "Install Go 1.21+, then rerun `npx workspai setup go` or `npx workspai init`.";case "java":case "jvm-generic":return "Install Java 21+ and Maven/Gradle, then rerun `npx workspai setup java` or `npx workspai init`.";case "node":return "Install Node.js LTS and npm/pnpm/yarn, then rerun `npx workspai setup node` or `npx workspai init`.";case "python":return "Install Python 3.10+ and pip/Poetry, then rerun `npx workspai setup python` or `npx workspai init`.";default:return null}}async function It(e){let r=[],t=await he(["doctor","workspace","--json"],e);if(t.exitCode!==0)r.push({gate:"doctor-workspace",status:"fail",summary:"doctor workspace command failed"});else {let s=et(t.stdout)?.healthScore,u=Number(s?.errors??0);Number.isFinite(u)&&u>0?r.push({gate:"doctor-workspace",status:"fail",summary:`doctor workspace reports ${u} error(s)`}):r.push({gate:"doctor-workspace",status:"pass",summary:"doctor workspace passed"});}let n=await he(["readiness","--json"],e);if(n.exitCode!==0)r.push({gate:"readiness",status:"fail",summary:"readiness command failed"});else {let o=et(n.stdout),s=String(o?.overallStatus??"").toLowerCase();s==="fail"?r.push({gate:"readiness",status:"fail",summary:"readiness overall status is fail"}):s==="warn"?r.push({gate:"readiness",status:"warn",summary:"readiness overall status is warn"}):r.push({gate:"readiness",status:"pass",summary:"readiness overall status is pass"});}return r}var $t=new Set(["dev","stop"]);function Mt(e){let r=e.trim();return !r||$t.has(r.toLowerCase())?false:gt.has(r)?true:/^[a-z][a-z0-9_-]*$/i.test(r)}function tt(e,r,t){let n=I(w.relative(t,r));return (Array.isArray(e.projects)?e.projects:[]).some(s=>{if(!s||typeof s!="object")return false;let u=s,c=[u.relativePath,u.path].filter(m=>typeof m=="string"&&m.length>0).map(m=>I(m));return u.status==="passed"&&(c.includes(n)||c.some(m=>m.endsWith(`/${n}`)))})}function Nt(e,r){return oe(e,r)?.dependencies??[]}function _t(e,r){let t=Math.max(1,Math.min(4,r)),n=Number(e??t);return Number.isFinite(n)?Math.max(1,Math.min(16,Math.trunc(n))):t}async function br(e$1){if(!Mt(e$1.stage))throw new Error(`Unsupported workspace run stage: ${e$1.stage}`);let r=Date.now(),t=w.resolve(e$1.workspacePath);c({blockId:"workspace.run.resolve",status:"running",message:"Resolving workspace project fleet",component:"workspace-run"});let n=await d(t),o=await wt(t),{projects:s,normalizedScope:u}=await xt(t,o,e$1.scope),c$1=e$1.affected===true,m=e$1.blastRadius===true,f=e$1.since?.trim()||"HEAD~1",d$2=c$1?await vt(t,s,f):new Set(s),i,l="not-applicable",h=0,k="all";if(c$1&&m){let p=await Rt(t,o,d$2);i=p.expanded,l=p.graphStatus,h=p.expansionDepth,k="affected+blast-radius";}else c$1?(i=d$2,k="affected"):(i=d$2,k="all");c({blockId:"workspace.run.resolve",status:"succeeded",message:`Resolved ${s.length} project(s)`,component:"workspace-run",attributes:{projects:s.length,selectionMode:k}}),c({blockId:"workspace.run.gates",status:"running",message:"Evaluating workspace run gates",component:"workspace-run"});let S=e$1.stage==="init"||e$1.planOnly===true?false:await Ct(t,e$1.enforceGates),g=S?await It(t):[{gate:"doctor-workspace",status:"skipped",summary:"workspace run gates disabled"},{gate:"readiness",status:"skipped",summary:"workspace run gates disabled"}],y=g.find(p=>p.status==="fail");c({blockId:"workspace.run.gates",status:y?"blocked":"succeeded",message:y?`Blocked by ${y.gate}`:"Workspace run gates passed",component:"workspace-run",attributes:{gates:g}});let P=s.filter(p=>i.has(p)),$=e$1.continueOnError===true||e$1.stage==="init",L=e$1.parallel===true,R=_t(e$1.maxWorkers,P.length),E=P.length,O=0;c({blockId:"workspace.run.execute",status:y?"blocked":"running",message:y?`Execution blocked by ${y.gate}`:`Executing ${e$1.stage} across ${E} project(s)`,component:"workspace-run",progress:{completed:0,total:E},attributes:{stage:e$1.stage,parallel:L,maxWorkers:R}}),e$1.json||console.log(T.gray(`Workspace run (${e$1.stage}) started: ${E} target(s), ${L?`parallel x${R}`:"sequential"}`));let M=new Map;for(let p of o){let b=I(w.relative(t,p)),a=await rt(p),N=s.includes(p),j=N&&i.has(p);M.set(p,{path:p,relativePath:b,projectName:a??(w.basename(b)||w.basename(p)),selected:j,affected:j,status:"skipped",exitCode:null,durationMs:0,reason:j?void 0:N?"not affected":"outside scope",framework:void 0,runtimeDetected:void 0,executionCommand:void 0});}if(y)for(let p of P){let b=M.get(p);b&&(b.status="skipped",b.reason=`blocked by ${y.gate}`);}else {let p=async b=>{let a$1=M.get(b);if(!a$1)return;let N=I(w.relative(t,b));e$1.json||console.log(T.gray(`\u23F3 [${O}/${E}] ${e$1.stage} ${N}`)),a$1.selected=true,a$1.affected=true;let j=Date.now(),W=a(b),D=e$1.runtime?.trim().toLowerCase(),B=W.units.filter(x=>!D||x.runtime===D).map(x=>({unit:x,stage:x.stages.find(F=>F.stage===e$1.stage)})).filter(x=>!!x.stage),Y=B.map(({unit:x,stage:F})=>({unitId:x.id,runtime:x.runtime,role:x.role,root:x.root,manifest:x.manifest,stage:F.stage,command:F.command,status:"planned",exitCode:null,durationMs:0}));if(a$1.runtimeExecutions=Y,e$1.planOnly){a$1.runtimeDetected=B[0]?.unit.runtime,a$1.status="skipped",a$1.reason=B.length>0?`plan only: ${B.length} runtime unit(s)`:D?`no ${D} runtime unit supports stage "${e$1.stage}"`:`no runtime unit supports stage "${e$1.stage}"`,a$1.durationMs=Date.now()-j,O+=1;return}if(W.polyglot||D){if(B.length===0){a$1.status="failed",a$1.reason=D?`No ${D} runtime unit supports stage "${e$1.stage}"`:`No runtime unit supports stage "${e$1.stage}"`,a$1.errorCategory="setup",a$1.errorMessage=a$1.reason,a$1.exitCode=127,a$1.durationMs=Date.now()-j,O+=1;return}let x;for(let C=0;C<B.length;C+=1){let{unit:xe,stage:ve}=B[C],V=Y[C],Re=w.resolve(b,xe.root),ut=Date.now(),de=await Qe(Re),U=await Ze(Re,e$1.stage,xe.runtime,de.framework,{[e$1.stage]:ve.command},de.environmentCommandVariants,de.environment);if(V.durationMs=Date.now()-ut,V.exitCode=U.exitCode,V.status=U.exitCode===0?"passed":"failed",V.reason=U.message,V.errorCategory=U.errorCategory,V.failureDiagnostic=U.failureDiagnostic,U.exitCode!==0&&!x&&(x=U.message??ve.command),U.exitCode!==0&&!$){for(let Se of Y.slice(C+1))Se.status="skipped",Se.reason="stopped after runtime-unit failure";break}}let F=Y.find(C=>C.status==="failed");a$1.runtimeDetected=B[0]?.unit.runtime,a$1.executionCommand=Y.filter(C=>C.status!=="skipped").map(C=>`[${C.runtime}:${C.root}] ${C.command}`).join(" && "),a$1.durationMs=Date.now()-j,a$1.exitCode=F?.exitCode??0,a$1.status=F?"failed":"passed",a$1.reason=F?x??"runtime-unit stage failed":void 0,a$1.errorCategory=F?F.errorCategory??"runtime":void 0,a$1.errorMessage=a$1.reason,a$1.failureDiagnostic=F?.failureDiagnostic,O+=1;return}let{runtime:ie,framework:ue,commandOverrides:st,environmentCommandVariants:at,environment:it}=await Qe(b);a$1.runtimeDetected=ie,a$1.framework=ue;let ce=Ye(b,e$1.stage);if(!ce.supported){a$1.status=ce.shouldFail===false?"skipped":"failed",a$1.reason=ce.reason??`stage "${e$1.stage}" unsupported for project`,a$1.durationMs=Date.now()-j,a$1.exitCode=a$1.status==="failed"?127:null,a$1.status==="failed"&&(a$1.errorCategory="setup",a$1.errorMessage=a$1.reason),O+=1;return}if(e$1.reusePassed&&n){let x=n.stages[e$1.stage]??n.stages[e$1.stage];if(x&&tt(x,b,t)){a$1.status="passed",a$1.reason="reused passed result from workspace-run-last.json",a$1.durationMs=Date.now()-j,a$1.exitCode=0,O+=1,e$1.json||console.log(T.gray(`\u21BA reused passed cache for ${N}`));return}}let we=Nt(ie,ue).filter(x=>x!==e$1.stage);if(we.length>0&&n){let x=we.find(F=>{let C=n.stages[F];return !C||!tt(C,b,t)});if(x){a$1.status="skipped",a$1.reason=`dependency stage "${x}" not satisfied in workspace-run-last.json`,a$1.durationMs=Date.now()-j,a$1.exitCode=null,O+=1;return}}let K=await Ze(b,e$1.stage,ie,ue,st,at,it);if(a$1.executionCommand=K.command,a$1.errorCategory=K.errorCategory,a$1.healthStatus=K.healthStatus,a$1.failureDiagnostic=K.failureDiagnostic,a$1.durationMs=Date.now()-j,a$1.exitCode=K.exitCode,K.exitCode===0?(a$1.status="passed",a$1.reason=void 0):(a$1.status="failed",a$1.reason=K.message||"stage command failed",a$1.errorMessage=K.message),O+=1,!e$1.json){let x=E>0?Math.round(O/E*100):100,F=a$1.status==="passed"?T.green("\u2705"):T.red("\u274C");if(console.log(T.gray(`${F} [${O}/${E}] (${x}%) ${N} ${a$1.durationMs}ms`)),a$1.status==="failed"){a$1.reason&&console.log(T.red(` Reason: ${a$1.reason}`)),a$1.executionCommand&&console.log(T.gray(` Command: ${a$1.executionCommand}`));let C=Wt(a$1.runtimeDetected);C&&a$1.errorCategory==="setup"&&console.log(T.gray(` Hint: ${C}`));}}};if(L&&P.length>1){let b=0,a=false,N=new Array(R).fill(null).map(async()=>{for(;b<P.length;){if(a&&!$)return;let j=b;b+=1;let W=P[j];await p(W),M.get(W)?.status==="failed"&&(a=true);}});if(await Promise.all(N),!$&&a){let j=false;for(let W of P){let D=M.get(W);if(D){if(D.status==="failed"){j=true;continue}j&&D.status==="skipped"&&(D.reason=D.reason||"stopped after failure");}}}}else for(let b of P){await p(b);let a=M.get(b);if(!$&&a?.status==="failed"){let N=P.slice(P.indexOf(b)+1);for(let j of N){let W=M.get(j);W&&(W.status="skipped",W.reason="stopped after failure");}break}}}let v=[];for(let p of o){let b=M.get(p);b&&v.push(b);}let A=v.filter(p=>p.status==="passed").length,G=v.filter(p=>p.status==="failed").length,q=v.filter(p=>p.status==="skipped").length;c({blockId:"workspace.run.execute",status:G>0?"failed":y?"blocked":"succeeded",message:`Workspace run finished: ${A} passed, ${G} failed, ${q} skipped`,component:"workspace-run",progress:{completed:E,total:E,percent:100},attributes:{passed:A,failed:G,skipped:q,stage:e$1.stage}});let ke=e$1.strict===true,nt=G>0||ke&&g.some(p=>p.status==="fail"||p.status==="warn")?1:0,be={schemaVersion:"1.0",workspacePath:t,stage:e$1.stage,generatedAt:new Date().toISOString(),durationMs:Date.now()-r,options:{affected:c$1,blastRadius:m,since:c$1?f:null,parallel:L,maxWorkers:R,continueOnError:$,strict:ke,enforceGates:S,scope:u,reusePassed:e$1.reusePassed===true,planOnly:e$1.planOnly===true,runtime:e$1.runtime?.trim()||null},selection:{mode:k,since:c$1?f:null,scope:u,graphStatus:l,expansionDepth:h},gates:{enforced:S,results:g,blocked:!!y,blockingGate:y?.gate},summary:{projectCount:o.length,selectedCount:P.length,passed:A,failed:G,skipped:q,exitCode:nt},projects:v,enterpriseControls:{jsonReady:true,evidencePath:b}},ot=w.join(t,b);c({blockId:"workspace.run.publish",status:"running",message:"Publishing workspace run evidence",component:"workspace.run"});try{await e(t,be),c({blockId:"workspace.run.publish",status:"succeeded",message:"Workspace run evidence published",component:"workspace.run"}),d$1({workspacePath:t,relativePath:b,blockId:"workspace.run.publish"});}catch(p){throw c({blockId:"workspace.run.publish",status:"failed",message:p instanceof Error?p.message:"Workspace run evidence publish failed",component:"workspace.run"}),p}return e$1.json||(y&&(console.log(T.red(`\u274C Workspace run blocked by ${y.gate}`)),console.log(T.gray(` ${y.summary}`))),console.log(T.cyan(`Workspace run (${e$1.stage}) => passed: ${A}, failed: ${G}, skipped: ${q}`)),console.log(T.gray(`Report: ${ot}`))),be}export{br as a};
|