workspai 0.43.0 → 0.44.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 +26 -13
- package/contracts/agent-customization-pack.v1.json +1 -1
- package/contracts/autopilot-release.v1.json +204 -0
- package/contracts/cli-operation-result.v1.json +119 -0
- package/contracts/command-capabilities.v1.json +138 -0
- package/contracts/compatibility-matrix.v1.json +37 -0
- package/contracts/create-planner-capabilities.v1.json +156 -65
- package/contracts/doctor-project-scan.v2.json +60 -0
- package/contracts/doctor-remediation-plan.v1.json +19 -4
- package/contracts/doctor-remediation-plan.v2.json +7 -0
- package/contracts/doctor-workspace-cache.v2.json +82 -0
- package/contracts/extension-cli-compatibility.v1.json +47 -3
- package/contracts/infra-plan.v1.json +189 -0
- package/contracts/private-product-manifest.v1.json +155 -0
- package/contracts/product-factory-plan.v1.json +200 -0
- package/contracts/project-archive.v1.json +40 -0
- package/contracts/project-entry-capability.v1.json +127 -0
- package/contracts/published-contract-catalog.v1.json +334 -0
- package/contracts/runtime-command-surface.v1.json +239 -10
- package/contracts/version.v1.json +48 -0
- package/contracts/workspace-archive-capabilities.v1.json +90 -0
- package/contracts/workspace-archive-manifest.v1.json +107 -0
- package/contracts/workspace-archive-operation-result.v1.json +565 -0
- package/contracts/workspace-intelligence/agent-customization-pack-report.v1.json +98 -0
- package/contracts/workspace-intelligence/agent-hooks.v1.json +38 -0
- package/contracts/workspace-intelligence/agent-reports-index.v1.json +56 -0
- package/contracts/workspace-intelligence/mcp-design.v1.json +42 -0
- package/contracts/workspace-intelligence/workspace-context.v1.json +12 -0
- package/contracts/workspace-intelligence/workspace-explain.v1.json +1 -0
- package/contracts/workspace-intelligence-architecture.v1.json +723 -0
- package/contracts/workspace-intelligence-chain.v1.json +1194 -0
- package/contracts/workspace-list.v1.json +56 -0
- package/contracts/workspace-model-cache.v1.json +55 -0
- package/contracts/workspace-snapshot.v1.json +58 -0
- package/contracts/workspace-snapshot.v2.json +97 -0
- package/contracts/workspace-sync.v1.json +30 -0
- package/contracts/workspace-watch-event.v1.json +112 -0
- package/dist/analyze-6OCBM4ID.js +1 -0
- package/dist/{artifact-remediation-plan-5GJWPPRS.js → artifact-remediation-plan-Z7OCSME3.js} +3 -3
- package/dist/autopilot-release-LI2WJCEW.js +1 -0
- package/dist/{chunk-LZQNVH7D.js → chunk-2K3GYCPS.js} +1 -1
- package/dist/chunk-2QN6BMM7.js +2 -0
- package/dist/chunk-2QOWRBQD.js +1 -0
- package/dist/chunk-5AKYMAIL.js +1 -0
- package/dist/{chunk-RE773WOX.js → chunk-5PVEQ6CZ.js} +5 -5
- package/dist/{chunk-AFSZHLQT.js → chunk-7EIMPQR3.js} +1 -1
- package/dist/{chunk-3KXW53QI.js → chunk-7IHLTPZ6.js} +1 -1
- package/dist/chunk-7RIWU5TZ.js +1 -0
- package/dist/{chunk-T6OR6YOI.js → chunk-7UZVOYF5.js} +1 -1
- package/dist/chunk-B66A4TVP.js +1 -0
- package/dist/chunk-CL6TGI4Q.js +8 -0
- package/dist/chunk-FWJV7CCI.js +2 -0
- package/dist/chunk-J4AICQFB.js +1 -0
- package/dist/chunk-JICOD2GI.js +1 -0
- package/dist/{chunk-OJEWQO3Z.js → chunk-JP25YL3J.js} +17 -17
- package/dist/chunk-L2Q7B2OJ.js +1 -0
- package/dist/chunk-L3E6IRUQ.js +8 -0
- package/dist/chunk-LG6RFLPZ.js +1 -0
- package/dist/chunk-LGP6WXS2.js +4 -0
- package/dist/{chunk-VRDF2J46.js → chunk-M4VITK6X.js} +52 -50
- package/dist/chunk-NTXO7BMH.js +4 -0
- package/dist/{chunk-LPZFK3Y6.js → chunk-OW4UNG27.js} +65 -66
- package/dist/{chunk-LUP4U6EE.js → chunk-P424XYHP.js} +1 -1
- package/dist/chunk-P4SWTY5X.js +33 -0
- package/dist/chunk-TQEMLBAG.js +1 -0
- package/dist/chunk-TRMDODFM.js +13 -0
- package/dist/chunk-UNF72FTB.js +1 -0
- package/dist/chunk-V5JN4TDX.js +2 -0
- package/dist/chunk-VA5MRHKM.js +2 -0
- package/dist/chunk-XIVFLY6G.js +1 -0
- package/dist/chunk-YUX4YFGL.js +78 -0
- package/dist/{create-WRZO4HK2.js → create-DFAWAS5C.js} +1 -1
- package/dist/demo-kit-DZ7TPG7K.js +149 -0
- package/dist/doctor-PVSWDBJL.js +1 -0
- package/dist/{dotnet-webapi-clean-IPY3MCGQ.js → dotnet-webapi-clean-BYUUHX5Y.js} +20 -20
- package/dist/{gofiber-standard-N5N3QGH3.js → gofiber-standard-B6UK5GR7.js} +31 -31
- package/dist/{gogin-standard-LAWQTBWL.js → gogin-standard-BXU44VEM.js} +31 -31
- package/dist/index.d.ts +250 -24
- package/dist/index.js +218 -182
- package/dist/pipeline-ND734AJM.js +5 -0
- package/dist/{platform-capabilities-XAVU4HSM.js → platform-capabilities-YICBF4FA.js} +1 -1
- package/dist/{pythonRapidkitExec-3L3XJBSY.js → pythonRapidkitExec-UJYIB6FL.js} +1 -1
- package/dist/{springboot-standard-OZYF7ZM7.js → springboot-standard-PEHDKH2L.js} +27 -27
- package/dist/{workspace-PR6VZRBG.js → workspace-FQT3QIRS.js} +1 -1
- package/dist/workspace-agent-sync-ZYCPXTU3.js +1 -0
- package/dist/workspace-archive-EEGLHZDW.js +10 -0
- package/dist/workspace-context-WAGGJCDL.js +1 -0
- package/dist/{workspace-contract-XUGMCUSQ.js → workspace-contract-SEI4SNSG.js} +1 -1
- package/dist/workspace-explain-MVGGRCDN.js +1 -0
- package/dist/workspace-explain-contract-KT757JGQ.js +1 -0
- package/dist/{workspace-feedback-R6H4UFZB.js → workspace-feedback-RCB25NFO.js} +1 -1
- package/dist/{workspace-foundation-KGSV4E6D.js → workspace-foundation-KXDL6P6X.js} +1 -1
- package/dist/{workspace-history-CGCK2DJI.js → workspace-history-M4QQBIPB.js} +1 -1
- package/dist/workspace-intelligence-QOGD2TZS.js +1 -0
- package/dist/workspace-mcp-serve-CEFKEMYG.js +3 -0
- package/dist/{workspace-model-PNXXOGPO.js → workspace-model-GMSRBICO.js} +1 -1
- package/dist/workspace-registry-summary-S52SEJAG.js +1 -0
- package/dist/workspace-run-VC4OUPRF.js +1 -0
- package/dist/{workspace-verify-WSDUUTR5.js → workspace-verify-NP4GMFSV.js} +1 -1
- package/dist/workspace-watch-IIBH3Y25.js +1 -0
- package/docs/AI_FEATURES.md +67 -34
- package/docs/README.md +2 -1
- package/docs/commands-reference.md +26 -14
- package/docs/contracts/ARTIFACT_CATALOG.md +60 -36
- package/docs/contracts/README.md +3 -2
- package/docs/create-planner-capabilities.md +36 -18
- package/docs/workspace-operations.md +25 -0
- package/package.json +35 -13
- package/scripts/enterprise-package-smoke.mjs +40 -8
- package/scripts/prepack-enterprise.mjs +8 -0
- package/templates/kits/fastapi-ddd/.gitignore.j2 +11 -0
- package/templates/kits/fastapi-ddd/README.md.j2 +23 -18
- package/templates/kits/fastapi-ddd/common/env.example.j2 +2 -2
- package/templates/kits/fastapi-ddd/pyproject.toml.j2 +7 -7
- package/templates/kits/fastapi-ddd/src/app/config/__init__.py.j2 +1 -1
- package/templates/kits/fastapi-ddd/src/cli.py.j2 +6 -9
- package/templates/kits/fastapi-ddd/src/main.py.j2 +1 -1
- package/templates/kits/fastapi-standard/.gitignore.j2 +11 -0
- package/templates/kits/fastapi-standard/README.md.j2 +35 -30
- package/templates/kits/fastapi-standard/common/env.example.j2 +2 -2
- package/templates/kits/fastapi-standard/pyproject.toml.j2 +7 -7
- package/templates/kits/fastapi-standard/src/cli.py.j2 +7 -10
- package/templates/kits/fastapi-standard/src/main.py.j2 +1 -1
- package/templates/kits/fastapi-standard/src/routing/examples.py.j2 +1 -1
- package/templates/kits/fastapi-standard/tests/test_examples.py.j2 +1 -1
- package/templates/kits/nestjs-standard/.dockerignore.j2 +11 -0
- package/templates/kits/nestjs-standard/.eslintrc.js.j2 +25 -0
- package/templates/kits/nestjs-standard/.gitignore.j2 +22 -0
- package/templates/kits/nestjs-standard/.node-version.j2 +1 -0
- package/templates/kits/nestjs-standard/.nvmrc.j2 +1 -0
- package/templates/kits/nestjs-standard/.prettierrc.j2 +7 -0
- package/templates/kits/nestjs-standard/README.md.j2 +23 -18
- package/templates/kits/nestjs-standard/docs/README.md.j2 +2 -2
- package/templates/kits/nestjs-standard/jest.config.ts.j2 +1 -7
- package/templates/kits/nestjs-standard/package.json.j2 +1 -1
- package/templates/kits/nestjs-standard/src/config/configuration.ts.j2 +4 -4
- package/templates/kits/nestjs-standard/src/main.ts.j2 +1 -1
- package/templates/kits/nestjs-standard/src/modules/index.ts.j2 +1 -1
- package/templates/kits/nestjs-standard/tsconfig.build.json.j2 +1 -1
- package/templates/kits/nestjs-standard/tsconfig.json.j2 +1 -1
- package/dist/analyze-5BU4QIPK.js +0 -1
- package/dist/autopilot-release-QYUOVB26.js +0 -1
- package/dist/chunk-54XJNLYC.js +0 -13
- package/dist/chunk-5SWNSJGW.js +0 -1
- package/dist/chunk-753LOKFZ.js +0 -2
- package/dist/chunk-AAKUNWPR.js +0 -78
- package/dist/chunk-AQ4XZZC6.js +0 -1
- package/dist/chunk-CVTCPPEF.js +0 -1
- package/dist/chunk-DNAY5ALC.js +0 -1
- package/dist/chunk-EWYYLJQY.js +0 -2
- package/dist/chunk-LO4C4VXR.js +0 -4
- package/dist/chunk-LYC6AIF2.js +0 -2
- package/dist/chunk-NAAQMSO3.js +0 -1
- package/dist/chunk-NFUXULIF.js +0 -1
- package/dist/chunk-OL64GWQC.js +0 -9
- package/dist/chunk-PI5KUXDA.js +0 -7
- package/dist/chunk-SI3AQKIP.js +0 -1
- package/dist/chunk-VZKSNUEE.js +0 -2
- package/dist/chunk-WU4ZRRA5.js +0 -4
- package/dist/chunk-XEJD4KCV.js +0 -33
- package/dist/demo-kit-AJ5LIM5G.js +0 -149
- package/dist/doctor-MF3M3FS3.js +0 -1
- package/dist/pipeline-QCUHFWDY.js +0 -5
- package/dist/workspace-agent-sync-KTYF3HQR.js +0 -1
- package/dist/workspace-archive-GCZNI44O.js +0 -3
- package/dist/workspace-context-QUTOP2XV.js +0 -1
- package/dist/workspace-explain-JEONEGZZ.js +0 -1
- package/dist/workspace-explain-contract-DNS2YEL7.js +0 -1
- package/dist/workspace-intelligence-QJGVL37U.js +0 -1
- package/dist/workspace-mcp-serve-AK4MYEHQ.js +0 -3
- package/dist/workspace-registry-summary-RUJE6RPH.js +0 -1
- package/dist/workspace-run-Y7YMUIHX.js +0 -1
- package/dist/workspace-watch-AGPOJ74Q.js +0 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {f as f$1,e as e$2}from'./chunk-
|
|
1
|
+
import {f as f$1,e as e$2}from'./chunk-7EIMPQR3.js';import {b as b$2}from'./chunk-JHC6SCJC.js';import {e,g,f as f$2,b as b$4,c as c$3,d as d$3}from'./chunk-5PVEQ6CZ.js';import {d as d$1,b as b$1}from'./chunk-GSWPGELT.js';import {c}from'./chunk-Y45WZR5N.js';import {f,c as c$2,e as e$3}from'./chunk-7YHK5NM3.js';import {a as a$1}from'./chunk-TQEMLBAG.js';import {b as b$3,j,i,l,h,s}from'./chunk-2K3GYCPS.js';import {b,a,c as c$1,d as d$2}from'./chunk-5XATWNME.js';import {promises}from'fs';import*as v from'fs-extra';import d from'path';import e$1 from'chalk';import {execa}from'execa';async function V(t,o={}){let n=d.resolve(t),s=o.workspaceName??d.basename(n);try{let{registerWorkspace:a}=await import('./workspace-FQT3QIRS.js');await a(n,s);}catch(a){o.silent||console.warn(e$1.gray(`Note: Could not register workspace in shared registry: ${a?.message??a}`));}try{let{syncWorkspaceContract:a}=await import('./workspace-contract-SEI4SNSG.js'),l=await a({workspacePath:n});if(o.silent||console.log(e$1.gray(`\u2139\uFE0F Workspace intelligence synced (contract + registry summary, ${l.contract.projects.length} project(s)).`)),!o.silent&&l.verification.status!=="passed"){console.log(e$1.yellow("\u26A0\uFE0F Workspace contract verification reported issues."));for(let p of l.verification.violations)console.log(e$1.gray(` Violation: ${p}`));console.log(e$1.white(" Next: npx workspai workspace contract inspect"));}}catch(a){o.silent||console.warn(e$1.gray(`Note: Could not sync workspace intelligence layer: ${a?.message??a}`));}}function D(){return h()}async function B(t,o,n,s,a){let l=d$1(o,c(),n,a?.pythonEngine?{coreStatus:a.pythonEngine,...a.pythonEngineReason?{coreReason:a.pythonEngineReason}:{},...s?{pythonVersion:s}:{}}:void 0);s&&!a?.pythonEngine&&(l.metadata||(l.metadata={}),l.metadata.python={pythonVersion:s}),await b$1(t,l);}async function G(t){await v.outputFile(d.join(t,".gitignore"),`.venv/
|
|
2
2
|
__pycache__/
|
|
3
3
|
*.pyc
|
|
4
4
|
.env
|
|
5
|
-
${
|
|
6
|
-
${d$1}
|
|
5
|
+
${d$2}
|
|
7
6
|
${b}/
|
|
8
7
|
|
|
9
|
-
`,"utf-8");}async function
|
|
8
|
+
`,"utf-8");}async function Ae(t){try{let o=await execa("git",["rev-parse","--show-toplevel"],{cwd:t,env:a$1()});return o.stdout.trim()?d.resolve(t,o.stdout.trim()):null}catch{return null}}async function J(t,o,n){if(await Ae(t)){o.warn("Git initialization skipped because target is already inside a git worktree");return}o.start("Initializing git repository");try{await execa("git",["init"],{cwd:t,env:a$1()}),await execa("git",["add","."],{cwd:t,env:a$1()}),await execa("git",["commit","-m",n],{cwd:t,env:a$1()}),o.succeed("Git repository initialized");}catch{o.warn("Could not initialize git repository");}}async function $e(t,o){let n=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await v.outputFile(d.join(t,"poetry.toml"),`[virtualenvs]
|
|
10
9
|
in-project = true
|
|
11
|
-
`,"utf-8"),await
|
|
10
|
+
`,"utf-8"),await v.outputFile(d.join(t,"pyproject.toml"),`[tool.poetry]
|
|
12
11
|
name = "${n}"
|
|
13
12
|
version = "0.1.0"
|
|
14
13
|
description = "Workspai workspace"
|
|
@@ -22,7 +21,7 @@ rapidkit-core = "*"
|
|
|
22
21
|
[build-system]
|
|
23
22
|
requires = ["poetry-core"]
|
|
24
23
|
build-backend = "poetry.core.masonry.api"
|
|
25
|
-
`,"utf-8");}function
|
|
24
|
+
`,"utf-8");}function Se(t,o,n,s,a){return JSON.stringify({schema_version:"1.0",workspace_name:t,workspai_version:c(),rapidkit_version:c(),created_at:new Date().toISOString(),created_by:"workspai",profile:s||"minimal",...a?.profileRequested?{profile_requested:a.profileRequested}:{},...a?.bootstrapNote?{bootstrap_note:a.bootstrapNote}:{},engine:{install_method:o,python_version:n||null,...a?.pythonEngine?{python_core:{status:a.pythonEngine,...a.pythonEngineReason?{reason:a.pythonEngineReason}:{}}}:{}}},null,2)}function Me(t,o,n,s,a,l){return JSON.stringify({schema_version:"1.0",generated_by:"workspai",generated_at:new Date().toISOString(),runtime:{python:{version:o||null,install_method:t,...l?.pythonEngine?{core:{status:l.pythonEngine,...l.pythonEngineReason?{reason:l.pythonEngineReason}:{}}}:{}},node:{version:n||process.version},go:{version:s||null},java:{version:null,build_tool:null,build_tool_version:null},dotnet:{version:a||null,sdk:a||null}}},null,2)}function De(){return `version: "1.0"
|
|
26
25
|
mode: warn # "warn" or "strict"
|
|
27
26
|
dependency_sharing_mode: isolated # "isolated" or "shared-runtime-caches" or "shared-node-deps"
|
|
28
27
|
# change profile (recommended): npx workspai bootstrap --profile polyglot
|
|
@@ -31,20 +30,20 @@ rules:
|
|
|
31
30
|
enforce_workspace_marker: true
|
|
32
31
|
enforce_toolchain_lock: false
|
|
33
32
|
disallow_untrusted_tool_sources: false
|
|
34
|
-
`}function
|
|
33
|
+
`}function Te(){return `version: "1.0"
|
|
35
34
|
cache:
|
|
36
35
|
strategy: shared # "shared" or "on-demand"
|
|
37
36
|
prune_on_bootstrap: false
|
|
38
37
|
self_heal: true
|
|
39
38
|
verify_integrity: false
|
|
40
|
-
`}async function
|
|
41
|
-
`,"utf-8"),f.debug(`Created .python-version with ${o}`);}catch(n){f.warn(`Failed to create .python-version: ${n}`);}}function
|
|
39
|
+
`}async function Ne(){try{let{stdout:t}=await execa("go",["version"],{timeout:3e3,stdio:"pipe"}),o=t.match(/go(\d+\.\d+(?:\.\d+)?)/i);return o?o[1]:void 0}catch{return}}async function Ke(){try{let{stdout:t}=await execa("dotnet",["--version"],{timeout:3e3,stdio:"pipe"}),o=t.trim();return o.length>0?o:void 0}catch{return}}async function Q(t,o,n,s,a$1,l){let[p,u]=await Promise.all([Ne(),Ke()]),c=[{fileName:"workspace.json",content:Se(o,n,s,a$1,l)},{fileName:"toolchain.lock",content:Me(n,s,process.version,p,u,l)},{fileName:"policies.yml",content:De()},{fileName:"cache-config.yml",content:Te()}];for(let h of c)await v.outputFile(d.join(t,a,h.fileName),h.content,"utf-8");}async function $t(t,o){let{workspaceName:n=d.basename(t),installMethod:s="venv",pythonVersion:a$1,profile:l,writeMarker:p=true,writeGitignore:u=true,onlyIfMissing:c$2=true}=o||{},h=[],[m,g]=await Promise.all([Ne(),Ke()]),r=[{relPath:d.join(a,"workspace.json"),legacyRelPath:d.join(b,"workspace.json"),content:Se(n,s,a$1,l)},{relPath:d.join(a,"toolchain.lock"),legacyRelPath:d.join(b,"toolchain.lock"),content:Me(s,a$1,process.version,m,g)},{relPath:d.join(a,"policies.yml"),legacyRelPath:d.join(b,"policies.yml"),content:De()},{relPath:d.join(a,"cache-config.yml"),legacyRelPath:d.join(b,"cache-config.yml"),content:Te()}];for(let i of r){let P=d.join(t,i.relPath),w=d.join(t,i.legacyRelPath),j=await v.pathExists(P),E=await v.pathExists(w);c$2&&j||(c$2&&E?(await v.copy(w,P),h.push(i.relPath)):(await v.outputFile(P,i.content,"utf-8"),h.push(i.relPath)));}if(p&&(!await v.pathExists(d.join(t,c$1))||!c$2)){let P=d$1(n,c(),s);a$1&&(P.metadata||(P.metadata={}),P.metadata.python={pythonVersion:a$1}),await b$1(t,P),h.push(c$1);}if(u){let i=d.join(t,".gitignore");(!c$2||!await v.pathExists(i))&&(await G(t),h.push(".gitignore"));}return h}var Oe=new Set(["go-only","java-only","dotnet-only","node-only","minimal"]),ze={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"};function Be(t){let o=t,n=new Set;for(;!Oe.has(o);){if(n.has(o))return "minimal";n.add(o);let s=ze[o];if(!s)return "minimal";o=s;}return o}var L="3.10",We=["3.10","3.11","3.12"];async function Ce(t){try{let{stdout:o}=await execa(t,["--version"],{timeout:3e3}),n=o.match(/Python (\d+\.\d+\.\d+)/);if(n)return n[1]}catch{}return null}async function Je(t,o){try{await promises.writeFile(d.join(t,".python-version"),`${o}
|
|
40
|
+
`,"utf-8"),f.debug(`Created .python-version with ${o}`);}catch(n){f.warn(`Failed to create .python-version: ${n}`);}}function U(){let n=[...(process.env.PATH||"").split(d.delimiter).filter(Boolean)];for(let s$1 of s())n.includes(s$1)||n.unshift(s$1);process.env.PATH=n.join(d.delimiter);}async function re(t,o){U(),t.start("Checking pipx installation");try{return await execa("pipx",["--version"]),t.succeed("pipx found"),{kind:"binary"}}catch{}let n=D();try{return await execa(n,["-m","pipx","--version"]),t.succeed("pipx found"),{kind:"python-module",pythonCmd:n}}catch{}if(o)throw new d$3;t.stop?.();let{installPipx:s}=await b$2([{type:"confirm",name:"installPipx",message:"pipx is not installed. Install it now (user install via python -m pip)?",default:true}]);if(!s)throw new d$3;t.start("Installing pipx (user install)");try{try{await execa(n,["-m","pip","install","--user","--upgrade","pip"]);}catch{}await execa(n,["-m","pip","install","--user","--upgrade","pipx"]);}catch(a){let l=a,p=String(l?.stderr||l?.shortMessage||l?.message||"");throw new f$2("Install pipx with python -m pip",a instanceof Error?a:new Error(p))}t.succeed("pipx installed"),U();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(a){let l=a,p=String(l?.stderr||l?.shortMessage||l?.message||"pipx not runnable after install");throw new f$2("Verify pipx after install",new Error(`${p}
|
|
42
41
|
|
|
43
|
-
Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function
|
|
44
|
-
${r.stderr||""}`);i&&
|
|
45
|
-
${
|
|
42
|
+
Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function H(t,o){return t.kind==="binary"?execa("pipx",o):execa(t.pythonCmd,["-m","pipx",...o])}function Qe(t){let o=t.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function je(t){if(!t)return null;let o=t.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function we(t,o){let[n,s]=t.split(".").map(p=>Number(p)),[a,l]=o.split(".").map(p=>Number(p));return n!==a?n-a:s-l}function X(t,o){return we(t,o)>=0}async function Xe(t){let o=new Set,n=j(14,10);for(let g of n)try{let r=await execa(g.command,g.args,{timeout:2500}),i=je(`${r.stdout||""}
|
|
43
|
+
${r.stderr||""}`);i&&X(i,L)&&o.add(i);}catch{}let s=null;try{let g=await execa(D(),["--version"],{timeout:2500}),r=je(`${g.stdout||""}
|
|
44
|
+
${g.stderr||""}`);r&&X(r,L)&&(s=r,o.add(r));}catch{}let a=We.filter(g=>X(g,L)),l=new Set([...a,...o]),p=Array.from(l).sort((g,r)=>we(r,g)),u=t?Qe(t):null,c=u&&X(u,L)?u:s||p[0]||L;return l.has(c)||l.add(c),{choices:Array.from(l).sort((g,r)=>we(r,g)).map(g=>{let r=[];return g===s&&r.push("current system"),g===L&&r.push("minimum supported"),o.has(g)&&g!==s&&r.push("detected"),{name:r.length>0?`${g} (${r.join(", ")})`:g,value:g}}),defaultValue:c}}async function Ze(){U();let t=false,o=false;try{await execa("poetry",["--version"],{timeout:2500}),t=true;}catch{t=false;}try{await execa("pipx",["--version"],{timeout:2500}),o=true;}catch{let n=h();try{await execa(n,["-m","pipx","--version"],{timeout:2500}),o=true;}catch{o=false;}}return {poetry:t,pipx:o}}async function Fe(){U();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function et(t,o){return t==="poetry"&&o.poetry?"poetry":t==="pipx"&&o.pipx?"pipx":t==="venv"?"venv":o.poetry?"poetry":"venv"}async function tt(t,o){U(),t.start("Checking Poetry installation");try{await execa("poetry",["--version"]),t.succeed("Poetry found");return}catch{}if(o)throw new c$3;let{installPoetry:n}=await b$2([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!n)throw new c$3;let s=await re(t,o);t.start("Installing Poetry with pipx");try{await H(s,["install","poetry"]);}catch(a){let l=a,p=String(l?.stderr||l?.shortMessage||l?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(p))try{await H(s,["upgrade","poetry"]);}catch{}else throw new f$2("Install Poetry with pipx",a instanceof Error?a:new Error(p))}t.succeed("Poetry installed"),U();try{await execa("poetry",["--version"]);}catch(a){let l=a,p=String(l?.stderr||l?.shortMessage||l?.message||"Poetry not found on PATH");throw new f$2("Verify Poetry after pipx install",new Error(`${p}
|
|
46
45
|
|
|
47
|
-
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function
|
|
46
|
+
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function ot(t,o={}){let n=t==="poetry",s=o.pythonEngineSkipped?`echo "- Python engine installation was intentionally skipped for this workspace." 1>&2
|
|
48
47
|
echo "- For npm-owned workspace commands, run: npx workspai <command>" 1>&2
|
|
49
48
|
echo "- To install the local Python engine later, create a RapidKit Core module-enabled project, then run: npx workspai workspace run init" 1>&2
|
|
50
49
|
`:`echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
|
|
@@ -80,7 +79,7 @@ ${s}${o.pythonEngineSkipped?"":n?`echo "- If you used Poetry: run 'poetry instal
|
|
|
80
79
|
`:""}${o.pythonEngineSkipped?`echo "Tip: use 'npx workspai workspace model --json' for Workspace Intelligence without the Python engine." 1>&2
|
|
81
80
|
`:`echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
|
|
82
81
|
`}exit 1
|
|
83
|
-
`}function
|
|
82
|
+
`}function nt(t,o={}){let n=t==="poetry",s=o.pythonEngineSkipped?`echo - Python engine installation was intentionally skipped for this workspace. 1>&2
|
|
84
83
|
echo - For npm-owned workspace commands, run: npx workspai ^<command^> 1>&2
|
|
85
84
|
echo - To install the local Python engine later, create a RapidKit Core module-enabled project, then run: npx workspai workspace run init 1>&2
|
|
86
85
|
`:`echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
|
|
@@ -120,8 +119,8 @@ for %%R in ("%USERPROFILE%\\.local\\bin\\rapidkit.exe" "%APPDATA%\\Python\\Scrip
|
|
|
120
119
|
echo RapidKit launcher could not find a local Python CLI. 1>&2
|
|
121
120
|
${s}echo Tip: for npm-owned workspace commands, run npx --yes --package workspai workspai %* from a shell where npm is on PATH. 1>&2
|
|
122
121
|
exit /b 1
|
|
123
|
-
`}async function
|
|
124
|
-
\u{1F4CC} Configuration notes:`)),I.pythonVersion==="3.10"?console.log(e$1.gray(" \u2022 Python 3.10: Latest stable with widespread compatibility")):I.pythonVersion==="3.11"?console.log(e$1.gray(" \u2022 Python 3.11: Newer, faster (3.10-3.11: ~10% speed improvement)")):I.pythonVersion==="3.12"&&console.log(e$1.gray(" \u2022 Python 3.12: Cutting edge, excellent for performance")),I.installMethod==="poetry"?console.log(e$1.gray(" \u2022 Poetry: Dependency management + virtual env (recommended for teams)")):I.installMethod==="venv"?console.log(e$1.gray(" \u2022 venv: Standard library approach, lightweight, zero dependencies")):console.log(e$1.gray(" \u2022 pipx: Global isolated, RapidKit Core only, no local venv")),console.log(""));let
|
|
122
|
+
`}async function fe(t,o,n={}){await v.outputFile(d.join(t,"rapidkit"),ot(o,n),{encoding:"utf-8",mode:493}),await v.outputFile(d.join(t,"rapidkit.cmd"),nt(o,n),"utf-8");}async function St(t,o){let{skipGit:n=false,skipPythonEngine:s=false,testMode:a=false,demoMode:l=false,dryRun:p=false,yes:u=false,userConfig:c={},installMethod:h,profile:m,parentDirectory:g}=o,r=t||"rapidkit",i=g?d.resolve(g,r):d.resolve(process.cwd(),r);if(await v.pathExists(i))throw new e(r);if(p){let f=m||(u?"minimal":void 0),R=h||c.defaultInstallMethod||"poetry",x=c.pythonVersion||"3.10";await at(i,r,l,c,f,R,x);return}if(l){await it(i,r,n);return}let P=new Set(["python-only","polyglot","enterprise"]),w=m||"";if(!u&&!m){let{selectedProfile:f}=await b$2([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"java-only \u2014 Java runtime (Spring Boot services)",value:"java-only"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"dotnet-only \u2014 .NET runtime (ASP.NET Core services)",value:"dotnet-only"},{name:"polyglot \u2014 Python + Node.js + Go + Java + .NET multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);w=f;}else w||(w="minimal");let j=!u&&P.has(w),E=P.has(w)&&s?"skip":j?(await b$2([{type:"confirm",name:"installPythonEngine",message:"Install the optional RapidKit Python engine now? (needed for Python-backed kits/modules)",default:true}])).installPythonEngine!==false?"install":"skip":"install",W=j&&E==="install",se=typeof c.pythonVersion=="string"&&c.pythonVersion.trim().length>0?c.pythonVersion.trim():void 0,Ue=h||c.defaultInstallMethod||"poetry",le=W?await Ze():{poetry:true,pipx:true},ke=W?await Xe(se):{choices:We.map(f=>({name:f,value:f})),defaultValue:L},Ye=et(Ue,le),qe=[{name:le.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:le.pipx?"\u{1F527} pipx (Global isolated - RapidKit Core only, no local venv)":"\u{1F527} pipx (Global isolated) \u2014 not detected (we can install it)",value:"pipx"}],I=W?await b$2([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:ke.choices,default:ke.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:qe,default:Ye}]):await(async()=>{if(E==="skip")return {pythonVersion:c.pythonVersion||"3.10",installMethod:"venv"};let f$1=h||c.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return f.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:c.pythonVersion||"3.10",installMethod:f$1}})();W&&(console.log(e$1.gray(`
|
|
123
|
+
\u{1F4CC} Configuration notes:`)),I.pythonVersion==="3.10"?console.log(e$1.gray(" \u2022 Python 3.10: Latest stable with widespread compatibility")):I.pythonVersion==="3.11"?console.log(e$1.gray(" \u2022 Python 3.11: Newer, faster (3.10-3.11: ~10% speed improvement)")):I.pythonVersion==="3.12"&&console.log(e$1.gray(" \u2022 Python 3.12: Cutting edge, excellent for performance")),I.installMethod==="poetry"?console.log(e$1.gray(" \u2022 Poetry: Dependency management + virtual env (recommended for teams)")):I.installMethod==="venv"?console.log(e$1.gray(" \u2022 venv: Standard library approach, lightweight, zero dependencies")):console.log(e$1.gray(" \u2022 pipx: Global isolated, RapidKit Core only, no local venv")),console.log(""));let ce=Oe;if(ce.has(w)){let f=c$2("Creating workspace",{component:"create",phase:"workspace.python-free"});try{await v.ensureDir(i),f.succeed("Directory created"),await B(i,r,"venv",void 0),await Q(i,r,"venv",void 0,w),await G(i);let R={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await v.outputFile(d.join(i,"README.md"),`# ${r}
|
|
125
124
|
|
|
126
125
|
Workspai **${R[w]}** workspace.
|
|
127
126
|
|
|
@@ -148,12 +147,12 @@ npx workspai dev
|
|
|
148
147
|
cd <project-name>
|
|
149
148
|
npx workspai init
|
|
150
149
|
npx workspai dev
|
|
151
|
-
`)+"```\n","utf-8")
|
|
150
|
+
`)+"```\n","utf-8"),n||await J(i,f,"Initial commit: Workspai workspace"),await V(i,{workspaceName:r,silent:a}),console.log(e$1.green(`
|
|
152
151
|
\u2728 Workspace created!
|
|
153
152
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan(`
|
|
154
153
|
\u{1F680} Get started:
|
|
155
154
|
`)),console.log(e$1.white(` ${f$1(i)}`)),w==="go-only"){console.log(e$1.white(" npx workspai create project gofiber.standard my-api")),console.log(e$1.white(" cd my-api")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
156
|
-
`)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:x}=await execa("go",["version"],{timeout:3e3}),
|
|
155
|
+
`)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:x}=await execa("go",["version"],{timeout:3e3}),k=x.match(/go version go(\d+\.\d+(?:\.\d+)?)/),T=k?k[1]:"unknown";console.log(e$1.gray(`\u{1F439} Go ${T} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(e$1.yellow(`
|
|
157
156
|
\u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else if(w==="java-only")console.log(e$1.white(" npx workspai create project springboot.standard my-service")),console.log(e$1.white(" cd my-service")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
158
157
|
`)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."));else if(w==="dotnet-only"){console.log(e$1.white(" npx workspai create project dotnet.webapi.clean my-api")),console.log(e$1.white(" cd my-api")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
159
158
|
`)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 ASP.NET Core kit runs through the npm package with .NET tooling."));try{let{stdout:x}=await execa("dotnet",["--version"],{timeout:3e3});console.log(e$1.gray(`\u2699\uFE0F .NET SDK ${x.trim()} detected \u2014 ready for ASP.NET Core projects`));}catch{console.log(e$1.yellow(`
|
|
@@ -161,7 +160,7 @@ npx workspai dev
|
|
|
161
160
|
`)),console.log(e$1.gray("\u{1F4A1} Node lifecycle commands run through Node tooling. RapidKit Core module commands for module-enabled kits can install the local Python engine later with workspace run init."))):(console.log(e$1.white(" npx workspai create project")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
162
161
|
`)),console.log(e$1.gray("\u{1F4A1} Bootstrap a specific runtime: workspai bootstrap --profile java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")));console.log(e$1.cyan(`
|
|
163
162
|
\u{1F4DA} More info:`)),console.log(e$1.gray(" \u2022 Change profile anytime: workspai bootstrap --profile <profile>")),console.log(e$1.gray(" \u2022 View config: cat "+r+"/.workspai-workspace")),console.log(e$1.gray(" \u2022 Check health: workspai doctor")),console.log("");}catch(R){throw f.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
164
|
-
\u274C Error:`),R),R}return}if(P.has(w)&&E==="skip"){let f=c$2("Creating workspace",{component:"create",phase:"workspace.python-engine-skipped"});try{await
|
|
163
|
+
\u274C Error:`),R),R}return}if(P.has(w)&&E==="skip"){let f=c$2("Creating workspace",{component:"create",phase:"workspace.python-engine-skipped"});try{await v.ensureDir(i),f.succeed("Directory created");let R={bootstrapNote:"python-engine-skipped",pythonEngine:"skipped",pythonEngineReason:"user-opted-out"};await B(i,r,"venv",void 0,R),await Q(i,r,"venv",void 0,w,R),await G(i),await fe(i,"venv",{pythonEngineSkipped:true});let x={"python-only":"Python-aware",polyglot:"Polyglot",enterprise:"Enterprise"};await v.outputFile(d.join(i,"README.md"),`# ${r}
|
|
165
164
|
|
|
166
165
|
Workspai **${x[w]??w}** workspace with Workspace Intelligence enabled and Python engine installation skipped.
|
|
167
166
|
|
|
@@ -179,7 +178,7 @@ npx workspai workspace verify --json
|
|
|
179
178
|
npx workspai create project fastapi.standard api --yes
|
|
180
179
|
npx workspai workspace run init
|
|
181
180
|
\`\`\`
|
|
182
|
-
`,"utf-8")
|
|
181
|
+
`,"utf-8"),n||await J(i,f,`Initial commit: Workspai workspace (${w})`),await V(i,{workspaceName:r,silent:a}),console.log(e$1.green(`
|
|
183
182
|
\u2728 Workspace created!
|
|
184
183
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u2699\uFE0F Configuration:")),console.log(e$1.gray(` \u2022 Profile: ${w}`)),console.log(e$1.gray(" \u2022 Python engine: skipped")),console.log(e$1.gray(" \u2022 Workspace Intelligence: enabled")),console.log(e$1.cyan(`
|
|
185
184
|
\u{1F680} Get started:
|
|
@@ -187,42 +186,42 @@ npx workspai workspace run init
|
|
|
187
186
|
`)),console.log(e$1.cyan(`\u{1F4A1} Add Python-backed kits/modules later:
|
|
188
187
|
`)),console.log(e$1.gray(" npx workspai create project fastapi.standard api --yes")),console.log(e$1.gray(` npx workspai workspace run init
|
|
189
188
|
`));return}catch(R){throw f.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
190
|
-
\u274C Error:`),R),R}}{let f=D(),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 x=w,
|
|
189
|
+
\u274C Error:`),R),R}}{let f=D(),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 x=w,k=Be(w);if(j&&!u){console.log(e$1.yellow(`
|
|
191
190
|
\u26A0\uFE0F Python 3.10+ is not detected on this system.
|
|
192
191
|
`)),console.log(e$1.cyan(`You have 3 options:
|
|
193
|
-
`));let{pythonAction:
|
|
192
|
+
`));let{pythonAction:A}=await b$2([{type:"rawlist",name:"pythonAction",message:"What would you like to do?",choices:[{name:"\u{1F4E5} Install Python now (I'll show you the command for your OS)",value:"install"},{name:`\u{1F504} Switch to "${k}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if(A==="cancel"&&(console.log(e$1.cyan(`
|
|
194
193
|
\u{1F4A1} How to install Python:
|
|
195
194
|
`)),console.log(e$1.white(" Ubuntu / Debian: sudo apt install python3.10")),console.log(e$1.white(" macOS (Homebrew): brew install python@3.10")),console.log(e$1.white(` Windows: https://python.org/downloads
|
|
196
195
|
`)),console.log(e$1.gray(` After installing Python, run: npx workspai ${r}
|
|
197
|
-
`)),process.exit(1)),
|
|
196
|
+
`)),process.exit(1)),A==="install"){console.log(e$1.cyan(`
|
|
198
197
|
\u{1F4A1} Install Python on your system:
|
|
199
|
-
`));let
|
|
200
|
-
`))
|
|
201
|
-
`))
|
|
198
|
+
`));let $=process.platform;$==="linux"?console.log(e$1.white(` sudo apt update && sudo apt install python3.10 python3.10-venv
|
|
199
|
+
`)):$==="darwin"?console.log(e$1.white(` brew install python@3.10
|
|
200
|
+
`)):$==="win32"&&(console.log(e$1.white(` Download: https://python.org/downloads
|
|
202
201
|
`)),console.log(e$1.white(` Run the installer and check "Add Python to PATH"
|
|
203
202
|
`))),console.log(e$1.gray(` After installing, run: npx workspai ${r}
|
|
204
|
-
`)),process.exit(0);}if(
|
|
205
|
-
\u2705 Switching to "${
|
|
206
|
-
`)),w=
|
|
203
|
+
`)),process.exit(0);}if(A==="fallback"&&(console.log(e$1.green(`
|
|
204
|
+
\u2705 Switching to "${k}" profile (no Python required).
|
|
205
|
+
`)),w=k,ce.has(k))){let $=c$2("Creating workspace",{component:"create",phase:"workspace.python-free"});try{await v.ensureDir(i),$.succeed("Directory created"),await B(i,r,"venv",void 0),await Q(i,r,"venv",void 0,k,{profileRequested:x,bootstrapNote:"python-free-fallback"}),await G(i);let oe={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};await v.outputFile(d.join(i,"README.md"),`# ${r}
|
|
207
206
|
|
|
208
|
-
Workspai **${
|
|
207
|
+
Workspai **${oe[k]}** workspace (switched from ${x} due to missing Python).
|
|
209
208
|
|
|
210
209
|
## Quick start
|
|
211
210
|
|
|
212
211
|
\`\`\`bash
|
|
213
|
-
`+(
|
|
212
|
+
`+(k==="go-only"?`npx workspai create project gofiber.standard my-api
|
|
214
213
|
cd my-api
|
|
215
214
|
npx workspai init
|
|
216
215
|
npx workspai dev
|
|
217
|
-
`:
|
|
216
|
+
`:k==="java-only"?`npx workspai create project springboot.standard my-service
|
|
218
217
|
cd my-service
|
|
219
218
|
npx workspai init
|
|
220
219
|
npx workspai dev
|
|
221
|
-
`:
|
|
220
|
+
`:k==="dotnet-only"?`npx workspai create project dotnet.webapi.clean my-api
|
|
222
221
|
cd my-api
|
|
223
222
|
npx workspai init
|
|
224
223
|
npx workspai dev
|
|
225
|
-
`:
|
|
224
|
+
`:k==="node-only"?`npx workspai create project nestjs.standard my-app
|
|
226
225
|
cd my-app
|
|
227
226
|
npx workspai init
|
|
228
227
|
npx workspai dev
|
|
@@ -230,37 +229,37 @@ npx workspai dev
|
|
|
230
229
|
cd <project-name>
|
|
231
230
|
npx workspai init
|
|
232
231
|
npx workspai dev
|
|
233
|
-
`)+"```\n","utf-8")
|
|
232
|
+
`)+"```\n","utf-8"),n||await J(i,$,`Initial commit: Workspai workspace (${k} profile)`),await V(i,{workspaceName:r,silent:a}),console.log(e$1.green(`
|
|
234
233
|
\u2728 Workspace created with fallback profile!
|
|
235
234
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan(`
|
|
236
235
|
\u{1F680} Get started:
|
|
237
236
|
`)),console.log(e$1.white(` ${f$1(i)}`)),console.log(e$1.white(" npx workspai create project")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
238
237
|
`)),console.log(e$1.cyan(`\u{1F4A1} To use Python later:
|
|
239
238
|
`)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: workspai bootstrap --profile ${x}
|
|
240
|
-
`)),console.log("");return}catch(
|
|
241
|
-
\u274C Error:`),
|
|
242
|
-
\u26A0\uFE0F Python not detected. Auto-switching to "${
|
|
243
|
-
`)),w=
|
|
239
|
+
`)),console.log("");return}catch(oe){throw $.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
240
|
+
\u274C Error:`),oe),oe}}}else if(console.log(e$1.yellow(`
|
|
241
|
+
\u26A0\uFE0F Python not detected. Auto-switching to "${k}" profile (no Python required).
|
|
242
|
+
`)),w=k,ce.has(k)){let A=c$2("Creating workspace",{component:"create",phase:"workspace.python-free"});try{await v.ensureDir(i),A.succeed("Directory created"),await B(i,r,"venv",void 0),await Q(i,r,"venv",void 0,k,{profileRequested:x,bootstrapNote:"python-free-fallback"}),await G(i),n||await J(i,A,`Initial commit: Workspai workspace (${k})`),await V(i,{workspaceName:r,silent:a}),console.log(e$1.green(`
|
|
244
243
|
\u2728 Workspace created (auto-fallback profile)!
|
|
245
|
-
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u{1F4E6} Profile:"),e$1.yellow(
|
|
244
|
+
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u{1F4E6} Profile:"),e$1.yellow(k)),console.log(e$1.cyan("\u{1F4A1} Reason:"),e$1.gray(`Python not detected; switched from ${x}`)),console.log(e$1.cyan(`
|
|
246
245
|
\u{1F680} Get started:
|
|
247
246
|
`)),console.log(e$1.white(` ${f$1(i)}`)),console.log(e$1.white(" npx workspai create project")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
248
247
|
`)),console.log(e$1.cyan(`\u{1F4A1} Add Python later:
|
|
249
248
|
`)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: ${f$1(i)} && workspai bootstrap --profile ${x}
|
|
250
|
-
`)),console.log("");return}catch(
|
|
251
|
-
\u274C Error:`)
|
|
249
|
+
`)),console.log("");return}catch($){throw A.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
250
|
+
\u274C Error:`),$),$}}}}f.step(1,3,"Setting up Workspai environment");let _=c$2("Creating directory",{component:"create",phase:"workspace.directory"});try{await v.ensureDir(i),_.succeed("Directory created"),_.start("Detecting Python version");let f$2=null,R=await Ve(I.pythonVersion);if(R)f$2=await Ce(R),f$2?(f.info(` Detected Python ${f$2}`),_.succeed(`Python ${f$2} detected`)):_.warn("Could not detect exact Python version");else {let x=D();f$2=await Ce(x),f$2?_.succeed(`Python ${f$2} detected`):_.warn("Could not detect Python version, proceeding with defaults");}if(I.installMethod==="poetry"&&!await Fe()&&(_.warn("Poetry not found \u2014 auto-fallback to pip + venv"),I.installMethod="venv"),await B(i,r,I.installMethod,f$2||void 0),f$2&&await Je(i,f$2),await Q(i,r,I.installMethod,f$2||I.pythonVersion,w||m),await G(i),await $e(i,r),I.installMethod==="poetry")try{await Le(i,I.pythonVersion,_,a,c,u);}catch(x){let k=x?.details||x?.message||String(x);if(k.includes("pyenv")||k.includes("exit status 127")||k.includes("returned non-zero exit status 127")){_.warn("Poetry encountered Python discovery issues, trying venv method"),f.debug(`Poetry error (attempting venv fallback): ${k}`);try{await ve(i,I.pythonVersion,_,a,c),I.installMethod="venv";}catch(A){throw A}}else throw x}else I.installMethod==="venv"?await ve(i,I.pythonVersion,_,a,c):await Ge(i,_,a,c,u);if(await fe(i,I.installMethod),await He(i,I.installMethod),_.succeed("Workspai environment ready!"),o.skipGit||await J(i,_,"Initial commit: Workspai environment"),await V(i,{workspaceName:r,silent:a}),console.log(e$1.green(`
|
|
252
251
|
\u2728 Workspai environment created successfully!
|
|
253
252
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u2699\uFE0F Configuration:")),console.log(e$1.gray(` \u2022 Profile: ${w}`)),console.log(e$1.gray(` \u2022 Python: ${I.pythonVersion}`)),console.log(e$1.gray(` \u2022 Install method: ${I.installMethod}`)),console.log(e$1.cyan(`
|
|
254
253
|
\u{1F680} Get started:
|
|
255
|
-
`)),console.log(e$1.white(` ${f$1(i)}`)),I.installMethod==="poetry"){let x="source $(poetry env info --path)/bin/activate";try{
|
|
254
|
+
`)),console.log(e$1.white(` ${f$1(i)}`)),I.installMethod==="poetry"){let x="source $(poetry env info --path)/bin/activate";try{U();let{stdout:k}=await execa("poetry",["--version"]),T=k.match(/Poetry.*?(\d+)\.(\d+)/);T&&(parseInt(T[1])>=2?x="source $(poetry env info --path)/bin/activate":x="poetry shell");}catch{}console.log(e$1.white(` ${x} # Or: poetry run rapidkit`)),console.log(e$1.white(" workspai create # Interactive mode")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" workspai init")),console.log(e$1.white(" workspai dev")),console.log(e$1.gray(`
|
|
256
255
|
\u{1F4E6} Why Poetry? Includes dependency management + virtual environment`));}else I.installMethod==="venv"?(console.log(e$1.white(" source .venv/bin/activate # On Windows: .venv\\Scripts\\activate")),console.log(e$1.white(" workspai create # Interactive mode")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" workspai init")),console.log(e$1.white(" workspai dev")),console.log(e$1.gray(`
|
|
257
256
|
\u{1F4E6} Why venv? Standard, zero extra tools, lightweight`))):(console.log(e$1.white(" workspai create # Interactive mode")),console.log(e$1.white(" cd <project-name>")),console.log(e$1.white(" workspai init")),console.log(e$1.white(" workspai dev")),console.log(e$1.gray(`
|
|
258
257
|
\u{1F4E6} Why pipx? Global isolated install, no local venv`)));console.log(e$1.cyan(`
|
|
259
258
|
\u{1F4DA} Next steps:`)),console.log(e$1.gray(" 1. Check README.md for workspace details")),console.log(e$1.gray(" 2. Create your first project: workspai create project")),console.log(e$1.gray(" 3. See all runtimes: workspai list # Shows: fastapi, nestjs, springboot, gofiber, gogin, dotnet")),console.log(e$1.cyan(`
|
|
260
259
|
\u{1F4A1} Profile management:`)),console.log(e$1.gray(" \u2022 Add Python? \u2192 workspai bootstrap --profile python-only|polyglot")),console.log(e$1.gray(" \u2022 Add Node.js? \u2192 workspai bootstrap --profile node-only|polyglot")),console.log(e$1.gray(" \u2022 Add Go? \u2192 workspai bootstrap --profile go-only|polyglot")),console.log(e$1.gray(" \u2022 Add .NET? \u2192 workspai bootstrap --profile dotnet-only|polyglot")),console.log(e$1.gray(" \u2022 Full setup? \u2192 workspai bootstrap --profile enterprise")),console.log(e$1.cyan(`
|
|
261
260
|
\u{1F4D6} Common commands:`)),console.log(e$1.white(" workspai create - Create a new project (interactive)")),console.log(e$1.white(" workspai list - List available kits")),console.log(e$1.white(" workspai modules - List available modules")),console.log(e$1.white(" workspai doctor - Check workspace health")),console.log(e$1.white(` workspai bootstrap --help - Advanced workspace configuration
|
|
262
|
-
`));try{let{stdout:x}=await execa("go",["version"],{timeout:3e3}),
|
|
263
|
-
\u274C Error:`),f);try{await
|
|
261
|
+
`));try{let{stdout:x}=await execa("go",["version"],{timeout:3e3}),k=x.match(/go version go(\d+\.\d+(?:\.\d+)?)/),T=k?k[1]:"unknown";console.log(e$1.gray(`\u{1F439} Go ${T} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(e$1.yellow("\u26A0\uFE0F Go not installed \u2014 needed for gofiber.standard/gogin.standard projects")),console.log(e$1.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(f){_.fail("Failed to create Workspai environment"),console.error(e$1.red(`
|
|
262
|
+
\u274C Error:`),f);try{await v.remove(i);}catch{}throw f}}async function Ve(t){let o=[];if(!b$3())try{let{stdout:l}=await execa("pyenv",["which","python"]),p=l.trim();p&&o.push(p);}catch{}let n=Number(t.split(".")[1]),s=j(n,10).map(l=>l.command).filter(Boolean);o.push(`python${t}`,...s,...i());let a=[...new Set(o)];for(let l of a)try{let p=l==="py"?["-3","--version"]:["--version"],u=l==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:c}=await execa(l,p,{timeout:2e3}),h=c.match(/Python (\d+\.\d+)/)?.[1];if(h&&X(h,t))return await execa(l,u,{timeout:2e3}),l}catch{continue}return null}async function Le(t,o,n,s,a,l$1=false){await tt(n,l$1),n.start("Finding Python interpreter");let p=await Ve(o);p?(f.debug(`Found working Python: ${p}`),n.succeed("Python found")):n.warn("Could not verify Python path, proceeding with default"),n.start("Initializing Poetry project");let u=d.join(t,"pyproject.toml"),h=(await v.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:t}),n.succeed("Poetry project initialized");let i=await promises.readFile(u,"utf-8");i.includes("[tool.poetry]")?i=i.replace("[tool.poetry]",`[tool.poetry]
|
|
264
263
|
package-mode = false`):i.includes("[project]")&&(i.includes("[build-system]")?i=i.replace("[build-system]",`
|
|
265
264
|
[tool.poetry]
|
|
266
265
|
package-mode = false
|
|
@@ -269,33 +268,33 @@ package-mode = false
|
|
|
269
268
|
|
|
270
269
|
[tool.poetry]
|
|
271
270
|
package-mode = false
|
|
272
|
-
`),await promises.writeFile(u,i,"utf-8");}n.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:t}),n.succeed("Poetry configured");}catch{n.warn("Could not configure Poetry virtualenvs.in-project");}n.start("Creating virtualenv");let
|
|
271
|
+
`),await promises.writeFile(u,i,"utf-8");}n.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:t}),n.succeed("Poetry configured");}catch{n.warn("Could not configure Poetry virtualenvs.in-project");}n.start("Creating virtualenv");let m=p||D(),g$1=l(d.join(t,".venv"));try{await execa(m,["-m","venv",".venv"],{cwd:t,timeout:6e4}),n.succeed("Virtualenv created");}catch(r){f.debug(`python -m venv failed: ${r}`),n.warn("Could not pre-create virtualenv, Poetry will try"),g$1=p||D();}try{await execa("poetry",["env","use",g$1||D()],{cwd:t}),f.debug(`Poetry env set to: ${g$1}`);}catch(r){f.debug(`Could not set Poetry env: ${r}`);}if(n.start("Installing RapidKit"),h&&!s){let r=e$2(a||{}),i=r?await v.pathExists(r):false,P=i&&r?r:"rapidkit-core";r&&!i&&f.warn(`WORKSPAI_DEV_PATH/RAPIDKIT_DEV_PATH points to a path that does not exist: ${r}. Falling back to PyPI.`),n.text=i?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let w=false,j=null;for(let E=1;E<=3;E++)try{i||e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:E,maxAttempts:3}),await execa(g$1,["-m","pip","install",P,"--quiet"],{cwd:t,timeout:18e4}),w=true,i||e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:E,maxAttempts:3});break}catch(W){j=W,f.debug(`pip install rapidkit-core attempt ${E} failed: ${W}`),E<3&&(n.text=`Retrying installation (attempt ${E+1}/3)`,await new Promise(se=>setTimeout(se,2e3)));}if(!w){let E=j?.stderr||j?.message||"Unknown error";throw f.debug(`All pip install attempts failed. Last error: ${E}`),E.includes("Could not find")||E.includes("No matching distribution")?new g:new f$2("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
273
272
|
Error: ${E}
|
|
274
273
|
|
|
275
274
|
Possible solutions:
|
|
276
275
|
1. Check your internet connection
|
|
277
|
-
2. Try installing manually: cd ${
|
|
278
|
-
3. Use venv method instead: npx workspai ${
|
|
276
|
+
2. Try installing manually: cd ${d.basename(t)} && poetry add rapidkit-core
|
|
277
|
+
3. Use venv method instead: npx workspai ${d.basename(t)} --install-method=venv`))}}else {n.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:12e4}),n.succeed("Poetry environment synced");}catch(r){f.debug(`poetry install --no-root failed: ${r}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),s){let r=e$2(a||{});if(!r)throw new f$2("Test mode installation",new Error("No local RapidKit path configured. Set WORKSPAI_DEV_PATH (or legacy RAPIDKIT_DEV_PATH)."));f.debug(`Installing from local path: ${r}`),n.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",r],{cwd:t});}else {n.text="Installing RapidKit from PyPI";let r=false,i=null;for(let P=1;P<=3;P++)try{e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:P,maxAttempts:3}),await execa("poetry",["add","rapidkit-core"],{cwd:t,timeout:6e4*P}),r=true,e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:P,maxAttempts:3});break}catch(w){i=w,f.debug(`Poetry add attempt ${P} failed: ${w}`),P<3&&(n.text=`Retrying installation (attempt ${P+1}/3)`,await new Promise(j=>setTimeout(j,2e3)));}if(!r){let P=i?.stderr||i?.message||"Unknown error";throw f.debug(`All Poetry install attempts failed. Last error: ${P}`),P.includes("Could not find")||P.includes("No matching distribution")?new g:new f$2("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
279
278
|
Error: ${P}
|
|
280
279
|
|
|
281
280
|
Possible solutions:
|
|
282
281
|
1. Check your internet connection
|
|
283
|
-
2. Try installing manually: cd ${
|
|
284
|
-
3. Use venv method instead: npx workspai ${
|
|
282
|
+
2. Try installing manually: cd ${d.basename(t)} && poetry add rapidkit-core
|
|
283
|
+
3. Use venv method instead: npx workspai ${d.basename(t)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:r}=await import('./pythonRapidkitExec-UJYIB6FL.js');if(!await r()&&!s){n.start("Checking optional global pipx installation");let P=await re(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await H(P,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(w){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),f.debug(`pipx install failed: ${w}`);}}}catch(r){n.succeed("Skipped optional global pipx installation"),f.debug(`Global install check skipped: ${r}`);}}async function ve(t,o,n,s,a,l$1=false){n.start(`Checking Python ${o}`);let p=D();try{let{stdout:c}=await execa(p,["--version"]),h=c.match(/Python (\d+\.\d+)/)?.[1];if(h&&!X(h,o))throw new b$4(o,h);n.succeed(`Python ${h} found`);}catch(c){throw c instanceof b$4?c:new b$4(o)}n.start("Creating virtual environment");try{await execa(p,["-m","venv",".venv"],{cwd:t}),n.succeed("Virtual environment created");}catch(c){if(n.fail("Failed to create virtual environment"),(m=>typeof m=="object"&&m!==null&&"stdout"in m&&typeof m.stdout=="string")(c)&&c.stdout.includes("ensurepip is not")){let m=c.stdout.match(/apt install (python[\d.]+-venv)/),g=m?m[1]:"python3-venv";throw new f$2("Python venv module not available",new Error(`Virtual environment creation failed.
|
|
285
284
|
|
|
286
285
|
On Debian/Ubuntu systems, install the venv package:
|
|
287
|
-
sudo apt install ${
|
|
286
|
+
sudo apt install ${g}
|
|
288
287
|
|
|
289
288
|
Or use Poetry instead (recommended):
|
|
290
|
-
npx workspai ${
|
|
291
|
-
Error: ${
|
|
289
|
+
npx workspai ${d.basename(t)} --yes`))}throw new f$2("Virtual environment creation",c instanceof Error?c:new Error(String(c)))}n.start("Installing RapidKit");let u=l(d.join(t,".venv"));if(await execa(u,["-m","pip","install","--upgrade","pip"],{cwd:t}),s){let c=e$2(a||{});if(!c)throw new f$2("Test mode installation",new Error("No local RapidKit path configured. Set WORKSPAI_DEV_PATH (or legacy RAPIDKIT_DEV_PATH)."));f.debug(`Installing from local path: ${c}`),n.text="Installing RapidKit from local path (test mode)",await execa(u,["-m","pip","install","-e",c],{cwd:t});}else {n.text="Installing RapidKit from PyPI";let c=false,h=null;for(let m=1;m<=3;m++)try{e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"venv",attempt:m,maxAttempts:3}),await execa(u,["-m","pip","install","rapidkit-core"],{cwd:t,timeout:6e4*m}),c=true,e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"venv",attempt:m,maxAttempts:3});break}catch(g){h=g,f.debug(`pip install attempt ${m} failed: ${g}`),m<3&&(n.text=`Retrying installation (attempt ${m+1}/3)`,await new Promise(r=>setTimeout(r,2e3)));}if(!c){let m=h?.stderr||h?.message||"Unknown error";throw f.debug(`All pip install attempts failed. Last error: ${m}`),m.includes("Could not find")||m.includes("No matching distribution")?new g:new f$2("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
290
|
+
Error: ${m}
|
|
292
291
|
|
|
293
292
|
Possible solutions:
|
|
294
293
|
1. Check your internet connection
|
|
295
|
-
2. Try installing manually: cd ${
|
|
296
|
-
3. Use Poetry instead: npx workspai ${
|
|
297
|
-
`,"utf-8");return}u.reason==="constraint-missing"?o.warn('Version-aware global reuse skipped: no explicit rapidkit-core version constraint found. Set RAPIDKIT_CORE_PYTHON_PACKAGE (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core>=0.4.0,<0.9.0") to enable version-aware reuse. Proceeding with pipx install/upgrade.'):u.reason==="constraint-unsupported"&&o.warn('Version-aware global reuse skipped: RAPIDKIT_CORE_PYTHON_PACKAGE uses an unsupported spec (path/url/git). Use a version range instead (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core==0.4.0" or "rapidkit-core>=0.4.0,<0.9.0"). Proceeding with pipx install/upgrade.'),f.debug(`Global RapidKit install is not reusable via version-aware policy (reason=${u.reason}, installed=${u.installedVersion??"unknown"}, expected=${u.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(
|
|
298
|
-
`,"utf-8");}async function
|
|
294
|
+
2. Try installing manually: cd ${d.basename(t)} && ${l(".venv")} -m pip install rapidkit-core
|
|
295
|
+
3. Use Poetry instead: npx workspai ${d.basename(t)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:c}=await import('./pythonRapidkitExec-UJYIB6FL.js');if(!await c()&&!s){n.start("Checking optional global pipx installation");let m=await re(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await H(m,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(g){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),f.debug(`pipx install failed: ${g}`);}}}catch(c){n.succeed("Skipped optional global pipx installation"),f.debug(`Global install check skipped: ${c}`);}}async function Ge(t,o,n,s,a=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:p}=await import('./pythonRapidkitExec-UJYIB6FL.js'),u=await p();if(u.isCompatible){o.succeed(`RapidKit ${u.installedVersion??""} already compatible globally; skipping pipx installation`),await v.outputFile(d.join(t,".rapidkit-global"),`RapidKit already available globally (version ${u.installedVersion??"unknown"}) and satisfies expected constraint ${u.expectedConstraint??"n/a"}; workspace will reuse the existing installation
|
|
296
|
+
`,"utf-8");return}u.reason==="constraint-missing"?o.warn('Version-aware global reuse skipped: no explicit rapidkit-core version constraint found. Set RAPIDKIT_CORE_PYTHON_PACKAGE (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core>=0.4.0,<0.9.0") to enable version-aware reuse. Proceeding with pipx install/upgrade.'):u.reason==="constraint-unsupported"&&o.warn('Version-aware global reuse skipped: RAPIDKIT_CORE_PYTHON_PACKAGE uses an unsupported spec (path/url/git). Use a version range instead (example: RAPIDKIT_CORE_PYTHON_PACKAGE="rapidkit-core==0.4.0" or "rapidkit-core>=0.4.0,<0.9.0"). Proceeding with pipx install/upgrade.'),f.debug(`Global RapidKit install is not reusable via version-aware policy (reason=${u.reason}, installed=${u.installedVersion??"unknown"}, expected=${u.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(p){f.debug(`Global RapidKit version-aware check failed before pipx install: ${p}`);}let l=await re(o,a);if(o.start("Installing RapidKit globally with pipx"),n){let p=e$2(s||{});if(!p)throw new f$2("Test mode installation",new Error("No local RapidKit path configured. Set WORKSPAI_DEV_PATH (or legacy RAPIDKIT_DEV_PATH)."));f.debug(`Installing from local path: ${p}`),o.text="Installing RapidKit from local path (test mode)",await H(l,["install","-e",p]);}else {o.text="Installing RapidKit from PyPI",e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"pipx"});try{await H(l,["install","rapidkit-core"]),e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"pipx"});}catch(p){try{o.text="RapidKit already installed globally, upgrading to match expected version",await H(l,["upgrade","rapidkit-core"]),e$3({status:"succeeded",message:"RapidKit upgraded from PyPI",installMethod:"pipx"});}catch(u){throw f.debug(`pipx install/upgrade failed: install=${p}, upgrade=${u}`),new g}}}o.succeed("RapidKit installed globally"),await v.outputFile(d.join(t,".rapidkit-global"),`RapidKit installed globally with pipx
|
|
297
|
+
`,"utf-8");}async function Mt(t,o){let{skipGit:n=false,testMode:s=false,userConfig:a={},yes:l=false,installMethod:p,pythonVersion:u="3.10"}=o||{},c=p||a.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return f.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),h=c==="poetry"&&!await Fe()?"venv":c;await B(t,d.basename(t),h),await G(t),await Q(t,d.basename(t),h,u,o?.profile);let m=c$2("Registering workspace",{component:"create",phase:"workspace.register"});try{h==="poetry"?(await $e(t,d.basename(t)),await Le(t,u,m,s,a,l)):h==="venv"?await ve(t,u,m,s,a):await Ge(t,m,s,a,l),await fe(t,h),await He(t,h),m.succeed("Workspace registered"),await V(t,{workspaceName:d.basename(t),silent:s}),n||await J(t,m,"Initial commit: Workspai workspace");}catch(g){throw m.fail("Failed to register workspace"),g}}async function He(t,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
|
|
299
298
|
# Or simply use: poetry run rapidkit <command>`:o==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)",s=o==="poetry"?`# No activation needed (recommended):
|
|
300
299
|
./rapidkit --help
|
|
301
300
|
# or:
|
|
@@ -406,7 +405,7 @@ If you encounter issues:
|
|
|
406
405
|
2. Check Workspai installation: \`workspai --version\`
|
|
407
406
|
3. Run diagnostics: \`workspai doctor\`
|
|
408
407
|
4. Visit Workspai documentation or GitHub issues
|
|
409
|
-
`;await promises.writeFile(
|
|
408
|
+
`;await promises.writeFile(d.join(t,"README.md"),l,"utf-8");}async function it(t,o,n){let s=c$2("Creating demo workspace",{component:"create",phase:"workspace.demo"});try{await v.ensureDir(t),s.succeed("Directory created"),s.start("Setting up demo kit generator");let a=JSON.stringify({name:`${o}-workspace`,version:"1.0.0",private:true,description:"Workspai demo workspace",scripts:{generate:"node generate-demo.js"}},null,2);await promises.writeFile(d.join(t,"package.json"),a,"utf-8"),await promises.writeFile(d.join(t,"generate-demo.js"),`#!/usr/bin/env node
|
|
410
409
|
/**
|
|
411
410
|
* Demo Kit Generator - Create FastAPI demo projects
|
|
412
411
|
*
|
|
@@ -804,7 +803,7 @@ venv/
|
|
|
804
803
|
}
|
|
805
804
|
|
|
806
805
|
main().catch(console.error);
|
|
807
|
-
`,"utf-8");try{await execa("chmod",["+x",
|
|
806
|
+
`,"utf-8");try{await execa("chmod",["+x",d.join(t,"generate-demo.js")]);}catch{}let p=`# Workspai Demo Workspace
|
|
808
807
|
|
|
809
808
|
Welcome to your Workspai demo workspace! This environment lets you generate FastAPI demo projects using bundled Workspai templates, without needing to install Python RapidKit Core.
|
|
810
809
|
|
|
@@ -891,7 +890,7 @@ ${o}/
|
|
|
891
890
|
---
|
|
892
891
|
|
|
893
892
|
**Generated with Workspai** | [GitHub](https://github.com/rapidkitlabs/workspai)
|
|
894
|
-
`;if(await promises.writeFile(
|
|
893
|
+
`;if(await promises.writeFile(d.join(t,"README.md"),p,"utf-8"),s.succeed("Demo workspace setup complete"),!n)if(await Ae(t))s.warn("Git initialization skipped because target is already inside a git worktree");else {s.start("Initializing git repository");try{await execa("git",["init"],{cwd:t,env:a$1()}),await v.outputFile(d.join(t,".gitignore"),`# Dependencies
|
|
895
894
|
node_modules/
|
|
896
895
|
|
|
897
896
|
# Generated projects
|
|
@@ -904,17 +903,17 @@ __pycache__/
|
|
|
904
903
|
*.pyc
|
|
905
904
|
.venv/
|
|
906
905
|
.env
|
|
907
|
-
`,"utf-8"),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:t}),s.succeed("Git repository initialized");}catch{s.warn("Could not initialize git repository");}}console.log(e$1.green(`
|
|
906
|
+
`,"utf-8"),await execa("git",["add","."],{cwd:t,env:a$1()}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:t,env:a$1()}),s.succeed("Git repository initialized");}catch{s.warn("Could not initialize git repository");}}console.log(e$1.green(`
|
|
908
907
|
\u2728 Demo workspace created successfully!
|
|
909
908
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(t)),console.log(e$1.cyan(`\u{1F680} Get started:
|
|
910
|
-
`)),console.log(e$1.white(` ${f$1(t)}`)),console.log(e$1.white(" node generate-demo.js my-api")),console.log(e$1.white(" cd my-api")),console.log(e$1.white(" workspai init")),console.log(e$1.white(" workspai dev")),console.log(),console.log(e$1.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For Python engine features:"),console.log(e$1.cyan(" pipx install rapidkit")),console.log();}catch(a){throw s.fail("Failed to create demo workspace"),a}}async function
|
|
909
|
+
`)),console.log(e$1.white(` ${f$1(t)}`)),console.log(e$1.white(" node generate-demo.js my-api")),console.log(e$1.white(" cd my-api")),console.log(e$1.white(" workspai init")),console.log(e$1.white(" workspai dev")),console.log(),console.log(e$1.yellow("\u{1F4A1} Note:"),"This is a demo workspace. For Python engine features:"),console.log(e$1.cyan(" pipx install rapidkit")),console.log();}catch(a){throw s.fail("Failed to create demo workspace"),a}}async function at(t,o,n,s,a,l,p){if(console.log(e$1.cyan(`
|
|
911
910
|
\u{1F50D} Dry-run mode - what would be created:
|
|
912
911
|
`)),console.log(e$1.white("\u{1F4C2} Workspace path:"),t),console.log(e$1.white("\u{1F4DB} Name:"),e$1.cyan(o)),n)console.log(e$1.white("\u{1F4E6} Type:"),"Demo environment"),console.log(e$1.white(`
|
|
913
912
|
\u{1F4DD} Files to create:`)),console.log(e$1.gray(" - package.json")),console.log(e$1.gray(" - generate-demo.js (project generator)")),console.log(e$1.gray(" - README.md")),console.log(e$1.gray(" - .gitignore")),console.log(e$1.white(`
|
|
914
|
-
\u{1F3AF} Capabilities:`)),console.log(e$1.gray(" - Generate FastAPI/NestJS demo projects")),console.log(e$1.gray(" - No Python RapidKit installation required")),console.log(e$1.gray(" - Bundled templates"));else {let u=a||"minimal",
|
|
915
|
-
\u{1F4CB} Files to create:`)),console.log(e$1.gray(" - .workspai-workspace (workspace marker)")),console.log(e$1.gray(" - .workspai/ (workspace config directory)")),console.log(e$1.gray(" - README.md")),console.log(e$1.gray(" - .gitignore")),
|
|
916
|
-
\u2699\uFE0F Environment setup:`)),
|
|
913
|
+
\u{1F3AF} Capabilities:`)),console.log(e$1.gray(" - Generate FastAPI/NestJS demo projects")),console.log(e$1.gray(" - No Python RapidKit installation required")),console.log(e$1.gray(" - Bundled templates"));else {let u=a||"minimal",c=l,h=p,g=new Set(["python-only","polyglot","enterprise"]).has(u);console.log(e$1.white("\u{1F4E6} Profile:"),e$1.cyan(u)),console.log(e$1.white("\u{1F4DD} Configuration:")),g?(console.log(e$1.gray(` - Python version: ${h}`)),console.log(e$1.gray(` - Install method: ${c}`)),console.log(e$1.gray(` - Git init: ${s.skipGit?"No":"Yes"}`))):(console.log(e$1.gray(" - Python-free profile (no Python needed)")),console.log(e$1.gray(` - Git init: ${s.skipGit?"No":"Yes"}`))),console.log(e$1.white(`
|
|
914
|
+
\u{1F4CB} Files to create:`)),console.log(e$1.gray(" - .workspai-workspace (workspace marker)")),console.log(e$1.gray(" - .workspai/ (workspace config directory)")),console.log(e$1.gray(" - README.md")),console.log(e$1.gray(" - .gitignore")),g&&console.log(e$1.gray(` - ${c==="poetry"?"pyproject.toml + poetry.lock":".venv/ (virtual environment)"}`)),console.log(e$1.white(`
|
|
915
|
+
\u2699\uFE0F Environment setup:`)),g&&console.log(c==="poetry"?e$1.gray(" - Poetry virtual environment created (recommended, includes dependency management)"):c==="venv"?e$1.gray(" - Python venv created in .venv/ (standard, zero extra tools)"):e$1.gray(" - Global pipx install (isolated, not local to workspace)")),console.log(e$1.white(`
|
|
917
916
|
\u{1F680} Next steps:`)),console.log(e$1.gray(` 1. ${f$1(t)}`)),console.log(e$1.gray(" 2. npx workspai create project")),console.log(e$1.gray(" 3. npx workspai init")),console.log(e$1.gray(" 4. npx workspai dev")),console.log(e$1.white(`
|
|
918
917
|
\u{1F4A1} Learn more:`)),console.log(e$1.gray(" \u2022 Change profile later: workspai bootstrap --profile <profile>")),console.log(e$1.gray(" \u2022 Profile options: minimal|java-only|python-only|node-only|go-only|dotnet-only|polyglot|enterprise")),console.log(e$1.gray(" \u2022 Help: npx workspai --help"));}console.log(e$1.white(`
|
|
919
918
|
\u2728 To proceed: remove --dry-run flag
|
|
920
|
-
`));}export{
|
|
919
|
+
`));}export{Se as a,$t as b,Oe as c,Be as d,fe as e,St as f,Mt as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=[{id:"fastapi.standard",aliases:["fastapi","fastapi.standard"],label:"fastapi \u2014 FastAPI Standard Kit",description:"Core-backed FastAPI service scaffold.",owner:"core",runtime:"python",framework:"fastapi",moduleSupport:true,stability:"stable"},{id:"fastapi.ddd",aliases:["fastapi.ddd","fastapi-ddd"],label:"fastapi \u2014 FastAPI DDD Kit",description:"Core-backed FastAPI DDD service scaffold.",owner:"core",runtime:"python",framework:"fastapi",moduleSupport:true,stability:"stable"},{id:"nestjs.standard",aliases:["nestjs","nest","nestjs.standard"],label:"nestjs \u2014 NestJS Standard Kit",description:"Core-backed NestJS service scaffold.",owner:"core",runtime:"node",framework:"nestjs",moduleSupport:true,stability:"stable"},{id:"springboot.standard",aliases:["spring","springboot","springboot.standard","java"],label:"spring \u2014 Spring Boot Standard Kit",description:"npm-backed Spring Boot service scaffold.",owner:"npm",runtime:"java",framework:"springboot",moduleSupport:false,stability:"stable",generator:"springboot",createUsage:"workspai create project springboot.standard <name> [--java-version <major>] [--spring-boot-version <semver>] [--group-id <com.example>] [--package-name <com.example.app>] [--port <number>]"},{id:"gofiber.standard",aliases:["go","go.standard","fiber","gofiber","gofiber.standard","go/fiber"],label:"go/fiber \u2014 Go Fiber Standard Kit",description:"npm-backed Go Fiber service scaffold.",owner:"npm",runtime:"go",framework:"gofiber",moduleSupport:false,stability:"stable",generator:"gofiber",createUsage:"workspai create project gofiber.standard <name> [--output <dir>]"},{id:"gogin.standard",aliases:["gin","gogin","gogin.standard","go/gin"],label:"go/gin \u2014 Go Gin Standard Kit",description:"npm-backed Go Gin service scaffold.",owner:"npm",runtime:"go",framework:"gogin",moduleSupport:false,stability:"stable",generator:"gogin",createUsage:"workspai create project gogin.standard <name> [--output <dir>]"},{id:"dotnet.webapi.clean",aliases:["dotnet","dotnet.webapi","dotnet.webapi.clean","aspnet","aspnetcore","asp.net","asp.net-core","csharp","c#"],label:"dotnet \u2014 ASP.NET Core Clean Web API",description:"npm-backed ASP.NET Core Web API with clean architecture boundaries.",owner:"npm",runtime:"dotnet",framework:"dotnet",moduleSupport:false,stability:"preview",generator:"dotnet-webapi-clean",createUsage:"workspai create project dotnet.webapi.clean <name> [--target-framework net8.0] [--root-namespace <Company.Product>] [--port <number>]"}],i=new Map;for(let t of o){i.set(t.id.toLowerCase(),t);for(let e of t.aliases)i.set(e.toLowerCase(),t);}function s(t){return t?i.get(t.trim().toLowerCase())??null:null}function l(t){return s(t)?.id??t}function g(){return o.filter(t=>t.owner==="core"||t.generator)}function m(t){return s(t)?.owner==="npm"}async function f(t,e){if(!t.generator)throw new Error(`Kit is not backed by an npm generator: ${t.id}`);if(t.generator==="gofiber"){let{generateGoFiberKit:r}=await import('./gofiber-standard-
|
|
1
|
+
var o=[{id:"fastapi.standard",aliases:["fastapi","fastapi.standard"],label:"fastapi \u2014 FastAPI Standard Kit",description:"Core-backed FastAPI service scaffold.",owner:"core",runtime:"python",framework:"fastapi",moduleSupport:true,stability:"stable"},{id:"fastapi.ddd",aliases:["fastapi.ddd","fastapi-ddd"],label:"fastapi \u2014 FastAPI DDD Kit",description:"Core-backed FastAPI DDD service scaffold.",owner:"core",runtime:"python",framework:"fastapi",moduleSupport:true,stability:"stable"},{id:"nestjs.standard",aliases:["nestjs","nest","nestjs.standard"],label:"nestjs \u2014 NestJS Standard Kit",description:"Core-backed NestJS service scaffold.",owner:"core",runtime:"node",framework:"nestjs",moduleSupport:true,stability:"stable"},{id:"springboot.standard",aliases:["spring","springboot","springboot.standard","java"],label:"spring \u2014 Spring Boot Standard Kit",description:"npm-backed Spring Boot service scaffold.",owner:"npm",runtime:"java",framework:"springboot",moduleSupport:false,stability:"stable",generator:"springboot",createUsage:"workspai create project springboot.standard <name> [--java-version <major>] [--spring-boot-version <semver>] [--group-id <com.example>] [--package-name <com.example.app>] [--port <number>]"},{id:"gofiber.standard",aliases:["go","go.standard","fiber","gofiber","gofiber.standard","go/fiber"],label:"go/fiber \u2014 Go Fiber Standard Kit",description:"npm-backed Go Fiber service scaffold.",owner:"npm",runtime:"go",framework:"gofiber",moduleSupport:false,stability:"stable",generator:"gofiber",createUsage:"workspai create project gofiber.standard <name> [--output <dir>]"},{id:"gogin.standard",aliases:["gin","gogin","gogin.standard","go/gin"],label:"go/gin \u2014 Go Gin Standard Kit",description:"npm-backed Go Gin service scaffold.",owner:"npm",runtime:"go",framework:"gogin",moduleSupport:false,stability:"stable",generator:"gogin",createUsage:"workspai create project gogin.standard <name> [--output <dir>]"},{id:"dotnet.webapi.clean",aliases:["dotnet","dotnet.webapi","dotnet.webapi.clean","aspnet","aspnetcore","asp.net","asp.net-core","csharp","c#"],label:"dotnet \u2014 ASP.NET Core Clean Web API",description:"npm-backed ASP.NET Core Web API with clean architecture boundaries.",owner:"npm",runtime:"dotnet",framework:"dotnet",moduleSupport:false,stability:"preview",generator:"dotnet-webapi-clean",createUsage:"workspai create project dotnet.webapi.clean <name> [--target-framework net8.0] [--root-namespace <Company.Product>] [--port <number>]"}],i=new Map;for(let t of o){i.set(t.id.toLowerCase(),t);for(let e of t.aliases)i.set(e.toLowerCase(),t);}function s(t){return t?i.get(t.trim().toLowerCase())??null:null}function l(t){return s(t)?.id??t}function g(){return o.filter(t=>t.owner==="core"||t.generator)}function m(t){return s(t)?.owner==="npm"}async function f(t,e){if(!t.generator)throw new Error(`Kit is not backed by an npm generator: ${t.id}`);if(t.generator==="gofiber"){let{generateGoFiberKit:r}=await import('./gofiber-standard-B6UK5GR7.js');await r(e.projectPath,{project_name:e.projectName,module_path:e.projectName,skipGit:e.skipGit,skipInstall:e.skipInstall});return}if(t.generator==="gogin"){let{generateGoGinKit:r}=await import('./gogin-standard-BXU44VEM.js');await r(e.projectPath,{project_name:e.projectName,module_path:e.projectName,skipGit:e.skipGit,skipInstall:e.skipInstall});return}if(t.generator==="springboot"){let{generateSpringBootKit:r}=await import('./springboot-standard-PEHDKH2L.js');await r(e.projectPath,{project_name:e.projectName,artifact_id:e.projectName,java_version:a(e.args,"--java-version")?.trim(),spring_boot_version:a(e.args,"--spring-boot-version")?.trim(),springdoc_version:a(e.args,"--springdoc-version")?.trim(),group_id:a(e.args,"--group-id")?.trim(),package_name:a(e.args,"--package-name")?.trim(),description:a(e.args,"--description")?.trim(),port:a(e.args,"--port")?.trim(),skipGit:e.skipGit,skipInstall:e.skipInstall});return}if(t.generator==="dotnet-webapi-clean"){let{generateDotnetWebApiCleanKit:r}=await import('./dotnet-webapi-clean-BYUUHX5Y.js');await r(e.projectPath,{project_name:e.projectName,target_framework:a(e.args,"--target-framework")?.trim(),root_namespace:a(e.args,"--root-namespace")?.trim(),description:a(e.args,"--description")?.trim(),port:a(e.args,"--port")?.trim(),skipGit:e.skipGit,skipInstall:e.skipInstall});return}throw new Error(`Unhandled npm kit generator: ${t.generator}`)}function a(t,e){let r=t.indexOf(e);if(r>=0&&r+1<t.length)return t[r+1];let n=t.find(p=>p.startsWith(`${e}=`));return n?n.slice(e.length+1):void 0}export{s as a,l as b,g as c,m as d,f as e};
|