rapidkit 0.37.0 → 0.38.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 (65) hide show
  1. package/README.md +166 -147
  2. package/contracts/create-planner-capabilities.v1.json +251 -0
  3. package/contracts/runtime-command-surface.v1.json +52 -0
  4. package/dist/autopilot-release-SBPGNGAB.js +1 -0
  5. package/dist/chunk-2ED6SPXP.js +1 -0
  6. package/dist/chunk-3R7UJAX5.js +1 -0
  7. package/dist/{chunk-RUUDLAKJ.js → chunk-5NBYSXOZ.js} +1 -1
  8. package/dist/chunk-7XW2I6MP.js +13 -0
  9. package/dist/{chunk-U6QUN6V2.js → chunk-ABPDGFVD.js} +1 -1
  10. package/dist/chunk-IW3KLQXE.js +2 -0
  11. package/dist/{chunk-7VSYTOOG.js → chunk-NKNMGWAZ.js} +1 -1
  12. package/dist/{chunk-IOIWVHRO.js → chunk-TVIOAZ6E.js} +13 -13
  13. package/dist/chunk-XESEBTPE.js +1 -0
  14. package/dist/{create-HN5HOGQ4.js → create-Y3XJOKL5.js} +1 -1
  15. package/dist/index.js +150 -144
  16. package/dist/{pipeline-BOU4KETN.js → pipeline-C4UCLETO.js} +1 -1
  17. package/dist/{workspace-2AL5C3QZ.js → workspace-WBKFXH4Z.js} +1 -1
  18. package/dist/{workspace-agent-sync-V2H6NTGD.js → workspace-agent-sync-3FFFJYKF.js} +1 -1
  19. package/dist/{workspace-context-KCKNV5VQ.js → workspace-context-V4UGIHSC.js} +1 -1
  20. package/dist/{workspace-foundation-L6ZBGMVE.js → workspace-foundation-T45HAWKL.js} +1 -1
  21. package/dist/{workspace-intelligence-3TWXJQ7Y.js → workspace-intelligence-MGL3Z25K.js} +1 -1
  22. package/dist/{workspace-model-NQVZN5W4.js → workspace-model-IKMGY2BX.js} +1 -1
  23. package/dist/workspace-run-HOR56FON.js +1 -0
  24. package/dist/workspace-verify-A3J6D7T2.js +1 -0
  25. package/docs/AI_DYNAMIC_INTEGRATION.md +440 -0
  26. package/docs/AI_EXAMPLES.md +419 -0
  27. package/docs/AI_FEATURES.md +460 -0
  28. package/docs/AI_QUICKSTART.md +245 -0
  29. package/docs/DEVELOPMENT.md +88 -0
  30. package/docs/From Code to Shared Understanding.png +0 -0
  31. package/docs/OPEN_SOURCE_USER_SCENARIOS.md +170 -0
  32. package/docs/OPTIMIZATION_GUIDE.md +504 -0
  33. package/docs/PACKAGE_MANAGER_POLICY.md +25 -0
  34. package/docs/README.md +121 -0
  35. package/docs/SECURITY.md +63 -0
  36. package/docs/SETUP.md +107 -0
  37. package/docs/UTILITIES.md +221 -0
  38. package/docs/WORKSPACE_MARKER_SPEC.md +276 -0
  39. package/docs/ci-workflows.md +56 -0
  40. package/docs/commands-reference.md +136 -0
  41. package/docs/config-file-guide.md +295 -0
  42. package/docs/contracts/ARTIFACT_CATALOG.md +111 -0
  43. package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +138 -0
  44. package/docs/contracts/README.md +71 -0
  45. package/docs/contracts/RUNTIME_ACCEPTANCE_MATRIX.md +98 -0
  46. package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +74 -0
  47. package/docs/contracts/rapidkit-cli-contracts.json +239 -0
  48. package/docs/create-planner-capabilities.md +81 -0
  49. package/docs/doctor-command.md +263 -0
  50. package/docs/examples/ci-agent-grounding.yml +62 -0
  51. package/docs/from-code-to-shared-understanding.md +46 -0
  52. package/docs/governance-policy.enterprise.example.json +40 -0
  53. package/docs/mirror-config.enterprise.example.json +60 -0
  54. package/docs/policies.workspace.example.yml +23 -0
  55. package/docs/workspace-operations.md +160 -0
  56. package/docs/workspace-run.md +80 -0
  57. package/package.json +3 -2
  58. package/dist/autopilot-release-AUXP2ZIF.js +0 -1
  59. package/dist/chunk-C7OVQQXT.js +0 -1
  60. package/dist/chunk-EJGKBFV4.js +0 -2
  61. package/dist/chunk-UXKB4KGZ.js +0 -13
  62. package/dist/chunk-YJ24EV3P.js +0 -1
  63. package/dist/workspace-run-DEXI52KO.js +0 -1
  64. package/dist/workspace-verify-HBCQNNGU.js +0 -1
  65. /package/dist/{chunk-D23L2GFT.js → chunk-6E5TBB2C.js} +0 -0
@@ -1,4 +1,4 @@
1
- import {e,C,w,g,f as f$1,b as b$3,c as c$2,d as d$3}from'./chunk-UXKB4KGZ.js';import {b as b$2}from'./chunk-C7WILE56.js';import {a,d,b as b$1}from'./chunk-RV6HBTFC.js';import {b}from'./chunk-PPQYTYQG.js';import {e as e$1,c,d as d$2}from'./chunk-RELR4O5E.js';import {a as a$1,e as e$2,d as d$1,f,c as c$1,k}from'./chunk-Z5LKRG57.js';import {promises}from'fs';import*as P from'fs-extra';import m from'path';import t from'chalk';import {execa}from'execa';async function H(e,o={}){let n=m.resolve(e),r=o.workspaceName??m.basename(n);try{let{registerWorkspace:a}=await import('./workspace-2AL5C3QZ.js');await a(n,r);}catch(a){o.silent||console.warn(t.gray(`Note: Could not register workspace in shared registry: ${a?.message??a}`));}try{let{syncWorkspaceContract:a}=await import('./workspace-contract-D5O4OZD5.js'),c=await a({workspacePath:n});if(o.silent||console.log(t.gray(`\u2139\uFE0F Workspace intelligence synced (contract + registry summary, ${c.contract.projects.length} project(s)).`)),!o.silent&&c.verification.status!=="passed"){console.log(t.yellow("\u26A0\uFE0F Workspace contract verification reported issues."));for(let d of c.verification.violations)console.log(t.gray(` Violation: ${d}`));console.log(t.white(" Next: npx rapidkit workspace contract inspect"));}}catch(a){o.silent||console.warn(t.gray(`Note: Could not sync workspace intelligence layer: ${a?.message??a}`));}}function S(){return c$1()}async function B(e,o,n,r){let a=d(o,b(),n);r&&(a.metadata||(a.metadata={}),a.metadata.python={version:r}),await b$1(e,a);}async function z(e){await P.outputFile(m.join(e,".gitignore"),`.venv/
1
+ import {k,e as e$3}from'./chunk-3R7UJAX5.js';import {b as b$2}from'./chunk-C7WILE56.js';import {e,g,f as f$1,b as b$3,c as c$2,d as d$3}from'./chunk-7XW2I6MP.js';import {a,d,b as b$1}from'./chunk-RV6HBTFC.js';import {b}from'./chunk-PPQYTYQG.js';import {e as e$1,c,d as d$2}from'./chunk-RELR4O5E.js';import {a as a$1,e as e$2,d as d$1,f,c as c$1,k as k$1}from'./chunk-Z5LKRG57.js';import {promises}from'fs';import*as P from'fs-extra';import m from'path';import t from'chalk';import {execa}from'execa';async function H(e,o={}){let n=m.resolve(e),r=o.workspaceName??m.basename(n);try{let{registerWorkspace:a}=await import('./workspace-WBKFXH4Z.js');await a(n,r);}catch(a){o.silent||console.warn(t.gray(`Note: Could not register workspace in shared registry: ${a?.message??a}`));}try{let{syncWorkspaceContract:a}=await import('./workspace-contract-D5O4OZD5.js'),c=await a({workspacePath:n});if(o.silent||console.log(t.gray(`\u2139\uFE0F Workspace intelligence synced (contract + registry summary, ${c.contract.projects.length} project(s)).`)),!o.silent&&c.verification.status!=="passed"){console.log(t.yellow("\u26A0\uFE0F Workspace contract verification reported issues."));for(let d of c.verification.violations)console.log(t.gray(` Violation: ${d}`));console.log(t.white(" Next: npx rapidkit workspace contract inspect"));}}catch(a){o.silent||console.warn(t.gray(`Note: Could not sync workspace intelligence layer: ${a?.message??a}`));}}function S(){return c$1()}async function B(e,o,n,r){let a=d(o,b(),n);r&&(a.metadata||(a.metadata={}),a.metadata.python={version:r}),await b$1(e,a);}async function z(e){await P.outputFile(m.join(e,".gitignore"),`.venv/
2
2
  __pycache__/
3
3
  *.pyc
4
4
  .env
@@ -36,7 +36,7 @@ cache:
36
36
  self_heal: true
37
37
  verify_integrity: false
38
38
  `}async function Et(){try{let{stdout:e}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),o=e.match(/go(\d+\.\d+(?:\.\d+)?)/i);return o?o[1]:void 0}catch{return}}async function Ct(){try{let{stdout:e}=await execa("dotnet",["--version"],{timeout:3e3,stdio:"pipe"}),o=e.trim();return o.length>0?o:void 0}catch{return}}async function Q(e,o,n,r,a,c){let[d,p]=await Promise.all([Et(),Ct()]);await P.outputFile(m.join(e,".rapidkit","workspace.json"),xt(o,n,r,a,c),"utf-8"),await P.outputFile(m.join(e,".rapidkit","toolchain.lock"),It(n,r,process.version,d,p),"utf-8"),await P.outputFile(m.join(e,".rapidkit","policies.yml"),Rt(),"utf-8"),await P.outputFile(m.join(e,".rapidkit","cache-config.yml"),_t(),"utf-8");}async function ke(e,o){let{workspaceName:n=m.basename(e),installMethod:r="venv",pythonVersion:a$1,profile:c,writeMarker:d$1=true,writeGitignore:p=true,onlyIfMissing:y=true}=o||{},h=[],[g,s]=await Promise.all([Et(),Ct()]),i=[{relPath:m.join(".rapidkit","workspace.json"),content:xt(n,r,a$1,c)},{relPath:m.join(".rapidkit","toolchain.lock"),content:It(r,a$1,process.version,g,s)},{relPath:m.join(".rapidkit","policies.yml"),content:Rt()},{relPath:m.join(".rapidkit","cache-config.yml"),content:_t()}];for(let f of i){let u=m.join(e,f.relPath);y&&await P.pathExists(u)||(await P.outputFile(u,f.content,"utf-8"),h.push(f.relPath));}if(d$1&&(!!!await a(e)||!y)){let u=d(n,b(),r);a$1&&(u.metadata||(u.metadata={}),u.metadata.python={version:a$1}),await b$1(e,u),h.push(".rapidkit-workspace");}if(p){let f=m.join(e,".gitignore");(!y||!await P.pathExists(f))&&(await z(e),h.push(".gitignore"));}return h}var jt=new Set(["go-only","java-only","dotnet-only","node-only","minimal"]),Ot={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"};function Vt(e){let o=e,n=new Set;for(;!jt.has(o);){if(n.has(o))return "minimal";n.add(o);let r=Ot[o];if(!r)return "minimal";o=r;}return o}var F="3.10",$t=["3.10","3.11","3.12"];async function Pt(e){try{let{stdout:o}=await execa(e,["--version"],{timeout:3e3}),n=o.match(/Python (\d+\.\d+\.\d+)/);if(n)return n[1]}catch{}return null}async function Lt(e,o){try{await promises.writeFile(m.join(e,".python-version"),`${o}
39
- `,"utf-8"),e$1.debug(`Created .python-version with ${o}`);}catch(n){e$1.warn(`Failed to create .python-version: ${n}`);}}function V(){let n=[...(process.env.PATH||"").split(m.delimiter).filter(Boolean)];for(let r of k())n.includes(r)||n.unshift(r);process.env.PATH=n.join(m.delimiter);}async function it(e,o){V(),e.start("Checking pipx installation");try{return await execa("pipx",["--version"]),e.succeed("pipx found"),{kind:"binary"}}catch{}let n=S();try{return await execa(n,["-m","pipx","--version"]),e.succeed("pipx found"),{kind:"python-module",pythonCmd:n}}catch{}if(o)throw new d$3;e.stop?.();let{installPipx:r}=await b$2([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!r)throw new d$3;e.start("Installing pipx (user install)");try{try{await execa(n,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(n,["-m","pip","install","--user","--upgrade","pipx"]);}catch(a){let c=a,d=String(c?.stderr||c?.shortMessage||c?.message||"");throw new f$1("Install pipx with python -m pip",a instanceof Error?a:new Error(d))}e.succeed("pipx installed"),V();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(a){let c=a,d=String(c?.stderr||c?.shortMessage||c?.message||"pipx not runnable after install");throw new f$1("Verify pipx after install",new Error(`${d}
39
+ `,"utf-8"),e$1.debug(`Created .python-version with ${o}`);}catch(n){e$1.warn(`Failed to create .python-version: ${n}`);}}function V(){let n=[...(process.env.PATH||"").split(m.delimiter).filter(Boolean)];for(let r of k$1())n.includes(r)||n.unshift(r);process.env.PATH=n.join(m.delimiter);}async function it(e,o){V(),e.start("Checking pipx installation");try{return await execa("pipx",["--version"]),e.succeed("pipx found"),{kind:"binary"}}catch{}let n=S();try{return await execa(n,["-m","pipx","--version"]),e.succeed("pipx found"),{kind:"python-module",pythonCmd:n}}catch{}if(o)throw new d$3;e.stop?.();let{installPipx:r}=await b$2([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!r)throw new d$3;e.start("Installing pipx (user install)");try{try{await execa(n,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(n,["-m","pip","install","--user","--upgrade","pipx"]);}catch(a){let c=a,d=String(c?.stderr||c?.shortMessage||c?.message||"");throw new f$1("Install pipx with python -m pip",a instanceof Error?a:new Error(d))}e.succeed("pipx installed"),V();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(a){let c=a,d=String(c?.stderr||c?.shortMessage||c?.message||"pipx not runnable after install");throw new f$1("Verify pipx after install",new Error(`${d}
40
40
 
41
41
  Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function O(e,o){return e.kind==="binary"?execa("pipx",o):execa(e.pythonCmd,["-m","pipx",...o])}function Gt(e){let o=e.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function bt(e){if(!e)return null;let o=e.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function ut(e,o){let[n,r]=e.split(".").map(d=>Number(d)),[a,c]=o.split(".").map(d=>Number(d));return n!==a?n-a:r-c}function U(e,o){return ut(e,o)>=0}async function Wt(e){let o=new Set,n=e$2(14,10);for(let s of n)try{let i=await execa(s.command,s.args,{timeout:2500}),f=bt(`${i.stdout||""}
42
42
  ${i.stderr||""}`);f&&U(f,F)&&o.add(f);}catch{}let r=null;try{let s=await execa(S(),["--version"],{timeout:2500}),i=bt(`${s.stdout||""}
@@ -143,7 +143,7 @@ npx rapidkit dev
143
143
  \u2728 Workspace created!
144
144
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i)),console.log(t.cyan(`
145
145
  \u{1F680} Get started:
146
- `)),console.log(t.white(` ${C(i)}`)),u==="go-only"){console.log(t.white(" npx rapidkit create project gofiber.standard my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
146
+ `)),console.log(t.white(` ${k(i)}`)),u==="go-only"){console.log(t.white(" npx rapidkit create project gofiber.standard my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
147
147
  `)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:b}=await execa("go",["version"],{timeout:3e3}),v=b.match(/go version go(\d+\.\d+(?:\.\d+)?)/),M=v?v[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${M} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(t.yellow(`
148
148
  \u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else if(u==="java-only")console.log(t.white(" npx rapidkit create project springboot.standard my-service")),console.log(t.white(" cd my-service")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
149
149
  `)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."));else if(u==="dotnet-only"){console.log(t.white(" npx rapidkit create project dotnet.webapi.clean my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
@@ -199,7 +199,7 @@ npx rapidkit dev
199
199
  \u2728 Workspace created with fallback profile!
200
200
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i)),console.log(t.cyan(`
201
201
  \u{1F680} Get started:
202
- `)),console.log(t.white(` ${C(i)}`)),console.log(t.white(" npx rapidkit create project")),console.log(t.white(" cd <project-name>")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
202
+ `)),console.log(t.white(` ${k(i)}`)),console.log(t.white(" npx rapidkit create project")),console.log(t.white(" cd <project-name>")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
203
203
  `)),console.log(t.cyan(`\u{1F4A1} To use Python later:
204
204
  `)),console.log(t.gray(" 1. Install Python 3.10+")),console.log(t.gray(` 2. Run: rapidkit bootstrap --profile ${b}
205
205
  `)),console.log("");return}catch(Z){throw $.fail("Failed to create workspace"),console.error(t.red(`
@@ -209,15 +209,15 @@ npx rapidkit dev
209
209
  \u2728 Workspace created (auto-fallback profile)!
210
210
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i)),console.log(t.cyan("\u{1F4E6} Profile:"),t.yellow(v)),console.log(t.cyan("\u{1F4A1} Reason:"),t.gray(`Python not detected; switched from ${b}`)),console.log(t.cyan(`
211
211
  \u{1F680} Get started:
212
- `)),console.log(t.white(` ${C(i)}`)),console.log(t.white(" npx rapidkit create project")),console.log(t.white(" cd <project-name>")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
212
+ `)),console.log(t.white(` ${k(i)}`)),console.log(t.white(" npx rapidkit create project")),console.log(t.white(" cd <project-name>")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
213
213
  `)),console.log(t.cyan(`\u{1F4A1} Add Python later:
214
- `)),console.log(t.gray(" 1. Install Python 3.10+")),console.log(t.gray(` 2. Run: ${C(i)} && rapidkit bootstrap --profile ${b}
214
+ `)),console.log(t.gray(" 1. Install Python 3.10+")),console.log(t.gray(` 2. Run: ${k(i)} && rapidkit bootstrap --profile ${b}
215
215
  `)),console.log("");return}catch($){throw j.fail("Failed to create workspace"),console.error(t.red(`
216
216
  \u274C Error:`),$),$}}}}e$1.step(1,3,"Setting up RapidKit environment");let I=c("Creating directory",{component:"create",phase:"workspace.directory"});try{await P.ensureDir(i),I.succeed("Directory created"),I.start("Detecting Python version");let w=null,R=await Mt(x.pythonVersion);if(R)w=await Pt(R),w?(e$1.info(` Detected Python ${w}`),I.succeed(`Python ${w} detected`)):I.warn("Could not detect exact Python version");else {let b=S();w=await Pt(b),w?I.succeed(`Python ${w} detected`):I.warn("Could not detect Python version, proceeding with defaults");}if(x.installMethod==="poetry"&&!await At()&&(I.warn("Poetry not found \u2014 auto-fallback to pip + venv"),x.installMethod="venv"),await B(i,s,x.installMethod,w||void 0),w&&await Lt(i,w),await Q(i,s,x.installMethod,w||x.pythonVersion,u||h),await z(i),await J(i,s),x.installMethod==="poetry")try{await Dt(i,x.pythonVersion,I,r,p,d);}catch(b){let v=b?.details||b?.message||String(b);if(v.includes("pyenv")||v.includes("exit status 127")||v.includes("returned non-zero exit status 127")){I.warn("Poetry encountered Python discovery issues, trying venv method"),e$1.debug(`Poetry error (attempting venv fallback): ${v}`);try{await yt(i,x.pythonVersion,I,r,p),x.installMethod="venv";}catch(j){throw j}}else throw b}else x.installMethod==="venv"?await yt(i,x.pythonVersion,I,r,p):await Kt(i,I,r,p,d);if(await St(i,x.installMethod),await Tt(i,x.installMethod),I.succeed("RapidKit environment ready!"),!o.skipGit){I.start("Initializing git repository");try{await execa("git",["init"],{cwd:i}),await execa("git",["add","."],{cwd:i}),await execa("git",["commit","-m","Initial commit: RapidKit environment"],{cwd:i}),I.succeed("Git repository initialized");}catch{I.warn("Could not initialize git repository");}}if(await H(i,{workspaceName:s,silent:r}),console.log(t.green(`
217
217
  \u2728 RapidKit environment created successfully!
218
218
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i)),console.log(t.cyan("\u2699\uFE0F Configuration:")),console.log(t.gray(` \u2022 Profile: ${u}`)),console.log(t.gray(` \u2022 Python: ${x.pythonVersion}`)),console.log(t.gray(` \u2022 Install method: ${x.installMethod}`)),console.log(t.cyan(`
219
219
  \u{1F680} Get started:
220
- `)),console.log(t.white(` ${C(i)}`)),x.installMethod==="poetry"){let b="source $(poetry env info --path)/bin/activate";try{V();let{stdout:v}=await execa("poetry",["--version"]),M=v.match(/Poetry.*?(\d+)\.(\d+)/);M&&(parseInt(M[1])>=2?b="source $(poetry env info --path)/bin/activate":b="poetry shell");}catch{}console.log(t.white(` ${b} # Or: poetry run rapidkit`)),console.log(t.white(" rapidkit create # Interactive mode")),console.log(t.white(" cd <project-name>")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(t.gray(`
220
+ `)),console.log(t.white(` ${k(i)}`)),x.installMethod==="poetry"){let b="source $(poetry env info --path)/bin/activate";try{V();let{stdout:v}=await execa("poetry",["--version"]),M=v.match(/Poetry.*?(\d+)\.(\d+)/);M&&(parseInt(M[1])>=2?b="source $(poetry env info --path)/bin/activate":b="poetry shell");}catch{}console.log(t.white(` ${b} # Or: poetry run rapidkit`)),console.log(t.white(" rapidkit create # Interactive mode")),console.log(t.white(" cd <project-name>")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(t.gray(`
221
221
  \u{1F4E6} Why Poetry? Includes dependency management + virtual environment`));}else x.installMethod==="venv"?(console.log(t.white(" source .venv/bin/activate # On Windows: .venv\\Scripts\\activate")),console.log(t.white(" rapidkit create # Interactive mode")),console.log(t.white(" cd <project-name>")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(t.gray(`
222
222
  \u{1F4E6} Why venv? Standard, zero extra tools, lightweight`))):(console.log(t.white(" rapidkit create # Interactive mode")),console.log(t.white(" cd <project-name>")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(t.gray(`
223
223
  \u{1F4E6} Why pipx? Global isolated install, no local venv`)));console.log(t.cyan(`
@@ -234,13 +234,13 @@ package-mode = false
234
234
 
235
235
  [tool.poetry]
236
236
  package-mode = false
237
- `),await promises.writeFile(p,f,"utf-8");}n.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:e}),n.succeed("Poetry configured");}catch{n.warn("Could not configure Poetry virtualenvs.in-project");}n.start("Creating virtualenv");let g$1=d||S(),s=f(m.join(e,".venv"));try{await execa(g$1,["-m","venv",".venv"],{cwd:e,timeout:6e4}),n.succeed("Virtualenv created");}catch(i){e$1.debug(`python -m venv failed: ${i}`),n.warn("Could not pre-create virtualenv, Poetry will try"),s=d||S();}try{await execa("poetry",["env","use",s||S()],{cwd:e}),e$1.debug(`Poetry env set to: ${s}`);}catch(i){e$1.debug(`Could not set Poetry env: ${i}`);}if(n.start("Installing RapidKit"),h&&!r){let i=w(a||{}),f=i?await P.pathExists(i):false,u=f&&i?i:"rapidkit-core";i&&!f&&e$1.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${i}. Falling back to PyPI.`),n.text=f?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let E=false,T=null;for(let _=1;_<=3;_++)try{f||d$2({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:_,maxAttempts:3}),await execa(s,["-m","pip","install",u,"--quiet"],{cwd:e,timeout:18e4}),E=true,f||d$2({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:_,maxAttempts:3});break}catch(L){T=L,e$1.debug(`pip install rapidkit-core attempt ${_} failed: ${L}`),_<3&&(n.text=`Retrying installation (attempt ${_+1}/3)`,await new Promise(X=>setTimeout(X,2e3)));}if(!E){let _=T?.stderr||T?.message||"Unknown error";throw e$1.debug(`All pip install attempts failed. Last error: ${_}`),_.includes("Could not find")||_.includes("No matching distribution")?new g:new f$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
237
+ `),await promises.writeFile(p,f,"utf-8");}n.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:e}),n.succeed("Poetry configured");}catch{n.warn("Could not configure Poetry virtualenvs.in-project");}n.start("Creating virtualenv");let g$1=d||S(),s=f(m.join(e,".venv"));try{await execa(g$1,["-m","venv",".venv"],{cwd:e,timeout:6e4}),n.succeed("Virtualenv created");}catch(i){e$1.debug(`python -m venv failed: ${i}`),n.warn("Could not pre-create virtualenv, Poetry will try"),s=d||S();}try{await execa("poetry",["env","use",s||S()],{cwd:e}),e$1.debug(`Poetry env set to: ${s}`);}catch(i){e$1.debug(`Could not set Poetry env: ${i}`);}if(n.start("Installing RapidKit"),h&&!r){let i=e$3(a||{}),f=i?await P.pathExists(i):false,u=f&&i?i:"rapidkit-core";i&&!f&&e$1.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${i}. Falling back to PyPI.`),n.text=f?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let E=false,T=null;for(let _=1;_<=3;_++)try{f||d$2({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:_,maxAttempts:3}),await execa(s,["-m","pip","install",u,"--quiet"],{cwd:e,timeout:18e4}),E=true,f||d$2({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:_,maxAttempts:3});break}catch(L){T=L,e$1.debug(`pip install rapidkit-core attempt ${_} failed: ${L}`),_<3&&(n.text=`Retrying installation (attempt ${_+1}/3)`,await new Promise(X=>setTimeout(X,2e3)));}if(!E){let _=T?.stderr||T?.message||"Unknown error";throw e$1.debug(`All pip install attempts failed. Last error: ${_}`),_.includes("Could not find")||_.includes("No matching distribution")?new g:new f$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
238
238
  Error: ${_}
239
239
 
240
240
  Possible solutions:
241
241
  1. Check your internet connection
242
242
  2. Try installing manually: cd ${m.basename(e)} && poetry add rapidkit-core
243
- 3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}else {n.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:e,timeout:12e4}),n.succeed("Poetry environment synced");}catch(i){e$1.debug(`poetry install --no-root failed: ${i}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),r){let i=w(a||{});if(!i)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));e$1.debug(`Installing from local path: ${i}`),n.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",i],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let i=false,f=null;for(let u=1;u<=3;u++)try{d$2({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:u,maxAttempts:3}),await execa("poetry",["add","rapidkit-core"],{cwd:e,timeout:6e4*u}),i=true,d$2({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:u,maxAttempts:3});break}catch(E){f=E,e$1.debug(`Poetry add attempt ${u} failed: ${E}`),u<3&&(n.text=`Retrying installation (attempt ${u+1}/3)`,await new Promise(T=>setTimeout(T,2e3)));}if(!i){let u=f?.stderr||f?.message||"Unknown error";throw e$1.debug(`All Poetry install attempts failed. Last error: ${u}`),u.includes("Could not find")||u.includes("No matching distribution")?new g:new f$1("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
243
+ 3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}else {n.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:e,timeout:12e4}),n.succeed("Poetry environment synced");}catch(i){e$1.debug(`poetry install --no-root failed: ${i}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),r){let i=e$3(a||{});if(!i)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));e$1.debug(`Installing from local path: ${i}`),n.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",i],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let i=false,f=null;for(let u=1;u<=3;u++)try{d$2({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:u,maxAttempts:3}),await execa("poetry",["add","rapidkit-core"],{cwd:e,timeout:6e4*u}),i=true,d$2({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:u,maxAttempts:3});break}catch(E){f=E,e$1.debug(`Poetry add attempt ${u} failed: ${E}`),u<3&&(n.text=`Retrying installation (attempt ${u+1}/3)`,await new Promise(T=>setTimeout(T,2e3)));}if(!i){let u=f?.stderr||f?.message||"Unknown error";throw e$1.debug(`All Poetry install attempts failed. Last error: ${u}`),u.includes("Could not find")||u.includes("No matching distribution")?new g:new f$1("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
244
244
  Error: ${u}
245
245
 
246
246
  Possible solutions:
@@ -252,14 +252,14 @@ On Debian/Ubuntu systems, install the venv package:
252
252
  sudo apt install ${s}
253
253
 
254
254
  Or use Poetry instead (recommended):
255
- npx rapidkit ${m.basename(e)} --yes`))}throw new f$1("Virtual environment creation",y instanceof Error?y:new Error(String(y)))}n.start("Installing RapidKit");let p=f(m.join(e,".venv"));if(await execa(p,["-m","pip","install","--upgrade","pip"],{cwd:e}),r){let y=w(a||{});if(!y)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));e$1.debug(`Installing from local path: ${y}`),n.text="Installing RapidKit from local path (test mode)",await execa(p,["-m","pip","install","-e",y],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let y=false,h=null;for(let g=1;g<=3;g++)try{d$2({status:"started",message:"Installing RapidKit from PyPI",installMethod:"venv",attempt:g,maxAttempts:3}),await execa(p,["-m","pip","install","rapidkit-core"],{cwd:e,timeout:6e4*g}),y=true,d$2({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"venv",attempt:g,maxAttempts:3});break}catch(s){h=s,e$1.debug(`pip install attempt ${g} failed: ${s}`),g<3&&(n.text=`Retrying installation (attempt ${g+1}/3)`,await new Promise(i=>setTimeout(i,2e3)));}if(!y){let g$1=h?.stderr||h?.message||"Unknown error";throw e$1.debug(`All pip install attempts failed. Last error: ${g$1}`),g$1.includes("Could not find")||g$1.includes("No matching distribution")?new g:new f$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
255
+ npx rapidkit ${m.basename(e)} --yes`))}throw new f$1("Virtual environment creation",y instanceof Error?y:new Error(String(y)))}n.start("Installing RapidKit");let p=f(m.join(e,".venv"));if(await execa(p,["-m","pip","install","--upgrade","pip"],{cwd:e}),r){let y=e$3(a||{});if(!y)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));e$1.debug(`Installing from local path: ${y}`),n.text="Installing RapidKit from local path (test mode)",await execa(p,["-m","pip","install","-e",y],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let y=false,h=null;for(let g=1;g<=3;g++)try{d$2({status:"started",message:"Installing RapidKit from PyPI",installMethod:"venv",attempt:g,maxAttempts:3}),await execa(p,["-m","pip","install","rapidkit-core"],{cwd:e,timeout:6e4*g}),y=true,d$2({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"venv",attempt:g,maxAttempts:3});break}catch(s){h=s,e$1.debug(`pip install attempt ${g} failed: ${s}`),g<3&&(n.text=`Retrying installation (attempt ${g+1}/3)`,await new Promise(i=>setTimeout(i,2e3)));}if(!y){let g$1=h?.stderr||h?.message||"Unknown error";throw e$1.debug(`All pip install attempts failed. Last error: ${g$1}`),g$1.includes("Could not find")||g$1.includes("No matching distribution")?new g:new f$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
256
256
  Error: ${g$1}
257
257
 
258
258
  Possible solutions:
259
259
  1. Check your internet connection
260
260
  2. Try installing manually: cd ${m.basename(e)} && ${f(".venv")} -m pip install rapidkit-core
261
261
  3. Use Poetry instead: npx rapidkit ${m.basename(e)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:y}=await import('./pythonRapidkitExec-MNWRC4F2.js');if(!await y()&&!r){n.start("Checking optional global pipx installation");let g=await it(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await O(g,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(s){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),e$1.debug(`pipx install failed: ${s}`);}}}catch(y){n.succeed("Skipped optional global pipx installation"),e$1.debug(`Global install check skipped: ${y}`);}}async function Kt(e,o,n,r,a=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:d}=await import('./pythonRapidkitExec-MNWRC4F2.js'),p=await d();if(p.isCompatible){o.succeed(`RapidKit ${p.installedVersion??""} already compatible globally; skipping pipx installation`),await P.outputFile(m.join(e,".rapidkit-global"),`RapidKit already available globally (version ${p.installedVersion??"unknown"}) and satisfies expected constraint ${p.expectedConstraint??"n/a"}; workspace will reuse the existing installation
262
- `,"utf-8");return}p.reason==="constraint-missing"?o.warn('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.'):p.reason==="constraint-unsupported"&&o.warn('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$1.debug(`Global RapidKit install is not reusable via version-aware policy (reason=${p.reason}, installed=${p.installedVersion??"unknown"}, expected=${p.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(d){e$1.debug(`Global RapidKit version-aware check failed before pipx install: ${d}`);}let c=await it(o,a);if(o.start("Installing RapidKit globally with pipx"),n){let d=w(r||{});if(!d)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));e$1.debug(`Installing from local path: ${d}`),o.text="Installing RapidKit from local path (test mode)",await O(c,["install","-e",d]);}else {o.text="Installing RapidKit from PyPI",d$2({status:"started",message:"Installing RapidKit from PyPI",installMethod:"pipx"});try{await O(c,["install","rapidkit-core"]),d$2({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"pipx"});}catch(d){try{o.text="RapidKit already installed globally, upgrading to match expected version",await O(c,["upgrade","rapidkit-core"]),d$2({status:"succeeded",message:"RapidKit upgraded from PyPI",installMethod:"pipx"});}catch(p){throw e$1.debug(`pipx install/upgrade failed: install=${d}, upgrade=${p}`),new g}}}o.succeed("RapidKit installed globally"),await P.outputFile(m.join(e,".rapidkit-global"),`RapidKit installed globally with pipx
262
+ `,"utf-8");return}p.reason==="constraint-missing"?o.warn('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.'):p.reason==="constraint-unsupported"&&o.warn('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$1.debug(`Global RapidKit install is not reusable via version-aware policy (reason=${p.reason}, installed=${p.installedVersion??"unknown"}, expected=${p.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(d){e$1.debug(`Global RapidKit version-aware check failed before pipx install: ${d}`);}let c=await it(o,a);if(o.start("Installing RapidKit globally with pipx"),n){let d=e$3(r||{});if(!d)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));e$1.debug(`Installing from local path: ${d}`),o.text="Installing RapidKit from local path (test mode)",await O(c,["install","-e",d]);}else {o.text="Installing RapidKit from PyPI",d$2({status:"started",message:"Installing RapidKit from PyPI",installMethod:"pipx"});try{await O(c,["install","rapidkit-core"]),d$2({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"pipx"});}catch(d){try{o.text="RapidKit already installed globally, upgrading to match expected version",await O(c,["upgrade","rapidkit-core"]),d$2({status:"succeeded",message:"RapidKit upgraded from PyPI",installMethod:"pipx"});}catch(p){throw e$1.debug(`pipx install/upgrade failed: install=${d}, upgrade=${p}`),new g}}}o.succeed("RapidKit installed globally"),await P.outputFile(m.join(e,".rapidkit-global"),`RapidKit installed globally with pipx
263
263
  `,"utf-8");}async function be(e,o){let{skipGit:n=false,testMode:r=false,userConfig:a={},yes:c$1=false,installMethod:d,pythonVersion:p="3.10"}=o||{},y=d||a.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return e$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),h=y==="poetry"&&!await At()?"venv":y;await B(e,m.basename(e),h),await z(e),await Q(e,m.basename(e),h,p,o?.profile);let g=c("Registering workspace",{component:"create",phase:"workspace.register"});try{if(h==="poetry"?(await J(e,m.basename(e)),await Dt(e,p,g,r,a,c$1)):h==="venv"?await yt(e,p,g,r,a):await Kt(e,g,r,a,c$1),await St(e,h),await Tt(e,h),g.succeed("Workspace registered"),await H(e,{workspaceName:m.basename(e),silent:r}),!n){g.start("Initializing git repository");try{await execa("git",["init"],{cwd:e}),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:e}),g.succeed("Git repository initialized");}catch{g.warn("Could not initialize git repository");}}}catch(s){throw g.fail("Failed to register workspace"),s}}async function Tt(e,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
264
264
  # Or simply use: poetry run rapidkit <command>`:o==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)",r=o==="poetry"?`# No activation needed (recommended):
265
265
  ./rapidkit --help
@@ -870,14 +870,14 @@ __pycache__/
870
870
  `,"utf-8"),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:e}),r.succeed("Git repository initialized");}catch{r.warn("Could not initialize git repository");}}console.log(t.green(`
871
871
  \u2728 Demo workspace created successfully!
872
872
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(e)),console.log(t.cyan(`\u{1F680} Get started:
873
- `)),console.log(t.white(` ${C(e)}`)),console.log(t.white(" node generate-demo.js my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(),console.log(t.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For full RapidKit features:"),console.log(t.cyan(" pipx install rapidkit")),console.log();}catch(a){throw r.fail("Failed to create demo workspace"),a}}async function Jt(e,o,n,r,a,c,d){if(console.log(t.cyan(`
873
+ `)),console.log(t.white(` ${k(e)}`)),console.log(t.white(" node generate-demo.js my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(),console.log(t.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For full RapidKit features:"),console.log(t.cyan(" pipx install rapidkit")),console.log();}catch(a){throw r.fail("Failed to create demo workspace"),a}}async function Jt(e,o,n,r,a,c,d){if(console.log(t.cyan(`
874
874
  \u{1F50D} Dry-run mode - what would be created:
875
875
  `)),console.log(t.white("\u{1F4C2} Workspace path:"),e),console.log(t.white("\u{1F4DB} Name:"),t.cyan(o)),n)console.log(t.white("\u{1F4E6} Type:"),"Demo environment"),console.log(t.white(`
876
876
  \u{1F4DD} Files to create:`)),console.log(t.gray(" - package.json")),console.log(t.gray(" - generate-demo.js (project generator)")),console.log(t.gray(" - README.md")),console.log(t.gray(" - .gitignore")),console.log(t.white(`
877
877
  \u{1F3AF} Capabilities:`)),console.log(t.gray(" - Generate FastAPI/NestJS demo projects")),console.log(t.gray(" - No Python RapidKit installation required")),console.log(t.gray(" - Bundled templates"));else {let p=a||"minimal",y=c,h=d,s=new Set(["python-only","polyglot","enterprise"]).has(p);console.log(t.white("\u{1F4E6} Profile:"),t.cyan(p)),console.log(t.white("\u{1F4DD} Configuration:")),s?(console.log(t.gray(` - Python version: ${h}`)),console.log(t.gray(` - Install method: ${y}`)),console.log(t.gray(` - Git init: ${r.skipGit?"No":"Yes"}`))):(console.log(t.gray(" - Python-free profile (no Python needed)")),console.log(t.gray(` - Git init: ${r.skipGit?"No":"Yes"}`))),console.log(t.white(`
878
878
  \u{1F4CB} Files to create:`)),console.log(t.gray(" - .rapidkit-workspace (workspace marker)")),console.log(t.gray(" - .rapidkit/ (workspace config directory)")),console.log(t.gray(" - README.md")),console.log(t.gray(" - .gitignore")),s&&console.log(t.gray(` - ${y==="poetry"?"pyproject.toml + poetry.lock":".venv/ (virtual environment)"}`)),console.log(t.white(`
879
879
  \u2699\uFE0F Environment setup:`)),s&&console.log(y==="poetry"?t.gray(" - Poetry virtual environment created (recommended, includes dependency management)"):y==="venv"?t.gray(" - Python venv created in .venv/ (standard, zero extra tools)"):t.gray(" - Global pipx install (isolated, not local to workspace)")),console.log(t.white(`
880
- \u{1F680} Next steps:`)),console.log(t.gray(` 1. ${C(e)}`)),console.log(t.gray(" 2. npx rapidkit create project")),console.log(t.gray(" 3. npx rapidkit init")),console.log(t.gray(" 4. npx rapidkit dev")),console.log(t.white(`
880
+ \u{1F680} Next steps:`)),console.log(t.gray(` 1. ${k(e)}`)),console.log(t.gray(" 2. npx rapidkit create project")),console.log(t.gray(" 3. npx rapidkit init")),console.log(t.gray(" 4. npx rapidkit dev")),console.log(t.white(`
881
881
  \u{1F4A1} Learn more:`)),console.log(t.gray(" \u2022 Change profile later: rapidkit bootstrap --profile <profile>")),console.log(t.gray(" \u2022 Profile options: minimal|java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")),console.log(t.gray(" \u2022 Help: npx rapidkit --help"));}console.log(t.white(`
882
882
  \u2728 To proceed: remove --dry-run flag
883
883
  `));}export{xt as a,ke as b,jt as c,Vt as d,St as e,Pe as f,be as g};
@@ -0,0 +1 @@
1
+ import {c,a as a$4}from'./chunk-2ED6SPXP.js';import {a}from'./chunk-RV6HBTFC.js';import {a as a$3,q as q$1,k as k$1}from'./chunk-YBS2HGO3.js';import {i,h}from'./chunk-UZW5QFRW.js';import {a as a$2}from'./chunk-VKLL63TL.js';import {a as a$1}from'./chunk-HHJAANUC.js';import l from'path';import f from'fs-extra';var K="workspace-model.v1",L=".rapidkit/reports/workspace-model.json",q=["package.json","pyproject.toml","requirements.txt","go.mod","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","mix.exs","deno.json","deno.jsonc","bun.lock","bun.lockb","deps.edn","project.clj","build.sbt","docker-compose.yml","docker-compose.yaml","terraform.tf"],z=new Set([".git",".hg",".svn",".rapidkit",".venv","node_modules","dist","build","target","coverage","htmlcov",".next",".turbo"]);function N(t,e){return (l.relative(t,e)||".").split(l.sep).join("/")}async function $(t){try{if(!await f.pathExists(t))return null;let e=await f.readJSON(t);return e&&typeof e=="object"?e:null}catch{return null}}async function H(t,e){for(let r of e)if(await f.pathExists(l.join(t,r)))return true;return false}function J(t){let e=Number.parseInt(process.env.RAPIDKIT_WORKSPACE_MODEL_SCAN_DEPTH??"",10),r=typeof t=="number"&&Number.isFinite(t)?t:Number.isFinite(e)?e:4;return Math.min(12,Math.max(1,Math.trunc(r)))}async function G(t,e){let r=l.resolve(t),n=[{dirPath:r,depth:0}],s=new Set,o=new Set;for(;n.length>0;){let i=n.shift();if(!i)continue;let a=l.resolve(i.dirPath);if(o.has(a))continue;if(o.add(a),a!==r&&await H(a,q)){s.add(a);continue}if(i.depth>=e)continue;let g=[];try{g=await f.readdir(a,{withFileTypes:true});}catch{continue}for(let m of g)!m.isDirectory()||z.has(m.name)||m.name.startsWith(".")&&m.name!==".config"||n.push({dirPath:l.join(a,m.name),depth:i.depth+1});}return Array.from(s).sort((i,a)=>i.localeCompare(a))}function U(t){let e=new Set,r=[];for(let n of t){let s=l.resolve(n);e.has(s)||(e.add(s),r.push(s));}return r.sort((n,s)=>n.localeCompare(s))}function _(t,e){let r=t?.[e];return typeof r=="string"&&r.trim()?r.trim():void 0}function Q(t,e){return t?.[e]===true}function X(t,e,r){let n=t?.frontend&&typeof t.frontend=="object"&&!Array.isArray(t.frontend)?t.frontend:void 0,s=_(n,"generator"),o=_(n,"command_display"),i=typeof e=="string"&&e.startsWith("frontend.");if(!(!s&&!i))return {...s?{id:s}:{},...e?{kit:e}:{},displayName:r,source:Q(n,"official_generator")?"official-generator":"metadata",...o?{commandDisplay:o}:{}}}async function Y(t){let e=[".rapidkit/project.json",".rapidkit/context.json","package.json","pyproject.toml","requirements.txt","go.mod","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","mix.exs","deno.json","Dockerfile","docker-compose.yml","README.md"],r=[];for(let n of e)await f.pathExists(l.join(t,n))&&r.push(n);return r}async function k(t,e,r){let n=l.join(t,e),s=await f.pathExists(n),o={path:e.split(l.sep).join("/"),exists:s};if(s&&r){let i=await $(n);typeof i?.generatedAt=="string"&&(o.generatedAt=i.generatedAt);let a=i?.status??i?.result??i?.verdict;typeof a=="string"&&(o.status=a);}return o}async function Z(t,e,r){let s=`${N(t,e)}/.rapidkit/reports`,o=await k(t,`${s}/doctor-project-last-run.json`,r);return {doctor:o?.exists===true?o:await k(t,`${s}/doctor-last-run.json`,r),analyze:await k(t,`${s}/analyze-last-run.json`,r),readiness:await k(t,`${s}/release-readiness-last-run.json`,r)}}async function ee(t,e,r){let n=a$3(e),s=i(e,n),o=q$1(e),i$1=k$1(s.runtime),a=await c(e,n),g=typeof n?.name=="string"&&n.name.trim()?n.name.trim():l.basename(e),m=typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0,y=typeof n?.engine=="string"?n.engine:o.engine!=="unknown"?o.engine:void 0,c$1=X(n,m,s.displayName),p=a$4({kitId:m,framework:s.key,runtime:s.runtime});return {name:g,path:N(t,e),...r.includeAbsolutePaths?{absolutePath:e}:{},kind:a,runtime:s.runtime,runtimeCandidates:h(e),framework:s.key,frameworkDisplayName:s.displayName,confidence:s.confidence,detectionSource:s.source,supportTier:s.supportTier,runtimeSupportTier:i$1.tier,runtimeDoctorSupport:i$1.doctorSupport,moduleSupport:o.moduleSupport,...m?{kit:m}:{},...y?{engine:y}:{},...c$1?{generator:c$1}:{},createCapability:p,commands:{supported:o.supportedCommands,unsupported:o.unsupportedCommands,global:o.globalCommands,fleetStages:o.fleetStages,localOnly:o.localOnlyCommands,map:o.commandMap},importantFiles:await Y(e),evidence:await Z(t,e,r.includeEvidence),provenance:{path:"filesystem discovery",runtime:s.source,framework:s.source,commands:"project command capability matrix",createCapability:"create planner capability contract",evidence:"project .rapidkit/reports"}}}async function te(t){return $(l.join(t,".rapidkit","workspace.json"))}function oe(t){return t.some(e=>e.kind==="frontend")&&t.length>1?"full-stack-workspace":t.some(e=>e.kind==="frontend")?"frontend-workspace":t.length>1?"backend-platform":"backend-workspace"}function re(t){let e=new Set;for(let r of t){let n=`${r.name} ${r.path}`.toLowerCase();for(let s of ["auth","billing","payment","notification","order","admin","report","search","analytics"])n.includes(s)&&e.add(s);}return Array.from(e).sort()}function u(t,e,r,n){return {severity:t,code:e,message:r,target:n}}function B(t){let e=[];t.workspace.name.trim()||e.push(u("error","workspace.name.missing","Workspace name could not be resolved.","workspace")),t.workspace.type==="observed-workspace"&&e.push(u("warning","workspace.marker.missing","Workspace marker is missing; model is based on filesystem observation.","workspace.marker")),t.summary.projectCount===0&&e.push(u("warning","workspace.projects.empty","No project roots were detected in this workspace.","projects")),t.contracts.exists||e.push(u("warning","workspace.contract.missing","Workspace contract is missing; dependency and API edges may be incomplete.",t.contracts.workspaceContractPath));let r=new Map;for(let o of t.projects){let i=o.name.toLowerCase(),a=r.get(i)??[];a.push(o),r.set(i,a),o.importantFiles.length||e.push(u("warning","project.markers.missing",`Project ${o.name} has no important manifest files recorded.`,o.path)),o.runtime==="unknown"&&e.push(u("warning","project.runtime.unknown",`Project ${o.name} runtime could not be confidently detected.`,o.path));let g=["test","build"];for(let c of g)o.commands.supported.includes(c)&&o.commands.unsupported.includes(c)&&e.push(u("error","project.commands.conflict",`Project ${o.name} marks ${c} as both supported and unsupported.`,o.path));let m=new Set(o.commands.fleetStages),y=new Set(o.commands.localOnly);for(let c of o.commands.fleetStages){y.has(c)&&e.push(u("error","project.commands.scope-conflict",`Project ${o.name} marks ${c} as both fleet and local-only.`,o.path));let p=o.commands.map[c];(!p||p.status!=="supported"||p.fleetEligible!==true||p.executionScope!=="fleet")&&e.push(u("error","project.commands.fleet-stage-invalid",`Project ${o.name} advertises ${c} as a fleet stage without a supported fleet capability.`,o.path));}for(let c of o.commands.localOnly){let p=o.commands.map[c];(!p||p.status!=="supported"||p.executionScope!=="local-only"||p.fleetEligible===true)&&e.push(u("error","project.commands.local-only-invalid",`Project ${o.name} advertises ${c} as local-only without a matching local-only capability.`,o.path));}for(let c of Object.values(o.commands.map))c.status==="supported"&&(c.fleetEligible===true&&!m.has(c.command)&&e.push(u("error","project.commands.fleet-stage-missing",`Project ${o.name} capability ${c.command} is fleet-eligible but missing from fleetStages.`,o.path)),c.executionScope==="local-only"&&c.fleetEligible!==true&&!y.has(c.command)&&e.push(u("error","project.commands.local-only-missing",`Project ${o.name} capability ${c.command} is local-only but missing from localOnly commands.`,o.path)));}for(let[o,i]of r.entries())i.length>1&&e.push(u("error","project.name.duplicate",`Project name "${o}" is ambiguous across ${i.length} project roots.`,i.map(a=>a.path).join(", ")));let n=e.filter(o=>o.severity==="error").length,s=e.filter(o=>o.severity==="warning").length;return {status:n>0?"failed":s>0?"warning":"passed",errors:n,warnings:s,issues:e}}function ye(t){return B(t)}async function be(t){let e=l.resolve(t.workspacePath),r=t.includeAbsolutePaths===true,n=t.includeEvidence===true,s=J(t.observableScanDepth),o=t.now??new Date,[i,a$3,g,m,y]=await Promise.all([a(e),te(e),a$1(e),a$2(e,{descendIntoMatchedProjects:false}),G(e,s)]),c=U([...m,...y,...g.map(d=>l.isAbsolute(d.path)?d.path:l.join(e,d.path))]),p=await Promise.all(c.map(d=>ee(e,d,{includeAbsolutePaths:r,includeEvidence:n}))),F=typeof a$3?.workspace_name=="string"?a$3.workspace_name:typeof a$3?.name=="string"?a$3.name:i?.name||l.basename(e),b=typeof a$3?.profile=="string"?a$3.profile:typeof a$3?.mode=="string"?a$3.mode:void 0,I=Array.from(new Set(p.map(d=>d.kind))).sort(),w=Array.from(new Set(p.map(d=>d.runtime))).sort(),T=Array.from(new Set(p.map(d=>d.framework))).sort(),h=[".rapidkit/policies.yml",".rapidkit/policies.yaml"].find(d=>f.existsSync(l.join(e,d))),j=".rapidkit/workspace.contract.json",v=await f.pathExists(l.join(e,j)),P={schemaVersion:K,generatedAt:o.toISOString(),workspace:{name:F,root:e,...b?{profile:b}:{},type:i?"rapidkit-workspace":"observed-workspace",...i?{marker:{createdBy:i.createdBy,version:i.version,createdAt:i.createdAt}}:{}},identity:{workspaceType:oe(p),surfaces:I,runtimeFamilies:w,businessCapabilities:re(p)},discovery:{observableScanDepth:s},projects:p,policies:{mode:typeof a$3?.policy_mode=="string"?a$3.policy_mode:typeof a$3?.policyMode=="string"?a$3.policyMode:"warn",source:h??null,exists:!!h},contracts:{workspaceContractPath:j,exists:v,status:v?"known":"missing"},evidence:{doctor:await k(e,".rapidkit/reports/doctor-last-run.json",n),analyze:await k(e,".rapidkit/reports/analyze-last-run.json",n),readiness:await k(e,".rapidkit/reports/release-readiness-last-run.json",n),pipeline:await k(e,".rapidkit/reports/pipeline-last-run.json",n)},summary:{projectCount:p.length,runtimes:w,frameworks:T,firstClassProjects:p.filter(d=>d.supportTier==="first-class").length,observedProjects:p.filter(d=>d.supportTier==="observed").length}},V=B(P);return {...P,validation:V}}async function we(t,e){let r=l.join(e,L);return await f.ensureDir(l.dirname(r)),await f.writeJSON(r,t,{spaces:2}),r}export{K as a,L as b,ye as c,be as d,we as e};
@@ -1 +1 @@
1
- export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-IOIWVHRO.js';
1
+ export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-TVIOAZ6E.js';