workspai 0.43.0 → 0.43.1
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 +3 -3
- package/contracts/extension-cli-compatibility.v1.json +1 -1
- package/dist/{artifact-remediation-plan-5GJWPPRS.js → artifact-remediation-plan-244S5K6I.js} +3 -3
- package/dist/autopilot-release-45YVOBQO.js +1 -0
- package/dist/chunk-3QVTWKUI.js +4 -0
- package/dist/{chunk-T6OR6YOI.js → chunk-7UZVOYF5.js} +1 -1
- package/dist/{chunk-CVTCPPEF.js → chunk-AMDKXXLP.js} +1 -1
- package/dist/{chunk-EWYYLJQY.js → chunk-CDE4Q77U.js} +1 -1
- package/dist/{chunk-AFSZHLQT.js → chunk-DOCPUNWS.js} +1 -1
- package/dist/{chunk-OJEWQO3Z.js → chunk-EMTQ6OKI.js} +17 -17
- package/dist/{chunk-RE773WOX.js → chunk-FDDDQMJ2.js} +5 -5
- package/dist/{chunk-5SWNSJGW.js → chunk-FHSMY75W.js} +1 -1
- package/dist/chunk-FM7GMFZA.js +2 -0
- package/dist/{chunk-54XJNLYC.js → chunk-HV5ZFXAZ.js} +1 -1
- package/dist/{chunk-LO4C4VXR.js → chunk-LRW2SAGL.js} +1 -1
- package/dist/{chunk-PI5KUXDA.js → chunk-LTWYYP6E.js} +1 -1
- package/dist/{chunk-VRDF2J46.js → chunk-ONU457VN.js} +17 -17
- package/dist/{chunk-LUP4U6EE.js → chunk-P424XYHP.js} +1 -1
- package/dist/{chunk-LPZFK3Y6.js → chunk-PPHTYJ7G.js} +61 -61
- package/dist/{chunk-XEJD4KCV.js → chunk-TH5Y3EMA.js} +1 -1
- package/dist/chunk-TQEMLBAG.js +1 -0
- package/dist/{chunk-3KXW53QI.js → chunk-U6AXYUQY.js} +1 -1
- package/dist/{chunk-AAKUNWPR.js → chunk-UQKCCWUL.js} +43 -43
- package/dist/{chunk-VZKSNUEE.js → chunk-XNGANEXM.js} +1 -1
- package/dist/{create-WRZO4HK2.js → create-42RTNLH2.js} +1 -1
- package/dist/demo-kit-DZ7TPG7K.js +149 -0
- package/dist/doctor-DK4BON3N.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.js +222 -185
- package/dist/pipeline-HQ57V6OZ.js +5 -0
- package/dist/{pythonRapidkitExec-3L3XJBSY.js → pythonRapidkitExec-GCQ3M46E.js} +1 -1
- package/dist/{springboot-standard-OZYF7ZM7.js → springboot-standard-PEHDKH2L.js} +27 -27
- package/dist/{workspace-PR6VZRBG.js → workspace-DZHWB7BV.js} +1 -1
- package/dist/{workspace-agent-sync-KTYF3HQR.js → workspace-agent-sync-5ADIQS7B.js} +1 -1
- package/dist/{workspace-context-QUTOP2XV.js → workspace-context-GEXDHA7A.js} +1 -1
- package/dist/{workspace-contract-XUGMCUSQ.js → workspace-contract-2TA27LGT.js} +1 -1
- package/dist/workspace-explain-D5NNL3NG.js +1 -0
- package/dist/{workspace-foundation-KGSV4E6D.js → workspace-foundation-FQWHPQGX.js} +1 -1
- package/dist/{workspace-intelligence-QJGVL37U.js → workspace-intelligence-BEM6WGCZ.js} +1 -1
- package/dist/{workspace-mcp-serve-AK4MYEHQ.js → workspace-mcp-serve-OMBA5V3C.js} +1 -1
- package/dist/{workspace-model-PNXXOGPO.js → workspace-model-F3B75TYT.js} +1 -1
- package/dist/workspace-registry-summary-6MFBRWDS.js +1 -0
- package/dist/workspace-run-3WJXIQKR.js +1 -0
- package/dist/{workspace-verify-WSDUUTR5.js → workspace-verify-OAATQV5T.js} +1 -1
- package/dist/{workspace-watch-AGPOJ74Q.js → workspace-watch-HU2OTQ52.js} +1 -1
- package/package.json +12 -2
- 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/autopilot-release-QYUOVB26.js +0 -1
- package/dist/chunk-LYC6AIF2.js +0 -2
- package/dist/chunk-WU4ZRRA5.js +0 -4
- 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-explain-JEONEGZZ.js +0 -1
- package/dist/workspace-registry-summary-RUJE6RPH.js +0 -1
- package/dist/workspace-run-Y7YMUIHX.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {f as f$1,e as e$2}from'./chunk-
|
|
1
|
+
import {f as f$1,e as e$2}from'./chunk-DOCPUNWS.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$2}from'./chunk-FDDDQMJ2.js';import {a as a$1,d,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$2}from'./chunk-TQEMLBAG.js';import {b as b$3,j,i,l,h,s}from'./chunk-LZQNVH7D.js';import {b,a,c as c$1,d as d$1}from'./chunk-5XATWNME.js';import {promises}from'fs';import*as v from'fs-extra';import y from'path';import e$1 from'chalk';import {execa}from'execa';async function V(t,o={}){let n=y.resolve(t),s=o.workspaceName??y.basename(n);try{let{registerWorkspace:a}=await import('./workspace-DZHWB7BV.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-2TA27LGT.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(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(y.join(t,".gitignore"),`.venv/
|
|
2
2
|
__pycache__/
|
|
3
3
|
*.pyc
|
|
4
4
|
.env
|
|
@@ -6,9 +6,9 @@ ${c$1}
|
|
|
6
6
|
${d$1}
|
|
7
7
|
${b}/
|
|
8
8
|
|
|
9
|
-
`,"utf-8");}async function
|
|
9
|
+
`,"utf-8");}async function $e(t){try{let o=await execa("git",["rev-parse","--show-toplevel"],{cwd:t,env:a$2()});return o.stdout.trim()?y.resolve(t,o.stdout.trim()):null}catch{return null}}async function J(t,o,n){if(await $e(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$2()}),await execa("git",["add","."],{cwd:t,env:a$2()}),await execa("git",["commit","-m",n],{cwd:t,env:a$2()}),o.succeed("Git repository initialized");}catch{o.warn("Could not initialize git repository");}}async function Se(t,o){let n=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await v.outputFile(y.join(t,"poetry.toml"),`[virtualenvs]
|
|
10
10
|
in-project = true
|
|
11
|
-
`,"utf-8"),await
|
|
11
|
+
`,"utf-8"),await v.outputFile(y.join(t,"pyproject.toml"),`[tool.poetry]
|
|
12
12
|
name = "${n}"
|
|
13
13
|
version = "0.1.0"
|
|
14
14
|
description = "Workspai workspace"
|
|
@@ -22,7 +22,7 @@ rapidkit-core = "*"
|
|
|
22
22
|
[build-system]
|
|
23
23
|
requires = ["poetry-core"]
|
|
24
24
|
build-backend = "poetry.core.masonry.api"
|
|
25
|
-
`,"utf-8");}function
|
|
25
|
+
`,"utf-8");}function Me(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 De(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 Te(){return `version: "1.0"
|
|
26
26
|
mode: warn # "warn" or "strict"
|
|
27
27
|
dependency_sharing_mode: isolated # "isolated" or "shared-runtime-caches" or "shared-node-deps"
|
|
28
28
|
# change profile (recommended): npx workspai bootstrap --profile polyglot
|
|
@@ -31,20 +31,20 @@ rules:
|
|
|
31
31
|
enforce_workspace_marker: true
|
|
32
32
|
enforce_toolchain_lock: false
|
|
33
33
|
disallow_untrusted_tool_sources: false
|
|
34
|
-
`}function
|
|
34
|
+
`}function Ne(){return `version: "1.0"
|
|
35
35
|
cache:
|
|
36
36
|
strategy: shared # "shared" or "on-demand"
|
|
37
37
|
prune_on_bootstrap: false
|
|
38
38
|
self_heal: true
|
|
39
39
|
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
|
|
40
|
+
`}async function Ke(){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 Oe(){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([Ke(),Oe()]),c=[{fileName:"workspace.json",content:Me(o,n,s,a$1,l)},{fileName:"toolchain.lock",content:De(n,s,process.version,p,u,l)},{fileName:"policies.yml",content:Te()},{fileName:"cache-config.yml",content:Ne()}];for(let h of c)await v.outputFile(y.join(t,a,h.fileName),h.content,"utf-8");}async function St(t,o){let{workspaceName:n=y.basename(t),installMethod:s="venv",pythonVersion:a$2,profile:l,writeMarker:p=true,writeGitignore:u=true,onlyIfMissing:c$2=true}=o||{},h=[],[m,g]=await Promise.all([Ke(),Oe()]),r=[{relPath:y.join(a,"workspace.json"),legacyRelPath:y.join(b,"workspace.json"),content:Me(n,s,a$2,l)},{relPath:y.join(a,"toolchain.lock"),legacyRelPath:y.join(b,"toolchain.lock"),content:De(s,a$2,process.version,m,g)},{relPath:y.join(a,"policies.yml"),legacyRelPath:y.join(b,"policies.yml"),content:Te()},{relPath:y.join(a,"cache-config.yml"),legacyRelPath:y.join(b,"cache-config.yml"),content:Ne()}];for(let i of r){let P=y.join(t,i.relPath),w=y.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 a$1(t)||!c$2)){let P=d(n,c(),s);a$2&&(P.metadata||(P.metadata={}),P.metadata.python={pythonVersion:a$2}),await b$1(t,P),h.push(c$1);}if(u){let i=y.join(t,".gitignore");(!c$2||!await v.pathExists(i))&&(await G(t),h.push(".gitignore"));}return h}var We=new Set(["go-only","java-only","dotnet-only","node-only","minimal"]),Be={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"};function Je(t){let o=t,n=new Set;for(;!We.has(o);){if(n.has(o))return "minimal";n.add(o);let s=Be[o];if(!s)return "minimal";o=s;}return o}var L="3.10",Fe=["3.10","3.11","3.12"];async function je(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 Qe(t,o){try{await promises.writeFile(y.join(t,".python-version"),`${o}
|
|
41
|
+
`,"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(y.delimiter).filter(Boolean)];for(let s$1 of s())n.includes(s$1)||n.unshift(s$1);process.env.PATH=n.join(y.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$2;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$2;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
42
|
|
|
43
|
-
Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function
|
|
44
|
-
${r.stderr||""}`);i&&
|
|
45
|
-
${
|
|
43
|
+
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 Xe(t){let o=t.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function Ae(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 Ze(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=Ae(`${r.stdout||""}
|
|
44
|
+
${r.stderr||""}`);i&&X(i,L)&&o.add(i);}catch{}let s=null;try{let g=await execa(D(),["--version"],{timeout:2500}),r=Ae(`${g.stdout||""}
|
|
45
|
+
${g.stderr||""}`);r&&X(r,L)&&(s=r,o.add(r));}catch{}let a=Fe.filter(g=>X(g,L)),l=new Set([...a,...o]),p=Array.from(l).sort((g,r)=>we(r,g)),u=t?Xe(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 et(){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 Ve(){U();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function tt(t,o){return t==="poetry"&&o.poetry?"poetry":t==="pipx"&&o.pipx?"pipx":t==="venv"?"venv":o.poetry?"poetry":"venv"}async function ot(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
46
|
|
|
47
|
-
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function
|
|
47
|
+
Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function nt(t,o={}){let n=t==="poetry",s=o.pythonEngineSkipped?`echo "- Python engine installation was intentionally skipped for this workspace." 1>&2
|
|
48
48
|
echo "- For npm-owned workspace commands, run: npx workspai <command>" 1>&2
|
|
49
49
|
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
50
|
`:`echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
|
|
@@ -80,7 +80,7 @@ ${s}${o.pythonEngineSkipped?"":n?`echo "- If you used Poetry: run 'poetry instal
|
|
|
80
80
|
`:""}${o.pythonEngineSkipped?`echo "Tip: use 'npx workspai workspace model --json' for Workspace Intelligence without the Python engine." 1>&2
|
|
81
81
|
`:`echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
|
|
82
82
|
`}exit 1
|
|
83
|
-
`}function
|
|
83
|
+
`}function it(t,o={}){let n=t==="poetry",s=o.pythonEngineSkipped?`echo - Python engine installation was intentionally skipped for this workspace. 1>&2
|
|
84
84
|
echo - For npm-owned workspace commands, run: npx workspai ^<command^> 1>&2
|
|
85
85
|
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
86
|
`:`echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
|
|
@@ -120,8 +120,8 @@ for %%R in ("%USERPROFILE%\\.local\\bin\\rapidkit.exe" "%APPDATA%\\Python\\Scrip
|
|
|
120
120
|
echo RapidKit launcher could not find a local Python CLI. 1>&2
|
|
121
121
|
${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
122
|
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
|
|
123
|
+
`}async function fe(t,o,n={}){await v.outputFile(y.join(t,"rapidkit"),nt(o,n),{encoding:"utf-8",mode:493}),await v.outputFile(y.join(t,"rapidkit.cmd"),it(o,n),"utf-8");}async function Mt(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?y.resolve(g,r):y.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 rt(i,r,l,c,f,R,x);return}if(l){await at(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,Ye=h||c.defaultInstallMethod||"poetry",le=W?await et():{poetry:true,pipx:true},ke=W?await Ze(se):{choices:Fe.map(f=>({name:f,value:f})),defaultValue:L},qe=tt(Ye,le),ze=[{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:ze,default:qe}]):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(`
|
|
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 ce=We;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(y.join(i,"README.md"),`# ${r}
|
|
125
125
|
|
|
126
126
|
Workspai **${R[w]}** workspace.
|
|
127
127
|
|
|
@@ -148,12 +148,12 @@ npx workspai dev
|
|
|
148
148
|
cd <project-name>
|
|
149
149
|
npx workspai init
|
|
150
150
|
npx workspai dev
|
|
151
|
-
`)+"```\n","utf-8")
|
|
151
|
+
`)+"```\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
152
|
\u2728 Workspace created!
|
|
153
153
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan(`
|
|
154
154
|
\u{1F680} Get started:
|
|
155
155
|
`)),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}),
|
|
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}),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
157
|
\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
158
|
`)),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
159
|
`)),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 +161,7 @@ npx workspai dev
|
|
|
161
161
|
`)),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
162
|
`)),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
163
|
\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
|
|
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 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(y.join(i,"README.md"),`# ${r}
|
|
165
165
|
|
|
166
166
|
Workspai **${x[w]??w}** workspace with Workspace Intelligence enabled and Python engine installation skipped.
|
|
167
167
|
|
|
@@ -179,7 +179,7 @@ npx workspai workspace verify --json
|
|
|
179
179
|
npx workspai create project fastapi.standard api --yes
|
|
180
180
|
npx workspai workspace run init
|
|
181
181
|
\`\`\`
|
|
182
|
-
`,"utf-8")
|
|
182
|
+
`,"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
183
|
\u2728 Workspace created!
|
|
184
184
|
`)),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
185
|
\u{1F680} Get started:
|
|
@@ -187,42 +187,42 @@ npx workspai workspace run init
|
|
|
187
187
|
`)),console.log(e$1.cyan(`\u{1F4A1} Add Python-backed kits/modules later:
|
|
188
188
|
`)),console.log(e$1.gray(" npx workspai create project fastapi.standard api --yes")),console.log(e$1.gray(` npx workspai workspace run init
|
|
189
189
|
`));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,
|
|
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,k=Je(w);if(j&&!u){console.log(e$1.yellow(`
|
|
191
191
|
\u26A0\uFE0F Python 3.10+ is not detected on this system.
|
|
192
192
|
`)),console.log(e$1.cyan(`You have 3 options:
|
|
193
|
-
`));let{pythonAction:
|
|
193
|
+
`));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
194
|
\u{1F4A1} How to install Python:
|
|
195
195
|
`)),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
196
|
`)),console.log(e$1.gray(` After installing Python, run: npx workspai ${r}
|
|
197
|
-
`)),process.exit(1)),
|
|
197
|
+
`)),process.exit(1)),A==="install"){console.log(e$1.cyan(`
|
|
198
198
|
\u{1F4A1} Install Python on your system:
|
|
199
|
-
`));let
|
|
200
|
-
`))
|
|
201
|
-
`))
|
|
199
|
+
`));let $=process.platform;$==="linux"?console.log(e$1.white(` sudo apt update && sudo apt install python3.10 python3.10-venv
|
|
200
|
+
`)):$==="darwin"?console.log(e$1.white(` brew install python@3.10
|
|
201
|
+
`)):$==="win32"&&(console.log(e$1.white(` Download: https://python.org/downloads
|
|
202
202
|
`)),console.log(e$1.white(` Run the installer and check "Add Python to PATH"
|
|
203
203
|
`))),console.log(e$1.gray(` After installing, run: npx workspai ${r}
|
|
204
|
-
`)),process.exit(0);}if(
|
|
205
|
-
\u2705 Switching to "${
|
|
206
|
-
`)),w=
|
|
204
|
+
`)),process.exit(0);}if(A==="fallback"&&(console.log(e$1.green(`
|
|
205
|
+
\u2705 Switching to "${k}" profile (no Python required).
|
|
206
|
+
`)),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(y.join(i,"README.md"),`# ${r}
|
|
207
207
|
|
|
208
|
-
Workspai **${
|
|
208
|
+
Workspai **${oe[k]}** workspace (switched from ${x} due to missing Python).
|
|
209
209
|
|
|
210
210
|
## Quick start
|
|
211
211
|
|
|
212
212
|
\`\`\`bash
|
|
213
|
-
`+(
|
|
213
|
+
`+(k==="go-only"?`npx workspai create project gofiber.standard my-api
|
|
214
214
|
cd my-api
|
|
215
215
|
npx workspai init
|
|
216
216
|
npx workspai dev
|
|
217
|
-
`:
|
|
217
|
+
`:k==="java-only"?`npx workspai create project springboot.standard my-service
|
|
218
218
|
cd my-service
|
|
219
219
|
npx workspai init
|
|
220
220
|
npx workspai dev
|
|
221
|
-
`:
|
|
221
|
+
`:k==="dotnet-only"?`npx workspai create project dotnet.webapi.clean my-api
|
|
222
222
|
cd my-api
|
|
223
223
|
npx workspai init
|
|
224
224
|
npx workspai dev
|
|
225
|
-
`:
|
|
225
|
+
`:k==="node-only"?`npx workspai create project nestjs.standard my-app
|
|
226
226
|
cd my-app
|
|
227
227
|
npx workspai init
|
|
228
228
|
npx workspai dev
|
|
@@ -230,37 +230,37 @@ npx workspai dev
|
|
|
230
230
|
cd <project-name>
|
|
231
231
|
npx workspai init
|
|
232
232
|
npx workspai dev
|
|
233
|
-
`)+"```\n","utf-8")
|
|
233
|
+
`)+"```\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
234
|
\u2728 Workspace created with fallback profile!
|
|
235
235
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan(`
|
|
236
236
|
\u{1F680} Get started:
|
|
237
237
|
`)),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
238
|
`)),console.log(e$1.cyan(`\u{1F4A1} To use Python later:
|
|
239
239
|
`)),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=
|
|
240
|
+
`)),console.log("");return}catch(oe){throw $.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
241
|
+
\u274C Error:`),oe),oe}}}else if(console.log(e$1.yellow(`
|
|
242
|
+
\u26A0\uFE0F Python not detected. Auto-switching to "${k}" profile (no Python required).
|
|
243
|
+
`)),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
244
|
\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(
|
|
245
|
+
`)),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
246
|
\u{1F680} Get started:
|
|
247
247
|
`)),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
248
|
`)),console.log(e$1.cyan(`\u{1F4A1} Add Python later:
|
|
249
249
|
`)),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:`)
|
|
250
|
+
`)),console.log("");return}catch($){throw A.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
251
|
+
\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 Le(I.pythonVersion);if(R)f$2=await je(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 je(x),f$2?_.succeed(`Python ${f$2} detected`):_.warn("Could not detect Python version, proceeding with defaults");}if(I.installMethod==="poetry"&&!await Ve()&&(_.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 Qe(i,f$2),await Q(i,r,I.installMethod,f$2||I.pythonVersion,w||m),await G(i),await Se(i,r),I.installMethod==="poetry")try{await Ge(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 He(i,_,a,c,u);if(await fe(i,I.installMethod),await Ue(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
252
|
\u2728 Workspai environment created successfully!
|
|
253
253
|
`)),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
254
|
\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{
|
|
255
|
+
`)),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
256
|
\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
257
|
\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
258
|
\u{1F4E6} Why pipx? Global isolated install, no local venv`)));console.log(e$1.cyan(`
|
|
259
259
|
\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
260
|
\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
261
|
\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
|
|
262
|
+
`));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(`
|
|
263
|
+
\u274C Error:`),f);try{await v.remove(i);}catch{}throw f}}async function Le(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 Ge(t,o,n,s,a,l$1=false){await ot(n,l$1),n.start("Finding Python interpreter");let p=await Le(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=y.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
264
|
package-mode = false`):i.includes("[project]")&&(i.includes("[build-system]")?i=i.replace("[build-system]",`
|
|
265
265
|
[tool.poetry]
|
|
266
266
|
package-mode = false
|
|
@@ -269,33 +269,33 @@ package-mode = false
|
|
|
269
269
|
|
|
270
270
|
[tool.poetry]
|
|
271
271
|
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
|
|
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 m=p||D(),g$1=l(y.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
273
|
Error: ${E}
|
|
274
274
|
|
|
275
275
|
Possible solutions:
|
|
276
276
|
1. Check your internet connection
|
|
277
277
|
2. Try installing manually: cd ${y.basename(t)} && poetry add rapidkit-core
|
|
278
|
-
3. Use venv method instead: npx workspai ${y.basename(t)} --install-method=venv`))}}else {n.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:12e4}),n.succeed("Poetry environment synced");}catch(r){f.debug(`poetry install --no-root failed: ${r}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),s){let r=e$2(a||{});if(!r)throw new f$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(
|
|
278
|
+
3. Use venv method instead: npx workspai ${y.basename(t)} --install-method=venv`))}}else {n.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:12e4}),n.succeed("Poetry environment synced");}catch(r){f.debug(`poetry install --no-root failed: ${r}`),n.warn("Could not sync Poetry environment, proceeding with add command");}if(n.start("Installing RapidKit"),s){let r=e$2(a||{});if(!r)throw new f$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
279
|
Error: ${P}
|
|
280
280
|
|
|
281
281
|
Possible solutions:
|
|
282
282
|
1. Check your internet connection
|
|
283
283
|
2. Try installing manually: cd ${y.basename(t)} && poetry add rapidkit-core
|
|
284
|
-
3. Use venv method instead: npx workspai ${y.basename(t)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:r}=await import('./pythonRapidkitExec-
|
|
284
|
+
3. Use venv method instead: npx workspai ${y.basename(t)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:r}=await import('./pythonRapidkitExec-GCQ3M46E.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
285
|
|
|
286
286
|
On Debian/Ubuntu systems, install the venv package:
|
|
287
|
-
sudo apt install ${
|
|
287
|
+
sudo apt install ${g}
|
|
288
288
|
|
|
289
289
|
Or use Poetry instead (recommended):
|
|
290
|
-
npx workspai ${y.basename(t)} --yes`))}throw new f$2("Virtual environment creation",
|
|
291
|
-
Error: ${
|
|
290
|
+
npx workspai ${y.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(y.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.
|
|
291
|
+
Error: ${m}
|
|
292
292
|
|
|
293
293
|
Possible solutions:
|
|
294
294
|
1. Check your internet connection
|
|
295
295
|
2. Try installing manually: cd ${y.basename(t)} && ${l(".venv")} -m pip install rapidkit-core
|
|
296
|
-
3. Use Poetry instead: npx workspai ${y.basename(t)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:
|
|
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
|
|
296
|
+
3. Use Poetry instead: npx workspai ${y.basename(t)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:c}=await import('./pythonRapidkitExec-GCQ3M46E.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 He(t,o,n,s,a=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:p}=await import('./pythonRapidkitExec-GCQ3M46E.js'),u=await p();if(u.isCompatible){o.succeed(`RapidKit ${u.installedVersion??""} already compatible globally; skipping pipx installation`),await v.outputFile(y.join(t,".rapidkit-global"),`RapidKit already available globally (version ${u.installedVersion??"unknown"}) and satisfies expected constraint ${u.expectedConstraint??"n/a"}; workspace will reuse the existing installation
|
|
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(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(y.join(t,".rapidkit-global"),`RapidKit installed globally with pipx
|
|
298
|
+
`,"utf-8");}async function Dt(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 Ve()?"venv":c;await B(t,y.basename(t),h),await G(t),await Q(t,y.basename(t),h,u,o?.profile);let m=c$2("Registering workspace",{component:"create",phase:"workspace.register"});try{h==="poetry"?(await Se(t,y.basename(t)),await Ge(t,u,m,s,a,l)):h==="venv"?await ve(t,u,m,s,a):await He(t,m,s,a,l),await fe(t,h),await Ue(t,h),m.succeed("Workspace registered"),await V(t,{workspaceName:y.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 Ue(t,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
|
|
299
299
|
# 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
300
|
./rapidkit --help
|
|
301
301
|
# or:
|
|
@@ -406,7 +406,7 @@ If you encounter issues:
|
|
|
406
406
|
2. Check Workspai installation: \`workspai --version\`
|
|
407
407
|
3. Run diagnostics: \`workspai doctor\`
|
|
408
408
|
4. Visit Workspai documentation or GitHub issues
|
|
409
|
-
`;await promises.writeFile(y.join(t,"README.md"),l,"utf-8");}async function
|
|
409
|
+
`;await promises.writeFile(y.join(t,"README.md"),l,"utf-8");}async function at(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(y.join(t,"package.json"),a,"utf-8"),await promises.writeFile(y.join(t,"generate-demo.js"),`#!/usr/bin/env node
|
|
410
410
|
/**
|
|
411
411
|
* Demo Kit Generator - Create FastAPI demo projects
|
|
412
412
|
*
|
|
@@ -804,7 +804,7 @@ venv/
|
|
|
804
804
|
}
|
|
805
805
|
|
|
806
806
|
main().catch(console.error);
|
|
807
|
-
`,"utf-8");try{await execa("chmod",["+x",y.join(t,"generate-demo.js")]);}catch{}let
|
|
807
|
+
`,"utf-8");try{await execa("chmod",["+x",y.join(t,"generate-demo.js")]);}catch{}let p=`# Workspai Demo Workspace
|
|
808
808
|
|
|
809
809
|
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
810
|
|
|
@@ -891,7 +891,7 @@ ${o}/
|
|
|
891
891
|
---
|
|
892
892
|
|
|
893
893
|
**Generated with Workspai** | [GitHub](https://github.com/rapidkitlabs/workspai)
|
|
894
|
-
`;if(await promises.writeFile(y.join(t,"README.md"),
|
|
894
|
+
`;if(await promises.writeFile(y.join(t,"README.md"),p,"utf-8"),s.succeed("Demo workspace setup complete"),!n)if(await $e(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$2()}),await v.outputFile(y.join(t,".gitignore"),`# Dependencies
|
|
895
895
|
node_modules/
|
|
896
896
|
|
|
897
897
|
# Generated projects
|
|
@@ -904,17 +904,17 @@ __pycache__/
|
|
|
904
904
|
*.pyc
|
|
905
905
|
.venv/
|
|
906
906
|
.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(`
|
|
907
|
+
`,"utf-8"),await execa("git",["add","."],{cwd:t,env:a$2()}),await execa("git",["commit","-m","Initial commit: Demo workspace"],{cwd:t,env:a$2()}),s.succeed("Git repository initialized");}catch{s.warn("Could not initialize git repository");}}console.log(e$1.green(`
|
|
908
908
|
\u2728 Demo workspace created successfully!
|
|
909
909
|
`)),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
|
|
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 rt(t,o,n,s,a,l,p){if(console.log(e$1.cyan(`
|
|
911
911
|
\u{1F50D} Dry-run mode - what would be created:
|
|
912
912
|
`)),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
913
|
\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:`)),
|
|
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",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(`
|
|
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")),g&&console.log(e$1.gray(` - ${c==="poetry"?"pyproject.toml + poetry.lock":".venv/ (virtual environment)"}`)),console.log(e$1.white(`
|
|
916
|
+
\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
917
|
\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
918
|
\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
919
|
\u2728 To proceed: remove --dry-run flag
|
|
920
|
-
`));}export{
|
|
920
|
+
`));}export{Me as a,St as b,We as c,Je as d,fe as e,Mt as f,Dt as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b,c as c$1,d}from'./chunk-
|
|
1
|
+
import {b,c as c$1,d}from'./chunk-CDE4Q77U.js';import {d as d$1}from'./chunk-AMDKXXLP.js';import {b as b$1,f,j as j$1,k as k$1,h,i,l as l$1,m,n as n$2,o,p,q,r,t,v,x,s,u,w as w$1,y,z as z$1,A,B as B$1,C,D,E as E$1,F as F$1,G,a,H,I}from'./chunk-DNAY5ALC.js';import {n as n$1,k as k$2,b as b$2,j as j$2}from'./chunk-FHSMY75W.js';import {j}from'./chunk-XNGANEXM.js';import {c}from'./chunk-NAAQMSO3.js';import n from'path';import k from'fs-extra';var U=["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"];var it="workspace-operational-skill.v1";function ct(e){if(typeof e!="string")return null;let t=e.trim();return !t||t.includes("/")||t.includes("..")?null:t}function Ge(e){let t=ct(e.skillId);if(!t)throw new Error(`Invalid skill id: ${e.skillId}`);return {schemaVersion:it,skillId:t,canonicalPath:H(t),title:e.title,triggers:[...e.triggers].sort((r,o)=>r.localeCompare(o)),requiredReports:[...e.requiredReports].sort((r,o)=>r.localeCompare(o)),scopedProjects:[...e.scopedProjects??[]].sort((r,o)=>r.localeCompare(o)),verificationCommands:[...e.verificationCommands],answerContractSections:[...U],...e.promptStem?{promptStem:e.promptStem}:{},markdown:e.markdown}}var pt="workspace-skills-index.v1";function He(e){let t=[...e.skills].sort((o,c)=>o.skillId.localeCompare(c.skillId)),r=e.inputsHash??b$2({skillIds:t.map(o=>o.skillId),paths:t.map(o=>o.canonicalPath)});return {schemaVersion:pt,generatedAt:e.generatedAt,inputsHash:r,skills:t.map(o=>({skillId:o.skillId,path:o.canonicalPath,schemaVersion:o.schemaVersion,title:o.title}))}}var Me=[".workspai/reports/INDEX.json",b,d$1],lt=[{skillId:"workspai-diagnose-api-failure",title:"Diagnose API failure",triggers:["api failure","500 error","integration test failed","service unreachable"],objective:"Investigate a failing API or service using Workspai evidence before editing application code.",steps:["Read `.workspai/reports/INDEX.json` and identify fail/warn reports for the scoped project.","Read `.workspai/reports/doctor-last-run.json`, `doctor-project-last-run.json`, and project-scoped run evidence if present.","If a fix was requested, read `artifact-remediation-plan-last-run.json` for cross-artifact next steps, then `doctor-remediation-plan-last-run.json` for Doctor-specific file edits.","Map the failure to workspace vs project scope; cite exit codes and blocker messages.","Propose the smallest safe fix (config, env, dependency) with explicit verification commands."]},{skillId:"workspai-release-readiness",title:"Release readiness",triggers:["release","ship","production","readiness gate"],objective:"Assess whether this workspace is release-ready using governed Workspai gates.",steps:["Read `.workspai/reports/release-readiness-last-run.json` and `pipeline-last-run.json`.","Read `.workspai/reports/workspace-verify-last-run.json` for verdict and blocking reasons.","Read `.workspai/reports/artifact-remediation-plan-last-run.json` when a Studio or agent repair path is needed.","List blocking gates first; never claim ready without cited report fields.","Provide one safe next command and a verification checklist."]},{skillId:"workspai-safe-schema-migration",title:"Safe schema migration",triggers:["migration","schema change","database migration","db migrate"],objective:"Plan and verify a schema migration with blast-radius awareness.",steps:["Identify affected projects from workspace model and dependency graph.","Run or review impact/verify evidence for transitive dependents.","Require project-scoped test/build commands before promoting the migration.","Document rollback and verification signals."]},{skillId:"workspai-dependency-upgrade",title:"Dependency upgrade",triggers:["upgrade dependency","bump package","security advisory","outdated deps"],objective:"Upgrade dependencies with graph-aware verification.",steps:["Scope the upgrade to the owning project from workspace model.","Check transitive dependents via workspace graph / impact reports.","Prefer workspace run test/build for affected projects.","Re-run `workspace verify` after evidence refresh."]},{skillId:"workspai-rename-contract",title:"Rename contract safely",triggers:["rename contract","rename event","breaking api","contract change"],objective:"Rename or change a shared contract with consumer awareness.",steps:["Read `.workspai/workspace.contract.json` for publishes/consumes/owns edges.","List all consumer projects before proposing renames.","Update contract file and regenerate workspace model.","Verify contract gate and integration tests for consumers."]}];function z(e){return `npx workspai ${e}`.trim()}function dt(e){let t=[`# ${e.template.title}`,"",`> Workspace: **${e.workspaceName}** \xB7 Skill: \`${e.template.skillId}\``,"","## Objective","",e.template.objective,"","## Triggers","",...e.template.triggers.map(r=>`- ${r}`),"","## Required evidence (read first)","",...Me.map(r=>`- \`${r}\``),"","## Procedure","",...e.template.steps.map((r,o)=>`${o+1}. ${r}`),""];if(e.scopedProjects.length>0&&t.push("## Scoped projects","",...e.scopedProjects.map(r=>`- ${r}`),""),e.contractSummary&&t.push("## Contract context","",e.contractSummary,""),e.verificationCommands.length>0){t.push("## Verification commands (this workspace)","");for(let r of e.verificationCommands)t.push(`- \`${r}\``);t.push("");}return t.push("## Answer contract","","Return: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.","","## Refresh stale evidence","","```bash",z("workspace agent-sync --write --refresh-context"),"```",""),t.join(`
|
|
2
2
|
`)}function ut(e){return e?.safeCommands?.length?e.safeCommands.slice(0,8).map(t=>t.display):[z("workspace verify --json"),z("doctor workspace --json")]}function gt(e){return e?.projects?.length?e.projects.slice(0,12).map(r=>{let o=r.contracts.owns.join(", ")||"none",c=r.contracts.publishes.join(", ")||"none",d=r.contracts.consumes.join(", ")||"none";return `- **${r.slug}**: owns \`${o}\`; publishes \`${c}\`; consumes \`${d}\``}).join(`
|
|
3
3
|
`):void 0}function Ke(e){let t=e.model.workspace.name,r=e.model.projects.map(d=>d.name).sort(),o=ut(e.context??null),c=gt(e.contract??null);return lt.map(d=>{let p=dt({template:d,workspaceName:t,scopedProjects:r,verificationCommands:o,contractSummary:c});return Ge({skillId:d.skillId,title:d.title,triggers:d.triggers,requiredReports:[...Me],scopedProjects:r,verificationCommands:o,promptStem:I[d.skillId],markdown:p})})}async function qe(e){let t=n.resolve(e.workspacePath),r=[],o=b$2({skills:e.skills.map(d=>({id:d.skillId,path:d.canonicalPath,hash:b$2({markdown:d.markdown})}))}),c=He({generatedAt:e.generatedAt,skills:e.skills,inputsHash:o});if(e.write){for(let p of e.skills){let s=n.join(t,p.canonicalPath);await k.ensureDir(n.dirname(s)),await k.writeFile(s,p.markdown,"utf8"),r.push(p.canonicalPath);}let d=n.join(t,b$1);await k.ensureDir(n.dirname(d)),await k.writeJson(d,c,{spaces:2}),r.push(b$1);}return {skills:e.skills,index:c,writtenPaths:r}}function $e(e){return ["## Operational skills (canonical)","","Read workspace-native playbooks from `.workspai/skills/` before generic repo scans. Legacy `.rapidkit/skills/` playbooks are read only when already present from older workspaces:","",...e.skills.map(r=>`- \`${r.path}\` \u2014 ${r.title} (\`${r.skillId}\`)`),"","Regenerate:","","```bash",z("workspace agent-sync --write --refresh-context"),"```",""].join(`
|
|
4
4
|
`)}var kt={"workspai-diagnose-api-failure":p,"workspai-release-readiness":t},Ae="## Workspace verification (hydrated)";function mt(e){let t=[Ae,"","Verification commands for this workspace:","",...e.verificationCommands.length?e.verificationCommands.map(r=>`- \`${r}\``):["- `npx workspai workspace verify --json`"]];return e.scopedProjects.length>0&&t.push("","Scoped projects:","",...e.scopedProjects.map(r=>`- ${r}`)),t.push(""),t.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from'path';import {execa}from'execa';var _=["GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_COMMON_DIR","GIT_CONFIG","GIT_CONFIG_COUNT","GIT_DIR","GIT_GRAFT_FILE","GIT_INDEX_FILE","GIT_NAMESPACE","GIT_OBJECT_DIRECTORY","GIT_PREFIX","GIT_QUARANTINE_PATH","GIT_REPLACE_REF_BASE","GIT_SHALLOW_FILE","GIT_WORK_TREE"];function I(e=process.env){let t={...e};for(let n of _)delete t[n];for(let n of Object.keys(t))(n.startsWith("GIT_CONFIG_KEY_")||n.startsWith("GIT_CONFIG_VALUE_"))&&delete t[n];return t}async function s(e){try{let t=await execa("git",["rev-parse","--show-toplevel"],{cwd:e,env:I()});return t.stdout.trim()?o.resolve(e,t.stdout.trim()):null}catch{return null}}async function c(e){return await s(e)!==null}export{I as a,c as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-FHSMY75W.js';import {a,b as b$1}from'./chunk-S5KTATOU.js';function f(r){let s=new Map;for(let n of r.projects)s.has(n.name)||s.set(n.name,b(n));return s}function j(r){let s=f(r),n=r.graph??{nodes:r.projects.map(t=>({id:t.name,path:t.path})),edges:[]},a$1=a(n),o=new Map;for(let t of n.nodes){let e=s.get(t.id)??b({missing:t.id}),g=[...b$1(a$1,[t.id],{direction:"dependencies"}).keys()].filter(c=>c!==t.id).sort((c,l)=>c.localeCompare(l)).map(c=>({id:c,hash:s.get(c)??"<unknown>"}));o.set(t.id,{id:t.id,ownHash:e,transitiveInputsHash:b({own:e,dependencies:g})});}return o}function v(r,s){if(!s||Object.keys(s).length===0)return {verdict:"unknown",baseline:"none",changed:[],added:[],removed:[]};let n=[],a=[];for(let[e,i]of r.entries())e in s?s[e]!==i.transitiveInputsHash&&n.push(e):a.push(e);let o=[];for(let e of Object.keys(s))r.has(e)||o.push(e);return n.sort((e,i)=>e.localeCompare(i)),a.sort((e,i)=>e.localeCompare(i)),o.sort((e,i)=>e.localeCompare(i)),{verdict:n.length>0||a.length>0||o.length>0?"stale":"fresh",baseline:"recorded",changed:n,added:a,removed:o}}function w(r){let s={};for(let[n,a]of [...r.entries()].sort((o,t)=>o[0].localeCompare(t[0])))s[n]=a.transitiveInputsHash;return s}export{f as a,j as b,v as c,w as d};
|