workspai 0.64.0 → 0.66.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.
Files changed (207) hide show
  1. package/README.md +40 -44
  2. package/contracts/agent-customization-pack.v1.json +4 -2
  3. package/contracts/analyze-last-run.v1.json +9 -1
  4. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +117 -0
  5. package/contracts/extension-cli-compatibility.v1.json +2 -0
  6. package/contracts/published-contract-catalog.v1.json +10 -0
  7. package/contracts/runtime-command-surface.v1.json +59 -3
  8. package/contracts/workspace-activity-event.v1.json +132 -0
  9. package/contracts/workspace-contract.v1.json +51 -6
  10. package/contracts/workspace-intelligence/agent-bootstrap-receipt.v1.json +17 -0
  11. package/contracts/workspace-intelligence/mcp-design.v1.json +49 -2
  12. package/contracts/workspace-intelligence/project-agent-entry.v1.json +3 -0
  13. package/contracts/workspace-intelligence/project-context-agent.v1.json +78 -7
  14. package/contracts/workspace-intelligence/project-knowledge-graph-reference.v1.json +51 -0
  15. package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +108 -3
  16. package/contracts/workspace-intelligence/workspace-model.v1.json +28 -1
  17. package/contracts/workspace-intelligence/workspace-skills-index.v1.json +34 -0
  18. package/contracts/workspace-model-cache.v1.json +4 -0
  19. package/contracts/workspace-repair-capabilities.v1.json +66 -0
  20. package/dist/analyze-UJQWGNM2.js +1 -0
  21. package/dist/{artifact-remediation-plan-XIQNI35L.js → artifact-remediation-plan-M2XBS2IU.js} +1 -1
  22. package/dist/autopilot-release-U6F4M2BQ.js +1 -0
  23. package/dist/capabilities-command-XUKPO25Z.js +1 -0
  24. package/dist/chunk-2LIVMG5C.js +2 -0
  25. package/dist/{chunk-ZGS5NKEO.js → chunk-2PACEMNE.js} +1 -1
  26. package/dist/chunk-334J2KIP.js +7 -0
  27. package/dist/{chunk-6TBTMWNA.js → chunk-3H5ACWWZ.js} +1 -1
  28. package/dist/{chunk-HCFWT42C.js → chunk-3NM3JAZW.js} +1 -1
  29. package/dist/chunk-4XEH3WNV.js +13 -0
  30. package/dist/chunk-5OA33JH2.js +2 -0
  31. package/dist/chunk-5TY74LLW.js +2 -0
  32. package/dist/{chunk-QCKWQFCD.js → chunk-5U4L6VF2.js} +1 -1
  33. package/dist/{chunk-W6FHVXNL.js → chunk-5XGR3LRI.js} +1 -1
  34. package/dist/{chunk-KTN2ARZJ.js → chunk-6JX56VAL.js} +3 -3
  35. package/dist/chunk-6UNATTB7.js +1 -0
  36. package/dist/{chunk-J3X56S7L.js → chunk-727IQFGN.js} +1 -1
  37. package/dist/chunk-7FF5EOIO.js +2 -0
  38. package/dist/chunk-AP4PV6WJ.js +1 -0
  39. package/dist/chunk-AXUA7PFV.js +2 -0
  40. package/dist/chunk-B4IVVTMQ.js +2 -0
  41. package/dist/{chunk-LNXIMF3O.js → chunk-C4S22E6S.js} +1 -1
  42. package/dist/{chunk-PXWKMPPI.js → chunk-D4UHRJAP.js} +1 -1
  43. package/dist/chunk-DUBOKZMA.js +49 -0
  44. package/dist/{chunk-VYDURWN7.js → chunk-ECLMYTWT.js} +1 -1
  45. package/dist/{chunk-VB6I52ZT.js → chunk-EHH4SKVH.js} +50 -50
  46. package/dist/chunk-EP4CUWOO.js +9 -0
  47. package/dist/chunk-FY4X2VOE.js +39 -0
  48. package/dist/chunk-GAYK3WGV.js +2 -0
  49. package/dist/{chunk-YUGKQ44M.js → chunk-H5RJCS5E.js} +1 -1
  50. package/dist/{chunk-5SFCBZOH.js → chunk-H7MRINGP.js} +1 -1
  51. package/dist/chunk-HJLGXFMK.js +1 -0
  52. package/dist/{chunk-VRGEPPUB.js → chunk-HLWDIIWL.js} +1 -1
  53. package/dist/{chunk-KJXMLBSY.js → chunk-IIFFEEMX.js} +1 -1
  54. package/dist/chunk-IVF6NEHS.js +1 -0
  55. package/dist/chunk-JC4XSU7G.js +1 -0
  56. package/dist/chunk-JRP6WP5C.js +681 -0
  57. package/dist/chunk-JZJBA2V2.js +1 -0
  58. package/dist/{chunk-N4QQADXX.js → chunk-L5CCIIF2.js} +1 -1
  59. package/dist/chunk-L5Q2S5GY.js +3 -0
  60. package/dist/chunk-LPCZHKD5.js +1 -0
  61. package/dist/chunk-MZ7U4BIQ.js +157 -0
  62. package/dist/chunk-NMXGSVMD.js +1 -0
  63. package/dist/{chunk-GQSRNUCU.js → chunk-NVND4727.js} +3 -3
  64. package/dist/chunk-O37UBRMX.js +4 -0
  65. package/dist/chunk-OI2VOU6S.js +1 -0
  66. package/dist/chunk-PD7Y6HIM.js +2 -0
  67. package/dist/chunk-PJPS7CNH.js +1 -0
  68. package/dist/chunk-QGAPGZPL.js +97 -0
  69. package/dist/chunk-R2M5OJOK.js +5 -0
  70. package/dist/chunk-SX6A656X.js +1 -0
  71. package/dist/{chunk-X6TNBARH.js → chunk-TABXSDTR.js} +2 -2
  72. package/dist/chunk-TTHO4MFC.js +2 -0
  73. package/dist/chunk-U5ENEDJA.js +7 -0
  74. package/dist/chunk-UOCERSAN.js +1 -0
  75. package/dist/chunk-UPIPSSXY.js +1 -0
  76. package/dist/chunk-UTV4DTNM.js +1 -0
  77. package/dist/chunk-VA5VSOBL.js +2 -0
  78. package/dist/chunk-VQOWB26M.js +12 -0
  79. package/dist/chunk-VQZ5PI5J.js +1 -0
  80. package/dist/chunk-WCJU3CFG.js +1 -0
  81. package/dist/chunk-WTWRSEOW.js +1 -0
  82. package/dist/{chunk-D65FCQIO.js → chunk-XESFJN52.js} +1 -1
  83. package/dist/chunk-XQFWUM2P.js +1 -0
  84. package/dist/chunk-XWKGZRHN.js +1 -0
  85. package/dist/{chunk-WRQWVSBJ.js → chunk-YX5VWPR5.js} +1 -1
  86. package/dist/chunk-ZEEV5J4I.js +1 -0
  87. package/dist/chunk-ZQH2I5RQ.js +1 -0
  88. package/dist/{create-PWJDTKDN.js → create-SOLLXXAB.js} +1 -1
  89. package/dist/{demo-kit-QHIDCSBI.js → demo-kit-5UQH2OXC.js} +1 -1
  90. package/dist/{doctor-CGXY4IDE.js → doctor-NQ5PUCUP.js} +1 -1
  91. package/dist/{dotnet-webapi-clean-AVHPJG7Y.js → dotnet-webapi-clean-YEHYIGOT.js} +1 -1
  92. package/dist/{goal-lifecycle-BRFFTIU2.js → goal-lifecycle-IPNY7KNR.js} +1 -1
  93. package/dist/goal-pack-2WV3EA4Y.js +1 -0
  94. package/dist/{gofiber-standard-47S2GYAO.js → gofiber-standard-C44IIQYH.js} +1 -1
  95. package/dist/{gogin-standard-EWB4XNOI.js → gogin-standard-X7VKACVR.js} +1 -1
  96. package/dist/index.d.ts +8 -2
  97. package/dist/index.js +170 -170
  98. package/dist/live-command-Q6E45N7S.js +18 -0
  99. package/dist/{pipeline-DF4UIHAD.js → pipeline-MIMENSI7.js} +1 -1
  100. package/dist/{project-agent-entry-IWUCV72J.js → project-agent-entry-OWLJ3IHQ.js} +1 -1
  101. package/dist/project-intelligence-lens-I67EO6AE.js +1 -0
  102. package/dist/{project-test-coverage-4S7MEQ6T.js → project-test-coverage-OPDVSFPH.js} +1 -1
  103. package/dist/{pythonRapidkitExec-VAW5XE4Z.js → pythonRapidkitExec-44ORGQ4R.js} +1 -1
  104. package/dist/{rust-axum-M5X4ZC4Z.js → rust-axum-JKZTZDRZ.js} +1 -1
  105. package/dist/{springboot-standard-Y5ADLZMQ.js → springboot-standard-PI4FLTAN.js} +1 -1
  106. package/dist/verified-goal-46JWNCDY.js +1 -0
  107. package/dist/{workspace-35Q2IXAR.js → workspace-KO37XHF6.js} +1 -1
  108. package/dist/{workspace-agent-sync-FFNSW2PD.js → workspace-agent-sync-32FIJQBH.js} +1 -1
  109. package/dist/{workspace-archive-ZBCKJHXS.js → workspace-archive-6R5DRNZW.js} +1 -1
  110. package/dist/{workspace-context-IJ36ZP6G.js → workspace-context-JKRPX775.js} +1 -1
  111. package/dist/workspace-contract-4T3NYNK5.js +1 -0
  112. package/dist/workspace-explain-MOGL4GEA.js +1 -0
  113. package/dist/workspace-explain-contract-W2E6LF4Q.js +1 -0
  114. package/dist/{workspace-feedback-RQ4TGJW6.js → workspace-feedback-6VQ7T4CR.js} +1 -1
  115. package/dist/{workspace-foundation-GMGDUMPR.js → workspace-foundation-GHWO3BZU.js} +1 -1
  116. package/dist/workspace-graph-stream-PTVS47NJ.js +1 -0
  117. package/dist/workspace-graph-token-efficiency-Z5JD5NHI.js +1 -0
  118. package/dist/{workspace-history-SYCDK7FO.js → workspace-history-M2K4M2JY.js} +1 -1
  119. package/dist/{workspace-intelligence-5NO4K5SC.js → workspace-intelligence-PJIPTXL3.js} +1 -1
  120. package/dist/{workspace-intelligence-evaluation-CQDKOYZZ.js → workspace-intelligence-evaluation-GONCRE6O.js} +1 -1
  121. package/dist/{workspace-intelligence-runner-FGEBFVVM.js → workspace-intelligence-runner-M47QR3JM.js} +1 -1
  122. package/dist/{workspace-intelligence-runtime-registry-IW6J53LO.js → workspace-intelligence-runtime-registry-FFGQF4A7.js} +1 -1
  123. package/dist/workspace-knowledge-graph-V2EAYDCL.js +1 -0
  124. package/dist/workspace-knowledge-graph-contract-VANN7RCA.js +1 -0
  125. package/dist/{workspace-knowledge-graph-query-ON45H6Y7.js → workspace-knowledge-graph-query-RASPF7FS.js} +1 -1
  126. package/dist/workspace-knowledge-graph-snapshot-5YIG6EMG.js +1 -0
  127. package/dist/{workspace-marker-7NHMDIRL.js → workspace-marker-XGAWZZDX.js} +1 -1
  128. package/dist/workspace-mcp-serve-YRORNE4P.js +3 -0
  129. package/dist/workspace-model-VSVKLX7M.js +1 -0
  130. package/dist/{workspace-onboarding-VS3YYNGK.js → workspace-onboarding-2VMJZVLZ.js} +1 -1
  131. package/dist/{workspace-python-engine-state-J4QKW55K.js → workspace-python-engine-state-BE4A3BL5.js} +1 -1
  132. package/dist/{workspace-readme-G7TZ3V5T.js → workspace-readme-6X3GLTBM.js} +2 -2
  133. package/dist/{workspace-registry-summary-MIDFG6EC.js → workspace-registry-summary-QVSJKKTX.js} +1 -1
  134. package/dist/workspace-repair-engine-WSKV3Q4V.js +3 -0
  135. package/dist/workspace-run-3BXKTLVL.js +1 -0
  136. package/dist/{workspace-verify-4R7QHUPO.js → workspace-verify-EJCSOBIK.js} +1 -1
  137. package/dist/workspace-watch-JTIFBF4Z.js +1 -0
  138. package/docs/SETUP.md +10 -0
  139. package/docs/agent-entry.md +22 -7
  140. package/docs/ci-workflows.md +1 -1
  141. package/docs/commands-reference.md +43 -7
  142. package/docs/contracts/ARTIFACT_CATALOG.md +63 -44
  143. package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +1 -0
  144. package/docs/contracts/NAMING_AND_COEXISTENCE.md +20 -18
  145. package/docs/contracts/README.md +4 -3
  146. package/docs/real-world-qualification.md +19 -3
  147. package/docs/workspace-knowledge-graph.md +131 -27
  148. package/docs/workspace-live-activity.md +199 -0
  149. package/docs/workspace-operations.md +54 -9
  150. package/docs/workspace-repair-engine.md +17 -0
  151. package/package.json +1 -1
  152. package/dist/analyze-NUGNB256.js +0 -1
  153. package/dist/autopilot-release-TWJWSVVF.js +0 -1
  154. package/dist/capabilities-command-LHM3XIS6.js +0 -1
  155. package/dist/chunk-2647BYBC.js +0 -1
  156. package/dist/chunk-27UR373Z.js +0 -1
  157. package/dist/chunk-2VJUAKMS.js +0 -2
  158. package/dist/chunk-3A23KJAQ.js +0 -1
  159. package/dist/chunk-4PUJVYRM.js +0 -1
  160. package/dist/chunk-5B2GAZAC.js +0 -5
  161. package/dist/chunk-6DAQ7PYT.js +0 -13
  162. package/dist/chunk-CCAXADKP.js +0 -49
  163. package/dist/chunk-CCDGHPEJ.js +0 -2
  164. package/dist/chunk-CJHWKXDN.js +0 -1
  165. package/dist/chunk-CT4IODPG.js +0 -2
  166. package/dist/chunk-DK6JNE6K.js +0 -2
  167. package/dist/chunk-DOXNVBX6.js +0 -1
  168. package/dist/chunk-DWB2RRF4.js +0 -1
  169. package/dist/chunk-FQSBOLM7.js +0 -1
  170. package/dist/chunk-ILIBOMYL.js +0 -1
  171. package/dist/chunk-ISOOENLW.js +0 -8
  172. package/dist/chunk-J7RU5WR5.js +0 -2
  173. package/dist/chunk-JQLJBK5N.js +0 -1
  174. package/dist/chunk-KANAJH65.js +0 -681
  175. package/dist/chunk-KV6PS54A.js +0 -8
  176. package/dist/chunk-L22EABIC.js +0 -7
  177. package/dist/chunk-MOSXTVPU.js +0 -1
  178. package/dist/chunk-NHTDPXTW.js +0 -4
  179. package/dist/chunk-NZ3WZYD5.js +0 -1
  180. package/dist/chunk-Q2WF7D5U.js +0 -2
  181. package/dist/chunk-RSG2GJXT.js +0 -2
  182. package/dist/chunk-SFO5GVRT.js +0 -1
  183. package/dist/chunk-T5YRFRJV.js +0 -1
  184. package/dist/chunk-THIOE2PB.js +0 -2
  185. package/dist/chunk-TOYN76K4.js +0 -144
  186. package/dist/chunk-U5WVR74V.js +0 -1
  187. package/dist/chunk-UXEO5QCF.js +0 -33
  188. package/dist/chunk-VR6XMUF3.js +0 -2
  189. package/dist/chunk-WY4DOMEA.js +0 -1
  190. package/dist/chunk-XKDR5BGS.js +0 -6
  191. package/dist/chunk-Y5YAP4F3.js +0 -2
  192. package/dist/chunk-ZH7CXQH3.js +0 -94
  193. package/dist/goal-pack-FG3QDNQH.js +0 -1
  194. package/dist/project-intelligence-lens-PZPPSCUW.js +0 -1
  195. package/dist/verified-goal-BBHZRYYH.js +0 -1
  196. package/dist/workspace-contract-JS4LZZQZ.js +0 -1
  197. package/dist/workspace-explain-TITIT5XN.js +0 -1
  198. package/dist/workspace-explain-contract-V2IVSROX.js +0 -1
  199. package/dist/workspace-graph-stream-7UU2YVHC.js +0 -1
  200. package/dist/workspace-graph-token-efficiency-D7CUT6NX.js +0 -1
  201. package/dist/workspace-knowledge-graph-RSDP2E36.js +0 -1
  202. package/dist/workspace-knowledge-graph-snapshot-3FJHH5IK.js +0 -1
  203. package/dist/workspace-mcp-serve-WUIQ2AE6.js +0 -3
  204. package/dist/workspace-model-OKY4CQ3X.js +0 -1
  205. package/dist/workspace-repair-engine-VUBT77Y7.js +0 -3
  206. package/dist/workspace-run-SSF6Z26G.js +0 -1
  207. package/dist/workspace-watch-IOPSHQS5.js +0 -1
@@ -1,33 +0,0 @@
1
- import {c,d}from'./chunk-MOSXTVPU.js';import {m,k as k$1,j as j$1,b,t,n,i}from'./chunk-RGNCL5OB.js';import {a}from'./chunk-2FIX2MDC.js';import wt from'crypto';import tt from'os';import l from'path';import*as p from'fs-extra';import {execa}from'execa';var yt=["version","project","create","add","list","info","upgrade","diff","doctor","license","commands","reconcile","rollback","uninstall","checkpoint","optimize","snapshot","frameworks","modules","merge"],M=new Set(yt);var g=a();async function et(t){for(let e of [c,d]){let r=l.join(t,e);if(await p.pathExists(r))try{let n=await p.readJson(r);if(n&&typeof n=="object")return n}catch{return null}}return null}function O(){let t=[],e=i=>{let o=i?.trim();o&&t.push(o);};e(process.env.RAPIDKIT_BRIDGE_PYTHON),e(process.env.RAPIDKIT_PYTHON_CMD),e(process.env.POETRY_PYTHON);let r=_();(r.startsWith("/")||r.startsWith(".")||r.startsWith(".."))&&!r.startsWith("file:")&&e(m(l.join(l.resolve(r),".venv")));for(let i of k$1())i.args.length===1&&i.args[0]==="--version"&&e(i.command);for(let i of j$1())e(i);return [...new Set(t)]}function v(t,e){return t==="py"?["-3",...e]:e}function H(t){if(!t)return t;let e=["Installed Poetry version does not support '--no-update'. Falling back to 'poetry lock'."];return t.split(/\r?\n/).filter(i=>!e.some(o=>i.includes(o))).join(`
2
- `)}var y=class extends Error{code;constructor(e,r){super(r),this.code=e;}};function D(t){if(t instanceof y)switch(t.code){case "PYTHON_NOT_FOUND":return `Workspai could not find Python (python3/python/py) on your PATH.
3
- Install Python 3.10+ and ensure \`${i()}\` is available, then retry.
4
- Tip: if you are inside a RapidKit project, use the local ./rapidkit launcher.`;case "BRIDGE_VENV_CREATE_FAILED":return `Workspai failed to create its bridge virtual environment.
5
- `+(b()?`Ensure Python is installed with venv support.
6
- `:`Ensure Python venv support is installed (e.g., python3-venv).
7
- `)+`Details: ${t.message}`;case "BRIDGE_PIP_BOOTSTRAP_FAILED":return `Workspai could not bootstrap pip inside the bridge virtual environment.
8
- `+(b()?`Ensure pip is available for your Python installation and retry.
9
- `:`Install python3-venv/python3-pip and retry.
10
- `)+`Details: ${t.message}`;case "BRIDGE_PIP_UPGRADE_FAILED":return `Workspai could not upgrade pip in the bridge virtual environment.
11
- Check your network/proxy or disable RAPIDKIT_BRIDGE_UPGRADE_PIP.
12
- Details: ${t.message}`;case "BRIDGE_PIP_INSTALL_FAILED":return `Workspai could not install rapidkit-core in the bridge virtual environment.
13
- Check your network/proxy, or install manually with: pipx install rapidkit-core.
14
- Details: ${t.message}`;default:return `Workspai bridge error: ${t.message}`}return `Workspai failed to run the Python core engine: ${t instanceof Error?t.message:String(t)}`}function _(){let t=process.env.RAPIDKIT_CORE_PYTHON_PACKAGE;return t&&t.trim()?t.trim():"rapidkit-core"}function vt(){let t=_(),e=process.env.RAPIDKIT_CORE_PYTHON_PACKAGE_ID,r=e&&e.trim()?`${t}|${e.trim()}`:t;return wt.createHash("sha256").update(r).digest("hex").slice(0,12)}function j(){let t=process.env.XDG_CACHE_HOME;return t&&t.trim()?t:l.join(tt.homedir(),".cache")}function Pt(){return l.join(j(),"rapidkit","npm-bridge","venv")}function nt(){let t=vt();return l.join(j(),"rapidkit","npm-bridge",`venv-${t}`)}function Y(t){return m(t)}function U(t){return n(t)}async function rt(t$1=process.platform,e=process.env){let r=b(t$1)?["rapidkit.exe","rapidkit.cmd"]:["rapidkit"],n=t(e,t$1).flatMap(i=>r.map(o=>l.join(i,o)));for(let i of [...new Set(n)])try{if(!await p.pathExists(i))continue;let o=await execa(i,["--version","--json"],{reject:false,stdio:"pipe",timeout:4e3});if(o.exitCode===0&&await k(o.stdout))return {cmd:i,baseArgs:[]}}catch{}return null}async function it(t=process.platform,e=process.env){let r=b(t)?"rapidkit.exe":"rapidkit",n=(e.PATH??"").split(l.delimiter).filter(Boolean);for(let i of n){let o=l.join(i,r);try{if(!await p.pathExists(o))continue;let c=await execa(o,["--version","--json"],{reject:false,stdio:"pipe",timeout:4e3});if(c.exitCode===0&&await k(c.stdout,{requireSchema:true}))return {cmd:o,baseArgs:[]}}catch{}}return null}function ot(t){return /[<>=!~]=|@|\.whl$|\.tar\.gz$|\.zip$|git\+|https?:\/\//.test(t)}function Ct(t){return l.dirname(l.dirname(t))}function st(){return l.join(j(),"rapidkit","npm-bridge","core-commands.json")}async function at(t){let e=!!process.env.RAPIDKIT_DEBUG,r=n=>{e&&process.stderr.write(`[DEBUG] tryRapidkit(${t}): ${n}
15
- `);};try{r("probing interpreter-specific rapidkit script");let i=((await execa(t,v(t,["-c","import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'rapidkit'))"]),{reject:false,stdio:"pipe",timeout:2e3})).stdout??"").toString().trim();if(r(`script path: ${i}`),i)try{if(await p.pathExists(i)){r(`found script at ${i}; invoking --version --json`);let o=await execa(i,["--version","--json"],{reject:false,stdio:"pipe",timeout:4e3});if(r(`script exitCode=${o.exitCode}`),o.exitCode===0){let c=(o.stdout??"").toString().trim();try{let s=JSON.parse(c),a=!!s&&typeof s=="object"&&s!==null&&"version"in s;if(r(`script JSON parse ok=${a}`),a)return true}catch{r("script output not valid JSON");}}}}catch(o){r(`interpreter-specific script probe failed: ${String(o)}`);}}catch(n){r(`interpreter-specific script probe error: ${String(n)}`);}try{r('probing importlib.find_spec("rapidkit")');let n=await execa(t,v(t,["-c","import importlib.util; print(1 if importlib.util.find_spec('rapidkit') else 0)"]),{reject:false,stdio:"pipe",timeout:2e3});if(r(`import probe exitCode=${n.exitCode} stdout=${(n.stdout??"").toString().trim()}`),n.exitCode===0&&(n.stdout??"").toString().trim()==="1")return true}catch(n){r(`import probe error: ${String(n)}`);}try{r("probing python -m rapidkit");let n=await execa(t,v(t,["-m","rapidkit","--version","--json"]),{reject:false,stdio:"pipe",timeout:8e3});if(r(`-m probe exitCode=${n.exitCode}`),n.exitCode===0)return true}catch(n){r(`-m probe error: ${String(n)}`);}try{r("probing PATH for rapidkit executables");let n=(process.env.PATH??"").split(l.delimiter).filter(Boolean);for(let i of n){let o=l.join(i,b()?"rapidkit.exe":"rapidkit");try{if(await p.pathExists(o)){r(`found candidate on PATH: ${o}; invoking --version --json`);let c=await execa(o,["--version","--json"],{reject:false,stdio:"pipe",timeout:4e3});if(r(`candidate exitCode=${c.exitCode}`),c.exitCode===0){let s=(c.stdout??"").toString().trim();try{let a=JSON.parse(s),d=a;if(a&&typeof a=="object"&&a!==null&&"version"in d&&d.schema_version===1)return true}catch{r("candidate output not valid JSON, skipping");}}}}catch(c){r(`error probing candidate ${o}: ${String(c)}`);}}return r("no valid rapidkit found on PATH"),false}catch(n){return r(`PATH probe error: ${String(n)}`),false}}async function k(t,e){let r=(t??"").toString().trim();if(!r)return false;try{let n=JSON.parse(r);if(!n||typeof n!="object"||n===null)return false;let i=n;return "version"in i?e?.requireSchema?i.schema_version===1||i.schemaVersion==="rapidkit-core-version-v1":true:false}catch{return false}}async function ct(t,e=process.platform){let r=async o=>{try{let a=(await et(o))?.metadata?.python?.venvPath;return typeof a!="string"||!a.trim()?null:l.isAbsolute(a)?a:l.join(o,a)}catch{return null}},n$1=async(o,c)=>{let s=n(c,e);if(await p.pathExists(s)){let d=await execa(s,["--version","--json"],{reject:false,stdio:"pipe",timeout:1500,cwd:o});if(d.exitCode===0&&await k(d.stdout))return {cmd:s,baseArgs:[],workspaceDir:o}}let a=m(c,e);if(await p.pathExists(a)){let d=await execa(a,["-m","rapidkit","--version","--json"],{reject:false,stdio:"pipe",timeout:1500,cwd:o});if(d.exitCode===0&&await k(d.stdout))return {cmd:a,baseArgs:["-m","rapidkit"],workspaceDir:o}}return null},i=t;for(let o=0;o<25;o+=1){let c=await r(i),s=[l.join(i,".venv"),c].filter(d=>!!d);for(let d of [...new Set(s)]){let P=await n$1(i,d);if(P)return P}let a=l.dirname(i);if(a===i)break;i=a;}return null}async function Et(t){try{let e=l.join(t,".python-version");if(await p.pathExists(e)){let n=(await p.readFile(e,"utf-8")).trim();if(n)return n}}catch{}try{let e=await et(t);if(typeof e?.pythonVersion=="string"&&e.pythonVersion.trim())return e.pythonVersion.trim();let n=e?.metadata?.python?.pythonVersion;if(typeof n=="string"&&n.trim())return n.trim()}catch{}return null}async function F(t){if(t&&t.trim())try{let s=await ct(t);if(s){let a=s.workspaceDir??(l.dirname(s.cmd).includes(".venv")?l.dirname(l.dirname(l.dirname(s.cmd))):l.dirname(s.cmd)),d=await Et(a);return d&&(process.env.PYENV_VERSION=d),s}}catch{}let e=await St();if(e.kind==="venv"){let s=Ct(e.pythonPath),a=U(s);return await p.pathExists(a)?{cmd:a,baseArgs:[]}:{cmd:e.pythonPath,baseArgs:["-m","rapidkit"]}}try{if((await execa(e.cmd,["-m","rapidkit","--version","--json"],{reject:false,stdio:"pipe",timeout:4e3})).exitCode===0)return {cmd:e.cmd,baseArgs:["-m","rapidkit"]}}catch{}try{let a=((await execa(e.cmd,["-c","import sysconfig, os; print(os.path.join(sysconfig.get_path('scripts'), 'rapidkit'))"],{reject:false,stdio:"pipe",timeout:2e3})).stdout??"").toString().trim();if(a&&await p.pathExists(a))try{let d=await execa(a,["--version","--json"],{reject:false,stdio:"pipe",timeout:4e3});if(d.exitCode===0&&await k(d.stdout))return {cmd:a,baseArgs:[]}}catch{}}catch{}let r=await rt();if(r)return r;let n=await it();if(n)return n;let i=nt(),o=await N(e.cmd),c=U(i);return await p.pathExists(c)?{cmd:c,baseArgs:[]}:{cmd:o,baseArgs:["-m","rapidkit"]}}async function dt(){for(let t of O())try{if((await execa(t,v(t,["--version"]),{reject:false,stdio:"pipe",timeout:2e3})).exitCode===0)return t}catch{}return null}async function B(){let t=null,e=false;for(let r of O()){try{if((await execa(r,v(r,["--version"]),{reject:false,stdio:"pipe",timeout:2e3})).exitCode!==0)continue;e=true;}catch{continue}try{return await N(r)}catch(n){t=n;continue}}throw e?t instanceof y?t:t instanceof Error?new y("BRIDGE_VENV_BOOTSTRAP_FAILED",t.message):new y("BRIDGE_VENV_BOOTSTRAP_FAILED","Python was detected, but the Workspai bridge environment could not be created."):new y("PYTHON_NOT_FOUND","No Python interpreter found (python3/python/py).")}async function _t(){let t=!!process.env.RAPIDKIT_DEBUG,e=n=>{t&&process.stderr.write(`[DEBUG] checkRapidkitCore: ${n}
16
- `);},r=Array.from(new Set([...j$1(),...k$1(14,10).map(n=>n.command)]));for(let n of r)try{e(`Method 1: trying ${n} import`);let i=await execa(n,v(n,["-c","import rapidkit_core; print(1)"]),{reject:false,stdio:"pipe",timeout:g});if(i.exitCode===0&&i.stdout?.trim()==="1")return e(`\u2713 Found via ${n} import`),true}catch{continue}for(let n of r)try{e(`Method 2: trying ${n} -m pip show`);let i=await execa(n,v(n,["-m","pip","show","rapidkit-core"]),{reject:false,stdio:"pipe",timeout:g});if(i.exitCode===0&&i.stdout?.includes("Name: rapidkit-core"))return e(`\u2713 Found via ${n} -m pip show`),true}catch{continue}for(let n of ["pip","pip3"])try{e(`Method 3: trying ${n} show`);let i=await execa(n,["show","rapidkit-core"],{reject:false,stdio:"pipe",timeout:g});if(i.exitCode===0&&i.stdout?.includes("Name: rapidkit-core"))return e(`\u2713 Found via ${n} show`),true}catch{continue}try{e("Method 4: checking pyenv versions");let n=await execa("pyenv",["versions","--bare"],{reject:false,stdio:"pipe",timeout:g});if(n.exitCode===0&&n.stdout){let i=n.stdout.split(`
17
- `).filter(o=>o.trim());e(`Found pyenv versions: ${i.join(", ")}`);for(let o of i){let c=process.env.PYENV_ROOT||l.join(tt.homedir(),".pyenv"),s=l.join(c,"versions",o.trim(),"bin","pip");try{let a=await execa(s,["show","rapidkit-core"],{reject:false,stdio:"pipe",timeout:g});if(a.exitCode===0&&a.stdout?.includes("Name: rapidkit-core"))return e(`\u2713 Found in pyenv ${o}`),true}catch{try{let a=await execa("pyenv",["exec","pip","show","rapidkit-core"],{reject:false,stdio:"pipe",timeout:g,env:{...process.env,PYENV_VERSION:o.trim()}});if(a.exitCode===0&&a.stdout?.includes("Name: rapidkit-core"))return e(`\u2713 Found in pyenv ${o} via PYENV_VERSION`),true}catch{continue}}}}}catch{e("pyenv not available");}for(let n of r)try{e(`Method 5: checking ${n} user site`);let i=await execa(n,v(n,["-m","site","--user-site"]),{reject:false,stdio:"pipe",timeout:g});if(i.exitCode===0&&i.stdout){let o=i.stdout.trim(),c=l.join(o,"rapidkit_core");if(await p.pathExists(c))return e("\u2713 Found in user site-packages"),true}}catch{continue}try{e("Method 6: checking pipx");let n=await execa("pipx",["list"],{reject:false,stdio:"pipe",timeout:g});if(n.exitCode===0&&n.stdout?.includes("rapidkit-core"))return e("\u2713 Found via pipx"),true}catch{e("pipx not available");}for(let n of r)try{e(`Method 6: checking ${n} -m pipx list`);let i=await execa(n,v(n,["-m","pipx","list"]),{reject:false,stdio:"pipe",timeout:g});if(i.exitCode===0&&i.stdout?.includes("rapidkit-core"))return e(`\u2713 Found via ${n} -m pipx list`),true}catch{continue}try{if(e("Method 7: checking poetry"),(await execa("poetry",["show","rapidkit-core"],{reject:false,stdio:"pipe",timeout:g})).exitCode===0)return e("\u2713 Found via poetry"),true}catch{e("poetry check failed");}for(let n of r)try{if(e(`Method 7: checking ${n} -m poetry show rapidkit-core`),(await execa(n,v(n,["-m","poetry","show","rapidkit-core"]),{reject:false,stdio:"pipe",timeout:g})).exitCode===0)return e(`\u2713 Found via ${n} -m poetry`),true}catch{continue}try{e("Method 8: checking conda");let n=await execa("conda",["list","rapidkit-core"],{reject:false,stdio:"pipe",timeout:g});if(n.exitCode===0&&n.stdout?.includes("rapidkit-core"))return e("\u2713 Found via conda"),true}catch{e("conda not available");}return e("\u2717 Not found in any environment"),false}function kt(t){let e=t.trim();if(!e||!e.startsWith("rapidkit-core"))return null;let r=e.slice(13).trim();return !r||/[\/@]|\.whl$|\.tar\.gz$|\.zip$|git\+|https?:\/\//.test(r)?null:r}function z(t){let e=t.trim();if(!e)return null;let r=e.split("."),n=[];for(let i of r){let o=i.match(/^(\d+)/);if(!o){n.push(0);continue}n.push(Number.parseInt(o[1],10));}return n}function q(t,e){let r=Math.max(t.length,e.length);for(let n=0;n<r;n+=1){let i=n<t.length?t[n]:0,o=n<e.length?e[n]:0;if(i>o)return 1;if(i<o)return -1}return 0}function xt(t){return t.length<=1?[t[0]+1]:t.length===2?[t[0]+1,0]:[t[0],t[1]+1,0]}function Rt(t){let e=t.split(",").map(n=>n.trim()).filter(Boolean);if(e.length===0)return null;let r=[];for(let n of e){let i=n.match(/^(==|>=|<=|>|<|~=)\s*([0-9][0-9A-Za-z+._-]*)$/);if(!i)return null;r.push({op:i[1],version:i[2]});}return r}function ut(t,e){let r=z(t);if(!r)return false;let n=Rt(e);if(!n)return false;for(let i of n){let o=z(i.version);if(!o)return false;let c=q(r,o);if(i.op==="=="&&c!==0||i.op===">="&&c<0||i.op==="<="&&c>0||i.op===">"&&c<=0||i.op==="<"&&c>=0)return false;if(i.op==="~="){if(c<0)return false;let s=xt(o);if(q(r,s)>=0)return false}}return true}async function bt(){let t=Array.from(new Set([...j$1(),...k$1(14,10).map(r=>r.command)])),e=r=>{let n=r.match(/^Version:\s*(.+)$/m);return n?n[1].trim():null};for(let r of t)try{let n=await execa(r,v(r,["-m","pip","show","rapidkit-core"]),{reject:false,stdio:"pipe",timeout:g});if(n.exitCode===0){let i=e(n.stdout||"");if(i)return i}}catch{continue}for(let r of ["pip","pip3"])try{let n=await execa(r,["show","rapidkit-core"],{reject:false,stdio:"pipe",timeout:g});if(n.exitCode===0){let i=e(n.stdout||"");if(i)return i}}catch{continue}try{let r=await execa("pipx",["list"],{reject:false,stdio:"pipe",timeout:g});if(r.exitCode===0&&r.stdout){let n=r.stdout.match(/rapidkit-core\s+([0-9][0-9A-Za-z+._-]*)/i);if(n?.[1])return n[1]}}catch{}return null}async function At(){let t=_(),e=kt(t);if(!e)return {isCompatible:false,installedVersion:null,expectedConstraint:null,reason:ot(t)?"constraint-unsupported":"constraint-missing"};let r=await bt();if(!r)return {isCompatible:false,installedVersion:null,expectedConstraint:e,reason:"version-not-detected"};let n=ut(r,e);return {isCompatible:n,installedVersion:r,expectedConstraint:e,reason:n?"compatible":"incompatible-version"}}async function N(t){let e=nt(),r=Pt(),n=_(),i=[e];!ot(n)&&!await p.pathExists(e)&&await p.pathExists(r)&&i.push(r);for(let m of i){let h=Y(m);if(await p.pathExists(h))try{let f=await execa(h,["-c","import importlib.util; print(1 if importlib.util.find_spec('rapidkit') else 0)"],{reject:false,stdio:"pipe",timeout:2e3});if(f.exitCode===0&&(f.stdout??"").toString().trim()==="1")return h;await p.remove(m);}catch{await p.remove(m);}}let o=e,c={...process.env,PIP_DISABLE_PIP_VERSION_CHECK:"1",PIP_NO_PYTHON_VERSION_WARNING:"1"},s=Math.max(0,Number(process.env.RAPIDKIT_BRIDGE_PIP_RETRY??"2")),a=Math.max(200,Number(process.env.RAPIDKIT_BRIDGE_PIP_RETRY_DELAY_MS??"800")),d=Math.max(1e4,Number(process.env.RAPIDKIT_BRIDGE_PIP_TIMEOUT_MS??"120000")),P=m=>new Promise(h=>setTimeout(h,m)),E=async(m,h,f)=>{let w=await execa(m,h,{reject:false,stdio:["ignore","pipe","inherit"],env:c,timeout:f});if(w.exitCode===0)return;let T=(w.stdout??"").toString(),$=(w.stderr??"").toString(),b=[T,$].filter(Boolean).join(`
18
- `),ft=b?`${m} ${h.join(" ")}
19
- ${b}`:`${m} ${h.join(" ")}`;throw new Error(ft)},R=async(m,h,f)=>{let w=0;for(;;)try{await E(m,h,f);return}catch(T){if(w>=s)throw T;let $=Math.floor(Math.random()*200),b=a*Math.pow(2,w)+$;w+=1,await P(b);}};try{await p.ensureDir(l.dirname(o));try{await E(t,v(t,["-m","venv",o]),6e4);}catch(f){let w=f instanceof Error?f.message:String(f);throw new y("BRIDGE_VENV_CREATE_FAILED",w)}let m=Y(o);if((await execa(m,["-m","pip","--version"],{reject:false,stdio:"pipe",timeout:2e3})).exitCode!==0&&(await execa(m,["-m","ensurepip","--default-pip"],{reject:false,stdio:["ignore","pipe","inherit"],env:c,timeout:6e4})).exitCode!==0)throw new y("BRIDGE_PIP_BOOTSTRAP_FAILED","ensurepip failed; install python3-venv/python3-pip and retry.");if(process.env.RAPIDKIT_BRIDGE_UPGRADE_PIP==="1")try{await R(m,["-m","pip","install","-U","pip"],d);}catch(f){let w=f instanceof Error?f.message:String(f);throw new y("BRIDGE_PIP_UPGRADE_FAILED",w)}try{await R(m,["-m","pip","install","-U",_()],d);}catch(f){let w=f instanceof Error?f.message:String(f);throw new y("BRIDGE_PIP_INSTALL_FAILED",w)}return m}catch(m){if(m instanceof y)throw m;let h=m instanceof Error?m.message:String(m);throw new y("BRIDGE_VENV_BOOTSTRAP_FAILED",h)}}async function St(){if(process.env.RAPIDKIT_BRIDGE_FORCE_VENV==="1")return {kind:"venv",pythonPath:await B()};for(let r of O())if(await at(r))return {kind:"system",cmd:r};let t=await dt();if(!t)throw new y("PYTHON_NOT_FOUND","No Python interpreter found (python3/python/py).");let e;try{e=await N(t);}catch{e=await B();}return {kind:"venv",pythonPath:e}}async function Wt(t,e){try{let r=await F(e?.cwd),n=r.cmd,i=[...r.baseArgs,...t];if(t[0]==="init"){let s=await execa(n,i,{cwd:e?.cwd,env:{...process.env,...e?.env},reject:false,stdio:"pipe"}),a=H((s.stdout??"").toString()),d=H((s.stderr??"").toString());return a&&process.stdout.write(a.endsWith(`
20
- `)?a:`${a}
21
- `),d&&process.stderr.write(d.endsWith(`
22
- `)?d:`${d}
23
- `),typeof s.exitCode=="number"?s.exitCode:1}let c=await execa(n,i,{cwd:e?.cwd,env:{...process.env,...e?.env},reject:false,stdio:"inherit"});return typeof c.exitCode=="number"?c.exitCode:1}catch(r){return process.stderr.write(`${D(r)}
24
- `),1}}var It=[{pattern:/RapidKitError:\s*Directory '([^']+)' exists and force is not set/,message:t=>`\u274C Directory "${l.basename(t[1])}" already exists.
25
- \u{1F4A1} Choose a different name, or remove the existing directory first:
26
- rm -rf ${t[1]}`},{pattern:/RapidKitError:\s*Project name '([^']+)' is (invalid|not allowed)/i,message:t=>`\u274C Invalid project name: "${t[1]}"
27
- \u{1F4A1} Use lowercase letters, numbers, and hyphens only (e.g. my-api).`},{pattern:/RapidKitError:\s*Kit '([^']+)' not found/i,message:t=>`\u274C Unknown kit: "${t[1]}"
28
- \u{1F4A1} Run "npx workspai list" to see available kits.`},{pattern:/RapidKitError:\s*(.+)/,message:t=>`\u274C ${t[1].trim()}`}];async function Jt(t,e){let{spawn:r}=await import('child_process');try{let n=await F(e?.cwd),i=n.cmd,o=[...n.baseArgs,...t];return await new Promise(c=>{let s=r(i,o,{cwd:e?.cwd,env:{...process.env,...e?.env},stdio:["inherit","inherit","pipe"]}),a=[];s.stderr?.on("data",d=>{a.push(d);}),s.on("close",d=>{let P=d??1;if(P!==0&&a.length>0){let E=Buffer.concat(a).toString("utf8");for(let{pattern:R,message:m}of It){let h=E.match(R);if(h){process.stderr.write(m(h)+`
29
- `),c(P);return}}process.stderr.write(E);}c(P);}),s.on("error",d=>{process.stderr.write(`${D(d)}
30
- `),c(1);});})}catch(n){return process.stderr.write(`${D(n)}
31
- `),1}}async function x(t,e){try{let r=await F(e?.cwd),n=r.cmd,i=[...r.baseArgs,...t],o=await execa(n,i,{cwd:e?.cwd,env:{...process.env,...e?.env},reject:false,stdio:"pipe"});return {exitCode:typeof o.exitCode=="number"?o.exitCode:1,stdout:(o.stdout??"").toString(),stderr:(o.stderr??"").toString()}}catch(r){return {exitCode:1,stdout:"",stderr:`${D(r)}
32
- `}}}function pt(t){let e=new Set,r=t.split(`
33
- `),n=false;for(let i of r){let o=i.replace(/\r$/,"");if(!n){/^\s*Commands:\s*$/i.test(o)&&(n=true);let a=o.match(/^\s*rapidkit\s+([a-z0-9_-]+)\b/i);if(a){let d=a[1].trim();d&&!d.startsWith("-")&&e.add(d);}continue}if(!o.trim())break;if(/^\s*(Options|Arguments|Usage|Commands)\s*:/i.test(o))continue;let c=o.match(/^\s*([a-z0-9][a-z0-9_-]*)\b/i);if(!c)continue;let s=c[1].trim();s&&!s.startsWith("-")&&e.add(s);}return e}async function lt(){let t=st();if(!await p.pathExists(t))return null;try{let e=await p.readJson(t);if(e&&e.schema_version===1&&Array.isArray(e.commands))return e}catch{}return null}async function Z(t){let e=st();await p.ensureDir(l.dirname(e)),await p.writeJson(e,t,{spaces:2});}async function Dt(){let t=await x(["version","--json"],{cwd:process.cwd()});if(t.exitCode===0)try{let r=JSON.parse(t.stdout)?.version;return typeof r=="string"?r:void 0}catch{return}}async function Ot(){let t=await x(["commands","--json"],{cwd:process.cwd()});if(t.exitCode!==0)return null;try{let e=JSON.parse(t.stdout);if(e?.schema_version!==1||!Array.isArray(e.commands))return null;let r=e.commands.filter(n=>typeof n=="string");return r.length?r:null}catch{return null}}async function Ht(){let e=Date.now(),r=await lt(),n=await Dt(),i=!!r?.commands?.length;if(i&&e-r.fetched_at<864e5&&(!n||!r.rapidkit_version||r.rapidkit_version===n))return new Set(r.commands);let o=await Ot();if(o?.length){let d=Array.from(new Set(o)).sort();return await Z({schema_version:1,fetched_at:e,rapidkit_version:n,commands:d}),new Set(d)}let c=await x(["--help"],{cwd:process.cwd()});if(c.exitCode!==0)return i&&r?.commands?new Set(r.commands):new Set(M);let s=pt(c.stdout);if(s.size===0)return new Set(M);let a=Array.from(s).sort();return await Z({schema_version:1,fetched_at:e,rapidkit_version:n,commands:a}),s}async function Yt(){let e=Date.now(),r=await lt();return !r||e-r.fetched_at>=864e5||!r.commands?.length?null:new Set(r.commands)}function mt(){return l.join(j(),"rapidkit","npm-bridge","modules-catalog.json")}async function jt(){let t=mt();if(!await p.pathExists(t))return null;try{let e=await p.readJson(t);if(e&&e.schema_version===1&&Array.isArray(e.modules))return e}catch{}return null}async function X(t){let e=mt();await p.ensureDir(l.dirname(e)),await p.writeJson(e,t,{spaces:2});}function Q(t){try{return JSON.parse(t)}catch{return null}}async function Ut(t={}){let e=typeof t.ttlMs=="number"?t.ttlMs:18e5,r=Date.now(),n=await jt();if(n?.fetched_at&&r-n.fetched_at<e)return n;let i=["modules","list","--json-schema","1"];t.category&&i.push("--category",t.category),t.tag&&i.push("--tag",t.tag),t.detailed&&i.push("--detailed");let o=await x(i,{cwd:t.cwd,env:t.env});if(o.exitCode===0){let s=Q(o.stdout);if(s&&s.schema_version===1&&Array.isArray(s.modules)){let a={...s,fetched_at:r};return await X(a),a}}let c=await x(["modules","list","--json"],{cwd:t.cwd,env:t.env});if(c.exitCode===0){let s=Q(c.stdout);if(Array.isArray(s)){let a={schema_version:1,generated_at:new Date().toISOString(),filters:{category:t.category??null,tag:t.tag??null,detailed:!!t.detailed},stats:{total:s.length,returned:s.length,invalid:0},modules:s,source:"legacy-json",fetched_at:r};return await X(a),a}}return n||null}var zt={pythonCommandCandidates:O,pickSystemPython:dt,ensureBridgeVenv:N,ensureBridgeVenvFromCandidates:B,parseCoreCommandsFromHelp:pt,tryRapidkit:at,findUserLocalRapidkitRunner:rt,findPathRapidkitRunner:it,findWorkspaceRunner:ct,checkRapidkitCoreAvailable:_t,checkRapidkitCoreVersionCompatible:At,isVersionSatisfyingConstraint:ut};export{M as a,_t as b,At as c,St as d,Wt as e,Jt as f,x as g,Ht as h,Yt as i,Ut as j,zt as k};
@@ -1,2 +0,0 @@
1
- import {b}from'./chunk-UJXE4UAX.js';var s="cli-log-event-v1";var a="unknown-run";function C(e){a=e;}function l(){return a}function c(e){return {schemaVersion:s,runId:l(),timestamp:new Date().toISOString(),level:e.level,event:e.event,component:e.component,message:e.message,...e.command?{command:e.command}:{},...e.metadata&&Object.keys(e.metadata).length>0?{metadata:E(e.metadata)}:{}}}function f(e){b()&&L(c(e));}function L(e){process.stderr.write(`${JSON.stringify(e)}
2
- `);}function E(e){let t={};for(let[r,n]of Object.entries(e))if(n!==void 0){if(n instanceof Error){t[r]={name:n.name,message:n.message};continue}if(n===null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"){t[r]=n;continue}if(Array.isArray(n)){t[r]=n.map(o=>typeof o=="string"||typeof o=="number"||typeof o=="boolean"?o:String(o));continue}t[r]=String(n);}return t}export{s as a,C as b,l as c,f as d,L as e};
@@ -1 +0,0 @@
1
- import {r as r$1}from'./chunk-ZH7CXQH3.js';import {a as a$1}from'./chunk-KV6PS54A.js';import {b,c as c$2}from'./chunk-6DAQ7PYT.js';import {a as a$2}from'./chunk-NHTDPXTW.js';import {g}from'./chunk-VB6I52ZT.js';import {j,l as l$2}from'./chunk-CCAXADKP.js';import {c as c$1,d}from'./chunk-RSG2GJXT.js';import {a}from'./chunk-LNXIMF3O.js';import {f as f$1,g as g$1,h as h$1}from'./chunk-3A23KJAQ.js';import {k,l as l$1,h,m as m$1,n,p as p$2,q}from'./chunk-CT4IODPG.js';import {a as a$3}from'./chunk-DWB2RRF4.js';import {j as j$1,e as e$2}from'./chunk-N4QQADXX.js';import {m,p as p$1,s}from'./chunk-CJHWKXDN.js';import {l,o as o$1,p as p$3}from'./chunk-Q2WF7D5U.js';import {c,e as e$1}from'./chunk-CCDGHPEJ.js';import {b as b$1}from'./chunk-D65FCQIO.js';import {e,f,o,p,n as n$1,m as m$2}from'./chunk-NZ3WZYD5.js';import {c as c$3}from'./chunk-X6TNBARH.js';import ge from'path';import pe from'fs-extra';function r(t,s){if(!t)throw new Error(`Workspace Intelligence run semantic violation: ${s}`)}function de(t,s){return t.length===s.length&&t.every((m,u)=>m===s[u])}function ue(t){b$1(e.intelligenceRun,t,"Workspace Intelligence run report"),r(t.chainSchemaVersion===a,`chainSchemaVersion must be ${a}`),r(t.artifactPath===e.intelligenceRun,`artifactPath must be ${e.intelligenceRun}`),r(t.preflight.length===n$1.length,`preflight must contain exactly ${n$1.length} entries`);for(let[d,n]of n$1.entries()){let a=t.preflight[d];r(a?.id===n,`preflight[${d}].id must be ${n}`),r(de(a.artifacts,o[n]),`${n} preflight artifacts must match the runtime registry`),n==="sync"?r(a.status==="passed"&&a.result==="synchronized"||a.status==="failed"&&a.result==="failed","sync preflight status and result are incoherent"):r(a.status==="passed"&&(a.result==="created"||a.result==="reused")||a.status==="failed"&&a.result==="failed"||a.status==="skipped"&&a.result==="skipped","baseline preflight status and result are incoherent");}let s=t.preflight[1];r(t.baselineCreated===(s?.result==="created"),"baselineCreated must match the baseline preflight result"),r(t.stages.length===m$2.length,`stages must contain exactly ${m$2.length} canonical steps`);let m=t.preflight[0],u=m?.status==="failed";for(let[d,n]of m$2.entries()){let a=t.stages[d];r(a?.id===n,`stages[${d}].id must be ${n}`),r(de(a.artifacts,p[n].produces),`${n} artifacts must match the runtime registry`),u&&r(a.status==="skipped",`${n} must be skipped after a hard failure`),a.status==="passed"?r(a.exitCode===0,`${n} passed stage must have exitCode 0`):a.status==="blocked"?r(a.exitCode!==0,`${n} blocked stage must have a non-zero exitCode`):a.status==="failed"?(r(a.exitCode===1,`${n} failed stage must have exitCode 1`),u=true):(r(a.exitCode===0,`${n} skipped stage must have exitCode 0`),r(a.durationMs===0,`${n} skipped stage must have durationMs 0`)),d===0&&((m?.status==="failed"||a.status==="failed")&&r(s?.status==="skipped","baseline must be skipped when sync or model fails"),s?.status==="skipped"&&r(m?.status==="failed"||a.status==="failed"||a.status==="skipped","baseline may be skipped only after an upstream failure"),s?.status!=="passed"&&(u=true));}let h=t.preflight.some(d=>d.status==="failed")||t.stages.some(d=>d.status==="failed"),y=t.stages.some(d=>d.status==="blocked"),l=h?"failed":y?"blocked":"passed",p$1=l==="failed"?1:l==="blocked"?2:0;r(t.status===l,`status must be ${l}`),r(t.exitCode===p$1,`exitCode must be ${p$1}`);}var we=e.intelligenceRun,Ee=f.intelligenceRun,L=we;function I(t){c$3({action:"intelligence",status:t.status==="started"?"started":t.status==="passed"?"succeeded":t.status==="failed"?"failed":"warn",message:t.message,metadata:{phase:`workspace.intelligence.${t.kind}.${t.id}`,intelligenceMilestoneId:t.id,intelligenceMilestoneKind:t.kind,intelligenceMilestoneStatus:t.status}});}async function Ue(t){let s=ge.resolve(t.workspacePath);return c(s,L,()=>ye({...t,workspacePath:s}),{timeoutMs:15*6e4,staleAfterMs:3e4})}async function ye(t){let s$1=t.workspacePath,m$2=[],u=[],h$2=false,y=async(e,o$1)=>{let c=[...o[e]];if(h$2){I({id:e,kind:"preflight",status:"skipped",message:`${e} prerequisite skipped after an upstream failure`}),m$2.push({id:e,status:"skipped",result:"skipped",durationMs:0,artifacts:c,message:"skipped because a required upstream operation failed"});return}let k=Date.now();I({id:e,kind:"preflight",status:"started",message:`${e} prerequisite started`});try{let i=await o$1();I({id:e,kind:"preflight",status:"passed",message:i.message}),m$2.push({id:e,status:"passed",result:i.result,durationMs:Date.now()-k,artifacts:c,message:i.message});}catch(i){h$2=true;let f=i instanceof Error?i.message:String(i);I({id:e,kind:"preflight",status:"failed",message:f}),m$2.push({id:e,status:"failed",result:"failed",durationMs:Date.now()-k,artifacts:c,message:f});}},l$3=async(e,o)=>{let c=[...p[e].produces];if(h$2){I({id:e,kind:"stage",status:"skipped",message:`${e} skipped after an upstream failure`}),u.push({id:e,status:"skipped",durationMs:0,artifacts:c,exitCode:0,message:"skipped because a required upstream stage failed"});return}let k=Date.now();I({id:e,kind:"stage",status:"started",message:`${e} started`});try{let i=await o(),f=i.exitCode??0,w=i.blocked||f!==0?"blocked":"passed";I({id:e,kind:"stage",status:w,message:i.message}),u.push({id:e,status:w,durationMs:Date.now()-k,artifacts:c,exitCode:f,message:i.message});}catch(i){h$2=true;let f=i instanceof Error?i.message:String(i);I({id:e,kind:"stage",status:"failed",message:f}),u.push({id:e,status:"failed",durationMs:Date.now()-k,artifacts:c,exitCode:1,message:f});}};await y("sync",async()=>{let e=await g(s$1,true),o=await l({workspacePath:s$1});return {result:"synchronized",message:`registry ${e.added.length} added/${e.skipped} existing; contract ${o.contract.projects.length} projects`}});let p$4,d$1=()=>{if(!p$4)throw new Error("canonical workspace model is unavailable");return p$4};await l$3("model",async()=>(p$4={...await p$1({workspacePath:s$1,includeEvidence:true}),build:m({mode:"full",engineStatus:"disabled"})},await s(p$4,s$1),{message:`${p$4.summary.projectCount} projects modeled`}));let n$1=ge.join(s$1,e.snapshot),a$4=false;await y("baseline",async()=>{if(!await pe.pathExists(n$1)){let c=await k({workspacePath:s$1,model:d$1()});return await l$1(c,s$1),a$4=true,{result:"created",message:"initial structural baseline created"}}let e=await pe.readJson(n$1),o=h(e);return o?(await l$1(o,s$1),{result:"reused",message:"legacy structural baseline migrated and reused"}):{result:"reused",message:"existing structural baseline reused"}}),await l$3("diff",async()=>{let e$1=await m$1({workspacePath:s$1,fromPath:e.snapshot,model:d$1()});return await n(e$1,s$1),{message:e$1.summary.changed?"workspace changes detected":"no workspace changes"}}),await l$3("impact",async()=>{let e$1=await p$2({workspacePath:s$1,fromPath:e.diff});return await q(e$1,s$1),{message:`${e$1.summary.risk} risk; ${e$1.summary.affectedProjects} affected`}}),await l$3("doctor-evidence",async()=>{let e=await r$1({workspace:s$1,json:true,quiet:true,profile:t.strict===true?"enterprise-strict":"local"});return {exitCode:e,blocked:e!==0,message:`doctor exit ${e}`}}),await l$3("contract-evidence",async()=>{let e=await o$1({workspacePath:s$1,strict:true});return await p$3({workspacePath:s$1,result:e}),{exitCode:e.status==="passed"?0:1,blocked:e.status!=="passed",message:`contract ${e.status}`}}),await l$3("analyze-evidence",async()=>{let e=await a$1({workspacePath:s$1,json:true,strict:t.strict===true});return {blocked:e.summary.verdict==="blocked"||t.strict===true&&e.summary.verdict==="needs-attention",exitCode:e.summary.verdict==="blocked"||t.strict===true&&e.summary.verdict==="needs-attention"?1:0,message:`analyze ${e.summary.verdict} (${e.summary.score}/100)`}}),await l$3("readiness-evidence",async()=>{let e=await a$2({startPath:s$1,writeReport:true,skipVerify:true});return {blocked:e.overallStatus==="fail"||t.strict===true&&e.overallStatus==="warn",exitCode:e.overallStatus==="fail"||t.strict===true&&e.overallStatus==="warn"?1:0,message:`pre-verify readiness ${e.overallStatus}`}}),await l$3("verify",async()=>{let e$1=await f$1({workspacePath:s$1,fromImpactPath:e.impact});await g$1(e$1,s$1);let o=h$1(e$1,{strict:t.strict===true});return await j$1(s$1,e$2(e$1,o.passed)),{blocked:!o.passed,exitCode:o.exitCode,message:`${e$1.summary.verdict}; gate ${o.passed?"passed":"blocked"}`}}),await l$3("context",async()=>{let e=await c$1({workspacePath:s$1,model:d$1(),agent:t.agent??"generic",includeEvidence:true});return await d(e,s$1),{message:`context grounded for ${e.agent}`}}),await l$3("agent-sync",async()=>{let e=await l$2({workspacePath:s$1,agent:t.agent??"generic",targets:["all"],write:true,refreshContext:false,strict:t.strict===true,preset:"enterprise"}),o=false,c=await a$3(s$1);if(c.status==="miss"){if(c.reason!=="live-input-mismatch")throw new Error(`Agent grounding left canonical evidence invalid (${c.reason}).`);p$4={...await p$1({workspacePath:s$1,includeEvidence:true}),build:m({mode:"full",engineStatus:"disabled"})},await s(p$4,s$1);let f=await c$1({workspacePath:s$1,model:p$4,agent:t.agent??"generic",includeEvidence:true});await d(f,s$1);let w=await l$2({workspacePath:s$1,agent:t.agent??"generic",targets:["all"],write:true,refreshContext:false,strict:t.strict===true,preset:"enterprise"});e={...w,writtenFiles:[...new Set([...e.writtenFiles,...w.writtenFiles])].sort(),strictViolations:[...new Set([...e.strictViolations??[],...w.strictViolations??[]])].sort()};let O=await a$3(s$1);if(O.status==="miss")throw new Error(`Agent grounding reconciliation did not produce fresh canonical evidence (${O.reason}).`);o=true;}let k=e.strictViolations??[],i=t.strict===true&&k.length>0;return {blocked:i,exitCode:i?2:0,message:i?`${e.writtenFiles.length} grounding files written; ${k.length} strict grounding violation(s): ${k.join("; ")}`:`${e.writtenFiles.length} grounding files written; portable entry surfaces prepared for all supported hosts${o?"; canonical Model/Graph freshness sealed":""}`}}),await l$3("explain",async()=>{let e=await b({workspacePath:s$1,target:{kind:"release-blocked"}});await c$2(e,s$1);let o=t.strict===true?u.filter(c=>c.status==="blocked").map(c=>c.id):[];return {message:o.length>0&&e.blocking!==true?`Strict policy blocked advisory or incomplete evidence in ${o.join(", ")}. ${e.summary}`:e.summary}});let me=u.some(e=>e.status==="blocked"),G=h$2?"failed":me?"blocked":"passed",fe=h$2?1:G==="blocked"?2:0,b$1={schemaVersion:Ee,chainSchemaVersion:a,generatedAt:new Date().toISOString(),workspacePath:s$1,baselineCreated:a$4,preflight:m$2,status:G,exitCode:fe,stages:u,artifactPath:L};ue(b$1),await e$1(s$1,L,b$1);let ke=await j({workspacePath:s$1});return await e$1(s$1,e.agentIndex,ke),b$1}export{we as a,Ee as b,Ue as c};
@@ -1,6 +0,0 @@
1
- import {a}from'./chunk-GR6442P7.js';import o from'fs';import s from'path';var x={nextjs:{key:"nextjs",runtime:"node",displayName:"Next.js",supportTier:"extended",importStack:"nextjs",aliases:["next","nextjs","next.js"],dependencyHints:["next"],scriptHints:["next dev","next build","next start"],fileHints:["next.config.js","next.config.mjs","next.config.ts"]},remix:{key:"remix",runtime:"node",displayName:"Remix",supportTier:"extended",importStack:"remix",aliases:["remix"],dependencyHints:["@remix-run/react","@remix-run/node","@remix-run/dev"],scriptHints:["remix dev","remix vite:dev"],fileHints:["remix.config.js","remix.config.mjs"]},nuxt:{key:"nuxt",runtime:"node",displayName:"Nuxt",supportTier:"extended",importStack:"nuxt",aliases:["nuxt","nuxtjs","nuxt.js"],dependencyHints:["nuxt","nuxt3"],scriptHints:["nuxt dev","nuxt build","nuxi dev","nuxi build"],fileHints:["nuxt.config.js","nuxt.config.ts","nuxt.config.mjs"]},react:{key:"react",runtime:"node",displayName:"React",supportTier:"extended",importStack:"react",aliases:["react"],dependencyHints:["react","react-dom"],scriptHints:["react-scripts start","react-scripts build"],fileHints:[]},vite:{key:"vite",runtime:"node",displayName:"Vite",supportTier:"extended",importStack:"vite",aliases:["vite"],dependencyHints:["vite"],scriptHints:["vite","vite dev","vite build"],fileHints:["vite.config.js","vite.config.ts","vite.config.mjs"]},vue:{key:"vue",runtime:"node",displayName:"Vue",supportTier:"extended",importStack:"vue",aliases:["vue","vuejs","vue.js"],dependencyHints:["vue","@vue/cli-service"],scriptHints:["vue-cli-service serve","vue-cli-service build"],fileHints:["vue.config.js"]},sveltekit:{key:"sveltekit",runtime:"node",displayName:"SvelteKit",supportTier:"extended",importStack:"sveltekit",aliases:["sveltekit","svelte-kit"],dependencyHints:["@sveltejs/kit"],scriptHints:["svelte-kit dev","svelte-kit build"],fileHints:["svelte.config.js"]},svelte:{key:"svelte",runtime:"node",displayName:"Svelte",supportTier:"extended",importStack:"svelte",aliases:["svelte"],dependencyHints:["svelte"],scriptHints:["svelte"],fileHints:[]},angular:{key:"angular",runtime:"node",displayName:"Angular",supportTier:"extended",importStack:"angular",aliases:["angular","@angular/core"],dependencyHints:["@angular/core","@angular/cli"],scriptHints:["ng serve","ng build"],fileHints:["angular.json"]},astro:{key:"astro",runtime:"node",displayName:"Astro",supportTier:"extended",importStack:"astro",aliases:["astro"],dependencyHints:["astro"],scriptHints:["astro dev","astro build"],fileHints:["astro.config.js","astro.config.ts","astro.config.mjs"]},solid:{key:"solid",runtime:"node",displayName:"Solid",supportTier:"extended",importStack:"solid",aliases:["solid","solidjs","solid-js"],dependencyHints:["solid-js"],scriptHints:[],fileHints:[]},unknown:{key:"unknown",runtime:"unknown",displayName:"Unknown frontend",supportTier:"observed",importStack:"unknown",aliases:["unknown"],dependencyHints:[],scriptHints:[],fileHints:[]}},A={nextjs:{dev:["dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},remix:{dev:["dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},nuxt:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},react:{dev:["dev","start"],start:["serve"],build:["build"],test:["test"],lint:["lint"],format:["format"]},vite:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},vue:{dev:["dev","serve"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},sveltekit:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},svelte:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},angular:{dev:["start","serve"],start:["serve"],build:["build"],test:["test"],lint:["lint"],format:["format"]},astro:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},solid:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]}};function ie(e,n){let t=typeof e=="string"?B(e):e;return t==="unknown"?[]:A[t]?.[n]??[]}function I(e){try{return o.existsSync(e)?JSON.parse(o.readFileSync(e,"utf8")):null}catch{return null}}function O(e){let n=I(s.join(e,"package.json"));if(!n)return {dependencies:{},scriptText:""};let t={...n.dependencies??{},...n.devDependencies??{},...n.peerDependencies??{}},i=n.scripts??{},l=Object.values(i).filter(d=>typeof d=="string").join(" ").toLowerCase();return {dependencies:t,scriptText:l}}function G(e,n){return n.some(t=>o.existsSync(s.join(e,t)))}function N(e){return e.vite?e.react||e["react-dom"]||e["@vitejs/plugin-react"]?"react":e.vue||e["@vitejs/plugin-vue"]?"vue":e.svelte||e["@sveltejs/vite-plugin-svelte"]?"svelte":e["solid-js"]||e["vite-plugin-solid"]?"solid":null:null}function y(e,n,t){let i=x[e]??x.unknown;return {key:i.key,runtime:i.runtime,displayName:i.displayName,supportTier:i.supportTier,importStack:i.importStack,confidence:n,source:t}}function re(e){return x[e]??x.unknown}function B(e){let n=(e??"").trim().toLowerCase().replace(/[_\s]+/g,"-");if(!n)return "unknown";for(let t of Object.values(x))if(t.aliases.includes(n))return t.key;return "unknown"}function C(e,n){let t=B(typeof n?.framework=="string"?n.framework:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0);if(t!=="unknown")return y(t,"high","framework");let{dependencies:i,scriptText:l}=O(e);for(let d of ["nextjs","remix","nuxt","sveltekit","angular","astro","vue","solid","vite","react","svelte"]){let c=x[d];if(c.dependencyHints.some(u=>i[u])){if(d==="vite"){let u=N(i);if(u)return y(u,"high","manifest")}return y(d,"high","manifest")}if(c.fileHints.length>0&&G(e,c.fileHints)){if(d==="vite"){let u=N(i);if(u)return y(u,"high","manifest")}return y(d,"high","manifest")}if(c.scriptHints.some(u=>l.includes(u)))return y(d,"medium","manifest")}return y("unknown","low","unknown")}var w={fastapi:{key:"fastapi",runtime:"python",displayName:"FastAPI",supportTier:"first-class",importStack:"fastapi",aliases:["fastapi"],kitPrefixes:["fastapi"]},django:{key:"django",runtime:"python",displayName:"Django",supportTier:"extended",importStack:"django",aliases:["django"]},flask:{key:"flask",runtime:"python",displayName:"Flask",supportTier:"extended",importStack:"flask",aliases:["flask"]},python:{key:"python",runtime:"python",displayName:"Python",supportTier:"observed",importStack:"unknown",aliases:["python"]},nestjs:{key:"nestjs",runtime:"node",displayName:"NestJS",supportTier:"first-class",importStack:"nestjs",aliases:["nestjs","nest"],kitPrefixes:["nestjs"]},nextjs:{key:"nextjs",runtime:"node",displayName:"Next.js",supportTier:"extended",importStack:"nextjs",aliases:["nextjs","next.js","next"]},remix:{key:"remix",runtime:"node",displayName:"Remix",supportTier:"extended",importStack:"remix",aliases:["remix"]},nuxt:{key:"nuxt",runtime:"node",displayName:"Nuxt",supportTier:"extended",importStack:"nuxt",aliases:["nuxt","nuxtjs","nuxt.js"]},react:{key:"react",runtime:"node",displayName:"React",supportTier:"extended",importStack:"react",aliases:["react"]},vite:{key:"vite",runtime:"node",displayName:"Vite",supportTier:"extended",importStack:"vite",aliases:["vite"]},vue:{key:"vue",runtime:"node",displayName:"Vue",supportTier:"extended",importStack:"vue",aliases:["vue","vuejs","vue.js"]},sveltekit:{key:"sveltekit",runtime:"node",displayName:"SvelteKit",supportTier:"extended",importStack:"sveltekit",aliases:["sveltekit","svelte-kit"]},svelte:{key:"svelte",runtime:"node",displayName:"Svelte",supportTier:"extended",importStack:"svelte",aliases:["svelte"]},angular:{key:"angular",runtime:"node",displayName:"Angular",supportTier:"extended",importStack:"angular",aliases:["angular","@angular/core"]},astro:{key:"astro",runtime:"node",displayName:"Astro",supportTier:"extended",importStack:"astro",aliases:["astro"]},solid:{key:"solid",runtime:"node",displayName:"Solid",supportTier:"extended",importStack:"solid",aliases:["solid","solidjs","solid-js"]},express:{key:"express",runtime:"node",displayName:"Express",supportTier:"extended",importStack:"express",aliases:["express"]},fastify:{key:"fastify",runtime:"node",displayName:"Fastify",supportTier:"extended",importStack:"unknown",aliases:["fastify"]},koa:{key:"koa",runtime:"node",displayName:"Koa",supportTier:"extended",importStack:"koa",aliases:["koa"]},node:{key:"node",runtime:"node",displayName:"Node.js",supportTier:"observed",importStack:"unknown",aliases:["node","nodejs","typescript","javascript"]},gofiber:{key:"gofiber",runtime:"go",displayName:"Go/Fiber",supportTier:"extended",importStack:"go",aliases:["gofiber","fiber","go-fiber","go/fiber"],kitPrefixes:["gofiber"]},gogin:{key:"gogin",runtime:"go",displayName:"Go/Gin",supportTier:"extended",importStack:"go",aliases:["gogin","gin","go-gin","go/gin"],kitPrefixes:["gogin"]},echo:{key:"echo",runtime:"go",displayName:"Echo",supportTier:"extended",importStack:"go",aliases:["echo"]},go:{key:"go",runtime:"go",displayName:"Go",supportTier:"observed",importStack:"go",aliases:["go","golang"],kitPrefixes:["go"]},springboot:{key:"springboot",runtime:"java",displayName:"Spring Boot",supportTier:"extended",importStack:"springboot",aliases:["springboot","spring","spring-boot"],kitPrefixes:["springboot"]},java:{key:"java",runtime:"java",displayName:"Java",supportTier:"observed",importStack:"unknown",aliases:["java"]},laravel:{key:"laravel",runtime:"php",displayName:"Laravel",supportTier:"extended",importStack:"unknown",aliases:["laravel"]},symfony:{key:"symfony",runtime:"php",displayName:"Symfony",supportTier:"extended",importStack:"unknown",aliases:["symfony"]},php:{key:"php",runtime:"php",displayName:"PHP",supportTier:"observed",importStack:"unknown",aliases:["php"]},rails:{key:"rails",runtime:"ruby",displayName:"Ruby on Rails",supportTier:"extended",importStack:"rails",aliases:["rails","ruby-on-rails","ruby on rails"]},sinatra:{key:"sinatra",runtime:"ruby",displayName:"Sinatra",supportTier:"extended",importStack:"unknown",aliases:["sinatra"]},ruby:{key:"ruby",runtime:"ruby",displayName:"Ruby",supportTier:"observed",importStack:"unknown",aliases:["ruby"]},dotnet:{key:"dotnet",runtime:"dotnet",displayName:"ASP.NET Core",supportTier:"extended",importStack:"dotnet",aliases:["dotnet","asp.net","aspnet","asp.net core","csharp","c#"],kitPrefixes:["dotnet","aspnet","aspnetcore"]},actix:{key:"actix",runtime:"rust",displayName:"Actix-web",supportTier:"extended",importStack:"unknown",aliases:["actix","actix-web"]},axum:{key:"axum",runtime:"rust",displayName:"Axum",supportTier:"extended",importStack:"unknown",aliases:["axum"]},rocket:{key:"rocket",runtime:"rust",displayName:"Rocket",supportTier:"extended",importStack:"unknown",aliases:["rocket"]},rust:{key:"rust",runtime:"rust",displayName:"Rust",supportTier:"observed",importStack:"unknown",aliases:["rust"]},phoenix:{key:"phoenix",runtime:"elixir",displayName:"Phoenix",supportTier:"extended",importStack:"unknown",aliases:["phoenix"]},elixir:{key:"elixir",runtime:"elixir",displayName:"Elixir",supportTier:"observed",importStack:"unknown",aliases:["elixir"]},clojure:{key:"clojure",runtime:"clojure",displayName:"Clojure",supportTier:"extended",importStack:"unknown",aliases:["clojure"]},scala:{key:"scala",runtime:"scala",displayName:"Scala",supportTier:"extended",importStack:"unknown",aliases:["scala"]},kotlin:{key:"kotlin",runtime:"kotlin",displayName:"Kotlin",supportTier:"extended",importStack:"unknown",aliases:["kotlin"]},deno:{key:"deno",runtime:"deno",displayName:"Deno",supportTier:"extended",importStack:"unknown",aliases:["deno"]},bun:{key:"bun",runtime:"bun",displayName:"Bun",supportTier:"extended",importStack:"unknown",aliases:["bun"]},tauri:{key:"tauri",runtime:"node",displayName:"Tauri",supportTier:"extended",importStack:"unknown",aliases:["tauri","tauri-app"],kitPrefixes:["desktop.tauri"]},electron:{key:"electron",runtime:"node",displayName:"Electron",supportTier:"extended",importStack:"unknown",aliases:["electron","electron-forge"],kitPrefixes:["desktop.electron"]},"vscode-extension":{key:"vscode-extension",runtime:"node",displayName:"VS Code Extension",supportTier:"extended",importStack:"unknown",aliases:["vscode-extension","visual-studio-code-extension"],kitPrefixes:["extension.vscode"]},c:{key:"c",runtime:"c",displayName:"C",supportTier:"observed",importStack:"unknown",aliases:["c","clang","gcc"]},cpp:{key:"cpp",runtime:"cpp",displayName:"C++",supportTier:"observed",importStack:"unknown",aliases:["cpp","c++","cplusplus","cc","clang++","g++"]},unknown:{key:"unknown",runtime:"unknown",displayName:"Unknown",supportTier:"observed",importStack:"unknown",aliases:["unknown"]}},H=new Map;for(let e of Object.values(w))for(let n of e.aliases)H.set(n,e.key);function r(e,n,t){let i=w[e]??w.unknown;return {key:i.key,runtime:i.runtime,displayName:i.displayName,supportTier:i.supportTier,importStack:i.importStack,confidence:n,source:t}}function K(e){return e.trim().toLowerCase().replace(/[_\s]+/g,"-")}function m(e){try{return o.existsSync(e)?o.readFileSync(e,"utf8").toLowerCase():""}catch{return ""}}function D(e){try{return o.existsSync(e)?JSON.parse(o.readFileSync(e,"utf8")):null}catch{return null}}var M=new Set([".git",".hg",".svn",".workspai",".rapidkit",".venv","venv","node_modules","vendor","dist","build","target","coverage",".next",".cache"]);function S(e,n){if(n<0||!o.existsSync(e))return [];let t=[],i=[];try{i=o.readdirSync(e,{withFileTypes:true});}catch{return []}for(let l of i){let d=s.join(e,l.name);l.isDirectory()?t.push(...S(d,n-1)):t.push(d);}return t}function E(e,n){if(n<0||!o.existsSync(e))return [];let t=[];try{t=o.readdirSync(e,{withFileTypes:true});}catch{return []}let i=[];for(let l of t){let d=s.join(e,l.name);if(l.isDirectory()){if(M.has(l.name)||a(l.name))continue;i.push(...E(d,n-1));}else i.push(d);}return i}function p(e,n,t=2){return S(e,t).some(i=>i.toLowerCase().endsWith(n.toLowerCase()))}function R(e,n,t=2){return S(e,t).filter(i=>i.toLowerCase().endsWith(n.toLowerCase()))}function V(e){let n=K(e??"");if(!n)return "unknown";for(let t of Object.values(w))if(t.kitPrefixes?.some(i=>n.startsWith(i)))return t.key;return "unknown"}function v(e){return e?H.get(K(e))??"unknown":"unknown"}function le(e){return v(e)}function me(e){let n=v(e);return n!=="unknown"?w[n].runtime:"unknown"}function z(e){let n=V(e.kitName);if(n!=="unknown")return r(n,"high","kit");let t=v(e.framework);if(t!=="unknown")return r(t,"high","framework");let i=v(e.runtime);return i!=="unknown"?r(i,"medium","runtime"):r("unknown","low","unknown")}function q(e){let n=D(s.join(e,"package.json"));if(!n)return r("unknown","low","unknown");let t={...n.dependencies??{},...n.devDependencies??{}},i=n.scripts??{},l=Object.values(i).filter(d=>typeof d=="string").join(" ").toLowerCase();return t["@nestjs/core"]||l.includes("nest start")?r("nestjs","high","manifest"):t.express?r("express","high","manifest"):t.fastify?r("fastify","high","manifest"):t.koa?r("koa","high","manifest"):r("node","medium","marker")}function W(e){let n=D(s.join(e,"package.json"));if(!n)return r("unknown","low","unknown");let t={...n.dependencies??{},...n.devDependencies??{}},i=n.engines??{},l=n.scripts??{},d=Object.values(l).filter(c=>typeof c=="string").join(" ").toLowerCase();return t["@tauri-apps/api"]||t["@tauri-apps/cli"]||o.existsSync(s.join(e,"src-tauri","Cargo.toml"))?r("tauri","high","manifest"):t.electron||t["@electron-forge/cli"]||d.includes("electron-forge")||d.includes("electron ")?r("electron","high","manifest"):typeof i.vscode=="string"&&(n.activationEvents!==void 0||n.contributes!==void 0)?r("vscode-extension","high","manifest"):r("unknown","low","unknown")}function U(e){let n=[m(s.join(e,"pyproject.toml")),m(s.join(e,"requirements.txt")),m(s.join(e,"requirements.in"))].join(`
2
- `);return n.includes("fastapi")?r("fastapi","high","manifest"):n.includes("django")?r("django","high","manifest"):n.includes("flask")?r("flask","high","manifest"):n.trim()?r("python","medium","marker"):r("unknown","low","unknown")}function Y(e){let n=[m(s.join(e,"go.mod")),m(s.join(e,"main.go"))].join(`
3
- `);return n.includes("github.com/gofiber/fiber")?r("gofiber","high","manifest"):n.includes("github.com/gin-gonic/gin")?r("gogin","high","manifest"):n.includes("github.com/labstack/echo")?r("echo","high","manifest"):n.trim()?r("go","medium","marker"):r("unknown","low","unknown")}function $(e){let n=[m(s.join(e,"pom.xml")),m(s.join(e,"build.gradle")),m(s.join(e,"build.gradle.kts"))].join(`
4
- `);return n.includes("spring-boot")||n.includes("org.springframework")?r("springboot","high","manifest"):n.trim()?r("java","medium","marker"):r("unknown","low","unknown")}function Q(e){let n=m(s.join(e,"composer.json"));return n.includes("laravel/framework")?r("laravel","high","manifest"):n.includes("symfony/")?r("symfony","high","manifest"):n.trim()?r("php","medium","marker"):r("unknown","low","unknown")}function X(e){let n=m(s.join(e,"Gemfile"));return n.includes("gem 'rails'")||n.includes('gem "rails"')?r("rails","high","manifest"):n.includes("gem 'sinatra'")||n.includes('gem "sinatra"')?r("sinatra","high","manifest"):n.trim()?r("ruby","medium","marker"):r("unknown","low","unknown")}function Z(e){let t=[...R(e,".csproj",3),...R(e,".sln",2)].map(i=>m(i)).join(`
5
- `);return t.includes("microsoft.net.sdk.web")||t.includes("microsoft.aspnetcore")||t.includes("swashbuckle.aspnetcore")?r("dotnet","high","manifest"):t.trim()?r("dotnet","medium","marker"):r("unknown","low","unknown")}function J(e){let n=m(s.join(e,"Cargo.toml"));return n.includes("actix-web")?r("actix","high","manifest"):n.includes("axum")?r("axum","high","manifest"):n.includes("rocket")?r("rocket","high","manifest"):n.trim()?r("rust","medium","marker"):r("unknown","low","unknown")}function P(e){let n=m(s.join(e,"mix.exs"));return n.includes("phoenix")?r("phoenix","high","manifest"):n.trim()?r("elixir","medium","marker"):r("unknown","low","unknown")}function ee(e){let n=[],t=i=>{n.includes(i)||n.push(i);};return o.existsSync(s.join(e,"go.mod"))&&t("go"),(o.existsSync(s.join(e,"Cargo.toml"))||o.existsSync(s.join(e,"src-tauri","Cargo.toml")))&&t("rust"),(o.existsSync(s.join(e,"pom.xml"))||o.existsSync(s.join(e,"build.gradle"))||o.existsSync(s.join(e,"build.gradle.kts")))&&t("java"),o.existsSync(s.join(e,"mix.exs"))&&t("elixir"),o.existsSync(s.join(e,"composer.json"))&&t("php"),(p(e,".csproj")||p(e,".sln"))&&t("dotnet"),o.existsSync(s.join(e,"package.json"))&&t("node"),o.existsSync(s.join(e,"Gemfile"))&&t("ruby"),(o.existsSync(s.join(e,"pyproject.toml"))||o.existsSync(s.join(e,"setup.py"))||o.existsSync(s.join(e,"requirements.txt"))||o.existsSync(s.join(e,"requirements.in")))&&t("python"),(o.existsSync(s.join(e,"deps.edn"))||o.existsSync(s.join(e,"project.clj")))&&t("clojure"),o.existsSync(s.join(e,"build.sbt"))&&t("scala"),(o.existsSync(s.join(e,"deno.json"))||o.existsSync(s.join(e,"deno.jsonc")))&&t("deno"),(o.existsSync(s.join(e,"bun.lockb"))||o.existsSync(s.join(e,"bun.lock")))&&t("bun"),(o.existsSync(s.join(e,"CMakeLists.txt"))||o.existsSync(s.join(e,"meson.build"))||p(e,".cpp",3)||p(e,".cc",3)||p(e,".cxx",3)||p(e,".hpp",3)||p(e,".hh",3)||p(e,".hxx",3))&&t("cpp"),(p(e,".c",3)||p(e,".h",3))&&t("c"),(o.existsSync(s.join(e,"settings.gradle.kts"))||p(s.join(e,"src"),".kt",3)||m(s.join(e,"build.gradle.kts")).includes("kotlin"))&&t("kotlin"),n}function ke(e,n=4){let t=E(e,Math.max(0,Math.min(12,n))),i=new Set(t.map(k=>s.basename(k))),l=t.map(k=>k.toLowerCase()),d=[],c=k=>{d.includes(k)||d.push(k);},u=(...k)=>k.some(g=>i.has(g)),f=(...k)=>l.some(g=>k.some(a=>g.endsWith(a)));return u("go.mod")&&c("go"),u("Cargo.toml")&&c("rust"),u("pom.xml","build.gradle","build.gradle.kts")&&c("java"),u("mix.exs")&&c("elixir"),u("composer.json")&&c("php"),f(".csproj",".sln")&&c("dotnet"),u("package.json")&&c("node"),u("Gemfile")&&c("ruby"),u("pyproject.toml","setup.py","requirements.txt","requirements.in")&&c("python"),u("deps.edn","project.clj")&&c("clojure"),u("build.sbt")&&c("scala"),u("deno.json","deno.jsonc")&&c("deno"),u("bun.lockb","bun.lock")&&c("bun"),(u("CMakeLists.txt","meson.build")||f(".cpp",".cc",".cxx",".hpp",".hh",".hxx"))&&c("cpp"),f(".c",".h")&&c("c"),(u("settings.gradle.kts")||f(".kt")||t.some(k=>s.basename(k)==="build.gradle.kts"&&m(k).includes("kotlin")))&&c("kotlin"),d}function pe(e,n){let t=z({framework:typeof n?.framework=="string"?n.framework:void 0,runtime:typeof n?.runtime=="string"?n.runtime:void 0,kitName:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0});if(t.key!=="unknown")return t;let i=ee(e),l=m(s.join(e,"CMakeLists.txt")),d=m(s.join(e,"meson.build")),c=m(s.join(e,"Cargo.toml")),u=l.trim().length>0||d.trim().length>0,f=p(e,".cpp",3)||p(e,".cc",3)||p(e,".cxx",3),k=p(e,".c",3),g=/(?:\bcxx\b|\bcplusplus\b|\bc\+\+\b)/u.test(`${l}
6
- ${d}`);if(u&&i.includes("cpp")&&(f||g))return r("cpp","high","manifest");if(u&&i.includes("c")&&k&&!f&&!g)return r("c","high","manifest");if(i.includes("rust")&&/\[workspace\]/u.test(c)&&/^default-members\s*=/mu.test(c))return r("rust","high","manifest");if(i.includes("bun"))return r("bun","high","marker");if(i.includes("deno"))return r("deno","high","marker");if(i.includes("kotlin"))return r("kotlin","medium","marker");if(i.includes("node")){let a=W(e);if(a.key!=="unknown")return a;let j=C(e,n);if(j.key!=="unknown")return j;let h=q(e);if(h.key!=="unknown")return h}if(i.includes("python")){let a=U(e);if(a.key!=="unknown")return a}if(i.includes("go")){let a=Y(e);if(a.key!=="unknown")return a}if(i.includes("java")){let a=$(e);if(a.key!=="unknown")return a}if(i.includes("php")){let a=Q(e);if(a.key!=="unknown")return a}if(i.includes("ruby")){let a=X(e);if(a.key!=="unknown")return a}if(i.includes("rust")){let a=J(e);if(a.key!=="unknown")return a}if(i.includes("elixir")){let a=P(e);if(a.key!=="unknown")return a}if(i.includes("dotnet")){let a=Z(e);if(a.key!=="unknown")return a}return i.includes("clojure")?r("clojure","medium","marker"):i.includes("scala")?r("scala","medium","marker"):i.includes("c")&&k&&!f?r("c","medium","marker"):i.includes("cpp")?r("cpp","medium","marker"):i.includes("c")?r("c","medium","marker"):i.length>0?r(v(i[0]),"medium","runtime"):r("unknown","low","unknown")}export{ie as a,re as b,B as c,C as d,le as e,me as f,z as g,ee as h,ke as i,pe as j};
@@ -1,2 +0,0 @@
1
- import {q,r}from'./chunk-MOSXTVPU.js';import o from'fs-extra';async function i(a){for(let t of [q(a),r(a)])try{if(await o.pathExists(t))return await o.readJson(t)}catch{}return null}async function c(a,t){let e=await i(a);e?.metadata&&(t.metadata={...e.metadata,...t.metadata});let r=JSON.stringify(t,null,2)+`
2
- `;await o.outputFile(q(a),r,"utf-8");}async function m(a,t){let e=await i(a);return e?(e.metadata={...e.metadata,...t,vscode:t.vscode?{...e.metadata?.vscode,...t.vscode}:e.metadata?.vscode,npm:t.npm?{...e.metadata?.npm,...t.npm}:e.metadata?.npm,python:t.python?{...e.metadata?.python,...t.python}:e.metadata?.python},await c(a,e),true):false}function u(a,t,e,r){return {signature:"RAPIDKIT_WORKSPACE",createdBy:"workspai-cli",version:t,createdAt:new Date().toISOString(),name:a,metadata:{npm:{packageVersion:t,installMethod:e,lastUsedAt:new Date().toISOString()},...r?{python:r}:{}}}}function f(a){if(!a||typeof a!="object")return false;let t=a;return t.signature==="RAPIDKIT_WORKSPACE"&&typeof t.createdBy=="string"&&typeof t.version=="string"&&typeof t.createdAt=="string"&&typeof t.name=="string"}export{i as a,c as b,m as c,u as d,f as e};