rapidkit 0.36.0 → 0.37.0

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