rapidkit 0.41.5 → 0.42.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 (54) hide show
  1. package/contracts/extension-cli-compatibility.v1.json +1 -1
  2. package/dist/analyze-XSPWKPA4.js +1 -0
  3. package/dist/autopilot-release-MVFRZMHD.js +1 -0
  4. package/dist/chunk-2LBPX5K3.js +2 -0
  5. package/dist/chunk-2ZLIVGO7.js +2 -0
  6. package/dist/{chunk-U7TS7W2V.js → chunk-3HBNF2A3.js} +1 -1
  7. package/dist/{chunk-UZW5QFRW.js → chunk-4KUIFXHM.js} +3 -3
  8. package/dist/chunk-4ZSDU5OO.js +4 -0
  9. package/dist/{chunk-U5IRABWC.js → chunk-5PFGOXBQ.js} +2 -2
  10. package/dist/chunk-5QAVZET2.js +1 -0
  11. package/dist/{chunk-HCJV2ITA.js → chunk-DZU4KPPW.js} +1 -1
  12. package/dist/chunk-F7GYXSBT.js +916 -0
  13. package/dist/{chunk-THSTNVE3.js → chunk-FB35IONI.js} +1 -1
  14. package/dist/chunk-FEA53XL6.js +4 -0
  15. package/dist/chunk-FSIZLBTL.js +1 -0
  16. package/dist/{chunk-TXUBE6KV.js → chunk-IS2XUPMP.js} +1 -1
  17. package/dist/chunk-LANBSCGS.js +13 -0
  18. package/dist/{chunk-FI4VMG2I.js → chunk-M44C2P3R.js} +1 -1
  19. package/dist/{chunk-SO2SSVWN.js → chunk-MQGVCTUL.js} +1 -1
  20. package/dist/{chunk-GDWLW7GF.js → chunk-QKVEWX4L.js} +1 -1
  21. package/dist/{chunk-3VI4Y7LZ.js → chunk-QOH5TIRZ.js} +1 -1
  22. package/dist/{chunk-T5GS4BUP.js → chunk-YM5Q3PV6.js} +1 -1
  23. package/dist/chunk-YWUWRSNO.js +1 -0
  24. package/dist/{create-P3USIH52.js → create-EAE2AJJL.js} +1 -1
  25. package/dist/{doctor-KYNACWFC.js → doctor-E6JE4Q3B.js} +1 -1
  26. package/dist/index.js +160 -159
  27. package/dist/{pipeline-SU3FJUKI.js → pipeline-TRA4MMZC.js} +1 -1
  28. package/dist/{workspace-5DKOA7TN.js → workspace-IBTKZX7T.js} +1 -1
  29. package/dist/{workspace-agent-sync-HZ4UBSZ2.js → workspace-agent-sync-LEYLJ42D.js} +1 -1
  30. package/dist/{workspace-context-R3XWWLFP.js → workspace-context-NTG3D4DI.js} +1 -1
  31. package/dist/workspace-explain-P2EBRNP6.js +1 -0
  32. package/dist/{workspace-foundation-H6IPS4MW.js → workspace-foundation-6AUEEJQQ.js} +1 -1
  33. package/dist/{workspace-intelligence-5BBKUJAG.js → workspace-intelligence-C6NT557E.js} +1 -1
  34. package/dist/{workspace-marker-HAC7BMEG.js → workspace-marker-5GAJSOFP.js} +1 -1
  35. package/dist/{workspace-mcp-serve-TQTJ4HWI.js → workspace-mcp-serve-GM7A3IVM.js} +1 -1
  36. package/dist/{workspace-model-YAC5BKLL.js → workspace-model-AOTSEAVW.js} +1 -1
  37. package/dist/workspace-python-engine-state-AEEZ7QYB.js +2 -0
  38. package/dist/workspace-run-ATFFJCMK.js +1 -0
  39. package/dist/{workspace-verify-5RZSDKGR.js → workspace-verify-7R3XBNKE.js} +1 -1
  40. package/dist/{workspace-watch-P2PGSYDD.js → workspace-watch-SGY2DEZ5.js} +1 -1
  41. package/docs/commands-reference.md +30 -3
  42. package/package.json +2 -2
  43. package/dist/analyze-JYHEGUSH.js +0 -1
  44. package/dist/autopilot-release-ZADU63OD.js +0 -1
  45. package/dist/chunk-7BEZH5LE.js +0 -2
  46. package/dist/chunk-DAPZJHMN.js +0 -4
  47. package/dist/chunk-E5ZVQL3C.js +0 -13
  48. package/dist/chunk-LRF6PQOZ.js +0 -1
  49. package/dist/chunk-P5NZE2RV.js +0 -883
  50. package/dist/chunk-Q4HEXEDW.js +0 -4
  51. package/dist/chunk-T7B3GF3Q.js +0 -1
  52. package/dist/chunk-YBS2HGO3.js +0 -2
  53. package/dist/workspace-explain-5RDFGHUN.js +0 -1
  54. package/dist/workspace-run-P5UOJSLQ.js +0 -1
@@ -0,0 +1,916 @@
1
+ import {k,e as e$2}from'./chunk-YWUWRSNO.js';import {b as b$2}from'./chunk-CDCYRBAY.js';import {e,g,f as f$1,b as b$4,c as c$1,d as d$1}from'./chunk-LANBSCGS.js';import {a,d,b as b$1}from'./chunk-2LBPX5K3.js';import {b}from'./chunk-Q2KZIBV4.js';import {f,c,e as e$3}from'./chunk-OLDPVVSV.js';import {b as b$3,j,i,l,h,q as q$1}from'./chunk-WRMCPKGA.js';import {promises}from'fs';import*as v from'fs-extra';import y from'path';import e$1 from'chalk';import {execa}from'execa';async function L(t,o={}){let n=y.resolve(t),s=o.workspaceName??y.basename(n);try{let{registerWorkspace:a}=await import('./workspace-IBTKZX7T.js');await a(n,s);}catch(a){o.silent||console.warn(e$1.gray(`Note: Could not register workspace in shared registry: ${a?.message??a}`));}try{let{syncWorkspaceContract:a}=await import('./workspace-contract-OO4GMENV.js'),l=await a({workspacePath:n});if(o.silent||console.log(e$1.gray(`\u2139\uFE0F Workspace intelligence synced (contract + registry summary, ${l.contract.projects.length} project(s)).`)),!o.silent&&l.verification.status!=="passed"){console.log(e$1.yellow("\u26A0\uFE0F Workspace contract verification reported issues."));for(let d of l.verification.violations)console.log(e$1.gray(` Violation: ${d}`));console.log(e$1.white(" Next: npx rapidkit workspace contract inspect"));}}catch(a){o.silent||console.warn(e$1.gray(`Note: Could not sync workspace intelligence layer: ${a?.message??a}`));}}function K(){return h()}async function U(t,o,n,s,a){let l=d(o,b(),n,a?.pythonEngine?{coreStatus:a.pythonEngine,...a.pythonEngineReason?{coreReason:a.pythonEngineReason}:{},...s?{pythonVersion:s}:{}}:void 0);s&&!a?.pythonEngine&&(l.metadata||(l.metadata={}),l.metadata.python={pythonVersion:s}),await b$1(t,l);}async function G(t){await v.outputFile(y.join(t,".gitignore"),`.venv/
2
+ __pycache__/
3
+ *.pyc
4
+ .env
5
+ .rapidkit-workspace/
6
+
7
+ `,"utf-8");}async function Ie(t,o){let n=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await v.outputFile(y.join(t,"poetry.toml"),`[virtualenvs]
8
+ in-project = true
9
+ `,"utf-8"),await v.outputFile(y.join(t,"pyproject.toml"),`[tool.poetry]
10
+ name = "${n}"
11
+ version = "0.1.0"
12
+ description = "RapidKit workspace"
13
+ authors = []
14
+ package-mode = false
15
+
16
+ [tool.poetry.dependencies]
17
+ python = "^3.10"
18
+ rapidkit-core = "*"
19
+
20
+ [build-system]
21
+ requires = ["poetry-core"]
22
+ build-backend = "poetry.core.masonry.api"
23
+ `,"utf-8");}function Ee(t,o,n,s,a){return JSON.stringify({schema_version:"1.0",workspace_name:t,rapidkit_version:b(),created_at:new Date().toISOString(),created_by:"rapidkit-npm",profile:s||"minimal",...a?.profileRequested?{profile_requested:a.profileRequested}:{},...a?.bootstrapNote?{bootstrap_note:a.bootstrapNote}:{},engine:{install_method:o,python_version:n||null,...a?.pythonEngine?{python_core:{status:a.pythonEngine,...a.pythonEngineReason?{reason:a.pythonEngineReason}:{}}}:{}}},null,2)}function _e(t,o,n,s,a,l){return JSON.stringify({schema_version:"1.0",generated_by:"rapidkit-npm",generated_at:new Date().toISOString(),runtime:{python:{version:o||null,install_method:t,...l?.pythonEngine?{core:{status:l.pythonEngine,...l.pythonEngineReason?{reason:l.pythonEngineReason}:{}}}:{}},node:{version:n||process.version},go:{version:s||null},java:{version:null,build_tool:null,build_tool_version:null},dotnet:{version:a||null,sdk:a||null}}},null,2)}function je(){return `version: "1.0"
24
+ mode: warn # "warn" or "strict"
25
+ dependency_sharing_mode: isolated # "isolated" or "shared-runtime-caches" or "shared-node-deps"
26
+ # change profile (recommended): npx rapidkit bootstrap --profile polyglot
27
+ # change mode/dependency manually: edit this file and rerun npx rapidkit init
28
+ rules:
29
+ enforce_workspace_marker: true
30
+ enforce_toolchain_lock: false
31
+ disallow_untrusted_tool_sources: false
32
+ `}function Ce(){return `version: "1.0"
33
+ cache:
34
+ strategy: shared # "shared" or "on-demand"
35
+ prune_on_bootstrap: false
36
+ self_heal: true
37
+ verify_integrity: false
38
+ `}async function $e(){try{let{stdout:t}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),o=t.match(/go(\d+\.\d+(?:\.\d+)?)/i);return o?o[1]:void 0}catch{return}}async function Ae(){try{let{stdout:t}=await execa("dotnet",["--version"],{timeout:3e3,stdio:"pipe"}),o=t.trim();return o.length>0?o:void 0}catch{return}}async function q(t,o,n,s,a,l){let[d,u]=await Promise.all([$e(),Ae()]);await v.outputFile(y.join(t,".rapidkit","workspace.json"),Ee(o,n,s,a,l),"utf-8"),await v.outputFile(y.join(t,".rapidkit","toolchain.lock"),_e(n,s,process.version,d,u,l),"utf-8"),await v.outputFile(y.join(t,".rapidkit","policies.yml"),je(),"utf-8"),await v.outputFile(y.join(t,".rapidkit","cache-config.yml"),Ce(),"utf-8");}async function xt(t,o){let{workspaceName:n=y.basename(t),installMethod:s="venv",pythonVersion:a$1,profile:l,writeMarker:d$1=true,writeGitignore:u=true,onlyIfMissing:p=true}=o||{},w=[],[g,m]=await Promise.all([$e(),Ae()]),r=[{relPath:y.join(".rapidkit","workspace.json"),content:Ee(n,s,a$1,l)},{relPath:y.join(".rapidkit","toolchain.lock"),content:_e(s,a$1,process.version,g,m)},{relPath:y.join(".rapidkit","policies.yml"),content:je()},{relPath:y.join(".rapidkit","cache-config.yml"),content:Ce()}];for(let i of r){let b=y.join(t,i.relPath);p&&await v.pathExists(b)||(await v.outputFile(b,i.content,"utf-8"),w.push(i.relPath));}if(d$1&&(!!!await a(t)||!p)){let b$2=d(n,b(),s);a$1&&(b$2.metadata||(b$2.metadata={}),b$2.metadata.python={pythonVersion:a$1}),await b$1(t,b$2),w.push(".rapidkit-workspace");}if(u){let i=y.join(t,".gitignore");(!p||!await v.pathExists(i))&&(await G(t),w.push(".gitignore"));}return w}var Se=new Set(["go-only","java-only","dotnet-only","node-only","minimal"]),Ge={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"};function We(t){let o=t,n=new Set;for(;!Se.has(o);){if(n.has(o))return "minimal";n.add(o);let s=Ge[o];if(!s)return "minimal";o=s;}return o}var V="3.10",Me=["3.10","3.11","3.12"];async function xe(t){try{let{stdout:o}=await execa(t,["--version"],{timeout:3e3}),n=o.match(/Python (\d+\.\d+\.\d+)/);if(n)return n[1]}catch{}return null}async function He(t,o){try{await promises.writeFile(y.join(t,".python-version"),`${o}
39
+ `,"utf-8"),f.debug(`Created .python-version with ${o}`);}catch(n){f.warn(`Failed to create .python-version: ${n}`);}}function H(){let n=[...(process.env.PATH||"").split(y.delimiter).filter(Boolean)];for(let s of q$1())n.includes(s)||n.unshift(s);process.env.PATH=n.join(y.delimiter);}async function oe(t,o){H(),t.start("Checking pipx installation");try{return await execa("pipx",["--version"]),t.succeed("pipx found"),{kind:"binary"}}catch{}let n=K();try{return await execa(n,["-m","pipx","--version"]),t.succeed("pipx found"),{kind:"python-module",pythonCmd:n}}catch{}if(o)throw new d$1;t.stop?.();let{installPipx:s}=await b$2([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!s)throw new d$1;t.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 l=a,d=String(l?.stderr||l?.shortMessage||l?.message||"");throw new f$1("Install pipx with python -m pip",a instanceof Error?a:new Error(d))}t.succeed("pipx installed"),H();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(a){let l=a,d=String(l?.stderr||l?.shortMessage||l?.message||"pipx not runnable after install");throw new f$1("Verify pipx after install",new Error(`${d}
40
+
41
+ Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function W(t,o){return t.kind==="binary"?execa("pipx",o):execa(t.pythonCmd,["-m","pipx",...o])}function ze(t){let o=t.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function Re(t){if(!t)return null;let o=t.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function ue(t,o){let[n,s]=t.split(".").map(d=>Number(d)),[a,l]=o.split(".").map(d=>Number(d));return n!==a?n-a:s-l}function Y(t,o){return ue(t,o)>=0}async function Ue(t){let o=new Set,n=j(14,10);for(let m of n)try{let r=await execa(m.command,m.args,{timeout:2500}),i=Re(`${r.stdout||""}
42
+ ${r.stderr||""}`);i&&Y(i,V)&&o.add(i);}catch{}let s=null;try{let m=await execa(K(),["--version"],{timeout:2500}),r=Re(`${m.stdout||""}
43
+ ${m.stderr||""}`);r&&Y(r,V)&&(s=r,o.add(r));}catch{}let a=Me.filter(m=>Y(m,V)),l=new Set([...a,...o]),d=Array.from(l).sort((m,r)=>ue(r,m)),u=t?ze(t):null,p=u&&Y(u,V)?u:s||d[0]||V;return l.has(p)||l.add(p),{choices:Array.from(l).sort((m,r)=>ue(r,m)).map(m=>{let r=[];return m===s&&r.push("current system"),m===V&&r.push("minimum supported"),o.has(m)&&m!==s&&r.push("detected"),{name:r.length>0?`${m} (${r.join(", ")})`:m,value:m}}),defaultValue:p}}async function qe(){H();let t=false,o=false;try{await execa("poetry",["--version"],{timeout:2500}),t=true;}catch{t=false;}try{await execa("pipx",["--version"],{timeout:2500}),o=true;}catch{let n=h();try{await execa(n,["-m","pipx","--version"],{timeout:2500}),o=true;}catch{o=false;}}return {poetry:t,pipx:o}}async function Ke(){H();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function Ye(t,o){return t==="poetry"&&o.poetry?"poetry":t==="pipx"&&o.pipx?"pipx":t==="venv"?"venv":o.poetry?"poetry":"venv"}async function Be(t,o){H(),t.start("Checking Poetry installation");try{await execa("poetry",["--version"]),t.succeed("Poetry found");return}catch{}if(o)throw new c$1;let{installPoetry:n}=await b$2([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!n)throw new c$1;let s=await oe(t,o);t.start("Installing Poetry with pipx");try{await W(s,["install","poetry"]);}catch(a){let l=a,d=String(l?.stderr||l?.shortMessage||l?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(d))try{await W(s,["upgrade","poetry"]);}catch{}else throw new f$1("Install Poetry with pipx",a instanceof Error?a:new Error(d))}t.succeed("Poetry installed"),H();try{await execa("poetry",["--version"]);}catch(a){let l=a,d=String(l?.stderr||l?.shortMessage||l?.message||"Poetry not found on PATH");throw new f$1("Verify Poetry after pipx install",new Error(`${d}
44
+
45
+ Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function Je(t,o={}){let n=t==="poetry",s=o.pythonEngineSkipped?`echo "- Python engine installation was intentionally skipped for this workspace." 1>&2
46
+ echo "- For npm-owned workspace commands, run: npx rapidkit <command>" 1>&2
47
+ echo "- To install the local Python engine later, create a RapidKit module-enabled project, then run: npx rapidkit workspace run init" 1>&2
48
+ `:`echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
49
+ `;return `#!/usr/bin/env sh
50
+ set -eu
51
+
52
+ SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
53
+
54
+ VENV_RAPIDKIT="$SCRIPT_DIR/.venv/bin/rapidkit"
55
+ if [ -x "$VENV_RAPIDKIT" ]; then
56
+ exec "$VENV_RAPIDKIT" "$@"
57
+ fi
58
+
59
+ ${n?`if command -v poetry >/dev/null 2>&1 && [ -f "$SCRIPT_DIR/pyproject.toml" ]; then
60
+ exec poetry run rapidkit "$@"
61
+ fi
62
+
63
+ `:""}if command -v rapidkit >/dev/null 2>&1; then
64
+ RAPIDKIT_CMD=$(command -v rapidkit)
65
+ if [ "$RAPIDKIT_CMD" != "$SCRIPT_DIR/rapidkit" ] && [ "$RAPIDKIT_CMD" != "$SCRIPT_DIR/.rapidkit/rapidkit" ]; then
66
+ RAPIDKIT_LOCAL_LAUNCHER_BYPASS=1 exec "$RAPIDKIT_CMD" "$@"
67
+ fi
68
+ fi
69
+
70
+ for RAPIDKIT_CORE in "$HOME/.local/bin/rapidkit" "$HOME/Library/Python/3.14/bin/rapidkit" "$HOME/Library/Python/3.13/bin/rapidkit" "$HOME/Library/Python/3.12/bin/rapidkit" "$HOME/Library/Python/3.11/bin/rapidkit" "$HOME/Library/Python/3.10/bin/rapidkit"; do
71
+ if [ -x "$RAPIDKIT_CORE" ]; then
72
+ exec "$RAPIDKIT_CORE" "$@"
73
+ fi
74
+ done
75
+
76
+ echo "RapidKit launcher could not find a local Python CLI." 1>&2
77
+ ${s}${o.pythonEngineSkipped?"":n?`echo "- If you used Poetry: run 'poetry install' and retry, or activate the env." 1>&2
78
+ `:""}${o.pythonEngineSkipped?`echo "Tip: use 'npx rapidkit workspace model --json' for Workspace Intelligence without the Python engine." 1>&2
79
+ `:`echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
80
+ `}exit 1
81
+ `}function Qe(t,o={}){let n=t==="poetry",s=o.pythonEngineSkipped?`echo - Python engine installation was intentionally skipped for this workspace. 1>&2
82
+ echo - For npm-owned workspace commands, run: npx rapidkit ^<command^> 1>&2
83
+ echo - To install the local Python engine later, create a RapidKit module-enabled project, then run: npx rapidkit workspace run init 1>&2
84
+ `:`echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
85
+ `;return `@echo off
86
+ setlocal
87
+
88
+ set "SCRIPT_DIR=%~dp0"
89
+
90
+ if exist "%SCRIPT_DIR%\\.venv\\Scripts\\rapidkit.exe" (
91
+ "%SCRIPT_DIR%\\.venv\\Scripts\\rapidkit.exe" %*
92
+ exit /b %ERRORLEVEL%
93
+ )
94
+
95
+ ${n?`where poetry >nul 2>nul
96
+ if %ERRORLEVEL%==0 if exist "%SCRIPT_DIR%\\pyproject.toml" (
97
+ poetry run rapidkit %*
98
+ exit /b %ERRORLEVEL%
99
+ )
100
+
101
+ `:""}:rapidkit_npm_wrapper_fallback
102
+ for /f "delims=" %%R in ('where rapidkit.cmd 2^>nul') do (
103
+ if /I not "%%~fR"=="%SCRIPT_DIR%rapidkit.cmd" if /I not "%%~fR"=="%SCRIPT_DIR%.rapidkit\\rapidkit.cmd" (
104
+ set "RAPIDKIT_LOCAL_LAUNCHER_BYPASS=1"
105
+ "%%~fR" %*
106
+ exit /b %ERRORLEVEL%
107
+ )
108
+ )
109
+
110
+ :rapidkit_core_fallback
111
+ for %%R in ("%USERPROFILE%\\.local\\bin\\rapidkit.exe" "%APPDATA%\\Python\\Scripts\\rapidkit.exe" "%LOCALAPPDATA%\\Programs\\Python\\Scripts\\rapidkit.exe") do (
112
+ if exist "%%~R" (
113
+ "%%~R" %*
114
+ exit /b %ERRORLEVEL%
115
+ )
116
+ )
117
+
118
+ echo RapidKit launcher could not find a local Python CLI. 1>&2
119
+ ${s}echo Tip: for npm-owned workspace commands, run npx --yes --package rapidkit rapidkit %* from a shell where npm is on PATH. 1>&2
120
+ exit /b 1
121
+ `}async function ye(t,o,n={}){await v.outputFile(y.join(t,"rapidkit"),Je(o,n),{encoding:"utf-8",mode:493}),await v.outputFile(y.join(t,"rapidkit.cmd"),Qe(o,n),"utf-8");}async function Rt(t,o){let{skipGit:n=false,skipPythonEngine:s=false,testMode:a=false,demoMode:l=false,dryRun:d=false,yes:u=false,userConfig:p={},installMethod:w,profile:g,parentDirectory:m}=o,r=t||"rapidkit",i=m?y.resolve(m,r):y.resolve(process.cwd(),r);if(await v.pathExists(i))throw new e(r);if(d){let h=g||(u?"minimal":void 0),I=w||p.defaultInstallMethod||"poetry",x=p.pythonVersion||"3.10";await Ze(i,r,l,p,h,I,x);return}if(l){await Xe(i,r,n);return}let b=new Set(["python-only","polyglot","enterprise"]),f$1=g||"";if(!u&&!g){let{selectedProfile:h}=await b$2([{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}]);f$1=h;}else f$1||(f$1="minimal");let S=!u&&b.has(f$1),_=b.has(f$1)&&s?"skip":S?(await b$2([{type:"confirm",name:"installPythonEngine",message:"Install the optional RapidKit Python engine now? (needed for Python-backed kits/modules)",default:true}])).installPythonEngine!==false?"install":"skip":"install",F=S&&_==="install",ne=typeof p.pythonVersion=="string"&&p.pythonVersion.trim().length>0?p.pythonVersion.trim():void 0,Oe=w||p.defaultInstallMethod||"poetry",ie=F?await qe():{poetry:true,pipx:true},me=F?await Ue(ne):{choices:Me.map(h=>({name:h,value:h})),defaultValue:V},Le=Ye(Oe,ie),Ve=[{name:ie.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:ie.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"}],R=F?await b$2([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:me.choices,default:me.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:Ve,default:Le}]):await(async()=>{if(_==="skip")return {pythonVersion:p.pythonVersion||"3.10",installMethod:"venv"};let h=w||p.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return f.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:p.pythonVersion||"3.10",installMethod:h}})();F&&(console.log(e$1.gray(`
122
+ \u{1F4CC} Configuration notes:`)),R.pythonVersion==="3.10"?console.log(e$1.gray(" \u2022 Python 3.10: Latest stable with widespread compatibility")):R.pythonVersion==="3.11"?console.log(e$1.gray(" \u2022 Python 3.11: Newer, faster (3.10-3.11: ~10% speed improvement)")):R.pythonVersion==="3.12"&&console.log(e$1.gray(" \u2022 Python 3.12: Cutting edge, excellent for performance")),R.installMethod==="poetry"?console.log(e$1.gray(" \u2022 Poetry: Dependency management + virtual env (recommended for teams)")):R.installMethod==="venv"?console.log(e$1.gray(" \u2022 venv: Standard library approach, lightweight, zero dependencies")):console.log(e$1.gray(" \u2022 pipx: Global isolated, RapidKit CLI only, no local venv")),console.log(""));let ae=Se;if(ae.has(f$1)){let h=c("Creating workspace",{component:"create",phase:"workspace.python-free"});try{await v.ensureDir(i),h.succeed("Directory created"),await U(i,r,"venv",void 0),await q(i,r,"venv",void 0,f$1),await G(i);let I={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await v.outputFile(y.join(i,"README.md"),`# ${r}
123
+
124
+ RapidKit **${I[f$1]}** workspace.
125
+
126
+ ## Quick start
127
+
128
+ \`\`\`bash
129
+ `+(f$1==="go-only"?`npx rapidkit create project gofiber.standard my-api
130
+ cd my-api
131
+ npx rapidkit init
132
+ npx rapidkit dev
133
+ `:f$1==="java-only"?`npx rapidkit create project springboot.standard my-service
134
+ cd my-service
135
+ npx rapidkit init
136
+ npx rapidkit dev
137
+ `:f$1==="dotnet-only"?`npx rapidkit create project dotnet.webapi.clean my-api
138
+ cd my-api
139
+ npx rapidkit init
140
+ npx rapidkit dev
141
+ `:f$1==="node-only"?`npx rapidkit create project nestjs.standard my-app
142
+ cd my-app
143
+ npx rapidkit init
144
+ npx rapidkit dev
145
+ `:`npx rapidkit create project
146
+ cd <project-name>
147
+ npx rapidkit init
148
+ npx rapidkit dev
149
+ `)+"```\n","utf-8"),!n){h.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 workspace"],{cwd:i}),h.succeed("Git repository initialized");}catch{h.warn("Could not initialize git repository");}}if(await L(i,{workspaceName:r,silent:a}),console.log(e$1.green(`
150
+ \u2728 Workspace created!
151
+ `)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan(`
152
+ \u{1F680} Get started:
153
+ `)),console.log(e$1.white(` ${k(i)}`)),f$1==="go-only"){console.log(e$1.white(" npx rapidkit create project gofiber.standard my-api")),console.log(e$1.white(" cd my-api")),console.log(e$1.white(" npx rapidkit init")),console.log(e$1.white(` npx rapidkit dev
154
+ `)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:x}=await execa("go",["version"],{timeout:3e3}),k=x.match(/go version go(\d+\.\d+(?:\.\d+)?)/),D=k?k[1]:"unknown";console.log(e$1.gray(`\u{1F439} Go ${D} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(e$1.yellow(`
155
+ \u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else if(f$1==="java-only")console.log(e$1.white(" npx rapidkit create project springboot.standard my-service")),console.log(e$1.white(" cd my-service")),console.log(e$1.white(" npx rapidkit init")),console.log(e$1.white(` npx rapidkit dev
156
+ `)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."));else if(f$1==="dotnet-only"){console.log(e$1.white(" npx rapidkit create project dotnet.webapi.clean my-api")),console.log(e$1.white(" cd my-api")),console.log(e$1.white(" npx rapidkit init")),console.log(e$1.white(` npx rapidkit dev
157
+ `)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 ASP.NET Core kit runs through the npm package with .NET tooling."));try{let{stdout:x}=await execa("dotnet",["--version"],{timeout:3e3});console.log(e$1.gray(`\u2699\uFE0F .NET SDK ${x.trim()} detected \u2014 ready for ASP.NET Core projects`));}catch{console.log(e$1.yellow(`
158
+ \u26A0\uFE0F .NET SDK is not installed \u2014 install it from https://dotnet.microsoft.com/download`));}}else f$1==="node-only"?(console.log(e$1.white(" npx rapidkit create project nestjs.standard my-app")),console.log(e$1.white(" cd my-app")),console.log(e$1.white(" npx rapidkit init")),console.log(e$1.white(` npx rapidkit dev
159
+ `)),console.log(e$1.gray("\u{1F4A1} Node lifecycle commands run through Node tooling. RapidKit module commands for module-enabled kits can install the local Python engine later with workspace run init."))):(console.log(e$1.white(" npx rapidkit create project")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" npx rapidkit init")),console.log(e$1.white(` npx rapidkit dev
160
+ `)),console.log(e$1.gray("\u{1F4A1} Bootstrap a specific runtime: rapidkit bootstrap --profile java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")));console.log(e$1.cyan(`
161
+ \u{1F4DA} More info:`)),console.log(e$1.gray(" \u2022 Change profile anytime: rapidkit bootstrap --profile <profile>")),console.log(e$1.gray(" \u2022 View config: cat "+r+"/.rapidkit-workspace")),console.log(e$1.gray(" \u2022 Check health: rapidkit doctor")),console.log("");}catch(I){throw h.fail("Failed to create workspace"),console.error(e$1.red(`
162
+ \u274C Error:`),I),I}return}if(b.has(f$1)&&_==="skip"){let h=c("Creating workspace",{component:"create",phase:"workspace.python-engine-skipped"});try{await v.ensureDir(i),h.succeed("Directory created");let I={bootstrapNote:"python-engine-skipped",pythonEngine:"skipped",pythonEngineReason:"user-opted-out"};await U(i,r,"venv",void 0,I),await q(i,r,"venv",void 0,f$1,I),await G(i),await ye(i,"venv",{pythonEngineSkipped:true});let x={"python-only":"Python-aware",polyglot:"Polyglot",enterprise:"Enterprise"};if(await v.outputFile(y.join(i,"README.md"),`# ${r}
163
+
164
+ RapidKit **${x[f$1]??f$1}** workspace with Workspace Intelligence enabled and Python engine installation skipped.
165
+
166
+ ## Quick start
167
+
168
+ \`\`\`bash
169
+ npx rapidkit workspace model --json
170
+ npx rapidkit adopt /path/to/project
171
+ npx rapidkit workspace verify --json
172
+ \`\`\`
173
+
174
+ ## Add the Python engine later
175
+
176
+ \`\`\`bash
177
+ npx rapidkit create project fastapi.standard api --yes
178
+ npx rapidkit workspace run init
179
+ \`\`\`
180
+ `,"utf-8"),!n){h.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 workspace (${f$1})`],{cwd:i}),h.succeed("Git repository initialized");}catch{h.warn("Could not initialize git repository");}}await L(i,{workspaceName:r,silent:a}),console.log(e$1.green(`
181
+ \u2728 Workspace created!
182
+ `)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u2699\uFE0F Configuration:")),console.log(e$1.gray(` \u2022 Profile: ${f$1}`)),console.log(e$1.gray(" \u2022 Python engine: skipped")),console.log(e$1.gray(" \u2022 Workspace Intelligence: enabled")),console.log(e$1.cyan(`
183
+ \u{1F680} Get started:
184
+ `)),console.log(e$1.white(` ${k(i)}`)),console.log(e$1.white(" npx rapidkit workspace model --json")),console.log(e$1.white(" npx rapidkit adopt /path/to/project")),console.log(e$1.white(` npx rapidkit workspace verify --json
185
+ `)),console.log(e$1.cyan(`\u{1F4A1} Add Python-backed kits/modules later:
186
+ `)),console.log(e$1.gray(" npx rapidkit create project fastapi.standard api --yes")),console.log(e$1.gray(` npx rapidkit workspace run init
187
+ `));return}catch(I){throw h.fail("Failed to create workspace"),console.error(e$1.red(`
188
+ \u274C Error:`),I),I}}{let h=K(),I=false;try{await execa(h,["--version"],{timeout:5e3}),I=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),I=true;}catch{I=false;}}if(!I){let x=f$1,k$1=We(f$1);if(S&&!u){console.log(e$1.yellow(`
189
+ \u26A0\uFE0F Python 3.10+ is not detected on this system.
190
+ `)),console.log(e$1.cyan(`You have 3 options:
191
+ `));let{pythonAction:C}=await b$2([{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 "${k$1}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if(C==="cancel"&&(console.log(e$1.cyan(`
192
+ \u{1F4A1} How to install Python:
193
+ `)),console.log(e$1.white(" Ubuntu / Debian: sudo apt install python3.10")),console.log(e$1.white(" macOS (Homebrew): brew install python@3.10")),console.log(e$1.white(` Windows: https://python.org/downloads
194
+ `)),console.log(e$1.gray(` After installing Python, run: npx rapidkit ${r}
195
+ `)),process.exit(1)),C==="install"){console.log(e$1.cyan(`
196
+ \u{1F4A1} Install Python on your system:
197
+ `));let $=process.platform;$==="linux"?console.log(e$1.white(` sudo apt update && sudo apt install python3.10 python3.10-venv
198
+ `)):$==="darwin"?console.log(e$1.white(` brew install python@3.10
199
+ `)):$==="win32"&&(console.log(e$1.white(` Download: https://python.org/downloads
200
+ `)),console.log(e$1.white(` Run the installer and check "Add Python to PATH"
201
+ `))),console.log(e$1.gray(` After installing, run: npx rapidkit ${r}
202
+ `)),process.exit(0);}if(C==="fallback"&&(console.log(e$1.green(`
203
+ \u2705 Switching to "${k$1}" profile (no Python required).
204
+ `)),f$1=k$1,ae.has(k$1))){let $=c("Creating workspace",{component:"create",phase:"workspace.python-free"});try{await v.ensureDir(i),$.succeed("Directory created"),await U(i,r,"venv",void 0),await q(i,r,"venv",void 0,k$1,{profileRequested:x,bootstrapNote:"python-free-fallback"}),await G(i);let Q={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await v.outputFile(y.join(i,"README.md"),`# ${r}
205
+
206
+ RapidKit **${Q[k$1]}** workspace (switched from ${x} due to missing Python).
207
+
208
+ ## Quick start
209
+
210
+ \`\`\`bash
211
+ `+(k$1==="go-only"?`npx rapidkit create project gofiber.standard my-api
212
+ cd my-api
213
+ npx rapidkit init
214
+ npx rapidkit dev
215
+ `:k$1==="java-only"?`npx rapidkit create project springboot.standard my-service
216
+ cd my-service
217
+ npx rapidkit init
218
+ npx rapidkit dev
219
+ `:k$1==="dotnet-only"?`npx rapidkit create project dotnet.webapi.clean my-api
220
+ cd my-api
221
+ npx rapidkit init
222
+ npx rapidkit dev
223
+ `:k$1==="node-only"?`npx rapidkit create project nestjs.standard my-app
224
+ cd my-app
225
+ npx rapidkit init
226
+ npx rapidkit dev
227
+ `:`npx rapidkit create project
228
+ cd <project-name>
229
+ npx rapidkit init
230
+ npx rapidkit dev
231
+ `)+"```\n","utf-8"),!n){$.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 workspace (${k$1} profile)`],{cwd:i}),$.succeed("Git repository initialized");}catch{$.warn("Could not initialize git repository");}}await L(i,{workspaceName:r,silent:a}),console.log(e$1.green(`
232
+ \u2728 Workspace created with fallback profile!
233
+ `)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan(`
234
+ \u{1F680} Get started:
235
+ `)),console.log(e$1.white(` ${k(i)}`)),console.log(e$1.white(" npx rapidkit create project")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" npx rapidkit init")),console.log(e$1.white(` npx rapidkit dev
236
+ `)),console.log(e$1.cyan(`\u{1F4A1} To use Python later:
237
+ `)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: rapidkit bootstrap --profile ${x}
238
+ `)),console.log("");return}catch(Q){throw $.fail("Failed to create workspace"),console.error(e$1.red(`
239
+ \u274C Error:`),Q),Q}}}else if(console.log(e$1.yellow(`
240
+ \u26A0\uFE0F Python not detected. Auto-switching to "${k$1}" profile (no Python required).
241
+ `)),f$1=k$1,ae.has(k$1)){let C=c("Creating workspace",{component:"create",phase:"workspace.python-free"});try{if(await v.ensureDir(i),C.succeed("Directory created"),await U(i,r,"venv",void 0),await q(i,r,"venv",void 0,k$1,{profileRequested:x,bootstrapNote:"python-free-fallback"}),await G(i),!n){C.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 workspace (${k$1})`],{cwd:i}),C.succeed("Git repository initialized");}catch{C.warn("Could not initialize git repository");}}await L(i,{workspaceName:r,silent:a}),console.log(e$1.green(`
242
+ \u2728 Workspace created (auto-fallback profile)!
243
+ `)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u{1F4E6} Profile:"),e$1.yellow(k$1)),console.log(e$1.cyan("\u{1F4A1} Reason:"),e$1.gray(`Python not detected; switched from ${x}`)),console.log(e$1.cyan(`
244
+ \u{1F680} Get started:
245
+ `)),console.log(e$1.white(` ${k(i)}`)),console.log(e$1.white(" npx rapidkit create project")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" npx rapidkit init")),console.log(e$1.white(` npx rapidkit dev
246
+ `)),console.log(e$1.cyan(`\u{1F4A1} Add Python later:
247
+ `)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: ${k(i)} && rapidkit bootstrap --profile ${x}
248
+ `)),console.log("");return}catch($){throw C.fail("Failed to create workspace"),console.error(e$1.red(`
249
+ \u274C Error:`),$),$}}}}f.step(1,3,"Setting up RapidKit environment");let E=c("Creating directory",{component:"create",phase:"workspace.directory"});try{await v.ensureDir(i),E.succeed("Directory created"),E.start("Detecting Python version");let h=null,I=await De(R.pythonVersion);if(I)h=await xe(I),h?(f.info(` Detected Python ${h}`),E.succeed(`Python ${h} detected`)):E.warn("Could not detect exact Python version");else {let x=K();h=await xe(x),h?E.succeed(`Python ${h} detected`):E.warn("Could not detect Python version, proceeding with defaults");}if(R.installMethod==="poetry"&&!await Ke()&&(E.warn("Poetry not found \u2014 auto-fallback to pip + venv"),R.installMethod="venv"),await U(i,r,R.installMethod,h||void 0),h&&await He(i,h),await q(i,r,R.installMethod,h||R.pythonVersion,f$1||g),await G(i),await Ie(i,r),R.installMethod==="poetry")try{await Te(i,R.pythonVersion,E,a,p,u);}catch(x){let k=x?.details||x?.message||String(x);if(k.includes("pyenv")||k.includes("exit status 127")||k.includes("returned non-zero exit status 127")){E.warn("Poetry encountered Python discovery issues, trying venv method"),f.debug(`Poetry error (attempting venv fallback): ${k}`);try{await ge(i,R.pythonVersion,E,a,p),R.installMethod="venv";}catch(C){throw C}}else throw x}else R.installMethod==="venv"?await ge(i,R.pythonVersion,E,a,p):await Ne(i,E,a,p,u);if(await ye(i,R.installMethod),await Fe(i,R.installMethod),E.succeed("RapidKit environment ready!"),!o.skipGit){E.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}),E.succeed("Git repository initialized");}catch{E.warn("Could not initialize git repository");}}if(await L(i,{workspaceName:r,silent:a}),console.log(e$1.green(`
250
+ \u2728 RapidKit environment created successfully!
251
+ `)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u2699\uFE0F Configuration:")),console.log(e$1.gray(` \u2022 Profile: ${f$1}`)),console.log(e$1.gray(` \u2022 Python: ${R.pythonVersion}`)),console.log(e$1.gray(` \u2022 Install method: ${R.installMethod}`)),console.log(e$1.cyan(`
252
+ \u{1F680} Get started:
253
+ `)),console.log(e$1.white(` ${k(i)}`)),R.installMethod==="poetry"){let x="source $(poetry env info --path)/bin/activate";try{H();let{stdout:k}=await execa("poetry",["--version"]),D=k.match(/Poetry.*?(\d+)\.(\d+)/);D&&(parseInt(D[1])>=2?x="source $(poetry env info --path)/bin/activate":x="poetry shell");}catch{}console.log(e$1.white(` ${x} # Or: poetry run rapidkit`)),console.log(e$1.white(" rapidkit create # Interactive mode")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" rapidkit init")),console.log(e$1.white(" rapidkit dev")),console.log(e$1.gray(`
254
+ \u{1F4E6} Why Poetry? Includes dependency management + virtual environment`));}else R.installMethod==="venv"?(console.log(e$1.white(" source .venv/bin/activate # On Windows: .venv\\Scripts\\activate")),console.log(e$1.white(" rapidkit create # Interactive mode")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" rapidkit init")),console.log(e$1.white(" rapidkit dev")),console.log(e$1.gray(`
255
+ \u{1F4E6} Why venv? Standard, zero extra tools, lightweight`))):(console.log(e$1.white(" rapidkit create # Interactive mode")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" rapidkit init")),console.log(e$1.white(" rapidkit dev")),console.log(e$1.gray(`
256
+ \u{1F4E6} Why pipx? Global isolated install, no local venv`)));console.log(e$1.cyan(`
257
+ \u{1F4DA} Next steps:`)),console.log(e$1.gray(" 1. Check README.md for workspace details")),console.log(e$1.gray(" 2. Create your first project: rapidkit create project")),console.log(e$1.gray(" 3. See all runtimes: rapidkit list # Shows: fastapi, nestjs, springboot, gofiber, gogin, dotnet")),console.log(e$1.cyan(`
258
+ \u{1F4A1} Profile management:`)),console.log(e$1.gray(" \u2022 Add Python? \u2192 rapidkit bootstrap --profile python-only|polyglot")),console.log(e$1.gray(" \u2022 Add Node.js? \u2192 rapidkit bootstrap --profile node-only|polyglot")),console.log(e$1.gray(" \u2022 Add Go? \u2192 rapidkit bootstrap --profile go-only|polyglot")),console.log(e$1.gray(" \u2022 Add .NET? \u2192 rapidkit bootstrap --profile dotnet-only|polyglot")),console.log(e$1.gray(" \u2022 Full setup? \u2192 rapidkit bootstrap --profile enterprise")),console.log(e$1.cyan(`
259
+ \u{1F4D6} Common commands:`)),console.log(e$1.white(" rapidkit create - Create a new project (interactive)")),console.log(e$1.white(" rapidkit list - List available kits")),console.log(e$1.white(" rapidkit modules - List available modules")),console.log(e$1.white(" rapidkit doctor - Check workspace health")),console.log(e$1.white(` rapidkit bootstrap --help - Advanced workspace configuration
260
+ `));try{let{stdout:x}=await execa("go",["version"],{timeout:3e3}),k=x.match(/go version go(\d+\.\d+(?:\.\d+)?)/),D=k?k[1]:"unknown";console.log(e$1.gray(`\u{1F439} Go ${D} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(e$1.yellow("\u26A0\uFE0F Go not installed \u2014 needed for gofiber.standard/gogin.standard projects")),console.log(e$1.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(h){E.fail("Failed to create RapidKit environment"),console.error(e$1.red(`
261
+ \u274C Error:`),h);try{await v.remove(i);}catch{}throw h}}async function De(t){let o=[];if(!b$3())try{let{stdout:l}=await execa("pyenv",["which","python"]),d=l.trim();d&&o.push(d);}catch{}let n=Number(t.split(".")[1]),s=j(n,10).map(l=>l.command).filter(Boolean);o.push(`python${t}`,...s,...i());let a=[...new Set(o)];for(let l of a)try{let d=l==="py"?["-3","--version"]:["--version"],u=l==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:p}=await execa(l,d,{timeout:2e3}),w=p.match(/Python (\d+\.\d+)/)?.[1];if(w&&Y(w,t))return await execa(l,u,{timeout:2e3}),l}catch{continue}return null}async function Te(t,o,n,s,a,l$1=false){await Be(n,l$1),n.start("Finding Python interpreter");let d=await De(o);d?(f.debug(`Found working Python: ${d}`),n.succeed("Python found")):n.warn("Could not verify Python path, proceeding with default"),n.start("Initializing Poetry project");let u=y.join(t,"pyproject.toml"),w=(await v.pathExists(u)?await promises.readFile(u,"utf-8"):"").includes("rapidkit-core");if(w)n.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${o}`],{cwd:t}),n.succeed("Poetry project initialized");let i=await promises.readFile(u,"utf-8");i.includes("[tool.poetry]")?i=i.replace("[tool.poetry]",`[tool.poetry]
262
+ package-mode = false`):i.includes("[project]")&&(i.includes("[build-system]")?i=i.replace("[build-system]",`
263
+ [tool.poetry]
264
+ package-mode = false
265
+
266
+ [build-system]`):i+=`
267
+
268
+ [tool.poetry]
269
+ package-mode = false
270
+ `),await promises.writeFile(u,i,"utf-8");}n.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:t}),n.succeed("Poetry configured");}catch{n.warn("Could not configure Poetry virtualenvs.in-project");}n.start("Creating virtualenv");let g$1=d||K(),m=l(y.join(t,".venv"));try{await execa(g$1,["-m","venv",".venv"],{cwd:t,timeout:6e4}),n.succeed("Virtualenv created");}catch(r){f.debug(`python -m venv failed: ${r}`),n.warn("Could not pre-create virtualenv, Poetry will try"),m=d||K();}try{await execa("poetry",["env","use",m||K()],{cwd:t}),f.debug(`Poetry env set to: ${m}`);}catch(r){f.debug(`Could not set Poetry env: ${r}`);}if(n.start("Installing RapidKit"),w&&!s){let r=e$2(a||{}),i=r?await v.pathExists(r):false,b=i&&r?r:"rapidkit-core";r&&!i&&f.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${r}. Falling back to PyPI.`),n.text=i?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let f$2=false,S=null;for(let _=1;_<=3;_++)try{i||e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:_,maxAttempts:3}),await execa(m,["-m","pip","install",b,"--quiet"],{cwd:t,timeout:18e4}),f$2=true,i||e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:_,maxAttempts:3});break}catch(F){S=F,f.debug(`pip install rapidkit-core attempt ${_} failed: ${F}`),_<3&&(n.text=`Retrying installation (attempt ${_+1}/3)`,await new Promise(ne=>setTimeout(ne,2e3)));}if(!f$2){let _=S?.stderr||S?.message||"Unknown error";throw f.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.
271
+ Error: ${_}
272
+
273
+ Possible solutions:
274
+ 1. Check your internet connection
275
+ 2. Try installing manually: cd ${y.basename(t)} && poetry add rapidkit-core
276
+ 3. Use venv method instead: npx rapidkit ${y.basename(t)} --install-method=venv`))}}else {n.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:12e4}),n.succeed("Poetry environment synced");}catch(r){f.debug(`poetry install --no-root failed: ${r}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),s){let r=e$2(a||{});if(!r)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));f.debug(`Installing from local path: ${r}`),n.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",r],{cwd:t});}else {n.text="Installing RapidKit from PyPI";let r=false,i=null;for(let b=1;b<=3;b++)try{e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:b,maxAttempts:3}),await execa("poetry",["add","rapidkit-core"],{cwd:t,timeout:6e4*b}),r=true,e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:b,maxAttempts:3});break}catch(f$1){i=f$1,f.debug(`Poetry add attempt ${b} failed: ${f$1}`),b<3&&(n.text=`Retrying installation (attempt ${b+1}/3)`,await new Promise(S=>setTimeout(S,2e3)));}if(!r){let b=i?.stderr||i?.message||"Unknown error";throw f.debug(`All Poetry install attempts failed. Last error: ${b}`),b.includes("Could not find")||b.includes("No matching distribution")?new g:new f$1("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
277
+ Error: ${b}
278
+
279
+ Possible solutions:
280
+ 1. Check your internet connection
281
+ 2. Try installing manually: cd ${y.basename(t)} && poetry add rapidkit-core
282
+ 3. Use venv method instead: npx rapidkit ${y.basename(t)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:r}=await import('./pythonRapidkitExec-SGKW76XM.js');if(!await r()&&!s){n.start("Checking optional global pipx installation");let b=await oe(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await W(b,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(f$1){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),f.debug(`pipx install failed: ${f$1}`);}}}catch(r){n.succeed("Skipped optional global pipx installation"),f.debug(`Global install check skipped: ${r}`);}}async function ge(t,o,n,s,a,l$1=false){n.start(`Checking Python ${o}`);let d=K();try{let{stdout:p}=await execa(d,["--version"]),w=p.match(/Python (\d+\.\d+)/)?.[1];if(w&&!Y(w,o))throw new b$4(o,w);n.succeed(`Python ${w} found`);}catch(p){throw p instanceof b$4?p:new b$4(o)}n.start("Creating virtual environment");try{await execa(d,["-m","venv",".venv"],{cwd:t}),n.succeed("Virtual environment created");}catch(p){if(n.fail("Failed to create virtual environment"),(g=>typeof g=="object"&&g!==null&&"stdout"in g&&typeof g.stdout=="string")(p)&&p.stdout.includes("ensurepip is not")){let g=p.stdout.match(/apt install (python[\d.]+-venv)/),m=g?g[1]:"python3-venv";throw new f$1("Python venv module not available",new Error(`Virtual environment creation failed.
283
+
284
+ On Debian/Ubuntu systems, install the venv package:
285
+ sudo apt install ${m}
286
+
287
+ Or use Poetry instead (recommended):
288
+ npx rapidkit ${y.basename(t)} --yes`))}throw new f$1("Virtual environment creation",p instanceof Error?p:new Error(String(p)))}n.start("Installing RapidKit");let u=l(y.join(t,".venv"));if(await execa(u,["-m","pip","install","--upgrade","pip"],{cwd:t}),s){let p=e$2(a||{});if(!p)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));f.debug(`Installing from local path: ${p}`),n.text="Installing RapidKit from local path (test mode)",await execa(u,["-m","pip","install","-e",p],{cwd:t});}else {n.text="Installing RapidKit from PyPI";let p=false,w=null;for(let g=1;g<=3;g++)try{e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"venv",attempt:g,maxAttempts:3}),await execa(u,["-m","pip","install","rapidkit-core"],{cwd:t,timeout:6e4*g}),p=true,e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"venv",attempt:g,maxAttempts:3});break}catch(m){w=m,f.debug(`pip install attempt ${g} failed: ${m}`),g<3&&(n.text=`Retrying installation (attempt ${g+1}/3)`,await new Promise(r=>setTimeout(r,2e3)));}if(!p){let g$1=w?.stderr||w?.message||"Unknown error";throw f.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.
289
+ Error: ${g$1}
290
+
291
+ Possible solutions:
292
+ 1. Check your internet connection
293
+ 2. Try installing manually: cd ${y.basename(t)} && ${l(".venv")} -m pip install rapidkit-core
294
+ 3. Use Poetry instead: npx rapidkit ${y.basename(t)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:p}=await import('./pythonRapidkitExec-SGKW76XM.js');if(!await p()&&!s){n.start("Checking optional global pipx installation");let g=await oe(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await W(g,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(m){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),f.debug(`pipx install failed: ${m}`);}}}catch(p){n.succeed("Skipped optional global pipx installation"),f.debug(`Global install check skipped: ${p}`);}}async function Ne(t,o,n,s,a=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:d}=await import('./pythonRapidkitExec-SGKW76XM.js'),u=await d();if(u.isCompatible){o.succeed(`RapidKit ${u.installedVersion??""} already compatible globally; skipping pipx installation`),await v.outputFile(y.join(t,".rapidkit-global"),`RapidKit already available globally (version ${u.installedVersion??"unknown"}) and satisfies expected constraint ${u.expectedConstraint??"n/a"}; workspace will reuse the existing installation
295
+ `,"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.'),f.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(d){f.debug(`Global RapidKit version-aware check failed before pipx install: ${d}`);}let l=await oe(o,a);if(o.start("Installing RapidKit globally with pipx"),n){let d=e$2(s||{});if(!d)throw new f$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));f.debug(`Installing from local path: ${d}`),o.text="Installing RapidKit from local path (test mode)",await W(l,["install","-e",d]);}else {o.text="Installing RapidKit from PyPI",e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"pipx"});try{await W(l,["install","rapidkit-core"]),e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"pipx"});}catch(d){try{o.text="RapidKit already installed globally, upgrading to match expected version",await W(l,["upgrade","rapidkit-core"]),e$3({status:"succeeded",message:"RapidKit upgraded from PyPI",installMethod:"pipx"});}catch(u){throw f.debug(`pipx install/upgrade failed: install=${d}, upgrade=${u}`),new g}}}o.succeed("RapidKit installed globally"),await v.outputFile(y.join(t,".rapidkit-global"),`RapidKit installed globally with pipx
296
+ `,"utf-8");}async function It(t,o){let{skipGit:n=false,testMode:s=false,userConfig:a={},yes:l=false,installMethod:d,pythonVersion:u="3.10"}=o||{},p=d||a.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return f.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),w=p==="poetry"&&!await Ke()?"venv":p;await U(t,y.basename(t),w),await G(t),await q(t,y.basename(t),w,u,o?.profile);let g=c("Registering workspace",{component:"create",phase:"workspace.register"});try{if(w==="poetry"?(await Ie(t,y.basename(t)),await Te(t,u,g,s,a,l)):w==="venv"?await ge(t,u,g,s,a):await Ne(t,g,s,a,l),await ye(t,w),await Fe(t,w),g.succeed("Workspace registered"),await L(t,{workspaceName:y.basename(t),silent:s}),!n){g.start("Initializing git repository");try{await execa("git",["init"],{cwd:t}),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:t}),g.succeed("Git repository initialized");}catch{g.warn("Could not initialize git repository");}}}catch(m){throw g.fail("Failed to register workspace"),m}}async function Fe(t,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
297
+ # Or simply use: poetry run rapidkit <command>`:o==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)",s=o==="poetry"?`# No activation needed (recommended):
298
+ ./rapidkit --help
299
+ # or:
300
+ poetry run rapidkit --help`:o==="venv"?`# No activation needed (recommended):
301
+ ./rapidkit --help
302
+ # or direct:
303
+ ./.venv/bin/rapidkit --help`:`# Optional: use the local launcher
304
+ ./rapidkit --help
305
+ # (pipx installs may require Poetry/venv to be present in this folder)`,a=b$3()?"python --version (or: py -3 --version)":"python3 --version (or: python --version)",l=`# RapidKit Workspace
306
+
307
+ This directory contains a RapidKit development environment.
308
+
309
+ ## Installation Method
310
+
311
+ **${o==="poetry"?"Poetry":o==="venv"?"Python venv + pip":"pipx (global)"}**
312
+
313
+ ## Getting Started
314
+
315
+ ### 0. Run Without Activation (Recommended)
316
+
317
+ This workspace includes a local launcher script so you can run the Python Core CLI without activating the environment:
318
+
319
+ \`\`\`bash
320
+ ${s}
321
+ \`\`\`
322
+
323
+ ### 1. Activate Environment
324
+
325
+ \`\`\`bash
326
+ ${n}
327
+ \`\`\`
328
+
329
+ ### 2. Create Your First Project
330
+
331
+ \`\`\`bash
332
+ # Interactive mode (recommended):
333
+ rapidkit create
334
+ # Follow the prompts to choose kit and project name
335
+
336
+ # Or specify directly:
337
+ rapidkit create project fastapi.standard my-project
338
+
339
+ # With poetry run (no activation needed):
340
+ poetry run rapidkit create
341
+ \`\`\`
342
+
343
+ Interactive mode will guide you through selecting a kit and configuring your project.
344
+
345
+ ### 3. Navigate and Run
346
+
347
+ \`\`\`bash
348
+ cd my-project
349
+ # Install dependencies (preferred):
350
+ rapidkit init
351
+
352
+ # Run the server (project-aware):
353
+ rapidkit dev
354
+
355
+ # Or with poetry run (manual / advanced):
356
+ poetry run rapidkit dev
357
+
358
+ # Or manually:
359
+ uvicorn src.main:app --reload
360
+ \`\`\`
361
+
362
+ ### 4. Add Modules (Optional)
363
+
364
+ \`\`\`bash
365
+ # Add common modules to your project:
366
+ rapidkit add module settings
367
+ rapidkit add module logging
368
+ rapidkit add module database
369
+
370
+ # List available modules:
371
+ rapidkit modules list
372
+ \`\`\`
373
+
374
+ ## Available Commands
375
+
376
+ - \`rapidkit create\` - Create a new project (interactive)
377
+ - \`rapidkit create project <kit> <name>\` - Create project with specific kit
378
+ - \`rapidkit dev\` - Run development server
379
+ - \`rapidkit add module <name>\` - Add a module (e.g., \`rapidkit add module settings\`)
380
+ - \`rapidkit list\` - List available kits
381
+ - \`rapidkit modules\` - List available modules
382
+ - \`rapidkit upgrade\` - Upgrade RapidKit
383
+ - \`rapidkit doctor\` - Check system requirements
384
+ - \`rapidkit --help\` - Show all commands
385
+
386
+ ## RapidKit Documentation
387
+
388
+ For full documentation, visit: [RapidKit Docs](https://getrapidkit.com) *(or appropriate URL)*
389
+
390
+ ## Workspace Structure
391
+
392
+ \`\`\`
393
+ ${o==="venv"?".venv/ # Python virtual environment":""}
394
+ ${o==="poetry"?"pyproject.toml # Poetry configuration":""}
395
+ my-project/ # Your RapidKit projects go here
396
+ README.md # This file
397
+ \`\`\`
398
+
399
+ ## Troubleshooting
400
+
401
+ If you encounter issues:
402
+
403
+ 1. Ensure Python 3.10+ is installed: \`${a}\`
404
+ 2. Check RapidKit installation: \`rapidkit --version\`
405
+ 3. Run diagnostics: \`rapidkit doctor\`
406
+ 4. Visit RapidKit documentation or GitHub issues
407
+ `;await promises.writeFile(y.join(t,"README.md"),l,"utf-8");}async function Xe(t,o,n){let s=c("Creating demo workspace",{component:"create",phase:"workspace.demo"});try{await v.ensureDir(t),s.succeed("Directory created"),s.start("Setting up demo kit generator");let a=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(y.join(t,"package.json"),a,"utf-8"),await promises.writeFile(y.join(t,"generate-demo.js"),`#!/usr/bin/env node
408
+ /**
409
+ * Demo Kit Generator - Create FastAPI demo projects
410
+ *
411
+ * This workspace contains bundled RapidKit templates that you can use
412
+ * to generate demo projects without installing Python RapidKit.
413
+ *
414
+ * Usage:
415
+ * npm run generate <project-name>
416
+ * node generate-demo.js <project-name>
417
+ *
418
+ * Example:
419
+ * npm run generate my-api
420
+ */
421
+
422
+ const fs = require('fs');
423
+ const path = require('path');
424
+ const readline = require('readline');
425
+
426
+ const projectName = process.argv[2];
427
+
428
+ if (!projectName) {
429
+ console.error('\\n\u274C Please provide a project name');
430
+ console.log('\\nUsage: npm run generate <project-name>\\n');
431
+ console.log('Example: npm run generate my-api\\n');
432
+ process.exit(1);
433
+ }
434
+
435
+ const rl = readline.createInterface({
436
+ input: process.stdin,
437
+ output: process.stdout
438
+ });
439
+
440
+ function ask(question, defaultValue) {
441
+ return new Promise((resolve) => {
442
+ rl.question(\`\${question} (\${defaultValue}): \`, (answer) => {
443
+ resolve(answer || defaultValue);
444
+ });
445
+ });
446
+ }
447
+
448
+ async function main() {
449
+ const targetPath = path.join(process.cwd(), projectName);
450
+
451
+ if (fs.existsSync(targetPath)) {
452
+ console.error(\`\\n\u274C Directory "\${projectName}" already exists\\n\`);
453
+ process.exit(1);
454
+ }
455
+
456
+ console.log(\`\\n\u{1F680} Creating FastAPI project: \${projectName}\\n\`);
457
+
458
+ const snakeName = projectName.replace(/-/g, '_').toLowerCase();
459
+ const project_name = await ask('Project name (snake_case)', snakeName);
460
+ const author = await ask('Author name', process.env.USER || 'RapidKit User');
461
+ const description = await ask('Description', 'FastAPI service generated with RapidKit');
462
+
463
+ rl.close();
464
+
465
+ // Create project structure
466
+ const dirs = [
467
+ '',
468
+ 'src',
469
+ 'src/routing',
470
+ 'src/modules',
471
+ 'tests',
472
+ '.rapidkit'
473
+ ];
474
+
475
+ for (const dir of dirs) {
476
+ fs.mkdirSync(path.join(targetPath, dir), { recursive: true });
477
+ }
478
+
479
+ // Template files with content
480
+ const files = {
481
+ 'src/__init__.py': '"""' + project_name + ' package."""\\n',
482
+ 'src/modules/__init__.py': '"""Modules package."""\\n',
483
+ 'tests/__init__.py': '"""Tests package."""\\n',
484
+ 'src/main.py': \`"""\${project_name} application entrypoint."""
485
+
486
+ from __future__ import annotations
487
+
488
+ from contextlib import asynccontextmanager
489
+ from typing import AsyncIterator
490
+
491
+ from fastapi import FastAPI
492
+ from fastapi.middleware.cors import CORSMiddleware
493
+
494
+ from .routing import api_router
495
+
496
+
497
+ @asynccontextmanager
498
+ async def lifespan(app: FastAPI) -> AsyncIterator[None]:
499
+ """Application lifespan context manager for startup/shutdown events."""
500
+ yield
501
+
502
+
503
+ app = FastAPI(
504
+ title="\${project_name}",
505
+ description="\${description}",
506
+ version="0.1.0",
507
+ docs_url="/docs",
508
+ redoc_url="/redoc",
509
+ lifespan=lifespan,
510
+ )
511
+
512
+ app.add_middleware(
513
+ CORSMiddleware,
514
+ allow_origins=["*"],
515
+ allow_credentials=True,
516
+ allow_methods=["*"],
517
+ allow_headers=["*"],
518
+ )
519
+
520
+ app.include_router(api_router, prefix="/api")
521
+
522
+
523
+ if __name__ == "__main__":
524
+ import uvicorn
525
+ uvicorn.run("src.main:app", host="0.0.0.0", port=8001, reload=True)
526
+ \`,
527
+ 'src/routing/__init__.py': \`"""API routing configuration."""
528
+
529
+ from fastapi import APIRouter
530
+
531
+ from .health import router as health_router
532
+
533
+ api_router = APIRouter()
534
+
535
+ api_router.include_router(health_router)
536
+ \`,
537
+ 'src/routing/health.py': \`"""Health check endpoints."""
538
+
539
+ from __future__ import annotations
540
+
541
+ from fastapi import APIRouter
542
+
543
+ router = APIRouter(prefix="/health", tags=["health"])
544
+
545
+
546
+ @router.get("/", summary="Health check")
547
+ async def heartbeat() -> dict[str, str]:
548
+ """Return basic service heartbeat."""
549
+ return {"status": "ok"}
550
+ \`,
551
+ 'src/cli.py': \`"""CLI commands for \${project_name}."""
552
+
553
+ import subprocess
554
+ import sys
555
+ from pathlib import Path
556
+
557
+
558
+ def dev():
559
+ """Start development server with hot reload."""
560
+ print("\u{1F680} Starting development server...")
561
+ subprocess.run([
562
+ sys.executable, "-m", "uvicorn",
563
+ "src.main:app", "--reload",
564
+ "--host", "0.0.0.0", "--port", "8000"
565
+ ])
566
+
567
+
568
+ def start():
569
+ """Start production server."""
570
+ print("\u26A1 Starting production server...")
571
+ subprocess.run([
572
+ sys.executable, "-m", "uvicorn",
573
+ "src.main:app",
574
+ "--host", "0.0.0.0", "--port", "8000"
575
+ ])
576
+
577
+
578
+ def test():
579
+ """Run tests."""
580
+ print("\u{1F9EA} Running tests...")
581
+ subprocess.run([sys.executable, "-m", "pytest", "-q"])
582
+
583
+
584
+ if __name__ == "__main__":
585
+ if len(sys.argv) < 2:
586
+ print("Usage: python -m src.cli <command>")
587
+ print("Commands: dev, start, test")
588
+ sys.exit(1)
589
+
590
+ cmd = sys.argv[1]
591
+ if cmd == "dev":
592
+ dev()
593
+ elif cmd == "start":
594
+ start()
595
+ elif cmd == "test":
596
+ test()
597
+ else:
598
+ print(f"Unknown command: {cmd}")
599
+ sys.exit(1)
600
+ \`,
601
+ 'pyproject.toml': \`[tool.poetry]
602
+ name = "\${project_name}"
603
+ version = "0.1.0"
604
+ description = "\${description}"
605
+ authors = ["\${author}"]
606
+ license = "MIT"
607
+ readme = "README.md"
608
+ package-mode = false
609
+
610
+ [tool.poetry.dependencies]
611
+ python = "^3.10"
612
+ fastapi = "^0.128.0"
613
+ uvicorn = {extras = ["standard"], version = "^0.40.0"}
614
+ pydantic = "^2.12.5"
615
+ pydantic-settings = "^2.12.0"
616
+
617
+ [tool.poetry.group.dev.dependencies]
618
+ pytest = "^9.0.2"
619
+ pytest-asyncio = "^1.3.0"
620
+ pytest-cov = "^7.0.0"
621
+ httpx = "^0.28.1"
622
+ black = "^25.12.0"
623
+ ruff = "^0.14.10"
624
+ mypy = "^1.19.1"
625
+
626
+ [tool.poetry.scripts]
627
+ dev = "src.cli:dev"
628
+ start = "src.cli:start"
629
+ test = "src.cli:test"
630
+
631
+ [build-system]
632
+ requires = ["poetry-core"]
633
+ build-backend = "poetry.core.masonry.api"
634
+
635
+ [tool.pytest.ini_options]
636
+ asyncio_mode = "auto"
637
+ testpaths = ["tests"]
638
+
639
+ [tool.ruff]
640
+ line-length = 100
641
+ target-version = "py311"
642
+
643
+ [tool.black]
644
+ line-length = 100
645
+ target-version = ["py311"]
646
+ \`,
647
+ 'README.md': \`# \${project_name}
648
+
649
+ \${description}
650
+
651
+ ## Quick start
652
+
653
+ \\\`\\\`\\\`bash
654
+ npx rapidkit init # Install dependencies
655
+ npx rapidkit dev # Start dev server
656
+ \\\`\\\`\\\`
657
+
658
+ ## Available commands
659
+
660
+ \\\`\\\`\\\`bash
661
+ npx rapidkit init # \u{1F527} Install dependencies
662
+ npx rapidkit dev # \u{1F680} Start development server with hot reload
663
+ npx rapidkit start # \u26A1 Start production server
664
+ npx rapidkit test # \u{1F9EA} Run tests
665
+ npx rapidkit help # \u{1F4DA} Show available commands
666
+ \\\`\\\`\\\`
667
+
668
+ ## Project layout
669
+
670
+ \\\`\\\`\\\`
671
+ \${project_name}/
672
+ \u251C\u2500\u2500 src/
673
+ \u2502 \u251C\u2500\u2500 main.py # FastAPI application
674
+ \u2502 \u251C\u2500\u2500 cli.py # CLI commands
675
+ \u2502 \u251C\u2500\u2500 routing/ # API routes
676
+ \u2502 \u2514\u2500\u2500 modules/ # Module system
677
+ \u251C\u2500\u2500 tests/ # Test suite
678
+ \u251C\u2500\u2500 pyproject.toml # Poetry configuration
679
+ \u2514\u2500\u2500 README.md
680
+ \\\`\\\`\\\`
681
+ \`,
682
+ '.rapidkit/project.json': JSON.stringify({
683
+ kit_name: "fastapi.standard",
684
+ profile: "fastapi/standard",
685
+ created_at: new Date().toISOString(),
686
+ rapidkit_version: "npm-demo"
687
+ }, null, 2),
688
+ '.rapidkit/cli.py': \`#!/usr/bin/env python3
689
+ """RapidKit CLI wrapper for demo projects."""
690
+
691
+ import subprocess
692
+ import sys
693
+ from pathlib import Path
694
+
695
+
696
+ def dev(port=8000, host="0.0.0.0"):
697
+ """Start development server."""
698
+ print("\u{1F680} Starting development server with hot reload...")
699
+ subprocess.run([
700
+ sys.executable, "-m", "uvicorn",
701
+ "src.main:app", "--reload",
702
+ "--host", host, "--port", str(port)
703
+ ])
704
+
705
+
706
+ def start(port=8000, host="0.0.0.0"):
707
+ """Start production server."""
708
+ print("\u26A1 Starting production server...")
709
+ subprocess.run([
710
+ sys.executable, "-m", "uvicorn",
711
+ "src.main:app",
712
+ "--host", host, "--port", str(port)
713
+ ])
714
+
715
+
716
+ def init():
717
+ """Install dependencies."""
718
+ print("\u{1F4E6} Installing dependencies...")
719
+ subprocess.run(["poetry", "install"])
720
+
721
+
722
+ def test():
723
+ """Run tests."""
724
+ print("\u{1F9EA} Running tests...")
725
+ subprocess.run([sys.executable, "-m", "pytest", "-q"])
726
+
727
+
728
+ def help_cmd():
729
+ """Show help."""
730
+ print("\u{1F4DA} Available commands:")
731
+ print(" init - Install dependencies")
732
+ print(" dev - Start dev server")
733
+ print(" start - Start production server")
734
+ print(" test - Run tests")
735
+
736
+
737
+ if __name__ == "__main__":
738
+ cmd = sys.argv[1] if len(sys.argv) > 1 else "help"
739
+ cmds = {"dev": dev, "start": start, "init": init, "test": test, "help": help_cmd}
740
+ cmds.get(cmd, help_cmd)()
741
+ \`,
742
+ '.rapidkit/rapidkit': '#!/usr/bin/env bash\\n# Local RapidKit launcher for demo projects\\nset -euo pipefail\\nSCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"\\nROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"\\ncd "$ROOT_DIR"\\n\\nif [ -f "pyproject.toml" ]; then\\n if command -v poetry >/dev/null 2>&1; then\\n exec poetry run python "$SCRIPT_DIR/cli.py" "$@"\\n fi\\nfi\\n\\necho "Poetry not found. Install with: pip install poetry"\\nexit 1\\n',
743
+ '.gitignore': \`# Python
744
+ __pycache__/
745
+ *.py[cod]
746
+ *.so
747
+ .Python
748
+ build/
749
+ dist/
750
+ *.egg-info/
751
+
752
+ # Virtual environments
753
+ .venv/
754
+ venv/
755
+
756
+ # IDEs
757
+ .vscode/
758
+ .idea/
759
+
760
+ # OS
761
+ .DS_Store
762
+
763
+ # Project
764
+ .env
765
+ .env.local
766
+ \`
767
+ };
768
+
769
+ for (const [filePath, content] of Object.entries(files)) {
770
+ fs.writeFileSync(path.join(targetPath, filePath), content);
771
+ }
772
+
773
+ // Make scripts executable
774
+ try {
775
+ fs.chmodSync(path.join(targetPath, '.rapidkit/cli.py'), 0o755);
776
+ fs.chmodSync(path.join(targetPath, '.rapidkit/rapidkit'), 0o755);
777
+ } catch (e) {
778
+ // Ignore on Windows
779
+ }
780
+
781
+ console.log(\`
782
+ \u2728 Demo project created successfully!
783
+
784
+ \u{1F4C2} Project: \${targetPath}
785
+
786
+ \u{1F680} Get started:
787
+ cd \${projectName}
788
+ npx rapidkit init # Install dependencies
789
+ npx rapidkit dev # Start dev server
790
+
791
+ \u{1F4DA} Available commands:
792
+ npx rapidkit init # \u{1F527} Install dependencies
793
+ npx rapidkit dev # \u{1F680} Start dev server with hot reload
794
+ npx rapidkit start # \u26A1 Start production server
795
+ npx rapidkit test # \u{1F9EA} Run tests
796
+ npx rapidkit help # \u{1F4DA} Show help
797
+
798
+ \u{1F4A1} For full RapidKit features: pipx install rapidkit
799
+ \`);
800
+ }
801
+
802
+ main().catch(console.error);
803
+ `,"utf-8");try{await execa("chmod",["+x",y.join(t,"generate-demo.js")]);}catch{}let d=`# RapidKit Demo Workspace
804
+
805
+ Welcome to your RapidKit demo workspace! This environment lets you generate FastAPI demo projects using bundled RapidKit templates, without needing to install Python RapidKit.
806
+
807
+ ## \u{1F680} Quick Start
808
+
809
+ ### Generate Your First Demo Project
810
+
811
+ \`\`\`bash
812
+ # Generate a demo project:
813
+ node generate-demo.js my-api
814
+
815
+ # Navigate to the project:
816
+ cd my-api
817
+
818
+ # Install dependencies:
819
+ rapidkit init
820
+
821
+ # Run the development server:
822
+ rapidkit dev
823
+ \`\`\`
824
+
825
+ Your API will be available at \`http://localhost:8000\`
826
+
827
+ ## \u{1F4E6} Generate Multiple Projects
828
+
829
+ You can create multiple demo projects in this workspace:
830
+
831
+ \`\`\`bash
832
+ node generate-demo.js api-service
833
+ node generate-demo.js auth-service
834
+ node generate-demo.js data-service
835
+ \`\`\`
836
+
837
+ Each project is independent and has its own dependencies.
838
+
839
+ ## \u{1F3AF} What's Included
840
+
841
+ Each generated demo project contains:
842
+
843
+ - **FastAPI Application** - Modern async web framework
844
+ - **Routing System** - Organized API routes
845
+ - **Module System** - Extensible module architecture
846
+ - **CLI Commands** - Built-in command system
847
+ - **Testing Setup** - pytest configuration
848
+ - **Poetry Configuration** - Dependency management
849
+
850
+ ## \u{1F4DA} Next Steps
851
+
852
+ 1. **Explore the Generated Code** - Check out \`src/main.py\` and \`src/routing/\`
853
+ 2. **Add Routes** - Create new endpoints in \`src/routing/\`
854
+ 3. **Install Full RapidKit** - For advanced features: \`pipx install rapidkit\`
855
+ 4. **Read the Documentation** - Visit [RapidKit Docs](https://getrapidkit.com)
856
+
857
+ ## \u26A0\uFE0F Demo Mode Limitations
858
+
859
+ This is a demo workspace with:
860
+ - \u2705 Pre-built FastAPI templates
861
+ - \u2705 Project generation without Python RapidKit
862
+ - \u274C No RapidKit CLI commands (\`rapidkit create\`, \`rapidkit add module\`)
863
+ - \u274C No interactive module system
864
+
865
+ For full RapidKit features, install the Python package:
866
+
867
+ \`\`\`bash
868
+ pipx install rapidkit
869
+ \`\`\`
870
+
871
+ ## \u{1F6E0}\uFE0F Workspace Structure
872
+
873
+ \`\`\`
874
+ ${o}/
875
+ \u251C\u2500\u2500 generate-demo.js # Demo project generator
876
+ \u251C\u2500\u2500 README.md # This file
877
+ \u2514\u2500\u2500 my-api/ # Your generated projects go here
878
+ \`\`\`
879
+
880
+ ## \u{1F4A1} Tips
881
+
882
+ - Run \`node generate-demo.js --help\` for more options (coming soon)
883
+ - Each project can have different configurations
884
+ - Demo projects are production-ready FastAPI applications
885
+ - You can copy and modify templates as needed
886
+
887
+ ---
888
+
889
+ **Generated with RapidKit** | [GitHub](https://github.com/rapidkitlabs/rapidkit-npm)
890
+ `;if(await promises.writeFile(y.join(t,"README.md"),d,"utf-8"),s.succeed("Demo workspace setup complete"),!n){s.start("Initializing git repository");try{await execa("git",["init"],{cwd:t}),await v.outputFile(y.join(t,".gitignore"),`# Dependencies
891
+ node_modules/
892
+
893
+ # Generated projects
894
+ */
895
+ !generate-demo.js
896
+ !README.md
897
+
898
+ # Python
899
+ __pycache__/
900
+ *.pyc
901
+ .venv/
902
+ .env
903
+ `,"utf-8"),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:t}),s.succeed("Git repository initialized");}catch{s.warn("Could not initialize git repository");}}console.log(e$1.green(`
904
+ \u2728 Demo workspace created successfully!
905
+ `)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(t)),console.log(e$1.cyan(`\u{1F680} Get started:
906
+ `)),console.log(e$1.white(` ${k(t)}`)),console.log(e$1.white(" node generate-demo.js my-api")),console.log(e$1.white(" cd my-api")),console.log(e$1.white(" rapidkit init")),console.log(e$1.white(" rapidkit dev")),console.log(),console.log(e$1.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For full RapidKit features:"),console.log(e$1.cyan(" pipx install rapidkit")),console.log();}catch(a){throw s.fail("Failed to create demo workspace"),a}}async function Ze(t,o,n,s,a,l,d){if(console.log(e$1.cyan(`
907
+ \u{1F50D} Dry-run mode - what would be created:
908
+ `)),console.log(e$1.white("\u{1F4C2} Workspace path:"),t),console.log(e$1.white("\u{1F4DB} Name:"),e$1.cyan(o)),n)console.log(e$1.white("\u{1F4E6} Type:"),"Demo environment"),console.log(e$1.white(`
909
+ \u{1F4DD} Files to create:`)),console.log(e$1.gray(" - package.json")),console.log(e$1.gray(" - generate-demo.js (project generator)")),console.log(e$1.gray(" - README.md")),console.log(e$1.gray(" - .gitignore")),console.log(e$1.white(`
910
+ \u{1F3AF} Capabilities:`)),console.log(e$1.gray(" - Generate FastAPI/NestJS demo projects")),console.log(e$1.gray(" - No Python RapidKit installation required")),console.log(e$1.gray(" - Bundled templates"));else {let u=a||"minimal",p=l,w=d,m=new Set(["python-only","polyglot","enterprise"]).has(u);console.log(e$1.white("\u{1F4E6} Profile:"),e$1.cyan(u)),console.log(e$1.white("\u{1F4DD} Configuration:")),m?(console.log(e$1.gray(` - Python version: ${w}`)),console.log(e$1.gray(` - Install method: ${p}`)),console.log(e$1.gray(` - Git init: ${s.skipGit?"No":"Yes"}`))):(console.log(e$1.gray(" - Python-free profile (no Python needed)")),console.log(e$1.gray(` - Git init: ${s.skipGit?"No":"Yes"}`))),console.log(e$1.white(`
911
+ \u{1F4CB} Files to create:`)),console.log(e$1.gray(" - .rapidkit-workspace (workspace marker)")),console.log(e$1.gray(" - .rapidkit/ (workspace config directory)")),console.log(e$1.gray(" - README.md")),console.log(e$1.gray(" - .gitignore")),m&&console.log(e$1.gray(` - ${p==="poetry"?"pyproject.toml + poetry.lock":".venv/ (virtual environment)"}`)),console.log(e$1.white(`
912
+ \u2699\uFE0F Environment setup:`)),m&&console.log(p==="poetry"?e$1.gray(" - Poetry virtual environment created (recommended, includes dependency management)"):p==="venv"?e$1.gray(" - Python venv created in .venv/ (standard, zero extra tools)"):e$1.gray(" - Global pipx install (isolated, not local to workspace)")),console.log(e$1.white(`
913
+ \u{1F680} Next steps:`)),console.log(e$1.gray(` 1. ${k(t)}`)),console.log(e$1.gray(" 2. npx rapidkit create project")),console.log(e$1.gray(" 3. npx rapidkit init")),console.log(e$1.gray(" 4. npx rapidkit dev")),console.log(e$1.white(`
914
+ \u{1F4A1} Learn more:`)),console.log(e$1.gray(" \u2022 Change profile later: rapidkit bootstrap --profile <profile>")),console.log(e$1.gray(" \u2022 Profile options: minimal|java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")),console.log(e$1.gray(" \u2022 Help: npx rapidkit --help"));}console.log(e$1.white(`
915
+ \u2728 To proceed: remove --dry-run flag
916
+ `));}export{Ee as a,xt as b,Se as c,We as d,ye as e,Rt as f,It as g};