workspai 0.73.0 → 0.75.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/contracts/agent-framework-capabilities.v1.json +454 -0
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +166 -0
- package/contracts/create-planner-capabilities.v1.json +24 -0
- package/contracts/extension-cli-compatibility.v1.json +6 -0
- package/contracts/published-contract-catalog.v1.json +30 -0
- package/contracts/runtime-command-surface.v1.json +78 -4
- package/contracts/workspace-intelligence/agent-framework-adapter-manifest.v1.json +2127 -0
- package/contracts/workspace-intelligence/agent-framework-admission-candidate.v1.json +193 -0
- package/contracts/workspace-intelligence/agent-framework-change-plan.v1.json +280 -0
- package/contracts/workspace-intelligence/agent-framework-conformance-report.v1.json +269 -0
- package/contracts/workspace-intelligence/agent-framework-ownership-receipt.v1.json +147 -0
- package/contracts/workspace-intelligence/workspace-model.v1.json +4 -0
- package/contracts/workspace-intelligence-architecture.v1.json +28 -2
- package/dist/analyze-FRQVJ3VJ.js +1 -0
- package/dist/{artifact-remediation-plan-WDK5ISRU.js → artifact-remediation-plan-HD5K52UJ.js} +1 -1
- package/dist/autopilot-release-D3UES53H.js +1 -0
- package/dist/capabilities-command-VK3LQLP2.js +1 -0
- package/dist/chunk-252EKOR6.js +2 -0
- package/dist/chunk-36VNERGC.js +1 -0
- package/dist/{chunk-TZK2R6RD.js → chunk-4DX4HBG3.js} +1 -1
- package/dist/chunk-4KEZQLBU.js +2 -0
- package/dist/{chunk-PKKSRXUS.js → chunk-6B7L4NZE.js} +1 -1
- package/dist/chunk-7NKM6EHE.js +7 -0
- package/dist/{chunk-FE5R6EUV.js → chunk-BLEIUQL6.js} +1 -1
- package/dist/{chunk-37SWTS2B.js → chunk-BR6QIYQS.js} +1 -1
- package/dist/chunk-CGNMS32W.js +97 -0
- package/dist/{chunk-3GO7BJ5J.js → chunk-CK73SQFF.js} +1 -1
- package/dist/chunk-CMLLERGG.js +418 -0
- package/dist/{chunk-MGL6DBOR.js → chunk-COOVCORC.js} +1 -1
- package/dist/chunk-D4AMCZJU.js +7 -0
- package/dist/chunk-DFREJHG7.js +1 -0
- package/dist/{chunk-OIGI7MP6.js → chunk-DJH2CH42.js} +1 -1
- package/dist/chunk-DT3LRKZQ.js +1 -0
- package/dist/{chunk-D3N2WFDV.js → chunk-FS3WLRQ4.js} +1 -1
- package/dist/chunk-G3ZC5W4U.js +1 -0
- package/dist/{chunk-TIZCESKY.js → chunk-GE46XKD2.js} +1 -1
- package/dist/chunk-GIFAGOMK.js +2 -0
- package/dist/{chunk-FRH7AIGY.js → chunk-HLSOZOL3.js} +3 -3
- package/dist/chunk-J4J3RYCL.js +4 -0
- package/dist/{chunk-JK6XEF7K.js → chunk-JKAAKE4Z.js} +1 -1
- package/dist/chunk-LMOTDLJF.js +2 -0
- package/dist/{chunk-DNKELRK6.js → chunk-MXI2DWLL.js} +1 -1
- package/dist/chunk-NFWUAEVQ.js +12 -0
- package/dist/chunk-NGU7RYXA.js +9 -0
- package/dist/{chunk-3WHE7V4M.js → chunk-NLRZFIC6.js} +1 -1
- package/dist/chunk-O2CFT2A3.js +1 -0
- package/dist/{chunk-EBQS5T7Q.js → chunk-OA2YJN22.js} +1 -1
- package/dist/chunk-OH6LV5JP.js +6 -0
- package/dist/{chunk-J44PN2FX.js → chunk-P5RZO5BY.js} +18 -18
- package/dist/{chunk-TSYDTKXO.js → chunk-RPM67N7A.js} +1 -1
- package/dist/{chunk-XVTN5DDV.js → chunk-RU3UT7GJ.js} +1 -1
- package/dist/{chunk-IPZT6WKM.js → chunk-RX3U7JKF.js} +4 -4
- package/dist/chunk-SRCZX2KC.js +13 -0
- package/dist/chunk-TXVMHEJS.js +1 -0
- package/dist/chunk-V5WVGPOP.js +1 -0
- package/dist/{chunk-FY4X2VOE.js → chunk-VHMDWRDG.js} +2 -2
- package/dist/chunk-W7I65IXY.js +3 -0
- package/dist/chunk-WOPZX56J.js +2 -0
- package/dist/chunk-XF65LQ6M.js +1 -0
- package/dist/chunk-YP436V7Q.js +2 -0
- package/dist/{chunk-HAZGSAKP.js → chunk-ZI54C2AO.js} +1 -1
- package/dist/chunk-ZKYH44ER.js +1 -0
- package/dist/chunk-ZS7JHATN.js +1 -0
- package/dist/{chunk-NSMRQOWP.js → chunk-ZW4QV6SB.js} +1 -1
- package/dist/{create-XYKXS3JB.js → create-7UENFCJK.js} +1 -1
- package/dist/{demo-kit-RKTHTXHJ.js → demo-kit-ALW6OSQV.js} +1 -1
- package/dist/doctor-KGADT4PI.js +1 -0
- package/dist/{dotnet-webapi-clean-VJX6SGGP.js → dotnet-webapi-clean-6Z4EXEJY.js} +1 -1
- package/dist/{goal-lifecycle-BIX2JVNO.js → goal-lifecycle-HIQGDEEP.js} +1 -1
- package/dist/goal-pack-63PEP2ND.js +1 -0
- package/dist/{gofiber-standard-I6ASLOEE.js → gofiber-standard-TDJQIVQZ.js} +1 -1
- package/dist/{gogin-standard-U2LSRLIP.js → gogin-standard-UEF3IHSJ.js} +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +266 -248
- package/dist/pipeline-VFI35PR4.js +5 -0
- package/dist/{project-agent-entry-Y3NEHZED.js → project-agent-entry-Z3OY3S7T.js} +1 -1
- package/dist/{project-intelligence-lens-6Q6XSUDJ.js → project-intelligence-lens-YWICXW6P.js} +1 -1
- package/dist/{project-test-coverage-5PXAHBYQ.js → project-test-coverage-3P5FH6E5.js} +1 -1
- package/dist/proof-carrying-change-BAP2C3KV.js +1 -0
- package/dist/{pythonRapidkitExec-44ORGQ4R.js → pythonRapidkitExec-UMFLDIYR.js} +1 -1
- package/dist/{rust-axum-JMV7UPO7.js → rust-axum-4TRVPFMB.js} +1 -1
- package/dist/{springboot-standard-OC2RS3KC.js → springboot-standard-COWL75GT.js} +1 -1
- package/dist/verified-goal-A6WOMNTU.js +1 -0
- package/dist/{workspace-ROUEA3RT.js → workspace-PAXTJCMH.js} +1 -1
- package/dist/{workspace-agent-sync-6UYG33EQ.js → workspace-agent-sync-MGCEF4ON.js} +1 -1
- package/dist/{workspace-archive-OSMU3CK6.js → workspace-archive-3AURTMYA.js} +1 -1
- package/dist/{workspace-context-H7ZXR6VI.js → workspace-context-2G6QZ6D3.js} +1 -1
- package/dist/{workspace-contract-2V2BI6A3.js → workspace-contract-VWPOIYHJ.js} +1 -1
- package/dist/{workspace-explain-IBMTRUSF.js → workspace-explain-HLEBUK4K.js} +1 -1
- package/dist/{workspace-feedback-D6HJLKBQ.js → workspace-feedback-FF34CSJE.js} +1 -1
- package/dist/{workspace-foundation-H5B3TTZD.js → workspace-foundation-X7LOGTS3.js} +1 -1
- package/dist/{workspace-graph-stream-YDEET5LK.js → workspace-graph-stream-XGSRDRLI.js} +1 -1
- package/dist/workspace-graph-token-efficiency-YHXFGH3Z.js +1 -0
- package/dist/{workspace-history-WWPS4U7H.js → workspace-history-EQG5UBKW.js} +1 -1
- package/dist/{workspace-intelligence-DXKQXTTM.js → workspace-intelligence-GFJKIWBX.js} +1 -1
- package/dist/{workspace-intelligence-benchmark-L46EGZZM.js → workspace-intelligence-benchmark-R5MEGJQS.js} +1 -1
- package/dist/{workspace-intelligence-evaluation-QDSOOUHH.js → workspace-intelligence-evaluation-4AB4BBRP.js} +1 -1
- package/dist/{workspace-intelligence-runner-SCB44IXU.js → workspace-intelligence-runner-BU6JKNUD.js} +1 -1
- package/dist/{workspace-knowledge-graph-BNEVFEOW.js → workspace-knowledge-graph-OUTCLYS2.js} +1 -1
- package/dist/{workspace-knowledge-graph-query-GOC365ZR.js → workspace-knowledge-graph-query-TT2KK3SF.js} +1 -1
- package/dist/workspace-knowledge-graph-snapshot-XWJRUMAC.js +1 -0
- package/dist/workspace-marker-7U3NYRPJ.js +1 -0
- package/dist/workspace-mcp-serve-JYUKX3YS.js +3 -0
- package/dist/workspace-model-DUGPW5IB.js +1 -0
- package/dist/{workspace-onboarding-IRBVZTT4.js → workspace-onboarding-C4CKWTJ3.js} +1 -1
- package/dist/{workspace-python-engine-state-BE4A3BL5.js → workspace-python-engine-state-VCOLSEWV.js} +2 -2
- package/dist/{workspace-readme-HA6XLDME.js → workspace-readme-4FCKAQME.js} +1 -1
- package/dist/{workspace-registry-summary-CBZDSG6I.js → workspace-registry-summary-4KX4QD55.js} +1 -1
- package/dist/workspace-repair-engine-OVW4J3DI.js +3 -0
- package/dist/workspace-run-NVQGRZYO.js +1 -0
- package/dist/{workspace-verify-QTRY7WW3.js → workspace-verify-B7HEFYO6.js} +1 -1
- package/dist/workspace-watch-TQYAMLIV.js +1 -0
- package/docs/README.md +4 -1
- package/docs/agent-framework-adapters.md +279 -0
- package/docs/ci-workflows.md +1 -1
- package/docs/commands-reference.md +16 -0
- package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +5 -0
- package/docs/creating-workspaces-and-projects.md +18 -4
- package/package.json +7 -1
- package/scripts/enterprise-package-smoke.mjs +98 -0
- package/dist/analyze-WC2TY5AT.js +0 -1
- package/dist/autopilot-release-LJDRECFW.js +0 -1
- package/dist/capabilities-command-NFGX42CH.js +0 -1
- package/dist/chunk-2BCECNIW.js +0 -1
- package/dist/chunk-2LIVMG5C.js +0 -2
- package/dist/chunk-3SNP6M4M.js +0 -2
- package/dist/chunk-46QH3ZVI.js +0 -105
- package/dist/chunk-4HQU2GQM.js +0 -1
- package/dist/chunk-4JAURS76.js +0 -13
- package/dist/chunk-7O7P4MRD.js +0 -1
- package/dist/chunk-AQNU5RXV.js +0 -2
- package/dist/chunk-CQBM6BBP.js +0 -2
- package/dist/chunk-CY4QZ3PE.js +0 -3
- package/dist/chunk-EDDGQ6LM.js +0 -2
- package/dist/chunk-F6CTGVJA.js +0 -9
- package/dist/chunk-K3O3HENC.js +0 -5
- package/dist/chunk-LDJAUIAG.js +0 -1
- package/dist/chunk-LGC4CRUF.js +0 -3
- package/dist/chunk-ND5YAC4T.js +0 -1
- package/dist/chunk-NNQE4DS2.js +0 -2
- package/dist/chunk-NSH7TTSV.js +0 -1
- package/dist/chunk-R5OJD5K2.js +0 -1
- package/dist/chunk-SO4CGS35.js +0 -4
- package/dist/chunk-T5NBSCVX.js +0 -97
- package/dist/chunk-UCNIXOTL.js +0 -2
- package/dist/chunk-UNXG3ZFV.js +0 -1
- package/dist/chunk-VBMWFT7Q.js +0 -1
- package/dist/chunk-YYELANJO.js +0 -7
- package/dist/chunk-ZZWGD3X3.js +0 -12
- package/dist/doctor-LQ7FT6AZ.js +0 -1
- package/dist/goal-pack-SUWH6K7U.js +0 -1
- package/dist/pipeline-NSPPWD7U.js +0 -5
- package/dist/proof-carrying-change-456TYEDW.js +0 -1
- package/dist/verified-goal-GRH5UOJR.js +0 -1
- package/dist/workspace-graph-token-efficiency-XM3LYFUC.js +0 -1
- package/dist/workspace-knowledge-graph-snapshot-2NMV7LEJ.js +0 -1
- package/dist/workspace-marker-XGAWZZDX.js +0 -1
- package/dist/workspace-mcp-serve-JLZTTEVG.js +0 -3
- package/dist/workspace-model-XSNLDUI2.js +0 -1
- package/dist/workspace-repair-engine-TDUNQSFJ.js +0 -3
- package/dist/workspace-run-I2W5PIPK.js +0 -1
- package/dist/workspace-watch-PDQKYBYQ.js +0 -1
- /package/dist/{chunk-K33JJVQZ.js → chunk-VN2MKTQO.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {m,g,f,h as h$2}from'./chunk-YP436V7Q.js';import {b as b$3}from'./chunk-MXI2DWLL.js';import {b as b$6,a as a$3}from'./chunk-D5LLTUTY.js';import {b as b$1}from'./chunk-B6FJ6RG6.js';import {a as a$2}from'./chunk-GE46XKD2.js';import {e as e$1,g as g$1,h as h$1,c as c$2,i as i$1,f as f$1,b as b$5,d as d$3}from'./chunk-CMLLERGG.js';import {g as g$2}from'./chunk-LMOTDLJF.js';import {e,c as c$1}from'./chunk-252EKOR6.js';import {i,b as b$4,k as k$1,j,m as m$1,t,s as s$1,q}from'./chunk-RGNCL5OB.js';import {h,e as e$2,b as b$2,d as d$1}from'./chunk-6B7L4NZE.js';import {a}from'./chunk-TQEMLBAG.js';import {b,a as a$1,c,d as d$2}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",` ${h$2(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$6(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$2.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$1,n,t,o,a){let l=e(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 c$1(e$1,l);}async function H(e){await k.outputFile(d.join(e,".gitignore"),`.venv/
|
|
2
2
|
__pycache__/
|
|
3
3
|
*.pyc
|
|
4
4
|
.env
|
|
5
|
-
${d$
|
|
5
|
+
${d$2}
|
|
6
6
|
${b}/
|
|
7
7
|
|
|
8
8
|
`,"utf-8");}async function qe(e){try{let n=await execa("git",["rev-parse","--show-toplevel"],{cwd:e,env:a()});return n.stdout.trim()?d.resolve(e,n.stdout.trim()):null}catch{return null}}function mt(e){if(!e||typeof e!="object")return String(e??"");let n=e;return [n.message,n.shortMessage,n.stderr].filter(t=>typeof t=="string").join(`
|
|
@@ -37,12 +37,12 @@ cache:
|
|
|
37
37
|
prune_on_bootstrap: false
|
|
38
38
|
self_heal: true
|
|
39
39
|
verify_integrity: false
|
|
40
|
-
`}async function Xe(){try{let{stdout:e}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),n=e.match(/go(\d+\.\d+(?:\.\d+)?)/i);return n?n[1]:void 0}catch{return}}async function Ze(){try{let{stdout:e}=await execa("dotnet",["--version"],{timeout:3e3,stdio:"pipe"}),n=e.trim();return n.length>0?n:void 0}catch{return}}async function Z(e,n,t,o,a,l){let[u,g]=await Promise.all([Xe(),Ze()]),c=[{fileName:"workspace.json",content:ze(n,t,o,a,l)},{fileName:"toolchain.lock",content:Be(t,o,process.version,u,g,l)},{fileName:"policies.yml",content:Je()},{fileName:"cache-config.yml",content:Qe()}];for(let h of c)await k.outputFile(d.join(e,a$1,h.fileName),h.content,"utf-8");}async function nn(e,n){let{workspaceName:t=d.basename(e),installMethod:o="venv",pythonVersion:a,profile:l,writeMarker:u=true,writeGitignore:g=true,onlyIfMissing:c$
|
|
41
|
-
`,"utf-8"),e$
|
|
40
|
+
`}async function Xe(){try{let{stdout:e}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),n=e.match(/go(\d+\.\d+(?:\.\d+)?)/i);return n?n[1]:void 0}catch{return}}async function Ze(){try{let{stdout:e}=await execa("dotnet",["--version"],{timeout:3e3,stdio:"pipe"}),n=e.trim();return n.length>0?n:void 0}catch{return}}async function Z(e,n,t,o,a,l){let[u,g]=await Promise.all([Xe(),Ze()]),c=[{fileName:"workspace.json",content:ze(n,t,o,a,l)},{fileName:"toolchain.lock",content:Be(t,o,process.version,u,g,l)},{fileName:"policies.yml",content:Je()},{fileName:"cache-config.yml",content:Qe()}];for(let h of c)await k.outputFile(d.join(e,a$1,h.fileName),h.content,"utf-8");}async function nn(e$1,n){let{workspaceName:t=d.basename(e$1),installMethod:o="venv",pythonVersion:a,profile:l,writeMarker:u=true,writeGitignore:g=true,onlyIfMissing:c$2=true}=n||{},h$1=[],[y,f]=await Promise.all([Xe(),Ze()]),p=[{relPath:d.join(a$1,"workspace.json"),legacyRelPath:d.join(b,"workspace.json"),content:ze(t,o,a,l)},{relPath:d.join(a$1,"toolchain.lock"),legacyRelPath:d.join(b,"toolchain.lock"),content:Be(o,a,process.version,y,f)},{relPath:d.join(a$1,"policies.yml"),legacyRelPath:d.join(b,"policies.yml"),content:Je()},{relPath:d.join(a$1,"cache-config.yml"),legacyRelPath:d.join(b,"cache-config.yml"),content:Qe()}];for(let r of p){let i=d.join(e$1,r.relPath),_=d.join(e$1,r.legacyRelPath),P=await k.pathExists(i),R=await k.pathExists(_);c$2&&P||(c$2&&R?(await k.copy(_,i),h$1.push(r.relPath)):(await k.outputFile(i,r.content,"utf-8"),h$1.push(r.relPath)));}if(u&&(!await k.pathExists(d.join(e$1,c))||!c$2)){let i=e(t,h(),o);a&&(i.metadata||(i.metadata={}),i.metadata.python={pythonVersion:a}),await c$1(e$1,i),h$1.push(c);}if(g){let r=d.join(e$1,".gitignore");(!c$2||!await k.pathExists(r))&&(await H(e$1),h$1.push(".gitignore"));}return h$1}var gt={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"};function ht(e){let n=e,t=new Set;for(;!m(n);){if(t.has(n))return "minimal";t.add(n);let o=gt[n];if(!o)return "minimal";n=o;}return n}var G="3.10",et=["3.10","3.11","3.12"];async function xe(e){try{let{stdout:n}=await execa(e,["--version"],{timeout:3e3}),t=n.match(/Python (\d+\.\d+\.\d+)/);if(t)return t[1]}catch{}return null}async function ft(e,n){try{await promises.writeFile(d.join(e,".python-version"),`${n}
|
|
41
|
+
`,"utf-8"),e$2.debug(`Created .python-version with ${n}`);}catch(t){e$2.warn(`Failed to create .python-version: ${t}`);}}function le(){let t$1=[...(process.env.PATH||"").split(d.delimiter).filter(Boolean)];for(let o of t())t$1.includes(o)||t$1.unshift(o);process.env.PATH=t$1.join(d.delimiter);}async function he(e,n){le(),e.start("Checking pipx installation");try{return await execa("pipx",["--version"]),e.succeed("pipx found"),{kind:"binary"}}catch{}let t=T();try{return await execa(t,["-m","pipx","--version"]),e.succeed("pipx found"),{kind:"python-module",pythonCmd:t}}catch{}if(n)throw new d$3;try{await execa(t,["-m","pip","--version"],{timeout:2500});}catch{throw new h$1}e.stop?.();let{installPipx:o}=await b$1([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!o)throw new d$3;e.start("Installing pipx (user install)");try{try{await execa(t,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(t,["-m","pip","install","--user","--upgrade","pipx"]);}catch(a){let l=a,u=String(l?.stderr||l?.shortMessage||l?.message||"");throw new f$1("Install pipx with python -m pip",a instanceof Error?a:new Error(u))}e.succeed("pipx installed"),le();try{return await execa(t,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:t}}catch(a){let l=a,u=String(l?.stderr||l?.shortMessage||l?.message||"pipx not runnable after install");throw new f$1("Verify pipx after install",new Error(`${u}
|
|
42
42
|
|
|
43
43
|
Try reopening your terminal or run: ${t} -m pipx ensurepath`))}}async function U(e,n){return e.kind==="binary"?execa("pipx",n):execa(e.pythonCmd,["-m","pipx",...n])}function tt(e){let n=e.match(/^(\d+)\.(\d+)/);return n?`${n[1]}.${n[2]}`:null}function Ge(e){if(!e)return null;let n=e.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return n?`${n[1]}.${n[2]}`:null}function Ie(e,n){let[t,o]=e.split(".").map(u=>Number(u)),[a,l]=n.split(".").map(u=>Number(u));return t!==a?t-a:o-l}function ee(e,n){return Ie(e,n)>=0}async function wt(e){let n=new Set,t=k$1(14,10);for(let f of t)try{let p=await execa(f.command,f.args,{timeout:2500}),r=Ge(`${p.stdout||""}
|
|
44
44
|
${p.stderr||""}`);r&&ee(r,G)&&n.add(r);}catch{}let o=null;try{let f=await execa(T(),["--version"],{timeout:2500}),p=Ge(`${f.stdout||""}
|
|
45
|
-
${f.stderr||""}`);p&&ee(p,G)&&(o=p,n.add(p));}catch{}let a=et.filter(f=>ee(f,G)),l=new Set([...a,...n]),u=Array.from(l).sort((f,p)=>Ie(p,f)),g=e?tt(e):null,c=g&&ee(g,G)?g:o||u[0]||G;return l.has(c)||l.add(c),{choices:Array.from(l).sort((f,p)=>Ie(p,f)).map(f=>{let p=[];return f===o&&p.push("current system"),f===G&&p.push("minimum supported"),n.has(f)&&f!==o&&p.push("detected"),{name:p.length>0?`${f} (${p.join(", ")})`:f,value:f}}),defaultValue:c}}async function vt(){le();let e=false,n=false,t=false,o=false;try{await execa("poetry",["--version"],{timeout:2500}),e=true;}catch{e=false;}try{await execa("pipx",["--version"],{timeout:2500}),n=true;}catch{let l=i();try{await execa(l,["-m","pipx","--version"],{timeout:2500}),n=true;}catch{n=false;}}let a=i();try{await execa(a,["-m","pip","--version"],{timeout:2500}),t=true;}catch{t=false;}try{await execa(a,["-c","import venv, ensurepip"],{timeout:2500}),o=true;}catch{o=false;}return {poetry:e,pipx:n,pip:t,venv:o}}function kt(e,n){return e==="poetry"&&n.poetry?"poetry":e==="pipx"&&n.pipx?"pipx":e==="venv"&&n.venv?"venv":n.poetry?"poetry":n.venv?"venv":"pipx"}async function Pt(e,n){le(),e.start("Checking Poetry installation");try{await execa("poetry",["--version"]),e.succeed("Poetry found");return}catch{}if(n)throw new c$
|
|
45
|
+
${f.stderr||""}`);p&&ee(p,G)&&(o=p,n.add(p));}catch{}let a=et.filter(f=>ee(f,G)),l=new Set([...a,...n]),u=Array.from(l).sort((f,p)=>Ie(p,f)),g=e?tt(e):null,c=g&&ee(g,G)?g:o||u[0]||G;return l.has(c)||l.add(c),{choices:Array.from(l).sort((f,p)=>Ie(p,f)).map(f=>{let p=[];return f===o&&p.push("current system"),f===G&&p.push("minimum supported"),n.has(f)&&f!==o&&p.push("detected"),{name:p.length>0?`${f} (${p.join(", ")})`:f,value:f}}),defaultValue:c}}async function vt(){le();let e=false,n=false,t=false,o=false;try{await execa("poetry",["--version"],{timeout:2500}),e=true;}catch{e=false;}try{await execa("pipx",["--version"],{timeout:2500}),n=true;}catch{let l=i();try{await execa(l,["-m","pipx","--version"],{timeout:2500}),n=true;}catch{n=false;}}let a=i();try{await execa(a,["-m","pip","--version"],{timeout:2500}),t=true;}catch{t=false;}try{await execa(a,["-c","import venv, ensurepip"],{timeout:2500}),o=true;}catch{o=false;}return {poetry:e,pipx:n,pip:t,venv:o}}function kt(e,n){return e==="poetry"&&n.poetry?"poetry":e==="pipx"&&n.pipx?"pipx":e==="venv"&&n.venv?"venv":n.poetry?"poetry":n.venv?"venv":"pipx"}async function Pt(e,n){le(),e.start("Checking Poetry installation");try{await execa("poetry",["--version"]),e.succeed("Poetry found");return}catch{}if(n)throw new c$2;let{installPoetry:t}=await b$1([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!t)throw new c$2;let o=await he(e,n);e.start("Installing Poetry with pipx");try{await U(o,["install","poetry"]);}catch(a){let l=a,u=String(l?.stderr||l?.shortMessage||l?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(u))try{await U(o,["upgrade","poetry"]);}catch{}else throw new f$1("Install Poetry with pipx",a instanceof Error?a:new Error(u))}e.succeed("Poetry installed"),le();try{await execa("poetry",["--version"]);}catch(a){let l=a,u=String(l?.stderr||l?.shortMessage||l?.message||"Poetry not found on PATH");throw new f$1("Verify Poetry after pipx install",new Error(`${u}
|
|
46
46
|
|
|
47
47
|
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function bt(e,n={}){let t=e==="poetry",o=n.pythonEngineSkipped?`echo "- Python engine installation was intentionally skipped for this workspace." 1>&2
|
|
48
48
|
echo "- For npm-owned workspace commands, run: npx workspai <command>" 1>&2
|
|
@@ -120,10 +120,10 @@ for %%R in ("%USERPROFILE%\\.local\\bin\\rapidkit.exe" "%APPDATA%\\Python\\Scrip
|
|
|
120
120
|
echo RapidKit launcher could not find a local Python CLI. 1>&2
|
|
121
121
|
${o}echo Tip: for npm-owned workspace commands, run npx --yes --package workspai workspai %* from a shell where npm is on PATH. 1>&2
|
|
122
122
|
exit /b 1
|
|
123
|
-
`}async function ge(e,n,t={}){await k.outputFile(d.join(e,"rapidkit"),bt(n,t),{encoding:"utf-8",mode:493}),await k.outputFile(d.join(e,"rapidkit.cmd"),Rt(n,t),"utf-8");}async function on(e
|
|
123
|
+
`}async function ge(e,n,t={}){await k.outputFile(d.join(e,"rapidkit"),bt(n,t),{encoding:"utf-8",mode:493}),await k.outputFile(d.join(e,"rapidkit.cmd"),Rt(n,t),"utf-8");}async function on(e,n){let{skipGit:t=false,skipPythonEngine:o=false,testMode:a=false,demoMode:l=false,dryRun:u=false,yes:g$2=false,userConfig:c={},installMethod:h,profile:y,parentDirectory:f,suppressReceipt:p=false}=n,r=e||"rapidkit",i$1=f?d.resolve(f,r):d.resolve(process.cwd(),r);if(await k.pathExists(i$1))throw new e$1(r);if(await g(i$1),u){let w=y||(g$2?"minimal":void 0),I=h||c.defaultInstallMethod||"poetry",E=c.pythonVersion||"3.10";await It(i$1,r,l,c,w,I,E,t,o);return}if(l){await xt(i$1,r,t);return}let _=new Set(["python-only","polyglot","enterprise"]),P=y||"";if(!g$2&&!y){let{selectedProfile:w}=await b$1([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"java-only \u2014 Java runtime (Spring Boot services)",value:"java-only"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"dotnet-only \u2014 .NET runtime (ASP.NET Core services)",value:"dotnet-only"},{name:"polyglot \u2014 Python + Node.js + Go + Java + .NET multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);P=w;}else P||(P="minimal");let R=!g$2&&_.has(P),O=_.has(P)?o?"skip":R?(await b$1([{type:"confirm",name:"installPythonEngine",message:"Install the optional RapidKit Python engine now? (needed for Python-backed kits/modules)",default:true}])).installPythonEngine!==false?"install":"skip":"install":"skip",ce=R&&O==="install",at=typeof c.pythonVersion=="string"&&c.pythonVersion.trim().length>0?c.pythonVersion.trim():void 0,rt=h||c.defaultInstallMethod||"poetry",A=O==="install"?await vt():{poetry:true,pipx:true,pip:true,venv:true},_e=ce?await wt(at):{choices:et.map(w=>({name:w,value:w})),defaultValue:G},st=kt(rt,A),lt=[{name:A.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env + dependency mgmt)":A.pipx||A.pip?"\u{1F3AF} Poetry (Recommended) \u2014 not detected (can be installed)":"\u{1F3AF} Poetry (Recommended) \u2014 unavailable (system pipx package required)",value:"poetry"},{name:A.venv?"\u{1F4E6} pip with venv (Standard, zero extra tools)":"\u{1F4E6} pip with venv \u2014 unavailable (system venv package required)",value:"venv"},{name:A.pipx?"\u{1F527} pipx (Global isolated - RapidKit Core only, no local venv)":A.pip?"\u{1F527} pipx (Global isolated) \u2014 not detected (can be installed)":"\u{1F527} pipx (Global isolated) \u2014 unavailable (system pipx package required)",value:"pipx"}],x=ce?await b$1([{type:"rawlist",name:"pythonVersion",message:"Select minimum Python version for RapidKit:",choices:_e.choices,default:_e.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:lt,default:st}]):await(async()=>{if(O==="skip")return {pythonVersion:c.pythonVersion||"3.10",installMethod:"venv"};let w=h||c.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return e$2.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:c.pythonVersion||"3.10",installMethod:w}})();if(m(P)){let w=b$2("Creating workspace",{component:"create",phase:"workspace.python-free"}),I=await se(i$1);try{await k.ensureDir(i$1),w.succeed("Directory created"),await Q(i$1,r,"venv",void 0),await Z(i$1,r,"venv",void 0,P,{bootstrapNote:"python-engine-skipped",pythonEngine:"skipped",pythonEngineReason:"workspace-profile-does-not-install-python-at-create"}),await H(i$1);let E=await b$3(i$1,{workspaceName:r,silent:true});await J(I),t||await X(i$1,w,"Initial commit: Workspai workspace"),p||B({workspaceName:r,workspacePath:i$1,profile:P,projectCount:E?.projectCount??0});}catch(E){return w.fail("Failed to create workspace"),F(I,E)}return}if(_.has(P)&&O==="skip"){let w=b$2("Creating workspace",{component:"create",phase:"workspace.python-engine-skipped"}),I=await se(i$1);try{await k.ensureDir(i$1),w.succeed("Directory created");let E={bootstrapNote:"python-engine-skipped",pythonEngine:"skipped",pythonEngineReason:"user-opted-out"};await Q(i$1,r,"venv",void 0,E),await Z(i$1,r,"venv",void 0,P,E),await H(i$1),await ge(i$1,"venv",{pythonEngineSkipped:true});let b=await b$3(i$1,{workspaceName:r,silent:true});await J(I),t||await X(i$1,w,`Initial commit: Workspai workspace (${P})`),p||B({workspaceName:r,workspacePath:i$1,profile:P,projectCount:b?.projectCount??0,pythonEngine:"skipped",note:"Install the optional Python engine later only when a Python-backed kit needs it."});return}catch(E){return w.fail("Failed to create workspace"),F(I,E)}}{let w=T(),I=false;try{await execa(w,["--version"],{timeout:5e3}),I=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),I=true;}catch{I=false;}}if(!I){let E=P,b=ht(P);if(R&&!g$2){console.log(s.yellow(`
|
|
124
124
|
\u26A0\uFE0F Python 3.10+ is not detected on this system.
|
|
125
125
|
`)),console.log(s.cyan(`You have 3 options:
|
|
126
|
-
`));let{pythonAction:D}=await b$
|
|
126
|
+
`));let{pythonAction:D}=await b$1([{type:"rawlist",name:"pythonAction",message:"What would you like to do?",choices:[{name:"\u{1F4E5} Install Python now (I'll show you the command for your OS)",value:"install"},{name:`\u{1F504} Switch to "${b}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if(D==="cancel"&&(console.log(s.cyan(`
|
|
127
127
|
\u{1F4A1} How to install Python:
|
|
128
128
|
`)),console.log(s.white(" Ubuntu / Debian: sudo apt install python3.10")),console.log(s.white(" macOS (Homebrew): brew install python@3.10")),console.log(s.white(` Windows: https://python.org/downloads
|
|
129
129
|
`)),console.log(s.gray(` After installing Python, run: npx workspai ${r}
|
|
@@ -136,9 +136,9 @@ exit /b 1
|
|
|
136
136
|
`))),console.log(s.gray(` After installing, run: npx workspai ${r}
|
|
137
137
|
`)),process.exit(0);}if(D==="fallback"&&(console.log(s.green(`
|
|
138
138
|
\u2705 Switching to "${b}" profile (no Python required).
|
|
139
|
-
`)),P=b,
|
|
139
|
+
`)),P=b,m(b))){let S=b$2("Creating workspace",{component:"create",phase:"workspace.python-free"}),q=await se(i$1);try{await k.ensureDir(i$1),S.succeed("Directory created"),await Q(i$1,r,"venv",void 0),await Z(i$1,r,"venv",void 0,b,{profileRequested:E,bootstrapNote:"python-free-fallback",pythonEngine:"skipped",pythonEngineReason:"python-runtime-unavailable"}),await H(i$1);let fe=await b$3(i$1,{workspaceName:r,silent:true});await J(q),t||await X(i$1,S,`Initial commit: Workspai workspace (${b} profile)`),p||B({workspaceName:r,workspacePath:i$1,profile:b,projectCount:fe?.projectCount??0,note:`Requested ${E}; used ${b} because Python was unavailable.`});return}catch(fe){return S.fail("Failed to create workspace"),F(q,fe)}}}else if(console.log(s.yellow(`
|
|
140
140
|
\u26A0\uFE0F Python not detected. Auto-switching to "${b}" profile (no Python required).
|
|
141
|
-
`)),P=b,
|
|
141
|
+
`)),P=b,m(b)){let D=b$2("Creating workspace",{component:"create",phase:"workspace.python-free"}),S=await se(i$1);try{await k.ensureDir(i$1),D.succeed("Directory created"),await Q(i$1,r,"venv",void 0),await Z(i$1,r,"venv",void 0,b,{profileRequested:E,bootstrapNote:"python-free-fallback",pythonEngine:"skipped",pythonEngineReason:"python-runtime-unavailable"}),await H(i$1);let q=await b$3(i$1,{workspaceName:r,silent:true});await J(S),t||await X(i$1,D,`Initial commit: Workspai workspace (${b})`),p||B({workspaceName:r,workspacePath:i$1,profile:b,projectCount:q?.projectCount??0,note:`Requested ${E}; used ${b} because Python was unavailable.`});return}catch(q){return D.fail("Failed to create workspace"),F(S,q)}}}}if(x.installMethod==="venv"&&!A.venv){let w=await xe(i()),I=w?tt(w):null;throw new g$1(`python${I||x.pythonVersion}-venv`,d.basename(i$1))}if(x.installMethod==="pipx"&&!A.pipx&&!A.pip)throw new h$1;if(x.installMethod==="poetry"&&!A.poetry&&!A.pipx&&!A.pip)throw new c$2;let C=b$2("Creating directory",{component:"create",phase:"workspace.directory"}),Ce=await se(i$1);try{await k.ensureDir(i$1),C.succeed("Directory created"),C.start("Detecting Python version");let w=null,I=await nt(x.pythonVersion);if(I)w=await xe(I),w?(e$2.info(` Detected Python ${w}`),C.succeed(`Python ${w} detected`)):C.warn("Could not detect exact Python version");else {let b=T();w=await xe(b),w?C.succeed(`Python ${w} detected`):C.warn("Could not detect Python version, proceeding with defaults");}if(await Q(i$1,r,x.installMethod,w||void 0),await Z(i$1,r,x.installMethod,w||x.pythonVersion,P||y),await H(i$1),await Ye(i$1,r),x.installMethod==="poetry")try{await ot(i$1,x.pythonVersion,C,a,c,g$2);}catch(b){let te=b?.details||b?.message||String(b);if(te.includes("pyenv")||te.includes("exit status 127")||te.includes("returned non-zero exit status 127")){C.warn("Poetry encountered Python discovery issues, trying venv method"),e$2.debug(`Poetry error (attempting venv fallback): ${te}`);try{await Ee(i$1,x.pythonVersion,C,a,c),x.installMethod="venv";}catch(S){throw S}}else throw b}else x.installMethod==="venv"?await Ee(i$1,x.pythonVersion,C,a,c):await it(i$1,C,a,c,g$2);w&&await ft(i$1,w),await ge(i$1,x.installMethod),C.succeed("Workspai environment ready!");let E=await b$3(i$1,{workspaceName:r,silent:true});await J(Ce),n.skipGit||await X(i$1,C,"Initial commit: Workspai environment"),p||B({workspaceName:r,workspacePath:i$1,profile:P,projectCount:E?.projectCount??0,pythonEngine:"installed",pythonVersion:x.pythonVersion,installMethod:x.installMethod});}catch(w){return C.fail("Failed to create Workspai environment"),F(Ce,w)}}async function nt(e){let n=[];if(!b$4())try{let{stdout:l}=await execa("pyenv",["which","python"]),u=l.trim();u&&n.push(u);}catch{}let t=Number(e.split(".")[1]),o=k$1(t,10).map(l=>l.command).filter(Boolean);n.push(`python${e}`,...o,...j());let a=[...new Set(n)];for(let l of a)try{let u=l==="py"?["-3","--version"]:["--version"],g=l==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:c}=await execa(l,u,{timeout:2e3}),h=c.match(/Python (\d+\.\d+)/)?.[1];if(h&&ee(h,e))return await execa(l,g,{timeout:2e3}),l}catch{continue}return null}async function ot(e,n,t,o,a,l=false){await Pt(t,l),t.start("Finding Python interpreter");let u=await nt(n);u?(e$2.debug(`Found working Python: ${u}`),t.succeed("Python found")):t.warn("Could not verify Python path, proceeding with default"),t.start("Initializing Poetry project");let g=d.join(e,"pyproject.toml"),h=(await k.pathExists(g)?await promises.readFile(g,"utf-8"):"").includes("rapidkit-core");if(h)t.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${n}`],{cwd:e}),t.succeed("Poetry project initialized");let r=await promises.readFile(g,"utf-8");r.includes("[tool.poetry]")?r=r.replace("[tool.poetry]",`[tool.poetry]
|
|
142
142
|
package-mode = false`):r.includes("[project]")&&(r.includes("[build-system]")?r=r.replace("[build-system]",`
|
|
143
143
|
[tool.poetry]
|
|
144
144
|
package-mode = false
|
|
@@ -147,27 +147,27 @@ package-mode = false
|
|
|
147
147
|
|
|
148
148
|
[tool.poetry]
|
|
149
149
|
package-mode = false
|
|
150
|
-
`),await promises.writeFile(g,r,"utf-8");}t.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:e}),t.succeed("Poetry configured");}catch{t.warn("Could not configure Poetry virtualenvs.in-project");}t.start("Creating virtualenv");let y=u||T(),f=m(d.join(e,".venv"));try{await execa(y,["-m","venv",".venv"],{cwd:e,timeout:6e4}),t.succeed("Virtualenv created");}catch(p){e$
|
|
150
|
+
`),await promises.writeFile(g,r,"utf-8");}t.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:e}),t.succeed("Poetry configured");}catch{t.warn("Could not configure Poetry virtualenvs.in-project");}t.start("Creating virtualenv");let y=u||T(),f$2=m$1(d.join(e,".venv"));try{await execa(y,["-m","venv",".venv"],{cwd:e,timeout:6e4}),t.succeed("Virtualenv created");}catch(p){e$2.debug(`python -m venv failed: ${p}`),t.warn("Could not pre-create virtualenv, Poetry will try"),f$2=u||T();}try{await execa("poetry",["env","use",f$2||T()],{cwd:e}),e$2.debug(`Poetry env set to: ${f$2}`);}catch(p){e$2.debug(`Could not set Poetry env: ${p}`);}if(t.start("Installing RapidKit"),h&&!o){let p=f(a||{}),r=p?await k.pathExists(p):false,i=r&&p?p:"rapidkit-core";p&&!r&&e$2.warn(`WORKSPAI_DEV_PATH/RAPIDKIT_DEV_PATH points to a path that does not exist: ${p}. Falling back to PyPI.`),t.text=r?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let _=false,P=null;for(let R=1;R<=3;R++)try{r||d$1({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:R,maxAttempts:3}),await execa(f$2,["-m","pip","install",i,"--quiet"],{cwd:e,timeout:18e4}),_=true,r||d$1({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:R,maxAttempts:3});break}catch(O){P=O,e$2.debug(`pip install rapidkit-core attempt ${R} failed: ${O}`),R<3&&(t.text=`Retrying installation (attempt ${R+1}/3)`,await new Promise(ce=>setTimeout(ce,2e3)));}if(!_){let R=P?.stderr||P?.message||"Unknown error";throw e$2.debug(`All pip install attempts failed. Last error: ${R}`),R.includes("Could not find")||R.includes("No matching distribution")?new i$1:new f$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
151
151
|
Error: ${R}
|
|
152
152
|
|
|
153
153
|
Possible solutions:
|
|
154
154
|
1. Check your internet connection
|
|
155
155
|
2. Try installing manually: cd ${d.basename(e)} && poetry add rapidkit-core
|
|
156
|
-
3. Use venv method instead: npx workspai ${d.basename(e)} --install-method=venv`))}}else {t.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:e,timeout:12e4}),t.succeed("Poetry environment synced");}catch(p){e$
|
|
156
|
+
3. Use venv method instead: npx workspai ${d.basename(e)} --install-method=venv`))}}else {t.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:e,timeout:12e4}),t.succeed("Poetry environment synced");}catch(p){e$2.debug(`poetry install --no-root failed: ${p}`),t.warn("Could not sync Poetry environment, proceeding with add command");}if(t.start("Installing RapidKit"),o){let p=f(a||{});if(!p)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set WORKSPAI_DEV_PATH (or legacy RAPIDKIT_DEV_PATH)."));e$2.debug(`Installing from local path: ${p}`),t.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",p],{cwd:e});}else {t.text="Installing RapidKit from PyPI";let p=false,r=null;for(let i=1;i<=3;i++)try{d$1({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:i,maxAttempts:3}),await execa("poetry",["add","rapidkit-core"],{cwd:e,timeout:6e4*i}),p=true,d$1({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:i,maxAttempts:3});break}catch(_){r=_,e$2.debug(`Poetry add attempt ${i} failed: ${_}`),i<3&&(t.text=`Retrying installation (attempt ${i+1}/3)`,await new Promise(P=>setTimeout(P,2e3)));}if(!p){let i=r?.stderr||r?.message||"Unknown error";throw e$2.debug(`All Poetry install attempts failed. Last error: ${i}`),i.includes("Could not find")||i.includes("No matching distribution")?new i$1:new f$1("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
157
157
|
Error: ${i}
|
|
158
158
|
|
|
159
159
|
Possible solutions:
|
|
160
160
|
1. Check your internet connection
|
|
161
161
|
2. Try installing manually: cd ${d.basename(e)} && poetry add rapidkit-core
|
|
162
|
-
3. Use venv method instead: npx workspai ${d.basename(e)} --install-method=venv`))}}}t.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:p}=await import('./pythonRapidkitExec-
|
|
162
|
+
3. Use venv method instead: npx workspai ${d.basename(e)} --install-method=venv`))}}}t.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:p}=await import('./pythonRapidkitExec-UMFLDIYR.js');if(!await p()&&!o){t.start("Checking optional global pipx installation");let i=await he(t,true);try{t.start("Installing RapidKit globally with pipx for CLI access"),await U(i,["install","rapidkit-core"]),t.succeed("RapidKit installed globally");}catch(_){t.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),e$2.debug(`pipx install failed: ${_}`);}}}catch(p){t.succeed("Skipped optional global pipx installation"),e$2.debug(`Global install check skipped: ${p}`);}}async function Ee(e,n,t,o,a,l=false){t.start(`Checking Python ${n}`);let u=T();try{let{stdout:c}=await execa(u,["--version"]),h=c.match(/Python (\d+\.\d+)/)?.[1];if(h&&!ee(h,n))throw new b$5(n,h);t.succeed(`Python ${h} found`);}catch(c){throw c instanceof b$5?c:new b$5(n)}t.start("Creating virtual environment");try{await execa(u,["-m","venv",".venv"],{cwd:e}),t.succeed("Virtual environment created");}catch(c){if(t.fail("Failed to create virtual environment"),(y=>typeof y=="object"&&y!==null&&"stdout"in y&&typeof y.stdout=="string")(c)&&c.stdout.includes("ensurepip is not")){let y=c.stdout.match(/apt install (python[\d.]+-venv)/),f=y?y[1]:"python3-venv";throw new g$1(f,d.basename(e))}throw new f$1("Virtual environment creation",c instanceof Error?c:new Error(String(c)))}t.start("Installing RapidKit");let g=m$1(d.join(e,".venv"));if(await execa(g,["-m","pip","install","--upgrade","pip"],{cwd:e}),o){let c=f(a||{});if(!c)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set WORKSPAI_DEV_PATH (or legacy RAPIDKIT_DEV_PATH)."));e$2.debug(`Installing from local path: ${c}`),t.text="Installing RapidKit from local path (test mode)",await execa(g,["-m","pip","install","-e",c],{cwd:e});}else {t.text="Installing RapidKit from PyPI";let c=false,h=null;for(let y=1;y<=3;y++)try{d$1({status:"started",message:"Installing RapidKit from PyPI",installMethod:"venv",attempt:y,maxAttempts:3}),await execa(g,["-m","pip","install","rapidkit-core"],{cwd:e,timeout:6e4*y}),c=true,d$1({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"venv",attempt:y,maxAttempts:3});break}catch(f){h=f,e$2.debug(`pip install attempt ${y} failed: ${f}`),y<3&&(t.text=`Retrying installation (attempt ${y+1}/3)`,await new Promise(p=>setTimeout(p,2e3)));}if(!c){let y=h?.stderr||h?.message||"Unknown error";throw e$2.debug(`All pip install attempts failed. Last error: ${y}`),y.includes("Could not find")||y.includes("No matching distribution")?new i$1:new f$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
163
163
|
Error: ${y}
|
|
164
164
|
|
|
165
165
|
Possible solutions:
|
|
166
166
|
1. Check your internet connection
|
|
167
|
-
2. Try installing manually: cd ${d.basename(e)} && ${m(".venv")} -m pip install rapidkit-core
|
|
168
|
-
3. Use Poetry instead: npx workspai ${d.basename(e)} --install-method=poetry`))}}t.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:c}=await import('./pythonRapidkitExec-
|
|
169
|
-
`,"utf-8");return}g.reason==="constraint-missing"?e$
|
|
170
|
-
`,"utf-8");}async function an(e,n){let{skipGit:t=false,installPythonEngine:o=false,testMode:a=false,userConfig:l={},yes:u=false,installMethod:g,pythonVersion:c="3.10"}=n||{},h="venv";o&&(h=g||l.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return e$
|
|
167
|
+
2. Try installing manually: cd ${d.basename(e)} && ${m$1(".venv")} -m pip install rapidkit-core
|
|
168
|
+
3. Use Poetry instead: npx workspai ${d.basename(e)} --install-method=poetry`))}}t.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:c}=await import('./pythonRapidkitExec-UMFLDIYR.js');if(!await c()&&!o){t.start("Checking optional global pipx installation");let y=await he(t,true);try{t.start("Installing RapidKit globally with pipx for CLI access"),await U(y,["install","rapidkit-core"]),t.succeed("RapidKit installed globally");}catch(f){t.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),e$2.debug(`pipx install failed: ${f}`);}}}catch(c){t.succeed("Skipped optional global pipx installation"),e$2.debug(`Global install check skipped: ${c}`);}}async function it(e,n,t,o,a=false){if(!t)try{let{checkRapidkitCoreVersionCompatible:u}=await import('./pythonRapidkitExec-UMFLDIYR.js'),g=await u();if(g.isCompatible){n.succeed(`RapidKit ${g.installedVersion??""} already compatible globally; skipping pipx installation`),await k.outputFile(d.join(e,".rapidkit-global"),`RapidKit already available globally (version ${g.installedVersion??"unknown"}) and satisfies expected constraint ${g.expectedConstraint??"n/a"}; workspace will reuse the existing installation
|
|
169
|
+
`,"utf-8");return}g.reason==="constraint-missing"?e$2.debug('Version-aware global reuse skipped: no explicit rapidkit-core version constraint found. Set RAPIDKIT_CORE_PYTHON_PACKAGE (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core>=0.4.0,<0.9.0") to enable version-aware reuse. Proceeding with pipx install/upgrade.'):g.reason==="constraint-unsupported"&&e$2.debug('Version-aware global reuse skipped: RAPIDKIT_CORE_PYTHON_PACKAGE uses an unsupported spec (path/url/git). Use a version range instead (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core==0.4.0" or "rapidkit-core>=0.4.0,<0.9.0"). Proceeding with pipx install/upgrade.'),e$2.debug(`Global RapidKit install is not reusable via version-aware policy (reason=${g.reason}, installed=${g.installedVersion??"unknown"}, expected=${g.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(u){e$2.debug(`Global RapidKit version-aware check failed before pipx install: ${u}`);}let l=await he(n,a);if(n.start("Installing RapidKit globally with pipx"),t){let u=f(o||{});if(!u)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set WORKSPAI_DEV_PATH (or legacy RAPIDKIT_DEV_PATH)."));e$2.debug(`Installing from local path: ${u}`),n.text="Installing RapidKit from local path (test mode)",await U(l,["install","-e",u]);}else {n.text="Installing RapidKit from PyPI",d$1({status:"started",message:"Installing RapidKit from PyPI",installMethod:"pipx"});try{await U(l,["install","rapidkit-core"]),d$1({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"pipx"});}catch(u){try{n.text="RapidKit already installed globally, upgrading to match expected version",await U(l,["upgrade","rapidkit-core"]),d$1({status:"succeeded",message:"RapidKit upgraded from PyPI",installMethod:"pipx"});}catch(g){throw e$2.debug(`pipx install/upgrade failed: install=${u}, upgrade=${g}`),new i$1}}}n.succeed("RapidKit installed globally"),await k.outputFile(d.join(e,".rapidkit-global"),`RapidKit installed globally with pipx
|
|
170
|
+
`,"utf-8");}async function an(e,n){let{skipGit:t=false,installPythonEngine:o=false,testMode:a=false,userConfig:l={},yes:u=false,installMethod:g,pythonVersion:c="3.10"}=n||{},h="venv";o&&(h=g||l.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return e$2.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})());let y=b$2("Registering workspace",{component:"create",phase:"workspace.register"}),f=await ut(e);try{let p=d.basename(e),r=o?void 0:{bootstrapNote:"python-engine-skipped",pythonEngine:"skipped",pythonEngineReason:"project-workspace-foundation"};await Q(e,p,h,o?c:void 0,r),await H(e),await Z(e,p,h,o?c:void 0,n?.profile??"minimal",r),o?h==="poetry"?(await Ye(e,p),await ot(e,c,y,a,l,u)):h==="venv"?await Ee(e,c,y,a,l):await it(e,y,a,l,u):await ge(e,h,{pythonEngineSkipped:true}),o&&await ge(e,h),y.succeed(o?"Workspace registered":"Workspace registered (Python engine skipped)"),await b$3(e,{workspaceName:d.basename(e),silent:a}),await J(f),t||await X(e,y,"Initial commit: Workspai workspace");}catch(p){return y.fail("Failed to register workspace"),F(f,p)}}async function xt(e,n,t){let o=b$2("Creating demo workspace",{component:"create",phase:"workspace.demo"});try{await k.ensureDir(e),o.succeed("Directory created"),o.start("Setting up demo kit generator");let a$1=JSON.stringify({name:`${n}-workspace`,version:"1.0.0",private:true,description:"Workspai demo workspace",scripts:{generate:"node generate-demo.js"}},null,2);await promises.writeFile(d.join(e,"package.json"),a$1,"utf-8"),await promises.writeFile(d.join(e,"generate-demo.js"),`#!/usr/bin/env node
|
|
171
171
|
/**
|
|
172
172
|
* Demo Kit Generator - Create FastAPI demo projects
|
|
173
173
|
*
|
|
@@ -668,14 +668,14 @@ __pycache__/
|
|
|
668
668
|
`,"utf-8"),await execa("git",["add","."],{cwd:e,env:a()}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:e,env:a()}),o.succeed("Git repository initialized");}catch{o.warn("Could not initialize git repository");}}console.log(s.green(`
|
|
669
669
|
\u2728 Demo workspace created successfully!
|
|
670
670
|
`)),console.log(s.cyan("\u{1F4C2} Location:"),s.white(e)),console.log(s.cyan(`\u{1F680} Get started:
|
|
671
|
-
`)),console.log(s.white(` ${
|
|
671
|
+
`)),console.log(s.white(` ${h$2(e)}`)),console.log(s.white(" node generate-demo.js my-api")),console.log(s.white(" cd my-api")),console.log(s.white(" workspai init")),console.log(s.white(" workspai dev")),console.log(),console.log(s.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For Python engine features:"),console.log(s.cyan(" pipx install rapidkit-core")),console.log();}catch(a){throw o.fail("Failed to create demo workspace"),a}}async function It(e,n,t,o,a,l,u,g=false,c=false){if(console.log(s.cyan(`
|
|
672
672
|
\u{1F50D} Dry-run mode - what would be created:
|
|
673
673
|
`)),console.log(s.white("\u{1F4C2} Workspace path:"),e),console.log(s.white("\u{1F4DB} Name:"),s.cyan(n)),t)console.log(s.white("\u{1F4E6} Type:"),"Demo environment"),console.log(s.white(`
|
|
674
674
|
\u{1F4DD} Files to create:`)),console.log(s.gray(" - package.json")),console.log(s.gray(" - generate-demo.js (project generator)")),console.log(s.gray(" - README.md")),console.log(s.gray(" - .gitignore")),console.log(s.white(`
|
|
675
675
|
\u{1F3AF} Capabilities:`)),console.log(s.gray(" - Generate FastAPI/NestJS demo projects")),console.log(s.gray(" - No Python RapidKit installation required")),console.log(s.gray(" - Bundled templates"));else {let h=a||"minimal",y=l,f=u,r=new Set(["python-only","polyglot","enterprise"]).has(h);console.log(s.white("\u{1F4E6} Profile:"),s.cyan(h)),console.log(s.white("\u{1F4DD} Configuration:")),r?(console.log(s.gray(` - Python version: ${f}`)),console.log(s.gray(` - Python engine: ${c?"Skipped":`Install with ${y}`}`)),console.log(s.gray(` - Git init: ${g?"No":"Yes"}`))):(console.log(s.gray(" - Python-free profile (no Python needed)")),console.log(s.gray(` - Git init: ${g?"No":"Yes"}`))),console.log(s.white(`
|
|
676
676
|
\u{1F4CB} Files to create:`)),console.log(s.gray(" - .workspai-workspace (workspace marker)")),console.log(s.gray(" - .workspai/ (workspace config directory)")),console.log(s.gray(" - README.md")),console.log(s.gray(" - .gitignore")),r&&!c&&console.log(s.gray(` - ${y==="poetry"?"pyproject.toml + poetry.lock":".venv/ (virtual environment)"}`)),console.log(s.white(`
|
|
677
677
|
\u2699\uFE0F Environment setup:`)),r&&c?console.log(s.gray(" - Python engine setup skipped")):r&&console.log(y==="poetry"?s.gray(" - Poetry virtual environment created (recommended, includes dependency management)"):y==="venv"?s.gray(" - Python venv created in .venv/ (standard, zero extra tools)"):s.gray(" - Global pipx install (isolated, not local to workspace)")),console.log(s.white(`
|
|
678
|
-
\u{1F680} Next steps:`)),console.log(s.gray(` 1. ${
|
|
678
|
+
\u{1F680} Next steps:`)),console.log(s.gray(` 1. ${h$2(e)}`)),console.log(s.gray(" 2. npx workspai create project")),console.log(s.gray(" 3. npx workspai init")),console.log(s.gray(" 4. npx workspai dev")),console.log(s.white(`
|
|
679
679
|
\u{1F4A1} Learn more:`)),console.log(s.gray(" \u2022 Change profile later: workspai bootstrap --profile <profile>")),console.log(s.gray(" \u2022 Profile options: minimal|java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")),console.log(s.gray(" \u2022 Help: npx workspai --help"));}console.log(s.white(`
|
|
680
680
|
\u2728 To proceed: remove --dry-run flag
|
|
681
681
|
`));}export{X as a,ze as b,nn as c,ht as d,ge as e,on as f,an as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {f}from'./chunk-
|
|
1
|
+
import {f}from'./chunk-ZKYH44ER.js';import a from'path';import d from'fs-extra';var b=4,C="workspace-graph-token-efficiency.v1";function k(e){return Math.ceil(e/b)}function y(e,o){let n=a.resolve(e,o),t=a.relative(e,n);return !t||t.startsWith("..")||a.isAbsolute(t)?null:n}async function P(e){let o=new Map,n=[a.join(e,".workspai","workspace.contract.json"),a.join(e,".rapidkit","workspace.contract.json")];for(let t of n)if(await d.pathExists(t))try{let s=await d.readJson(t);for(let r of s.projects??[])typeof r.relativePath=="string"&&typeof r.externalPath=="string"&&a.isAbsolute(r.externalPath)&&o.set(r.relativePath.replace(/\\/g,"/").replace(/\/$/,""),r.externalPath);break}catch{}return o}function A(e,o,n){if(!o||a.isAbsolute(o))return null;let t=a.resolve(e),s=o.replace(/\\/g,"/");for(let[r,c]of [...n.entries()].sort(([u],[l])=>l.length-u.length))if(s.startsWith(`${r}/`))return y(c,s.slice(r.length+1));return y(t,s)}async function S(e){let o=a.resolve(e.workspacePath),n=f(e.graph,{query:e.query,...e.kind?{kind:e.kind}:{},...e.projectId?{projectId:e.projectId}:{},limit:e.limit,projection:"agent"}),t=e.corpus;if(!t){let l=[...new Set(e.graph.proofs.map(i=>i.artifact))].sort(),p=[],v=await P(o),h=0,g=0;for(let i of l){let f=A(o,i,v);if(!f){p.push(i);continue}try{let w=await d.readFile(f,"utf8");h+=w.length,g+=1;}catch{p.push(i);}}t={artifactCount:g,characterCount:h,estimatedTokens:k(h),unreadableArtifacts:p};}let s=JSON.stringify(n).length,r=t.estimatedTokens,c=k(s),u=Math.max(0,r-c);return {schemaVersion:C,generatedAt:(e.now??new Date).toISOString(),workspacePath:o,query:e.query,graph:{schemaVersion:e.graph.schemaVersion,sourceArtifact:e.graph.source.artifact,sourceHash:e.graph.source.hash,entityCount:e.graph.entities.length,relationCount:e.graph.relations.length,proofCount:e.graph.proofs.length},methodology:{id:"indexed-corpus-vs-bounded-retrieval.v1",estimated:true,charsPerToken:b,claimBoundary:"Measures retrieval payload reduction against readable proof-source text; it does not claim equivalent answer quality or model-specific billing savings."},corpus:t,retrieval:{matchCount:n.entities.length,characterCount:s,estimatedTokens:c,truncated:n.truncated,payload:n},savings:{estimatedTokensAvoided:u,reductionRatio:c===0?0:Number((r/c).toFixed(2)),reductionPercent:r===0?0:Number((u/r*100).toFixed(2))}}}export{C as a,S as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {g,f,h}from'./chunk-
|
|
1
|
+
import {g,f,h}from'./chunk-BLEIUQL6.js';import {q,p}from'./chunk-ODK4LCEL.js';import k from'fs-extra';var y=q.history,a=p.history,d=50;function A(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t;return typeof e.generatedAt!="string"?null:e.kind==="agent-action"?typeof e.actionId!="string"||typeof e.summary!="string"||e.outcome!=="ok"&&e.outcome!=="failed"?null:{kind:"agent-action",generatedAt:e.generatedAt,actionId:e.actionId,scope:typeof e.scope=="string"?e.scope:"workspace",summary:e.summary,outcome:e.outcome,...typeof e.evidenceSha256=="string"?{evidenceSha256:e.evidenceSha256}:{}}:e.kind==="doctor-fix"?e.scope!=="workspace"&&e.scope!=="project"||typeof e.summary!="string"||e.outcome!=="ok"&&e.outcome!=="failed"?null:{kind:"doctor-fix",generatedAt:e.generatedAt,scope:e.scope,summary:e.summary,outcome:e.outcome,applied:typeof e.applied=="number"?e.applied:0,failed:typeof e.failed=="number"?e.failed:0,skipped:typeof e.skipped=="number"?e.skipped:0,remainingBlockers:typeof e.remainingBlockers=="number"?e.remainingBlockers:0}:typeof e.verdict!="string"||typeof e.risk!="string"||typeof e.gatePassed!="boolean"?null:{kind:"verify",generatedAt:e.generatedAt,verdict:e.verdict,risk:String(e.risk),affectedProjects:typeof e.affectedProjects=="number"?e.affectedProjects:0,freshness:e.freshness??"unknown",gatePassed:e.gatePassed,blockingReasons:typeof e.blockingReasons=="number"?e.blockingReasons:0,policyViolations:typeof e.policyViolations=="number"?e.policyViolations:0}}function S(t,e){return {kind:"verify",generatedAt:t.generatedAt,verdict:t.summary.verdict,risk:t.impact.risk,affectedProjects:t.impact.affectedProjects,freshness:t.freshness.verdict,gatePassed:e,blockingReasons:t.blockingReasons.length,policyViolations:t.policyViolations.length}}function F(t){return {kind:"agent-action",generatedAt:t.generatedAt,actionId:t.actionId,scope:t.scope,summary:t.summary,outcome:t.outcome,...t.evidenceSha256?{evidenceSha256:t.evidenceSha256}:{}}}function V(t,e){let o=t.appliedFixes.filter(i=>i.outcome==="applied").length,r=t.appliedFixes.filter(i=>i.outcome==="failed").length,n=t.appliedFixes.filter(i=>i.outcome==="skipped").length,s=t.appliedFixes.filter(i=>i.outcome==="guidance").length,c=t.remainingBlockers.length,g=r>0||c>0?"failed":"ok";return {kind:"doctor-fix",generatedAt:t.generatedAt,scope:e,summary:`${o} applied, ${r} failed, ${n} skipped, ${s} guidance, ${c} blocker(s) remaining`,outcome:g,applied:o,failed:r,skipped:n,remainingBlockers:c}}async function E(t){let e=await g(t,a);try{if(!e||!await k.pathExists(e))return null;let o=await k.readJson(e);return o?.schemaVersion!==y||!Array.isArray(o.entries)?null:{schemaVersion:y,retention:typeof o.retention=="number"?o.retention:d,entries:o.entries.map(r=>A(r)).filter(r=>r!=null)}}catch{return null}}function x(t,e,o=d){let r=Math.max(1,Math.floor(o)),n=[...t?.entries??[],e],s=n.slice(Math.max(0,n.length-r));return {schemaVersion:y,retention:r,entries:s}}async function v(t,e,o){return f(t,a,async()=>{let r=await g(t,a),n=await E(t);if(r&&!n)throw new Error(`Workspace history is unreadable or invalid; refusing to overwrite: ${r}`);let s=x(n,e,o?.retention??d);return await h(t,a,s),s})}export{y as a,a as b,d as c,A as d,S as e,F as f,V as g,E as h,x as i,v as j};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {m,a as a$1,l as l$1}from'./chunk-
|
|
1
|
+
import {m,a as a$1,l as l$1}from'./chunk-ZW4QV6SB.js';import {b as b$5,g as g$2}from'./chunk-GIFAGOMK.js';import {b as b$4,a}from'./chunk-D5LLTUTY.js';import {b as b$2,f as f$2,s as s$1,t as t$1,u,P as P$1,v,q as q$1,r as r$1,R,n,o,p as p$2,h as h$2,i,m as m$1,j,k,l,O,w,x,y,z as z$1,A,B as B$1,C,E,G,I,D as D$1,F,H,J as J$1,K,L,M,N,S,T,U,V,Y as Y$1,X as X$1,W,a as a$3,Q}from'./chunk-QYEQVNBF.js';import {b as b$1,c,d}from'./chunk-4KEZQLBU.js';import {b as b$3}from'./chunk-COICGD62.js';import {d as d$2}from'./chunk-G3ZC5W4U.js';import {b as b$7}from'./chunk-NFWUAEVQ.js';import {r,m as m$2,d as d$1}from'./chunk-O2CFT2A3.js';import {p as p$1}from'./chunk-LMOTDLJF.js';import {g}from'./chunk-BLEIUQL6.js';import {a as a$2,b as b$6}from'./chunk-VN2MKTQO.js';import {f as f$1,g as g$1,h}from'./chunk-VQZ5PI5J.js';import {q,p,t,s as s$2}from'./chunk-ODK4LCEL.js';import s from'path';import h$1 from'fs-extra';var pe=["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"];var Jt="workspace-operational-skill.v1";function Yt(e){if(typeof e!="string")return null;let t=e.trim();return !t||t.includes("/")||t.includes("..")?null:t}function Ot(e){let t=Yt(e.skillId);if(!t)throw new Error(`Invalid skill id: ${e.skillId}`);return {schemaVersion:Jt,skillId:t,canonicalPath:W(t),title:e.title,triggers:[...e.triggers].sort((r,n)=>r.localeCompare(n)),requiredReports:[...e.requiredReports].sort((r,n)=>r.localeCompare(n)),scopedProjects:[...e.scopedProjects??[]].sort((r,n)=>r.localeCompare(n)),verificationCommands:[...e.verificationCommands],answerContractSections:[...pe],...e.promptStem?{promptStem:e.promptStem}:{},markdown:e.markdown}}var Xt=q.skillsIndex;function Tt(e){let t=[...e.skills].sort((i,c)=>i.skillId.localeCompare(c.skillId)),r=e.inputsHash??d$1({skillIds:t.map(i=>i.skillId),paths:t.map(i=>i.canonicalPath),decisions:e.decisions??[]}),n=e.decisions?[...e.decisions].sort((i,c)=>i.skillId.localeCompare(c.skillId)):void 0;return {schemaVersion:Xt,generatedAt:e.generatedAt,inputsHash:r,skills:t.map(i=>({skillId:i.skillId,path:i.canonicalPath,schemaVersion:i.schemaVersion,title:i.title})),...n?{selection:{generatedCount:n.filter(i=>i.status==="generated").length,suppressedCount:n.filter(i=>i.status==="suppressed").length,decisions:n}}:{}}}var _t=[p.agentIndex,b$1,d$2],B="<!-- WORKSPAI:GENERATED-OPERATIONAL-SKILL -->",Qt=[{skillId:"workspai-diagnose-api-failure",title:"Diagnose API failure",triggers:["api failure","500 error","integration test failed","service unreachable"],objective:"Investigate a failing API or service using Workspai evidence before editing application code.",steps:[`Read \`${p.agentIndex}\` and identify fail/warn reports for the scoped project.`,`Read \`${p.doctor}\`, \`doctor-project-last-run.json\`, and project-scoped run evidence if present.`,"If a fix was requested, read `artifact-remediation-plan-last-run.json` for cross-artifact next steps, then `doctor-remediation-plan-last-run.json` for Doctor-specific file edits.","Map the failure to workspace vs project scope; cite exit codes and blocker messages.","Propose the smallest safe fix (config, env, dependency) with explicit verification commands."],applicability:"api"},{skillId:"workspai-release-readiness",title:"Release readiness",triggers:["release","ship","production","readiness gate"],objective:"Assess whether this workspace is release-ready using governed Workspai gates.",steps:[`Read \`${p.readiness}\` and \`pipeline-last-run.json\`.`,`Read \`${p.verify}\` for verdict and blocking reasons.`,`Read \`${t.artifactRemediationPlan}\` when a Studio or agent repair path is needed.`,"List blocking gates first; never claim ready without cited report fields.","Provide one safe next command and a verification checklist."],applicability:"workspace"},{skillId:"workspai-safe-schema-migration",title:"Safe schema migration",triggers:["migration","schema change","database migration","db migrate"],objective:"Plan and verify a schema migration with blast-radius awareness.",steps:["Identify affected projects from workspace model and dependency graph.","Run or review impact/verify evidence for transitive dependents.","Run a registered project-scoped test/build command when available; otherwise resolve the repository-authored validation command from cited manifests before promoting the migration.","Document rollback and verification signals."],applicability:"schema"},{skillId:"workspai-dependency-upgrade",title:"Dependency upgrade",triggers:["upgrade dependency","bump package","security advisory","outdated deps"],objective:"Upgrade dependencies with graph-aware verification.",steps:["Scope the upgrade to the owning project from workspace model.","Check transitive dependents via workspace graph / impact reports.","Use registered test/build commands for affected projects; when none are registered, resolve repository-authored commands from cited manifests instead of inventing one.","Re-run `workspace verify` after evidence refresh."],applicability:"dependency"},{skillId:"workspai-rename-contract",title:"Rename contract safely",triggers:["rename contract","rename event","breaking api","contract change"],objective:"Rename or change a shared contract with consumer awareness.",steps:[`Read \`${t.workspaceContract}\` for publishes/consumes/owns edges.`,"List all consumer projects before proposing renames.","Update contract file and regenerate workspace model.","Verify contract gate and integration tests for consumers."],applicability:"contract"}];function z(e){return `npx workspai ${e}`.trim()}function Zt(e){let t=["---",`name: ${e.template.skillId}`,`description: ${e.template.objective}`,"---","",B,"",`# ${e.template.title}`,"",`> Workspace: **${e.workspaceName}** \xB7 Skill: \`${e.template.skillId}\``,"","## Objective","",e.template.objective,"","## Triggers","",...e.template.triggers.map(r=>`- ${r}`),"","## Required evidence (read first)","",..._t.map(r=>`- \`${r}\``),"","## Why this skill exists here","",`Applicability: **${e.decision.confidence} confidence**.`,"",...e.decision.reasons.map(r=>`- ${r}`),...e.decision.signals.length>0?["","Evidence signals:","",...e.decision.signals.map(r=>`- \`${r}\``)]:[],"","## Project-aware execution boundary","",...e.projectEvidence,"",...e.retrievalCommands.length>0?["## Scoped retrieval commands","",...e.retrievalCommands.map(r=>`- \`${r}\``),""]:[],"## Procedure","",...e.template.steps.map((r,n)=>`${n+1}. ${r}`),""];if(e.scopedProjects.length>0&&t.push("## Scoped projects","",...e.scopedProjects.map(r=>`- ${r}`),""),e.contractSummary&&t.push("## Contract context","",e.contractSummary,""),e.verificationCommands.length>0){t.push("## Verification commands (this workspace)","");for(let r of e.verificationCommands)t.push(`- \`${r}\``);t.push("");}return t.push("## Answer contract","","Return: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.","","## Refresh stale evidence","","```bash",z("workspace agent-sync --write --refresh-context"),"```",""),t.join(`
|
|
2
2
|
`)}function er(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function tr(e){let t=new Map;for(let c of e.projects){let m=new Set([c.runtime,...c.runtimeCandidates??[]].map(er).filter(a=>a&&a!=="unknown"));for(let a of m){let k=t.get(a)??[];k.includes(c.name)||k.push(c.name),t.set(a,k);}}let r=[];for(let[c,m]of [...t.entries()].sort(([a],[k])=>a.localeCompare(k)))r.push({skillId:`workspai-${c}-runtime-validation`,title:`${c.toUpperCase()} runtime validation`,triggers:[`${c} build`,`${c} test`,`${c} runtime failure`],objective:`Validate ${c} changes against the detected runtime boundary, registered project commands, and canonical Workspai evidence.`,steps:["Read the scoped project lens and current fail/warn evidence before changing source.",`Use a registered ${c} command only when the project model identifies ${c} as the primary runtime; for a composite secondary boundary, inspect its manifest and Graph proofs instead of assuming the primary adapter covers it.`,"Run only the affected project validation first, then verify the workspace when the change crosses a contract boundary."],scopedProjects:[...m].sort(),applicability:"derived"});t.size>1&&r.push({skillId:"workspai-polyglot-change-validation",title:"Polyglot change validation",triggers:["cross-language change","polyglot change","binding change","multi-runtime validation"],objective:"Plan and verify a cross-runtime change without assuming that one runtime command proves the whole system.",steps:["Use the project topology and bounded Graph query to identify runtime and contract boundaries.","Validate each affected runtime with its registered project command.","Run workspace impact and canonical verification before declaring the change complete."],scopedProjects:Wt([...t.values()].flat()),applicability:"derived"});let n=e.projects.filter(c=>c.commands.supported.includes("test")).map(c=>c.name).sort();n.length>0&&r.push({skillId:"workspai-test-evidence-recovery",title:"Test evidence recovery",triggers:["test failure","coverage","regression","test evidence"],objective:"Repair a test or coverage blocker by proving changed behavior, not merely improving a metric.",steps:["Read the exact Analyze, Doctor, or Goal evidence that owns the test finding.","Inspect the behavior and relevant test boundary before proposing a source change.","Run the scoped test command, then the exact producer and canonical verification."],scopedProjects:n,applicability:"derived"});let i=e.projects.filter(c=>c.importantFiles.some(m=>/(?:^|\/)(?:Dockerfile|docker-compose|compose\.|Chart\.yaml|\.github\/workflows)/i.test(m))).map(c=>c.name).sort();return i.length>0&&r.push({skillId:"workspai-delivery-evidence",title:"Delivery evidence and CI recovery",triggers:["ci failure","workflow failure","container build","deployment evidence"],objective:"Diagnose delivery evidence with the owning project and CI/container artifacts before changing application source.",steps:["Identify whether the failing evidence is project-owned or workspace-owned.","Inspect the referenced workflow or delivery artifact and its bounded proof paths.","Validate the affected project first, then refresh the exact evidence producer and verify the workspace."],scopedProjects:i,applicability:"derived"}),r}function rr(e,t){if(!e?.safeCommands?.length)return [z("workspace verify --json"),z("doctor workspace --json")];let r=new Set(t);return e.safeCommands.filter(n=>n.scope==="workspace"||n.project&&r.has(n.project)).slice(0,8).map(n=>n.display)}function nr(e,t){if(!e?.projects?.length)return;let r=new Set(t),n=e.projects.filter(i=>r.has(i.slug)).filter(i=>(i.contracts?.owns?.length??0)>0||(i.contracts?.publishes?.length??0)>0||(i.contracts?.consumes?.length??0)>0||(i.contracts?.apis?.length??0)>0).slice(0,12).map(i=>{let c=i.contracts?.owns?.join(", ")||"none",m=i.contracts?.publishes?.join(", ")||"none",a=i.contracts?.consumes?.join(", ")||"none";return `- **${i.slug}**: owns \`${c}\`; publishes \`${m}\`; consumes \`${a}\``});return n.length>0?n.join(`
|
|
3
3
|
`):void 0}var ar=/(?:^|\/)(?:package(?:-lock)?\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb?|pyproject\.toml|poetry\.lock|requirements[^/]*\.txt|Pipfile(?:\.lock)?|uv\.lock|Cargo\.toml|Cargo\.lock|go\.mod|go\.sum|pom\.xml|build\.gradle(?:\.kts)?|settings\.gradle(?:\.kts)?|Gemfile(?:\.lock)?|composer\.(?:json|lock)|mix\.exs|deps\.edn|project\.clj|[^/]+\.(?:csproj|fsproj|vbproj)|Directory\.Packages\.props)$/i,or=/(?:^|\/)(?:openapi|swagger|asyncapi)\.(?:json|ya?ml)$|(?:^|\/)(?:routes?|controllers?|endpoints?|proto)(?:\/|\.)/i,ir=/(?:^|\/)(?:migrations?|database|db|prisma)(?:\/|\.)|(?:^|\/)schema\.(?:sql|prisma)$/i;function sr(e){let t=e.attributes.artifact;return typeof t=="string"&&t.trim()?t.trim():null}function cr(e){let t=e.attributes.ports;return Array.isArray(t)&&t.length>0}function lr(e,t){return e?.entities.filter(r=>r.projectId===t)??[]}function ue(e,t=12){return [...new Set([...e].map(r=>r.trim()).filter(Boolean))].sort((r,n)=>r.localeCompare(n)).slice(0,t)}function Wt(e){return [...new Set([...e].map(t=>t.trim()).filter(Boolean))].sort((t,r)=>t.localeCompare(r))}function dr(e){if(e.template.scopedProjects)return {projects:[...e.template.scopedProjects].sort(),reasons:["The canonical workspace model directly derived this capability."],signals:ue(e.template.scopedProjects.map(i=>`model:project:${i}:${e.template.skillId}`)),confidence:"high",applicable:true};if(e.template.applicability==="workspace")return {projects:e.model.projects.map(i=>i.name).sort(),reasons:["Workspace-level release and verification gates are always available."],signals:["model:workspace",`model:project-count:${e.model.projects.length}`],confidence:"high",applicable:true};let t=[],r=[],n=new Set;for(let i of e.model.projects){let c=lr(e.graph,i.name),m=Wt([...i.importantFiles,...c.map(sr).filter(l=>!!l)]),a=e.contract?.projects.find(l=>l.slug===i.name),k=false;switch(e.template.applicability){case "dependency":{let l=m.filter(d=>ar.test(d)),p=c.filter(d=>d.kind==="package");k=l.length>0||p.length>0,r.push(...l.map(d=>`artifact:${d}`),...p.slice(0,4).map(d=>`graph:package:${d.label}`)),k&&n.add("Dependency manifests or package entities were observed.");break}case "api":{let l=c.filter(w=>w.kind==="api"||w.kind==="endpoint"||w.kind==="service"&&cr(w)),p=m.filter(w=>or.test(w)),d=a?.contracts?.apis??[],R=(a?.ports??[]).filter(w=>["http","https","grpc"].includes(w.protocol));k=l.length>0||p.length>0||d.length>0||R.length>0,r.push(...l.slice(0,4).map(w=>`graph:${w.kind}:${w.label}`),...p.map(w=>`artifact:${w}`),...d.map(w=>`contract:api:${w.name}:${w.basePath}`),...R.map(w=>`contract:port:${w.name}:${w.protocol}:${w.port}`)),k&&n.add("An API, endpoint, routed artifact, or network contract was observed.");break}case "schema":{let l=c.filter(d=>{if(d.kind==="database")return true;if(d.kind!=="schema")return false;let R=`${d.label} ${JSON.stringify(d.attributes)}`;return /database|migration|sql|prisma|orm/i.test(R)}),p=m.filter(d=>ir.test(d));k=l.length>0||p.length>0,r.push(...l.slice(0,4).map(d=>`graph:${d.kind}:${d.label}`),...p.map(d=>`artifact:${d}`)),k&&n.add("A database, schema, or migration artifact was observed.");break}case "contract":{let l=a?[...a.contracts?.owns??[],...a.contracts?.publishes??[],...a.contracts?.consumes??[],...(a.contracts?.apis??[]).map(d=>d.name)]:[],p=c.filter(d=>["api","protocol"].includes(d.kind));k=l.length>0||p.length>0,r.push(...l.map(d=>`contract:${i.name}:${d}`),...p.slice(0,6).map(d=>`graph:${d.kind}:${d.label}`)),k&&n.add("A shared API, protocol, schema, or authored contract edge was observed.");break}case "derived":k=true;break}k&&t.push(i.name);}return {projects:ue(t,e.model.projects.length),reasons:[...n],signals:ue(r),confidence:e.graph||e.contract?"high":"medium",applicable:t.length>0}}function pr(e,t,r){let n=[];for(let i of t){let c=e.projects.find(l=>l.name===i);if(!c)continue;let m=c.commands.supported.filter(l=>["build","test","lint","format"].includes(l)),a=c.commands.supported.filter(l=>["docs","doctor"].includes(l)),k=r.filter(l=>l.startsWith("artifact:")).map(l=>l.slice(9)).filter(l=>c.importantFiles.includes(l)||l.includes(c.name));n.push(`- **${c.name}** \u2014 runtime \`${c.runtime}\`, framework \`${c.framework}\`, confidence \`${c.confidence}\`.`),n.push(m.length>0?` Registered lifecycle commands: ${m.map(l=>`\`${l}\``).join(", ")}.`:" No project-native build/test command is registered; inspect repository-authored manifests and Graph proofs before running a command."),a.length>0&&n.push(` Registered evidence commands: ${a.map(l=>`\`${l}\``).join(", ")}.`),k.length>0&&n.push(` Relevant artifacts: ${ue(k,6).map(l=>`\`${l}\``).join(", ")}.`);}return n.length>0?n:["- No project boundary was proven; do not infer repository-specific commands or files."]}function ur(e,t){let r=e.applicability==="api"?"api endpoint route service failure":e.applicability==="schema"?"database schema migration persistence":e.applicability==="dependency"?"package dependency manifest lockfile":e.applicability==="contract"?"api protocol published consumed contract":e.applicability==="workspace"?"release pipeline deployment verification":`${e.title.toLowerCase()} manifest command test`;return t.slice(0,8).map(n=>z(`workspace graph search "${r}" --scope project:${n} --limit 12 --json`))}function jt(e){let t=e.model.workspace.name,r=[],n=[];for(let i of [...Qt,...tr(e.model)]){let c=dr({template:i,model:e.model,contract:e.contract??null,graph:e.graph??null}),m={skillId:i.skillId,title:i.title,status:c.applicable?"generated":"suppressed",confidence:c.confidence,reasons:c.reasons.length>0?c.reasons:["No authoritative workspace signal proves this capability is present."],signals:c.signals,scopedProjects:c.projects};if(n.push(m),m.status==="suppressed")continue;let a=m.scopedProjects,k=rr(e.context??null,a),l=nr(e.contract??null,a),p=Zt({template:i,workspaceName:t,scopedProjects:a,verificationCommands:k,contractSummary:l,decision:m,projectEvidence:pr(e.model,a,m.signals),retrievalCommands:ur(i,a)});r.push(Ot({skillId:i.skillId,title:i.title,triggers:i.triggers,requiredReports:[..._t],scopedProjects:a,verificationCommands:k,...X$1(i.skillId)?{promptStem:Y$1[i.skillId]}:{},markdown:p}));}return {skills:r,decisions:n}}async function Nt(e){let t=s.resolve(e.workspacePath),r=[],n=d$1({skills:e.skills.map(a=>({id:a.skillId,path:a.canonicalPath,hash:d$1({markdown:a.markdown})})),decisions:e.decisions??[]}),i=Tt({generatedAt:e.generatedAt,skills:e.skills,inputsHash:n,decisions:e.decisions}),c=new Set(e.skills.map(a=>a.skillId)),m=[];if(e.write){let a=s.join(t,".workspai","skills");if(await h$1.pathExists(a))for(let l of await h$1.readdir(a,{withFileTypes:true})){if(!l.isFile()||!l.name.endsWith(".md"))continue;let p=l.name.slice(0,-3);if(c.has(p))continue;let d=s.join(a,l.name);(await h$1.readFile(d,"utf8")).includes(B)&&(await h$1.remove(d),m.push(p));}for(let l of e.skills){let p=s.join(t,l.canonicalPath);await h$1.ensureDir(s.dirname(p)),await h$1.writeFile(p,l.markdown,"utf8"),r.push(l.canonicalPath);}let k=s.join(t,b$2);await h$1.ensureDir(s.dirname(k)),await h$1.writeJson(k,i,{spaces:2}),r.push(b$2);}return {skills:e.skills,index:i,writtenPaths:r,removedSkillIds:m.sort()}}function Lt(e){return ["## Operational skills (canonical)","","Read workspace-native playbooks from `.workspai/skills/` before generic repo scans. Legacy `.rapidkit/skills/` playbooks are read only when already present from older workspaces:","",...e.skills.map(r=>`- \`${r.path}\` \u2014 ${r.title} (\`${r.skillId}\`)`),"","Regenerate:","","```bash",z("workspace agent-sync --write --refresh-context"),"```",""].join(`
|
|
4
4
|
`)}var gr={"workspai-diagnose-api-failure":A,"workspai-release-readiness":E},Je="## Workspace verification (hydrated)";function mr(e){let t=[Je,"","Verification commands for this workspace:","",...e.verificationCommands.length?e.verificationCommands.map(r=>`- \`${r}\``):["- `npx workspai workspace verify --json`"]];return e.scopedProjects.length>0&&t.push("","Scoped projects:","",...e.scopedProjects.map(r=>`- ${r}`)),t.push(""),t.join(`
|
|
5
5
|
`)}async function Gt(e){let t=s.resolve(e.workspacePath),r=[];for(let n of e.skills){let i=gr[n.skillId];if(!i)continue;let c=s.join(t,i);if(!await h$1.pathExists(c))continue;let m=await h$1.readFile(c,"utf8"),a=mr(n),k=m.includes(Je)?m.replace(new RegExp(`${Je}[\\s\\S]*$`),a.trimEnd()):`${m.trimEnd()}
|
|
6
6
|
|
|
7
7
|
${a}`;e.write&&await h$1.writeFile(c,`${k.trimEnd()}
|
|
8
|
-
`,"utf8"),r.push(i);}return r}var fr="workspai-agent-customization-pack-capabilities.v1";function $t(){return {schemaVersion:fr,presets:{minimal:{meaning:"Generate the portable grounding index, AGENTS.md, and provider-specific lightweight instructions.",requiredOutputs:[p.agentIndex,p.agentCustomizationPack,p.agents]},enterprise:{meaning:"Generate the full VS Code-native pack: instructions, prompts, skills, custom agents, and validation metadata.",requiredOutputs:[p.agentIndex,p.agentCustomizationPack,p.agents,w,A,M,".github/agents/workspai-advisor.agent.md",S,b$2]}},targets:{all:{meaning:"Generate every supported customization surface.",outputFamilies:["portable","vscode","copilot","cursor","claude","gemini","qwen","kimi","grok","windsurf","amazon-q"]},vscode:{meaning:"Generate VS Code-native customizations for Copilot Chat and agent workflows.",outputFamilies:["instructions","prompts","skills","agents","hooks"]},agents:{meaning:"Generate portable AGENTS.md grounding and .agents/skills projections.",outputFamilies:["portable","skills"]},copilot:{meaning:"Generate GitHub Copilot instructions, prompts, and skills.",outputFamilies:["instructions","prompts","skills"]},cursor:{meaning:"Generate Cursor rules.",outputFamilies:["rules"]},claude:{meaning:"Generate Claude Code grounding files.",outputFamilies:["rules","portable"]},codex:{meaning:"Use AGENTS.md and the report index as the Codex grounding layer.",outputFamilies:["portable"]},gemini:{meaning:"Generate Gemini CLI grounding through GEMINI.md and canonical AGENTS.md.",outputFamilies:["adapter","portable"]},qwen:{meaning:"Generate Qwen Code grounding through QWEN.md and canonical AGENTS.md.",outputFamilies:["adapter","portable"]},kimi:{meaning:"Use AGENTS.md and the report index as the Kimi Code grounding layer.",outputFamilies:["portable"]},grok:{meaning:"Use AGENTS.md and the report index as the xAI Grok grounding layer.",outputFamilies:["portable"]},windsurf:{meaning:"Use AGENTS.md and the report index as the Windsurf grounding layer.",outputFamilies:["portable"]},"amazon-q":{meaning:"Generate an Amazon Q project rule that routes agents to canonical evidence.",outputFamilies:["rules","portable"]},orca:{meaning:"Legacy compatibility alias for AGENTS.md consumers; prefer the grok target.",outputFamilies:["portable"]}},standardAnswerContract:[...pe],requiredReports:J.map(e=>({path:e.relativePath,label:e.label,required:e.required})),strictRules:["Required reports must exist.","Generated report paths must stay inside the workspace root.","Generated customization text must be English-only.","Agent answers must not claim pass, ready, or healthy without cited evidence.","Commands must distinguish display guidance from execution requests.","Agent hook files must be advisory and disabled by default unless the user explicitly enables them.","MCP design artifacts must stay read-mostly until write tools have explicit approval boundaries."],outputKinds:["report","grounding","instruction","prompt","skill","skill-resource","operational-skill","skills-index","explain-report","agent","rule","hook","mcp-design"],pathLayers:{l1CanonicalRoots:[".workspai/reports/",`${a$3}/`],l2PrefixedMirrorRoots:[".agents/",".github/",".cursor/",".claude/",".amazonq/"],l3SharedIndustryFiles:["AGENTS.md",".github/copilot-instructions.md","CLAUDE.md","GEMINI.md","QWEN.md"]}}}var kr=q.agentIndex,hr=q.agentCustomizationPack,X=p.agentIndex,Y=p.agentCustomizationPack;var J=[{relativePath:t.goalIndex,label:"Active Goal Pack index",required:false},{relativePath:t.goalPackLastRun,label:"Latest governed Goal Pack",required:false},{relativePath:b$1,label:"Agent context pack",required:true},{relativePath:b$2,label:"Operational skills index",required:true},{relativePath:p.model,label:"Workspace model",required:false},{relativePath:p.knowledgeGraph,label:"Workspace knowledge graph",required:false},{relativePath:p.evaluationLastRun,label:"Workspace Intelligence evaluation",required:false},{relativePath:p.doctor,label:"Workspace doctor",required:false},{relativePath:t.doctorProject,label:"Project doctor",required:false},{relativePath:t.doctorRemediationPlan,label:"Doctor remediation plan",required:false},{relativePath:t.artifactRemediationPlan,label:"Artifact remediation plan",required:false},{relativePath:t.doctorFixResult,label:"Doctor fix result",required:false},{relativePath:p.analyze,label:"Workspace analyze",required:false},{relativePath:t.pipelineLastRun,label:"Governance pipeline",required:false},{relativePath:p.readiness,label:"Release readiness",required:false},{relativePath:p.impact,label:"Workspace impact",required:false},{relativePath:p.verify,label:"Workspace verify",required:false},{relativePath:p.snapshot,label:"Workspace model snapshot",required:false},{relativePath:p.diff,label:"Workspace model diff",required:false},{relativePath:p.explain,label:"Workspace explain",required:false},{relativePath:p.contractVerify,label:"Workspace contract verify",required:false},{relativePath:p.history,label:"Workspace intelligence history",required:false}];function wr(){let e=J.map(r=>r.relativePath),t=b$3().consumers.agents.canonicalReadOrder;return [...new Set(t.filter(r=>r!==X&&e.includes(r)))]}async function Ar(e){try{let{contract:t}=await p$1({workspacePath:e});if(t?.workspace?.name)return `workspace:${t.workspace.name}`}catch{}for(let t of [".workspai/workspace.json",".rapidkit/workspace.json"])try{let r=await h$1.readJson(s.join(e,t)),n=typeof r.workspace_name=="string"?r.workspace_name:typeof r.name=="string"?r.name:null;if(n?.trim())return `workspace:${n.trim()}`}catch{}return `workspace:${s.basename(s.resolve(e))}`}function P(e){return `npx workspai ${e}`.trim()}function rt(e){return e&&typeof e=="object"?e:null}function Ye(e,t=12){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0).slice(0,t):[]}function yr(e){let t=Ye(e.blockers,12);if(t.length>0)return t;let r=Ye(e.blockingReasons,12);if(r.length>0)return r;let n=rt(e.summary);return n&&Array.isArray(n.blockingReasons)?Ye(n.blockingReasons,12):[]}function Rr(e){let t=[...new Set(e.map(r=>r.trim()).filter(Boolean))];return t.filter(r=>{let n=r.toLowerCase();return !t.some(i=>{if(i===r||!i.includes(":"))return false;let c=i.toLowerCase();return c.length>n.length&&c.endsWith(n)})})}function br(e){for(let t of ["generatedAt","updatedAt","timestamp"]){let r=e[t];if(typeof r=="string"&&r.trim())return r.trim()}if(Array.isArray(e.entries)){let t=e.entries.map(r=>rt(r)?.generatedAt).filter(r=>typeof r=="string"&&r.trim().length>0).map(r=>r.trim()).filter(r=>Number.isFinite(Date.parse(r)));if(t.length>0)return t.reduce((r,n)=>Date.parse(n)>Date.parse(r)?n:r)}}function Pr(e,t,r){if(!e)return true;let n=Date.parse(e);return Number.isFinite(n)?r.getTime()-n>t*60*60*1e3:true}function vr(e,t,r){return e.path===p.snapshot?false:Pr(e.generatedAt,t,r)}function Sr(e){let t=e&&e.length>0?e:["all"];return t.includes("all")?new Set(["all","vscode","agents","copilot","cursor","claude","codex","gemini","qwen","kimi","grok","windsurf","amazon-q","orca"]):new Set(t)}function b(e,t){return e.has("all")||e.has(t)}function Ft(e){return b(e,"copilot")||b(e,"vscode")}function Xe(e){return b(e,"agents")||b(e,"codex")||b(e,"kimi")||b(e,"grok")||b(e,"orca")}function Er(e,t){return t==="generic"?b(e,"agents"):t==="copilot"?Ft(e):t==="grok"?b(e,"grok")||b(e,"orca"):b(e,t)}function Ir(e){return e??"enterprise"}function Cr(e){return e===b$2?"skills-index":e.includes("workspace-explain-last-run.json")?"explain-report":(e.startsWith(`${a$3}/`)||e.startsWith(".rapidkit/skills/"))&&e.endsWith(".md")?"operational-skill":e.includes("hooks")||e===U||e===V?"hook":e.includes("mcp")||e===S||e===T?"mcp-design":e.endsWith(".json")?"report":e.includes("/instructions/")||e.endsWith("copilot-instructions.md")?"instruction":e.includes("/prompts/")?"prompt":e.includes("/skills/")&&e.endsWith("/SKILL.md")?"skill":e.includes("/skills/")?"skill-resource":e.includes("/agents/")?"agent":e.includes("/rules/")||e.endsWith(".mdc")?"rule":"grounding"}function xr(e){return e.startsWith(".github/")?["vscode","copilot"]:e.startsWith(".cursor/")?["cursor"]:e.startsWith(".claude/")||e==="CLAUDE.md"?["claude"]:e==="GEMINI.md"?["gemini"]:e==="QWEN.md"?["qwen"]:e.startsWith(".amazonq/")?["amazon-q"]:e===".windsurfrules"||e.startsWith(".windsurf/")?["windsurf"]:e.startsWith(".grok/")?["grok"]:e.startsWith(".agents/")?["agents","codex","kimi","grok","orca"]:e==="AGENTS.md"||e.startsWith(".rapidkit/")?["agents","codex","kimi","grok","copilot","cursor","claude","gemini","qwen","amazon-q","windsurf","orca","vscode"]:e.startsWith(".vscode/")?["vscode"]:["agents"]}function Dt(e){return [{target:"agents",path:`.agents/skills/${e}/SKILL.md`},{target:"copilot",path:`.github/skills/${e}/SKILL.md`},{target:"claude",path:`.claude/skills/${e}/SKILL.md`},{target:"cursor",path:`.cursor/skills/${e}/SKILL.md`},{target:"grok",path:`.grok/skills/${e}/SKILL.md`}]}async function Or(e,t){let r=s.join(e,t);!await h$1.pathExists(r)||!(await h$1.readFile(r,"utf8")).includes(B)||await h$1.remove(r);}function Tr(e,t){return $t().presets[t].requiredOutputs.includes(e)}async function _r(e,t){if(t)return t;let r=await g(e,l$2)??s.join(e,l$2);if(await h$1.pathExists(r))try{let n=await h$1.readJson(r);return b$6(l$2,n,r),n}catch{}return q$1({workspacePath:e,includeEvidence:true})}async function Wr(e,t){let r=await g(e,p.knowledgeGraph);if(!r)return null;try{let n=await h$1.readJson(r);b$6(p.knowledgeGraph,n,r);let i=n;return i.proofs.some(c=>c.freshness==="stale")?null:(b$7(i,t),i)}catch{return null}}function jr(e){return e.length>0&&!s.isAbsolute(e)&&!e.split(/[\\/]+/).includes("..")}function Nr(e){return Object.fromEntries(["all","vscode","agents","copilot","cursor","claude","codex","gemini","qwen","kimi","grok","windsurf","amazon-q","orca"].map(r=>[r,{enabled:e.targets.includes("all")||e.targets.includes(r),outputs:e.outputs.filter(n=>n.targets.includes(r)).map(n=>n.path).sort()}]))}async function Lr(e,t){try{if(!await h$1.pathExists(e))return {payload:null,exists:false,validity:"missing"};let r=await h$1.readJson(e),n=rt(r);return n?a$2(t)?(b$6(t,n,e),{payload:n,exists:true,validity:"valid"}):{payload:n,exists:true,validity:"uncontracted"}:{payload:null,exists:true,validity:"invalid",validationError:"Artifact root must be a JSON object"}}catch(r){return {payload:null,exists:true,validity:"invalid",validationError:r instanceof Error?r.message:String(r)}}}async function Kt(e){let t=e.now??new Date,r=e.staleAfterHours??24,n=[],i=[];for(let a of J){let k=await g(e.workspacePath,a.relativePath)??s.join(e.workspacePath,a.relativePath),l=await Lr(k,a.relativePath),p=l.payload;l.validity==="invalid"?i.push(`Invalid evidence contract: ${a.relativePath}`):p&&i.push(...yr(p)),n.push({path:a.relativePath,label:a.label,required:a.required,exists:l.exists,validity:l.validity,validationError:l.validationError,generatedAt:p?br(p):void 0,commandId:typeof p?.commandId=="string"?p.commandId:void 0,exitCode:typeof p?.exitCode=="number"?p.exitCode:void 0});}let c=Rr(i).slice(0,16),m=b$3();return {schemaVersion:kr,generatedAt:t.toISOString(),workspaceRoot:await Ar(e.workspacePath),intelligenceChain:{schemaVersion:m.schemaVersion,contractPath:m.contractPath,currentStep:"agent-sync"},readOrder:wr(),blockers:c,staleAfterHours:r,reports:n,refreshCommand:P("workspace agent-sync --write --refresh-context")}}function Gr(e){let t$1=["# Workspai agent grounding","","Cross-tool instructions for Copilot, Cursor, Claude Code, Codex, Grok, and other agents.","","## Read order (mandatory before workspace diagnosis)","",`1. \`${p.agentIndex}\` \u2014 latest blockers, timestamps, and report paths`,`2. \`${t.goalIndex}\` \u2014 when present, read the active Goal Pack and its handoff before choosing work.`,`3. \`${p.agentContext}\` \u2014 read only task-relevant context`,`4. \`${p.skillsIndex}\` \u2014 select only the Skill that matches the task.`,"5. Read only the task-relevant evidence artifacts listed in the index.","6. Use the Goal Pack retrieval queries, `workspace graph search <query> --limit 12 --json`, or MCP `searchWorkspaceGraph` before loading the full graph.","","Do **not** full-repo scan or inject the complete graph when a bounded query can answer the task.","","## Proof-carrying mutations","","For source-changing work, use the active Goal Pack command `beginChange` before the first mutation.","Prediction is planning input, never proof. Execute only explicitly authorized effect classes, record typed effect receipts, then run `workspai change verify --change <id> --json`.","A task is not complete until its capsule is sealed or its remaining uncertainty is reported.","","## Regenerate intelligence","","```bash",P("workspace agent-sync --write --refresh-context"),P("workspace context --for-agent --json --write"),P("pipeline --json --write"),"```",""];if(e.index.blockers.length>0){t$1.push("## Current blockers","");for(let r of e.index.blockers.slice(0,12))t$1.push(`- ${r}`);t$1.push("");}if(e.context?.safeCommands?.length){t$1.push("## Safe commands (prefer these)","");for(let r of e.context.safeCommands.slice(0,10))t$1.push(`- \`${r.display}\` \u2014 ${r.description}`);t$1.push("");}return t$1.push("## Rules","","- Treat `.workspai/reports/*` as the source of truth for health, gates, and release posture.","- Prefer deterministic Workspai CLI commands over heuristic framework guesses.","- If evidence is missing or stale, run the refresh commands above before proposing fixes.","- Keep project-scoped advice aligned with the active project named in the context pack.","- Never claim that an active goal is satisfied until its CLI-owned verification lifecycle is `verified`.",""),t$1.join(`
|
|
8
|
+
`,"utf8"),r.push(i);}return r}var fr="workspai-agent-customization-pack-capabilities.v1";function $t(){return {schemaVersion:fr,presets:{minimal:{meaning:"Generate the portable grounding index, AGENTS.md, and provider-specific lightweight instructions.",requiredOutputs:[p.agentIndex,p.agentCustomizationPack,p.agents]},enterprise:{meaning:"Generate the full VS Code-native pack: instructions, prompts, skills, custom agents, and validation metadata.",requiredOutputs:[p.agentIndex,p.agentCustomizationPack,p.agents,w,A,M,".github/agents/workspai-advisor.agent.md",S,b$2]}},targets:{all:{meaning:"Generate every supported customization surface.",outputFamilies:["portable","vscode","copilot","cursor","claude","gemini","qwen","kimi","grok","windsurf","amazon-q"]},vscode:{meaning:"Generate VS Code-native customizations for Copilot Chat and agent workflows.",outputFamilies:["instructions","prompts","skills","agents","hooks"]},agents:{meaning:"Generate portable AGENTS.md grounding and .agents/skills projections.",outputFamilies:["portable","skills"]},copilot:{meaning:"Generate GitHub Copilot instructions, prompts, and skills.",outputFamilies:["instructions","prompts","skills"]},cursor:{meaning:"Generate Cursor rules.",outputFamilies:["rules"]},claude:{meaning:"Generate Claude Code grounding files.",outputFamilies:["rules","portable"]},codex:{meaning:"Use AGENTS.md and the report index as the Codex grounding layer.",outputFamilies:["portable"]},gemini:{meaning:"Generate Gemini CLI grounding through GEMINI.md and canonical AGENTS.md.",outputFamilies:["adapter","portable"]},qwen:{meaning:"Generate Qwen Code grounding through QWEN.md and canonical AGENTS.md.",outputFamilies:["adapter","portable"]},kimi:{meaning:"Use AGENTS.md and the report index as the Kimi Code grounding layer.",outputFamilies:["portable"]},grok:{meaning:"Use AGENTS.md and the report index as the xAI Grok grounding layer.",outputFamilies:["portable"]},windsurf:{meaning:"Use AGENTS.md and the report index as the Windsurf grounding layer.",outputFamilies:["portable"]},"amazon-q":{meaning:"Generate an Amazon Q project rule that routes agents to canonical evidence.",outputFamilies:["rules","portable"]},orca:{meaning:"Legacy compatibility alias for AGENTS.md consumers; prefer the grok target.",outputFamilies:["portable"]}},standardAnswerContract:[...pe],requiredReports:J.map(e=>({path:e.relativePath,label:e.label,required:e.required})),strictRules:["Required reports must exist.","Generated report paths must stay inside the workspace root.","Generated customization text must be English-only.","Agent answers must not claim pass, ready, or healthy without cited evidence.","Commands must distinguish display guidance from execution requests.","Agent hook files must be advisory and disabled by default unless the user explicitly enables them.","MCP design artifacts must stay read-mostly until write tools have explicit approval boundaries."],outputKinds:["report","grounding","instruction","prompt","skill","skill-resource","operational-skill","skills-index","explain-report","agent","rule","hook","mcp-design"],pathLayers:{l1CanonicalRoots:[".workspai/reports/",`${a$3}/`],l2PrefixedMirrorRoots:[".agents/",".github/",".cursor/",".claude/",".amazonq/"],l3SharedIndustryFiles:["AGENTS.md",".github/copilot-instructions.md","CLAUDE.md","GEMINI.md","QWEN.md"]}}}var kr=q.agentIndex,hr=q.agentCustomizationPack,X=p.agentIndex,Y=p.agentCustomizationPack;var J=[{relativePath:t.goalIndex,label:"Active Goal Pack index",required:false},{relativePath:t.goalPackLastRun,label:"Latest governed Goal Pack",required:false},{relativePath:b$1,label:"Agent context pack",required:true},{relativePath:b$2,label:"Operational skills index",required:true},{relativePath:p.model,label:"Workspace model",required:false},{relativePath:p.knowledgeGraph,label:"Workspace knowledge graph",required:false},{relativePath:p.evaluationLastRun,label:"Workspace Intelligence evaluation",required:false},{relativePath:p.doctor,label:"Workspace doctor",required:false},{relativePath:t.doctorProject,label:"Project doctor",required:false},{relativePath:t.doctorRemediationPlan,label:"Doctor remediation plan",required:false},{relativePath:t.artifactRemediationPlan,label:"Artifact remediation plan",required:false},{relativePath:t.doctorFixResult,label:"Doctor fix result",required:false},{relativePath:p.analyze,label:"Workspace analyze",required:false},{relativePath:t.pipelineLastRun,label:"Governance pipeline",required:false},{relativePath:p.readiness,label:"Release readiness",required:false},{relativePath:p.impact,label:"Workspace impact",required:false},{relativePath:p.verify,label:"Workspace verify",required:false},{relativePath:p.snapshot,label:"Workspace model snapshot",required:false},{relativePath:p.diff,label:"Workspace model diff",required:false},{relativePath:p.explain,label:"Workspace explain",required:false},{relativePath:p.contractVerify,label:"Workspace contract verify",required:false},{relativePath:p.history,label:"Workspace intelligence history",required:false}];function wr(){let e=J.map(r=>r.relativePath),t=b$3().consumers.agents.canonicalReadOrder;return [...new Set(t.filter(r=>r!==X&&e.includes(r)))]}async function Ar(e){try{let{contract:t}=await p$1({workspacePath:e});if(t?.workspace?.name)return `workspace:${t.workspace.name}`}catch{}for(let t of [".workspai/workspace.json",".rapidkit/workspace.json"])try{let r=await h$1.readJson(s.join(e,t)),n=typeof r.workspace_name=="string"?r.workspace_name:typeof r.name=="string"?r.name:null;if(n?.trim())return `workspace:${n.trim()}`}catch{}return `workspace:${s.basename(s.resolve(e))}`}function P(e){return `npx workspai ${e}`.trim()}function rt(e){return e&&typeof e=="object"?e:null}function Ye(e,t=12){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0).slice(0,t):[]}function yr(e){let t=Ye(e.blockers,12);if(t.length>0)return t;let r=Ye(e.blockingReasons,12);if(r.length>0)return r;let n=rt(e.summary);return n&&Array.isArray(n.blockingReasons)?Ye(n.blockingReasons,12):[]}function Rr(e){let t=[...new Set(e.map(r=>r.trim()).filter(Boolean))];return t.filter(r=>{let n=r.toLowerCase();return !t.some(i=>{if(i===r||!i.includes(":"))return false;let c=i.toLowerCase();return c.length>n.length&&c.endsWith(n)})})}function br(e){for(let t of ["generatedAt","updatedAt","timestamp"]){let r=e[t];if(typeof r=="string"&&r.trim())return r.trim()}if(Array.isArray(e.entries)){let t=e.entries.map(r=>rt(r)?.generatedAt).filter(r=>typeof r=="string"&&r.trim().length>0).map(r=>r.trim()).filter(r=>Number.isFinite(Date.parse(r)));if(t.length>0)return t.reduce((r,n)=>Date.parse(n)>Date.parse(r)?n:r)}}function Pr(e,t,r){if(!e)return true;let n=Date.parse(e);return Number.isFinite(n)?r.getTime()-n>t*60*60*1e3:true}function vr(e,t,r){return e.path===p.snapshot?false:Pr(e.generatedAt,t,r)}function Sr(e){let t=e&&e.length>0?e:["all"];return t.includes("all")?new Set(["all","vscode","agents","copilot","cursor","claude","codex","gemini","qwen","kimi","grok","windsurf","amazon-q","orca"]):new Set(t)}function b(e,t){return e.has("all")||e.has(t)}function Ft(e){return b(e,"copilot")||b(e,"vscode")}function Xe(e){return b(e,"agents")||b(e,"codex")||b(e,"kimi")||b(e,"grok")||b(e,"orca")}function Er(e,t){return t==="generic"?b(e,"agents"):t==="copilot"?Ft(e):t==="grok"?b(e,"grok")||b(e,"orca"):b(e,t)}function Ir(e){return e??"enterprise"}function Cr(e){return e===b$2?"skills-index":e.includes("workspace-explain-last-run.json")?"explain-report":(e.startsWith(`${a$3}/`)||e.startsWith(".rapidkit/skills/"))&&e.endsWith(".md")?"operational-skill":e.includes("hooks")||e===U||e===V?"hook":e.includes("mcp")||e===S||e===T?"mcp-design":e.endsWith(".json")?"report":e.includes("/instructions/")||e.endsWith("copilot-instructions.md")?"instruction":e.includes("/prompts/")?"prompt":e.includes("/skills/")&&e.endsWith("/SKILL.md")?"skill":e.includes("/skills/")?"skill-resource":e.includes("/agents/")?"agent":e.includes("/rules/")||e.endsWith(".mdc")?"rule":"grounding"}function xr(e){return e.startsWith(".github/")?["vscode","copilot"]:e.startsWith(".cursor/")?["cursor"]:e.startsWith(".claude/")||e==="CLAUDE.md"?["claude"]:e==="GEMINI.md"?["gemini"]:e==="QWEN.md"?["qwen"]:e.startsWith(".amazonq/")?["amazon-q"]:e===".windsurfrules"||e.startsWith(".windsurf/")?["windsurf"]:e.startsWith(".grok/")?["grok"]:e.startsWith(".agents/")?["agents","codex","kimi","grok","orca"]:e==="AGENTS.md"||e.startsWith(".rapidkit/")?["agents","codex","kimi","grok","copilot","cursor","claude","gemini","qwen","amazon-q","windsurf","orca","vscode"]:e.startsWith(".vscode/")?["vscode"]:["agents"]}function Dt(e){return [{target:"agents",path:`.agents/skills/${e}/SKILL.md`},{target:"copilot",path:`.github/skills/${e}/SKILL.md`},{target:"claude",path:`.claude/skills/${e}/SKILL.md`},{target:"cursor",path:`.cursor/skills/${e}/SKILL.md`},{target:"grok",path:`.grok/skills/${e}/SKILL.md`}]}async function Or(e,t){let r=s.join(e,t);!await h$1.pathExists(r)||!(await h$1.readFile(r,"utf8")).includes(B)||await h$1.remove(r);}function Tr(e,t){return $t().presets[t].requiredOutputs.includes(e)}async function _r(e,t){if(t)return t;let r$1=await g(e,m$2)??s.join(e,m$2);if(await h$1.pathExists(r$1))try{let n=await h$1.readJson(r$1);return b$6(m$2,n,r$1),n}catch{}return r({workspacePath:e,includeEvidence:true})}async function Wr(e,t){let r=await g(e,p.knowledgeGraph);if(!r)return null;try{let n=await h$1.readJson(r);b$6(p.knowledgeGraph,n,r);let i=n;return i.proofs.some(c=>c.freshness==="stale")?null:(b$7(i,t),i)}catch{return null}}function jr(e){return e.length>0&&!s.isAbsolute(e)&&!e.split(/[\\/]+/).includes("..")}function Nr(e){return Object.fromEntries(["all","vscode","agents","copilot","cursor","claude","codex","gemini","qwen","kimi","grok","windsurf","amazon-q","orca"].map(r=>[r,{enabled:e.targets.includes("all")||e.targets.includes(r),outputs:e.outputs.filter(n=>n.targets.includes(r)).map(n=>n.path).sort()}]))}async function Lr(e,t){try{if(!await h$1.pathExists(e))return {payload:null,exists:false,validity:"missing"};let r=await h$1.readJson(e),n=rt(r);return n?a$2(t)?(b$6(t,n,e),{payload:n,exists:true,validity:"valid"}):{payload:n,exists:true,validity:"uncontracted"}:{payload:null,exists:true,validity:"invalid",validationError:"Artifact root must be a JSON object"}}catch(r){return {payload:null,exists:true,validity:"invalid",validationError:r instanceof Error?r.message:String(r)}}}async function Kt(e){let t=e.now??new Date,r=e.staleAfterHours??24,n=[],i=[];for(let a of J){let k=await g(e.workspacePath,a.relativePath)??s.join(e.workspacePath,a.relativePath),l=await Lr(k,a.relativePath),p=l.payload;l.validity==="invalid"?i.push(`Invalid evidence contract: ${a.relativePath}`):p&&i.push(...yr(p)),n.push({path:a.relativePath,label:a.label,required:a.required,exists:l.exists,validity:l.validity,validationError:l.validationError,generatedAt:p?br(p):void 0,commandId:typeof p?.commandId=="string"?p.commandId:void 0,exitCode:typeof p?.exitCode=="number"?p.exitCode:void 0});}let c=Rr(i).slice(0,16),m=b$3();return {schemaVersion:kr,generatedAt:t.toISOString(),workspaceRoot:await Ar(e.workspacePath),intelligenceChain:{schemaVersion:m.schemaVersion,contractPath:m.contractPath,currentStep:"agent-sync"},readOrder:wr(),blockers:c,staleAfterHours:r,reports:n,refreshCommand:P("workspace agent-sync --write --refresh-context")}}function Gr(e){let t$1=["# Workspai agent grounding","","Cross-tool instructions for Copilot, Cursor, Claude Code, Codex, Grok, and other agents.","","## Read order (mandatory before workspace diagnosis)","",`1. \`${p.agentIndex}\` \u2014 latest blockers, timestamps, and report paths`,`2. \`${t.goalIndex}\` \u2014 when present, read the active Goal Pack and its handoff before choosing work.`,`3. \`${p.agentContext}\` \u2014 read only task-relevant context`,`4. \`${p.skillsIndex}\` \u2014 select only the Skill that matches the task.`,"5. Read only the task-relevant evidence artifacts listed in the index.","6. Use the Goal Pack retrieval queries, `workspace graph search <query> --limit 12 --json`, or MCP `searchWorkspaceGraph` before loading the full graph.","","Do **not** full-repo scan or inject the complete graph when a bounded query can answer the task.","","## Proof-carrying mutations","","For source-changing work, use the active Goal Pack command `beginChange` before the first mutation.","Prediction is planning input, never proof. Execute only explicitly authorized effect classes, record typed effect receipts, then run `workspai change verify --change <id> --json`.","A task is not complete until its capsule is sealed or its remaining uncertainty is reported.","","## Regenerate intelligence","","```bash",P("workspace agent-sync --write --refresh-context"),P("workspace context --for-agent --json --write"),P("pipeline --json --write"),"```",""];if(e.index.blockers.length>0){t$1.push("## Current blockers","");for(let r of e.index.blockers.slice(0,12))t$1.push(`- ${r}`);t$1.push("");}if(e.context?.safeCommands?.length){t$1.push("## Safe commands (prefer these)","");for(let r of e.context.safeCommands.slice(0,10))t$1.push(`- \`${r.display}\` \u2014 ${r.description}`);t$1.push("");}return t$1.push("## Rules","","- Treat `.workspai/reports/*` as the source of truth for health, gates, and release posture.","- Prefer deterministic Workspai CLI commands over heuristic framework guesses.","- If evidence is missing or stale, run the refresh commands above before proposing fixes.","- Keep project-scoped advice aligned with the active project named in the context pack.","- Never claim that an active goal is satisfied until its CLI-owned verification lifecycle is `verified`.",""),t$1.join(`
|
|
9
9
|
`)}function $r(e){return ["# Workspai agent grounding","",`Generated: ${e.generatedAt}`,"",`This file is tool-agnostic. Synced agents should read it together with \`${p.agentIndex}\`.`,"","## Mandatory read order","",...e.readOrder.map((t,r)=>`${r+1}. \`${t}\``),"",e.blockers.length>0?"## Blockers":"",...e.blockers.length>0?e.blockers.map(t=>`- ${t}`):[],"","## Refresh","","```bash",e.refreshCommand,"```",""].filter(t=>t!=="").join(`
|
|
10
10
|
`)}function Dr(){return ["# Workspai workspace grounding","","Before answering workspace, release, or architecture questions:","","1. Read `AGENTS.md` (managed Workspai section).",`2. Read \`${p.agentIndex}\` and only task-relevant context from \`${p.agentContext}\`.`,"3. Use bounded `workspace graph search` or MCP `searchWorkspaceGraph` before scanning the full repository.","","Regenerate stale intelligence:","","```bash",P("workspace agent-sync --write --refresh-context"),"```",""].join(`
|
|
11
11
|
`)}function Kr(){return ["## Claude Code","",`- Load \`${p.agentIndex}\` before diagnosing blockers.`,"- Use `.claude/rules/workspai-evidence.md` for scoped Workspai evidence rules.","- Treat `.claude/rules/rapidkit-evidence.md` as a legacy compatibility mirror.","- Refresh grounding with `npx workspai workspace agent-sync --write`.",""].join(`
|
|
@@ -38,12 +38,12 @@ ${a}`;e.write&&await h$1.writeFile(c,`${k.trimEnd()}
|
|
|
38
38
|
|
|
39
39
|
${n}`:n;return await h$1.ensureDir(s.dirname(e.absolutePath)),await h$1.writeFile(e.absolutePath,i,"utf8"),"written"}async function et(e){if(!e.write)return "skipped";await fe(e.workspacePath,e.absolutePath);let t=await h$1.pathExists(e.absolutePath)?await h$1.readFile(e.absolutePath,"utf8"):"",{upsertManagedAgentSection:r}=await import('./managed-agent-markers-COE5DJ3W.js'),n=r(t,e.generatedBody),i=n.includes(e.importLine)?n:`${e.importLine}
|
|
40
40
|
|
|
41
|
-
${n}`;return await h$1.ensureDir(s.dirname(e.absolutePath)),await h$1.writeFile(e.absolutePath,i,"utf8"),"written"}async function fe(e,t){let r=s.resolve(e),n=await h$1.realpath(r).catch(()=>r),i=s.resolve(t),c=s.relative(r,i);if(!c||c===".."||c.startsWith(`..${s.sep}`)||s.isAbsolute(c))throw new Error("Agent output path must remain inside the canonical workspace.");let m=c.split(s.sep),a=r;for(let[k,l]of m.entries()){a=s.join(a,l);let p=await h$1.lstat(a).catch(R=>{if(R.code==="ENOENT")return null;throw R});if(!p)return s.join(a,...m.slice(k+1));let d=k===m.length-1;if(p.isSymbolicLink()){if(d)throw new Error(`Agent output path is blocked by authored repository state: ${c}`);let R=await h$1.realpath(a),w=s.relative(n,R),I=w!==".."&&!w.startsWith(`..${s.sep}`)&&!s.isAbsolute(w),K=await h$1.stat(R);if(!I||!K.isDirectory())throw new Error(`Agent output path is blocked by authored repository state: ${c}`);a=R;continue}if(d?!p.isFile():!p.isDirectory())throw new Error(`Agent output path is blocked by authored repository state: ${c}`)}return a}function aa(e){if(!e?.trim())return;let t=new Set(["all","vscode","agents","copilot","cursor","claude","codex","gemini","qwen","kimi","grok","windsurf","amazon-q","orca"]),r=e.split(",").map(n=>n.trim().toLowerCase()).filter(n=>t.has(n));return r.length>0?r:void 0}function cn(e){let t=[...e.outputs].sort((n,i)=>n.path.localeCompare(i.path)),r=b$3();return {schemaVersion:hr,generatedAt:e.generatedAt,workspaceRoot:e.workspaceRef,preset:e.preset,targets:[...e.targets].sort(),sourceReports:e.index.reports.filter(n=>n.exists).map(n=>n.path).sort(),intelligenceChain:{schemaVersion:r.schemaVersion,contractPath:r.contractPath,currentStep:"agent-sync"},outputInventory:t,capabilityMatrix:Nr({targets:e.targets,outputs:t}),drift:{missingRequired:e.missingRequired,staleReports:e.staleReports,strictViolations:e.strictViolations},answerContract:["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"],refreshCommand:P(`workspace agent-sync --write --refresh-context --preset ${e.preset}`),experimental:{hooksEnabled:e.experimentalHooks,mcpReady:t.some(n=>n.kind==="mcp-design")}}}async function tt(e){let t=s.resolve(e.workspacePath),r$
|
|
41
|
+
${n}`;return await h$1.ensureDir(s.dirname(e.absolutePath)),await h$1.writeFile(e.absolutePath,i,"utf8"),"written"}async function fe(e,t){let r=s.resolve(e),n=await h$1.realpath(r).catch(()=>r),i=s.resolve(t),c=s.relative(r,i);if(!c||c===".."||c.startsWith(`..${s.sep}`)||s.isAbsolute(c))throw new Error("Agent output path must remain inside the canonical workspace.");let m=c.split(s.sep),a=r;for(let[k,l]of m.entries()){a=s.join(a,l);let p=await h$1.lstat(a).catch(R=>{if(R.code==="ENOENT")return null;throw R});if(!p)return s.join(a,...m.slice(k+1));let d=k===m.length-1;if(p.isSymbolicLink()){if(d)throw new Error(`Agent output path is blocked by authored repository state: ${c}`);let R=await h$1.realpath(a),w=s.relative(n,R),I=w!==".."&&!w.startsWith(`..${s.sep}`)&&!s.isAbsolute(w),K=await h$1.stat(R);if(!I||!K.isDirectory())throw new Error(`Agent output path is blocked by authored repository state: ${c}`);a=R;continue}if(d?!p.isFile():!p.isDirectory())throw new Error(`Agent output path is blocked by authored repository state: ${c}`)}return a}function aa(e){if(!e?.trim())return;let t=new Set(["all","vscode","agents","copilot","cursor","claude","codex","gemini","qwen","kimi","grok","windsurf","amazon-q","orca"]),r=e.split(",").map(n=>n.trim().toLowerCase()).filter(n=>t.has(n));return r.length>0?r:void 0}function cn(e){let t=[...e.outputs].sort((n,i)=>n.path.localeCompare(i.path)),r=b$3();return {schemaVersion:hr,generatedAt:e.generatedAt,workspaceRoot:e.workspaceRef,preset:e.preset,targets:[...e.targets].sort(),sourceReports:e.index.reports.filter(n=>n.exists).map(n=>n.path).sort(),intelligenceChain:{schemaVersion:r.schemaVersion,contractPath:r.contractPath,currentStep:"agent-sync"},outputInventory:t,capabilityMatrix:Nr({targets:e.targets,outputs:t}),drift:{missingRequired:e.missingRequired,staleReports:e.staleReports,strictViolations:e.strictViolations},answerContract:["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"],refreshCommand:P(`workspace agent-sync --write --refresh-context --preset ${e.preset}`),experimental:{hooksEnabled:e.experimentalHooks,mcpReady:t.some(n=>n.kind==="mcp-design")}}}async function tt(e){let t=s.resolve(e.workspacePath),r$2=e.now??new Date,n$1=e.staleAfterHours??24,i$1=Sr(e.targets),c$1=[...i$1].sort(),m=Ir(e.preset),a=e.write===true,k$1=e.strict===true,l$2,p=null,d$1=e.model;e.refreshContext&&(d$1??=await r({workspacePath:t,includeEvidence:true}),p=await c({workspacePath:t,model:d$1,agent:e.agent??"generic",scope:e.scope,includeEvidence:true}),a&&(l$2=await d(p,t)));let R$1=[],w$1=[],I$1=[],K$1=[],g=(u,A)=>{u==="written"?w$1.push(A):I$1.push(A),K$1.push({path:A,kind:Cr(A),targets:xr(A),required:Tr(A,m),status:u==="written"?"written":e.dryRun?"planned":"skipped"});},ke="",T$1=await _r(t,d$1),he=null;try{he=(await p$1({workspacePath:t})).contract;}catch{he=null;}let Vt=await Wr(t,T$1),at=jt({model:T$1,context:p,contract:he,graph:Vt}),zt=at.skills,Q$1=await Nt({workspacePath:t,skills:zt,generatedAt:r$2.toISOString(),write:a,decisions:at.decisions});for(let u of Q$1.skills){g(a?"written":"skipped",u.canonicalPath);for(let A of Dt(u.skillId))(A.target==="agents"?!Xe(i$1):!b(i$1,A.target))||g(await Ut({workspacePath:t,relativePath:A.path,content:u.markdown,write:a}),A.path);}for(let u of Q$1.removedSkillIds)for(let A of Dt(u))!(A.target==="agents"?Xe(i$1):b(i$1,A.target))||!a||await Or(t,A.path);g(a?"written":"skipped",b$2),ke=Lt(Q$1.index);let v$1=await Kt({workspacePath:t,staleAfterHours:n$1,now:r$2});if(g(await f(s.join(t,X),`${JSON.stringify(v$1,null,2)}
|
|
42
42
|
`,a),X),g(await f(s.join(t,f$2),`${$r(v$1)}
|
|
43
43
|
`,a),f$2),["agents","vscode","copilot","cursor","claude","codex","gemini","qwen","kimi","grok","windsurf","amazon-q","orca"].some(u=>b(i$1,u))&&g(await Ze({workspacePath:t,absolutePath:s.join(t,"AGENTS.md"),generatedBody:Gr({index:v$1,context:p}),write:a}),"AGENTS.md"),b(i$1,"claude")){let u$1=s.join(t,"CLAUDE.md");if(a){await fe(t,u$1);let{upsertManagedAgentSection:A}=await import('./managed-agent-markers-COE5DJ3W.js'),y=await h$1.pathExists(u$1)?await h$1.readFile(u$1,"utf8"):"",E=A(y,Kr()),_=E.includes("@AGENTS.md")?E:`@AGENTS.md
|
|
44
44
|
|
|
45
45
|
${E}`;await h$1.ensureDir(s.dirname(u$1)),await h$1.writeFile(u$1,_,"utf8"),w$1.push("CLAUDE.md");}else I$1.push("CLAUDE.md");g(await f(s.join(t,s$1),`${tn()}
|
|
46
46
|
`,a),s$1),g(await f(s.join(t,t$1),`${Qr()}
|
|
47
47
|
`,a),t$1),g(await f(s.join(t,u),`${rn()}
|
|
48
|
-
`,a),u),g(await f(s.join(t,P$1),$({index:v$1,context:p,model:T$1}),a),P$1);}if(b(i$1,"gemini")&&g(await et({workspacePath:t,absolutePath:s.join(t,"GEMINI.md"),importLine:"@./AGENTS.md",generatedBody:Qe("Gemini CLI"),write:a}),"GEMINI.md"),b(i$1,"qwen")&&g(await et({workspacePath:t,absolutePath:s.join(t,"QWEN.md"),importLine:"@AGENTS.md",generatedBody:Qe("Qwen Code"),write:a}),"QWEN.md"),b(i$1,"amazon-q")&&(g(await et({workspacePath:t,absolutePath:s.join(t,".amazonq/rules/workspai-agent-entry.md"),importLine:"@../../AGENTS.md",generatedBody:Qe("Amazon Q Developer"),write:a}),".amazonq/rules/workspai-agent-entry.md"),g(await f(s.join(t,v),Yr(),a),v)),b(i$1,"grok")&&(g(await f(s.join(t,q$
|
|
48
|
+
`,a),u),g(await f(s.join(t,P$1),$({index:v$1,context:p,model:T$1}),a),P$1);}if(b(i$1,"gemini")&&g(await et({workspacePath:t,absolutePath:s.join(t,"GEMINI.md"),importLine:"@./AGENTS.md",generatedBody:Qe("Gemini CLI"),write:a}),"GEMINI.md"),b(i$1,"qwen")&&g(await et({workspacePath:t,absolutePath:s.join(t,"QWEN.md"),importLine:"@AGENTS.md",generatedBody:Qe("Qwen Code"),write:a}),"QWEN.md"),b(i$1,"amazon-q")&&(g(await et({workspacePath:t,absolutePath:s.join(t,".amazonq/rules/workspai-agent-entry.md"),importLine:"@../../AGENTS.md",generatedBody:Qe("Amazon Q Developer"),write:a}),".amazonq/rules/workspai-agent-entry.md"),g(await f(s.join(t,v),Yr(),a),v)),b(i$1,"grok")&&(g(await f(s.join(t,q$1),Br(),a),q$1),g(await f(s.join(t,r$1),Jr(),a),r$1),g(await f(s.join(t,R),$({index:v$1,context:p,model:T$1}),a),R)),Xe(i$1)&&g(await Ut({workspacePath:t,relativePath:Q,content:$({index:v$1,context:p,model:T$1}),write:a}),Q),b(i$1,"windsurf")&&(g(await Ze({workspacePath:t,absolutePath:s.join(t,n),generatedBody:Xr(),write:a}),n),g(await f(s.join(t,o),Vr(),a),o),g(await f(s.join(t,p$2),zr(),a),p$2)),b(i$1,"cursor")&&(g(await f(s.join(t,h$2),qr(),a),h$2),g(await f(s.join(t,i),Mr(),a),i),g(await f(s.join(t,m$1),nn(),a),m$1),m==="enterprise"&&(g(await f(s.join(t,j),Hr(),a),j),g(await f(s.join(t,k),Ur(),a),k),g(await f(s.join(t,l),Fr(),a),l)),g(await f(s.join(t,O),$({index:v$1,context:p,model:T$1}),a),O)),Ft(i$1)){if(g(await Ze({workspacePath:t,absolutePath:s.join(t,".github/copilot-instructions.md"),generatedBody:Dr(),write:a}),".github/copilot-instructions.md"),g(await f(s.join(t,w),en(),a),w),g(await f(s.join(t,x),qt("workspace"),a),x),g(await f(s.join(t,y),Zr(),a),y),g(await f(s.join(t,z$1),qt("evidence"),a),z$1),g(await f(s.join(t,A),Mt(),a),A),g(await f(s.join(t,B$1),Mt(),a),B$1),m==="enterprise"){let u=[[C,ge({description:"Repair Workspai blockers with evidence and verification",objective:"Plan the smallest safe repair for the current Workspai blocker.",expectedOutput:["Blocker and affected workspace/project scope","Evidence paths and exact failing signals","Minimal fix plan","Human-run commands","Verification command and expected success signal"]})],[E,ge({description:"Assess Workspai release readiness from evidence",objective:"Assess whether this workspace is release-ready using Workspai gates.",expectedOutput:["Readiness verdict with cited reports","Blocking gates","Safe next command","Verification checklist"]})],[G,ge({description:"Onboard a project into Workspai Workspace Intelligence",objective:"Guide project onboarding using workspace model and create planner capabilities.",expectedOutput:["Target project scope","Native create, official generator, or existing lane","Safe commands","Post-onboarding verification"]})],[I,ge({description:"Adopt an existing project into Workspai governance",objective:"Adopt an existing project without changing its runtime behavior.",expectedOutput:["Detected stack and confidence","Adoption plan","Generated metadata expectations","Doctor and workspace model verification"]})]];for(let[y,E]of u)g(await f(s.join(t,y),E,a),y);let A=[[D$1,u[0][1]],[F,u[1][1]],[H,u[2][1]],[J$1,u[3][1]]];for(let[y,E]of A)g(await f(s.join(t,y),E,a),y);if(e.hydratePrompts===true)for(let y of await Gt({workspacePath:t,skills:Q$1.skills,write:a}))g(a?"written":"skipped",y);}if(g(await f(s.join(t,K),$({index:v$1,context:p,model:T$1}),a),K),g(await f(s.join(t,L),$({index:v$1,context:p,model:T$1}),a),L),m==="enterprise"){g(await f(s.join(t,M),Ht(ke),a),M),g(await f(s.join(t,N),Ht(ke),a),N);let u=[["artifact-map.md",D({title:"Artifact Map",lines:J.map(y=>`- \`${y.relativePath}\` \u2014 ${y.label}`)})],["command-map.md",D({title:"Command Map",lines:["- `npx workspai workspace agent-sync --write --refresh-context` \u2014 refresh agent grounding.","- `npx workspai workspace model --json --write` \u2014 refresh workspace model.","- `npx workspai doctor workspace` \u2014 refresh health evidence.","- `npx workspai workspace verify --strict --json` \u2014 verify release gates."]})],["scope-model.md",D({title:"Scope Model",lines:["- Workspace scope is the default source of truth.","- Project scope is selected only when the active task targets a specific project.","- Always name the workspace and project when giving repair or lifecycle advice."]})],["runtime-support.md",D({title:"Runtime Support",lines:["- Native create is available only for Workspai-owned scaffold contracts.","- Unsupported stacks should use the official lane when a stable ecosystem generator exists.","- Existing projects should use the existing lane when native create is unavailable."]})],["create-planner-capabilities.md",D({title:"Create Planner Capabilities",lines:["- Use `contracts/create-planner-capabilities.v1.json` to decide native, official, or existing.","- Do not map PHP, WordPress, Laravel, Rails, or Symfony requests to unrelated native kits.","- Explain unsupported native create requests and guide users to adopt/import."]})],["mcp-tools.md",an()]];for(let[y,E]of u){let _=`${s.dirname(M)}/resources/${y}`;g(await f(s.join(t,_),E,a),_);let it=`${s.dirname(N)}/resources/${y}`;g(await f(s.join(t,it),E,a),it);}let A=[["workspai-advisor.agent.md",me({name:"Workspai Advisor",description:"Read-only workspace and project guidance using Workspai evidence",mode:"read-only",tools:["search","read"]})],["workspai-repair.agent.md",me({name:"Workspai Repair",description:"Turn Workspai blockers into minimal fixes and verification steps",mode:"repair",tools:["search","read","edit"]})],["workspai-release.agent.md",me({name:"Workspai Release",description:"Assess readiness, governance gates, and release safety from evidence",mode:"release",tools:["search","read"]})],["workspai-project-onboarder.agent.md",me({name:"Workspai Project Onboarder",description:"Guide create, import, and adopt flows with Workspai contracts",mode:"onboard",tools:["search","read","edit"]})]];for(let[y,E]of A){let _=`.github/agents/${y}`;g(await f(s.join(t,_),E,a),_);}}}if(m==="enterprise"){let u=on({workspaceRef:v$1.workspaceRoot,generatedAt:v$1.generatedAt});b$6(S,JSON.parse(u)),g(await f(s.join(t,S),u,a),S),g(await f(s.join(t,T),u,a),T);}if(m==="enterprise"&&e.experimentalHooks===true){let u=sn({workspaceRef:v$1.workspaceRoot,generatedAt:v$1.generatedAt});b$6(U,JSON.parse(u)),g(await f(s.join(t,U),u,a),U),g(await f(s.join(t,V),u,a),V);}let Z=a?await Kt({workspacePath:t,staleAfterHours:n$1,now:r$2}):v$1,ee=Z.reports.filter(u=>u.required&&!u.exists).map(u=>u.path),te=Z.reports.filter(u=>u.exists&&vr(u,n$1,r$2)).map(u=>u.path);if(k$1){ee.length>0&&R$1.push(`Missing required reports: ${ee.join(", ")}`),te.length>0&&R$1.push(`Stale reports (>${n$1}h): ${te.join(", ")}`);let u=K$1.map(A=>A.path).filter(A=>!jr(A));u.length>0&&R$1.push(`Unsafe generated output paths: ${u.join(", ")}`);}let N$1=a?await l$1({workspacePath:t,mode:e.projectGrounding??"managed",now:r$2}):void 0;if(k$1&&N$1&&N$1.skipped.length>0&&R$1.push(`Project grounding incomplete: ${N$1.skipped.map(u=>`${u.name} (${u.reason})`).join(", ")}`),k$1&&N$1){let u=N$1.projects.flatMap(A=>(A.hostCoverage??[]).filter(y=>y.status==="blocked"&&Er(i$1,y.id)).map(y=>`${s.basename(A.projectPath)}:${y.id}`));u.length>0&&R$1.push(`Project agent entry coverage blocked: ${u.join(", ")}`);}let ot=cn({workspaceRef:Z.workspaceRoot,generatedAt:r$2.toISOString(),preset:m,targets:c$1,index:Z,outputs:[...K$1,{path:Y,kind:"report",targets:["agents","vscode","copilot","cursor","claude","codex","gemini","qwen","kimi","grok","windsurf","amazon-q","orca"],required:true,status:a?"written":e.dryRun?"planned":"skipped"}],missingRequired:ee,staleReports:te,strictViolations:R$1,experimentalHooks:e.experimentalHooks===true});if(a&&process.env.WORKSPAI_TEST_FAIL_AGENT_SYNC_BEFORE_PACK==="1")throw new Error("Injected agent-sync failure before generation commit.");return g(await f(s.join(t,Y),`${JSON.stringify(ot,null,2)}
|
|
49
49
|
`,a),Y),{workspacePath:t,indexPath:s.join(t,X),packPath:s.join(t,Y),pack:ot,contextPath:l$2,writtenFiles:w$1,skippedFiles:I$1,blockers:v$1.blockers,missingRequired:ee,staleReports:te,strictViolations:R$1,projectLenses:N$1}}async function oa(e){if(e.write!==true)return tt(e);let t=s.resolve(e.workspacePath),r=s.join(t,".workspai","transactions","agent-sync");await b$4(r);let n=await tt({...e,write:false,dryRun:true});if(!n.pack)throw new Error("Agent-sync dry run did not produce an output inventory.");let i=[...n.pack.outputInventory.map(m=>m.path),X,Y],c=await a({journalDirectory:r});try{for(let l of [...new Set(i)].sort()){let p=s.resolve(t,l),d=s.relative(t,p);if(d===".."||d.startsWith(`..${s.sep}`)||s.isAbsolute(d))throw new Error(`Agent-sync output escapes workspace root: ${l}`);await c.captureFile(p);}let m$1=await m(t),a=new Set;for(let l of m$1.resolved)for(let p of [f$1,g$1,h,b$5,...g$2,"AGENTS.md",".gitignore"]){let d=s.join(l.projectPath,p);if((p==="AGENTS.md"||g$2.some(w=>w===p))&&(await h$1.lstat(d).catch(I=>{if(I.code==="ENOENT")return null;throw I}))?.isSymbolicLink()){let I=await a$1(l.projectPath,d);if(!I)continue;d=I;}a.has(d)||(await c.captureFile(d),a.add(d));}let k=await tt(e);return await c.commit(),k}catch(m){try{await c.rollback();}catch(a){throw new AggregateError([m,a],"Agent-sync generation failed and rollback was incomplete.")}throw m}}export{Jt as a,Xt as b,fr as c,kr as d,hr as e,X as f,Y as g,J as h,wr as i,Kt as j,aa as k,oa as l};
|