rapidkit 0.33.1 → 0.34.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.
package/README.md CHANGED
@@ -30,9 +30,48 @@ RapidKit is designed around the workspace as the operational boundary.
30
30
  - Projects are discovered and managed inside that workspace boundary.
31
31
  - Wrapper-owned commands stay in the npm CLI; runtime-specific execution is delegated only when appropriate.
32
32
  - Release evidence is written into `.rapidkit/reports/` so CI, docs, and local workflows use the same contract surface.
33
+ - A single governance loop connects bootstrap, sync, doctor, analyze, readiness, and autopilot without requiring the VS Code extension.
33
34
 
34
35
  This layout keeps workspace setup deterministic, makes cross-project orchestration explicit, and avoids drifting behavior between the CLI and the core runtime.
35
36
 
37
+ ## Governance Pipeline (CLI-native)
38
+
39
+ RapidKit ships a wrapper-owned release loop for CI and local pre-merge checks:
40
+
41
+ ```text
42
+ bootstrap → workspace sync → doctor → analyze → readiness → autopilot
43
+ ```
44
+
45
+ Run the full loop in one command:
46
+
47
+ ```bash
48
+ npx rapidkit pipeline --json --strict
49
+ ```
50
+
51
+ Or run stages individually:
52
+
53
+ ```bash
54
+ npx rapidkit bootstrap --profile polyglot
55
+ npx rapidkit workspace sync --json
56
+ npx rapidkit doctor workspace --json --ci
57
+ npx rapidkit analyze --json --strict
58
+ npx rapidkit readiness --json --strict
59
+ npx rapidkit autopilot release --mode audit --json
60
+ ```
61
+
62
+ Evidence artifacts:
63
+
64
+ | Stage | Report path |
65
+ | ---------- | ----------- |
66
+ | Pipeline | `.rapidkit/reports/pipeline-last-run.json` |
67
+ | Doctor | `.rapidkit/reports/doctor-last-run.json` |
68
+ | Analyze | `.rapidkit/reports/analyze-last-run.json` |
69
+ | Readiness | `.rapidkit/reports/release-readiness-last-run.json` |
70
+ | Autopilot | `.rapidkit/reports/autopilot-release-last-run.json` |
71
+ | Contract verify (CLI fallback) | `.rapidkit/reports/workspace-contract-verify-last-run.json` |
72
+
73
+ The verify gate accepts extension `verify-pack-contract` artifacts **or** runs `workspace contract verify` inline when no extension artifact is present. Use `--skip-verify` on `readiness` / `pipeline` when verify is handled elsewhere.
74
+
36
75
  ## RapidKit CLI in the Workspai Ecosystem
37
76
 
38
77
  The `rapidkit` npm package remains the official RapidKit CLI.
@@ -134,21 +173,31 @@ npx rapidkit create project dotnet.webapi.clean my-dotnet --yes --skip-install
134
173
  ```bash
135
174
  npx rapidkit create # Prompts: workspace | project
136
175
  npx rapidkit create workspace <name> [--profile <profile>] [--author <name>] [--yes]
137
- npx rapidkit bootstrap [--profile <profile>] [--json]
176
+ npx rapidkit bootstrap [--profile <profile>] [--json] [--compliance-only]
138
177
  npx rapidkit setup <python|node|go|java|dotnet> [--warm-deps]
178
+ npx rapidkit pipeline [--json] [--strict] [--skip-verify] [--skip-analyze] [--skip-autopilot] [--autopilot-mode <audit|safe-fix|enforce>]
139
179
  npx rapidkit analyze [--workspace <path>] [--json] [--strict] [--output <file>]
140
- npx rapidkit readiness [--json] [--strict]
180
+ npx rapidkit readiness [--json] [--strict] [--skip-verify]
141
181
  npx rapidkit autopilot release [--mode <audit|safe-fix|enforce>] [--json] [--output <file>] [--since <ref>] [--parallel] [--max-workers <n>]
142
182
  ```
143
183
 
144
- Recommended for CI: `npx rapidkit autopilot release --mode enforce --json --output .rapidkit/reports/autopilot-release.json`
184
+ Recommended for CI:
145
185
 
146
186
  ```bash
187
+ npx rapidkit pipeline --json --strict
188
+ # or the release gate alone:
189
+ npx rapidkit autopilot release --mode enforce --json --output .rapidkit/reports/autopilot-release.json
190
+ ```
191
+
192
+ `bootstrap --json --compliance-only` runs compliance checks only (skips init) for machine-readable CI gates. Default `bootstrap --json` still runs init after compliance checks.
193
+
194
+ ```bash
195
+ npx rapidkit workspace sync [--json]
147
196
  npx rapidkit workspace policy show
148
197
  npx rapidkit workspace policy set <key> <value>
149
198
  npx rapidkit doctor
150
- npx rapidkit doctor workspace [--fix] [--plan] [--apply]
151
- npx rapidkit doctor project [--fix] [--plan] [--apply]
199
+ npx rapidkit doctor workspace [--json] [--strict] [--ci] [--fix] [--plan] [--apply]
200
+ npx rapidkit doctor project [--json] [--strict] [--ci] [--fix] [--plan] [--apply]
152
201
  npx rapidkit workspace list # Display all workspaces created on this system
153
202
  npx rapidkit workspace foundation ensure [--force] [--json]
154
203
  npx rapidkit workspace share [--output <file>] [--include-paths] [--no-doctor]
@@ -361,24 +410,34 @@ RapidKit keeps the wrapper boundary explicit so users know which layer owns each
361
410
  | `create workspace`, `workspace`, `cache`, `mirror`, `infra` | RapidKit wrapper | Platform-level orchestration |
362
411
  | `init` | Wrapper orchestrated | Project init in project dirs; full-init alias at workspace root |
363
412
  | `dev`, `test`, `build`, `start` | Runtime aware | Delegates to the active project/runtime when available |
364
- | `readiness` | Wrapper release gate | Generates release-readiness evidence (`--json` for CI, `--strict` for fail-fast) |
365
- | `autopilot release` | Wrapper orchestrator | Runs doctor/readiness/remediation/workspace-run gates and emits release verdict evidence |
413
+ | `readiness` | Wrapper release gate | Env + doctor + analyze + verify + dependency gates (`--json`, `--strict`, `--skip-verify`) |
414
+ | `pipeline` | Wrapper orchestrator | End-to-end governance loop: sync → doctor analyze readiness autopilot; writes `pipeline-last-run.json` |
415
+ | `autopilot release` | Wrapper orchestrator | Runs doctor/analyze/readiness/remediation/workspace-run gates and emits release verdict evidence |
366
416
  | `import` | Workspace ingestion | Imports local folders or git backends with rollback-safe sync behavior |
367
417
  | `snapshot` | Workspace recovery | Creates/list/restores metadata or full workspace snapshots with destructive-operation guards |
368
418
  | `project archive/restore/delete` | Project lifecycle | Archives by default, restores archived projects, requires exact confirmation for permanent delete, and creates safety snapshots |
369
419
  | `doctor` | Wrapper system check | Checks host prerequisites by default |
370
- | `doctor workspace` | Workspace health | Full workspace scan with project-level details and fixes |
420
+ | `doctor workspace` | Workspace health | Full workspace scan with project-level details, CI exit codes (`--strict`, `--ci`), and fixes |
371
421
  | `doctor project` | Project health | Current project (or nearest parent) diagnostics with project evidence and scoped fixes |
372
422
  | `workspace run` | Workspace orchestrator | Stage execution across discovered projects with optional affected-only, blast-radius expansion, and policy-gated pre-checks |
373
423
  | `infra` | Workspace sidecar | Contract-driven local infra discovery, compose generation, and Docker lifecycle (`plan`, `up`, `down`, `status`) |
374
424
 
375
425
  Use `npx rapidkit doctor` for a quick host pre-flight, `npx rapidkit doctor project` for a service-level check, and `npx rapidkit doctor workspace` for the full workspace picture.
426
+ Use `npx rapidkit pipeline --json --strict` to run the full governance loop and gate CI on a single exit code.
376
427
  Use `npx rapidkit analyze --json` to generate CI-friendly workspace health evidence and save it under `.rapidkit/reports/`.
428
+ Use `npx rapidkit doctor workspace --ci` for CI-friendly exit codes (1 = errors, 2 = warnings).
377
429
  Use `npx rapidkit doctor workspace --plan` or `npx rapidkit doctor project --plan` to preview remediation safely.
378
430
  Use `npx rapidkit doctor workspace --apply` or `npx rapidkit doctor project --apply` for non-interactive remediation runs.
379
431
  Use `npx rapidkit readiness` when you need machine-readable release evidence or strict CI gating.
432
+ Use `npx rapidkit readiness --skip-verify` when verify is handled by extension/CI separately.
380
433
  Use `npx rapidkit autopilot release` to run an end-to-end pre-merge release gate in one command.
381
434
 
435
+ ### Doctor workspace CI exit codes
436
+
437
+ - `npx rapidkit doctor workspace --strict` exits `1` when health score reports errors **or** warnings.
438
+ - `npx rapidkit doctor workspace --ci` exits `1` on errors and `2` on warnings only (errors take precedence).
439
+ - Without `--strict` or `--ci`, doctor reports findings but exits `0` (backward compatible).
440
+
382
441
  ### Doctor workspace fix behavior
383
442
 
384
443
  - `npx rapidkit doctor workspace` reuses cached project scans when valid and refreshes evidence under `.rapidkit/reports/doctor-last-run.json`.
@@ -725,6 +784,8 @@ npx rapidkit --version
725
784
  | `python3` not found | `python3 --version` | Install Python 3.10+ and re-run `npx rapidkit create workspace ...` |
726
785
  | `setup --warm-deps` skipped | Check for `package.json` / `go.mod` in current dir | Run from the target project directory |
727
786
  | strict policy blocks command | Review `.rapidkit/policies.yml` | Set policy intentionally via `npx rapidkit workspace policy set ...` |
787
+ | `npm audit fix --force` downgrades tsup | Check `package.json` — tsup should stay `^8.5.1` | **Do not use `--force`**. Run `npm install` after restoring tsup; use `esbuild` override if audit still flags dev deps |
788
+ | Security Audit CI fails on esbuild | Run `npm audit --audit-level=moderate` locally | Keep `tsup@^8.5.1` and `"overrides": { "esbuild": "^0.28.1" }` in `package.json` |
728
789
  | doctor output seems stale | Check report timestamp in `.rapidkit/reports/` | Re-run `npx rapidkit doctor workspace` or `npx rapidkit doctor project` |
729
790
  | affected run scope seems wrong | Verify git ref | Use `--since <ref>` explicitly |
730
791
 
@@ -0,0 +1,80 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://getrapidkit.com/schemas/pipeline-last-run.v1.json",
4
+ "title": "RapidKit Governance Pipeline Last Run",
5
+ "type": "object",
6
+ "required": [
7
+ "schemaVersion",
8
+ "generatedAt",
9
+ "workspacePath",
10
+ "summary",
11
+ "stages",
12
+ "blockingReasons",
13
+ "artifacts"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": {
17
+ "const": "rapidkit-pipeline-v1"
18
+ },
19
+ "generatedAt": {
20
+ "type": "string",
21
+ "format": "date-time"
22
+ },
23
+ "workspacePath": {
24
+ "type": "string",
25
+ "minLength": 1
26
+ },
27
+ "summary": {
28
+ "type": "object",
29
+ "required": ["verdict", "exitCode", "stagesPassed", "stagesWarn", "stagesFailed"],
30
+ "properties": {
31
+ "verdict": {
32
+ "enum": ["ready", "needs-attention", "blocked"]
33
+ },
34
+ "exitCode": {
35
+ "enum": [0, 1, 2, 3]
36
+ },
37
+ "stagesPassed": { "type": "integer", "minimum": 0 },
38
+ "stagesWarn": { "type": "integer", "minimum": 0 },
39
+ "stagesFailed": { "type": "integer", "minimum": 0 }
40
+ },
41
+ "additionalProperties": false
42
+ },
43
+ "stages": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "object",
47
+ "required": ["name", "status", "durationMs", "summary"],
48
+ "properties": {
49
+ "name": {
50
+ "enum": ["sync", "doctor", "analyze", "readiness", "autopilot"]
51
+ },
52
+ "status": {
53
+ "enum": ["pass", "warn", "fail", "skipped"]
54
+ },
55
+ "durationMs": { "type": "integer", "minimum": 0 },
56
+ "summary": { "type": "string" },
57
+ "exitCode": { "type": "integer" },
58
+ "evidencePath": { "type": "string" }
59
+ },
60
+ "additionalProperties": true
61
+ }
62
+ },
63
+ "blockingReasons": {
64
+ "type": "array",
65
+ "items": { "type": "string" }
66
+ },
67
+ "artifacts": {
68
+ "type": "object",
69
+ "required": ["reportPath"],
70
+ "properties": {
71
+ "reportPath": { "type": "string" },
72
+ "analyzeEvidencePath": { "type": "string" },
73
+ "readinessEvidencePath": { "type": "string" },
74
+ "autopilotEvidencePath": { "type": "string" }
75
+ },
76
+ "additionalProperties": true
77
+ }
78
+ },
79
+ "additionalProperties": true
80
+ }
@@ -0,0 +1 @@
1
+ export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-ILY6QARY.js';
@@ -0,0 +1 @@
1
+ export{a as runAutopilotRelease}from'./chunk-RGXFDBYB.js';
@@ -1,10 +1,10 @@
1
- import {i,d as d$2,l,k as k$1,f as f$1,g,h}from'./chunk-7OGOVP5U.js';import {a,d,b as b$1}from'./chunk-RV6HBTFC.js';import {a as a$2,e,d as d$1,f,c,k as k$2}from'./chunk-Z5LKRG57.js';import {b}from'./chunk-AC6KIKII.js';import {a as a$1}from'./chunk-VM2TOHNX.js';import {promises}from'fs';import*as k from'fs-extra';import m from'path';import q from'inquirer';import t from'chalk';import O from'ora';import {execa}from'execa';function S(){return c()}async function z(e,o,n,r){let l=d(o,b(),n);r&&(l.metadata||(l.metadata={}),l.metadata.python={version:r}),await b$1(e,l);}async function V(e){await k.outputFile(m.join(e,".gitignore"),`.venv/
1
+ import {i,d as d$2,l,k as k$1,f as f$1,g,h}from'./chunk-IATULVMR.js';import {a,d,b as b$1}from'./chunk-RV6HBTFC.js';import {a as a$2,e,d as d$1,f,c,k as k$2}from'./chunk-Z5LKRG57.js';import {b}from'./chunk-AC6KIKII.js';import {a as a$1}from'./chunk-VM2TOHNX.js';import {promises}from'fs';import*as k from'fs-extra';import m from'path';import q from'inquirer';import t from'chalk';import F from'ora';import {execa}from'execa';function A(){return c()}async function U(e,o,n,r){let l=d(o,b(),n);r&&(l.metadata||(l.metadata={}),l.metadata.python={version:r}),await b$1(e,l);}async function L(e){await k.outputFile(m.join(e,".gitignore"),`.venv/
2
2
  __pycache__/
3
3
  *.pyc
4
4
  .env
5
5
  .rapidkit-workspace/
6
6
 
7
- `,"utf-8");}async function U(e,o){let n=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await k.outputFile(m.join(e,"poetry.toml"),`[virtualenvs]
7
+ `,"utf-8");}async function z(e,o){let n=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await k.outputFile(m.join(e,"poetry.toml"),`[virtualenvs]
8
8
  in-project = true
9
9
  `,"utf-8"),await k.outputFile(m.join(e,"pyproject.toml"),`[tool.poetry]
10
10
  name = "${n}"
@@ -35,14 +35,14 @@ cache:
35
35
  prune_on_bootstrap: false
36
36
  self_heal: true
37
37
  verify_integrity: false
38
- `}async function kt(){try{let{stdout:e}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),o=e.match(/go(\d+\.\d+(?:\.\d+)?)/i);return o?o[1]:void 0}catch{return}}async function Pt(){try{let{stdout:e}=await execa("dotnet",["--version"],{timeout:3e3,stdio:"pipe"}),o=e.trim();return o.length>0?o:void 0}catch{return}}async function Y(e,o,n,r,l){let[p,c]=await Promise.all([kt(),Pt()]);await k.outputFile(m.join(e,".rapidkit","workspace.json"),ht(o,n,r,l),"utf-8"),await k.outputFile(m.join(e,".rapidkit","toolchain.lock"),ft(n,r,process.version,p,c),"utf-8"),await k.outputFile(m.join(e,".rapidkit","policies.yml"),wt(),"utf-8"),await k.outputFile(m.join(e,".rapidkit","cache-config.yml"),vt(),"utf-8");}async function se(e,o){let{workspaceName:n=m.basename(e),installMethod:r="venv",pythonVersion:l,profile:p,writeMarker:c=true,writeGitignore:u=true,onlyIfMissing:g=true}=o||{},h=[],[a$1,i]=await Promise.all([kt(),Pt()]),y=[{relPath:m.join(".rapidkit","workspace.json"),content:ht(n,r,l,p)},{relPath:m.join(".rapidkit","toolchain.lock"),content:ft(r,l,process.version,a$1,i)},{relPath:m.join(".rapidkit","policies.yml"),content:wt()},{relPath:m.join(".rapidkit","cache-config.yml"),content:vt()}];for(let d of y){let P=m.join(e,d.relPath);g&&await k.pathExists(P)||(await k.outputFile(P,d.content,"utf-8"),h.push(d.relPath));}if(c&&(!!!await a(e)||!g)){let P=d(n,b(),r);l&&(P.metadata||(P.metadata={}),P.metadata.python={version:l}),await b$1(e,P),h.push(".rapidkit-workspace");}if(u){let d=m.join(e,".gitignore");(!g||!await k.pathExists(d))&&(await V(e),h.push(".gitignore"));}return h}var K="3.10",bt=["3.10","3.11","3.12"];async function gt(e){try{let{stdout:o}=await execa(e,["--version"],{timeout:3e3}),n=o.match(/Python (\d+\.\d+\.\d+)/);if(n)return n[1]}catch{}return null}async function Mt(e,o){try{await promises.writeFile(m.join(e,".python-version"),`${o}
39
- `,"utf-8"),a$1.debug(`Created .python-version with ${o}`);}catch(n){a$1.warn(`Failed to create .python-version: ${n}`);}}function F(){let n=[...(process.env.PATH||"").split(m.delimiter).filter(Boolean)];for(let r of k$2())n.includes(r)||n.unshift(r);process.env.PATH=n.join(m.delimiter);}async function tt(e,o){F(),e.start("Checking pipx installation");try{return await execa("pipx",["--version"]),e.succeed("pipx found"),{kind:"binary"}}catch{}let n=S();try{return await execa(n,["-m","pipx","--version"]),e.succeed("pipx found"),{kind:"python-module",pythonCmd:n}}catch{}if(o)throw new h;e.stop?.();let{installPipx:r}=await q.prompt([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!r)throw new h;e.start("Installing pipx (user install)");try{try{await execa(n,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(n,["-m","pip","install","--user","--upgrade","pipx"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"");throw new k$1("Install pipx with python -m pip",l instanceof Error?l:new Error(c))}e.succeed("pipx installed"),F();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"pipx not runnable after install");throw new k$1("Verify pipx after install",new Error(`${c}
38
+ `}async function kt(){try{let{stdout:e}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),o=e.match(/go(\d+\.\d+(?:\.\d+)?)/i);return o?o[1]:void 0}catch{return}}async function Pt(){try{let{stdout:e}=await execa("dotnet",["--version"],{timeout:3e3,stdio:"pipe"}),o=e.trim();return o.length>0?o:void 0}catch{return}}async function Y(e,o,n,r,l){let[p,c]=await Promise.all([kt(),Pt()]);await k.outputFile(m.join(e,".rapidkit","workspace.json"),ht(o,n,r,l),"utf-8"),await k.outputFile(m.join(e,".rapidkit","toolchain.lock"),ft(n,r,process.version,p,c),"utf-8"),await k.outputFile(m.join(e,".rapidkit","policies.yml"),wt(),"utf-8"),await k.outputFile(m.join(e,".rapidkit","cache-config.yml"),vt(),"utf-8");}async function se(e,o){let{workspaceName:n=m.basename(e),installMethod:r="venv",pythonVersion:l,profile:p,writeMarker:c=true,writeGitignore:u=true,onlyIfMissing:g=true}=o||{},h=[],[a$1,i]=await Promise.all([kt(),Pt()]),y=[{relPath:m.join(".rapidkit","workspace.json"),content:ht(n,r,l,p)},{relPath:m.join(".rapidkit","toolchain.lock"),content:ft(r,l,process.version,a$1,i)},{relPath:m.join(".rapidkit","policies.yml"),content:wt()},{relPath:m.join(".rapidkit","cache-config.yml"),content:vt()}];for(let d of y){let P=m.join(e,d.relPath);g&&await k.pathExists(P)||(await k.outputFile(P,d.content,"utf-8"),h.push(d.relPath));}if(c&&(!!!await a(e)||!g)){let P=d(n,b(),r);l&&(P.metadata||(P.metadata={}),P.metadata.python={version:l}),await b$1(e,P),h.push(".rapidkit-workspace");}if(u){let d=m.join(e,".gitignore");(!g||!await k.pathExists(d))&&(await L(e),h.push(".gitignore"));}return h}var K="3.10",bt=["3.10","3.11","3.12"];async function gt(e){try{let{stdout:o}=await execa(e,["--version"],{timeout:3e3}),n=o.match(/Python (\d+\.\d+\.\d+)/);if(n)return n[1]}catch{}return null}async function Mt(e,o){try{await promises.writeFile(m.join(e,".python-version"),`${o}
39
+ `,"utf-8"),a$1.debug(`Created .python-version with ${o}`);}catch(n){a$1.warn(`Failed to create .python-version: ${n}`);}}function O(){let n=[...(process.env.PATH||"").split(m.delimiter).filter(Boolean)];for(let r of k$2())n.includes(r)||n.unshift(r);process.env.PATH=n.join(m.delimiter);}async function tt(e,o){O(),e.start("Checking pipx installation");try{return await execa("pipx",["--version"]),e.succeed("pipx found"),{kind:"binary"}}catch{}let n=A();try{return await execa(n,["-m","pipx","--version"]),e.succeed("pipx found"),{kind:"python-module",pythonCmd:n}}catch{}if(o)throw new h;e.stop?.();let{installPipx:r}=await q.prompt([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!r)throw new h;e.start("Installing pipx (user install)");try{try{await execa(n,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(n,["-m","pip","install","--user","--upgrade","pipx"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"");throw new k$1("Install pipx with python -m pip",l instanceof Error?l:new Error(c))}e.succeed("pipx installed"),O();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"pipx not runnable after install");throw new k$1("Verify pipx after install",new Error(`${c}
40
40
 
41
- Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function N(e,o){return e.kind==="binary"?execa("pipx",o):execa(e.pythonCmd,["-m","pipx",...o])}function Tt(e){let o=e.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function mt(e){if(!e)return null;let o=e.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function lt(e,o){let[n,r]=e.split(".").map(c=>Number(c)),[l,p]=o.split(".").map(c=>Number(c));return n!==l?n-l:r-p}function G(e,o){return lt(e,o)>=0}async function Dt(e$1){let o=new Set,n=e(14,10);for(let i of n)try{let y=await execa(i.command,i.args,{timeout:2500}),d=mt(`${y.stdout||""}
42
- ${y.stderr||""}`);d&&G(d,K)&&o.add(d);}catch{}let r=null;try{let i=await execa(S(),["--version"],{timeout:2500}),y=mt(`${i.stdout||""}
43
- ${i.stderr||""}`);y&&G(y,K)&&(r=y,o.add(y));}catch{}let l=bt.filter(i=>G(i,K)),p=new Set([...l,...o]),c=Array.from(p).sort((i,y)=>lt(y,i)),u=e$1?Tt(e$1):null,g=u&&G(u,K)?u:r||c[0]||K;return p.has(g)||p.add(g),{choices:Array.from(p).sort((i,y)=>lt(y,i)).map(i=>{let y=[];return i===r&&y.push("current system"),i===K&&y.push("minimum supported"),o.has(i)&&i!==r&&y.push("detected"),{name:y.length>0?`${i} (${y.join(", ")})`:i,value:i}}),defaultValue:g}}async function Kt(){F();let e=false,o=false;try{await execa("poetry",["--version"],{timeout:2500}),e=true;}catch{e=false;}try{await execa("pipx",["--version"],{timeout:2500}),o=true;}catch{let n=c();try{await execa(n,["-m","pipx","--version"],{timeout:2500}),o=true;}catch{o=false;}}return {poetry:e,pipx:o}}async function xt(){F();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function Nt(e,o){return e==="poetry"&&o.poetry?"poetry":e==="pipx"&&o.pipx?"pipx":e==="venv"?"venv":o.poetry?"poetry":"venv"}async function Ft(e,o){F(),e.start("Checking Poetry installation");try{await execa("poetry",["--version"]),e.succeed("Poetry found");return}catch{}if(o)throw new g;let{installPoetry:n}=await q.prompt([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!n)throw new g;let r=await tt(e,o);e.start("Installing Poetry with pipx");try{await N(r,["install","poetry"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(c))try{await N(r,["upgrade","poetry"]);}catch{}else throw new k$1("Install Poetry with pipx",l instanceof Error?l:new Error(c))}e.succeed("Poetry installed"),F();try{await execa("poetry",["--version"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"Poetry not found on PATH");throw new k$1("Verify Poetry after pipx install",new Error(`${c}
41
+ Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function N(e,o){return e.kind==="binary"?execa("pipx",o):execa(e.pythonCmd,["-m","pipx",...o])}function Dt(e){let o=e.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function mt(e){if(!e)return null;let o=e.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function lt(e,o){let[n,r]=e.split(".").map(c=>Number(c)),[l,p]=o.split(".").map(c=>Number(c));return n!==l?n-l:r-p}function V(e,o){return lt(e,o)>=0}async function Tt(e$1){let o=new Set,n=e(14,10);for(let i of n)try{let y=await execa(i.command,i.args,{timeout:2500}),d=mt(`${y.stdout||""}
42
+ ${y.stderr||""}`);d&&V(d,K)&&o.add(d);}catch{}let r=null;try{let i=await execa(A(),["--version"],{timeout:2500}),y=mt(`${i.stdout||""}
43
+ ${i.stderr||""}`);y&&V(y,K)&&(r=y,o.add(y));}catch{}let l=bt.filter(i=>V(i,K)),p=new Set([...l,...o]),c=Array.from(p).sort((i,y)=>lt(y,i)),u=e$1?Dt(e$1):null,g=u&&V(u,K)?u:r||c[0]||K;return p.has(g)||p.add(g),{choices:Array.from(p).sort((i,y)=>lt(y,i)).map(i=>{let y=[];return i===r&&y.push("current system"),i===K&&y.push("minimum supported"),o.has(i)&&i!==r&&y.push("detected"),{name:y.length>0?`${i} (${y.join(", ")})`:i,value:i}}),defaultValue:g}}async function Kt(){O();let e=false,o=false;try{await execa("poetry",["--version"],{timeout:2500}),e=true;}catch{e=false;}try{await execa("pipx",["--version"],{timeout:2500}),o=true;}catch{let n=c();try{await execa(n,["-m","pipx","--version"],{timeout:2500}),o=true;}catch{o=false;}}return {poetry:e,pipx:o}}async function xt(){O();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function Nt(e,o){return e==="poetry"&&o.poetry?"poetry":e==="pipx"&&o.pipx?"pipx":e==="venv"?"venv":o.poetry?"poetry":"venv"}async function Ot(e,o){O(),e.start("Checking Poetry installation");try{await execa("poetry",["--version"]),e.succeed("Poetry found");return}catch{}if(o)throw new g;let{installPoetry:n}=await q.prompt([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!n)throw new g;let r=await tt(e,o);e.start("Installing Poetry with pipx");try{await N(r,["install","poetry"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(c))try{await N(r,["upgrade","poetry"]);}catch{}else throw new k$1("Install Poetry with pipx",l instanceof Error?l:new Error(c))}e.succeed("Poetry installed"),O();try{await execa("poetry",["--version"]);}catch(l){let p=l,c=String(p?.stderr||p?.shortMessage||p?.message||"Poetry not found on PATH");throw new k$1("Verify Poetry after pipx install",new Error(`${c}
44
44
 
45
- Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function Ot(e){let o=e==="poetry";return `#!/usr/bin/env sh
45
+ Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function Ft(e){let o=e==="poetry";return `#!/usr/bin/env sh
46
46
  set -eu
47
47
 
48
48
  SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
@@ -56,12 +56,25 @@ ${o?`if command -v poetry >/dev/null 2>&1 && [ -f "$SCRIPT_DIR/pyproject.toml" ]
56
56
  exec poetry run rapidkit "$@"
57
57
  fi
58
58
 
59
- `:""}echo "RapidKit launcher could not find a local Python CLI." 1>&2
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
60
73
  echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
61
74
  ${o?`echo "- If you used Poetry: run 'poetry install' and retry, or activate the env." 1>&2
62
75
  `:""}echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
63
76
  exit 1
64
- `}function Vt(e){return `@echo off
77
+ `}function Lt(e){return `@echo off
65
78
  setlocal
66
79
 
67
80
  set "SCRIPT_DIR=%~dp0"
@@ -77,11 +90,29 @@ if %ERRORLEVEL%==0 if exist "%SCRIPT_DIR%\\pyproject.toml" (
77
90
  exit /b %ERRORLEVEL%
78
91
  )
79
92
 
80
- `:""}echo RapidKit launcher could not find a local Python CLI. 1>&2
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
81
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
82
113
  exit /b 1
83
- `}async function It(e,o){await k.outputFile(m.join(e,"rapidkit"),Ot(o),{encoding:"utf-8",mode:493}),await k.outputFile(m.join(e,"rapidkit.cmd"),Vt(o),"utf-8");}async function le(e,o){let{skipGit:n=false,testMode:r=false,demoMode:l=false,dryRun:p=false,yes:c=false,userConfig:u={},installMethod:g,profile:h}=o,a=e||"rapidkit",i$1=m.resolve(process.cwd(),a);if(await k.pathExists(i$1))throw new i(a);if(p){let f=h||(c?"minimal":void 0),R=g||u.defaultInstallMethod||"poetry",b=u.pythonVersion||"3.10";await Lt(i$1,a,l,u,f,R,b);return}if(l){await Gt(i$1,a,n);return}let y=new Set(["python-only","polyglot","enterprise"]),d=h||"";if(!c&&!h){let{selectedProfile:f}=await q.prompt([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"java-only \u2014 Java runtime (Spring Boot services)",value:"java-only"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"dotnet-only \u2014 .NET runtime (ASP.NET Core services)",value:"dotnet-only"},{name:"polyglot \u2014 Python + Node.js + Go + Java + .NET multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);d=f;}else d||(d="minimal");let P=!c&&y.has(d),$=typeof u.pythonVersion=="string"&&u.pythonVersion.trim().length>0?u.pythonVersion.trim():void 0,T=g||u.defaultInstallMethod||"poetry",_=P?await Kt():{poetry:true,pipx:true},L=P?await Dt($):{choices:bt.map(f=>({name:f,value:f})),defaultValue:K},et=Nt(T,_),Ct=[{name:_.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env + dependency mgmt)":"\u{1F3AF} Poetry (Recommended) \u2014 not detected (we can install it)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard, zero extra tools)",value:"venv"},{name:_.pipx?"\u{1F527} pipx (Global isolated - RapidKit CLI only, no local venv)":"\u{1F527} pipx (Global isolated) \u2014 not detected (we can install it)",value:"pipx"}],x=P?await q.prompt([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:L.choices,default:L.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:Ct,default:et}]):await(async()=>{let f=g||u.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:u.pythonVersion||"3.10",installMethod:f}})();if(P&&(console.log(t.gray(`
84
- \u{1F4CC} Configuration notes:`)),x.pythonVersion==="3.10"?console.log(t.gray(" \u2022 Python 3.10: Latest stable with widespread compatibility")):x.pythonVersion==="3.11"?console.log(t.gray(" \u2022 Python 3.11: Newer, faster (3.10-3.11: ~10% speed improvement)")):x.pythonVersion==="3.12"&&console.log(t.gray(" \u2022 Python 3.12: Cutting edge, excellent for performance")),x.installMethod==="poetry"?console.log(t.gray(" \u2022 Poetry: Dependency management + virtual env (recommended for teams)")):x.installMethod==="venv"?console.log(t.gray(" \u2022 venv: Standard library approach, lightweight, zero dependencies")):console.log(t.gray(" \u2022 pipx: Global isolated, RapidKit CLI only, no local venv")),console.log("")),new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(d)){let f=O("Creating workspace").start();try{await k.ensureDir(i$1),f.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,d),await V(i$1),await U(i$1,a);let R={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
114
+ `}async function It(e,o){await k.outputFile(m.join(e,"rapidkit"),Ft(o),{encoding:"utf-8",mode:493}),await k.outputFile(m.join(e,"rapidkit.cmd"),Lt(o),"utf-8");}async function le(e,o){let{skipGit:n=false,testMode:r=false,demoMode:l=false,dryRun:p=false,yes:c=false,userConfig:u={},installMethod:g,profile:h}=o,a=e||"rapidkit",i$1=m.resolve(process.cwd(),a);if(await k.pathExists(i$1))throw new i(a);if(p){let f=h||(c?"minimal":void 0),R=g||u.defaultInstallMethod||"poetry",b=u.pythonVersion||"3.10";await Gt(i$1,a,l,u,f,R,b);return}if(l){await Vt(i$1,a,n);return}let y=new Set(["python-only","polyglot","enterprise"]),d=h||"";if(!c&&!h){let{selectedProfile:f}=await q.prompt([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"java-only \u2014 Java runtime (Spring Boot services)",value:"java-only"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"dotnet-only \u2014 .NET runtime (ASP.NET Core services)",value:"dotnet-only"},{name:"polyglot \u2014 Python + Node.js + Go + Java + .NET multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);d=f;}else d||(d="minimal");let P=!c&&y.has(d),$=typeof u.pythonVersion=="string"&&u.pythonVersion.trim().length>0?u.pythonVersion.trim():void 0,D=g||u.defaultInstallMethod||"poetry",_=P?await Kt():{poetry:true,pipx:true},G=P?await Tt($):{choices:bt.map(f=>({name:f,value:f})),defaultValue:K},et=Nt(D,_),Ct=[{name:_.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env + dependency mgmt)":"\u{1F3AF} Poetry (Recommended) \u2014 not detected (we can install it)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard, zero extra tools)",value:"venv"},{name:_.pipx?"\u{1F527} pipx (Global isolated - RapidKit CLI only, no local venv)":"\u{1F527} pipx (Global isolated) \u2014 not detected (we can install it)",value:"pipx"}],x=P?await q.prompt([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:G.choices,default:G.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:Ct,default:et}]):await(async()=>{let f=g||u.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:u.pythonVersion||"3.10",installMethod:f}})();if(P&&(console.log(t.gray(`
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("")),new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(d)){let f=F("Creating workspace").start();try{await k.ensureDir(i$1),f.succeed("Directory created"),await U(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,d),await L(i$1),await z(i$1,a);let R={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
85
116
 
86
117
  RapidKit **${R[d]}** workspace.
87
118
 
@@ -108,12 +139,12 @@ npx rapidkit dev
108
139
  cd <project-name>
109
140
  npx rapidkit init
110
141
  npx rapidkit dev
111
- `)+"```\n","utf-8"),!n){f.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:i$1}),f.succeed("Git repository initialized");}catch{f.warn("Could not initialize git repository");}}try{let{registerWorkspace:b}=await import('./workspace-4VGM2NPS.js');await b(i$1,a);}catch{}if(console.log(t.green(`
142
+ `)+"```\n","utf-8"),!n){f.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:i$1}),f.succeed("Git repository initialized");}catch{f.warn("Could not initialize git repository");}}try{let{registerWorkspace:b}=await import('./workspace-AG2MQFTY.js');await b(i$1,a);}catch{}if(console.log(t.green(`
112
143
  \u2728 Workspace created!
113
144
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan(`
114
145
  \u{1F680} Get started:
115
146
  `)),console.log(t.white(` cd ${a}`)),d==="go-only"){console.log(t.white(" npx rapidkit create project gofiber.standard my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
116
- `)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:b}=await execa("go",["version"],{timeout:3e3}),w=b.match(/go version go(\d+\.\d+(?:\.\d+)?)/),A=w?w[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${A} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(t.yellow(`
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}),w=b.match(/go version go(\d+\.\d+(?:\.\d+)?)/),S=w?w[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${S} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(t.yellow(`
117
148
  \u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else if(d==="java-only")console.log(t.white(" npx rapidkit create project springboot.standard my-service")),console.log(t.white(" cd my-service")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
118
149
  `)),console.log(t.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."));else if(d==="dotnet-only"){console.log(t.white(" npx rapidkit create project dotnet.webapi.clean my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" npx rapidkit init")),console.log(t.white(` npx rapidkit dev
119
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(`
@@ -121,23 +152,23 @@ npx rapidkit dev
121
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
122
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(`
123
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 "+a+"/.rapidkit-workspace")),console.log(t.gray(" \u2022 Check health: rapidkit doctor")),console.log("");}catch(R){throw f.fail("Failed to create workspace"),console.error(t.red(`
124
- \u274C Error:`),R),R}return}{let f=S(),R=false;try{await execa(f,["--version"],{timeout:5e3}),R=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),R=true;}catch{R=false;}}if(!R){let w={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"}[d];if(P&&!c){console.log(t.yellow(`
155
+ \u274C Error:`),R),R}return}{let f=A(),R=false;try{await execa(f,["--version"],{timeout:5e3}),R=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),R=true;}catch{R=false;}}if(!R){let w={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"}[d];if(P&&!c){console.log(t.yellow(`
125
156
  \u26A0\uFE0F Python 3.10+ is not detected on this system.
126
157
  `)),console.log(t.cyan(`You have 3 options:
127
- `));let{pythonAction:D}=await q.prompt([{type:"rawlist",name:"pythonAction",message:"What would you like to do?",choices:[{name:"\u{1F4E5} Install Python now (I'll show you the command for your OS)",value:"install"},{name:`\u{1F504} Switch to "${w}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if(D==="cancel"&&(console.log(t.cyan(`
158
+ `));let{pythonAction:T}=await q.prompt([{type:"rawlist",name:"pythonAction",message:"What would you like to do?",choices:[{name:"\u{1F4E5} Install Python now (I'll show you the command for your OS)",value:"install"},{name:`\u{1F504} Switch to "${w}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if(T==="cancel"&&(console.log(t.cyan(`
128
159
  \u{1F4A1} How to install Python:
129
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
130
161
  `)),console.log(t.gray(` After installing Python, run: npx rapidkit ${a}
131
- `)),process.exit(1)),D==="install"){console.log(t.cyan(`
162
+ `)),process.exit(1)),T==="install"){console.log(t.cyan(`
132
163
  \u{1F4A1} Install Python on your system:
133
164
  `));let j=process.platform;j==="linux"?console.log(t.white(` sudo apt update && sudo apt install python3.10 python3.10-venv
134
165
  `)):j==="darwin"?console.log(t.white(` brew install python@3.10
135
166
  `)):j==="win32"&&(console.log(t.white(` Download: https://python.org/downloads
136
167
  `)),console.log(t.white(` Run the installer and check "Add Python to PATH"
137
168
  `))),console.log(t.gray(` After installing, run: npx rapidkit ${a}
138
- `)),process.exit(0);}if(D==="fallback"&&(console.log(t.green(`
169
+ `)),process.exit(0);}if(T==="fallback"&&(console.log(t.green(`
139
170
  \u2705 Switching to "${w}" profile (no Python required).
140
- `)),d=w,new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(w))){let C=O("Creating workspace").start();try{await k.ensureDir(i$1),C.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await V(i$1),await U(i$1,a);let B={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
171
+ `)),d=w,new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(w))){let C=F("Creating workspace").start();try{await k.ensureDir(i$1),C.succeed("Directory created"),await U(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await L(i$1),await z(i$1,a);let B={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await k.outputFile(m.join(i$1,"README.md"),`# ${a}
141
172
 
142
173
  RapidKit **${B[w]}** workspace (switched from ${d} due to missing Python).
143
174
 
@@ -164,7 +195,7 @@ npx rapidkit dev
164
195
  cd <project-name>
165
196
  npx rapidkit init
166
197
  npx rapidkit dev
167
- `)+"```\n","utf-8"),!n){C.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m",`Initial commit: RapidKit workspace (${w} profile)`],{cwd:i$1}),C.succeed("Git repository initialized");}catch{C.warn("Could not initialize git repository");}}try{let{registerWorkspace:$t}=await import('./workspace-4VGM2NPS.js');await $t(i$1,a);}catch{}console.log(t.green(`
198
+ `)+"```\n","utf-8"),!n){C.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m",`Initial commit: RapidKit workspace (${w} profile)`],{cwd:i$1}),C.succeed("Git repository initialized");}catch{C.warn("Could not initialize git repository");}}try{let{registerWorkspace:$t}=await import('./workspace-AG2MQFTY.js');await $t(i$1,a);}catch{}console.log(t.green(`
168
199
  \u2728 Workspace created with fallback profile!
169
200
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan(`
170
201
  \u{1F680} Get started:
@@ -174,7 +205,7 @@ npx rapidkit dev
174
205
  `)),console.log("");return}catch(B){throw C.fail("Failed to create workspace"),console.error(t.red(`
175
206
  \u274C Error:`),B),B}}}else if(console.log(t.yellow(`
176
207
  \u26A0\uFE0F Python not detected. Auto-switching to "${w}" profile (no Python required).
177
- `)),d=w,new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(w)){let j=O("Creating workspace").start();try{if(await k.ensureDir(i$1),j.succeed("Directory created"),await z(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await V(i$1),await U(i$1,a),!n){j.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m",`Initial commit: RapidKit workspace (${w})`],{cwd:i$1}),j.succeed("Git repository initialized");}catch{j.warn("Could not initialize git repository");}}try{let{registerWorkspace:C}=await import('./workspace-4VGM2NPS.js');await C(i$1,a);}catch{}console.log(t.green(`
208
+ `)),d=w,new Set(["go-only","java-only","dotnet-only","node-only","minimal"]).has(w)){let j=F("Creating workspace").start();try{if(await k.ensureDir(i$1),j.succeed("Directory created"),await U(i$1,a,"venv",void 0),await Y(i$1,a,"venv",void 0,w),await L(i$1),await z(i$1,a),!n){j.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m",`Initial commit: RapidKit workspace (${w})`],{cwd:i$1}),j.succeed("Git repository initialized");}catch{j.warn("Could not initialize git repository");}}try{let{registerWorkspace:C}=await import('./workspace-AG2MQFTY.js');await C(i$1,a);}catch{}console.log(t.green(`
178
209
  \u2728 Workspace created (auto-fallback profile)!
179
210
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u{1F4E6} Profile:"),t.yellow(w)),console.log(t.cyan("\u{1F4A1} Reason:"),t.gray("Python not detected; switched from "+d)),console.log(t.cyan(`
180
211
  \u{1F680} Get started:
@@ -182,19 +213,19 @@ npx rapidkit dev
182
213
  `)),console.log(t.cyan(`\u{1F4A1} Add Python later:
183
214
  `)),console.log(t.gray(" 1. Install Python 3.10+")),console.log(t.gray(` 2. Run: cd ${a} && rapidkit bootstrap --profile ${d}
184
215
  `)),console.log("");return}catch(C){throw j.fail("Failed to create workspace"),console.error(t.red(`
185
- \u274C Error:`),C),C}}}}a$1.step(1,3,"Setting up RapidKit environment");let I=O("Creating directory").start();try{await k.ensureDir(i$1),I.succeed("Directory created"),I.start("Detecting Python version");let f=null,R=await Rt(x.pythonVersion);if(R)f=await gt(R),f?(a$1.info(` Detected Python ${f}`),I.succeed(`Python ${f} detected`)):I.warn("Could not detect exact Python version");else {let b=S();f=await gt(b),f?I.succeed(`Python ${f} detected`):I.warn("Could not detect Python version, proceeding with defaults");}if(x.installMethod==="poetry"&&!await xt()&&(I.warn("Poetry not found \u2014 auto-fallback to pip + venv"),x.installMethod="venv"),await z(i$1,a,x.installMethod,f||void 0),f&&await Mt(i$1,f),await Y(i$1,a,x.installMethod,f||x.pythonVersion,d||h),await V(i$1),await U(i$1,a),x.installMethod==="poetry")try{await _t(i$1,x.pythonVersion,I,r,u,c);}catch(b){let w=b?.details||b?.message||String(b);if(w.includes("pyenv")||w.includes("exit status 127")||w.includes("returned non-zero exit status 127")){I.warn("Poetry encountered Python discovery issues, trying venv method"),a$1.debug(`Poetry error (attempting venv fallback): ${w}`);try{await ct(i$1,x.pythonVersion,I,r,u),x.installMethod="venv";}catch(D){throw D}}else throw b}else x.installMethod==="venv"?await ct(i$1,x.pythonVersion,I,r,u):await Et(i$1,I,r,u,c);if(await It(i$1,x.installMethod),await jt(i$1,x.installMethod),I.succeed("RapidKit environment ready!"),!o.skipGit){I.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit environment"],{cwd:i$1}),I.succeed("Git repository initialized");}catch{I.warn("Could not initialize git repository");}}try{let{registerWorkspace:b}=await import('./workspace-4VGM2NPS.js');await b(i$1,a);}catch{console.warn(t.gray("Note: Could not register workspace in shared registry"));}if(console.log(t.green(`
216
+ \u274C Error:`),C),C}}}}a$1.step(1,3,"Setting up RapidKit environment");let I=F("Creating directory").start();try{await k.ensureDir(i$1),I.succeed("Directory created"),I.start("Detecting Python version");let f=null,R=await Rt(x.pythonVersion);if(R)f=await gt(R),f?(a$1.info(` Detected Python ${f}`),I.succeed(`Python ${f} detected`)):I.warn("Could not detect exact Python version");else {let b=A();f=await gt(b),f?I.succeed(`Python ${f} detected`):I.warn("Could not detect Python version, proceeding with defaults");}if(x.installMethod==="poetry"&&!await xt()&&(I.warn("Poetry not found \u2014 auto-fallback to pip + venv"),x.installMethod="venv"),await U(i$1,a,x.installMethod,f||void 0),f&&await Mt(i$1,f),await Y(i$1,a,x.installMethod,f||x.pythonVersion,d||h),await L(i$1),await z(i$1,a),x.installMethod==="poetry")try{await _t(i$1,x.pythonVersion,I,r,u,c);}catch(b){let w=b?.details||b?.message||String(b);if(w.includes("pyenv")||w.includes("exit status 127")||w.includes("returned non-zero exit status 127")){I.warn("Poetry encountered Python discovery issues, trying venv method"),a$1.debug(`Poetry error (attempting venv fallback): ${w}`);try{await ct(i$1,x.pythonVersion,I,r,u),x.installMethod="venv";}catch(T){throw T}}else throw b}else x.installMethod==="venv"?await ct(i$1,x.pythonVersion,I,r,u):await Et(i$1,I,r,u,c);if(await It(i$1,x.installMethod),await jt(i$1,x.installMethod),I.succeed("RapidKit environment ready!"),!o.skipGit){I.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit environment"],{cwd:i$1}),I.succeed("Git repository initialized");}catch{I.warn("Could not initialize git repository");}}try{let{registerWorkspace:b}=await import('./workspace-AG2MQFTY.js');await b(i$1,a);}catch{console.warn(t.gray("Note: Could not register workspace in shared registry"));}if(console.log(t.green(`
186
217
  \u2728 RapidKit environment created successfully!
187
218
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(i$1)),console.log(t.cyan("\u2699\uFE0F Configuration:")),console.log(t.gray(` \u2022 Profile: ${d}`)),console.log(t.gray(` \u2022 Python: ${x.pythonVersion}`)),console.log(t.gray(` \u2022 Install method: ${x.installMethod}`)),console.log(t.cyan(`
188
219
  \u{1F680} Get started:
189
- `)),console.log(t.white(` cd ${a}`)),x.installMethod==="poetry"){let b="source $(poetry env info --path)/bin/activate";try{F();let{stdout:w}=await execa("poetry",["--version"]),A=w.match(/Poetry.*?(\d+)\.(\d+)/);A&&(parseInt(A[1])>=2?b="source $(poetry env info --path)/bin/activate":b="poetry shell");}catch{}console.log(t.white(` ${b} # Or: poetry run rapidkit`)),console.log(t.white(" rapidkit create # Interactive mode")),console.log(t.white(" cd <project-name>")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(t.gray(`
220
+ `)),console.log(t.white(` cd ${a}`)),x.installMethod==="poetry"){let b="source $(poetry env info --path)/bin/activate";try{O();let{stdout:w}=await execa("poetry",["--version"]),S=w.match(/Poetry.*?(\d+)\.(\d+)/);S&&(parseInt(S[1])>=2?b="source $(poetry env info --path)/bin/activate":b="poetry shell");}catch{}console.log(t.white(` ${b} # Or: poetry run rapidkit`)),console.log(t.white(" rapidkit create # Interactive mode")),console.log(t.white(" cd <project-name>")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(t.gray(`
190
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(`
191
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(`
192
223
  \u{1F4E6} Why pipx? Global isolated install, no local venv`)));console.log(t.cyan(`
193
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(`
194
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(`
195
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
196
- `));try{let{stdout:b}=await execa("go",["version"],{timeout:3e3}),w=b.match(/go version go(\d+\.\d+(?:\.\d+)?)/),A=w?w[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${A} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(t.yellow("\u26A0\uFE0F Go not installed \u2014 needed for gofiber.standard/gogin.standard projects")),console.log(t.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(f){I.fail("Failed to create RapidKit environment"),console.error(t.red(`
197
- \u274C Error:`),f);try{await k.remove(i$1);}catch{}throw f}}async function Rt(e$1){let o=[];if(!a$2())try{let{stdout:p}=await execa("pyenv",["which","python"]),c=p.trim();c&&o.push(c);}catch{}let n=Number(e$1.split(".")[1]),r=e(n,10).map(p=>p.command).filter(Boolean);o.push(`python${e$1}`,...r,...d$1());let l=[...new Set(o)];for(let p of l)try{let c=p==="py"?["-3","--version"]:["--version"],u=p==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:g}=await execa(p,c,{timeout:2e3}),h=g.match(/Python (\d+\.\d+)/)?.[1];if(h&&G(h,e$1))return await execa(p,u,{timeout:2e3}),p}catch{continue}return null}async function _t(e,o,n,r,l$1,p=false){await Ft(n,p),n.start("Finding Python interpreter");let c=await Rt(o);c?(a$1.debug(`Found working Python: ${c}`),n.succeed("Python found")):n.warn("Could not verify Python path, proceeding with default"),n.start("Initializing Poetry project");let u=m.join(e,"pyproject.toml"),h=(await k.pathExists(u)?await promises.readFile(u,"utf-8"):"").includes("rapidkit-core");if(h)n.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${o}`],{cwd:e}),n.succeed("Poetry project initialized");let d=await promises.readFile(u,"utf-8");d.includes("[tool.poetry]")?d=d.replace("[tool.poetry]",`[tool.poetry]
227
+ `));try{let{stdout:b}=await execa("go",["version"],{timeout:3e3}),w=b.match(/go version go(\d+\.\d+(?:\.\d+)?)/),S=w?w[1]:"unknown";console.log(t.gray(`\u{1F439} Go ${S} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(t.yellow("\u26A0\uFE0F Go not installed \u2014 needed for gofiber.standard/gogin.standard projects")),console.log(t.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(f){I.fail("Failed to create RapidKit environment"),console.error(t.red(`
228
+ \u274C Error:`),f);try{await k.remove(i$1);}catch{}throw f}}async function Rt(e$1){let o=[];if(!a$2())try{let{stdout:p}=await execa("pyenv",["which","python"]),c=p.trim();c&&o.push(c);}catch{}let n=Number(e$1.split(".")[1]),r=e(n,10).map(p=>p.command).filter(Boolean);o.push(`python${e$1}`,...r,...d$1());let l=[...new Set(o)];for(let p of l)try{let c=p==="py"?["-3","--version"]:["--version"],u=p==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:g}=await execa(p,c,{timeout:2e3}),h=g.match(/Python (\d+\.\d+)/)?.[1];if(h&&V(h,e$1))return await execa(p,u,{timeout:2e3}),p}catch{continue}return null}async function _t(e,o,n,r,l$1,p=false){await Ot(n,p),n.start("Finding Python interpreter");let c=await Rt(o);c?(a$1.debug(`Found working Python: ${c}`),n.succeed("Python found")):n.warn("Could not verify Python path, proceeding with default"),n.start("Initializing Poetry project");let u=m.join(e,"pyproject.toml"),h=(await k.pathExists(u)?await promises.readFile(u,"utf-8"):"").includes("rapidkit-core");if(h)n.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${o}`],{cwd:e}),n.succeed("Poetry project initialized");let d=await promises.readFile(u,"utf-8");d.includes("[tool.poetry]")?d=d.replace("[tool.poetry]",`[tool.poetry]
198
229
  package-mode = false`):d.includes("[project]")&&(d.includes("[build-system]")?d=d.replace("[build-system]",`
199
230
  [tool.poetry]
200
231
  package-mode = false
@@ -203,19 +234,19 @@ package-mode = false
203
234
 
204
235
  [tool.poetry]
205
236
  package-mode = false
206
- `),await promises.writeFile(u,d,"utf-8");}n.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:e}),n.succeed("Poetry configured");}catch{n.warn("Could not configure Poetry virtualenvs.in-project");}n.start("Creating virtualenv");let a=c||S(),i=f(m.join(e,".venv"));try{await execa(a,["-m","venv",".venv"],{cwd:e,timeout:6e4}),n.succeed("Virtualenv created");}catch(y){a$1.debug(`python -m venv failed: ${y}`),n.warn("Could not pre-create virtualenv, Poetry will try"),i=c||S();}try{await execa("poetry",["env","use",i||S()],{cwd:e}),a$1.debug(`Poetry env set to: ${i}`);}catch(y){a$1.debug(`Could not set Poetry env: ${y}`);}if(n.start("Installing RapidKit"),h&&!r){let y=d$2(l$1||{}),d=y?await k.pathExists(y):false,P=d&&y?y:"rapidkit-core";y&&!d&&a$1.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${y}. Falling back to PyPI.`),n.text=d?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let $=false,T=null;for(let _=1;_<=3;_++)try{await execa(i,["-m","pip","install",P,"--quiet"],{cwd:e,timeout:18e4}),$=true;break}catch(L){T=L,a$1.debug(`pip install rapidkit-core attempt ${_} failed: ${L}`),_<3&&(n.text=`Retrying installation (attempt ${_+1}/3)`,await new Promise(et=>setTimeout(et,2e3)));}if(!$){let _=T?.stderr||T?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${_}`),_.includes("Could not find")||_.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
237
+ `),await promises.writeFile(u,d,"utf-8");}n.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:e}),n.succeed("Poetry configured");}catch{n.warn("Could not configure Poetry virtualenvs.in-project");}n.start("Creating virtualenv");let a=c||A(),i=f(m.join(e,".venv"));try{await execa(a,["-m","venv",".venv"],{cwd:e,timeout:6e4}),n.succeed("Virtualenv created");}catch(y){a$1.debug(`python -m venv failed: ${y}`),n.warn("Could not pre-create virtualenv, Poetry will try"),i=c||A();}try{await execa("poetry",["env","use",i||A()],{cwd:e}),a$1.debug(`Poetry env set to: ${i}`);}catch(y){a$1.debug(`Could not set Poetry env: ${y}`);}if(n.start("Installing RapidKit"),h&&!r){let y=d$2(l$1||{}),d=y?await k.pathExists(y):false,P=d&&y?y:"rapidkit-core";y&&!d&&a$1.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${y}. Falling back to PyPI.`),n.text=d?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let $=false,D=null;for(let _=1;_<=3;_++)try{await execa(i,["-m","pip","install",P,"--quiet"],{cwd:e,timeout:18e4}),$=true;break}catch(G){D=G,a$1.debug(`pip install rapidkit-core attempt ${_} failed: ${G}`),_<3&&(n.text=`Retrying installation (attempt ${_+1}/3)`,await new Promise(et=>setTimeout(et,2e3)));}if(!$){let _=D?.stderr||D?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${_}`),_.includes("Could not find")||_.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
207
238
  Error: ${_}
208
239
 
209
240
  Possible solutions:
210
241
  1. Check your internet connection
211
242
  2. Try installing manually: cd ${m.basename(e)} && poetry add rapidkit-core
212
- 3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}else {n.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:e,timeout:12e4}),n.succeed("Poetry environment synced");}catch(y){a$1.debug(`poetry install --no-root failed: ${y}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),r){let y=d$2(l$1||{});if(!y)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${y}`),n.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",y],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let y=false,d=null;for(let P=1;P<=3;P++)try{await execa("poetry",["add","rapidkit-core"],{cwd:e,timeout:6e4*P}),y=true;break}catch($){d=$,a$1.debug(`Poetry add attempt ${P} failed: ${$}`),P<3&&(n.text=`Retrying installation (attempt ${P+1}/3)`,await new Promise(T=>setTimeout(T,2e3)));}if(!y){let P=d?.stderr||d?.message||"Unknown error";throw a$1.debug(`All Poetry install attempts failed. Last error: ${P}`),P.includes("Could not find")||P.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
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(y){a$1.debug(`poetry install --no-root failed: ${y}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),r){let y=d$2(l$1||{});if(!y)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${y}`),n.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",y],{cwd:e});}else {n.text="Installing RapidKit from PyPI";let y=false,d=null;for(let P=1;P<=3;P++)try{await execa("poetry",["add","rapidkit-core"],{cwd:e,timeout:6e4*P}),y=true;break}catch($){d=$,a$1.debug(`Poetry add attempt ${P} failed: ${$}`),P<3&&(n.text=`Retrying installation (attempt ${P+1}/3)`,await new Promise(D=>setTimeout(D,2e3)));}if(!y){let P=d?.stderr||d?.message||"Unknown error";throw a$1.debug(`All Poetry install attempts failed. Last error: ${P}`),P.includes("Could not find")||P.includes("No matching distribution")?new l:new k$1("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
213
244
  Error: ${P}
214
245
 
215
246
  Possible solutions:
216
247
  1. Check your internet connection
217
248
  2. Try installing manually: cd ${m.basename(e)} && poetry add rapidkit-core
218
- 3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:y}=await import('./pythonRapidkitExec-JXOKKTXZ.js');if(!await y()&&!r){n.start("Checking optional global pipx installation");let P=await tt(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await N(P,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch($){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${$}`);}}}catch(y){n.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${y}`);}}async function ct(e,o,n,r,l$1,p=false){n.start(`Checking Python ${o}`);let c=S();try{let{stdout:g}=await execa(c,["--version"]),h=g.match(/Python (\d+\.\d+)/)?.[1];if(h&&!G(h,o))throw new f$1(o,h);n.succeed(`Python ${h} found`);}catch(g){throw g instanceof f$1?g:new f$1(o)}n.start("Creating virtual environment");try{await execa(c,["-m","venv",".venv"],{cwd:e}),n.succeed("Virtual environment created");}catch(g){if(n.fail("Failed to create virtual environment"),(a=>typeof a=="object"&&a!==null&&"stdout"in a&&typeof a.stdout=="string")(g)&&g.stdout.includes("ensurepip is not")){let a=g.stdout.match(/apt install (python[\d.]+-venv)/),i=a?a[1]:"python3-venv";throw new k$1("Python venv module not available",new Error(`Virtual environment creation failed.
249
+ 3. Use venv method instead: npx rapidkit ${m.basename(e)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:y}=await import('./pythonRapidkitExec-MNWRC4F2.js');if(!await y()&&!r){n.start("Checking optional global pipx installation");let P=await tt(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await N(P,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch($){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${$}`);}}}catch(y){n.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${y}`);}}async function ct(e,o,n,r,l$1,p=false){n.start(`Checking Python ${o}`);let c=A();try{let{stdout:g}=await execa(c,["--version"]),h=g.match(/Python (\d+\.\d+)/)?.[1];if(h&&!V(h,o))throw new f$1(o,h);n.succeed(`Python ${h} found`);}catch(g){throw g instanceof f$1?g:new f$1(o)}n.start("Creating virtual environment");try{await execa(c,["-m","venv",".venv"],{cwd:e}),n.succeed("Virtual environment created");}catch(g){if(n.fail("Failed to create virtual environment"),(a=>typeof a=="object"&&a!==null&&"stdout"in a&&typeof a.stdout=="string")(g)&&g.stdout.includes("ensurepip is not")){let a=g.stdout.match(/apt install (python[\d.]+-venv)/),i=a?a[1]:"python3-venv";throw new k$1("Python venv module not available",new Error(`Virtual environment creation failed.
219
250
 
220
251
  On Debian/Ubuntu systems, install the venv package:
221
252
  sudo apt install ${i}
@@ -227,9 +258,9 @@ Error: ${a}
227
258
  Possible solutions:
228
259
  1. Check your internet connection
229
260
  2. Try installing manually: cd ${m.basename(e)} && ${f(".venv")} -m pip install rapidkit-core
230
- 3. Use Poetry instead: npx rapidkit ${m.basename(e)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:g}=await import('./pythonRapidkitExec-JXOKKTXZ.js');if(!await g()&&!r){n.start("Checking optional global pipx installation");let a=await tt(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await N(a,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(i){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${i}`);}}}catch(g){n.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${g}`);}}async function Et(e,o,n,r,l$1=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:c}=await import('./pythonRapidkitExec-JXOKKTXZ.js'),u=await c();if(u.isCompatible){o.succeed(`RapidKit ${u.installedVersion??""} already compatible globally; skipping pipx installation`),await k.outputFile(m.join(e,".rapidkit-global"),`RapidKit already available globally (version ${u.installedVersion??"unknown"}) and satisfies expected constraint ${u.expectedConstraint??"n/a"}; workspace will reuse the existing installation
261
+ 3. Use Poetry instead: npx rapidkit ${m.basename(e)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:g}=await import('./pythonRapidkitExec-MNWRC4F2.js');if(!await g()&&!r){n.start("Checking optional global pipx installation");let a=await tt(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await N(a,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(i){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${i}`);}}}catch(g){n.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${g}`);}}async function Et(e,o,n,r,l$1=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:c}=await import('./pythonRapidkitExec-MNWRC4F2.js'),u=await c();if(u.isCompatible){o.succeed(`RapidKit ${u.installedVersion??""} already compatible globally; skipping pipx installation`),await k.outputFile(m.join(e,".rapidkit-global"),`RapidKit already available globally (version ${u.installedVersion??"unknown"}) and satisfies expected constraint ${u.expectedConstraint??"n/a"}; workspace will reuse the existing installation
231
262
  `,"utf-8");return}u.reason==="constraint-missing"?o.warn('Version-aware global reuse skipped: no explicit rapidkit-core version constraint found. Set RAPIDKIT_CORE_PYTHON_PACKAGE (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core>=0.4.0,<0.9.0") to enable version-aware reuse. Proceeding with pipx install/upgrade.'):u.reason==="constraint-unsupported"&&o.warn('Version-aware global reuse skipped: RAPIDKIT_CORE_PYTHON_PACKAGE uses an unsupported spec (path/url/git). Use a version range instead (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core==0.4.0" or "rapidkit-core>=0.4.0,<0.9.0"). Proceeding with pipx install/upgrade.'),a$1.debug(`Global RapidKit install is not reusable via version-aware policy (reason=${u.reason}, installed=${u.installedVersion??"unknown"}, expected=${u.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(c){a$1.debug(`Global RapidKit version-aware check failed before pipx install: ${c}`);}let p=await tt(o,l$1);if(o.start("Installing RapidKit globally with pipx"),n){let c=d$2(r||{});if(!c)throw new k$1("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${c}`),o.text="Installing RapidKit from local path (test mode)",await N(p,["install","-e",c]);}else {o.text="Installing RapidKit from PyPI";try{await N(p,["install","rapidkit-core"]);}catch(c){try{o.text="RapidKit already installed globally, upgrading to match expected version",await N(p,["upgrade","rapidkit-core"]);}catch(u){throw a$1.debug(`pipx install/upgrade failed: install=${c}, upgrade=${u}`),new l}}}o.succeed("RapidKit installed globally"),await k.outputFile(m.join(e,".rapidkit-global"),`RapidKit installed globally with pipx
232
- `,"utf-8");}async function ce(e,o){let{skipGit:n=false,testMode:r=false,userConfig:l={},yes:p=false,installMethod:c,pythonVersion:u="3.10"}=o||{},g=c||l.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),h=g==="poetry"&&!await xt()?"venv":g;await z(e,m.basename(e),h),await V(e),await Y(e,m.basename(e),h,u,o?.profile);let a=O("Registering workspace").start();try{h==="poetry"?(await U(e,m.basename(e)),await _t(e,u,a,r,l,p)):h==="venv"?await ct(e,u,a,r,l):await Et(e,a,r,l,p),await It(e,h),await jt(e,h),a.succeed("Workspace registered");try{let{registerWorkspace:i}=await import('./workspace-4VGM2NPS.js');await i(e,m.basename(e));}catch{}if(!n){a.start("Initializing git repository");try{await execa("git",["init"],{cwd:e}),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:e}),a.succeed("Git repository initialized");}catch{a.warn("Could not initialize git repository");}}}catch(i){throw a.fail("Failed to register workspace"),i}}async function jt(e,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
263
+ `,"utf-8");}async function ce(e,o){let{skipGit:n=false,testMode:r=false,userConfig:l={},yes:p=false,installMethod:c,pythonVersion:u="3.10"}=o||{},g=c||l.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),h=g==="poetry"&&!await xt()?"venv":g;await U(e,m.basename(e),h),await L(e),await Y(e,m.basename(e),h,u,o?.profile);let a=F("Registering workspace").start();try{h==="poetry"?(await z(e,m.basename(e)),await _t(e,u,a,r,l,p)):h==="venv"?await ct(e,u,a,r,l):await Et(e,a,r,l,p),await It(e,h),await jt(e,h),a.succeed("Workspace registered");try{let{registerWorkspace:i}=await import('./workspace-AG2MQFTY.js');await i(e,m.basename(e));}catch{}if(!n){a.start("Initializing git repository");try{await execa("git",["init"],{cwd:e}),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:e}),a.succeed("Git repository initialized");}catch{a.warn("Could not initialize git repository");}}}catch(i){throw a.fail("Failed to register workspace"),i}}async function jt(e,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
233
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):
234
265
  ./rapidkit --help
235
266
  # or:
@@ -340,7 +371,7 @@ If you encounter issues:
340
371
  2. Check RapidKit installation: \`rapidkit --version\`
341
372
  3. Run diagnostics: \`rapidkit doctor\`
342
373
  4. Visit RapidKit documentation or GitHub issues
343
- `;await promises.writeFile(m.join(e,"README.md"),p,"utf-8");}async function Gt(e,o,n){let r=O("Creating demo workspace").start();try{await k.ensureDir(e),r.succeed("Directory created"),r.start("Setting up demo kit generator");let l=JSON.stringify({name:`${o}-workspace`,version:"1.0.0",private:true,description:"RapidKit demo workspace",scripts:{generate:"node generate-demo.js"}},null,2);await promises.writeFile(m.join(e,"package.json"),l,"utf-8"),await promises.writeFile(m.join(e,"generate-demo.js"),`#!/usr/bin/env node
374
+ `;await promises.writeFile(m.join(e,"README.md"),p,"utf-8");}async function Vt(e,o,n){let r=F("Creating demo workspace").start();try{await k.ensureDir(e),r.succeed("Directory created"),r.start("Setting up demo kit generator");let l=JSON.stringify({name:`${o}-workspace`,version:"1.0.0",private:true,description:"RapidKit demo workspace",scripts:{generate:"node generate-demo.js"}},null,2);await promises.writeFile(m.join(e,"package.json"),l,"utf-8"),await promises.writeFile(m.join(e,"generate-demo.js"),`#!/usr/bin/env node
344
375
  /**
345
376
  * Demo Kit Generator - Create FastAPI demo projects
346
377
  *
@@ -839,7 +870,7 @@ __pycache__/
839
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(`
840
871
  \u2728 Demo workspace created successfully!
841
872
  `)),console.log(t.cyan("\u{1F4C2} Location:"),t.white(e)),console.log(t.cyan(`\u{1F680} Get started:
842
- `)),console.log(t.white(` cd ${o}`)),console.log(t.white(" node generate-demo.js my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(),console.log(t.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For full RapidKit features:"),console.log(t.cyan(" pipx install rapidkit")),console.log();}catch(l){throw r.fail("Failed to create demo workspace"),l}}async function Lt(e,o,n,r,l,p,c){if(console.log(t.cyan(`
873
+ `)),console.log(t.white(` cd ${o}`)),console.log(t.white(" node generate-demo.js my-api")),console.log(t.white(" cd my-api")),console.log(t.white(" rapidkit init")),console.log(t.white(" rapidkit dev")),console.log(),console.log(t.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For full RapidKit features:"),console.log(t.cyan(" pipx install rapidkit")),console.log();}catch(l){throw r.fail("Failed to create demo workspace"),l}}async function Gt(e,o,n,r,l,p,c){if(console.log(t.cyan(`
843
874
  \u{1F50D} Dry-run mode - what would be created:
844
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(`
845
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(`