rapidkit 0.31.0 → 0.32.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.
@@ -1,13 +1,13 @@
1
- import {i,d as d$2,l,k as k$1,f as f$1,g,h}from'./chunk-7OGOVP5U.js';import {a,d,b as b$1}from'./chunk-RV6HBTFC.js';import {a as a$2,e,d as d$1,f,c,k as k$2}from'./chunk-Z5LKRG57.js';import {b}from'./chunk-AC6KIKII.js';import {a as a$1}from'./chunk-VM2TOHNX.js';import {promises}from'fs';import*as k from'fs-extra';import m from'path';import q from'inquirer';import t from'chalk';import O from'ora';import {execa}from'execa';function S(){return c()}async function z(e,n,o,r){let l=d(n,b(),o);r&&(l.metadata||(l.metadata={}),l.metadata.python={version:r}),await b$1(e,l);}async function V(e){await k.outputFile(m.join(e,".gitignore"),`.venv/
1
+ import {i,d as d$2,l,k as k$1,f as f$1,g,h}from'./chunk-7OGOVP5U.js';import {a as a$2,e,d as d$1,f,c,k as k$2}from'./chunk-Z5LKRG57.js';import {b}from'./chunk-AC6KIKII.js';import {a as a$1}from'./chunk-VM2TOHNX.js';import {a,d,b as b$1}from'./chunk-RV6HBTFC.js';import {promises}from'fs';import*as k from'fs-extra';import m from'path';import q from'inquirer';import t from'chalk';import O from'ora';import {execa}from'execa';function S(){return c()}async function z(e,o,n,r){let l=d(o,b(),n);r&&(l.metadata||(l.metadata={}),l.metadata.python={version:r}),await b$1(e,l);}async function V(e){await k.outputFile(m.join(e,".gitignore"),`.venv/
2
2
  __pycache__/
3
3
  *.pyc
4
4
  .env
5
5
  .rapidkit-workspace/
6
6
 
7
- `,"utf-8");}async function U(e,n){let o=n.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await k.outputFile(m.join(e,"poetry.toml"),`[virtualenvs]
7
+ `,"utf-8");}async function U(e,o){let n=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await k.outputFile(m.join(e,"poetry.toml"),`[virtualenvs]
8
8
  in-project = true
9
9
  `,"utf-8"),await k.outputFile(m.join(e,"pyproject.toml"),`[tool.poetry]
10
- name = "${o}"
10
+ name = "${n}"
11
11
  version = "0.1.0"
12
12
  description = "RapidKit workspace"
13
13
  authors = []
@@ -20,7 +20,7 @@ rapidkit-core = "*"
20
20
  [build-system]
21
21
  requires = ["poetry-core"]
22
22
  build-backend = "poetry.core.masonry.api"
23
- `,"utf-8");}function ht(e,n,o,r){return JSON.stringify({schema_version:"1.0",workspace_name:e,rapidkit_version:b(),created_at:new Date().toISOString(),created_by:"rapidkit-npm",profile:r||"minimal",engine:{install_method:n,python_version:o||null}},null,2)}function ft(e,n,o,r){return JSON.stringify({schema_version:"1.0",generated_by:"rapidkit-npm",generated_at:new Date().toISOString(),runtime:{python:{version:n||null,install_method:e},node:{version:o||process.version},go:{version:r||null},java:{version:null,build_tool:null,build_tool_version:null}}},null,2)}function wt(){return `version: "1.0"
23
+ `,"utf-8");}function ht(e,o,n,r){return JSON.stringify({schema_version:"1.0",workspace_name:e,rapidkit_version:b(),created_at:new Date().toISOString(),created_by:"rapidkit-npm",profile:r||"minimal",engine:{install_method:o,python_version:n||null}},null,2)}function ft(e,o,n,r,l){return JSON.stringify({schema_version:"1.0",generated_by:"rapidkit-npm",generated_at:new Date().toISOString(),runtime:{python:{version:o||null,install_method:e},node:{version:n||process.version},go:{version:r||null},java:{version:null,build_tool:null,build_tool_version:null},dotnet:{version:l||null,sdk:l||null}}},null,2)}function wt(){return `version: "1.0"
24
24
  mode: warn # "warn" or "strict"
25
25
  dependency_sharing_mode: isolated # "isolated" or "shared-runtime-caches" or "shared-node-deps"
26
26
  # change profile (recommended): npx rapidkit bootstrap --profile polyglot
@@ -35,14 +35,14 @@ cache:
35
35
  prune_on_bootstrap: false
36
36
  self_heal: true
37
37
  verify_integrity: false
38
- `}async function Y(e,n,o,r,l){let p;try{let{stdout:u}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),y=u.match(/go(\d+\.\d+(?:\.\d+)?)/i);p=y?y[1]:void 0;}catch{}await k.outputFile(m.join(e,".rapidkit","workspace.json"),ht(n,o,r,l),"utf-8"),await k.outputFile(m.join(e,".rapidkit","toolchain.lock"),ft(o,r,process.version,p),"utf-8"),await k.outputFile(m.join(e,".rapidkit","policies.yml"),wt(),"utf-8"),await k.outputFile(m.join(e,".rapidkit","cache-config.yml"),vt(),"utf-8");}async function ae(e,n){let{workspaceName:o=m.basename(e),installMethod:r="venv",pythonVersion:l,profile:p,writeMarker:u=true,writeGitignore:y=true,onlyIfMissing:g=true}=n||{},h=[],a$1;try{let{stdout:c}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),d=c.match(/go(\d+\.\d+(?:\.\d+)?)/i);a$1=d?d[1]:void 0;}catch{}let i=[{relPath:m.join(".rapidkit","workspace.json"),content:ht(o,r,l,p)},{relPath:m.join(".rapidkit","toolchain.lock"),content:ft(r,l,process.version,a$1)},{relPath:m.join(".rapidkit","policies.yml"),content:wt()},{relPath:m.join(".rapidkit","cache-config.yml"),content:vt()}];for(let c of i){let d=m.join(e,c.relPath);g&&await k.pathExists(d)||(await k.outputFile(d,c.content,"utf-8"),h.push(c.relPath));}if(u&&(!!!await a(e)||!g)){let d$1=d(o,b(),r);l&&(d$1.metadata||(d$1.metadata={}),d$1.metadata.python={version:l}),await b$1(e,d$1),h.push(".rapidkit-workspace");}if(y){let c=m.join(e,".gitignore");(!g||!await k.pathExists(c))&&(await V(e),h.push(".gitignore"));}return h}var F="3.10",kt=["3.10","3.11","3.12"];async function gt(e){try{let{stdout:n}=await execa(e,["--version"],{timeout:3e3}),o=n.match(/Python (\d+\.\d+\.\d+)/);if(o)return o[1]}catch{}return null}async function St(e,n){try{await promises.writeFile(m.join(e,".python-version"),`${n}
39
- `,"utf-8"),a$1.debug(`Created .python-version with ${n}`);}catch(o){a$1.warn(`Failed to create .python-version: ${o}`);}}function N(){let o=[...(process.env.PATH||"").split(m.delimiter).filter(Boolean)];for(let r of k$2())o.includes(r)||o.unshift(r);process.env.PATH=o.join(m.delimiter);}async function tt(e,n){N(),e.start("Checking pipx installation");try{return await execa("pipx",["--version"]),e.succeed("pipx found"),{kind:"binary"}}catch{}let o=S();try{return await execa(o,["-m","pipx","--version"]),e.succeed("pipx found"),{kind:"python-module",pythonCmd:o}}catch{}if(n)throw new h;e.stop?.();let{installPipx:r}=await q.prompt([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!r)throw new h;e.start("Installing pipx (user install)");try{try{await execa(o,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(o,["-m","pip","install","--user","--upgrade","pipx"]);}catch(l){let p=l,u=String(p?.stderr||p?.shortMessage||p?.message||"");throw new k$1("Install pipx with python -m pip",l instanceof Error?l:new Error(u))}e.succeed("pipx installed"),N();try{return await execa(o,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:o}}catch(l){let p=l,u=String(p?.stderr||p?.shortMessage||p?.message||"pipx not runnable after install");throw new k$1("Verify pipx after install",new Error(`${u}
38
+ `}async function kt(){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 Pt(){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 Y(e,o,n,r,l){let[p,c]=await Promise.all([kt(),Pt()]);await k.outputFile(m.join(e,".rapidkit","workspace.json"),ht(o,n,r,l),"utf-8"),await k.outputFile(m.join(e,".rapidkit","toolchain.lock"),ft(n,r,process.version,p,c),"utf-8"),await k.outputFile(m.join(e,".rapidkit","policies.yml"),wt(),"utf-8"),await k.outputFile(m.join(e,".rapidkit","cache-config.yml"),vt(),"utf-8");}async function se(e,o){let{workspaceName:n=m.basename(e),installMethod:r="venv",pythonVersion:l,profile:p,writeMarker:c=true,writeGitignore:u=true,onlyIfMissing:g=true}=o||{},h=[],[a$1,i]=await Promise.all([kt(),Pt()]),y=[{relPath:m.join(".rapidkit","workspace.json"),content:ht(n,r,l,p)},{relPath:m.join(".rapidkit","toolchain.lock"),content:ft(r,l,process.version,a$1,i)},{relPath:m.join(".rapidkit","policies.yml"),content:wt()},{relPath:m.join(".rapidkit","cache-config.yml"),content:vt()}];for(let d of y){let P=m.join(e,d.relPath);g&&await k.pathExists(P)||(await k.outputFile(P,d.content,"utf-8"),h.push(d.relPath));}if(c&&(!!!await a(e)||!g)){let P=d(n,b(),r);l&&(P.metadata||(P.metadata={}),P.metadata.python={version:l}),await b$1(e,P),h.push(".rapidkit-workspace");}if(u){let d=m.join(e,".gitignore");(!g||!await k.pathExists(d))&&(await V(e),h.push(".gitignore"));}return h}var K="3.10",bt=["3.10","3.11","3.12"];async function gt(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 Mt(e,o){try{await promises.writeFile(m.join(e,".python-version"),`${o}
39
+ `,"utf-8"),a$1.debug(`Created .python-version with ${o}`);}catch(n){a$1.warn(`Failed to create .python-version: ${n}`);}}function F(){let n=[...(process.env.PATH||"").split(m.delimiter).filter(Boolean)];for(let r of k$2())n.includes(r)||n.unshift(r);process.env.PATH=n.join(m.delimiter);}async function tt(e,o){F(),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 h;e.stop?.();let{installPipx:r}=await q.prompt([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!r)throw new h;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(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"");throw new k$1("Install pipx with python -m pip",l instanceof Error?l:new Error(c))}e.succeed("pipx installed"),F();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"pipx not runnable after install");throw new k$1("Verify pipx after install",new Error(`${c}
40
40
 
41
- Try reopening your terminal or run: ${o} -m pipx ensurepath`))}}async function T(e,n){return e.kind==="binary"?execa("pipx",n):execa(e.pythonCmd,["-m","pipx",...n])}function At(e){let n=e.match(/^(\d+)\.(\d+)/);return n?`${n[1]}.${n[2]}`:null}function mt(e){if(!e)return null;let n=e.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return n?`${n[1]}.${n[2]}`:null}function lt(e,n){let[o,r]=e.split(".").map(u=>Number(u)),[l,p]=n.split(".").map(u=>Number(u));return o!==l?o-l:r-p}function G(e,n){return lt(e,n)>=0}async function Mt(e$1){let n=new Set,o=e(14,10);for(let i of o)try{let c=await execa(i.command,i.args,{timeout:2500}),d=mt(`${c.stdout||""}
42
- ${c.stderr||""}`);d&&G(d,F)&&n.add(d);}catch{}let r=null;try{let i=await execa(S(),["--version"],{timeout:2500}),c=mt(`${i.stdout||""}
43
- ${i.stderr||""}`);c&&G(c,F)&&(r=c,n.add(c));}catch{}let l=kt.filter(i=>G(i,F)),p=new Set([...l,...n]),u=Array.from(p).sort((i,c)=>lt(c,i)),y=e$1?At(e$1):null,g=y&&G(y,F)?y:r||u[0]||F;return p.has(g)||p.add(g),{choices:Array.from(p).sort((i,c)=>lt(c,i)).map(i=>{let c=[];return i===r&&c.push("current system"),i===F&&c.push("minimum supported"),n.has(i)&&i!==r&&c.push("detected"),{name:c.length>0?`${i} (${c.join(", ")})`:i,value:i}}),defaultValue:g}}async function Dt(){N();let e=false,n=false;try{await execa("poetry",["--version"],{timeout:2500}),e=true;}catch{e=false;}try{await execa("pipx",["--version"],{timeout:2500}),n=true;}catch{let o=c();try{await execa(o,["-m","pipx","--version"],{timeout:2500}),n=true;}catch{n=false;}}return {poetry:e,pipx:n}}async function bt(){N();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function Kt(e,n){return e==="poetry"&&n.poetry?"poetry":e==="pipx"&&n.pipx?"pipx":e==="venv"?"venv":n.poetry?"poetry":"venv"}async function Ft(e,n){N(),e.start("Checking Poetry installation");try{await execa("poetry",["--version"]),e.succeed("Poetry found");return}catch{}if(n)throw new g;let{installPoetry:o}=await q.prompt([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!o)throw new g;let r=await tt(e,n);e.start("Installing Poetry with pipx");try{await T(r,["install","poetry"]);}catch(l){let p=l,u=String(p?.stderr||p?.shortMessage||p?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(u))try{await T(r,["upgrade","poetry"]);}catch{}else throw new k$1("Install Poetry with pipx",l instanceof Error?l:new Error(u))}e.succeed("Poetry installed"),N();try{await execa("poetry",["--version"]);}catch(l){let p=l,u=String(p?.stderr||p?.shortMessage||p?.message||"Poetry not found on PATH");throw new k$1("Verify Poetry after pipx install",new Error(`${u}
41
+ Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function N(e,o){return e.kind==="binary"?execa("pipx",o):execa(e.pythonCmd,["-m","pipx",...o])}function Tt(e){let o=e.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function mt(e){if(!e)return null;let o=e.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function lt(e,o){let[n,r]=e.split(".").map(c=>Number(c)),[l,p]=o.split(".").map(c=>Number(c));return n!==l?n-l:r-p}function G(e,o){return lt(e,o)>=0}async function Dt(e$1){let o=new Set,n=e(14,10);for(let i of n)try{let y=await execa(i.command,i.args,{timeout:2500}),d=mt(`${y.stdout||""}
42
+ ${y.stderr||""}`);d&&G(d,K)&&o.add(d);}catch{}let r=null;try{let i=await execa(S(),["--version"],{timeout:2500}),y=mt(`${i.stdout||""}
43
+ ${i.stderr||""}`);y&&G(y,K)&&(r=y,o.add(y));}catch{}let l=bt.filter(i=>G(i,K)),p=new Set([...l,...o]),c=Array.from(p).sort((i,y)=>lt(y,i)),u=e$1?Tt(e$1):null,g=u&&G(u,K)?u:r||c[0]||K;return p.has(g)||p.add(g),{choices:Array.from(p).sort((i,y)=>lt(y,i)).map(i=>{let y=[];return i===r&&y.push("current system"),i===K&&y.push("minimum supported"),o.has(i)&&i!==r&&y.push("detected"),{name:y.length>0?`${i} (${y.join(", ")})`:i,value:i}}),defaultValue:g}}async function Kt(){F();let e=false,o=false;try{await execa("poetry",["--version"],{timeout:2500}),e=true;}catch{e=false;}try{await execa("pipx",["--version"],{timeout:2500}),o=true;}catch{let n=c();try{await execa(n,["-m","pipx","--version"],{timeout:2500}),o=true;}catch{o=false;}}return {poetry:e,pipx:o}}async function xt(){F();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function Nt(e,o){return e==="poetry"&&o.poetry?"poetry":e==="pipx"&&o.pipx?"pipx":e==="venv"?"venv":o.poetry?"poetry":"venv"}async function Ft(e,o){F(),e.start("Checking Poetry installation");try{await execa("poetry",["--version"]),e.succeed("Poetry found");return}catch{}if(o)throw new g;let{installPoetry:n}=await q.prompt([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!n)throw new g;let r=await tt(e,o);e.start("Installing Poetry with pipx");try{await N(r,["install","poetry"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(c))try{await N(r,["upgrade","poetry"]);}catch{}else throw new k$1("Install Poetry with pipx",l instanceof Error?l:new Error(c))}e.succeed("Poetry installed"),F();try{await execa("poetry",["--version"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"Poetry not found on PATH");throw new k$1("Verify Poetry after pipx install",new Error(`${c}
44
44
 
45
- Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function Tt(e){let n=e==="poetry";return `#!/usr/bin/env sh
45
+ Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function Ot(e){let o=e==="poetry";return `#!/usr/bin/env sh
46
46
  set -eu
47
47
 
48
48
  SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
@@ -52,16 +52,16 @@ if [ -x "$VENV_RAPIDKIT" ]; then
52
52
  exec "$VENV_RAPIDKIT" "$@"
53
53
  fi
54
54
 
55
- ${n?`if command -v poetry >/dev/null 2>&1 && [ -f "$SCRIPT_DIR/pyproject.toml" ]; then
55
+ ${o?`if command -v poetry >/dev/null 2>&1 && [ -f "$SCRIPT_DIR/pyproject.toml" ]; then
56
56
  exec poetry run rapidkit "$@"
57
57
  fi
58
58
 
59
59
  `:""}echo "RapidKit launcher could not find a local Python CLI." 1>&2
60
60
  echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
61
- ${n?`echo "- If you used Poetry: run 'poetry install' and retry, or activate the env." 1>&2
61
+ ${o?`echo "- If you used Poetry: run 'poetry install' and retry, or activate the env." 1>&2
62
62
  `:""}echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
63
63
  exit 1
64
- `}function Nt(e){return `@echo off
64
+ `}function Vt(e){return `@echo off
65
65
  setlocal
66
66
 
67
67
  set "SCRIPT_DIR=%~dp0"
@@ -80,8 +80,8 @@ if %ERRORLEVEL%==0 if exist "%SCRIPT_DIR%\\pyproject.toml" (
80
80
  `:""}echo RapidKit launcher could not find a local Python CLI. 1>&2
81
81
  echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
82
82
  exit /b 1
83
- `}async function Pt(e,n){await k.outputFile(m.join(e,"rapidkit"),Tt(n),{encoding:"utf-8",mode:493}),await k.outputFile(m.join(e,"rapidkit.cmd"),Nt(n),"utf-8");}async function re(e,n){let{skipGit:o=false,testMode:r=false,demoMode:l=false,dryRun:p=false,yes:u=false,userConfig:y={},installMethod:g,profile:h}=n,a=e||"rapidkit",i$1=m.resolve(process.cwd(),a);if(await k.pathExists(i$1))throw new i(a);if(p){let f=h||(u?"minimal":void 0),R=g||y.defaultInstallMethod||"poetry",P=y.pythonVersion||"3.10";await Vt(i$1,a,l,y,f,R,P);return}if(l){await Ot(i$1,a,o);return}let c=new Set(["python-only","polyglot","enterprise"]),d=h||"";if(!u&&!h){let{selectedProfile:f}=await q.prompt([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"java-only \u2014 Java runtime (Spring Boot services)",value:"java-only"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"polyglot \u2014 Python + Node.js + Go + Java multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);d=f;}else d||(d="minimal");let x=!u&&c.has(d),$=typeof y.pythonVersion=="string"&&y.pythonVersion.trim().length>0?y.pythonVersion.trim():void 0,D=g||y.defaultInstallMethod||"poetry",_=x?await Dt():{poetry:true,pipx:true},L=x?await Mt($):{choices:kt.map(f=>({name:f,value:f})),defaultValue:F},et=Kt(D,_),jt=[{name:_.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env + dependency mgmt)":"\u{1F3AF} Poetry (Recommended) \u2014 not detected (we can install it)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard, zero extra tools)",value:"venv"},{name:_.pipx?"\u{1F527} pipx (Global isolated - RapidKit CLI only, no local venv)":"\u{1F527} pipx (Global isolated) \u2014 not detected (we can install it)",value:"pipx"}],b=x?await q.prompt([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:L.choices,default:L.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:jt,default:et}]):await(async()=>{let f=g||y.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:y.pythonVersion||"3.10",installMethod:f}})();if(x&&(console.log(t.gray(`
84
- \u{1F4CC} Configuration notes:`)),b.pythonVersion==="3.10"?console.log(t.gray(" \u2022 Python 3.10: Latest stable with widespread compatibility")):b.pythonVersion==="3.11"?console.log(t.gray(" \u2022 Python 3.11: Newer, faster (3.10-3.11: ~10% speed improvement)")):b.pythonVersion==="3.12"&&console.log(t.gray(" \u2022 Python 3.12: Cutting edge, excellent for performance")),b.installMethod==="poetry"?console.log(t.gray(" \u2022 Poetry: Dependency management + virtual env (recommended for teams)")):b.installMethod==="venv"?console.log(t.gray(" \u2022 venv: Standard library approach, lightweight, zero dependencies")):console.log(t.gray(" \u2022 pipx: Global isolated, RapidKit CLI only, no local venv")),console.log("")),new Set(["go-only","java-only","node-only","minimal"]).has(d)){let f=O("Creating workspace").start();try{await k.ensureDir(i$1),f.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,d),await V(i$1),await U(i$1,a);let R={"go-only":"Go-only","java-only":"Java-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
83
+ `}async function It(e,o){await k.outputFile(m.join(e,"rapidkit"),Ot(o),{encoding:"utf-8",mode:493}),await k.outputFile(m.join(e,"rapidkit.cmd"),Vt(o),"utf-8");}async function le(e,o){let{skipGit:n=false,testMode:r=false,demoMode:l=false,dryRun:p=false,yes:c=false,userConfig:u={},installMethod:g,profile:h}=o,a=e||"rapidkit",i$1=m.resolve(process.cwd(),a);if(await k.pathExists(i$1))throw new i(a);if(p){let f=h||(c?"minimal":void 0),R=g||u.defaultInstallMethod||"poetry",b=u.pythonVersion||"3.10";await Lt(i$1,a,l,u,f,R,b);return}if(l){await Gt(i$1,a,n);return}let y=new Set(["python-only","polyglot","enterprise"]),d=h||"";if(!c&&!h){let{selectedProfile:f}=await q.prompt([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"java-only \u2014 Java runtime (Spring Boot services)",value:"java-only"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"dotnet-only \u2014 .NET runtime (ASP.NET Core services)",value:"dotnet-only"},{name:"polyglot \u2014 Python + Node.js + Go + Java + .NET multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);d=f;}else d||(d="minimal");let P=!c&&y.has(d),$=typeof u.pythonVersion=="string"&&u.pythonVersion.trim().length>0?u.pythonVersion.trim():void 0,T=g||u.defaultInstallMethod||"poetry",_=P?await Kt():{poetry:true,pipx:true},L=P?await Dt($):{choices:bt.map(f=>({name:f,value:f})),defaultValue:K},et=Nt(T,_),Ct=[{name:_.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env + dependency mgmt)":"\u{1F3AF} Poetry (Recommended) \u2014 not detected (we can install it)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard, zero extra tools)",value:"venv"},{name:_.pipx?"\u{1F527} pipx (Global isolated - RapidKit CLI only, no local venv)":"\u{1F527} pipx (Global isolated) \u2014 not detected (we can install it)",value:"pipx"}],x=P?await q.prompt([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:L.choices,default:L.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:Ct,default:et}]):await(async()=>{let f=g||u.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:u.pythonVersion||"3.10",installMethod:f}})();if(P&&(console.log(t.gray(`
84
+ \u{1F4CC} Configuration notes:`)),x.pythonVersion==="3.10"?console.log(t.gray(" \u2022 Python 3.10: Latest stable with widespread compatibility")):x.pythonVersion==="3.11"?console.log(t.gray(" \u2022 Python 3.11: Newer, faster (3.10-3.11: ~10% speed improvement)")):x.pythonVersion==="3.12"&&console.log(t.gray(" \u2022 Python 3.12: Cutting edge, excellent for performance")),x.installMethod==="poetry"?console.log(t.gray(" \u2022 Poetry: Dependency management + virtual env (recommended for teams)")):x.installMethod==="venv"?console.log(t.gray(" \u2022 venv: Standard library approach, lightweight, zero dependencies")):console.log(t.gray(" \u2022 pipx: Global isolated, RapidKit CLI only, no local venv")),console.log("")),new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(d)){let f=O("Creating workspace").start();try{await k.ensureDir(i$1),f.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,d),await V(i$1),await U(i$1,a);let R={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
85
85
 
86
86
  RapidKit **${R[d]}** workspace.
87
87
 
@@ -96,6 +96,10 @@ npx rapidkit dev
96
96
  cd my-service
97
97
  npx rapidkit init
98
98
  npx rapidkit dev
99
+ `:d==="dotnet-only"?`npx rapidkit create project dotnet.webapi.clean my-api
100
+ cd my-api
101
+ npx rapidkit init
102
+ npx rapidkit dev
99
103
  `:d==="node-only"?`npx rapidkit create project nestjs.standard my-app
100
104
  cd my-app
101
105
  npx rapidkit init
@@ -104,34 +108,36 @@ npx rapidkit dev
104
108
  cd <project-name>
105
109
  npx rapidkit init
106
110
  npx rapidkit dev
107
- `)+"```\n","utf-8"),!o){f.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:i$1}),f.succeed("Git repository initialized");}catch{f.warn("Could not initialize git repository");}}try{let{registerWorkspace:P}=await import('./workspace-YLFC25EZ.js');await P(i$1,a);}catch{}if(console.log(t.green(`
111
+ `)+"```\n","utf-8"),!n){f.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:i$1}),f.succeed("Git repository initialized");}catch{f.warn("Could not initialize git repository");}}try{let{registerWorkspace:b}=await import('./workspace-EHYCBFXL.js');await b(i$1,a);}catch{}if(console.log(t.green(`
108
112
  \u2728 Workspace created!
109
113
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan(`
110
114
  \u{1F680} Get started:
111
115
  `)),console.log(t.white(` cd ${a}`)),d==="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
112
- `)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:P}=await execa("go",["version"],{timeout:3e3}),w=P.match(/go version go(\d+\.\d+(?:\.\d+)?)/),A=w?w[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${A} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(t.yellow(`
113
- \u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else d==="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
114
- `)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."))):d==="node-only"?(console.log(t.white(" npx rapidkit create project nestjs.standard my-app")),console.log(t.white(" cd my-app")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
116
+ `)),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}),w=b.match(/go version go(\d+\.\d+(?:\.\d+)?)/),A=w?w[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${A} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(t.yellow(`
117
+ \u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else if(d==="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
118
+ `)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."));else if(d==="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
119
+ `)),console.log(t.gray("\u{1F4A1} No Python required \u2014 ASP.NET Core kit runs through the npm package with .NET tooling."));try{let{stdout:b}=await execa("dotnet",["--version"],{timeout:3e3});console.log(t.gray(`\u2699\uFE0F .NET SDK ${b.trim()} detected \u2014 ready for ASP.NET Core projects`));}catch{console.log(t.yellow(`
120
+ \u26A0\uFE0F .NET SDK is not installed \u2014 install it from https://dotnet.microsoft.com/download`));}}else d==="node-only"?(console.log(t.white(" npx rapidkit create project nestjs.standard my-app")),console.log(t.white(" cd my-app")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
115
121
  `)),console.log(t.gray("\u{1F4A1} Python engine will be installed automatically on first `create project nestjs.standard`."))):(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
116
- `)),console.log(t.gray("\u{1F4A1} Bootstrap a specific runtime: rapidkit bootstrap --profile java-only|python-only|node-only|go-only|polyglot|enterprise")));console.log(t.cyan(`
122
+ `)),console.log(t.gray("\u{1F4A1} Bootstrap a specific runtime: rapidkit bootstrap --profile java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")));console.log(t.cyan(`
117
123
  \u{1F4DA} More info:`)),console.log(t.gray(" \u2022 Change profile anytime: rapidkit bootstrap --profile <profile>")),console.log(t.gray(" \u2022 View config: cat "+a+"/.rapidkit-workspace")),console.log(t.gray(" \u2022 Check health: rapidkit doctor")),console.log("");}catch(R){throw f.fail("Failed to create workspace"),console.error(t.red(`
118
- \u274C Error:`),R),R}return}{let f=S(),R=false;try{await execa(f,["--version"],{timeout:5e3}),R=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),R=true;}catch{R=false;}}if(!R){let w={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"}[d];if(x&&!u){console.log(t.yellow(`
124
+ \u274C Error:`),R),R}return}{let f=S(),R=false;try{await execa(f,["--version"],{timeout:5e3}),R=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),R=true;}catch{R=false;}}if(!R){let w={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"}[d];if(P&&!c){console.log(t.yellow(`
119
125
  \u26A0\uFE0F Python 3.10+ is not detected on this system.
120
126
  `)),console.log(t.cyan(`You have 3 options:
121
- `));let{pythonAction:K}=await q.prompt([{type:"rawlist",name:"pythonAction",message:"What would you like to do?",choices:[{name:"\u{1F4E5} Install Python now (I'll show you the command for your OS)",value:"install"},{name:`\u{1F504} Switch to "${w}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if(K==="cancel"&&(console.log(t.cyan(`
127
+ `));let{pythonAction:D}=await q.prompt([{type:"rawlist",name:"pythonAction",message:"What would you like to do?",choices:[{name:"\u{1F4E5} Install Python now (I'll show you the command for your OS)",value:"install"},{name:`\u{1F504} Switch to "${w}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if(D==="cancel"&&(console.log(t.cyan(`
122
128
  \u{1F4A1} How to install Python:
123
129
  `)),console.log(t.white(" Ubuntu / Debian: sudo apt install python3.10")),console.log(t.white(" macOS (Homebrew): brew install python@3.10")),console.log(t.white(` Windows: https://python.org/downloads
124
130
  `)),console.log(t.gray(` After installing Python, run: npx rapidkit ${a}
125
- `)),process.exit(1)),K==="install"){console.log(t.cyan(`
131
+ `)),process.exit(1)),D==="install"){console.log(t.cyan(`
126
132
  \u{1F4A1} Install Python on your system:
127
- `));let E=process.platform;E==="linux"?console.log(t.white(` sudo apt update && sudo apt install python3.10 python3.10-venv
128
- `)):E==="darwin"?console.log(t.white(` brew install python@3.10
129
- `)):E==="win32"&&(console.log(t.white(` Download: https://python.org/downloads
133
+ `));let j=process.platform;j==="linux"?console.log(t.white(` sudo apt update && sudo apt install python3.10 python3.10-venv
134
+ `)):j==="darwin"?console.log(t.white(` brew install python@3.10
135
+ `)):j==="win32"&&(console.log(t.white(` Download: https://python.org/downloads
130
136
  `)),console.log(t.white(` Run the installer and check "Add Python to PATH"
131
137
  `))),console.log(t.gray(` After installing, run: npx rapidkit ${a}
132
- `)),process.exit(0);}if(K==="fallback"&&(console.log(t.green(`
138
+ `)),process.exit(0);}if(D==="fallback"&&(console.log(t.green(`
133
139
  \u2705 Switching to "${w}" profile (no Python required).
134
- `)),d=w,new Set(["go-only","java-only","node-only","minimal"]).has(w))){let C=O("Creating workspace").start();try{await k.ensureDir(i$1),C.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await V(i$1),await U(i$1,a);let B={"go-only":"Go-only","java-only":"Java-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
140
+ `)),d=w,new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(w))){let C=O("Creating workspace").start();try{await k.ensureDir(i$1),C.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await V(i$1),await U(i$1,a);let B={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
135
141
 
136
142
  RapidKit **${B[w]}** workspace (switched from ${d} due to missing Python).
137
143
 
@@ -146,6 +152,10 @@ npx rapidkit dev
146
152
  cd my-service
147
153
  npx rapidkit init
148
154
  npx rapidkit dev
155
+ `:w==="dotnet-only"?`npx rapidkit create project dotnet.webapi.clean my-api
156
+ cd my-api
157
+ npx rapidkit init
158
+ npx rapidkit dev
149
159
  `:w==="node-only"?`npx rapidkit create project nestjs.standard my-app
150
160
  cd my-app
151
161
  npx rapidkit init
@@ -154,7 +164,7 @@ npx rapidkit dev
154
164
  cd <project-name>
155
165
  npx rapidkit init
156
166
  npx rapidkit dev
157
- `)+"```\n","utf-8"),!o){C.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m",`Initial commit: RapidKit workspace (${w} profile)`],{cwd:i$1}),C.succeed("Git repository initialized");}catch{C.warn("Could not initialize git repository");}}try{let{registerWorkspace:Et}=await import('./workspace-YLFC25EZ.js');await Et(i$1,a);}catch{}console.log(t.green(`
167
+ `)+"```\n","utf-8"),!n){C.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m",`Initial commit: RapidKit workspace (${w} profile)`],{cwd:i$1}),C.succeed("Git repository initialized");}catch{C.warn("Could not initialize git repository");}}try{let{registerWorkspace:$t}=await import('./workspace-EHYCBFXL.js');await $t(i$1,a);}catch{}console.log(t.green(`
158
168
  \u2728 Workspace created with fallback profile!
159
169
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan(`
160
170
  \u{1F680} Get started:
@@ -164,27 +174,27 @@ npx rapidkit dev
164
174
  `)),console.log("");return}catch(B){throw C.fail("Failed to create workspace"),console.error(t.red(`
165
175
  \u274C Error:`),B),B}}}else if(console.log(t.yellow(`
166
176
  \u26A0\uFE0F Python not detected. Auto-switching to "${w}" profile (no Python required).
167
- `)),d=w,new Set(["go-only","java-only","node-only","minimal"]).has(w)){let E=O("Creating workspace").start();try{if(await k.ensureDir(i$1),E.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await V(i$1),await U(i$1,a),!o){E.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m",`Initial commit: RapidKit workspace (${w})`],{cwd:i$1}),E.succeed("Git repository initialized");}catch{E.warn("Could not initialize git repository");}}try{let{registerWorkspace:C}=await import('./workspace-YLFC25EZ.js');await C(i$1,a);}catch{}console.log(t.green(`
177
+ `)),d=w,new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(w)){let j=O("Creating workspace").start();try{if(await k.ensureDir(i$1),j.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await V(i$1),await U(i$1,a),!n){j.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m",`Initial commit: RapidKit workspace (${w})`],{cwd:i$1}),j.succeed("Git repository initialized");}catch{j.warn("Could not initialize git repository");}}try{let{registerWorkspace:C}=await import('./workspace-EHYCBFXL.js');await C(i$1,a);}catch{}console.log(t.green(`
168
178
  \u2728 Workspace created (auto-fallback profile)!
169
179
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u{1F4E6} Profile:"),t.yellow(w)),console.log(t.cyan("\u{1F4A1} Reason:"),t.gray("Python not detected; switched from "+d)),console.log(t.cyan(`
170
180
  \u{1F680} Get started:
171
181
  `)),console.log(t.white(` cd ${a}`)),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
172
182
  `)),console.log(t.cyan(`\u{1F4A1} Add Python later:
173
183
  `)),console.log(t.gray(" 1. Install Python 3.10+")),console.log(t.gray(` 2. Run: cd ${a} && rapidkit bootstrap --profile ${d}
174
- `)),console.log("");return}catch(C){throw E.fail("Failed to create workspace"),console.error(t.red(`
175
- \u274C Error:`),C),C}}}}a$1.step(1,3,"Setting up RapidKit environment");let I=O("Creating directory").start();try{await k.ensureDir(i$1),I.succeed("Directory created"),I.start("Detecting Python version");let f=null,R=await xt(b.pythonVersion);if(R)f=await gt(R),f?(a$1.info(` Detected Python ${f}`),I.succeed(`Python ${f} detected`)):I.warn("Could not detect exact Python version");else {let P=S();f=await gt(P),f?I.succeed(`Python ${f} detected`):I.warn("Could not detect Python version, proceeding with defaults");}if(b.installMethod==="poetry"&&!await bt()&&(I.warn("Poetry not found \u2014 auto-fallback to pip + venv"),b.installMethod="venv"),await z(i$1,a,b.installMethod,f||void 0),f&&await St(i$1,f),await Y(i$1,a,b.installMethod,f||b.pythonVersion,d||h),await V(i$1),await U(i$1,a),b.installMethod==="poetry")try{await It(i$1,b.pythonVersion,I,r,y,u);}catch(P){let w=P?.details||P?.message||String(P);if(w.includes("pyenv")||w.includes("exit status 127")||w.includes("returned non-zero exit status 127")){I.warn("Poetry encountered Python discovery issues, trying venv method"),a$1.debug(`Poetry error (attempting venv fallback): ${w}`);try{await ct(i$1,b.pythonVersion,I,r,y),b.installMethod="venv";}catch(K){throw K}}else throw P}else b.installMethod==="venv"?await ct(i$1,b.pythonVersion,I,r,y):await Rt(i$1,I,r,y,u);if(await Pt(i$1,b.installMethod),await _t(i$1,b.installMethod),I.succeed("RapidKit environment ready!"),!n.skipGit){I.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit environment"],{cwd:i$1}),I.succeed("Git repository initialized");}catch{I.warn("Could not initialize git repository");}}try{let{registerWorkspace:P}=await import('./workspace-YLFC25EZ.js');await P(i$1,a);}catch{console.warn(t.gray("Note: Could not register workspace in shared registry"));}if(console.log(t.green(`
184
+ `)),console.log("");return}catch(C){throw j.fail("Failed to create workspace"),console.error(t.red(`
185
+ \u274C Error:`),C),C}}}}a$1.step(1,3,"Setting up RapidKit environment");let I=O("Creating directory").start();try{await k.ensureDir(i$1),I.succeed("Directory created"),I.start("Detecting Python version");let f=null,R=await Rt(x.pythonVersion);if(R)f=await gt(R),f?(a$1.info(` Detected Python ${f}`),I.succeed(`Python ${f} detected`)):I.warn("Could not detect exact Python version");else {let b=S();f=await gt(b),f?I.succeed(`Python ${f} detected`):I.warn("Could not detect Python version, proceeding with defaults");}if(x.installMethod==="poetry"&&!await xt()&&(I.warn("Poetry not found \u2014 auto-fallback to pip + venv"),x.installMethod="venv"),await z(i$1,a,x.installMethod,f||void 0),f&&await Mt(i$1,f),await Y(i$1,a,x.installMethod,f||x.pythonVersion,d||h),await V(i$1),await U(i$1,a),x.installMethod==="poetry")try{await _t(i$1,x.pythonVersion,I,r,u,c);}catch(b){let w=b?.details||b?.message||String(b);if(w.includes("pyenv")||w.includes("exit status 127")||w.includes("returned non-zero exit status 127")){I.warn("Poetry encountered Python discovery issues, trying venv method"),a$1.debug(`Poetry error (attempting venv fallback): ${w}`);try{await ct(i$1,x.pythonVersion,I,r,u),x.installMethod="venv";}catch(D){throw D}}else throw b}else x.installMethod==="venv"?await ct(i$1,x.pythonVersion,I,r,u):await Et(i$1,I,r,u,c);if(await It(i$1,x.installMethod),await jt(i$1,x.installMethod),I.succeed("RapidKit environment ready!"),!o.skipGit){I.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit environment"],{cwd:i$1}),I.succeed("Git repository initialized");}catch{I.warn("Could not initialize git repository");}}try{let{registerWorkspace:b}=await import('./workspace-EHYCBFXL.js');await b(i$1,a);}catch{console.warn(t.gray("Note: Could not register workspace in shared registry"));}if(console.log(t.green(`
176
186
  \u2728 RapidKit environment created successfully!
177
- `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u2699\uFE0F Configuration:")),console.log(t.gray(` \u2022 Profile: ${d}`)),console.log(t.gray(` \u2022 Python: ${b.pythonVersion}`)),console.log(t.gray(` \u2022 Install method: ${b.installMethod}`)),console.log(t.cyan(`
187
+ `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u2699\uFE0F Configuration:")),console.log(t.gray(` \u2022 Profile: ${d}`)),console.log(t.gray(` \u2022 Python: ${x.pythonVersion}`)),console.log(t.gray(` \u2022 Install method: ${x.installMethod}`)),console.log(t.cyan(`
178
188
  \u{1F680} Get started:
179
- `)),console.log(t.white(` cd ${a}`)),b.installMethod==="poetry"){let P="source $(poetry env info --path)/bin/activate";try{N();let{stdout:w}=await execa("poetry",["--version"]),A=w.match(/Poetry.*?(\d+)\.(\d+)/);A&&(parseInt(A[1])>=2?P="source $(poetry env info --path)/bin/activate":P="poetry shell");}catch{}console.log(t.white(` ${P} # 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(`
180
- \u{1F4E6} Why Poetry? Includes dependency management + virtual environment`));}else b.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(`
189
+ `)),console.log(t.white(` cd ${a}`)),x.installMethod==="poetry"){let b="source $(poetry env info --path)/bin/activate";try{F();let{stdout:w}=await execa("poetry",["--version"]),A=w.match(/Poetry.*?(\d+)\.(\d+)/);A&&(parseInt(A[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(`
190
+ \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(`
181
191
  \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(`
182
192
  \u{1F4E6} Why pipx? Global isolated install, no local venv`)));console.log(t.cyan(`
183
- \u{1F4DA} Next steps:`)),console.log(t.gray(" 1. Check README.md for workspace details")),console.log(t.gray(" 2. Create your first project: rapidkit create project")),console.log(t.gray(" 3. See all runtimes: rapidkit list # Shows: fastapi, nestjs, springboot, gofiber, gogin")),console.log(t.cyan(`
184
- \u{1F4A1} Profile management:`)),console.log(t.gray(" \u2022 Add Python? \u2192 rapidkit bootstrap --profile python-only|polyglot")),console.log(t.gray(" \u2022 Add Node.js? \u2192 rapidkit bootstrap --profile node-only|polyglot")),console.log(t.gray(" \u2022 Add Go? \u2192 rapidkit bootstrap --profile go-only|polyglot")),console.log(t.gray(" \u2022 Full setup? \u2192 rapidkit bootstrap --profile enterprise")),console.log(t.cyan(`
193
+ \u{1F4DA} Next steps:`)),console.log(t.gray(" 1. Check README.md for workspace details")),console.log(t.gray(" 2. Create your first project: rapidkit create project")),console.log(t.gray(" 3. See all runtimes: rapidkit list # Shows: fastapi, nestjs, springboot, gofiber, gogin, dotnet")),console.log(t.cyan(`
194
+ \u{1F4A1} Profile management:`)),console.log(t.gray(" \u2022 Add Python? \u2192 rapidkit bootstrap --profile python-only|polyglot")),console.log(t.gray(" \u2022 Add Node.js? \u2192 rapidkit bootstrap --profile node-only|polyglot")),console.log(t.gray(" \u2022 Add Go? \u2192 rapidkit bootstrap --profile go-only|polyglot")),console.log(t.gray(" \u2022 Add .NET? \u2192 rapidkit bootstrap --profile dotnet-only|polyglot")),console.log(t.gray(" \u2022 Full setup? \u2192 rapidkit bootstrap --profile enterprise")),console.log(t.cyan(`
185
195
  \u{1F4D6} Common commands:`)),console.log(t.white(" rapidkit create - Create a new project (interactive)")),console.log(t.white(" rapidkit list - List available kits")),console.log(t.white(" rapidkit modules - List available modules")),console.log(t.white(" rapidkit doctor - Check workspace health")),console.log(t.white(` rapidkit bootstrap --help - Advanced workspace configuration
186
- `));try{let{stdout:P}=await execa("go",["version"],{timeout:3e3}),w=P.match(/go version go(\d+\.\d+(?:\.\d+)?)/),A=w?w[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${A} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(t.yellow("\u26A0\uFE0F Go not installed \u2014 needed for gofiber.standard/gogin.standard projects")),console.log(t.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(f){I.fail("Failed to create RapidKit environment"),console.error(t.red(`
187
- \u274C Error:`),f);try{await k.remove(i$1);}catch{}throw f}}async function xt(e$1){let n=[];if(!a$2())try{let{stdout:p}=await execa("pyenv",["which","python"]),u=p.trim();u&&n.push(u);}catch{}let o=Number(e$1.split(".")[1]),r=e(o,10).map(p=>p.command).filter(Boolean);n.push(`python${e$1}`,...r,...d$1());let l=[...new Set(n)];for(let p of l)try{let u=p==="py"?["-3","--version"]:["--version"],y=p==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:g}=await execa(p,u,{timeout:2e3}),h=g.match(/Python (\d+\.\d+)/)?.[1];if(h&&G(h,e$1))return await execa(p,y,{timeout:2e3}),p}catch{continue}return null}async function It(e,n,o,r,l$1,p=false){await Ft(o,p),o.start("Finding Python interpreter");let u=await xt(n);u?(a$1.debug(`Found working Python: ${u}`),o.succeed("Python found")):o.warn("Could not verify Python path, proceeding with default"),o.start("Initializing Poetry project");let y=m.join(e,"pyproject.toml"),h=(await k.pathExists(y)?await promises.readFile(y,"utf-8"):"").includes("rapidkit-core");if(h)o.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${n}`],{cwd:e}),o.succeed("Poetry project initialized");let d=await promises.readFile(y,"utf-8");d.includes("[tool.poetry]")?d=d.replace("[tool.poetry]",`[tool.poetry]
196
+ `));try{let{stdout:b}=await execa("go",["version"],{timeout:3e3}),w=b.match(/go version go(\d+\.\d+(?:\.\d+)?)/),A=w?w[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${A} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(t.yellow("\u26A0\uFE0F Go not installed \u2014 needed for gofiber.standard/gogin.standard projects")),console.log(t.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(f){I.fail("Failed to create RapidKit environment"),console.error(t.red(`
197
+ \u274C Error:`),f);try{await k.remove(i$1);}catch{}throw f}}async function Rt(e$1){let o=[];if(!a$2())try{let{stdout:p}=await execa("pyenv",["which","python"]),c=p.trim();c&&o.push(c);}catch{}let n=Number(e$1.split(".")[1]),r=e(n,10).map(p=>p.command).filter(Boolean);o.push(`python${e$1}`,...r,...d$1());let l=[...new Set(o)];for(let p of l)try{let c=p==="py"?["-3","--version"]:["--version"],u=p==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:g}=await execa(p,c,{timeout:2e3}),h=g.match(/Python (\d+\.\d+)/)?.[1];if(h&&G(h,e$1))return await execa(p,u,{timeout:2e3}),p}catch{continue}return null}async function _t(e,o,n,r,l$1,p=false){await Ft(n,p),n.start("Finding Python interpreter");let c=await Rt(o);c?(a$1.debug(`Found working Python: ${c}`),n.succeed("Python found")):n.warn("Could not verify Python path, proceeding with default"),n.start("Initializing Poetry project");let u=m.join(e,"pyproject.toml"),h=(await k.pathExists(u)?await promises.readFile(u,"utf-8"):"").includes("rapidkit-core");if(h)n.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${o}`],{cwd:e}),n.succeed("Poetry project initialized");let d=await promises.readFile(u,"utf-8");d.includes("[tool.poetry]")?d=d.replace("[tool.poetry]",`[tool.poetry]
188
198
  package-mode = false`):d.includes("[project]")&&(d.includes("[build-system]")?d=d.replace("[build-system]",`
189
199
  [tool.poetry]
190
200
  package-mode = false
@@ -193,37 +203,37 @@ package-mode = false
193
203
 
194
204
  [tool.poetry]
195
205
  package-mode = false
196
- `),await promises.writeFile(y,d,"utf-8");}o.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:e}),o.succeed("Poetry configured");}catch{o.warn("Could not configure Poetry virtualenvs.in-project");}o.start("Creating virtualenv");let a=u||S(),i=f(m.join(e,".venv"));try{await execa(a,["-m","venv",".venv"],{cwd:e,timeout:6e4}),o.succeed("Virtualenv created");}catch(c){a$1.debug(`python -m venv failed: ${c}`),o.warn("Could not pre-create virtualenv, Poetry will try"),i=u||S();}try{await execa("poetry",["env","use",i||S()],{cwd:e}),a$1.debug(`Poetry env set to: ${i}`);}catch(c){a$1.debug(`Could not set Poetry env: ${c}`);}if(o.start("Installing RapidKit"),h&&!r){let c=d$2(l$1||{}),d=c?await k.pathExists(c):false,x=d&&c?c:"rapidkit-core";c&&!d&&a$1.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${c}. Falling back to PyPI.`),o.text=d?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let $=false,D=null;for(let _=1;_<=3;_++)try{await execa(i,["-m","pip","install",x,"--quiet"],{cwd:e,timeout:18e4}),$=true;break}catch(L){D=L,a$1.debug(`pip install rapidkit-core attempt ${_} failed: ${L}`),_<3&&(o.text=`Retrying installation (attempt ${_+1}/3)`,await new Promise(et=>setTimeout(et,2e3)));}if(!$){let _=D?.stderr||D?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${_}`),_.includes("Could not find")||_.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
206
+ `),await promises.writeFile(u,d,"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 a=c||S(),i=f(m.join(e,".venv"));try{await execa(a,["-m","venv",".venv"],{cwd:e,timeout:6e4}),n.succeed("Virtualenv created");}catch(y){a$1.debug(`python -m venv failed: ${y}`),n.warn("Could not pre-create virtualenv, Poetry will try"),i=c||S();}try{await execa("poetry",["env","use",i||S()],{cwd:e}),a$1.debug(`Poetry env set to: ${i}`);}catch(y){a$1.debug(`Could not set Poetry env: ${y}`);}if(n.start("Installing RapidKit"),h&&!r){let y=d$2(l$1||{}),d=y?await k.pathExists(y):false,P=d&&y?y:"rapidkit-core";y&&!d&&a$1.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${y}. Falling back to PyPI.`),n.text=d?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let $=false,T=null;for(let _=1;_<=3;_++)try{await execa(i,["-m","pip","install",P,"--quiet"],{cwd:e,timeout:18e4}),$=true;break}catch(L){T=L,a$1.debug(`pip install rapidkit-core attempt ${_} failed: ${L}`),_<3&&(n.text=`Retrying installation (attempt ${_+1}/3)`,await new Promise(et=>setTimeout(et,2e3)));}if(!$){let _=T?.stderr||T?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${_}`),_.includes("Could not find")||_.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
197
207
  Error: ${_}
198
208
 
199
209
  Possible solutions:
200
210
  1. Check your internet connection
201
211
  2. Try installing manually: cd ${m.basename(e)} && poetry add rapidkit-core
202
- 3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}else {o.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:e,timeout:12e4}),o.succeed("Poetry environment synced");}catch(c){a$1.debug(`poetry install --no-root failed: ${c}`),o.warn("Could not sync Poetry environment, proceeding with add command");}if(o.start("Installing RapidKit"),r){let c=d$2(l$1||{});if(!c)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${c}`),o.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",c],{cwd:e});}else {o.text="Installing RapidKit from PyPI";let c=false,d=null;for(let x=1;x<=3;x++)try{await execa("poetry",["add","rapidkit-core"],{cwd:e,timeout:6e4*x}),c=true;break}catch($){d=$,a$1.debug(`Poetry add attempt ${x} failed: ${$}`),x<3&&(o.text=`Retrying installation (attempt ${x+1}/3)`,await new Promise(D=>setTimeout(D,2e3)));}if(!c){let x=d?.stderr||d?.message||"Unknown error";throw a$1.debug(`All Poetry install attempts failed. Last error: ${x}`),x.includes("Could not find")||x.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
203
- Error: ${x}
212
+ 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(y){a$1.debug(`poetry install --no-root failed: ${y}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),r){let y=d$2(l$1||{});if(!y)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${y}`),n.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",y],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let y=false,d=null;for(let P=1;P<=3;P++)try{await execa("poetry",["add","rapidkit-core"],{cwd:e,timeout:6e4*P}),y=true;break}catch($){d=$,a$1.debug(`Poetry add attempt ${P} failed: ${$}`),P<3&&(n.text=`Retrying installation (attempt ${P+1}/3)`,await new Promise(T=>setTimeout(T,2e3)));}if(!y){let P=d?.stderr||d?.message||"Unknown error";throw a$1.debug(`All Poetry install attempts failed. Last error: ${P}`),P.includes("Could not find")||P.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
213
+ Error: ${P}
204
214
 
205
215
  Possible solutions:
206
216
  1. Check your internet connection
207
217
  2. Try installing manually: cd ${m.basename(e)} && poetry add rapidkit-core
208
- 3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}}o.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:c}=await import('./pythonRapidkitExec-4MP62M5R.js');if(!await c()&&!r){o.start("Checking optional global pipx installation");let x=await tt(o,true);try{o.start("Installing RapidKit globally with pipx for CLI access"),await T(x,["install","rapidkit-core"]),o.succeed("RapidKit installed globally");}catch($){o.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${$}`);}}}catch(c){o.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${c}`);}}async function ct(e,n,o,r,l$1,p=false){o.start(`Checking Python ${n}`);let u=S();try{let{stdout:g}=await execa(u,["--version"]),h=g.match(/Python (\d+\.\d+)/)?.[1];if(h&&!G(h,n))throw new f$1(n,h);o.succeed(`Python ${h} found`);}catch(g){throw g instanceof f$1?g:new f$1(n)}o.start("Creating virtual environment");try{await execa(u,["-m","venv",".venv"],{cwd:e}),o.succeed("Virtual environment created");}catch(g){if(o.fail("Failed to create virtual environment"),(a=>typeof a=="object"&&a!==null&&"stdout"in a&&typeof a.stdout=="string")(g)&&g.stdout.includes("ensurepip is not")){let a=g.stdout.match(/apt install (python[\d.]+-venv)/),i=a?a[1]:"python3-venv";throw new k$1("Python venv module not available",new Error(`Virtual environment creation failed.
218
+ 3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:y}=await import('./pythonRapidkitExec-4MP62M5R.js');if(!await y()&&!r){n.start("Checking optional global pipx installation");let P=await tt(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await N(P,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch($){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${$}`);}}}catch(y){n.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${y}`);}}async function ct(e,o,n,r,l$1,p=false){n.start(`Checking Python ${o}`);let c=S();try{let{stdout:g}=await execa(c,["--version"]),h=g.match(/Python (\d+\.\d+)/)?.[1];if(h&&!G(h,o))throw new f$1(o,h);n.succeed(`Python ${h} found`);}catch(g){throw g instanceof f$1?g:new f$1(o)}n.start("Creating virtual environment");try{await execa(c,["-m","venv",".venv"],{cwd:e}),n.succeed("Virtual environment created");}catch(g){if(n.fail("Failed to create virtual environment"),(a=>typeof a=="object"&&a!==null&&"stdout"in a&&typeof a.stdout=="string")(g)&&g.stdout.includes("ensurepip is not")){let a=g.stdout.match(/apt install (python[\d.]+-venv)/),i=a?a[1]:"python3-venv";throw new k$1("Python venv module not available",new Error(`Virtual environment creation failed.
209
219
 
210
220
  On Debian/Ubuntu systems, install the venv package:
211
221
  sudo apt install ${i}
212
222
 
213
223
  Or use Poetry instead (recommended):
214
- npx rapidkit ${m.basename(e)} --yes`))}throw new k$1("Virtual environment creation",g instanceof Error?g:new Error(String(g)))}o.start("Installing RapidKit");let y=f(m.join(e,".venv"));if(await execa(y,["-m","pip","install","--upgrade","pip"],{cwd:e}),r){let g=d$2(l$1||{});if(!g)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${g}`),o.text="Installing RapidKit from local path (test mode)",await execa(y,["-m","pip","install","-e",g],{cwd:e});}else {o.text="Installing RapidKit from PyPI";let g=false,h=null;for(let a=1;a<=3;a++)try{await execa(y,["-m","pip","install","rapidkit-core"],{cwd:e,timeout:6e4*a}),g=true;break}catch(i){h=i,a$1.debug(`pip install attempt ${a} failed: ${i}`),a<3&&(o.text=`Retrying installation (attempt ${a+1}/3)`,await new Promise(c=>setTimeout(c,2e3)));}if(!g){let a=h?.stderr||h?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${a}`),a.includes("Could not find")||a.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
224
+ npx rapidkit ${m.basename(e)} --yes`))}throw new k$1("Virtual environment creation",g instanceof Error?g:new Error(String(g)))}n.start("Installing RapidKit");let u=f(m.join(e,".venv"));if(await execa(u,["-m","pip","install","--upgrade","pip"],{cwd:e}),r){let g=d$2(l$1||{});if(!g)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${g}`),n.text="Installing RapidKit from local path (test mode)",await execa(u,["-m","pip","install","-e",g],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let g=false,h=null;for(let a=1;a<=3;a++)try{await execa(u,["-m","pip","install","rapidkit-core"],{cwd:e,timeout:6e4*a}),g=true;break}catch(i){h=i,a$1.debug(`pip install attempt ${a} failed: ${i}`),a<3&&(n.text=`Retrying installation (attempt ${a+1}/3)`,await new Promise(y=>setTimeout(y,2e3)));}if(!g){let a=h?.stderr||h?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${a}`),a.includes("Could not find")||a.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
215
225
  Error: ${a}
216
226
 
217
227
  Possible solutions:
218
228
  1. Check your internet connection
219
229
  2. Try installing manually: cd ${m.basename(e)} && ${f(".venv")} -m pip install rapidkit-core
220
- 3. Use Poetry instead: npx rapidkit ${m.basename(e)} --install-method=poetry`))}}o.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:g}=await import('./pythonRapidkitExec-4MP62M5R.js');if(!await g()&&!r){o.start("Checking optional global pipx installation");let a=await tt(o,true);try{o.start("Installing RapidKit globally with pipx for CLI access"),await T(a,["install","rapidkit-core"]),o.succeed("RapidKit installed globally");}catch(i){o.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${i}`);}}}catch(g){o.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${g}`);}}async function Rt(e,n,o,r,l$1=false){if(!o)try{let{checkRapidkitCoreVersionCompatible:u}=await import('./pythonRapidkitExec-4MP62M5R.js'),y=await u();if(y.isCompatible){n.succeed(`RapidKit ${y.installedVersion??""} already compatible globally; skipping pipx installation`),await k.outputFile(m.join(e,".rapidkit-global"),`RapidKit already available globally (version ${y.installedVersion??"unknown"}) and satisfies expected constraint ${y.expectedConstraint??"n/a"}; workspace will reuse the existing installation
221
- `,"utf-8");return}y.reason==="constraint-missing"?n.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.'):y.reason==="constraint-unsupported"&&n.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.'),a$1.debug(`Global RapidKit install is not reusable via version-aware policy (reason=${y.reason}, installed=${y.installedVersion??"unknown"}, expected=${y.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(u){a$1.debug(`Global RapidKit version-aware check failed before pipx install: ${u}`);}let p=await tt(n,l$1);if(n.start("Installing RapidKit globally with pipx"),o){let u=d$2(r||{});if(!u)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${u}`),n.text="Installing RapidKit from local path (test mode)",await T(p,["install","-e",u]);}else {n.text="Installing RapidKit from PyPI";try{await T(p,["install","rapidkit-core"]);}catch(u){try{n.text="RapidKit already installed globally, upgrading to match expected version",await T(p,["upgrade","rapidkit-core"]);}catch(y){throw a$1.debug(`pipx install/upgrade failed: install=${u}, upgrade=${y}`),new l}}}n.succeed("RapidKit installed globally"),await k.outputFile(m.join(e,".rapidkit-global"),`RapidKit installed globally with pipx
222
- `,"utf-8");}async function se(e,n){let{skipGit:o=false,testMode:r=false,userConfig:l={},yes:p=false,installMethod:u,pythonVersion:y="3.10"}=n||{},g=u||l.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),h=g==="poetry"&&!await bt()?"venv":g;await z(e,m.basename(e),h),await V(e),await Y(e,m.basename(e),h,y,n?.profile);let a=O("Registering workspace").start();try{h==="poetry"?(await U(e,m.basename(e)),await It(e,y,a,r,l,p)):h==="venv"?await ct(e,y,a,r,l):await Rt(e,a,r,l,p),await Pt(e,h),await _t(e,h),a.succeed("Workspace registered");try{let{registerWorkspace:i}=await import('./workspace-YLFC25EZ.js');await i(e,m.basename(e));}catch{}if(!o){a.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}),a.succeed("Git repository initialized");}catch{a.warn("Could not initialize git repository");}}}catch(i){throw a.fail("Failed to register workspace"),i}}async function _t(e,n){let o=n==="poetry"?`source $(poetry env info --path)/bin/activate
223
- # Or simply use: poetry run rapidkit <command>`:n==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)",r=n==="poetry"?`# No activation needed (recommended):
230
+ 3. Use Poetry instead: npx rapidkit ${m.basename(e)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:g}=await import('./pythonRapidkitExec-4MP62M5R.js');if(!await g()&&!r){n.start("Checking optional global pipx installation");let a=await tt(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await N(a,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(i){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${i}`);}}}catch(g){n.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${g}`);}}async function Et(e,o,n,r,l$1=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:c}=await import('./pythonRapidkitExec-4MP62M5R.js'),u=await c();if(u.isCompatible){o.succeed(`RapidKit ${u.installedVersion??""} already compatible globally; skipping pipx installation`),await k.outputFile(m.join(e,".rapidkit-global"),`RapidKit already available globally (version ${u.installedVersion??"unknown"}) and satisfies expected constraint ${u.expectedConstraint??"n/a"}; workspace will reuse the existing installation
231
+ `,"utf-8");return}u.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.'):u.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.'),a$1.debug(`Global RapidKit install is not reusable via version-aware policy (reason=${u.reason}, installed=${u.installedVersion??"unknown"}, expected=${u.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(c){a$1.debug(`Global RapidKit version-aware check failed before pipx install: ${c}`);}let p=await tt(o,l$1);if(o.start("Installing RapidKit globally with pipx"),n){let c=d$2(r||{});if(!c)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${c}`),o.text="Installing RapidKit from local path (test mode)",await N(p,["install","-e",c]);}else {o.text="Installing RapidKit from PyPI";try{await N(p,["install","rapidkit-core"]);}catch(c){try{o.text="RapidKit already installed globally, upgrading to match expected version",await N(p,["upgrade","rapidkit-core"]);}catch(u){throw a$1.debug(`pipx install/upgrade failed: install=${c}, upgrade=${u}`),new l}}}o.succeed("RapidKit installed globally"),await k.outputFile(m.join(e,".rapidkit-global"),`RapidKit installed globally with pipx
232
+ `,"utf-8");}async function ce(e,o){let{skipGit:n=false,testMode:r=false,userConfig:l={},yes:p=false,installMethod:c,pythonVersion:u="3.10"}=o||{},g=c||l.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),h=g==="poetry"&&!await xt()?"venv":g;await z(e,m.basename(e),h),await V(e),await Y(e,m.basename(e),h,u,o?.profile);let a=O("Registering workspace").start();try{h==="poetry"?(await U(e,m.basename(e)),await _t(e,u,a,r,l,p)):h==="venv"?await ct(e,u,a,r,l):await Et(e,a,r,l,p),await It(e,h),await jt(e,h),a.succeed("Workspace registered");try{let{registerWorkspace:i}=await import('./workspace-EHYCBFXL.js');await i(e,m.basename(e));}catch{}if(!n){a.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}),a.succeed("Git repository initialized");}catch{a.warn("Could not initialize git repository");}}}catch(i){throw a.fail("Failed to register workspace"),i}}async function jt(e,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
233
+ # 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):
224
234
  ./rapidkit --help
225
235
  # or:
226
- poetry run rapidkit --help`:n==="venv"?`# No activation needed (recommended):
236
+ poetry run rapidkit --help`:o==="venv"?`# No activation needed (recommended):
227
237
  ./rapidkit --help
228
238
  # or direct:
229
239
  ./.venv/bin/rapidkit --help`:`# Optional: use the local launcher
@@ -234,7 +244,7 @@ This directory contains a RapidKit development environment.
234
244
 
235
245
  ## Installation Method
236
246
 
237
- **${n==="poetry"?"Poetry":n==="venv"?"Python venv + pip":"pipx (global)"}**
247
+ **${o==="poetry"?"Poetry":o==="venv"?"Python venv + pip":"pipx (global)"}**
238
248
 
239
249
  ## Getting Started
240
250
 
@@ -249,7 +259,7 @@ ${r}
249
259
  ### 1. Activate Environment
250
260
 
251
261
  \`\`\`bash
252
- ${o}
262
+ ${n}
253
263
  \`\`\`
254
264
 
255
265
  ### 2. Create Your First Project
@@ -316,8 +326,8 @@ For full documentation, visit: [RapidKit Docs](https://getrapidkit.com) *(or app
316
326
  ## Workspace Structure
317
327
 
318
328
  \`\`\`
319
- ${n==="venv"?".venv/ # Python virtual environment":""}
320
- ${n==="poetry"?"pyproject.toml # Poetry configuration":""}
329
+ ${o==="venv"?".venv/ # Python virtual environment":""}
330
+ ${o==="poetry"?"pyproject.toml # Poetry configuration":""}
321
331
  my-project/ # Your RapidKit projects go here
322
332
  README.md # This file
323
333
  \`\`\`
@@ -330,7 +340,7 @@ If you encounter issues:
330
340
  2. Check RapidKit installation: \`rapidkit --version\`
331
341
  3. Run diagnostics: \`rapidkit doctor\`
332
342
  4. Visit RapidKit documentation or GitHub issues
333
- `;await promises.writeFile(m.join(e,"README.md"),p,"utf-8");}async function Ot(e,n,o){let r=O("Creating demo workspace").start();try{await k.ensureDir(e),r.succeed("Directory created"),r.start("Setting up demo kit generator");let l=JSON.stringify({name:`${n}-workspace`,version:"1.0.0",private:true,description:"RapidKit demo workspace",scripts:{generate:"node generate-demo.js"}},null,2);await promises.writeFile(m.join(e,"package.json"),l,"utf-8"),await promises.writeFile(m.join(e,"generate-demo.js"),`#!/usr/bin/env node
343
+ `;await promises.writeFile(m.join(e,"README.md"),p,"utf-8");}async function Gt(e,o,n){let r=O("Creating demo workspace").start();try{await k.ensureDir(e),r.succeed("Directory created"),r.start("Setting up demo kit generator");let l=JSON.stringify({name:`${o}-workspace`,version:"1.0.0",private:true,description:"RapidKit demo workspace",scripts:{generate:"node generate-demo.js"}},null,2);await promises.writeFile(m.join(e,"package.json"),l,"utf-8"),await promises.writeFile(m.join(e,"generate-demo.js"),`#!/usr/bin/env node
334
344
  /**
335
345
  * Demo Kit Generator - Create FastAPI demo projects
336
346
  *
@@ -726,7 +736,7 @@ venv/
726
736
  }
727
737
 
728
738
  main().catch(console.error);
729
- `,"utf-8");try{await execa("chmod",["+x",m.join(e,"generate-demo.js")]);}catch{}let u=`# RapidKit Demo Workspace
739
+ `,"utf-8");try{await execa("chmod",["+x",m.join(e,"generate-demo.js")]);}catch{}let c=`# RapidKit Demo Workspace
730
740
 
731
741
  Welcome to your RapidKit demo workspace! This environment lets you generate FastAPI demo projects using bundled RapidKit templates, without needing to install Python RapidKit.
732
742
 
@@ -797,7 +807,7 @@ pipx install rapidkit
797
807
  ## \u{1F6E0}\uFE0F Workspace Structure
798
808
 
799
809
  \`\`\`
800
- ${n}/
810
+ ${o}/
801
811
  \u251C\u2500\u2500 generate-demo.js # Demo project generator
802
812
  \u251C\u2500\u2500 README.md # This file
803
813
  \u2514\u2500\u2500 my-api/ # Your generated projects go here
@@ -813,7 +823,7 @@ ${n}/
813
823
  ---
814
824
 
815
825
  **Generated with RapidKit** | [GitHub](https://github.com/rapidkitlabs/rapidkit-npm)
816
- `;if(await promises.writeFile(m.join(e,"README.md"),u,"utf-8"),r.succeed("Demo workspace setup complete"),!o){r.start("Initializing git repository");try{await execa("git",["init"],{cwd:e}),await k.outputFile(m.join(e,".gitignore"),`# Dependencies
826
+ `;if(await promises.writeFile(m.join(e,"README.md"),c,"utf-8"),r.succeed("Demo workspace setup complete"),!n){r.start("Initializing git repository");try{await execa("git",["init"],{cwd:e}),await k.outputFile(m.join(e,".gitignore"),`# Dependencies
817
827
  node_modules/
818
828
 
819
829
  # Generated projects
@@ -829,14 +839,14 @@ __pycache__/
829
839
  `,"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(`
830
840
  \u2728 Demo workspace created successfully!
831
841
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(e)),console.log(t.cyan(`\u{1F680} Get started:
832
- `)),console.log(t.white(` cd ${n}`)),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(l){throw r.fail("Failed to create demo workspace"),l}}async function Vt(e,n,o,r,l,p,u){if(console.log(t.cyan(`
842
+ `)),console.log(t.white(` cd ${o}`)),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(l){throw r.fail("Failed to create demo workspace"),l}}async function Lt(e,o,n,r,l,p,c){if(console.log(t.cyan(`
833
843
  \u{1F50D} Dry-run mode - what would be created:
834
- `)),console.log(t.white("\u{1F4C2} Workspace path:"),e),console.log(t.white("\u{1F4DB} Name:"),t.cyan(n)),o)console.log(t.white("\u{1F4E6} Type:"),"Demo environment"),console.log(t.white(`
844
+ `)),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(`
835
845
  \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(`
836
- \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 y=l||"minimal",g=p,h=u,i=new Set(["python-only","polyglot","enterprise"]).has(y);console.log(t.white("\u{1F4E6} Profile:"),t.cyan(y)),console.log(t.white("\u{1F4DD} Configuration:")),i?(console.log(t.gray(` - Python version: ${h}`)),console.log(t.gray(` - Install method: ${g}`)),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(`
846
+ \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 u=l||"minimal",g=p,h=c,i=new Set(["python-only","polyglot","enterprise"]).has(u);console.log(t.white("\u{1F4E6} Profile:"),t.cyan(u)),console.log(t.white("\u{1F4DD} Configuration:")),i?(console.log(t.gray(` - Python version: ${h}`)),console.log(t.gray(` - Install method: ${g}`)),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(`
837
847
  \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")),i&&console.log(t.gray(` - ${g==="poetry"?"pyproject.toml + poetry.lock":".venv/ (virtual environment)"}`)),console.log(t.white(`
838
848
  \u2699\uFE0F Environment setup:`)),i&&console.log(g==="poetry"?t.gray(" - Poetry virtual environment created (recommended, includes dependency management)"):g==="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(`
839
- \u{1F680} Next steps:`)),console.log(t.gray(" 1. cd "+n)),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(`
840
- \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|polyglot|enterprise")),console.log(t.gray(" \u2022 Help: npx rapidkit --help"));}console.log(t.white(`
849
+ \u{1F680} Next steps:`)),console.log(t.gray(" 1. cd "+o)),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(`
850
+ \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(`
841
851
  \u2728 To proceed: remove --dry-run flag
842
- `));}export{re as createProject,se as registerWorkspaceAtPath,ae as syncWorkspaceFoundationFiles,Pt as writeWorkspaceLauncher};
852
+ `));}export{le as createProject,ce as registerWorkspaceAtPath,se as syncWorkspaceFoundationFiles,It as writeWorkspaceLauncher};