workspai 0.44.0 → 0.46.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 +243 -513
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +1372 -0
- package/contracts/command-capabilities.v1.json +166 -1
- package/contracts/extension-cli-compatibility.v1.json +4 -2
- package/contracts/published-contract-catalog.v1.json +12 -1
- package/contracts/runtime-command-surface.v1.json +1478 -3
- package/contracts/workspace-archive-capabilities.v1.json +17 -6
- package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +4 -0
- package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +207 -0
- package/contracts/workspace-intelligence-architecture.v1.json +1 -1
- package/contracts/workspace-intelligence-chain.v1.json +37 -1
- package/dist/analyze-BEBEZSZK.js +1 -0
- package/dist/{artifact-remediation-plan-Z7OCSME3.js → artifact-remediation-plan-FFQSESAM.js} +1 -1
- package/dist/autopilot-release-WUR4CQIT.js +1 -0
- package/dist/chunk-2G7FASAO.js +2 -0
- package/dist/{chunk-CL6TGI4Q.js → chunk-4EPHWD27.js} +1 -1
- package/dist/{chunk-J4AICQFB.js → chunk-4LGXSBCN.js} +1 -1
- package/dist/chunk-52PBRX7F.js +1 -0
- package/dist/{chunk-2QOWRBQD.js → chunk-6IIZJQLV.js} +1 -1
- package/dist/{chunk-JICOD2GI.js → chunk-CVHMUSRX.js} +1 -1
- package/dist/{chunk-7UZVOYF5.js → chunk-DIPD72H4.js} +1 -1
- package/dist/chunk-EFYHGCGX.js +2 -0
- package/dist/chunk-EYJ2CQSK.js +1 -0
- package/dist/chunk-FPJNWPKU.js +1 -0
- package/dist/{chunk-JP25YL3J.js → chunk-FTY7GGXJ.js} +2 -2
- package/dist/chunk-FWRXA435.js +2 -0
- package/dist/chunk-FXQJX34Z.js +1 -0
- package/dist/chunk-HDURFXW5.js +2 -0
- package/dist/chunk-HMUKBW2S.js +4 -0
- package/dist/{chunk-OW4UNG27.js → chunk-J5PIZCAU.js} +92 -78
- package/dist/{chunk-P4SWTY5X.js → chunk-K4WNYXKK.js} +7 -7
- package/dist/chunk-MER6ZBN2.js +13 -0
- package/dist/chunk-N7DV5L7C.js +1 -0
- package/dist/{chunk-JHC6SCJC.js → chunk-NHN4QXPP.js} +1 -1
- package/dist/{chunk-P424XYHP.js → chunk-PRBVYW3T.js} +1 -1
- package/dist/{chunk-NTXO7BMH.js → chunk-QA5BGEQW.js} +1 -1
- package/dist/chunk-QZLIURER.js +13 -0
- package/dist/{chunk-L3E6IRUQ.js → chunk-RIEF2DDX.js} +1 -1
- package/dist/{chunk-L2Q7B2OJ.js → chunk-SXMTSV5M.js} +1 -1
- package/dist/chunk-SXPY523X.js +1 -0
- package/dist/{chunk-XIVFLY6G.js → chunk-UQWOVV6V.js} +1 -1
- package/dist/chunk-V3LRQZ36.js +1 -0
- package/dist/chunk-VFDM65IE.js +80 -0
- package/dist/{chunk-B66A4TVP.js → chunk-WPEEC5BX.js} +1 -1
- package/dist/chunk-WYFPXTTS.js +2 -0
- package/dist/{chunk-M4VITK6X.js → chunk-YUATNVOT.js} +62 -51
- package/dist/{chunk-7IHLTPZ6.js → chunk-ZKAI3PJE.js} +1 -1
- package/dist/{create-DFAWAS5C.js → create-WCV3L6XH.js} +1 -1
- package/dist/doctor-5BWM2EMJ.js +1 -0
- package/dist/{dotnet-webapi-clean-BYUUHX5Y.js → dotnet-webapi-clean-6TVFBTVI.js} +20 -20
- package/dist/{gofiber-standard-B6UK5GR7.js → gofiber-standard-2BL7GWZB.js} +1 -1
- package/dist/{gogin-standard-BXU44VEM.js → gogin-standard-XGP3KBXA.js} +1 -1
- package/dist/index.d.ts +123 -15
- package/dist/index.js +337 -323
- package/dist/pipeline-ORIWVVYM.js +5 -0
- package/dist/{platform-capabilities-YICBF4FA.js → platform-capabilities-2B4QMZXE.js} +1 -1
- package/dist/{pythonRapidkitExec-UJYIB6FL.js → pythonRapidkitExec-CVCIK225.js} +1 -1
- package/dist/{springboot-standard-PEHDKH2L.js → springboot-standard-JJNUID6M.js} +6 -6
- package/dist/workspace-7OXW5YTJ.js +1 -0
- package/dist/{workspace-agent-sync-ZYCPXTU3.js → workspace-agent-sync-O4IA6VOA.js} +1 -1
- package/dist/workspace-archive-H74NBBNW.js +10 -0
- package/dist/{workspace-context-WAGGJCDL.js → workspace-context-R7IPUBPG.js} +1 -1
- package/dist/workspace-contract-HKCMOMFE.js +1 -0
- package/dist/workspace-explain-GOPQYTPQ.js +1 -0
- package/dist/workspace-explain-contract-SVFJAAEI.js +1 -0
- package/dist/{workspace-feedback-RCB25NFO.js → workspace-feedback-REOS36ZZ.js} +1 -1
- package/dist/{workspace-foundation-KXDL6P6X.js → workspace-foundation-KXT4QI5O.js} +1 -1
- package/dist/{workspace-history-M4QQBIPB.js → workspace-history-OGOVSKZG.js} +1 -1
- package/dist/{workspace-intelligence-QOGD2TZS.js → workspace-intelligence-7IESQSXY.js} +1 -1
- package/dist/workspace-intelligence-runner-6GJ5M4HB.js +1 -0
- package/dist/{workspace-mcp-serve-CEFKEMYG.js → workspace-mcp-serve-FRVWBO36.js} +1 -1
- package/dist/{workspace-model-GMSRBICO.js → workspace-model-PPYX7B4S.js} +1 -1
- package/dist/workspace-python-engine-state-2MLKJYQG.js +2 -0
- package/dist/workspace-registry-summary-SZ46R5PD.js +1 -0
- package/dist/workspace-run-V3KKHTVF.js +1 -0
- package/dist/{workspace-verify-NP4GMFSV.js → workspace-verify-MFQ7IXGD.js} +1 -1
- package/dist/{workspace-watch-IIBH3Y25.js → workspace-watch-SOPZHRWA.js} +1 -1
- package/docs/AI_DYNAMIC_INTEGRATION.md +29 -33
- package/docs/AI_FEATURES.md +18 -27
- package/docs/AI_QUICKSTART.md +7 -4
- package/docs/DEVELOPMENT.md +5 -5
- package/docs/From Code to Shared Understanding.png +0 -0
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +23 -2
- package/docs/OPTIMIZATION_GUIDE.md +19 -51
- package/docs/PACKAGE_MANAGER_POLICY.md +4 -1
- package/docs/README.md +30 -3
- package/docs/SECURITY.md +13 -6
- package/docs/SETUP.md +6 -3
- package/docs/UTILITIES.md +8 -20
- package/docs/WORKSPACE_MARKER_SPEC.md +27 -20
- package/docs/ci-workflows.md +19 -5
- package/docs/commands-reference.md +51 -10
- package/docs/config-file-guide.md +64 -247
- package/docs/contracts/ARTIFACT_CATALOG.md +14 -2
- package/docs/contracts/CLI_LOG_EVENT_STREAM.md +1 -1
- package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +27 -6
- package/docs/contracts/README.md +5 -2
- package/docs/contracts/RUNTIME_ACCEPTANCE_MATRIX.md +4 -4
- package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +14 -10
- package/docs/creating-workspaces-and-projects.md +649 -0
- package/docs/doctor-command.md +5 -4
- package/docs/examples/ci-agent-grounding.yml +16 -10
- package/docs/from-code-to-shared-understanding.md +69 -38
- package/docs/workspace-intelligence-runner.md +186 -0
- package/docs/workspace-operations.md +29 -11
- package/docs/workspace-run.md +4 -1
- package/package.json +10 -8
- package/rapidkit.config.example.cjs +5 -5
- package/scripts/enforce-package-manager.cjs +1 -1
- package/scripts/prepack-enterprise.mjs +8 -0
- package/workspai.config.example.cjs +12 -47
- package/dist/analyze-6OCBM4ID.js +0 -1
- package/dist/autopilot-release-LI2WJCEW.js +0 -1
- package/dist/chunk-2K3GYCPS.js +0 -1
- package/dist/chunk-2QN6BMM7.js +0 -2
- package/dist/chunk-5AKYMAIL.js +0 -1
- package/dist/chunk-5PVEQ6CZ.js +0 -13
- package/dist/chunk-7EIMPQR3.js +0 -1
- package/dist/chunk-7RIWU5TZ.js +0 -1
- package/dist/chunk-FWJV7CCI.js +0 -2
- package/dist/chunk-LGP6WXS2.js +0 -4
- package/dist/chunk-TRMDODFM.js +0 -13
- package/dist/chunk-UNF72FTB.js +0 -1
- package/dist/chunk-V5JN4TDX.js +0 -2
- package/dist/chunk-VA5MRHKM.js +0 -2
- package/dist/chunk-XZGVNGRB.js +0 -1
- package/dist/chunk-YUX4YFGL.js +0 -78
- package/dist/doctor-PVSWDBJL.js +0 -1
- package/dist/imported-projects-registry-FOIE27WT.js +0 -1
- package/dist/pipeline-ND734AJM.js +0 -5
- package/dist/workspace-FQT3QIRS.js +0 -1
- package/dist/workspace-archive-EEGLHZDW.js +0 -10
- package/dist/workspace-contract-SEI4SNSG.js +0 -1
- package/dist/workspace-explain-MVGGRCDN.js +0 -1
- package/dist/workspace-explain-contract-KT757JGQ.js +0 -1
- package/dist/workspace-python-engine-state-MTWIIZPY.js +0 -2
- package/dist/workspace-registry-summary-S52SEJAG.js +0 -1
- package/dist/workspace-run-VC4OUPRF.js +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {f as f$1,e as e$2}from'./chunk-
|
|
1
|
+
import {f as f$1,e as e$2,k,j as j$1}from'./chunk-2G7FASAO.js';import {b as b$3}from'./chunk-NHN4QXPP.js';import {a as a$2}from'./chunk-SXPY523X.js';import {e,g,f as f$2,b as b$5,c as c$3,d as d$2}from'./chunk-MER6ZBN2.js';import {b as b$6}from'./chunk-WYFPXTTS.js';import {d,b as b$2}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$1,a,c as c$1,d as d$1}from'./chunk-5XATWNME.js';import {b as b$4,j,i,l,h,s,r,p as p$1}from'./chunk-EYJ2CQSK.js';import {promises}from'fs';import*as b from'fs-extra';import p from'path';import e$1 from'chalk';import {execa}from'execa';async function G(t,o={}){let n=p.resolve(t),s=o.workspaceName??p.basename(n),{registerWorkspaceStrict:a}=await import('./workspace-7OXW5YTJ.js');await a(n,s);let{syncWorkspaceContract:l}=await import('./workspace-contract-HKCMOMFE.js'),d=await l({workspacePath:n,strict:true});o.silent||console.log(e$1.gray(`\u2139\uFE0F Workspace intelligence synced (contract + registry summary, ${d.contract.projects.length} project(s)).`));}function N(){return h()}var st="transactions";function lt(){return p.join(p$1(),st)}async function Fe(){let t=lt();return await k(t),j$1({journalDirectory:t})}async function Le(t){for(let o of r())await t.captureFile(o);}async function ie(t){let o=await Fe();try{return await Le(o),await o.captureOwnedTree(t),o}catch(n){return F(o,n)}}async function ct(t){let o=await Fe();try{await Le(o),await o.captureOwnedTree(p.join(t,a)),await o.captureOwnedTree(p.join(t,".venv"));let n=[c$1,".gitignore",p.join(a,"workspace.json"),p.join(a,"toolchain.lock"),p.join(a,"policies.yml"),p.join(a,"cache-config.yml"),b$6,a$2,"pyproject.toml","poetry.toml","poetry.lock","rapidkit","rapidkit.cmd","README.md",".rapidkit-global"];for(let s of n)await o.captureFile(p.join(t,s));return o}catch(n){return F(o,n)}}async function B(t){await t.commit(),t.journalPath&&await promises.rm(p.dirname(t.journalPath),{recursive:true,force:true}).catch(o=>f.debug(`Could not remove committed lifecycle journal: ${o}`));}async function F(t,o){try{await t.rollback();}catch(n){throw new AggregateError([o,n],"Workspace lifecycle failed and rollback was incomplete.")}throw o}async function J(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$2(t,l);}async function U(t){await b.outputFile(p.join(t,".gitignore"),`.venv/
|
|
2
2
|
__pycache__/
|
|
3
3
|
*.pyc
|
|
4
4
|
.env
|
|
5
|
-
${d$
|
|
6
|
-
${b}/
|
|
5
|
+
${d$1}
|
|
6
|
+
${b$1}/
|
|
7
7
|
|
|
8
|
-
`,"utf-8");}async function
|
|
8
|
+
`,"utf-8");}async function Ve(t){try{let o=await execa("git",["rev-parse","--show-toplevel"],{cwd:t,env:a$1()});return o.stdout.trim()?p.resolve(t,o.stdout.trim()):null}catch{return null}}async function Q(t,o,n){if(await Ve(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",["-c","user.name=Workspai","-c","user.email=workspai@localhost","commit","-m",n],{cwd:t,env:a$1()}),o.succeed("Git repository initialized");}catch{o.warn("Could not initialize git repository");}}async function Ge(t,o){let n=o.replace(/[^a-z0-9-]/gi,"-").toLowerCase();await b.outputFile(p.join(t,"poetry.toml"),`[virtualenvs]
|
|
9
9
|
in-project = true
|
|
10
|
-
`,"utf-8"),await
|
|
10
|
+
`,"utf-8"),await b.outputFile(p.join(t,"pyproject.toml"),`[tool.poetry]
|
|
11
11
|
name = "${n}"
|
|
12
12
|
version = "0.1.0"
|
|
13
13
|
description = "Workspai workspace"
|
|
@@ -21,7 +21,7 @@ rapidkit-core = "*"
|
|
|
21
21
|
[build-system]
|
|
22
22
|
requires = ["poetry-core"]
|
|
23
23
|
build-backend = "poetry.core.masonry.api"
|
|
24
|
-
`,"utf-8");}function
|
|
24
|
+
`,"utf-8");}function He(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 Ue(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 Ye(){return `version: "1.0"
|
|
25
25
|
mode: warn # "warn" or "strict"
|
|
26
26
|
dependency_sharing_mode: isolated # "isolated" or "shared-runtime-caches" or "shared-node-deps"
|
|
27
27
|
# change profile (recommended): npx workspai bootstrap --profile polyglot
|
|
@@ -30,20 +30,20 @@ rules:
|
|
|
30
30
|
enforce_workspace_marker: true
|
|
31
31
|
enforce_toolchain_lock: false
|
|
32
32
|
disallow_untrusted_tool_sources: false
|
|
33
|
-
`}function
|
|
33
|
+
`}function qe(){return `version: "1.0"
|
|
34
34
|
cache:
|
|
35
35
|
strategy: shared # "shared" or "on-demand"
|
|
36
36
|
prune_on_bootstrap: false
|
|
37
37
|
self_heal: true
|
|
38
38
|
verify_integrity: false
|
|
39
|
-
`}async function
|
|
40
|
-
`,"utf-8"),f.debug(`Created .python-version with ${o}`);}catch(n){f.warn(`Failed to create .python-version: ${n}`);}}function
|
|
39
|
+
`}async function ze(){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 Be(){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 X(t,o,n,s,a$1,l){let[d,y]=await Promise.all([ze(),Be()]),c=[{fileName:"workspace.json",content:He(o,n,s,a$1,l)},{fileName:"toolchain.lock",content:Ue(n,s,process.version,d,y,l)},{fileName:"policies.yml",content:Ye()},{fileName:"cache-config.yml",content:qe()}];for(let h of c)await b.outputFile(p.join(t,a,h.fileName),h.content,"utf-8");}async function Jt(t,o){let{workspaceName:n=p.basename(t),installMethod:s="venv",pythonVersion:a$1,profile:l,writeMarker:d$1=true,writeGitignore:y=true,onlyIfMissing:c$2=true}=o||{},h=[],[g,m]=await Promise.all([ze(),Be()]),r=[{relPath:p.join(a,"workspace.json"),legacyRelPath:p.join(b$1,"workspace.json"),content:He(n,s,a$1,l)},{relPath:p.join(a,"toolchain.lock"),legacyRelPath:p.join(b$1,"toolchain.lock"),content:Ue(s,a$1,process.version,g,m)},{relPath:p.join(a,"policies.yml"),legacyRelPath:p.join(b$1,"policies.yml"),content:Ye()},{relPath:p.join(a,"cache-config.yml"),legacyRelPath:p.join(b$1,"cache-config.yml"),content:qe()}];for(let i of r){let x=p.join(t,i.relPath),w=p.join(t,i.legacyRelPath),A=await b.pathExists(x),I=await b.pathExists(w);c$2&&A||(c$2&&I?(await b.copy(w,x),h.push(i.relPath)):(await b.outputFile(x,i.content,"utf-8"),h.push(i.relPath)));}if(d$1&&(!await b.pathExists(p.join(t,c$1))||!c$2)){let x=d(n,c(),s);a$1&&(x.metadata||(x.metadata={}),x.metadata.python={pythonVersion:a$1}),await b$2(t,x),h.push(c$1);}if(y){let i=p.join(t,".gitignore");(!c$2||!await b.pathExists(i))&&(await U(t),h.push(".gitignore"));}return h}var Je=new Set(["go-only","java-only","dotnet-only","node-only","minimal"]),pt={"python-only":"minimal",polyglot:"node-only",enterprise:"polyglot"};function dt(t){let o=t,n=new Set;for(;!Je.has(o);){if(n.has(o))return "minimal";n.add(o);let s=pt[o];if(!s)return "minimal";o=s;}return o}var H="3.10",Qe=["3.10","3.11","3.12"];async function Oe(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 ut(t,o){try{await promises.writeFile(p.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 q(){let n=[...(process.env.PATH||"").split(p.delimiter).filter(Boolean)];for(let s$1 of s())n.includes(s$1)||n.unshift(s$1);process.env.PATH=n.join(p.delimiter);}async function pe(t,o){q(),t.start("Checking pipx installation");try{return await execa("pipx",["--version"]),t.succeed("pipx found"),{kind:"binary"}}catch{}let n=N();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$3([{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,d=String(l?.stderr||l?.shortMessage||l?.message||"");throw new f$2("Install pipx with python -m pip",a instanceof Error?a:new Error(d))}t.succeed("pipx installed"),q();try{return await execa(n,["-m","pipx","--version"]),{kind:"python-module",pythonCmd:n}}catch(a){let l=a,d=String(l?.stderr||l?.shortMessage||l?.message||"pipx not runnable after install");throw new f$2("Verify pipx after install",new Error(`${d}
|
|
41
41
|
|
|
42
|
-
Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function
|
|
43
|
-
${r.stderr||""}`);i&&
|
|
44
|
-
${
|
|
42
|
+
Try reopening your terminal or run: ${n} -m pipx ensurepath`))}}async function Y(t,o){return t.kind==="binary"?execa("pipx",o):execa(t.pythonCmd,["-m","pipx",...o])}function yt(t){let o=t.match(/^(\d+)\.(\d+)/);return o?`${o[1]}.${o[2]}`:null}function We(t){if(!t)return null;let o=t.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return o?`${o[1]}.${o[2]}`:null}function ve(t,o){let[n,s]=t.split(".").map(d=>Number(d)),[a,l]=o.split(".").map(d=>Number(d));return n!==a?n-a:s-l}function Z(t,o){return ve(t,o)>=0}async function gt(t){let o=new Set,n=j(14,10);for(let m of n)try{let r=await execa(m.command,m.args,{timeout:2500}),i=We(`${r.stdout||""}
|
|
43
|
+
${r.stderr||""}`);i&&Z(i,H)&&o.add(i);}catch{}let s=null;try{let m=await execa(N(),["--version"],{timeout:2500}),r=We(`${m.stdout||""}
|
|
44
|
+
${m.stderr||""}`);r&&Z(r,H)&&(s=r,o.add(r));}catch{}let a=Qe.filter(m=>Z(m,H)),l=new Set([...a,...o]),d=Array.from(l).sort((m,r)=>ve(r,m)),y=t?yt(t):null,c=y&&Z(y,H)?y:s||d[0]||H;return l.has(c)||l.add(c),{choices:Array.from(l).sort((m,r)=>ve(r,m)).map(m=>{let r=[];return m===s&&r.push("current system"),m===H&&r.push("minimum supported"),o.has(m)&&m!==s&&r.push("detected"),{name:r.length>0?`${m} (${r.join(", ")})`:m,value:m}}),defaultValue:c}}async function mt(){q();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 Xe(){q();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function ht(t,o){return t==="poetry"&&o.poetry?"poetry":t==="pipx"&&o.pipx?"pipx":t==="venv"?"venv":o.poetry?"poetry":"venv"}async function wt(t,o){q(),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$3([{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 pe(t,o);t.start("Installing Poetry with pipx");try{await Y(s,["install","poetry"]);}catch(a){let l=a,d=String(l?.stderr||l?.shortMessage||l?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(d))try{await Y(s,["upgrade","poetry"]);}catch{}else throw new f$2("Install Poetry with pipx",a instanceof Error?a:new Error(d))}t.succeed("Poetry installed"),q();try{await execa("poetry",["--version"]);}catch(a){let l=a,d=String(l?.stderr||l?.shortMessage||l?.message||"Poetry not found on PATH");throw new f$2("Verify Poetry after pipx install",new Error(`${d}
|
|
45
45
|
|
|
46
|
-
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 ft(t,o={}){let n=t==="poetry",s=o.pythonEngineSkipped?`echo "- Python engine installation was intentionally skipped for this workspace." 1>&2
|
|
47
47
|
echo "- For npm-owned workspace commands, run: npx workspai <command>" 1>&2
|
|
48
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
|
|
49
49
|
`:`echo "- If you used venv: ensure .venv exists (or re-run the installer)." 1>&2
|
|
@@ -79,7 +79,7 @@ ${s}${o.pythonEngineSkipped?"":n?`echo "- If you used Poetry: run 'poetry instal
|
|
|
79
79
|
`:""}${o.pythonEngineSkipped?`echo "Tip: use 'npx workspai workspace model --json' for Workspace Intelligence without the Python engine." 1>&2
|
|
80
80
|
`:`echo "Tip: you can also run: ./.venv/bin/rapidkit --help" 1>&2
|
|
81
81
|
`}exit 1
|
|
82
|
-
`}function
|
|
82
|
+
`}function kt(t,o={}){let n=t==="poetry",s=o.pythonEngineSkipped?`echo - Python engine installation was intentionally skipped for this workspace. 1>&2
|
|
83
83
|
echo - For npm-owned workspace commands, run: npx workspai ^<command^> 1>&2
|
|
84
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
|
|
85
85
|
`:`echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
|
|
@@ -119,10 +119,10 @@ for %%R in ("%USERPROFILE%\\.local\\bin\\rapidkit.exe" "%APPDATA%\\Python\\Scrip
|
|
|
119
119
|
echo RapidKit launcher could not find a local Python CLI. 1>&2
|
|
120
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
|
|
121
121
|
exit /b 1
|
|
122
|
-
`}async function
|
|
123
|
-
\u{1F4CC} Configuration notes:`)),
|
|
122
|
+
`}async function Pe(t,o,n={}){await b.outputFile(p.join(t,"rapidkit"),ft(o,n),{encoding:"utf-8",mode:493}),await b.outputFile(p.join(t,"rapidkit.cmd"),kt(o,n),"utf-8");}async function Qt(t,o){let{skipGit:n=false,skipPythonEngine:s=false,testMode:a=false,demoMode:l=false,dryRun:d=false,yes:y=false,userConfig:c={},installMethod:h,profile:g,parentDirectory:m}=o,r=t||"rapidkit",i=m?p.resolve(m,r):p.resolve(process.cwd(),r);if(await b.pathExists(i))throw new e(r);if(d){let k=g||(y?"minimal":void 0),_=h||c.defaultInstallMethod||"poetry",v=c.pythonVersion||"3.10";await Pt(i,r,l,c,k,_,v,n,s);return}if(l){await vt(i,r,n);return}let x=new Set(["python-only","polyglot","enterprise"]),w=g||"";if(!y&&!g){let{selectedProfile:k}=await b$3([{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=k;}else w||(w="minimal");let A=!y&&x.has(w),I=x.has(w)?s?"skip":A?(await b$3([{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":"skip",L=A&&I==="install",de=typeof c.pythonVersion=="string"&&c.pythonVersion.trim().length>0?c.pythonVersion.trim():void 0,nt=h||c.defaultInstallMethod||"poetry",ue=L?await mt():{poetry:true,pipx:true},xe=L?await gt(de):{choices:Qe.map(k=>({name:k,value:k})),defaultValue:H},it=ht(nt,ue),at=[{name:ue.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:ue.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"}],R=L?await b$3([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:xe.choices,default:xe.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:at,default:it}]):await(async()=>{if(I==="skip")return {pythonVersion:c.pythonVersion||"3.10",installMethod:"venv"};let k=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:k}})();L&&(console.log(e$1.gray(`
|
|
123
|
+
\u{1F4CC} Configuration notes:`)),R.pythonVersion==="3.10"?console.log(e$1.gray(" \u2022 Python 3.10: Latest stable with widespread compatibility")):R.pythonVersion==="3.11"?console.log(e$1.gray(" \u2022 Python 3.11: Newer, faster (3.10-3.11: ~10% speed improvement)")):R.pythonVersion==="3.12"&&console.log(e$1.gray(" \u2022 Python 3.12: Cutting edge, excellent for performance")),R.installMethod==="poetry"?console.log(e$1.gray(" \u2022 Poetry: Dependency management + virtual env (recommended for teams)")):R.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 ye=Je;if(ye.has(w)){let k=c$2("Creating workspace",{component:"create",phase:"workspace.python-free"}),_=await ie(i);try{await b.ensureDir(i),k.succeed("Directory created"),await J(i,r,"venv",void 0),await X(i,r,"venv",void 0,w),await U(i);let v={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};if(await b.outputFile(p.join(i,"README.md"),`# ${r}
|
|
124
124
|
|
|
125
|
-
Workspai **${
|
|
125
|
+
Workspai **${v[w]}** workspace.
|
|
126
126
|
|
|
127
127
|
## Quick start
|
|
128
128
|
|
|
@@ -147,81 +147,85 @@ npx workspai dev
|
|
|
147
147
|
cd <project-name>
|
|
148
148
|
npx workspai init
|
|
149
149
|
npx workspai dev
|
|
150
|
-
`)+"```\n","utf-8"),n||await
|
|
150
|
+
`)+"```\n\n## Workspace Intelligence\n\n```bash\nnpx workspai workspace model --json --write\nnpx workspai workspace context --for-agent --json --write\nnpx workspai pipeline --json --strict\n```\n\nDurable evidence is written to `.workspai/reports/`; generated agent instructions start at `AGENTS.md`.\n","utf-8"),await G(i,{workspaceName:r,silent:a}),await B(_),n||await Q(i,k,"Initial commit: Workspai workspace"),console.log(e$1.green(`
|
|
151
151
|
\u2728 Workspace created!
|
|
152
152
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan(`
|
|
153
153
|
\u{1F680} Get started:
|
|
154
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
|
|
155
|
-
`)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:
|
|
155
|
+
`)),console.log(e$1.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:f}=await execa("go",["version"],{timeout:3e3}),M=f.match(/go version go(\d+\.\d+(?:\.\d+)?)/),C=M?M[1]:"unknown";console.log(e$1.gray(`\u{1F439} Go ${C} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(e$1.yellow(`
|
|
156
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
|
|
157
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
|
|
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:
|
|
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:f}=await execa("dotnet",["--version"],{timeout:3e3});console.log(e$1.gray(`\u2699\uFE0F .NET SDK ${f.trim()} detected \u2014 ready for ASP.NET Core projects`));}catch{console.log(e$1.yellow(`
|
|
159
159
|
\u26A0\uFE0F .NET SDK is not installed \u2014 install it from https://dotnet.microsoft.com/download`));}}else w==="node-only"?(console.log(e$1.white(" npx workspai create project nestjs.standard my-app")),console.log(e$1.white(" cd my-app")),console.log(e$1.white(" npx workspai init")),console.log(e$1.white(` npx workspai dev
|
|
160
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
|
|
161
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(`
|
|
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(
|
|
163
|
-
\u274C Error:`),
|
|
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(v){return k.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
163
|
+
\u274C Error:`),v),F(_,v)}return}if(x.has(w)&&I==="skip"){let k=c$2("Creating workspace",{component:"create",phase:"workspace.python-engine-skipped"}),_=await ie(i);try{await b.ensureDir(i),k.succeed("Directory created");let v={bootstrapNote:"python-engine-skipped",pythonEngine:"skipped",pythonEngineReason:"user-opted-out"};await J(i,r,"venv",void 0,v),await X(i,r,"venv",void 0,w,v),await U(i),await Pe(i,"venv",{pythonEngineSkipped:true});let f={"python-only":"Python-aware",polyglot:"Polyglot",enterprise:"Enterprise"};await b.outputFile(p.join(i,"README.md"),`# ${r}
|
|
164
164
|
|
|
165
|
-
Workspai **${
|
|
165
|
+
Workspai **${f[w]??w}** workspace with Workspace Intelligence enabled and Python engine installation skipped.
|
|
166
166
|
|
|
167
167
|
## Quick start
|
|
168
168
|
|
|
169
169
|
\`\`\`bash
|
|
170
|
-
npx workspai workspace model --json
|
|
170
|
+
npx workspai workspace model --json --write
|
|
171
|
+
npx workspai workspace context --for-agent --json --write
|
|
171
172
|
npx workspai adopt /path/to/project
|
|
172
173
|
npx workspai workspace verify --json
|
|
174
|
+
npx workspai pipeline --json --strict
|
|
173
175
|
\`\`\`
|
|
174
176
|
|
|
177
|
+
Durable evidence is written to \`.workspai/reports/\`; generated agent instructions start at \`AGENTS.md\`.
|
|
178
|
+
|
|
175
179
|
## Add the Python engine later
|
|
176
180
|
|
|
177
181
|
\`\`\`bash
|
|
178
182
|
npx workspai create project fastapi.standard api --yes
|
|
179
183
|
npx workspai workspace run init
|
|
180
184
|
\`\`\`
|
|
181
|
-
`,"utf-8"),n||await
|
|
185
|
+
`,"utf-8"),await G(i,{workspaceName:r,silent:a}),await B(_),n||await Q(i,k,`Initial commit: Workspai workspace (${w})`),console.log(e$1.green(`
|
|
182
186
|
\u2728 Workspace created!
|
|
183
187
|
`)),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(`
|
|
184
188
|
\u{1F680} Get started:
|
|
185
189
|
`)),console.log(e$1.white(` ${f$1(i)}`)),console.log(e$1.white(" npx workspai workspace model --json")),console.log(e$1.white(" npx workspai adopt /path/to/project")),console.log(e$1.white(` npx workspai workspace verify --json
|
|
186
190
|
`)),console.log(e$1.cyan(`\u{1F4A1} Add Python-backed kits/modules later:
|
|
187
191
|
`)),console.log(e$1.gray(" npx workspai create project fastapi.standard api --yes")),console.log(e$1.gray(` npx workspai workspace run init
|
|
188
|
-
`));return}catch(
|
|
189
|
-
\u274C Error:`),
|
|
192
|
+
`));return}catch(v){return k.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
193
|
+
\u274C Error:`),v),F(_,v)}}{let k=N(),_=false;try{await execa(k,["--version"],{timeout:5e3}),_=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),_=true;}catch{_=false;}}if(!_){let v=w,f=dt(w);if(A&&!y){console.log(e$1.yellow(`
|
|
190
194
|
\u26A0\uFE0F Python 3.10+ is not detected on this system.
|
|
191
195
|
`)),console.log(e$1.cyan(`You have 3 options:
|
|
192
|
-
`));let{pythonAction:
|
|
196
|
+
`));let{pythonAction:C}=await b$3([{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 "${f}" profile (no Python required)`,value:"fallback"},{name:"\u274C Cancel and install Python manually",value:"cancel"}]}]);if(C==="cancel"&&(console.log(e$1.cyan(`
|
|
193
197
|
\u{1F4A1} How to install Python:
|
|
194
198
|
`)),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
|
|
195
199
|
`)),console.log(e$1.gray(` After installing Python, run: npx workspai ${r}
|
|
196
|
-
`)),process.exit(1)),
|
|
200
|
+
`)),process.exit(1)),C==="install"){console.log(e$1.cyan(`
|
|
197
201
|
\u{1F4A1} Install Python on your system:
|
|
198
202
|
`));let $=process.platform;$==="linux"?console.log(e$1.white(` sudo apt update && sudo apt install python3.10 python3.10-venv
|
|
199
203
|
`)):$==="darwin"?console.log(e$1.white(` brew install python@3.10
|
|
200
204
|
`)):$==="win32"&&(console.log(e$1.white(` Download: https://python.org/downloads
|
|
201
205
|
`)),console.log(e$1.white(` Run the installer and check "Add Python to PATH"
|
|
202
206
|
`))),console.log(e$1.gray(` After installing, run: npx workspai ${r}
|
|
203
|
-
`)),process.exit(0);}if(
|
|
204
|
-
\u2705 Switching to "${
|
|
205
|
-
`)),w=
|
|
207
|
+
`)),process.exit(0);}if(C==="fallback"&&(console.log(e$1.green(`
|
|
208
|
+
\u2705 Switching to "${f}" profile (no Python required).
|
|
209
|
+
`)),w=f,ye.has(f))){let $=c$2("Creating workspace",{component:"create",phase:"workspace.python-free"}),ee=await ie(i);try{await b.ensureDir(i),$.succeed("Directory created"),await J(i,r,"venv",void 0),await X(i,r,"venv",void 0,f,{profileRequested:v,bootstrapNote:"python-free-fallback"}),await U(i);let ae={"go-only":"Go-only","java-only":"Java-only","dotnet-only":".NET-only","node-only":"Node.js-only",minimal:"Minimal"};await b.outputFile(p.join(i,"README.md"),`# ${r}
|
|
206
210
|
|
|
207
|
-
Workspai **${
|
|
211
|
+
Workspai **${ae[f]}** workspace (switched from ${v} due to missing Python).
|
|
208
212
|
|
|
209
213
|
## Quick start
|
|
210
214
|
|
|
211
215
|
\`\`\`bash
|
|
212
|
-
`+(
|
|
216
|
+
`+(f==="go-only"?`npx workspai create project gofiber.standard my-api
|
|
213
217
|
cd my-api
|
|
214
218
|
npx workspai init
|
|
215
219
|
npx workspai dev
|
|
216
|
-
`:
|
|
220
|
+
`:f==="java-only"?`npx workspai create project springboot.standard my-service
|
|
217
221
|
cd my-service
|
|
218
222
|
npx workspai init
|
|
219
223
|
npx workspai dev
|
|
220
|
-
`:
|
|
224
|
+
`:f==="dotnet-only"?`npx workspai create project dotnet.webapi.clean my-api
|
|
221
225
|
cd my-api
|
|
222
226
|
npx workspai init
|
|
223
227
|
npx workspai dev
|
|
224
|
-
`:
|
|
228
|
+
`:f==="node-only"?`npx workspai create project nestjs.standard my-app
|
|
225
229
|
cd my-app
|
|
226
230
|
npx workspai init
|
|
227
231
|
npx workspai dev
|
|
@@ -229,37 +233,37 @@ npx workspai dev
|
|
|
229
233
|
cd <project-name>
|
|
230
234
|
npx workspai init
|
|
231
235
|
npx workspai dev
|
|
232
|
-
`)+"```\n","utf-8"),n||await
|
|
236
|
+
`)+"```\n","utf-8"),await G(i,{workspaceName:r,silent:a}),await B(ee),n||await Q(i,$,`Initial commit: Workspai workspace (${f} profile)`),console.log(e$1.green(`
|
|
233
237
|
\u2728 Workspace created with fallback profile!
|
|
234
238
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan(`
|
|
235
239
|
\u{1F680} Get started:
|
|
236
240
|
`)),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
|
|
237
241
|
`)),console.log(e$1.cyan(`\u{1F4A1} To use Python later:
|
|
238
|
-
`)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: workspai bootstrap --profile ${
|
|
239
|
-
`)),console.log("");return}catch(
|
|
240
|
-
\u274C Error:`),
|
|
241
|
-
\u26A0\uFE0F Python not detected. Auto-switching to "${
|
|
242
|
-
`)),w=
|
|
242
|
+
`)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: workspai bootstrap --profile ${v}
|
|
243
|
+
`)),console.log("");return}catch(ae){return $.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
244
|
+
\u274C Error:`),ae),F(ee,ae)}}}else if(console.log(e$1.yellow(`
|
|
245
|
+
\u26A0\uFE0F Python not detected. Auto-switching to "${f}" profile (no Python required).
|
|
246
|
+
`)),w=f,ye.has(f)){let C=c$2("Creating workspace",{component:"create",phase:"workspace.python-free"}),$=await ie(i);try{await b.ensureDir(i),C.succeed("Directory created"),await J(i,r,"venv",void 0),await X(i,r,"venv",void 0,f,{profileRequested:v,bootstrapNote:"python-free-fallback"}),await U(i),await G(i,{workspaceName:r,silent:a}),await B($),n||await Q(i,C,`Initial commit: Workspai workspace (${f})`),console.log(e$1.green(`
|
|
243
247
|
\u2728 Workspace created (auto-fallback profile)!
|
|
244
|
-
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u{1F4E6} Profile:"),e$1.yellow(
|
|
248
|
+
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(i)),console.log(e$1.cyan("\u{1F4E6} Profile:"),e$1.yellow(f)),console.log(e$1.cyan("\u{1F4A1} Reason:"),e$1.gray(`Python not detected; switched from ${v}`)),console.log(e$1.cyan(`
|
|
245
249
|
\u{1F680} Get started:
|
|
246
250
|
`)),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
|
|
247
251
|
`)),console.log(e$1.cyan(`\u{1F4A1} Add Python later:
|
|
248
|
-
`)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: ${f$1(i)} && workspai bootstrap --profile ${
|
|
249
|
-
`)),console.log("");return}catch(
|
|
250
|
-
\u274C Error:`)
|
|
252
|
+
`)),console.log(e$1.gray(" 1. Install Python 3.10+")),console.log(e$1.gray(` 2. Run: ${f$1(i)} && workspai bootstrap --profile ${v}
|
|
253
|
+
`)),console.log("");return}catch(ee){return C.fail("Failed to create workspace"),console.error(e$1.red(`
|
|
254
|
+
\u274C Error:`),ee),F($,ee)}}}}f.step(1,3,"Setting up Workspai environment");let E=c$2("Creating directory",{component:"create",phase:"workspace.directory"}),Re=await ie(i);try{await b.ensureDir(i),E.succeed("Directory created"),E.start("Detecting Python version");let k=null,_=await Ze(R.pythonVersion);if(_)k=await Oe(_),k?(f.info(` Detected Python ${k}`),E.succeed(`Python ${k} detected`)):E.warn("Could not detect exact Python version");else {let v=N();k=await Oe(v),k?E.succeed(`Python ${k} detected`):E.warn("Could not detect Python version, proceeding with defaults");}if(R.installMethod==="poetry"&&!await Xe()&&(E.warn("Poetry not found \u2014 auto-fallback to pip + venv"),R.installMethod="venv"),await J(i,r,R.installMethod,k||void 0),k&&await ut(i,k),await X(i,r,R.installMethod,k||R.pythonVersion,w||g),await U(i),await Ge(i,r),R.installMethod==="poetry")try{await et(i,R.pythonVersion,E,a,c,y);}catch(v){let f$1=v?.details||v?.message||String(v);if(f$1.includes("pyenv")||f$1.includes("exit status 127")||f$1.includes("returned non-zero exit status 127")){E.warn("Poetry encountered Python discovery issues, trying venv method"),f.debug(`Poetry error (attempting venv fallback): ${f$1}`);try{await be(i,R.pythonVersion,E,a,c),R.installMethod="venv";}catch(C){throw C}}else throw v}else R.installMethod==="venv"?await be(i,R.pythonVersion,E,a,c):await tt(i,E,a,c,y);if(await Pe(i,R.installMethod),await ot(i,R.installMethod),E.succeed("Workspai environment ready!"),await G(i,{workspaceName:r,silent:a}),await B(Re),o.skipGit||await Q(i,E,"Initial commit: Workspai environment"),console.log(e$1.green(`
|
|
251
255
|
\u2728 Workspai environment created successfully!
|
|
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: ${
|
|
256
|
+
`)),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: ${R.pythonVersion}`)),console.log(e$1.gray(` \u2022 Install method: ${R.installMethod}`)),console.log(e$1.cyan(`
|
|
253
257
|
\u{1F680} Get started:
|
|
254
|
-
`)),console.log(e$1.white(` ${f$1(i)}`)),
|
|
255
|
-
\u{1F4E6} Why Poetry? Includes dependency management + virtual environment`));}else
|
|
258
|
+
`)),console.log(e$1.white(` ${f$1(i)}`)),R.installMethod==="poetry"){let v="source $(poetry env info --path)/bin/activate";try{q();let{stdout:f}=await execa("poetry",["--version"]),M=f.match(/Poetry.*?(\d+)\.(\d+)/);M&&(parseInt(M[1])>=2?v="source $(poetry env info --path)/bin/activate":v="poetry shell");}catch{}console.log(e$1.white(` ${v} # 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(`
|
|
259
|
+
\u{1F4E6} Why Poetry? Includes dependency management + virtual environment`));}else R.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(`
|
|
256
260
|
\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(`
|
|
257
261
|
\u{1F4E6} Why pipx? Global isolated install, no local venv`)));console.log(e$1.cyan(`
|
|
258
262
|
\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(`
|
|
259
263
|
\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(`
|
|
260
264
|
\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
|
|
261
|
-
`));try{let{stdout:
|
|
262
|
-
\u274C Error:`),
|
|
265
|
+
`));try{let{stdout:v}=await execa("go",["version"],{timeout:3e3}),f=v.match(/go version go(\d+\.\d+(?:\.\d+)?)/),M=f?f[1]:"unknown";console.log(e$1.gray(`\u{1F439} Go ${M} 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(k){return E.fail("Failed to create Workspai environment"),console.error(e$1.red(`
|
|
266
|
+
\u274C Error:`),k),F(Re,k)}}async function Ze(t){let o=[];if(!b$4())try{let{stdout:l}=await execa("pyenv",["which","python"]),d=l.trim();d&&o.push(d);}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 d=l==="py"?["-3","--version"]:["--version"],y=l==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:c}=await execa(l,d,{timeout:2e3}),h=c.match(/Python (\d+\.\d+)/)?.[1];if(h&&Z(h,t))return await execa(l,y,{timeout:2e3}),l}catch{continue}return null}async function et(t,o,n,s,a,l$1=false){await wt(n,l$1),n.start("Finding Python interpreter");let d=await Ze(o);d?(f.debug(`Found working Python: ${d}`),n.succeed("Python found")):n.warn("Could not verify Python path, proceeding with default"),n.start("Initializing Poetry project");let y=p.join(t,"pyproject.toml"),h=(await b.pathExists(y)?await promises.readFile(y,"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(y,"utf-8");i.includes("[tool.poetry]")?i=i.replace("[tool.poetry]",`[tool.poetry]
|
|
263
267
|
package-mode = false`):i.includes("[project]")&&(i.includes("[build-system]")?i=i.replace("[build-system]",`
|
|
264
268
|
[tool.poetry]
|
|
265
269
|
package-mode = false
|
|
@@ -268,33 +272,33 @@ package-mode = false
|
|
|
268
272
|
|
|
269
273
|
[tool.poetry]
|
|
270
274
|
package-mode = false
|
|
271
|
-
`),await promises.writeFile(
|
|
272
|
-
Error: ${
|
|
275
|
+
`),await promises.writeFile(y,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 g$1=d||N(),m=l(p.join(t,".venv"));try{await execa(g$1,["-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"),m=d||N();}try{await execa("poetry",["env","use",m||N()],{cwd:t}),f.debug(`Poetry env set to: ${m}`);}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 b.pathExists(r):false,x=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,A=null;for(let I=1;I<=3;I++)try{i||e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:I,maxAttempts:3}),await execa(m,["-m","pip","install",x,"--quiet"],{cwd:t,timeout:18e4}),w=true,i||e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:I,maxAttempts:3});break}catch(L){A=L,f.debug(`pip install rapidkit-core attempt ${I} failed: ${L}`),I<3&&(n.text=`Retrying installation (attempt ${I+1}/3)`,await new Promise(de=>setTimeout(de,2e3)));}if(!w){let I=A?.stderr||A?.message||"Unknown error";throw f.debug(`All pip install attempts failed. Last error: ${I}`),I.includes("Could not find")||I.includes("No matching distribution")?new g:new f$2("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
276
|
+
Error: ${I}
|
|
273
277
|
|
|
274
278
|
Possible solutions:
|
|
275
279
|
1. Check your internet connection
|
|
276
|
-
2. Try installing manually: cd ${
|
|
277
|
-
3. Use venv method instead: npx workspai ${
|
|
278
|
-
Error: ${
|
|
280
|
+
2. Try installing manually: cd ${p.basename(t)} && poetry add rapidkit-core
|
|
281
|
+
3. Use venv method instead: npx workspai ${p.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 x=1;x<=3;x++)try{e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"poetry",attempt:x,maxAttempts:3}),await execa("poetry",["add","rapidkit-core"],{cwd:t,timeout:6e4*x}),r=true,e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"poetry",attempt:x,maxAttempts:3});break}catch(w){i=w,f.debug(`Poetry add attempt ${x} failed: ${w}`),x<3&&(n.text=`Retrying installation (attempt ${x+1}/3)`,await new Promise(A=>setTimeout(A,2e3)));}if(!r){let x=i?.stderr||i?.message||"Unknown error";throw f.debug(`All Poetry install attempts failed. Last error: ${x}`),x.includes("Could not find")||x.includes("No matching distribution")?new g:new f$2("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
282
|
+
Error: ${x}
|
|
279
283
|
|
|
280
284
|
Possible solutions:
|
|
281
285
|
1. Check your internet connection
|
|
282
|
-
2. Try installing manually: cd ${
|
|
283
|
-
3. Use venv method instead: npx workspai ${
|
|
286
|
+
2. Try installing manually: cd ${p.basename(t)} && poetry add rapidkit-core
|
|
287
|
+
3. Use venv method instead: npx workspai ${p.basename(t)} --install-method=venv`))}}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:r}=await import('./pythonRapidkitExec-CVCIK225.js');if(!await r()&&!s){n.start("Checking optional global pipx installation");let x=await pe(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await Y(x,["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 be(t,o,n,s,a,l$1=false){n.start(`Checking Python ${o}`);let d=N();try{let{stdout:c}=await execa(d,["--version"]),h=c.match(/Python (\d+\.\d+)/)?.[1];if(h&&!Z(h,o))throw new b$5(o,h);n.succeed(`Python ${h} found`);}catch(c){throw c instanceof b$5?c:new b$5(o)}n.start("Creating virtual environment");try{await execa(d,["-m","venv",".venv"],{cwd:t}),n.succeed("Virtual environment created");}catch(c){if(n.fail("Failed to create virtual environment"),(g=>typeof g=="object"&&g!==null&&"stdout"in g&&typeof g.stdout=="string")(c)&&c.stdout.includes("ensurepip is not")){let g=c.stdout.match(/apt install (python[\d.]+-venv)/),m=g?g[1]:"python3-venv";throw new f$2("Python venv module not available",new Error(`Virtual environment creation failed.
|
|
284
288
|
|
|
285
289
|
On Debian/Ubuntu systems, install the venv package:
|
|
286
|
-
sudo apt install ${
|
|
290
|
+
sudo apt install ${m}
|
|
287
291
|
|
|
288
292
|
Or use Poetry instead (recommended):
|
|
289
|
-
npx workspai ${
|
|
290
|
-
Error: ${
|
|
293
|
+
npx workspai create workspace ${p.basename(t)} --yes --install-method poetry`))}throw new f$2("Virtual environment creation",c instanceof Error?c:new Error(String(c)))}n.start("Installing RapidKit");let y=l(p.join(t,".venv"));if(await execa(y,["-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(y,["-m","pip","install","-e",c],{cwd:t});}else {n.text="Installing RapidKit from PyPI";let c=false,h=null;for(let g=1;g<=3;g++)try{e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"venv",attempt:g,maxAttempts:3}),await execa(y,["-m","pip","install","rapidkit-core"],{cwd:t,timeout:6e4*g}),c=true,e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"venv",attempt:g,maxAttempts:3});break}catch(m){h=m,f.debug(`pip install attempt ${g} failed: ${m}`),g<3&&(n.text=`Retrying installation (attempt ${g+1}/3)`,await new Promise(r=>setTimeout(r,2e3)));}if(!c){let g$1=h?.stderr||h?.message||"Unknown error";throw f.debug(`All pip install attempts failed. Last error: ${g$1}`),g$1.includes("Could not find")||g$1.includes("No matching distribution")?new g:new f$2("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
|
|
294
|
+
Error: ${g$1}
|
|
291
295
|
|
|
292
296
|
Possible solutions:
|
|
293
297
|
1. Check your internet connection
|
|
294
|
-
2. Try installing manually: cd ${
|
|
295
|
-
3. Use Poetry instead: npx workspai ${
|
|
296
|
-
`,"utf-8");return}
|
|
297
|
-
`,"utf-8");}async function
|
|
298
|
+
2. Try installing manually: cd ${p.basename(t)} && ${l(".venv")} -m pip install rapidkit-core
|
|
299
|
+
3. Use Poetry instead: npx workspai ${p.basename(t)} --install-method=poetry`))}}n.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:c}=await import('./pythonRapidkitExec-CVCIK225.js');if(!await c()&&!s){n.start("Checking optional global pipx installation");let g=await pe(n,true);try{n.start("Installing RapidKit globally with pipx for CLI access"),await Y(g,["install","rapidkit-core"]),n.succeed("RapidKit installed globally");}catch(m){n.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),f.debug(`pipx install failed: ${m}`);}}}catch(c){n.succeed("Skipped optional global pipx installation"),f.debug(`Global install check skipped: ${c}`);}}async function tt(t,o,n,s,a=false){if(!n)try{let{checkRapidkitCoreVersionCompatible:d}=await import('./pythonRapidkitExec-CVCIK225.js'),y=await d();if(y.isCompatible){o.succeed(`RapidKit ${y.installedVersion??""} already compatible globally; skipping pipx installation`),await b.outputFile(p.join(t,".rapidkit-global"),`RapidKit already available globally (version ${y.installedVersion??"unknown"}) and satisfies expected constraint ${y.expectedConstraint??"n/a"}; workspace will reuse the existing installation
|
|
300
|
+
`,"utf-8");return}y.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.'):y.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=${y.reason}, installed=${y.installedVersion??"unknown"}, expected=${y.expectedConstraint??"none"}). Proceeding with pipx install/upgrade.`);}catch(d){f.debug(`Global RapidKit version-aware check failed before pipx install: ${d}`);}let l=await pe(o,a);if(o.start("Installing RapidKit globally with pipx"),n){let d=e$2(s||{});if(!d)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: ${d}`),o.text="Installing RapidKit from local path (test mode)",await Y(l,["install","-e",d]);}else {o.text="Installing RapidKit from PyPI",e$3({status:"started",message:"Installing RapidKit from PyPI",installMethod:"pipx"});try{await Y(l,["install","rapidkit-core"]),e$3({status:"succeeded",message:"RapidKit installed from PyPI",installMethod:"pipx"});}catch(d){try{o.text="RapidKit already installed globally, upgrading to match expected version",await Y(l,["upgrade","rapidkit-core"]),e$3({status:"succeeded",message:"RapidKit upgraded from PyPI",installMethod:"pipx"});}catch(y){throw f.debug(`pipx install/upgrade failed: install=${d}, upgrade=${y}`),new g}}}o.succeed("RapidKit installed globally"),await b.outputFile(p.join(t,".rapidkit-global"),`RapidKit installed globally with pipx
|
|
301
|
+
`,"utf-8");}async function Xt(t,o){let{skipGit:n=false,testMode:s=false,userConfig:a={},yes:l=false,installMethod:d,pythonVersion:y="3.10"}=o||{},c=d||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 Xe()?"venv":c,g=c$2("Registering workspace",{component:"create",phase:"workspace.register"}),m=await ct(t);try{await J(t,p.basename(t),h),await U(t),await X(t,p.basename(t),h,y,o?.profile),h==="poetry"?(await Ge(t,p.basename(t)),await et(t,y,g,s,a,l)):h==="venv"?await be(t,y,g,s,a):await tt(t,g,s,a,l),await Pe(t,h),await ot(t,h),g.succeed("Workspace registered"),await G(t,{workspaceName:p.basename(t),silent:s}),await B(m),n||await Q(t,g,"Initial commit: Workspai workspace");}catch(r){return g.fail("Failed to register workspace"),F(m,r)}}async function ot(t,o){let n=o==="poetry"?`source $(poetry env info --path)/bin/activate
|
|
298
302
|
# 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):
|
|
299
303
|
./rapidkit --help
|
|
300
304
|
# or:
|
|
@@ -303,7 +307,7 @@ poetry run rapidkit --help`:o==="venv"?`# No activation needed (recommended):
|
|
|
303
307
|
# or direct:
|
|
304
308
|
./.venv/bin/rapidkit --help`:`# Optional: use the local launcher
|
|
305
309
|
./rapidkit --help
|
|
306
|
-
# (pipx installs may require Poetry/venv to be present in this folder)`,a=b$
|
|
310
|
+
# (pipx installs may require Poetry/venv to be present in this folder)`,a=b$4()?"python --version (or: py -3 --version)":"python3 --version (or: python --version)",l=`# Workspai Workspace
|
|
307
311
|
|
|
308
312
|
This directory contains a Workspai development environment.
|
|
309
313
|
|
|
@@ -384,6 +388,16 @@ workspai modules list
|
|
|
384
388
|
- \`workspai doctor\` - Check system requirements
|
|
385
389
|
- \`workspai --help\` - Show all commands
|
|
386
390
|
|
|
391
|
+
## Workspace Intelligence
|
|
392
|
+
|
|
393
|
+
\`\`\`bash
|
|
394
|
+
workspai workspace model --json --write
|
|
395
|
+
workspai workspace context --for-agent --json --write
|
|
396
|
+
workspai pipeline --json --strict
|
|
397
|
+
\`\`\`
|
|
398
|
+
|
|
399
|
+
Durable evidence is written to \`.workspai/reports/\`; generated agent instructions start at \`AGENTS.md\`.
|
|
400
|
+
|
|
387
401
|
## Workspai Documentation
|
|
388
402
|
|
|
389
403
|
For full documentation, visit: [Workspai Docs](https://workspai.dev/docs)
|
|
@@ -405,7 +419,7 @@ If you encounter issues:
|
|
|
405
419
|
2. Check Workspai installation: \`workspai --version\`
|
|
406
420
|
3. Run diagnostics: \`workspai doctor\`
|
|
407
421
|
4. Visit Workspai documentation or GitHub issues
|
|
408
|
-
`;await promises.writeFile(
|
|
422
|
+
`;await promises.writeFile(p.join(t,"README.md"),l,"utf-8");}async function vt(t,o,n){let s=c$2("Creating demo workspace",{component:"create",phase:"workspace.demo"});try{await b.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(p.join(t,"package.json"),a,"utf-8"),await promises.writeFile(p.join(t,"generate-demo.js"),`#!/usr/bin/env node
|
|
409
423
|
/**
|
|
410
424
|
* Demo Kit Generator - Create FastAPI demo projects
|
|
411
425
|
*
|
|
@@ -798,12 +812,12 @@ venv/
|
|
|
798
812
|
npx workspai test # \u{1F9EA} Run tests
|
|
799
813
|
npx workspai help # \u{1F4DA} Show help
|
|
800
814
|
|
|
801
|
-
\u{1F4A1} For Python engine features: pipx install rapidkit
|
|
815
|
+
\u{1F4A1} For Python engine features: pipx install rapidkit-core
|
|
802
816
|
\`);
|
|
803
817
|
}
|
|
804
818
|
|
|
805
819
|
main().catch(console.error);
|
|
806
|
-
`,"utf-8");try{await execa("chmod",["+x",
|
|
820
|
+
`,"utf-8");try{await execa("chmod",["+x",p.join(t,"generate-demo.js")]);}catch{}let d=`# Workspai Demo Workspace
|
|
807
821
|
|
|
808
822
|
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.
|
|
809
823
|
|
|
@@ -854,7 +868,7 @@ Each generated demo project contains:
|
|
|
854
868
|
|
|
855
869
|
1. **Explore the Generated Code** - Check out \`src/main.py\` and \`src/routing/\`
|
|
856
870
|
2. **Add Routes** - Create new endpoints in \`src/routing/\`
|
|
857
|
-
3. **Install RapidKit Core** - For Python engine features: \`pipx install rapidkit\`
|
|
871
|
+
3. **Install RapidKit Core** - For Python engine features: \`pipx install rapidkit-core\`
|
|
858
872
|
4. **Read the Documentation** - Visit [Workspai Docs](https://workspai.dev/docs)
|
|
859
873
|
|
|
860
874
|
## \u26A0\uFE0F Demo Mode Limitations
|
|
@@ -868,7 +882,7 @@ This is a demo workspace with:
|
|
|
868
882
|
For Python engine features, install RapidKit Core:
|
|
869
883
|
|
|
870
884
|
\`\`\`bash
|
|
871
|
-
pipx install rapidkit
|
|
885
|
+
pipx install rapidkit-core
|
|
872
886
|
\`\`\`
|
|
873
887
|
|
|
874
888
|
## \u{1F6E0}\uFE0F Workspace Structure
|
|
@@ -890,7 +904,7 @@ ${o}/
|
|
|
890
904
|
---
|
|
891
905
|
|
|
892
906
|
**Generated with Workspai** | [GitHub](https://github.com/rapidkitlabs/workspai)
|
|
893
|
-
`;if(await promises.writeFile(
|
|
907
|
+
`;if(await promises.writeFile(p.join(t,"README.md"),d,"utf-8"),s.succeed("Demo workspace setup complete"),!n)if(await Ve(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 b.outputFile(p.join(t,".gitignore"),`# Dependencies
|
|
894
908
|
node_modules/
|
|
895
909
|
|
|
896
910
|
# Generated projects
|
|
@@ -906,14 +920,14 @@ __pycache__/
|
|
|
906
920
|
`,"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(`
|
|
907
921
|
\u2728 Demo workspace created successfully!
|
|
908
922
|
`)),console.log(e$1.cyan("\u{1F4C2} Location:"),e$1.white(t)),console.log(e$1.cyan(`\u{1F680} Get started:
|
|
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
|
|
923
|
+
`)),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-core")),console.log();}catch(a){throw s.fail("Failed to create demo workspace"),a}}async function Pt(t,o,n,s,a,l,d,y=false,c=false){if(console.log(e$1.cyan(`
|
|
910
924
|
\u{1F50D} Dry-run mode - what would be created:
|
|
911
925
|
`)),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(`
|
|
912
926
|
\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(`
|
|
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
|
|
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")),
|
|
915
|
-
\u2699\uFE0F Environment setup:`)),
|
|
927
|
+
\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 h=a||"minimal",g=l,m=d,i=new Set(["python-only","polyglot","enterprise"]).has(h);console.log(e$1.white("\u{1F4E6} Profile:"),e$1.cyan(h)),console.log(e$1.white("\u{1F4DD} Configuration:")),i?(console.log(e$1.gray(` - Python version: ${m}`)),console.log(e$1.gray(` - Python engine: ${c?"Skipped":`Install with ${g}`}`)),console.log(e$1.gray(` - Git init: ${y?"No":"Yes"}`))):(console.log(e$1.gray(" - Python-free profile (no Python needed)")),console.log(e$1.gray(` - Git init: ${y?"No":"Yes"}`))),console.log(e$1.white(`
|
|
928
|
+
\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")),i&&!c&&console.log(e$1.gray(` - ${g==="poetry"?"pyproject.toml + poetry.lock":".venv/ (virtual environment)"}`)),console.log(e$1.white(`
|
|
929
|
+
\u2699\uFE0F Environment setup:`)),i&&c?console.log(e$1.gray(" - Python engine setup skipped")):i&&console.log(g==="poetry"?e$1.gray(" - Poetry virtual environment created (recommended, includes dependency management)"):g==="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(`
|
|
916
930
|
\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(`
|
|
917
931
|
\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(`
|
|
918
932
|
\u2728 To proceed: remove --dry-run flag
|
|
919
|
-
`));}export{
|
|
933
|
+
`));}export{He as a,Jt as b,Je as c,dt as d,Pe as e,Qt as f,Xt as g};
|