rapidkit 0.25.0 → 0.25.2

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # RapidKit NPM CLI
2
2
 
3
- ### RapidKit is an open-source workspace platform that standardizes how teams build, scale, and deploy backend services.
3
+ > RapidKit is an open-source workspace platform that standardizes how teams build, scale, and deploy backend services.
4
4
 
5
5
  FastAPI, NestJS, Go/Fiber, and Go/Gin scaffolding with production-ready defaults.
6
6
  **27+ plug-and-play modules** are available for FastAPI & NestJS projects.
@@ -10,6 +10,7 @@ Clean architecture • Zero boilerplate • Instant deployment.
10
10
  [![Downloads](https://img.shields.io/npm/dm/rapidkit.svg?style=flat-square)](https://www.npmjs.com/package/rapidkit)
11
11
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
12
12
  [![GitHub Stars](https://img.shields.io/github/stars/getrapidkit/rapidkit-npm.svg?style=flat-square)](https://github.com/getrapidkit/rapidkit-npm/stargazers)
13
+ [![Part of RapidKit Platform](https://img.shields.io/badge/Part%20of-RapidKit%20Workspace%20Platform-0f172a?logo=github)](https://github.com/getrapidkit/rapidkit)
13
14
 
14
15
  Official CLI for creating and operating RapidKit workspaces and projects.
15
16
 
@@ -18,6 +19,17 @@ Official CLI for creating and operating RapidKit workspaces and projects.
18
19
  - Profile + policy enforcement (`warn` / `strict`)
19
20
  - Cache and mirror lifecycle commands for stable environments
20
21
 
22
+ ## Part of the RapidKit Ecosystem
23
+
24
+ RapidKit NPM CLI is the developer entrypoint layer of the platform.
25
+
26
+ | Layer | Repository |
27
+ |---|---|
28
+ | Ecosystem Hub | [getrapidkit/rapidkit](https://github.com/getrapidkit/rapidkit) |
29
+ | IDE | [getrapidkit/rapidkit-vscode](https://github.com/getrapidkit/rapidkit-vscode) |
30
+ | Core Engine | [getrapidkit/rapidkit-core](https://github.com/getrapidkit/rapidkit-core) |
31
+ | Examples | [getrapidkit/rapidkit-examples](https://github.com/getrapidkit/rapidkit-examples) |
32
+
21
33
  ## Requirements
22
34
 
23
35
  - Node.js `>= 20.19.6`
@@ -1,20 +1,20 @@
1
- import {a as a$1,d,b}from'./chunk-RV6HBTFC.js';import {a,c}from'./chunk-N64Z3XVF.js';import {a as a$2,f,c as c$1,e}from'./chunk-FXRDNZGB.js';import {promises}from'fs';import*as v from'fs-extra';import*as $t from'os';import $t__default from'os';import m from'path';import J from'inquirer';import n from'chalk';import Q from'ora';import {execa}from'execa';import {pathToFileURL}from'url';var St=".rapidkitrc.json",Mt=["rapidkit.config.js","rapidkit.config.mjs","rapidkit.config.cjs"];async function Bt(){let t=m.join($t__default.homedir(),St);try{let o=await promises.readFile(t,"utf-8"),e=JSON.parse(o);return a.debug(`Loaded config from ${t}`),e}catch{return a.debug("No user config found, using defaults"),{}}}async function Jt(t=process.cwd()){let o=t,e=m.parse(o).root;for(;o!==e;){for(let i of Mt){let a$1=m.join(o,i);try{await promises.access(a$1),a.debug(`Found config file: ${a$1}`);let p=await import(pathToFileURL(a$1).href),y=p.default||p;return a.debug(`Loaded RapidKit config from ${i}`),y}catch{continue}}o=m.dirname(o);}return a.debug("No RapidKit config file found, using defaults"),{}}function Qt(t,o,e){return {author:e.author||o.workspace?.defaultAuthor||t.author,pythonVersion:e.pythonVersion||o.workspace?.pythonVersion||t.pythonVersion,defaultInstallMethod:e.defaultInstallMethod||o.workspace?.installMethod||t.defaultInstallMethod,defaultKit:e.defaultKit||o.projects?.defaultKit||t.defaultKit,skipGit:e.skipGit??o.projects?.skipGit??t.skipGit,license:e.license||t.license,testRapidKitPath:e.testRapidKitPath||t.testRapidKitPath}}function L(t){return process.env.RAPIDKIT_DEV_PATH||t.testRapidKitPath||void 0}var $=class extends Error{constructor(e,i,a){super(e);this.code=i;this.details=a;this.name="RapidKitError",Error.captureStackTrace(this,this.constructor);}},T=class extends ${constructor(o,e){let i=e?`Python ${o}+ required, found ${e}`:`Python ${o}+ not found`;super(i,"PYTHON_NOT_FOUND","Please install Python from https://www.python.org/downloads/");}},G=class extends ${constructor(){super("Poetry is not installed","POETRY_NOT_FOUND","Install Poetry from https://python-poetry.org/docs/#installation");}},U=class extends ${constructor(){super("pipx is not installed","PIPX_NOT_FOUND","Install pipx from https://pypa.github.io/pipx/installation/");}},B=class extends ${constructor(o){super(`Directory "${o}" already exists`,"DIRECTORY_EXISTS","Please choose a different name or remove the existing directory");}},gt=class extends ${constructor(o,e){super(`Invalid project name: "${o}"`,"INVALID_PROJECT_NAME",e);}},x=class extends ${constructor(o,e){let i=`Installation failed at: ${o}`,a=`${e.message}
1
+ import {a as a$1,d,b}from'./chunk-RV6HBTFC.js';import {a,c}from'./chunk-N64Z3XVF.js';import {a as a$2,e,d as d$1,f,c as c$1,k}from'./chunk-Z5LKRG57.js';import {promises}from'fs';import*as v from'fs-extra';import m from'path';import B from'inquirer';import n from'chalk';import J from'ora';import {execa}from'execa';import Mt from'os';import {pathToFileURL}from'url';var At=".rapidkitrc.json",Kt=["rapidkit.config.js","rapidkit.config.mjs","rapidkit.config.cjs"];async function Qt(){let t=m.join(Mt.homedir(),At);try{let o=await promises.readFile(t,"utf-8"),e=JSON.parse(o);return a.debug(`Loaded config from ${t}`),e}catch{return a.debug("No user config found, using defaults"),{}}}async function Xt(t=process.cwd()){let o=t,e=m.parse(o).root;for(;o!==e;){for(let r of Kt){let a$1=m.join(o,r);try{await promises.access(a$1),a.debug(`Found config file: ${a$1}`);let p=await import(pathToFileURL(a$1).href),g=p.default||p;return a.debug(`Loaded RapidKit config from ${r}`),g}catch{continue}}o=m.dirname(o);}return a.debug("No RapidKit config file found, using defaults"),{}}function Zt(t,o,e){return {author:e.author||o.workspace?.defaultAuthor||t.author,pythonVersion:e.pythonVersion||o.workspace?.pythonVersion||t.pythonVersion,defaultInstallMethod:e.defaultInstallMethod||o.workspace?.installMethod||t.defaultInstallMethod,defaultKit:e.defaultKit||o.projects?.defaultKit||t.defaultKit,skipGit:e.skipGit??o.projects?.skipGit??t.skipGit,license:e.license||t.license,testRapidKitPath:e.testRapidKitPath||t.testRapidKitPath}}function L(t){return process.env.RAPIDKIT_DEV_PATH||t.testRapidKitPath||void 0}var C=class extends Error{constructor(e,r,a){super(e);this.code=r;this.details=a;this.name="RapidKitError",Error.captureStackTrace(this,this.constructor);}},F=class extends C{constructor(o,e){let r=e?`Python ${o}+ required, found ${e}`:`Python ${o}+ not found`;super(r,"PYTHON_NOT_FOUND","Please install Python from https://www.python.org/downloads/");}},G=class extends C{constructor(){super("Poetry is not installed","POETRY_NOT_FOUND","Install Poetry from https://python-poetry.org/docs/#installation");}},U=class extends C{constructor(){super("pipx is not installed","PIPX_NOT_FOUND","Install pipx from https://pypa.github.io/pipx/installation/");}},q=class extends C{constructor(o){super(`Directory "${o}" already exists`,"DIRECTORY_EXISTS","Please choose a different name or remove the existing directory");}},ht=class extends C{constructor(o,e){super(`Invalid project name: "${o}"`,"INVALID_PROJECT_NAME",e);}},I=class extends C{constructor(o,e){let r=`Installation failed at: ${o}`,a=`${e.message}
2
2
 
3
3
  Troubleshooting:
4
4
  - Check your internet connection
5
5
  - Verify Python/Poetry installation
6
- - Try running with --debug flag for more details`;super(i,"INSTALLATION_ERROR",a);}},K=class extends ${constructor(){super("RapidKit Python package is not yet available on PyPI","RAPIDKIT_NOT_AVAILABLE",`Available options:
6
+ - Try running with --debug flag for more details`;super(r,"INSTALLATION_ERROR",a);}},K=class extends C{constructor(){super("RapidKit Python package is not yet available on PyPI","RAPIDKIT_NOT_AVAILABLE",`Available options:
7
7
  1. Install Python 3.10+ and retry the same command
8
8
  2. Use the core workflow: npx rapidkit create workspace <name>
9
9
  3. Offline fallback (limited): npx rapidkit create project fastapi.standard <name> --output .
10
10
 
11
- Legacy: set RAPIDKIT_SHOW_LEGACY=1 to reveal template-mode flags in help.`);}};function C(){return c$1()}async function rt(t,o,e,i){let a=d(o,c(),e);i&&(a.metadata||(a.metadata={}),a.metadata.python={version:i}),await b(t,a);}async function X(t){await v.outputFile(m.join(t,".gitignore"),`.venv/
11
+ Legacy: set RAPIDKIT_SHOW_LEGACY=1 to reveal template-mode flags in help.`);}};function $(){return c$1()}async function at(t,o,e,r){let a=d(o,c(),e);r&&(a.metadata||(a.metadata={}),a.metadata.python={version:r}),await b(t,a);}async function Q(t){await v.outputFile(m.join(t,".gitignore"),`.venv/
12
12
  __pycache__/
13
13
  *.pyc
14
14
  .env
15
15
  .rapidkit-workspace/
16
16
 
17
- `,"utf-8");}async function at(t,o){let e=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await v.outputFile(m.join(t,"poetry.toml"),`[virtualenvs]
17
+ `,"utf-8");}async function st(t,o){let e=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await v.outputFile(m.join(t,"poetry.toml"),`[virtualenvs]
18
18
  in-project = true
19
19
  `,"utf-8"),await v.outputFile(m.join(t,"pyproject.toml"),`[tool.poetry]
20
20
  name = "${e}"
@@ -30,7 +30,7 @@ rapidkit-core = "*"
30
30
  [build-system]
31
31
  requires = ["poetry-core"]
32
32
  build-backend = "poetry.core.masonry.api"
33
- `,"utf-8");}function wt(t,o,e,i){return JSON.stringify({schema_version:"1.0",workspace_name:t,rapidkit_version:c(),created_at:new Date().toISOString(),created_by:"rapidkit-npm",profile:i||"minimal",engine:{install_method:o,python_version:e||null}},null,2)}function vt(t,o,e,i){return JSON.stringify({schema_version:"1.0",generated_by:"rapidkit-npm",generated_at:new Date().toISOString(),runtime:{python:{version:o||null,install_method:t},node:{version:e||process.version},go:{version:i||null}}},null,2)}function kt(){return `version: "1.0"
33
+ `,"utf-8");}function vt(t,o,e,r){return JSON.stringify({schema_version:"1.0",workspace_name:t,rapidkit_version:c(),created_at:new Date().toISOString(),created_by:"rapidkit-npm",profile:r||"minimal",engine:{install_method:o,python_version:e||null}},null,2)}function kt(t,o,e,r){return JSON.stringify({schema_version:"1.0",generated_by:"rapidkit-npm",generated_at:new Date().toISOString(),runtime:{python:{version:o||null,install_method:t},node:{version:e||process.version},go:{version:r||null}}},null,2)}function Pt(){return `version: "1.0"
34
34
  mode: warn # "warn" or "strict"
35
35
  dependency_sharing_mode: isolated # "isolated" or "shared-runtime-caches" or "shared-node-deps"
36
36
  # change profile (recommended): npx rapidkit bootstrap --profile polyglot
@@ -39,20 +39,20 @@ rules:
39
39
  enforce_workspace_marker: true
40
40
  enforce_toolchain_lock: false
41
41
  disallow_untrusted_tool_sources: false
42
- `}function Pt(){return `version: "1.0"
42
+ `}function bt(){return `version: "1.0"
43
43
  cache:
44
44
  strategy: shared # "shared" or "on-demand"
45
45
  prune_on_bootstrap: false
46
46
  self_heal: true
47
47
  verify_integrity: false
48
- `}async function st(t,o,e,i,a){let u;try{let{stdout:p}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),y=p.match(/go(\d+\.\d+(?:\.\d+)?)/i);u=y?y[1]:void 0;}catch{}await v.outputFile(m.join(t,".rapidkit","workspace.json"),wt(o,e,i,a),"utf-8"),await v.outputFile(m.join(t,".rapidkit","toolchain.lock"),vt(e,i,process.version,u),"utf-8"),await v.outputFile(m.join(t,".rapidkit","policies.yml"),kt(),"utf-8"),await v.outputFile(m.join(t,".rapidkit","cache-config.yml"),Pt(),"utf-8");}async function ve(t,o){let{workspaceName:e=m.basename(t),installMethod:i="venv",pythonVersion:a,profile:u,writeMarker:p=true,writeGitignore:y=true,onlyIfMissing:g=true}=o||{},f=[],c$1;try{let{stdout:s}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),d=s.match(/go(\d+\.\d+(?:\.\d+)?)/i);c$1=d?d[1]:void 0;}catch{}let r=[{relPath:m.join(".rapidkit","workspace.json"),content:wt(e,i,a,u)},{relPath:m.join(".rapidkit","toolchain.lock"),content:vt(i,a,process.version,c$1)},{relPath:m.join(".rapidkit","policies.yml"),content:kt()},{relPath:m.join(".rapidkit","cache-config.yml"),content:Pt()}];for(let s of r){let d=m.join(t,s.relPath);g&&await v.pathExists(d)||(await v.outputFile(d,s.content,"utf-8"),f.push(s.relPath));}if(p&&(!!!await a$1(t)||!g)){let d$1=d(e,c(),i);a&&(d$1.metadata||(d$1.metadata={}),d$1.metadata.python={version:a}),await b(t,d$1),f.push(".rapidkit-workspace");}if(y){let s=m.join(t,".gitignore");(!g||!await v.pathExists(s))&&(await X(t),f.push(".gitignore"));}return f}var D="3.10",bt=["3.10","3.11","3.12"];async function yt(t){try{let{stdout:o}=await execa(t,["--version"],{timeout:3e3}),e=o.match(/Python (\d+\.\d+\.\d+)/);if(e)return e[1]}catch{}return null}async function At(t,o){try{await promises.writeFile(m.join(t,".python-version"),`${o}
49
- `,"utf-8"),a.debug(`Created .python-version with ${o}`);}catch(e){a.warn(`Failed to create .python-version: ${e}`);}}function N(){let t=m.join($t.homedir(),".local","bin"),e=(process.env.PATH||"").split(m.delimiter).filter(Boolean);e.includes(t)||(process.env.PATH=[t,...e].join(m.delimiter));}async function Z(t,o){N(),t.start("Checking pipx installation");try{return await execa("pipx",["--version"]),t.succeed("pipx found"),{kind:"binary"}}catch{}let e=C();try{return await execa(e,["-m","pipx","--version"]),t.succeed("pipx found"),{kind:"python-module",pythonCmd:e}}catch{}if(o)throw new U;let{installPipx:i}=await J.prompt([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!i)throw new U;t.start("Installing pipx (user install)");try{try{await execa(e,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(e,["-m","pip","install","--user","--upgrade","pipx"]);}catch(a){let u=a,p=String(u?.stderr||u?.shortMessage||u?.message||"");throw new x("Install pipx with python -m pip",a instanceof Error?a:new Error(p))}t.succeed("pipx installed"),N();try{return await execa(e,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:e}}catch(a){let u=a,p=String(u?.stderr||u?.shortMessage||u?.message||"pipx not runnable after install");throw new x("Verify pipx after install",new Error(`${p}
48
+ `}async function lt(t,o,e,r,a){let c;try{let{stdout:p}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),g=p.match(/go(\d+\.\d+(?:\.\d+)?)/i);c=g?g[1]:void 0;}catch{}await v.outputFile(m.join(t,".rapidkit","workspace.json"),vt(o,e,r,a),"utf-8"),await v.outputFile(m.join(t,".rapidkit","toolchain.lock"),kt(e,r,process.version,c),"utf-8"),await v.outputFile(m.join(t,".rapidkit","policies.yml"),Pt(),"utf-8"),await v.outputFile(m.join(t,".rapidkit","cache-config.yml"),bt(),"utf-8");}async function Pe(t,o){let{workspaceName:e=m.basename(t),installMethod:r="venv",pythonVersion:a,profile:c$1,writeMarker:p=true,writeGitignore:g=true,onlyIfMissing:y=true}=o||{},h=[],d$1;try{let{stdout:s}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),u=s.match(/go(\d+\.\d+(?:\.\d+)?)/i);d$1=u?u[1]:void 0;}catch{}let i=[{relPath:m.join(".rapidkit","workspace.json"),content:vt(e,r,a,c$1)},{relPath:m.join(".rapidkit","toolchain.lock"),content:kt(r,a,process.version,d$1)},{relPath:m.join(".rapidkit","policies.yml"),content:Pt()},{relPath:m.join(".rapidkit","cache-config.yml"),content:bt()}];for(let s of i){let u=m.join(t,s.relPath);y&&await v.pathExists(u)||(await v.outputFile(u,s.content,"utf-8"),h.push(s.relPath));}if(p&&(!!!await a$1(t)||!y)){let u=d(e,c(),r);a&&(u.metadata||(u.metadata={}),u.metadata.python={version:a}),await b(t,u),h.push(".rapidkit-workspace");}if(g){let s=m.join(t,".gitignore");(!y||!await v.pathExists(s))&&(await Q(t),h.push(".gitignore"));}return h}var D="3.10",xt=["3.10","3.11","3.12"];async function ft(t){try{let{stdout:o}=await execa(t,["--version"],{timeout:3e3}),e=o.match(/Python (\d+\.\d+\.\d+)/);if(e)return e[1]}catch{}return null}async function Dt(t,o){try{await promises.writeFile(m.join(t,".python-version"),`${o}
49
+ `,"utf-8"),a.debug(`Created .python-version with ${o}`);}catch(e){a.warn(`Failed to create .python-version: ${e}`);}}function T(){let e=[...(process.env.PATH||"").split(m.delimiter).filter(Boolean)];for(let r of k())e.includes(r)||e.unshift(r);process.env.PATH=e.join(m.delimiter);}async function X(t,o){T(),t.start("Checking pipx installation");try{return await execa("pipx",["--version"]),t.succeed("pipx found"),{kind:"binary"}}catch{}let e=$();try{return await execa(e,["-m","pipx","--version"]),t.succeed("pipx found"),{kind:"python-module",pythonCmd:e}}catch{}if(o)throw new U;t.stop?.();let{installPipx:r}=await B.prompt([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!r)throw new U;t.start("Installing pipx (user install)");try{try{await execa(e,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(e,["-m","pip","install","--user","--upgrade","pipx"]);}catch(a){let c=a,p=String(c?.stderr||c?.shortMessage||c?.message||"");throw new I("Install pipx with python -m pip",a instanceof Error?a:new Error(p))}t.succeed("pipx installed"),T();try{return await execa(e,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:e}}catch(a){let c=a,p=String(c?.stderr||c?.shortMessage||c?.message||"pipx not runnable after install");throw new I("Verify pipx after install",new Error(`${p}
50
50
 
51
- Try reopening your terminal or run: ${e} -m pipx ensurepath`))}}async function O(t,o){return t.kind==="binary"?execa("pipx",o):execa(t.pythonCmd,["-m","pipx",...o])}function Kt(t){let o=t.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function ht(t){if(!t)return null;let o=t.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function lt(t,o){let[e,i]=t.split(".").map(p=>Number(p)),[a,u]=o.split(".").map(p=>Number(p));return e!==a?e-a:i-u}function F(t,o){return lt(t,o)>=0}async function Dt(t){let o=new Set,e$1=e(14,10);for(let r of e$1)try{let s=await execa(r.command,r.args,{timeout:2500}),d=ht(`${s.stdout||""}
52
- ${s.stderr||""}`);d&&F(d,D)&&o.add(d);}catch{}let i=null;try{let r=await execa(C(),["--version"],{timeout:2500}),s=ht(`${r.stdout||""}
53
- ${r.stderr||""}`);s&&F(s,D)&&(i=s,o.add(s));}catch{}let a=bt.filter(r=>F(r,D)),u=new Set([...a,...o]),p=Array.from(u).sort((r,s)=>lt(s,r)),y=t?Kt(t):null,g=y&&F(y,D)?y:i||p[0]||D;return u.has(g)||u.add(g),{choices:Array.from(u).sort((r,s)=>lt(s,r)).map(r=>{let s=[];return r===i&&s.push("current system"),r===D&&s.push("minimum supported"),o.has(r)&&r!==i&&s.push("detected"),{name:s.length>0?`${r} (${s.join(", ")})`:r,value:r}}),defaultValue:g}}async function Tt(){N();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 e=c$1();try{await execa(e,["-m","pipx","--version"],{timeout:2500}),o=true;}catch{o=false;}}return {poetry:t,pipx:o}}function Ft(t,o){return t==="poetry"&&o.poetry?"poetry":t==="pipx"&&o.pipx?"pipx":t==="venv"?"venv":o.poetry?"poetry":"venv"}async function Nt(t,o){N(),t.start("Checking Poetry installation");try{await execa("poetry",["--version"]),t.succeed("Poetry found");return}catch{}if(o)throw new G;let{installPoetry:e}=await J.prompt([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!e)throw new G;let i=await Z(t,o);t.start("Installing Poetry with pipx");try{await O(i,["install","poetry"]);}catch(a){let u=a,p=String(u?.stderr||u?.shortMessage||u?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(p))try{await O(i,["upgrade","poetry"]);}catch{}else throw new x("Install Poetry with pipx",a instanceof Error?a:new Error(p))}t.succeed("Poetry installed"),N();try{await execa("poetry",["--version"]);}catch(a){let u=a,p=String(u?.stderr||u?.shortMessage||u?.message||"Poetry not found on PATH");throw new x("Verify Poetry after pipx install",new Error(`${p}
51
+ Try reopening your terminal or run: ${e} -m pipx ensurepath`))}}async function O(t,o){return t.kind==="binary"?execa("pipx",o):execa(t.pythonCmd,["-m","pipx",...o])}function Tt(t){let o=t.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function wt(t){if(!t)return null;let o=t.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function ct(t,o){let[e,r]=t.split(".").map(p=>Number(p)),[a,c]=o.split(".").map(p=>Number(p));return e!==a?e-a:r-c}function N(t,o){return ct(t,o)>=0}async function Ft(t){let o=new Set,e$1=e(14,10);for(let i of e$1)try{let s=await execa(i.command,i.args,{timeout:2500}),u=wt(`${s.stdout||""}
52
+ ${s.stderr||""}`);u&&N(u,D)&&o.add(u);}catch{}let r=null;try{let i=await execa($(),["--version"],{timeout:2500}),s=wt(`${i.stdout||""}
53
+ ${i.stderr||""}`);s&&N(s,D)&&(r=s,o.add(s));}catch{}let a=xt.filter(i=>N(i,D)),c=new Set([...a,...o]),p=Array.from(c).sort((i,s)=>ct(s,i)),g=t?Tt(t):null,y=g&&N(g,D)?g:r||p[0]||D;return c.has(y)||c.add(y),{choices:Array.from(c).sort((i,s)=>ct(s,i)).map(i=>{let s=[];return i===r&&s.push("current system"),i===D&&s.push("minimum supported"),o.has(i)&&i!==r&&s.push("detected"),{name:s.length>0?`${i} (${s.join(", ")})`:i,value:i}}),defaultValue:y}}async function Nt(){T();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 e=c$1();try{await execa(e,["-m","pipx","--version"],{timeout:2500}),o=true;}catch{o=false;}}return {poetry:t,pipx:o}}async function It(){T();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function Ot(t,o){return t==="poetry"&&o.poetry?"poetry":t==="pipx"&&o.pipx?"pipx":t==="venv"?"venv":o.poetry?"poetry":"venv"}async function Vt(t,o){T(),t.start("Checking Poetry installation");try{await execa("poetry",["--version"]),t.succeed("Poetry found");return}catch{}if(o)throw new G;let{installPoetry:e}=await B.prompt([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!e)throw new G;let r=await X(t,o);t.start("Installing Poetry with pipx");try{await O(r,["install","poetry"]);}catch(a){let c=a,p=String(c?.stderr||c?.shortMessage||c?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(p))try{await O(r,["upgrade","poetry"]);}catch{}else throw new I("Install Poetry with pipx",a instanceof Error?a:new Error(p))}t.succeed("Poetry installed"),T();try{await execa("poetry",["--version"]);}catch(a){let c=a,p=String(c?.stderr||c?.shortMessage||c?.message||"Poetry not found on PATH");throw new I("Verify Poetry after pipx install",new Error(`${p}
54
54
 
55
- Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function Ot(t){let o=t==="poetry";return `#!/usr/bin/env sh
55
+ Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function Lt(t){let o=t==="poetry";return `#!/usr/bin/env sh
56
56
  set -eu
57
57
 
58
58
  SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
@@ -71,7 +71,7 @@ echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
71
71
  ${o?`echo "- If you used Poetry: run 'poetry install' and retry, or activate the env." 1>&2
72
72
  `:""}echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
73
73
  exit 1
74
- `}function Vt(t){return `@echo off
74
+ `}function Gt(t){return `@echo off
75
75
  setlocal
76
76
 
77
77
  set "SCRIPT_DIR=%~dp0"
@@ -90,18 +90,18 @@ if %ERRORLEVEL%==0 if exist "%SCRIPT_DIR%\\pyproject.toml" (
90
90
  `:""}echo RapidKit launcher could not find a local Python CLI. 1>&2
91
91
  echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
92
92
  exit /b 1
93
- `}async function xt(t,o){await v.outputFile(m.join(t,"rapidkit"),Ot(o),{encoding:"utf-8",mode:493}),await v.outputFile(m.join(t,"rapidkit.cmd"),Vt(o),"utf-8");}async function ke(t,o){let{skipGit:e=false,testMode:i=false,demoMode:a$1=false,dryRun:u=false,yes:p=false,userConfig:y={},installMethod:g,profile:f}=o,c=t||"rapidkit",r=m.resolve(process.cwd(),c);if(await v.pathExists(r))throw new B(c);if(u){await Gt(r,c,a$1,y);return}if(a$1){await Lt(r,c,e);return}let s=new Set(["python-only","polyglot","enterprise"]),d=f||"";if(!p&&!f){let{selectedProfile:w}=await J.prompt([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"polyglot \u2014 Python + Node.js + Go multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);d=w;}else d||(d="minimal");let P=!p&&s.has(d),E=typeof y.pythonVersion=="string"&&y.pythonVersion.trim().length>0?y.pythonVersion.trim():void 0,M=g||y.defaultInstallMethod||"poetry",I=P?await Tt():{poetry:true,pipx:true},V=P?await Dt(E):{choices:bt.map(w=>({name:w,value:w})),defaultValue:D},tt=Ft(M,I),Et=[{name:I.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env)":"\u{1F3AF} Poetry (Recommended - includes virtual env) \u2014 not detected (we can install it)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard, zero extra tools)",value:"venv"},{name:I.pipx?"\u{1F527} pipx (Global isolated install)":"\u{1F527} pipx (Global isolated install) \u2014 not detected (we can install it)",value:"pipx"}],R=P?await J.prompt([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:V.choices,default:V.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:Et,default:tt}]):await(async()=>{let w=g||y.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:y.pythonVersion||"3.10",installMethod:w}})();if(new Set(["go-only","node-only","minimal"]).has(d)){let w=Q("Creating workspace").start();try{await v.ensureDir(r),w.succeed("Directory created"),await rt(r,c,"venv",void 0),await st(r,c,"venv",void 0,d),await X(r),await at(r,c);let _={"go-only":"Go-only","node-only":"Node.js-only",minimal:"Minimal"};if(await v.outputFile(m.join(r,"README.md"),`# ${c}
93
+ `}async function Rt(t,o){await v.outputFile(m.join(t,"rapidkit"),Lt(o),{encoding:"utf-8",mode:493}),await v.outputFile(m.join(t,"rapidkit.cmd"),Gt(o),"utf-8");}async function be(t,o){let{skipGit:e=false,testMode:r=false,demoMode:a$1=false,dryRun:c=false,yes:p=false,userConfig:g={},installMethod:y,profile:h}=o,d=t||"rapidkit",i=m.resolve(process.cwd(),d);if(await v.pathExists(i))throw new q(d);if(c){await Wt(i,d,a$1,g);return}if(a$1){await Ut(i,d,e);return}let s=new Set(["python-only","polyglot","enterprise"]),u=h||"";if(!p&&!h){let{selectedProfile:w}=await B.prompt([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"polyglot \u2014 Python + Node.js + Go multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);u=w;}else u||(u="minimal");let P=!p&&s.has(u),E=typeof g.pythonVersion=="string"&&g.pythonVersion.trim().length>0?g.pythonVersion.trim():void 0,S=y||g.defaultInstallMethod||"poetry",R=P?await Nt():{poetry:true,pipx:true},V=P?await Ft(E):{choices:xt.map(w=>({name:w,value:w})),defaultValue:D},Z=Ot(S,R),$t=[{name:R.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env)":"\u{1F3AF} Poetry (Recommended - includes virtual env) \u2014 not detected (we can install it)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard, zero extra tools)",value:"venv"},{name:R.pipx?"\u{1F527} pipx (Global isolated install)":"\u{1F527} pipx (Global isolated install) \u2014 not detected (we can install it)",value:"pipx"}],x=P?await B.prompt([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:V.choices,default:V.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:$t,default:Z}]):await(async()=>{let w=y||g.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:g.pythonVersion||"3.10",installMethod:w}})();if(new Set(["go-only","node-only","minimal"]).has(u)){let w=J("Creating workspace").start();try{await v.ensureDir(i),w.succeed("Directory created"),await at(i,d,"venv",void 0),await lt(i,d,"venv",void 0,u),await Q(i),await st(i,d);let _={"go-only":"Go-only","node-only":"Node.js-only",minimal:"Minimal"};if(await v.outputFile(m.join(i,"README.md"),`# ${d}
94
94
 
95
- RapidKit **${_[d]}** workspace.
95
+ RapidKit **${_[u]}** workspace.
96
96
 
97
97
  ## Quick start
98
98
 
99
99
  \`\`\`bash
100
- `+(d==="go-only"?`npx rapidkit create project gofiber.standard my-api
100
+ `+(u==="go-only"?`npx rapidkit create project gofiber.standard my-api
101
101
  cd my-api
102
102
  npx rapidkit init
103
103
  npx rapidkit dev
104
- `:d==="node-only"?`npx rapidkit create project nestjs.standard my-app
104
+ `:u==="node-only"?`npx rapidkit create project nestjs.standard my-app
105
105
  cd my-app
106
106
  npx rapidkit init
107
107
  npx rapidkit dev
@@ -109,62 +109,71 @@ npx rapidkit dev
109
109
  cd <project-name>
110
110
  npx rapidkit init
111
111
  npx rapidkit dev
112
- `)+"```\n","utf-8"),!e){w.start("Initializing git repository");try{await execa("git",["init"],{cwd:r}),await execa("git",["add","."],{cwd:r}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:r}),w.succeed("Git repository initialized");}catch{w.warn("Could not initialize git repository");}}try{let{registerWorkspace:k}=await import('./workspace-J5UUDMHW.js');await k(r,c);}catch{}if(console.log(n.green(`
112
+ `)+"```\n","utf-8"),!e){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");}}try{let{registerWorkspace:k}=await import('./workspace-M2Y2ZVTK.js');await k(i,d);}catch{}if(console.log(n.green(`
113
113
  \u2728 Workspace created!
114
- `)),console.log(n.cyan("\u{1F4C2} Location:"),n.white(r)),console.log(n.cyan(`
114
+ `)),console.log(n.cyan("\u{1F4C2} Location:"),n.white(i)),console.log(n.cyan(`
115
115
  \u{1F680} Get started:
116
- `)),console.log(n.white(` cd ${c}`)),d==="go-only"){console.log(n.white(" npx rapidkit create project gofiber.standard my-api")),console.log(n.white(" cd my-api")),console.log(n.white(" npx rapidkit init")),console.log(n.white(` npx rapidkit dev
116
+ `)),console.log(n.white(` cd ${d}`)),u==="go-only"){console.log(n.white(" npx rapidkit create project gofiber.standard my-api")),console.log(n.white(" cd my-api")),console.log(n.white(" npx rapidkit init")),console.log(n.white(` npx rapidkit dev
117
117
  `)),console.log(n.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:k}=await execa("go",["version"],{timeout:3e3}),j=k.match(/go version go(\d+\.\d+(?:\.\d+)?)/),A=j?j[1]:"unknown";console.log(n.gray(`\u{1F439} Go ${A} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(n.yellow(`
118
- \u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else d==="node-only"?(console.log(n.white(" npx rapidkit create project nestjs.standard my-app")),console.log(n.white(" cd my-app")),console.log(n.white(" npx rapidkit init")),console.log(n.white(` npx rapidkit dev
118
+ \u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else u==="node-only"?(console.log(n.white(" npx rapidkit create project nestjs.standard my-app")),console.log(n.white(" cd my-app")),console.log(n.white(" npx rapidkit init")),console.log(n.white(` npx rapidkit dev
119
119
  `)),console.log(n.gray("\u{1F4A1} Python engine will be installed automatically on first `create project nestjs.standard`."))):(console.log(n.white(" npx rapidkit create project")),console.log(n.white(" cd <project-name>")),console.log(n.white(" npx rapidkit init")),console.log(n.white(` npx rapidkit dev
120
120
  `)),console.log(n.gray("\u{1F4A1} Bootstrap a specific runtime any time: rapidkit bootstrap --profile python-only|node-only|go-only")));console.log("");}catch(_){throw w.fail("Failed to create workspace"),console.error(n.red(`
121
- \u274C Error:`),_),_}return}{let w=C(),_=false;try{await execa(w,["--version"],{timeout:5e3}),_=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),_=true;}catch{_=false;}}_||(console.log(n.red(`
122
- \u274C Python 3.10+ is required for the "${d}" profile.
121
+ \u274C Error:`),_),_}return}{let w=$(),_=false;try{await execa(w,["--version"],{timeout:5e3}),_=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),_=true;}catch{_=false;}}_||(console.log(n.red(`
122
+ \u274C Python 3.10+ is required for the "${u}" profile.
123
123
  `)),console.log(n.cyan(`\u{1F4A1} How to install Python:
124
124
  `)),console.log(n.white(" Ubuntu / Debian: sudo apt install python3.10")),console.log(n.white(" macOS (Homebrew): brew install python@3.10")),console.log(n.white(` Windows: https://python.org/downloads
125
- `)),console.log(n.gray(` After installing Python, run: npx rapidkit ${c}
126
- `)),process.exit(1));}a.step(1,3,"Setting up RapidKit environment");let b=Q("Creating directory").start();try{await v.ensureDir(r),b.succeed("Directory created"),b.start("Detecting Python version");let w=null,_=await It(R.pythonVersion);if(_)w=await yt(_),w?(a.info(` Detected Python ${w}`),b.succeed(`Python ${w} detected`)):b.warn("Could not detect exact Python version");else {let k=C();w=await yt(k),w?b.succeed(`Python ${w} detected`):b.warn("Could not detect Python version, proceeding with defaults");}if(await rt(r,c,R.installMethod,w||void 0),w&&await At(r,w),await st(r,c,R.installMethod,w||R.pythonVersion,d||f),await X(r),await at(r,c),R.installMethod==="poetry")try{await Rt(r,R.pythonVersion,b,i,y,p);}catch(k){let j=k?.details||k?.message||String(k);if(j.includes("pyenv")||j.includes("exit status 127")||j.includes("returned non-zero exit status 127")){b.warn("Poetry encountered Python discovery issues, trying venv method"),a.debug(`Poetry error (attempting venv fallback): ${j}`);try{await ct(r,R.pythonVersion,b,i,y),R.installMethod="venv";}catch(dt){throw dt}}else throw k}else R.installMethod==="venv"?await ct(r,R.pythonVersion,b,i,y):await _t(r,b,i,y,p);if(await xt(r,R.installMethod),await jt(r,R.installMethod),b.succeed("RapidKit environment ready!"),!o.skipGit){b.start("Initializing git repository");try{await execa("git",["init"],{cwd:r}),await execa("git",["add","."],{cwd:r}),await execa("git",["commit","-m","Initial commit: RapidKit environment"],{cwd:r}),b.succeed("Git repository initialized");}catch{b.warn("Could not initialize git repository");}}try{let{registerWorkspace:k}=await import('./workspace-J5UUDMHW.js');await k(r,c);}catch{console.warn(n.gray("Note: Could not register workspace in shared registry"));}if(console.log(n.green(`
125
+ `)),console.log(n.gray(` After installing Python, run: npx rapidkit ${d}
126
+ `)),process.exit(1));}a.step(1,3,"Setting up RapidKit environment");let b=J("Creating directory").start();try{await v.ensureDir(i),b.succeed("Directory created"),b.start("Detecting Python version");let w=null,_=await _t(x.pythonVersion);if(_)w=await ft(_),w?(a.info(` Detected Python ${w}`),b.succeed(`Python ${w} detected`)):b.warn("Could not detect exact Python version");else {let k=$();w=await ft(k),w?b.succeed(`Python ${w} detected`):b.warn("Could not detect Python version, proceeding with defaults");}if(x.installMethod==="poetry"&&!await It()&&(b.warn("Poetry not found \u2014 auto-fallback to pip + venv"),x.installMethod="venv"),await at(i,d,x.installMethod,w||void 0),w&&await Dt(i,w),await lt(i,d,x.installMethod,w||x.pythonVersion,u||h),await Q(i),await st(i,d),x.installMethod==="poetry")try{await jt(i,x.pythonVersion,b,r,g,p);}catch(k){let j=k?.details||k?.message||String(k);if(j.includes("pyenv")||j.includes("exit status 127")||j.includes("returned non-zero exit status 127")){b.warn("Poetry encountered Python discovery issues, trying venv method"),a.debug(`Poetry error (attempting venv fallback): ${j}`);try{await dt(i,x.pythonVersion,b,r,g),x.installMethod="venv";}catch(pt){throw pt}}else throw k}else x.installMethod==="venv"?await dt(i,x.pythonVersion,b,r,g):await Et(i,b,r,g,p);if(await Rt(i,x.installMethod),await Ct(i,x.installMethod),b.succeed("RapidKit environment ready!"),!o.skipGit){b.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}),b.succeed("Git repository initialized");}catch{b.warn("Could not initialize git repository");}}try{let{registerWorkspace:k}=await import('./workspace-M2Y2ZVTK.js');await k(i,d);}catch{console.warn(n.gray("Note: Could not register workspace in shared registry"));}if(console.log(n.green(`
127
127
  \u2728 RapidKit environment created successfully!
128
- `)),console.log(n.cyan("\u{1F4C2} Location:"),n.white(r)),console.log(n.cyan(`\u{1F680} Get started:
129
- `)),console.log(n.white(` cd ${c}`)),R.installMethod==="poetry"){let k="source $(poetry env info --path)/bin/activate";try{N();let{stdout:j}=await execa("poetry",["--version"]),A=j.match(/Poetry.*?(\d+)\.(\d+)/);A&&(parseInt(A[1])>=2?k="source $(poetry env info --path)/bin/activate":k="poetry shell");}catch{}console.log(n.white(` ${k} # Or: poetry run rapidkit`)),console.log(n.white(" rapidkit create # Interactive mode")),console.log(n.white(" cd <project-name>")),console.log(n.white(" rapidkit init")),console.log(n.white(" rapidkit dev"));}else R.installMethod==="venv"?(console.log(n.white(" source .venv/bin/activate # On Windows: .venv\\Scripts\\activate")),console.log(n.white(" rapidkit create # Interactive mode")),console.log(n.white(" cd <project-name>")),console.log(n.white(" rapidkit init")),console.log(n.white(" rapidkit dev"))):(console.log(n.white(" rapidkit create # Interactive mode")),console.log(n.white(" cd <project-name>")),console.log(n.white(" rapidkit init")),console.log(n.white(" rapidkit dev")));console.log(n.white(`
128
+ `)),console.log(n.cyan("\u{1F4C2} Location:"),n.white(i)),console.log(n.cyan(`\u{1F680} Get started:
129
+ `)),console.log(n.white(` cd ${d}`)),x.installMethod==="poetry"){let k="source $(poetry env info --path)/bin/activate";try{T();let{stdout:j}=await execa("poetry",["--version"]),A=j.match(/Poetry.*?(\d+)\.(\d+)/);A&&(parseInt(A[1])>=2?k="source $(poetry env info --path)/bin/activate":k="poetry shell");}catch{}console.log(n.white(` ${k} # Or: poetry run rapidkit`)),console.log(n.white(" rapidkit create # Interactive mode")),console.log(n.white(" cd <project-name>")),console.log(n.white(" rapidkit init")),console.log(n.white(" rapidkit dev"));}else x.installMethod==="venv"?(console.log(n.white(" source .venv/bin/activate # On Windows: .venv\\Scripts\\activate")),console.log(n.white(" rapidkit create # Interactive mode")),console.log(n.white(" cd <project-name>")),console.log(n.white(" rapidkit init")),console.log(n.white(" rapidkit dev"))):(console.log(n.white(" rapidkit create # Interactive mode")),console.log(n.white(" cd <project-name>")),console.log(n.white(" rapidkit init")),console.log(n.white(" rapidkit dev")));console.log(n.white(`
130
130
  \u{1F4A1} For more information, check the README.md file.`)),console.log(n.cyan(`
131
131
  \u{1F4DA} RapidKit commands:`)),console.log(n.white(" rapidkit create - Create a new project (interactive)")),console.log(n.white(" rapidkit dev - Run development server")),console.log(n.white(" rapidkit add module <name> - Add a module (e.g., settings)")),console.log(n.white(" rapidkit list - List available kits")),console.log(n.white(" rapidkit modules - List available modules")),console.log(n.white(` rapidkit --help - Show all commands
132
132
  `));try{let{stdout:k}=await execa("go",["version"],{timeout:3e3}),j=k.match(/go version go(\d+\.\d+(?:\.\d+)?)/),A=j?j[1]:"unknown";console.log(n.gray(`\u{1F439} Go toolchain: Go ${A} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(n.yellow("\u26A0\uFE0F Go toolchain not installed \u2014 needed for gofiber.standard projects")),console.log(n.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(w){b.fail("Failed to create RapidKit environment"),console.error(n.red(`
133
- \u274C Error:`),w);try{await v.remove(r);}catch{}throw w}}async function It(t){let o=[];if(!a$2())try{let{stdout:e}=await execa("pyenv",["which","python"]),i=e.trim();i&&o.push(i);}catch{}o.push(`python${t}`,`python3.${t.split(".")[1]}`,"python3","python"),a$2()&&o.push("py"),a$2()||o.push(`/usr/bin/python${t}`,"/usr/bin/python3",`/usr/local/bin/python${t}`,"/usr/local/bin/python3");for(let e of o)try{let i=e==="py"?["-3","--version"]:["--version"],a=e==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:u}=await execa(e,i,{timeout:2e3}),p=u.match(/Python (\d+\.\d+)/)?.[1];if(p&&F(p,t))return await execa(e,a,{timeout:2e3}),e}catch{continue}return null}async function Rt(t,o,e,i,a$1,u=false){await Nt(e,u),e.start("Finding Python interpreter");let p=await It(o);p?(a.debug(`Found working Python: ${p}`),e.succeed("Python found")):e.warn("Could not verify Python path, proceeding with default"),e.start("Initializing Poetry project");let y=m.join(t,"pyproject.toml"),f$1=(await v.pathExists(y)?await promises.readFile(y,"utf-8"):"").includes("rapidkit-core");if(f$1)e.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${o}`],{cwd:t}),e.succeed("Poetry project initialized");let d=await promises.readFile(y,"utf-8");d.includes("[tool.poetry]")?d=d.replace("[tool.poetry]",`[tool.poetry]
134
- package-mode = false`):d.includes("[project]")&&(d.includes("[build-system]")?d=d.replace("[build-system]",`
133
+ \u274C Error:`),w);try{await v.remove(i);}catch{}throw w}}async function _t(t){let o=[];if(!a$2())try{let{stdout:c}=await execa("pyenv",["which","python"]),p=c.trim();p&&o.push(p);}catch{}let e$1=Number(t.split(".")[1]),r=e(e$1,10).map(c=>c.command).filter(Boolean);o.push(`python${t}`,...r,...d$1());let a=[...new Set(o)];for(let c of a)try{let p=c==="py"?["-3","--version"]:["--version"],g=c==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:y}=await execa(c,p,{timeout:2e3}),h=y.match(/Python (\d+\.\d+)/)?.[1];if(h&&N(h,t))return await execa(c,g,{timeout:2e3}),c}catch{continue}return null}async function jt(t,o,e,r,a$1,c=false){await Vt(e,c),e.start("Finding Python interpreter");let p=await _t(o);p?(a.debug(`Found working Python: ${p}`),e.succeed("Python found")):e.warn("Could not verify Python path, proceeding with default"),e.start("Initializing Poetry project");let g=m.join(t,"pyproject.toml"),h=(await v.pathExists(g)?await promises.readFile(g,"utf-8"):"").includes("rapidkit-core");if(h)e.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${o}`],{cwd:t}),e.succeed("Poetry project initialized");let u=await promises.readFile(g,"utf-8");u.includes("[tool.poetry]")?u=u.replace("[tool.poetry]",`[tool.poetry]
134
+ package-mode = false`):u.includes("[project]")&&(u.includes("[build-system]")?u=u.replace("[build-system]",`
135
135
  [tool.poetry]
136
136
  package-mode = false
137
137
 
138
- [build-system]`):d+=`
138
+ [build-system]`):u+=`
139
139
 
140
140
  [tool.poetry]
141
141
  package-mode = false
142
- `),await promises.writeFile(y,d,"utf-8");}e.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:t}),e.succeed("Poetry configured");}catch{e.warn("Could not configure Poetry virtualenvs.in-project");}e.start("Creating virtualenv");let c=p||C(),r=f(m.join(t,".venv"));try{await execa(c,["-m","venv",".venv"],{cwd:t,timeout:6e4}),e.succeed("Virtualenv created");}catch(s){a.debug(`python -m venv failed: ${s}`),e.warn("Could not pre-create virtualenv, Poetry will try"),r=p||C();}try{await execa("poetry",["env","use",r||C()],{cwd:t}),a.debug(`Poetry env set to: ${r}`);}catch(s){a.debug(`Could not set Poetry env: ${s}`);}if(e.start("Installing RapidKit"),f$1&&!i){let s=L(a$1||{}),d=s?await v.pathExists(s):false,P=d&&s?s:"rapidkit-core";s&&!d&&a.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${s}. Falling back to PyPI.`),e.text=d?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let E=false,M=null;for(let I=1;I<=3;I++)try{await execa(r,["-m","pip","install",P,"--quiet"],{cwd:t,timeout:18e4}),E=true;break}catch(V){M=V,a.debug(`pip install rapidkit-core attempt ${I} failed: ${V}`),I<3&&(e.text=`Retrying installation (attempt ${I+1}/3)`,await new Promise(tt=>setTimeout(tt,2e3)));}if(!E){let I=M?.stderr||M?.message||"Unknown error";throw a.debug(`All pip install attempts failed. Last error: ${I}`),I.includes("Could not find")||I.includes("No matching distribution")?new K:new x("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
143
- Error: ${I}
142
+ `),await promises.writeFile(g,u,"utf-8");}e.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:t}),e.succeed("Poetry configured");}catch{e.warn("Could not configure Poetry virtualenvs.in-project");}e.start("Creating virtualenv");let d=p||$(),i=f(m.join(t,".venv"));try{await execa(d,["-m","venv",".venv"],{cwd:t,timeout:6e4}),e.succeed("Virtualenv created");}catch(s){a.debug(`python -m venv failed: ${s}`),e.warn("Could not pre-create virtualenv, Poetry will try"),i=p||$();}try{await execa("poetry",["env","use",i||$()],{cwd:t}),a.debug(`Poetry env set to: ${i}`);}catch(s){a.debug(`Could not set Poetry env: ${s}`);}if(e.start("Installing RapidKit"),h&&!r){let s=L(a$1||{}),u=s?await v.pathExists(s):false,P=u&&s?s:"rapidkit-core";s&&!u&&a.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${s}. Falling back to PyPI.`),e.text=u?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let E=false,S=null;for(let R=1;R<=3;R++)try{await execa(i,["-m","pip","install",P,"--quiet"],{cwd:t,timeout:18e4}),E=true;break}catch(V){S=V,a.debug(`pip install rapidkit-core attempt ${R} failed: ${V}`),R<3&&(e.text=`Retrying installation (attempt ${R+1}/3)`,await new Promise(Z=>setTimeout(Z,2e3)));}if(!E){let R=S?.stderr||S?.message||"Unknown error";throw a.debug(`All pip install attempts failed. Last error: ${R}`),R.includes("Could not find")||R.includes("No matching distribution")?new K:new I("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
143
+ Error: ${R}
144
144
 
145
145
  Possible solutions:
146
146
  1. Check your internet connection
147
147
  2. Try installing manually: cd ${m.basename(t)} && poetry add rapidkit-core
148
- 3. Use venv method instead: npx rapidkit ${m.basename(t)} --install-method=venv`))}}else {e.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:12e4}),e.succeed("Poetry environment synced");}catch(s){a.debug(`poetry install --no-root failed: ${s}`),e.warn("Could not sync Poetry environment, proceeding with add command");}if(e.start("Installing RapidKit"),i){let s=L(a$1||{});if(!s)throw new x("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a.debug(`Installing from local path: ${s}`),e.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",s],{cwd:t});}else {e.text="Installing RapidKit from PyPI";let s=false,d=null;for(let P=1;P<=3;P++)try{await execa("poetry",["add","rapidkit-core"],{cwd:t,timeout:6e4*P}),s=true;break}catch(E){d=E,a.debug(`Poetry add attempt ${P} failed: ${E}`),P<3&&(e.text=`Retrying installation (attempt ${P+1}/3)`,await new Promise(M=>setTimeout(M,2e3)));}if(!s){let P=d?.stderr||d?.message||"Unknown error";throw a.debug(`All Poetry install attempts failed. Last error: ${P}`),P.includes("Could not find")||P.includes("No matching distribution")?new K:new x("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
148
+ 3. Use venv method instead: npx rapidkit ${m.basename(t)} --install-method=venv`))}}else {e.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:12e4}),e.succeed("Poetry environment synced");}catch(s){a.debug(`poetry install --no-root failed: ${s}`),e.warn("Could not sync Poetry environment, proceeding with add command");}if(e.start("Installing RapidKit"),r){let s=L(a$1||{});if(!s)throw new I("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a.debug(`Installing from local path: ${s}`),e.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",s],{cwd:t});}else {e.text="Installing RapidKit from PyPI";let s=false,u=null;for(let P=1;P<=3;P++)try{await execa("poetry",["add","rapidkit-core"],{cwd:t,timeout:6e4*P}),s=true;break}catch(E){u=E,a.debug(`Poetry add attempt ${P} failed: ${E}`),P<3&&(e.text=`Retrying installation (attempt ${P+1}/3)`,await new Promise(S=>setTimeout(S,2e3)));}if(!s){let P=u?.stderr||u?.message||"Unknown error";throw a.debug(`All Poetry install attempts failed. Last error: ${P}`),P.includes("Could not find")||P.includes("No matching distribution")?new K:new I("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
149
149
  Error: ${P}
150
150
 
151
151
  Possible solutions:
152
152
  1. Check your internet connection
153
153
  2. Try installing manually: cd ${m.basename(t)} && poetry add rapidkit-core
154
- 3. Use venv method instead: npx rapidkit ${m.basename(t)} --install-method=venv`))}}}e.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:s}=await import('./pythonRapidkitExec-7LPE3JUQ.js');if(!await s()&&!i){e.start("Installing RapidKit globally with pipx for CLI access");let P=await Z(e,u);try{await O(P,["install","rapidkit-core"]),e.succeed("RapidKit installed globally");}catch(E){e.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a.debug(`pipx install failed: ${E}`);}}}catch(s){a.debug(`Global install check skipped: ${s}`);}}async function ct(t,o,e,i,a$1,u=false){e.start(`Checking Python ${o}`);let p=C();try{let{stdout:g}=await execa(p,["--version"]),f=g.match(/Python (\d+\.\d+)/)?.[1];if(f&&!F(f,o))throw new T(o,f);e.succeed(`Python ${f} found`);}catch(g){throw g instanceof T?g:new T(o)}e.start("Creating virtual environment");try{await execa(p,["-m","venv",".venv"],{cwd:t}),e.succeed("Virtual environment created");}catch(g){if(e.fail("Failed to create virtual environment"),(c=>typeof c=="object"&&c!==null&&"stdout"in c&&typeof c.stdout=="string")(g)&&g.stdout.includes("ensurepip is not")){let c=g.stdout.match(/apt install (python[\d.]+-venv)/),r=c?c[1]:"python3-venv";throw new x("Python venv module not available",new Error(`Virtual environment creation failed.
154
+ 3. Use venv method instead: npx rapidkit ${m.basename(t)} --install-method=venv`))}}}e.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:s}=await import('./pythonRapidkitExec-K2SFGAYJ.js');if(!await s()&&!r){e.start("Checking optional global pipx installation");let P=await X(e,true);try{e.start("Installing RapidKit globally with pipx for CLI access"),await O(P,["install","rapidkit-core"]),e.succeed("RapidKit installed globally");}catch(E){e.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a.debug(`pipx install failed: ${E}`);}}}catch(s){e.succeed("Skipped optional global pipx installation"),a.debug(`Global install check skipped: ${s}`);}}async function dt(t,o,e,r,a$1,c=false){e.start(`Checking Python ${o}`);let p=$();try{let{stdout:y}=await execa(p,["--version"]),h=y.match(/Python (\d+\.\d+)/)?.[1];if(h&&!N(h,o))throw new F(o,h);e.succeed(`Python ${h} found`);}catch(y){throw y instanceof F?y:new F(o)}e.start("Creating virtual environment");try{await execa(p,["-m","venv",".venv"],{cwd:t}),e.succeed("Virtual environment created");}catch(y){if(e.fail("Failed to create virtual environment"),(d=>typeof d=="object"&&d!==null&&"stdout"in d&&typeof d.stdout=="string")(y)&&y.stdout.includes("ensurepip is not")){let d=y.stdout.match(/apt install (python[\d.]+-venv)/),i=d?d[1]:"python3-venv";throw new I("Python venv module not available",new Error(`Virtual environment creation failed.
155
155
 
156
156
  On Debian/Ubuntu systems, install the venv package:
157
- sudo apt install ${r}
157
+ sudo apt install ${i}
158
158
 
159
159
  Or use Poetry instead (recommended):
160
- npx rapidkit ${m.basename(t)} --yes`))}throw new x("Virtual environment creation",g instanceof Error?g:new Error(String(g)))}e.start("Installing RapidKit");let y=f(m.join(t,".venv"));if(await execa(y,["-m","pip","install","--upgrade","pip"],{cwd:t}),i){let g=L(a$1||{});if(!g)throw new x("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a.debug(`Installing from local path: ${g}`),e.text="Installing RapidKit from local path (test mode)",await execa(y,["-m","pip","install","-e",g],{cwd:t});}else {e.text="Installing RapidKit from PyPI";let g=false,f$1=null;for(let c=1;c<=3;c++)try{await execa(y,["-m","pip","install","rapidkit-core"],{cwd:t,timeout:6e4*c}),g=true;break}catch(r){f$1=r,a.debug(`pip install attempt ${c} failed: ${r}`),c<3&&(e.text=`Retrying installation (attempt ${c+1}/3)`,await new Promise(s=>setTimeout(s,2e3)));}if(!g){let c=f$1?.stderr||f$1?.message||"Unknown error";throw a.debug(`All pip install attempts failed. Last error: ${c}`),c.includes("Could not find")||c.includes("No matching distribution")?new K:new x("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
161
- Error: ${c}
160
+ npx rapidkit ${m.basename(t)} --yes`))}throw new I("Virtual environment creation",y instanceof Error?y:new Error(String(y)))}e.start("Installing RapidKit");let g=f(m.join(t,".venv"));if(await execa(g,["-m","pip","install","--upgrade","pip"],{cwd:t}),r){let y=L(a$1||{});if(!y)throw new I("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a.debug(`Installing from local path: ${y}`),e.text="Installing RapidKit from local path (test mode)",await execa(g,["-m","pip","install","-e",y],{cwd:t});}else {e.text="Installing RapidKit from PyPI";let y=false,h=null;for(let d=1;d<=3;d++)try{await execa(g,["-m","pip","install","rapidkit-core"],{cwd:t,timeout:6e4*d}),y=true;break}catch(i){h=i,a.debug(`pip install attempt ${d} failed: ${i}`),d<3&&(e.text=`Retrying installation (attempt ${d+1}/3)`,await new Promise(s=>setTimeout(s,2e3)));}if(!y){let d=h?.stderr||h?.message||"Unknown error";throw a.debug(`All pip install attempts failed. Last error: ${d}`),d.includes("Could not find")||d.includes("No matching distribution")?new K:new I("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
161
+ Error: ${d}
162
162
 
163
163
  Possible solutions:
164
164
  1. Check your internet connection
165
165
  2. Try installing manually: cd ${m.basename(t)} && ${f(".venv")} -m pip install rapidkit-core
166
- 3. Use Poetry instead: npx rapidkit ${m.basename(t)} --install-method=poetry`))}}e.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:g}=await import('./pythonRapidkitExec-7LPE3JUQ.js');if(!await g()&&!i){e.start("Installing RapidKit globally with pipx for CLI access");let c=await Z(e,u);try{await O(c,["install","rapidkit-core"]),e.succeed("RapidKit installed globally");}catch(r){e.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a.debug(`pipx install failed: ${r}`);}}}catch(g){a.debug(`Global install check skipped: ${g}`);}}async function _t(t,o,e,i,a$1=false){let u=await Z(o,a$1);if(o.start("Installing RapidKit globally with pipx"),e){let p=L(i||{});if(!p)throw new x("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a.debug(`Installing from local path: ${p}`),o.text="Installing RapidKit from local path (test mode)",await O(u,["install","-e",p]);}else {o.text="Installing RapidKit from PyPI";try{await O(u,["install","rapidkit-core"]);}catch{throw new K}}o.succeed("RapidKit installed globally"),await v.outputFile(m.join(t,".rapidkit-global"),`RapidKit installed globally with pipx
167
- `,"utf-8");}async function Pe(t,o){let{skipGit:e=false,testMode:i=false,userConfig:a$1={},yes:u=false,installMethod:p,pythonVersion:y="3.10"}=o||{},g=p||a$1.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();await rt(t,m.basename(t),g),await X(t),await st(t,m.basename(t),g,y,o?.profile);let f=Q("Registering workspace").start();try{g==="poetry"?(await at(t,m.basename(t)),await Rt(t,y,f,i,a$1,u)):g==="venv"?await ct(t,y,f,i,a$1):await _t(t,f,i,a$1,u),await xt(t,g),await jt(t,g),f.succeed("Workspace registered");try{let{registerWorkspace:c}=await import('./workspace-J5UUDMHW.js');await c(t,m.basename(t));}catch{}if(!e){f.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}),f.succeed("Git repository initialized");}catch{f.warn("Could not initialize git repository");}}}catch(c){throw f.fail("Failed to register workspace"),c}}async function jt(t,o){let a=`# RapidKit Workspace
166
+ 3. Use Poetry instead: npx rapidkit ${m.basename(t)} --install-method=poetry`))}}e.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:y}=await import('./pythonRapidkitExec-K2SFGAYJ.js');if(!await y()&&!r){e.start("Checking optional global pipx installation");let d=await X(e,true);try{e.start("Installing RapidKit globally with pipx for CLI access"),await O(d,["install","rapidkit-core"]),e.succeed("RapidKit installed globally");}catch(i){e.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a.debug(`pipx install failed: ${i}`);}}}catch(y){e.succeed("Skipped optional global pipx installation"),a.debug(`Global install check skipped: ${y}`);}}async function Et(t,o,e,r,a$1=false){let c=await X(o,a$1);if(o.start("Installing RapidKit globally with pipx"),e){let p=L(r||{});if(!p)throw new I("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a.debug(`Installing from local path: ${p}`),o.text="Installing RapidKit from local path (test mode)",await O(c,["install","-e",p]);}else {o.text="Installing RapidKit from PyPI";try{await O(c,["install","rapidkit-core"]);}catch{throw new K}}o.succeed("RapidKit installed globally"),await v.outputFile(m.join(t,".rapidkit-global"),`RapidKit installed globally with pipx
167
+ `,"utf-8");}async function xe(t,o){let{skipGit:e=false,testMode:r=false,userConfig:a$1={},yes:c=false,installMethod:p,pythonVersion:g="3.10"}=o||{},y=p||a$1.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),h=y==="poetry"&&!await It()?"venv":y;await at(t,m.basename(t),h),await Q(t),await lt(t,m.basename(t),h,g,o?.profile);let d=J("Registering workspace").start();try{h==="poetry"?(await st(t,m.basename(t)),await jt(t,g,d,r,a$1,c)):h==="venv"?await dt(t,g,d,r,a$1):await Et(t,d,r,a$1,c),await Rt(t,h),await Ct(t,h),d.succeed("Workspace registered");try{let{registerWorkspace:i}=await import('./workspace-M2Y2ZVTK.js');await i(t,m.basename(t));}catch{}if(!e){d.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}),d.succeed("Git repository initialized");}catch{d.warn("Could not initialize git repository");}}}catch(i){throw d.fail("Failed to register workspace"),i}}async function Ct(t,o){let e=o==="poetry"?`source $(poetry env info --path)/bin/activate
168
+ # 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):
169
+ ./rapidkit --help
170
+ # or:
171
+ poetry run rapidkit --help`:o==="venv"?`# No activation needed (recommended):
172
+ ./rapidkit --help
173
+ # or direct:
174
+ ./.venv/bin/rapidkit --help`:`# Optional: use the local launcher
175
+ ./rapidkit --help
176
+ # (pipx installs may require Poetry/venv to be present in this folder)`,a=a$2()?"python --version (or: py -3 --version)":"python3 --version (or: python --version)",c=`# RapidKit Workspace
168
177
 
169
178
  This directory contains a RapidKit development environment.
170
179
 
@@ -179,22 +188,13 @@ This directory contains a RapidKit development environment.
179
188
  This workspace includes a local launcher script so you can run the Python Core CLI without activating the environment:
180
189
 
181
190
  \`\`\`bash
182
- ${o==="poetry"?`# No activation needed (recommended):
183
- ./rapidkit --help
184
- # or:
185
- poetry run rapidkit --help`:o==="venv"?`# No activation needed (recommended):
186
- ./rapidkit --help
187
- # or direct:
188
- ./.venv/bin/rapidkit --help`:`# Optional: use the local launcher
189
- ./rapidkit --help
190
- # (pipx installs may require Poetry/venv to be present in this folder)`}
191
+ ${r}
191
192
  \`\`\`
192
193
 
193
194
  ### 1. Activate Environment
194
195
 
195
196
  \`\`\`bash
196
- ${o==="poetry"?`source $(poetry env info --path)/bin/activate
197
- # Or simply use: poetry run rapidkit <command>`:o==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)"}
197
+ ${e}
198
198
  \`\`\`
199
199
 
200
200
  ### 2. Create Your First Project
@@ -271,11 +271,11 @@ README.md # This file
271
271
 
272
272
  If you encounter issues:
273
273
 
274
- 1. Ensure Python 3.10+ is installed: \`python3 --version\`
274
+ 1. Ensure Python 3.10+ is installed: \`${a}\`
275
275
  2. Check RapidKit installation: \`rapidkit --version\`
276
276
  3. Run diagnostics: \`rapidkit doctor\`
277
277
  4. Visit RapidKit documentation or GitHub issues
278
- `;await promises.writeFile(m.join(t,"README.md"),a,"utf-8");}async function Lt(t,o,e){let i=Q("Creating demo workspace").start();try{await v.ensureDir(t),i.succeed("Directory created"),i.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(t,"package.json"),a,"utf-8"),await promises.writeFile(m.join(t,"generate-demo.js"),`#!/usr/bin/env node
278
+ `;await promises.writeFile(m.join(t,"README.md"),c,"utf-8");}async function Ut(t,o,e){let r=J("Creating demo workspace").start();try{await v.ensureDir(t),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(t,"package.json"),a,"utf-8"),await promises.writeFile(m.join(t,"generate-demo.js"),`#!/usr/bin/env node
279
279
  /**
280
280
  * Demo Kit Generator - Create FastAPI demo projects
281
281
  *
@@ -758,7 +758,7 @@ ${o}/
758
758
  ---
759
759
 
760
760
  **Generated with RapidKit** | [GitHub](https://github.com/getrapidkit/rapidkit-npm)
761
- `;if(await promises.writeFile(m.join(t,"README.md"),p,"utf-8"),i.succeed("Demo workspace setup complete"),!e){i.start("Initializing git repository");try{await execa("git",["init"],{cwd:t}),await v.outputFile(m.join(t,".gitignore"),`# Dependencies
761
+ `;if(await promises.writeFile(m.join(t,"README.md"),p,"utf-8"),r.succeed("Demo workspace setup complete"),!e){r.start("Initializing git repository");try{await execa("git",["init"],{cwd:t}),await v.outputFile(m.join(t,".gitignore"),`# Dependencies
762
762
  node_modules/
763
763
 
764
764
  # Generated projects
@@ -771,16 +771,16 @@ __pycache__/
771
771
  *.pyc
772
772
  .venv/
773
773
  .env
774
- `,"utf-8"),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:t}),i.succeed("Git repository initialized");}catch{i.warn("Could not initialize git repository");}}console.log(n.green(`
774
+ `,"utf-8"),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:t}),r.succeed("Git repository initialized");}catch{r.warn("Could not initialize git repository");}}console.log(n.green(`
775
775
  \u2728 Demo workspace created successfully!
776
776
  `)),console.log(n.cyan("\u{1F4C2} Location:"),n.white(t)),console.log(n.cyan(`\u{1F680} Get started:
777
- `)),console.log(n.white(` cd ${o}`)),console.log(n.white(" node generate-demo.js my-api")),console.log(n.white(" cd my-api")),console.log(n.white(" rapidkit init")),console.log(n.white(" rapidkit dev")),console.log(),console.log(n.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For full RapidKit features:"),console.log(n.cyan(" pipx install rapidkit")),console.log();}catch(a){throw i.fail("Failed to create demo workspace"),a}}async function Gt(t,o,e,i){console.log(n.cyan(`
777
+ `)),console.log(n.white(` cd ${o}`)),console.log(n.white(" node generate-demo.js my-api")),console.log(n.white(" cd my-api")),console.log(n.white(" rapidkit init")),console.log(n.white(" rapidkit dev")),console.log(),console.log(n.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For full RapidKit features:"),console.log(n.cyan(" pipx install rapidkit")),console.log();}catch(a){throw r.fail("Failed to create demo workspace"),a}}async function Wt(t,o,e,r){console.log(n.cyan(`
778
778
  \u{1F50D} Dry-run mode - showing what would be created:
779
779
  `)),console.log(n.white("\u{1F4C2} Project path:"),t),console.log(n.white("\u{1F4E6} Project type:"),e?"Demo workspace":"Full RapidKit environment"),e?(console.log(n.white(`
780
780
  \u{1F4DD} Files to create:`)),console.log(n.gray(" - package.json")),console.log(n.gray(" - generate-demo.js (project generator)")),console.log(n.gray(" - README.md")),console.log(n.gray(" - .gitignore")),console.log(n.white(`
781
781
  \u{1F3AF} Capabilities:`)),console.log(n.gray(" - Generate multiple FastAPI demo projects")),console.log(n.gray(" - No Python RapidKit installation required")),console.log(n.gray(" - Bundled templates included"))):(console.log(n.white(`
782
- \u2699\uFE0F Configuration:`)),console.log(n.gray(` - Python version: ${i.pythonVersion||"3.10"}`)),console.log(n.gray(` - Install method: ${i.defaultInstallMethod||"poetry"}`)),console.log(n.gray(` - Git initialization: ${i.skipGit?"No":"Yes"}`)),console.log(n.white(`
782
+ \u2699\uFE0F Configuration:`)),console.log(n.gray(` - Python version: ${r.pythonVersion||"3.10"}`)),console.log(n.gray(` - Install method: ${r.defaultInstallMethod||"poetry"}`)),console.log(n.gray(` - Git initialization: ${r.skipGit?"No":"Yes"}`)),console.log(n.white(`
783
783
  \u{1F4DD} Files to create:`)),console.log(n.gray(" - pyproject.toml (Poetry) or .venv/ (venv)")),console.log(n.gray(" - README.md")),console.log(n.gray(" - .gitignore")),console.log(n.white(`
784
784
  \u{1F3AF} Next steps after creation:`)),console.log(n.gray(" 1. Install RapidKit Python package")),console.log(n.gray(" 2. Create projects with rapidkit CLI")),console.log(n.gray(" 3. Add modules and customize"))),console.log(n.white(`
785
785
  \u{1F4A1} To proceed with actual creation, run without --dry-run flag
786
- `));}export{Bt as a,Jt as b,Qt as c,$ as d,gt as e,ve as f,xt as g,ke as h,Pe as i};
786
+ `));}export{Qt as a,Xt as b,Zt as c,C as d,ht as e,Pe as f,Rt as g,be as h,xe as i};
@@ -1,4 +1,4 @@
1
- import {a,d as d$1,e,f,c,g}from'./chunk-FXRDNZGB.js';import it from'crypto';import U from'os';import u from'path';import*as d from'fs-extra';import {execa}from'execa';var rt=["version","project","create","add","list","info","upgrade","diff","doctor","license","commands","reconcile","rollback","uninstall","checkpoint","optimize","snapshot","frameworks","modules","merge"],j=new Set(rt);function Y(){return d$1()}function w(t,e){return t==="py"?["-3",...e]:e}function V(t){if(!t)return t;let e=["Installed Poetry version does not support '--no-update'. Falling back to 'poetry lock'."];return t.split(/\r?\n/).filter(o=>!e.some(i=>o.includes(i))).join(`
1
+ import {a,d as d$1,e,f,c,g}from'./chunk-Z5LKRG57.js';import it from'crypto';import U from'os';import u from'path';import*as d from'fs-extra';import {execa}from'execa';var rt=["version","project","create","add","list","info","upgrade","diff","doctor","license","commands","reconcile","rollback","uninstall","checkpoint","optimize","snapshot","frameworks","modules","merge"],j=new Set(rt);function Y(){return d$1()}function w(t,e){return t==="py"?["-3",...e]:e}function V(t){if(!t)return t;let e=["Installed Poetry version does not support '--no-update'. Falling back to 'poetry lock'."];return t.split(/\r?\n/).filter(o=>!e.some(i=>o.includes(i))).join(`
2
2
  `)}var y=class extends Error{code;constructor(e,r){super(r),this.code=e;}};function k(t){if(t instanceof y)switch(t.code){case "PYTHON_NOT_FOUND":return `RapidKit (npm) could not find Python (python3/python/py) on your PATH.
3
3
  Install Python 3.10+ and ensure \`${c()}\` is available, then retry.
4
4
  Tip: if you are inside a RapidKit project, use the local ./rapidkit launcher.`;case "BRIDGE_VENV_CREATE_FAILED":return `RapidKit (npm) failed to create its bridge virtual environment.
@@ -0,0 +1 @@
1
+ import p from'os';import r from'path';function a(o=process.platform){return o==="win32"?"windows":o==="linux"?"linux":o==="darwin"?"macos":"other"}function n(o=process.platform){return a(o)==="windows"}function l(o=process.platform){return n(o)}function u(o=process.platform){return n(o)?"python":"python3"}function P(o=process.platform){return n(o)?["python","py","python3"]:["python3","python"]}function g(o=14,t=10,i=process.platform){let e=[];if(n(i)){for(let s=o;s>=t;s-=1)e.push({command:"py",args:[`-3.${s}`,"--version"]});return e.push({command:"py",args:["-3","--version"]}),e.push({command:"python",args:["--version"]}),e}for(let s=o;s>=t;s-=1)e.push({command:`python3.${s}`,args:["--version"]});return e.push({command:"python3",args:["--version"]}),e.push({command:"python",args:["--version"]}),e}function h(o,t=process.platform){return n(t)?r.join(o,"Scripts","python.exe"):r.join(o,"bin","python")}function y(o,t=process.platform){return n(t)?r.join(o,"Scripts","rapidkit.exe"):r.join(o,"bin","rapidkit")}function S(o,t=process.platform){return n(t)?r.join(o,"Scripts","activate"):r.join(o,"bin","activate")}function x(o,t=process.platform){return n(t)?[r.join(o,"rapidkit.cmd"),r.join(o,".rapidkit","rapidkit.cmd")]:[r.join(o,"rapidkit"),r.join(o,".rapidkit","rapidkit")]}function j(o=process.env,t=process.platform){let i=o.XDG_CONFIG_HOME||o.APPDATA||r.join(p.homedir(),".config");return n(t)?r.join(i,"rapidkit"):r.join(p.homedir(),".rapidkit")}function A(o=process.env,t=process.platform){let i=[];return n(t)?(o.USERPROFILE&&i.push(r.join(o.USERPROFILE,".local","bin")),o.APPDATA&&i.push(r.join(o.APPDATA,"Python","Scripts")),o.LOCALAPPDATA&&i.push(r.join(o.LOCALAPPDATA,"Programs","Python","Scripts"))):i.push(r.join(p.homedir(),".local","bin")),[...new Set(i.filter(Boolean))]}export{n as a,l as b,u as c,P as d,g as e,h as f,y as g,S as h,x as i,j,A as k};
@@ -1 +1 @@
1
- export{h as createProject,i as registerWorkspaceAtPath,f as syncWorkspaceFoundationFiles,g as writeWorkspaceLauncher}from'./chunk-T62GANVU.js';
1
+ export{h as createProject,i as registerWorkspaceAtPath,f as syncWorkspaceFoundationFiles,g as writeWorkspaceLauncher}from'./chunk-CD534JH4.js';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  declare function handleCreateOrFallback(args: string[]): Promise<number>;
3
3
  declare const NPM_ONLY_TOP_LEVEL_COMMANDS: readonly ["doctor", "workspace", "bootstrap", "setup", "cache", "mirror", "ai", "config", "shell"];
4
+ declare const WRAPPER_ORCHESTRATED_PROJECT_COMMANDS: readonly ["init"];
4
5
  declare function handleBootstrapCommand(args: string[], initRunner?: (nextArgs: string[]) => Promise<number>): Promise<number>;
5
6
  declare function handleSetupCommand(args: string[]): Promise<number>;
6
7
  declare function handleCacheCommand(args: string[]): Promise<number>;
@@ -8,4 +9,4 @@ declare function handleMirrorCommand(args: string[]): Promise<number>;
8
9
  declare function handleInitCommand(args: string[]): Promise<number>;
9
10
  declare function shouldForwardToCore(args: string[]): Promise<boolean>;
10
11
 
11
- export { NPM_ONLY_TOP_LEVEL_COMMANDS, handleBootstrapCommand, handleCacheCommand, handleCreateOrFallback, handleInitCommand, handleMirrorCommand, handleSetupCommand, shouldForwardToCore };
12
+ export { NPM_ONLY_TOP_LEVEL_COMMANDS, WRAPPER_ORCHESTRATED_PROJECT_COMMANDS, handleBootstrapCommand, handleCacheCommand, handleCreateOrFallback, handleInitCommand, handleMirrorCommand, handleSetupCommand, shouldForwardToCore };