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}from'./chunk-T3GJ7YVG.js';import {a,b}from'./chunk-22DT744Z.js';import {c}from'./chunk-NFUXULIF.js';import {d as d$1,e as e$1,g,f as f$2,i}from'./chunk-T6OR6YOI.js';import {a as a$1,d as d$2}from'./chunk-NAAQMSO3.js';import {o}from'./chunk-5XATWNME.js';import d from'chalk';import l from'fs';import p from'path';var L="release-readiness-v1";function D(t,e){let s=p.resolve(t);if(!b(s))return s;let a=V(e,"workspace.contract.json");if(l.existsSync(a))try{let o=JSON.parse(l.readFileSync(a,"utf-8")),n=Array.isArray(o.projects)?o.projects:[];for(let r of n){let u=f(r),m=typeof u.relativePath=="string"?u.relativePath.trim():"";if(m)return p.join(e,m)}}catch{}let i=W(e),c=Array.isArray(i.payload?.projects)?i.payload.projects:[];for(let o of c){let n=f(o),r=typeof n.path=="string"?n.path.trim():"";if(r)return p.resolve(r)}return s}function J(t){let e=d$1(t);return e$1(e,t)?"go":g(e,t)?"java":f$2(e,t)?"node":i(e,t)?"python":"unknown"}function $(t,e){if(!l.existsSync(t))return null;let s=l.readdirSync(t).filter(a=>a.endsWith(".json")&&e.some(i=>i.test(a))).map(a=>p.join(t,a));return s.length===0?null:(s.sort((a,i)=>l.statSync(i).mtimeMs-l.statSync(a).mtimeMs),s[0])}function f(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function I(t){for(let e of t)if(l.existsSync(e))return e;return null}function V(t,...e){let s=o(t,...e);return I(s)??s[0]}function P(t,e){let s=a$1(t,`.workspai/reports/${e}`);return I([s,p.join(t,".rapidkit","reports",e)])??s}async function F(t){let{readWorkspaceRegistrySummary:e,resolveWorkspaceRegisteredProjects:s}=await import('./workspace-registry-summary-RUJE6RPH.js'),a=await e(t);return a?a.projectCount:(await s(t)).summary.projectCount}function M(t,e,s){let a=V(t,"toolchain.lock");if(!l.existsSync(a))return {gate:"env",status:"fail",summary:"toolchain.lock is missing",details:["Run workspai bootstrap to pin runtime versions and generate a reproducible toolchain."],evidencePath:a};try{let i=JSON.parse(l.readFileSync(a,"utf-8")),c=f(i.runtime),n=["python","node","go","java"].filter(r=>{let u=f(c[r]);return typeof u.version=="string"&&u.version.trim().length>0});if(n.length===0)return {gate:"env",status:"fail",summary:"No runtime versions are pinned in toolchain.lock",details:["Pin at least one runtime version via workspai setup <runtime> and re-run bootstrap."],evidencePath:a};if(e!=="unknown"){let r=f(c[e]);if(typeof r.version!="string"||r.version.trim().length===0)return {gate:"env",status:"fail",summary:`${s?.hasRegisteredProjects?"Project runtime":"Workspace"} (${e}) is not pinned in toolchain.lock`,details:[`Run workspai setup ${e} and workspai bootstrap to lock ${e} for this workspace.`],evidencePath:a}}return {gate:"env",status:"pass",summary:`Pinned runtimes: ${n.join(", ")}`,details:[],evidencePath:a}}catch{return {gate:"env",status:"fail",summary:"toolchain.lock is invalid JSON",details:["Regenerate lockfile with workspai bootstrap."],evidencePath:a}}}function W(t){let e=P(t,"doctor-last-run.json");if(!l.existsSync(e))return {payload:null,path:e};try{let s=JSON.parse(l.readFileSync(e,"utf-8"));return c(s,"workspace")?{payload:s,path:e}:{payload:null,path:e}}catch{return {payload:null,path:e}}}function _(t){let e=W(t);if(!e.payload)return {gate:{gate:"doctor",status:"fail",summary:"Doctor evidence is missing",details:["Run workspai doctor workspace --json before release readiness checks."],evidencePath:e.path},payload:null};let s=f(e.payload.summary),a=Number(s.totalIssues??0);return s.hasSystemErrors?{gate:{gate:"doctor",status:"fail",summary:"Doctor reported system errors",details:["Resolve system-level doctor errors before proceeding."],evidencePath:e.path},payload:e.payload}:a>0?{gate:{gate:"doctor",status:"warn",summary:`Doctor found ${a} issue(s)`,details:["Run workspai doctor workspace --fix and re-run readiness checks."],evidencePath:e.path},payload:e.payload}:{gate:{gate:"doctor",status:"pass",summary:"Doctor checks passed without issues",details:[],evidencePath:e.path},payload:e.payload}}function H(t){let e=P(t,"analyze-last-run.json");if(!l.existsSync(e))return {gate:"analyze",status:"fail",summary:"Analyze evidence is missing",details:["Run workspai analyze --json before release readiness checks."],evidencePath:e};try{let s=JSON.parse(l.readFileSync(e,"utf-8")),a=f(s.summary),i=String(a.verdict??"").toLowerCase(),c=Number(a.score??0),o=f(a.findings),n=Number(o.fail??0);return i==="blocked"||n>0?{gate:"analyze",status:"fail",summary:`Analyze verdict is blocked (score ${c}/100)`,details:["Resolve analyze findings and regenerate analyze-last-run.json."],evidencePath:e}:i==="needs-attention"?{gate:"analyze",status:"warn",summary:`Analyze needs attention (score ${c}/100)`,details:["Review analyze warnings before release."],evidencePath:e}:{gate:"analyze",status:"pass",summary:`Analyze passed (score ${c}/100)`,details:[],evidencePath:e}}catch{return {gate:"analyze",status:"fail",summary:"Analyze evidence is invalid JSON",details:["Re-run workspai analyze --json to regenerate evidence."],evidencePath:e}}}function K(t){try{let e=JSON.parse(l.readFileSync(t,"utf-8")),s=String(e.status??"").toLowerCase(),a=f(e.summary),i=Number(a.failedChecks??0);return s==="fail"||i>0?{gate:"verify",status:"fail",summary:"Verify-pack contract reports failed checks",details:["Fix failed verify checks and regenerate verify-pack contract evidence."],evidencePath:t}:s==="pass"?{gate:"verify",status:"pass",summary:"Verify-pack contract passed",details:[],evidencePath:t}:{gate:"verify",status:"warn",summary:"Verify-pack contract status is not explicit",details:["Ensure contract status is pass/fail and keep schema aligned with v1 contract."],evidencePath:t}}catch{return {gate:"verify",status:"fail",summary:"Verify-pack contract is invalid JSON",details:["Regenerate verify-pack contract artifact."],evidencePath:t}}}async function B(t,e){if(e.skipVerify)return {gate:"verify",status:"pass",summary:"Verify gate skipped (--skip-verify)",details:["Verification was explicitly skipped for this readiness run."]};let s=[a$1(t,".workspai/reports"),p.join(t,".rapidkit","reports")],a=s[0],i=s.map(n=>$(n,[/verify-pack-contract/i,/^verify.*\.json$/i])).find(n=>typeof n=="string")??null;if(i)return K(i);let c=a$1(t,".workspai/reports/workspace-contract-verify-last-run.json"),o=s.map(n=>$(n,[/workspace-contract-verify-last-run/i,/workspace-contract-verify/i])).find(n=>typeof n=="string")??null;if(o)try{let n=JSON.parse(l.readFileSync(o,"utf-8")),r=String(n.status??"").toLowerCase();if(r==="passed"||r==="pass")return {gate:"verify",status:"pass",summary:"Workspace contract verification passed (CLI cache)",details:[],evidencePath:o};if(r==="failed"||r==="fail")return {gate:"verify",status:"fail",summary:"Workspace contract verification failed (CLI cache)",details:(Array.isArray(n.violations)?n.violations:[]).slice(0,5),evidencePath:o}}catch{}try{let{verifyWorkspaceContract:n}=await import('./workspace-contract-XUGMCUSQ.js'),r=await n({workspacePath:t}),u={schemaVersion:"v1",source:"cli",generatedAt:new Date().toISOString(),status:r.status,contractPath:r.contractPath,projectCount:r.projectCount,checks:r.checks,violations:r.violations};return await d$2(t,".workspai/reports/workspace-contract-verify-last-run.json",u),r.status==="failed"?{gate:"verify",status:"fail",summary:"Workspace contract verification failed (CLI)",details:r.violations.slice(0,5),evidencePath:c}:{gate:"verify",status:"pass",summary:"Workspace contract verification passed (CLI)",details:[],evidencePath:c}}catch(n){return {gate:"verify",status:"fail",summary:"No verify evidence and workspace contract verification unavailable",details:["Run workspai workspace contract verify --json or export verify-pack contract from CI.",n instanceof Error?n.message:String(n)],evidencePath:p.join(a,"*verify*.json")}}}function U(t,e){let s=P(e,"doctor-last-run.json");if(!t)return {gate:"dependency",status:"warn",summary:"Dependency risk check skipped (doctor evidence missing)",details:["Run workspai doctor workspace --json to include dependency findings."],evidencePath:s};let a=Array.isArray(t.projects)?t.projects:[],i=a.reduce((o,n)=>{let r=Number(n.vulnerabilities??0);return Number.isFinite(r)?o+Math.max(0,r):o},0),c=a.filter(o=>o.depsInstalled===false).length;return i>0?{gate:"dependency",status:"fail",summary:`${i} dependency vulnerability(ies) reported`,details:["Resolve vulnerabilities (npm/pip/go audit pipelines) before release."],evidencePath:s}:c>0?{gate:"dependency",status:"warn",summary:`${c} project(s) report missing dependencies`,details:["Run project init/bootstrap and regenerate doctor evidence."],evidencePath:s}:{gate:"dependency",status:"pass",summary:"No dependency vulnerabilities reported",details:[],evidencePath:s}}function q(t){return t.some(e=>e.status==="fail")?"fail":t.some(e=>e.status==="warn")?"warn":"pass"}async function Q(t,e){return d$2(t,".workspai/reports/release-readiness-last-run.json",e)}async function T(t={}){let e$1=p.resolve(t.startPath??process.cwd()),s=a(e$1)??e$1,a$1=await F(s)>0,i=a$1&&b(e$1)?s:D(e$1,s),c=i===s?"unknown":J(i),n=M(s,a$1?c:"unknown",{hasRegisteredProjects:a$1}),r=_(s),u=H(s),m=await B(s,{skipVerify:t.skipVerify}),z=U(r.payload,s),h=[n,r.gate,u,m,z],v=q(h),g={schemaVersion:L,generatedAt:new Date().toISOString(),workspacePath:s,projectPath:i,action:t.action,overallStatus:v,blocking:v==="fail",blockingReasons:h.filter(y=>y.status==="fail").map(y=>`${y.gate}: ${y.summary}`),gates:h};if(t.writeReport!==false){let y=f$1(g,{commandId:"workspaceReadiness",exitCode:v==="fail"?2:v==="warn"?1:0,generatedAt:g.generatedAt,blockers:g.blockingReasons,runId:e()});g.evidencePath=await Q(s,y);}return g}function X(t){return t==="pass"?d.green("PASS"):t==="warn"?d.yellow("WARN"):d.red("FAIL")}function Y(t){return t==="pass"?d.green("PASS"):t==="warn"?d.yellow("WARN"):d.red("FAIL")}async function de(t){let e=await T({writeReport:true,skipVerify:t.skipVerify===true});if(t.json)console.log(JSON.stringify(e,null,2));else {console.log(d.bold.cyan(`
|
|
1
|
+
import {f as f$1,e}from'./chunk-T3GJ7YVG.js';import {a,b}from'./chunk-22DT744Z.js';import {c}from'./chunk-NFUXULIF.js';import {d as d$1,e as e$1,g,f as f$2,i}from'./chunk-7UZVOYF5.js';import {a as a$1,d as d$2}from'./chunk-NAAQMSO3.js';import {o}from'./chunk-5XATWNME.js';import d from'chalk';import l from'fs';import p from'path';var L="release-readiness-v1";function D(t,e){let s=p.resolve(t);if(!b(s))return s;let a=V(e,"workspace.contract.json");if(l.existsSync(a))try{let o=JSON.parse(l.readFileSync(a,"utf-8")),n=Array.isArray(o.projects)?o.projects:[];for(let r of n){let u=f(r),m=typeof u.relativePath=="string"?u.relativePath.trim():"";if(m)return p.join(e,m)}}catch{}let i=W(e),c=Array.isArray(i.payload?.projects)?i.payload.projects:[];for(let o of c){let n=f(o),r=typeof n.path=="string"?n.path.trim():"";if(r)return p.resolve(r)}return s}function J(t){let e=d$1(t);return e$1(e,t)?"go":g(e,t)?"java":f$2(e,t)?"node":i(e,t)?"python":"unknown"}function $(t,e){if(!l.existsSync(t))return null;let s=l.readdirSync(t).filter(a=>a.endsWith(".json")&&e.some(i=>i.test(a))).map(a=>p.join(t,a));return s.length===0?null:(s.sort((a,i)=>l.statSync(i).mtimeMs-l.statSync(a).mtimeMs),s[0])}function f(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function I(t){for(let e of t)if(l.existsSync(e))return e;return null}function V(t,...e){let s=o(t,...e);return I(s)??s[0]}function P(t,e){let s=a$1(t,`.workspai/reports/${e}`);return I([s,p.join(t,".rapidkit","reports",e)])??s}async function F(t){let{readWorkspaceRegistrySummary:e,resolveWorkspaceRegisteredProjects:s}=await import('./workspace-registry-summary-6MFBRWDS.js'),a=await e(t);return a?a.projectCount:(await s(t)).summary.projectCount}function M(t,e,s){let a=V(t,"toolchain.lock");if(!l.existsSync(a))return {gate:"env",status:"fail",summary:"toolchain.lock is missing",details:["Run workspai bootstrap to pin runtime versions and generate a reproducible toolchain."],evidencePath:a};try{let i=JSON.parse(l.readFileSync(a,"utf-8")),c=f(i.runtime),n=["python","node","go","java"].filter(r=>{let u=f(c[r]);return typeof u.version=="string"&&u.version.trim().length>0});if(n.length===0)return {gate:"env",status:"fail",summary:"No runtime versions are pinned in toolchain.lock",details:["Pin at least one runtime version via workspai setup <runtime> and re-run bootstrap."],evidencePath:a};if(e!=="unknown"){let r=f(c[e]);if(typeof r.version!="string"||r.version.trim().length===0)return {gate:"env",status:"fail",summary:`${s?.hasRegisteredProjects?"Project runtime":"Workspace"} (${e}) is not pinned in toolchain.lock`,details:[`Run workspai setup ${e} and workspai bootstrap to lock ${e} for this workspace.`],evidencePath:a}}return {gate:"env",status:"pass",summary:`Pinned runtimes: ${n.join(", ")}`,details:[],evidencePath:a}}catch{return {gate:"env",status:"fail",summary:"toolchain.lock is invalid JSON",details:["Regenerate lockfile with workspai bootstrap."],evidencePath:a}}}function W(t){let e=P(t,"doctor-last-run.json");if(!l.existsSync(e))return {payload:null,path:e};try{let s=JSON.parse(l.readFileSync(e,"utf-8"));return c(s,"workspace")?{payload:s,path:e}:{payload:null,path:e}}catch{return {payload:null,path:e}}}function _(t){let e=W(t);if(!e.payload)return {gate:{gate:"doctor",status:"fail",summary:"Doctor evidence is missing",details:["Run workspai doctor workspace --json before release readiness checks."],evidencePath:e.path},payload:null};let s=f(e.payload.summary),a=Number(s.totalIssues??0);return s.hasSystemErrors?{gate:{gate:"doctor",status:"fail",summary:"Doctor reported system errors",details:["Resolve system-level doctor errors before proceeding."],evidencePath:e.path},payload:e.payload}:a>0?{gate:{gate:"doctor",status:"warn",summary:`Doctor found ${a} issue(s)`,details:["Run workspai doctor workspace --fix and re-run readiness checks."],evidencePath:e.path},payload:e.payload}:{gate:{gate:"doctor",status:"pass",summary:"Doctor checks passed without issues",details:[],evidencePath:e.path},payload:e.payload}}function H(t){let e=P(t,"analyze-last-run.json");if(!l.existsSync(e))return {gate:"analyze",status:"fail",summary:"Analyze evidence is missing",details:["Run workspai analyze --json before release readiness checks."],evidencePath:e};try{let s=JSON.parse(l.readFileSync(e,"utf-8")),a=f(s.summary),i=String(a.verdict??"").toLowerCase(),c=Number(a.score??0),o=f(a.findings),n=Number(o.fail??0);return i==="blocked"||n>0?{gate:"analyze",status:"fail",summary:`Analyze verdict is blocked (score ${c}/100)`,details:["Resolve analyze findings and regenerate analyze-last-run.json."],evidencePath:e}:i==="needs-attention"?{gate:"analyze",status:"warn",summary:`Analyze needs attention (score ${c}/100)`,details:["Review analyze warnings before release."],evidencePath:e}:{gate:"analyze",status:"pass",summary:`Analyze passed (score ${c}/100)`,details:[],evidencePath:e}}catch{return {gate:"analyze",status:"fail",summary:"Analyze evidence is invalid JSON",details:["Re-run workspai analyze --json to regenerate evidence."],evidencePath:e}}}function K(t){try{let e=JSON.parse(l.readFileSync(t,"utf-8")),s=String(e.status??"").toLowerCase(),a=f(e.summary),i=Number(a.failedChecks??0);return s==="fail"||i>0?{gate:"verify",status:"fail",summary:"Verify-pack contract reports failed checks",details:["Fix failed verify checks and regenerate verify-pack contract evidence."],evidencePath:t}:s==="pass"?{gate:"verify",status:"pass",summary:"Verify-pack contract passed",details:[],evidencePath:t}:{gate:"verify",status:"warn",summary:"Verify-pack contract status is not explicit",details:["Ensure contract status is pass/fail and keep schema aligned with v1 contract."],evidencePath:t}}catch{return {gate:"verify",status:"fail",summary:"Verify-pack contract is invalid JSON",details:["Regenerate verify-pack contract artifact."],evidencePath:t}}}async function B(t,e){if(e.skipVerify)return {gate:"verify",status:"pass",summary:"Verify gate skipped (--skip-verify)",details:["Verification was explicitly skipped for this readiness run."]};let s=[a$1(t,".workspai/reports"),p.join(t,".rapidkit","reports")],a=s[0],i=s.map(n=>$(n,[/verify-pack-contract/i,/^verify.*\.json$/i])).find(n=>typeof n=="string")??null;if(i)return K(i);let c=a$1(t,".workspai/reports/workspace-contract-verify-last-run.json"),o=s.map(n=>$(n,[/workspace-contract-verify-last-run/i,/workspace-contract-verify/i])).find(n=>typeof n=="string")??null;if(o)try{let n=JSON.parse(l.readFileSync(o,"utf-8")),r=String(n.status??"").toLowerCase();if(r==="passed"||r==="pass")return {gate:"verify",status:"pass",summary:"Workspace contract verification passed (CLI cache)",details:[],evidencePath:o};if(r==="failed"||r==="fail")return {gate:"verify",status:"fail",summary:"Workspace contract verification failed (CLI cache)",details:(Array.isArray(n.violations)?n.violations:[]).slice(0,5),evidencePath:o}}catch{}try{let{verifyWorkspaceContract:n}=await import('./workspace-contract-2TA27LGT.js'),r=await n({workspacePath:t}),u={schemaVersion:"v1",source:"cli",generatedAt:new Date().toISOString(),status:r.status,contractPath:r.contractPath,projectCount:r.projectCount,checks:r.checks,violations:r.violations};return await d$2(t,".workspai/reports/workspace-contract-verify-last-run.json",u),r.status==="failed"?{gate:"verify",status:"fail",summary:"Workspace contract verification failed (CLI)",details:r.violations.slice(0,5),evidencePath:c}:{gate:"verify",status:"pass",summary:"Workspace contract verification passed (CLI)",details:[],evidencePath:c}}catch(n){return {gate:"verify",status:"fail",summary:"No verify evidence and workspace contract verification unavailable",details:["Run workspai workspace contract verify --json or export verify-pack contract from CI.",n instanceof Error?n.message:String(n)],evidencePath:p.join(a,"*verify*.json")}}}function U(t,e){let s=P(e,"doctor-last-run.json");if(!t)return {gate:"dependency",status:"warn",summary:"Dependency risk check skipped (doctor evidence missing)",details:["Run workspai doctor workspace --json to include dependency findings."],evidencePath:s};let a=Array.isArray(t.projects)?t.projects:[],i=a.reduce((o,n)=>{let r=Number(n.vulnerabilities??0);return Number.isFinite(r)?o+Math.max(0,r):o},0),c=a.filter(o=>o.depsInstalled===false).length;return i>0?{gate:"dependency",status:"fail",summary:`${i} dependency vulnerability(ies) reported`,details:["Resolve vulnerabilities (npm/pip/go audit pipelines) before release."],evidencePath:s}:c>0?{gate:"dependency",status:"warn",summary:`${c} project(s) report missing dependencies`,details:["Run project init/bootstrap and regenerate doctor evidence."],evidencePath:s}:{gate:"dependency",status:"pass",summary:"No dependency vulnerabilities reported",details:[],evidencePath:s}}function q(t){return t.some(e=>e.status==="fail")?"fail":t.some(e=>e.status==="warn")?"warn":"pass"}async function Q(t,e){return d$2(t,".workspai/reports/release-readiness-last-run.json",e)}async function T(t={}){let e$1=p.resolve(t.startPath??process.cwd()),s=a(e$1)??e$1,a$1=await F(s)>0,i=a$1&&b(e$1)?s:D(e$1,s),c=i===s?"unknown":J(i),n=M(s,a$1?c:"unknown",{hasRegisteredProjects:a$1}),r=_(s),u=H(s),m=await B(s,{skipVerify:t.skipVerify}),z=U(r.payload,s),h=[n,r.gate,u,m,z],v=q(h),g={schemaVersion:L,generatedAt:new Date().toISOString(),workspacePath:s,projectPath:i,action:t.action,overallStatus:v,blocking:v==="fail",blockingReasons:h.filter(y=>y.status==="fail").map(y=>`${y.gate}: ${y.summary}`),gates:h};if(t.writeReport!==false){let y=f$1(g,{commandId:"workspaceReadiness",exitCode:v==="fail"?2:v==="warn"?1:0,generatedAt:g.generatedAt,blockers:g.blockingReasons,runId:e()});g.evidencePath=await Q(s,y);}return g}function X(t){return t==="pass"?d.green("PASS"):t==="warn"?d.yellow("WARN"):d.red("FAIL")}function Y(t){return t==="pass"?d.green("PASS"):t==="warn"?d.yellow("WARN"):d.red("FAIL")}async function de(t){let e=await T({writeReport:true,skipVerify:t.skipVerify===true});if(t.json)console.log(JSON.stringify(e,null,2));else {console.log(d.bold.cyan(`
|
|
2
2
|
\u{1F6A6} Workspai Release Readiness
|
|
3
3
|
`)),console.log(d.bold(`Workspace: ${d.cyan(p.basename(e.workspacePath))}`)),console.log(d.gray(`Path: ${e.workspacePath}`)),console.log(`Overall: ${Y(e.overallStatus)}`);for(let s of e.gates){console.log(` - ${s.gate}: ${X(s.status)} ${s.summary}`);for(let a of s.details)console.log(d.gray(` ${a}`));s.evidencePath&&console.log(d.gray(` evidence: ${s.evidencePath}`));}e.evidencePath&&console.log(d.gray(`
|
|
4
4
|
Evidence saved: ${e.evidencePath}`));}t.strict&&e.overallStatus!=="pass"&&process.exit(1);}export{T as a,de as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-3QVTWKUI.js';import {a as a$3}from'./chunk-22DT744Z.js';import {a as a$2,e}from'./chunk-753LOKFZ.js';import {c,a,d}from'./chunk-NAAQMSO3.js';import l from'chalk';import ee from'fs';import b from'path';import {execa}from'execa';var O="autopilot-release-last-run.json",K="autopilot-release.json";function $(s){try{return JSON.parse(s)}catch{return null}}function ke(s){let e=b.resolve(s),a=a$3(e);if(!a)throw new Error("No Workspai workspace found in current directory or parents");return a}async function S(s,e){let a=process.argv[1];if(!a)return {exitCode:1,stdout:"",stderr:"RapidKit entrypoint is unavailable for autopilot execution.",crashed:true};try{let o=await execa(process.execPath,[a,...s],{cwd:e,reject:false,env:{...process.env,RAPIDKIT_AUTOPILOT_CHILD:"1"}});return {exitCode:Number(o.exitCode??1),stdout:o.stdout,stderr:o.stderr,crashed:false}}catch(o){return {exitCode:1,stdout:"",stderr:o instanceof Error?o.message:String(o),crashed:true}}}function te(s){let e=s.toLowerCase();return e==="pass"?"pass":e==="warn"?"warn":e==="fail"?"fail":"warn"}function se(s){return s.summary.failed>0||s.gates.results.some(e=>e.status==="fail")?"fail":s.gates.results.some(e=>e.status==="warn")?"warn":"pass"}function he(s){let e=s.filter(o=>o.status!=="skipped");if(e.length===0)return 100;let a=e.reduce((o,t)=>t.status==="pass"?o+1:t.status==="warn"?o+.6:o,0);return Math.round(a/e.length*100)}function ye(s){return s.executionError?["Re-run: npx workspai autopilot release --mode audit --json","Inspect .workspai/reports/autopilot-release-last-run.json for execution failure details"]:s.blockers.length>0?["Run: npx workspai doctor workspace --plan","Run: npx workspai readiness --json --strict","Run: npx workspai workspace run test --affected --strict"]:s.hasWarnings&&s.mode!=="enforce"?["Review warning-level findings in autopilot report","Optionally run: npx workspai autopilot release --mode safe-fix"]:["Workspace is release-ready based on current autopilot policy"]}async function Re(s,e){await ee.promises.mkdir(b.dirname(s),{recursive:true}),await ee.promises.writeFile(s,`${JSON.stringify(e,null,2)}
|
|
2
2
|
`,"utf-8");}async function De(s){let e$1=ke(s.workspacePath),a$3=s.mode,o=[],t=[],I,G,C,V,H,q=0,f=false,T=0,L=0,D=-1,N=-1,c$1="skipped",u="skipped",re=a$3==="enforce"?["doctor","workspace","--json","--strict"]:["doctor","workspace","--json","--ci"];if(s.skipPipelineStages)o.push({name:"doctor-workspace",status:"skipped",durationMs:0,summary:"doctor stage skipped (pipeline already executed)"},{name:"analyze",status:"skipped",durationMs:0,summary:"analyze stage skipped (pipeline already executed)"},{name:"readiness",status:"skipped",durationMs:0,summary:"readiness stage skipped (pipeline already executed)"});else {let r=Date.now(),i=await S([...re],e$1),m=Date.now()-r;if(c$1="pass",i.crashed)c$1="fail",f=true,t.push(`doctor workspace execution error: ${i.stderr||"unknown error"}`);else if(i.exitCode===1)c$1="fail",t.push("doctor workspace command failed or reported errors");else if(i.exitCode===2)c$1="warn",t.push("doctor workspace reported warnings");else if(i.exitCode!==0)c$1="fail",t.push("doctor workspace command failed");else {let p=$(i.stdout),j=p&&p.healthScore&&typeof p.healthScore=="object"?p.healthScore:{},h=Number(j.errors??0),E=Number(j.warnings??0);Number.isFinite(h)&&h>0?(c$1="fail",t.push(`doctor workspace reports ${h} error(s)`)):Number.isFinite(E)&&E>0&&(c$1="warn");}D=o.push({name:"doctor-workspace",status:c$1,durationMs:m,summary:c$1==="pass"?"doctor workspace passed":c$1==="warn"?"doctor workspace reported warnings":"doctor workspace reported errors"})-1,a$3==="enforce"&&c$1==="warn"&&t.push("doctor workspace reported warnings under enforce mode");let w=Date.now(),g=await S(["analyze","--json"],e$1),v=Date.now()-w;G=await c(e$1,".workspai/reports/analyze-last-run.json")??a(e$1,".workspai/reports/analyze-last-run.json");let n="pass";if(g.crashed)n="fail",f=true,t.push(`analyze execution error: ${g.stderr||"unknown error"}`);else if(g.exitCode!==0)n=g.exitCode===2?"warn":"fail",t.push(g.exitCode===2?"analyze reported needs-attention verdict":"analyze command failed or reported blocked verdict");else {let p=$(g.stdout),j=p&&p.summary&&typeof p.summary=="object"?p.summary:{},h=String(j.verdict??"ready");h==="blocked"?(n="fail",t.push("analyze reported blocked verdict")):h==="needs-attention"&&(n="warn");}o.push({name:"analyze",status:n,durationMs:v,summary:n==="pass"?"analyze passed":n==="warn"?"analyze reported needs-attention":"analyze reported blocked verdict"}),a$3==="enforce"&&n==="warn"&&t.push("analyze reported warnings under enforce mode");let P=Date.now(),k=await S(["readiness","--json"],e$1),y=Date.now()-P;if(u="fail",k.crashed)u="fail",f=true,t.push(`readiness execution error: ${k.stderr||"unknown error"}`);else if(k.exitCode!==0)u="fail",t.push("readiness command failed");else {let p=$(k.stdout),j=String(p?.overallStatus??"fail");if(u=te(j),typeof p?.evidencePath=="string"&&p.evidencePath.trim().length>0&&(I=p.evidencePath),u==="fail"){let h=Array.isArray(p?.blockingReasons)?p?.blockingReasons.filter(E=>typeof E=="string"):[];h.length>0?t.push(...h.map(E=>`readiness: ${E}`)):t.push("readiness overall status is fail");}}N=o.push({name:"readiness",status:u,durationMs:y,summary:`readiness overall status is ${u}`})-1,a$3==="enforce"&&u==="warn"&&t.push("readiness reported warnings under enforce mode");}let oe=Date.now(),W=await S(["doctor","workspace","--plan","--json"],e$1),ae=Date.now()-oe,R="warn";if(W.crashed)R="fail",f=true,t.push(`doctor remediation plan execution error: ${W.stderr||"unknown error"}`);else if(W.exitCode!==0)R="fail",t.push("doctor remediation plan command failed");else {let r=$(W.stdout),i=r&&r.remediationPlan&&typeof r.remediationPlan=="object"?r.remediationPlan:null,m=Number(i?.totalSteps??0),w=Number(i?.executableSteps??0);Number.isFinite(m)&&m>0&&(T=m),Number.isFinite(w)&&w>0&&(L=w),Number.isFinite(m)&&m===0?R="pass":R="warn";}if(o.push({name:"remediation-plan",status:R,durationMs:ae,summary:R==="pass"?"no remediation steps required":"remediation steps available"}),a$3==="enforce"&&R==="warn"&&t.push("remediation plan has pending steps under enforce mode"),a$3==="safe-fix"){let r=Date.now(),i=await S(["doctor","workspace","--apply"],e$1),m=Date.now()-r,w=i.crashed||i.exitCode!==0?"fail":"pass";if(i.crashed)f=true,t.push(`doctor remediation apply execution error: ${i.stderr||"unknown error"}`);else if(w==="fail")t.push("doctor remediation apply failed");else {q=L>0?L:T>0?T:1;let g=await S(["doctor","workspace","--json"],e$1);if(g.crashed)c$1="fail",f=true,t.push(`post-apply doctor execution error: ${g.stderr||"unknown error"}`);else if(g.exitCode!==0)c$1="fail",t.push("post-apply doctor workspace command failed");else {let n=$(g.stdout),P=n&&n.healthScore&&typeof n.healthScore=="object"?n.healthScore:{},k=Number(P.errors??0),y=Number(P.warnings??0);Number.isFinite(k)&&k>0?(c$1="fail",t.push(`post-apply doctor reports ${k} error(s)`)):Number.isFinite(y)&&y>0?c$1="warn":c$1="pass";}D>=0&&(o[D].status=c$1,o[D].summary=`doctor workspace post-apply status is ${c$1}`);let v=await S(["readiness","--json"],e$1);if(v.crashed)u="fail",f=true,t.push(`post-apply readiness execution error: ${v.stderr||"unknown error"}`);else if(v.exitCode!==0)u="fail",t.push("post-apply readiness command failed");else {let n=$(v.stdout),P=String(n?.overallStatus??"fail");if(u=te(P),typeof n?.evidencePath=="string"&&n.evidencePath.trim().length>0&&(I=n.evidencePath),u==="fail"){let k=Array.isArray(n?.blockingReasons)?n?.blockingReasons.filter(y=>typeof y=="string"):[];k.length>0?t.push(...k.map(y=>`post-apply readiness: ${y}`)):t.push("post-apply readiness overall status is fail");}}N>=0&&(o[N].status=u,o[N].summary=`readiness post-apply overall status is ${u}`);}o.push({name:"remediation-apply",status:w,durationMs:m,summary:w==="pass"?"safe remediation apply completed":"safe remediation apply failed"});}else o.push({name:"remediation-apply",status:"skipped",durationMs:0,summary:"remediation apply is skipped for this mode"});let ne=Date.now(),x="pass",A="workspace test/build completed for selected projects";try{let r=await a$1({workspacePath:e$1,stage:"test",affected:true,since:s.since,parallel:s.parallel,maxWorkers:s.maxWorkers,strict:true,json:true,enforceGates:false});C=a(e$1,b.join(".workspai","reports",a$2)),await e(e$1,r),V=C;let i=se(r);if(i==="fail")x="fail",A="workspace test stage failed for selected projects",t.push("workspace run test failed for selected projects");else {i==="warn"&&(x="warn",A="workspace test stage completed with warnings",a$3==="enforce"&&t.push("workspace run test reported warnings under enforce mode"));let m=await a$1({workspacePath:e$1,stage:"build",affected:true,since:s.since,parallel:s.parallel,maxWorkers:s.maxWorkers,strict:true,json:true,enforceGates:false});await e(e$1,m),H=C;let w=se(m);w==="fail"?(x="fail",A="workspace build stage failed for selected projects",t.push("workspace run build failed for selected projects")):w==="warn"&&(x="warn",A="workspace test/build completed with warnings",a$3==="enforce"&&t.push("workspace run test/build reported warnings under enforce mode"));}}catch(r){x="fail",A="workspace test/build orchestration failed",f=true,t.push(`workspace run orchestration error: ${r instanceof Error?r.message:String(r)}`);}let ie=Date.now()-ne;o.push({name:"workspace-run-test-build",status:x,durationMs:ie,summary:A});let z=o.filter(r=>r.status==="warn").length,le=o.filter(r=>r.status==="fail").length,_=a$3==="enforce"?o.some(r=>r.status==="warn"||r.status==="fail"):le>0,M=[...new Set(t)],ce=f||_?Math.max(1,M.length):0,pe=he(o),ue=f||_?"blocked":z>0?"partial":"approved",de=f?3:_?1:z>0?2:0,fe=ye({mode:a$3,executionError:f,blockers:M,hasWarnings:z>0}),Q=a(e$1,".workspai/reports"),me=b.join(Q,O),we=b.join(Q,K),d$1={schemaVersion:"autopilot-release-v1",generatedAt:new Date().toISOString(),workspacePath:e$1,mode:a$3,summary:{releaseScore:pe,verdict:ue,blockers:ce,warnings:z,safeFixesApplied:q,manualActions:M.length,exitCode:de},stages:o,blockingReasons:M,nextActions:fe,artifacts:{reportPath:me,aliasEvidencePath:we,analyzeEvidencePath:G,readinessEvidencePath:I,workspaceRunEvidencePath:C,workspaceRunTestPath:V,workspaceRunBuildPath:H},enterpriseControls:{jsonReady:true,evidencePath:`.workspai/reports/${O}`,aliasEvidencePath:`.workspai/reports/${K}`}};if(await d(e$1,`.workspai/reports/${O}`,d$1),await d(e$1,`.workspai/reports/${K}`,d$1),s.output&&await Re(b.resolve(s.output),d$1),!s.json){console.log(l.bold.cyan(`
|
|
3
3
|
\u{1F680} Workspai Autopilot Release
|
|
4
4
|
`)),console.log(l.bold(`Workspace: ${l.cyan(b.basename(e$1))}`)),console.log(l.gray(`Path: ${e$1}`)),console.log(l.white(`Mode: ${a$3}`)),console.log(l.white(`Verdict: ${d$1.summary.verdict==="approved"?l.green("approved"):d$1.summary.verdict==="partial"?l.yellow("partial"):l.red("blocked")}`)),console.log(l.white(`Release score: ${d$1.summary.releaseScore}`));for(let r of d$1.stages){let i=r.status==="pass"?l.green("PASS"):r.status==="warn"?l.yellow("WARN"):r.status==="skipped"?l.gray("SKIP"):l.red("FAIL");console.log(` - ${r.name}: ${i} ${r.summary} (${r.durationMs}ms)`);}if(d$1.blockingReasons.length>0){console.log(l.bold.red(`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {c as c$1}from'./chunk-NFUXULIF.js';import {a}from'./chunk-A5FBGRJA.js';import {a as a$
|
|
2
|
-
\u2705 Synced ${p$2} project(s) to registry`)):
|
|
3
|
-
\u2705 All projects already registered (${u} found)`),{workspacePath:
|
|
1
|
+
import {c as c$1}from'./chunk-NFUXULIF.js';import {a}from'./chunk-A5FBGRJA.js';import {a as a$3}from'./chunk-GZTYAEWX.js';import {c}from'./chunk-Y45WZR5N.js';import {a as a$2}from'./chunk-TQEMLBAG.js';import {p,r}from'./chunk-LZQNVH7D.js';import {p as p$1,o}from'./chunk-5XATWNME.js';import {promises}from'fs';import n from'path';import a$1 from'chalk';import N from'ora';import {execa}from'execa';async function H(e){try{let t=await execa("git",["rev-parse","--show-toplevel"],{cwd:e,env:a$2()});return t.stdout.trim()?n.resolve(e,t.stdout.trim()):null}catch{return null}}async function J(e,t,r){if(await H(e)){t.warn("Git initialization skipped because target is already inside a git worktree");return}t.start("Initializing git repository...");try{await execa("git",["init"],{cwd:e,env:a$2()}),await execa("git",["add","."],{cwd:e,env:a$2()}),await execa("git",["commit","-m",r],{cwd:e,env:a$2()}),t.succeed("Git repository initialized");}catch{t.warn("Could not initialize git repository");}}function q(e){let t=a(e.path),r=Array.isArray(e.projects)?e.projects:[],i=[],o=new Set;for(let l of r){if(!l||typeof l.name!="string"||typeof l.path!="string")continue;let c=a(l.path);o.has(c)||(o.add(c),i.push({name:l.name,path:c}));}return {name:e.name,path:t,mode:e.mode,projects:i}}function z(e){let t=[],r=new Set;for(let i of e.workspaces||[]){if(!i||typeof i.name!="string"||typeof i.path!="string")continue;let o=q(i);r.has(o.path)||(r.add(o.path),t.push(o));}return {workspaces:t}}async function U(e){try{let t=await promises.readFile(e,"utf8"),r=JSON.parse(t);if(r&&Array.isArray(r.workspaces))return z(r)}catch{}return {workspaces:[]}}async function F(){let e={workspaces:[]},t=new Set;for(let r$1 of r()){let i=await U(r$1);for(let o of i.workspaces)t.has(o.path)||(t.add(o.path),e.workspaces.push(o));}return e}async function K(e,t){try{let r=a(e),i=p(),o=n.join(i,"workspaces.json");await promises.mkdir(i,{recursive:true});let l={name:t,path:r,mode:"full",projects:[]};for(let c=0;c<3;c+=1){let s=await F();if(s.workspaces.some(u=>u.path===r)||(s.workspaces.push(l),await promises.writeFile(o,JSON.stringify(s,null,2)),(await U(o)).workspaces.some(u=>u.path===r)))return}console.warn(a$1.gray("Note: Could not register workspace in shared registry"));}catch{console.warn(a$1.gray("Note: Could not register workspace in shared registry"));}}async function ye(e,t=false){let r=a(e),i={workspacePath:r,workspaceFound:false,added:[],skipped:0};try{let o=p(),l=n.join(o,"workspaces.json"),c=await F();if(c.workspaces.length===0)return t||console.log("\u26A0\uFE0F Workspace registry not found"),i;let s=c.workspaces.find(f=>f.path===r);if(!s)return t||console.log("\u26A0\uFE0F Workspace not registered in registry"),i;Array.isArray(s.projects)||(s.projects=[]);let p$2=0,u=0,k=[],m=[e],y=new Set;for(;m.length>0;){let f=m.shift();if(!f||y.has(f))continue;y.add(f);let $=await promises.readdir(f,{withFileTypes:true});for(let h of $){if(!h.isDirectory()||h.name.startsWith(".")||["node_modules","dist","build","target","coverage","htmlcov"].includes(h.name))continue;let _=n.join(f,h.name),g=a(_);try{let w=false;for(let j of [...p$1(g,"context.json"),...p$1(g,"project.json")])try{await promises.access(j),w=true;break}catch{}if(w){let j=n.basename(g);s.projects.some(S=>S.path===g||S.name===j)?u++:(s.projects.push({name:j,path:g}),p$2++,k.push(g),t||console.log(`\u2714 Added: ${n.relative(e,g)}`));continue}}catch{}m.push(_);}}return p$2>0?(await promises.writeFile(l,JSON.stringify(c,null,2)),t||console.log(`
|
|
2
|
+
\u2705 Synced ${p$2} project(s) to registry`)):t||console.log(`
|
|
3
|
+
\u2705 All projects already registered (${u} found)`),{workspacePath:r,workspaceFound:true,added:k,skipped:u}}catch(o){return t||console.error("\u274C Failed to sync projects:",o.message),i}}async function $e(e,t,r){try{let i=a(e),o=a(r),l=p(),c=n.join(l,"workspaces.json"),s=await F();if(s.workspaces.length===0)return;let p$1=s.workspaces.find(m=>m.path===i);if(!p$1)return;Array.isArray(p$1.projects)||(p$1.projects=[]);let u=p$1.projects.findIndex(m=>m.path===o||m.name===t),k={name:t,path:o};if(u>=0){let m=p$1.projects[u];(m.name!==k.name||m.path!==k.path)&&(p$1.projects[u]=k,await promises.writeFile(c,JSON.stringify(s,null,2)));}else p$1.projects.push({name:t,path:o}),await promises.writeFile(c,JSON.stringify(s,null,2));}catch{}}async function je(e,t){let r=N("Creating Workspai workspace...").start();try{await promises.mkdir(e,{recursive:true}),await promises.mkdir(n.join(e,".workspai"),{recursive:true});let i={workspace_name:t.name,author:t.author,rapidkit_version:c(),created_at:new Date().toISOString(),type:"workspace"};await promises.writeFile(n.join(e,".workspai","config.json"),JSON.stringify(i,null,2));let{syncWorkspaceFoundationFiles:o}=await import('./create-42RTNLH2.js');await o(e,{workspaceName:t.name,installMethod:"venv",writeMarker:true,writeGitignore:false,onlyIfMissing:true});let{publishWorkspaceRegistrySummary:l}=await import('./workspace-registry-summary-6MFBRWDS.js');await l(e);let c$1=Q();await promises.writeFile(n.join(e,"rapidkit"),c$1),await promises.chmod(n.join(e,"rapidkit"),493);let s=X();await promises.writeFile(n.join(e,"rapidkit.cmd"),s);let p=Z(t.name);await promises.writeFile(n.join(e,"README.md"),p),await promises.writeFile(n.join(e,".gitignore"),`# Workspai workspace
|
|
4
4
|
.env
|
|
5
5
|
.env.*
|
|
6
6
|
!.env.example
|
|
@@ -15,7 +15,7 @@ Thumbs.db
|
|
|
15
15
|
|
|
16
16
|
# Logs
|
|
17
17
|
*.log
|
|
18
|
-
`),await promises.writeFile(n.join(e,".workspai-workspace"),JSON.stringify({signature:"WORKSPAI_WORKSPACE",createdBy:"workspai-cli",version:c(),createdAt:new Date().toISOString(),name:
|
|
18
|
+
`),await promises.writeFile(n.join(e,".workspai-workspace"),JSON.stringify({signature:"WORKSPAI_WORKSPACE",createdBy:"workspai-cli",version:c(),createdAt:new Date().toISOString(),name:t.name},null,2)),await ee(e),r.succeed("Workspace created!"),t.skipGit||await J(e,N(),"Initial commit: Workspai workspace"),await K(e,t.name),console.log(`
|
|
19
19
|
${a$1.green("\u2728 Workspai workspace created successfully!")}
|
|
20
20
|
|
|
21
21
|
${a$1.bold("\u{1F4C2} Workspace structure:")}
|
|
@@ -31,7 +31,7 @@ ${e}/
|
|
|
31
31
|
\u2514\u2500\u2500 README.md
|
|
32
32
|
|
|
33
33
|
${a$1.bold("\u{1F680} Get started:")}
|
|
34
|
-
${a$1.cyan(`cd ${
|
|
34
|
+
${a$1.cyan(`cd ${t.name}`)}
|
|
35
35
|
${a$1.cyan("npx workspai create project fastapi.standard my-api --yes")}
|
|
36
36
|
${a$1.cyan("cd my-api")}
|
|
37
37
|
${a$1.cyan("npx workspai init")}
|
|
@@ -52,7 +52,7 @@ ${a$1.bold("\u{1F4DA} Commands:")}
|
|
|
52
52
|
|
|
53
53
|
${a$1.gray("Alternative: npx workspai dev, make dev")}
|
|
54
54
|
${a$1.gray("\u{1F4A1} Tip: Install globally (npm i -g workspai) to use without npx")}
|
|
55
|
-
`);}catch(i){throw
|
|
55
|
+
`);}catch(i){throw r.fail("Failed to create workspace"),i}}function Q(){return `#!/usr/bin/env bash
|
|
56
56
|
#
|
|
57
57
|
# Workspai CLI - local workspace commands
|
|
58
58
|
# This script provides legacy ./rapidkit commands within the workspace
|
|
@@ -438,7 +438,7 @@ main() {
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
main "$@"
|
|
441
|
-
`}function
|
|
441
|
+
`}function X(){return `@echo off
|
|
442
442
|
setlocal enabledelayedexpansion
|
|
443
443
|
|
|
444
444
|
set "SCRIPT_DIR=%~dp0"
|
|
@@ -458,7 +458,7 @@ if %ERRORLEVEL%==0 (
|
|
|
458
458
|
echo [Workspai] No sh/bash found. Falling back to npx workspai.
|
|
459
459
|
npx workspai %*
|
|
460
460
|
exit /b %ERRORLEVEL%
|
|
461
|
-
`}function
|
|
461
|
+
`}function Z(e){return `# ${e}
|
|
462
462
|
|
|
463
463
|
Workspai workspace for building API projects.
|
|
464
464
|
|
|
@@ -504,7 +504,7 @@ npx workspai dev # Start dev server
|
|
|
504
504
|
|
|
505
505
|
- [Workspai Documentation](https://workspai.dev)
|
|
506
506
|
- [GitHub Repository](https://github.com/rapidkitlabs/workspai)
|
|
507
|
-
`}async function
|
|
507
|
+
`}async function ee(e){let{fileURLToPath:t}=await import('url'),r=t(import.meta.url),i=n.dirname(r),o=n.resolve(i,".."),l=n.join(o,"templates","kits"),c=n.join(e,".workspai","templates"),{default:s}=await import('fs-extra');await s.copy(l,c);let p=n.join(o,"templates","generator.js"),u=n.join(e,".workspai","generator.js");await s.copy(p,u);}async function ve(e,t){let r=t.template==="fastapi",i=r?"FastAPI":"NestJS",o=N(`Creating ${i} project...`).start();try{let{fileURLToPath:l}=await import('url'),c$1=l(import.meta.url),s=n.dirname(c$1),p=n.resolve(s,".."),u=r?"fastapi-standard":"nestjs-standard",k=n.join(p,"templates","kits",u);await promises.mkdir(e,{recursive:true});let m={project_name:r?t.name.replace(/-/g,"_").toLowerCase():t.name.replace(/_/g,"-").toLowerCase(),author:t.author,description:t.description||`${i} application generated with Workspai`,app_version:"0.1.0",license:"MIT",package_manager:t.package_manager||"npm",created_at:new Date().toISOString(),rapidkit_version:c()};await V(k,e,m);let y=r?`# Python
|
|
508
508
|
__pycache__/
|
|
509
509
|
*.py[cod]
|
|
510
510
|
*$py.class
|
|
@@ -572,7 +572,7 @@ Thumbs.db
|
|
|
572
572
|
|
|
573
573
|
# Coverage
|
|
574
574
|
coverage/
|
|
575
|
-
`;if(await promises.writeFile(n.join(e,".gitignore")
|
|
575
|
+
`;if(await promises.writeFile(n.join(e,".gitignore"),y),o.succeed(`${i} project created!`),t.skipGit||await J(e,N(),`Initial commit: ${i} project via Workspai`),!t.skipInstall&&!r){let $=t.package_manager||"npm",h=N(`Installing dependencies with ${$}...`).start();try{await execa($,["install"],{cwd:e}),h.succeed("Dependencies installed");}catch{h.warn(`Could not install dependencies. Run '${$} install' manually.`);}}let f=n.basename(e);console.log(r?`
|
|
576
576
|
${a$1.green("\u2728 FastAPI project created successfully!")}
|
|
577
577
|
|
|
578
578
|
${a$1.bold("\u{1F4C2} Project structure:")}
|
|
@@ -619,7 +619,7 @@ ${e}/
|
|
|
619
619
|
|
|
620
620
|
${a$1.bold("\u{1F680} Get started:")}
|
|
621
621
|
${a$1.cyan(`cd ${f}`)}
|
|
622
|
-
${
|
|
622
|
+
${t.skipInstall?a$1.cyan("npx workspai init")+a$1.gray(" # npm install")+`
|
|
623
623
|
`:""}${a$1.cyan("cp .env.example .env")}
|
|
624
624
|
${a$1.cyan("npx workspai dev")} ${a$1.gray("# Start dev server")}
|
|
625
625
|
|
|
@@ -638,16 +638,16 @@ ${a$1.bold("\u{1F310} API endpoints:")}
|
|
|
638
638
|
http://localhost:8000/examples/notes # Example API
|
|
639
639
|
|
|
640
640
|
${a$1.gray("\u{1F4A1} Tip: Install globally (npm i -g workspai) to use without npx")}
|
|
641
|
-
`);}catch(l){throw o.fail(`Failed to create ${i} project`),l}}async function
|
|
641
|
+
`);}catch(l){throw o.fail(`Failed to create ${i} project`),l}}async function V(e,t,r){let i=await promises.readdir(e,{withFileTypes:true});for(let o of i){let l=n.join(e,o.name),c=o.name.replace(/\.j2$/,""),s=n.join(t,c);if(o.isDirectory())await promises.mkdir(s,{recursive:true}),await V(l,s,r);else {let p=await promises.readFile(l,"utf-8");o.name.endsWith(".j2")&&(p=te(p,r)),await promises.writeFile(s,p),(c==="rapidkit"||c==="activate"||c.endsWith(".py")&&(s.includes(".workspai")||s.includes(".rapidkit")))&&await promises.chmod(s,493);}}}function te(e,t){let r=e;for(let[i,o]of Object.entries(t)){let l=new RegExp(`\\{\\{\\s*${i}\\s*\\}\\}`,"g");r=r.replace(l,String(o));let c=new RegExp(`\\{\\{\\s*${i}\\s*\\|\\s*replace\\s*\\(\\s*['"]([^'"]+)['"]\\s*,\\s*['"]([^'"]*)['"]\\s*\\)\\s*\\}\\}`,"g");r=r.replace(c,(u,k,m)=>String(o).replace(new RegExp(k,"g"),m));let s=new RegExp(`\\{\\{\\s*${i}\\s*\\|\\s*lower\\s*\\}\\}`,"g");r=r.replace(s,String(o).toLowerCase());let p=new RegExp(`\\{\\{\\s*${i}\\s*\\|\\s*replace\\s*\\(\\s*['"]([^'"]+)['"]\\s*,\\s*['"]([^'"]*)['"]\\s*\\)\\s*\\|\\s*lower\\s*\\}\\}`,"g");r=r.replace(p,(u,k,m)=>String(o).replace(new RegExp(k,"g"),m).toLowerCase());}return r}async function _e(e={}){let t=p(),r=n.join(t,"workspaces.json"),i=await F();if(i.workspaces.length===0){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:r,workspaces:[],summary:{total:0,missing:0,registryExists:false}},null,2));return}console.log(a$1.yellow(`
|
|
642
642
|
\u26A0\uFE0F No workspaces registered yet.
|
|
643
643
|
`)),console.log(a$1.gray(`Create a workspace with: npx workspai <workspace-name>
|
|
644
|
-
`));return}try{let o=i;if(!o||typeof o!="object"||!Array.isArray(o.workspaces)){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:
|
|
644
|
+
`));return}try{let o=i;if(!o||typeof o!="object"||!Array.isArray(o.workspaces)){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:r,workspaces:[],summary:{total:0,missing:0,registryExists:true,registryValid:false},error:{code:"workspace.registry.invalid",message:"Workspace registry is invalid."}},null,2));return}console.log(a$1.yellow(`
|
|
645
645
|
\u26A0\uFE0F Workspace registry is invalid; resetting to empty state.
|
|
646
|
-
`)),await promises.writeFile(
|
|
646
|
+
`)),await promises.writeFile(r,JSON.stringify({workspaces:[]},null,2));return}let l=z(o),c=[],s=0;for(let m of l.workspaces)await promises.stat(m.path).catch(()=>null)?c.push(m):s+=1;let p={workspaces:c},u=JSON.stringify(o),k=JSON.stringify(p);if(!e.json&&u!==k&&await promises.writeFile(r,JSON.stringify(p,null,2)),!p.workspaces||p.workspaces.length===0){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:r,workspaces:[],summary:{total:0,missing:s,registryExists:true,registryValid:true,cleanupApplied:false}},null,2));return}console.log(a$1.yellow(`
|
|
647
647
|
\u26A0\uFE0F No workspaces registered yet.
|
|
648
648
|
`)),s>0&&console.log(a$1.gray(`Cleaned ${s} stale workspace entr${s===1?"y":"ies"}.
|
|
649
|
-
`));return}if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:
|
|
649
|
+
`));return}if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:r,workspaces:p.workspaces,summary:{total:p.workspaces.length,missing:s,registryExists:true,registryValid:true,cleanupApplied:false}},null,2));return}console.log(a$1.bold(`
|
|
650
650
|
\u{1F4E6} Registered Workspai Workspaces:
|
|
651
651
|
`));for(let m of p.workspaces)console.log(a$1.cyan(` ${m.name}`)),console.log(a$1.gray(` Path: ${m.path}`)),console.log(a$1.gray(` Projects: ${m.projects?.length||0}`)),console.log();s>0&&console.log(a$1.gray(`Cleaned ${s} stale workspace entr${s===1?"y":"ies"}.`)),console.log(a$1.gray(`Total: ${p.workspaces.length} workspace(s)
|
|
652
|
-
`));}catch(o){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:
|
|
653
|
-
\u274C Failed to read workspace registry`)),console.error(a$1.gray(String(o)));}}async function
|
|
652
|
+
`));}catch(o){if(e.json){console.log(JSON.stringify({schemaVersion:"rapidkit-workspace-list-v1",registryPath:r,workspaces:[],summary:{total:0,missing:0,registryExists:true,registryValid:false},error:{code:"workspace.registry.read_failed",message:o.message}},null,2));return}console.error(a$1.red(`
|
|
653
|
+
\u274C Failed to read workspace registry`)),console.error(a$1.gray(String(o)));}}async function re(e){try{let t=await promises.readFile(e,"utf8");return JSON.parse(t)}catch{return null}}async function D(e){for(let t of e){let r=await re(t);if(r!==null)return r}return null}function oe(e){return c$1(e)}async function ae(e){return a$3(e,{skipDirs:new Set(["node_modules","dist","build","target","coverage","htmlcov"]),includeHiddenDirs:false,descendIntoMatchedProjects:true})}async function L(e){try{return (await promises.readdir(e,{withFileTypes:true})).filter(r=>r.isFile()&&r.name.toLowerCase().endsWith(".json")).map(r=>r.name).sort((r,i)=>r.localeCompare(i))}catch{return []}}async function xe(e,t){let r=t?.includePaths===true,i=t?.includeDoctorEvidence!==false,o$1=t?.includeBlueprint!==false,l=n.resolve(e),c=await D(o(l,"workspace.json")),s=typeof c?.workspace_name=="string"&&c.workspace_name.trim()||n.basename(l),p=typeof c?.profile=="string"?c.profile:void 0,u=typeof c?.rapidkit_version=="string"?c.rapidkit_version:void 0,k=await ae(l),m=[];for(let g of k){let w=await D(p$1(g,"project.json")),j=n.relative(l,g)||".",O=n.dirname(p$1(g,n.join("reports","placeholder"))[0]),S=n.dirname(p$1(g,n.join("reports","placeholder"))[1]),W={name:n.basename(g),relative_path:j,runtime:typeof w?.runtime=="string"?w.runtime:void 0,kit_name:typeof w?.kit_name=="string"?w.kit_name:void 0,modules:Array.isArray(w?.modules)?w.modules.filter(x=>typeof x=="string"):void 0};if(r&&(W.absolute_path=g),i){let x=await D([n.join(O,"doctor-last-run.json"),n.join(S,"doctor-last-run.json")]);oe(x)&&(W.doctor_report=x);}let A=[...await L(O),...await L(S)].filter((x,M,Y)=>Y.indexOf(x)===M);A.length>0&&(W.reports=A),m.push(W);}let y=o(l,"reports"),f=[...await L(y[0]),...await L(y[1])].filter((g,w,j)=>j.indexOf(g)===w),$=await D(o(l,"workspace.contract.json")),h={schema_version:"1.1",generated_at:new Date().toISOString(),generated_by:"workspai",workspace:{name:s,relative_root:".",profile:p,rapidkit_version:u,...r?{absolute_root:l}:{}},summary:{project_count:m.length,doctor_evidence_included:i,contract_included:!!$},reports:{workspace:f},projects:m,...$?{contract:$}:{}};o$1&&(h.blueprint={schema_version:"rapidkit.workspace-blueprint.v1",purpose:"portable-reproducibility",workspace:{name:s,profile:p},projects:m.map(g=>({name:g.name,relative_path:g.relative_path,runtime:g.runtime,kit_name:g.kit_name,modules:g.modules??[],recreate_commands:[...g.kit_name?[`npx workspai create project ${g.kit_name} ${g.name} --yes --skip-install`]:[],`cd ${g.relative_path}`,"npx workspai init","npx workspai test"]})),recommended_commands:["npx workspai workspace contract verify --strict","npx workspai doctor workspace","npx workspai workspace run init --json","npx workspai workspace run test --strict --json","npx workspai readiness --strict --json"]});let _=t?.outputPath?n.resolve(t.outputPath):n.join(y[0],"share-bundle.json");return await promises.mkdir(n.dirname(_),{recursive:true}),await promises.writeFile(_,JSON.stringify(h,null,2),"utf8"),_}export{K as a,ye as b,$e as c,je as d,ve as e,_e as f,xe as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=[{id:"fastapi.standard",aliases:["fastapi","fastapi.standard"],label:"fastapi \u2014 FastAPI Standard Kit",description:"Core-backed FastAPI service scaffold.",owner:"core",runtime:"python",framework:"fastapi",moduleSupport:true,stability:"stable"},{id:"fastapi.ddd",aliases:["fastapi.ddd","fastapi-ddd"],label:"fastapi \u2014 FastAPI DDD Kit",description:"Core-backed FastAPI DDD service scaffold.",owner:"core",runtime:"python",framework:"fastapi",moduleSupport:true,stability:"stable"},{id:"nestjs.standard",aliases:["nestjs","nest","nestjs.standard"],label:"nestjs \u2014 NestJS Standard Kit",description:"Core-backed NestJS service scaffold.",owner:"core",runtime:"node",framework:"nestjs",moduleSupport:true,stability:"stable"},{id:"springboot.standard",aliases:["spring","springboot","springboot.standard","java"],label:"spring \u2014 Spring Boot Standard Kit",description:"npm-backed Spring Boot service scaffold.",owner:"npm",runtime:"java",framework:"springboot",moduleSupport:false,stability:"stable",generator:"springboot",createUsage:"workspai create project springboot.standard <name> [--java-version <major>] [--spring-boot-version <semver>] [--group-id <com.example>] [--package-name <com.example.app>] [--port <number>]"},{id:"gofiber.standard",aliases:["go","go.standard","fiber","gofiber","gofiber.standard","go/fiber"],label:"go/fiber \u2014 Go Fiber Standard Kit",description:"npm-backed Go Fiber service scaffold.",owner:"npm",runtime:"go",framework:"gofiber",moduleSupport:false,stability:"stable",generator:"gofiber",createUsage:"workspai create project gofiber.standard <name> [--output <dir>]"},{id:"gogin.standard",aliases:["gin","gogin","gogin.standard","go/gin"],label:"go/gin \u2014 Go Gin Standard Kit",description:"npm-backed Go Gin service scaffold.",owner:"npm",runtime:"go",framework:"gogin",moduleSupport:false,stability:"stable",generator:"gogin",createUsage:"workspai create project gogin.standard <name> [--output <dir>]"},{id:"dotnet.webapi.clean",aliases:["dotnet","dotnet.webapi","dotnet.webapi.clean","aspnet","aspnetcore","asp.net","asp.net-core","csharp","c#"],label:"dotnet \u2014 ASP.NET Core Clean Web API",description:"npm-backed ASP.NET Core Web API with clean architecture boundaries.",owner:"npm",runtime:"dotnet",framework:"dotnet",moduleSupport:false,stability:"preview",generator:"dotnet-webapi-clean",createUsage:"workspai create project dotnet.webapi.clean <name> [--target-framework net8.0] [--root-namespace <Company.Product>] [--port <number>]"}],i=new Map;for(let t of o){i.set(t.id.toLowerCase(),t);for(let e of t.aliases)i.set(e.toLowerCase(),t);}function s(t){return t?i.get(t.trim().toLowerCase())??null:null}function l(t){return s(t)?.id??t}function g(){return o.filter(t=>t.owner==="core"||t.generator)}function m(t){return s(t)?.owner==="npm"}async function f(t,e){if(!t.generator)throw new Error(`Kit is not backed by an npm generator: ${t.id}`);if(t.generator==="gofiber"){let{generateGoFiberKit:r}=await import('./gofiber-standard-
|
|
1
|
+
var o=[{id:"fastapi.standard",aliases:["fastapi","fastapi.standard"],label:"fastapi \u2014 FastAPI Standard Kit",description:"Core-backed FastAPI service scaffold.",owner:"core",runtime:"python",framework:"fastapi",moduleSupport:true,stability:"stable"},{id:"fastapi.ddd",aliases:["fastapi.ddd","fastapi-ddd"],label:"fastapi \u2014 FastAPI DDD Kit",description:"Core-backed FastAPI DDD service scaffold.",owner:"core",runtime:"python",framework:"fastapi",moduleSupport:true,stability:"stable"},{id:"nestjs.standard",aliases:["nestjs","nest","nestjs.standard"],label:"nestjs \u2014 NestJS Standard Kit",description:"Core-backed NestJS service scaffold.",owner:"core",runtime:"node",framework:"nestjs",moduleSupport:true,stability:"stable"},{id:"springboot.standard",aliases:["spring","springboot","springboot.standard","java"],label:"spring \u2014 Spring Boot Standard Kit",description:"npm-backed Spring Boot service scaffold.",owner:"npm",runtime:"java",framework:"springboot",moduleSupport:false,stability:"stable",generator:"springboot",createUsage:"workspai create project springboot.standard <name> [--java-version <major>] [--spring-boot-version <semver>] [--group-id <com.example>] [--package-name <com.example.app>] [--port <number>]"},{id:"gofiber.standard",aliases:["go","go.standard","fiber","gofiber","gofiber.standard","go/fiber"],label:"go/fiber \u2014 Go Fiber Standard Kit",description:"npm-backed Go Fiber service scaffold.",owner:"npm",runtime:"go",framework:"gofiber",moduleSupport:false,stability:"stable",generator:"gofiber",createUsage:"workspai create project gofiber.standard <name> [--output <dir>]"},{id:"gogin.standard",aliases:["gin","gogin","gogin.standard","go/gin"],label:"go/gin \u2014 Go Gin Standard Kit",description:"npm-backed Go Gin service scaffold.",owner:"npm",runtime:"go",framework:"gogin",moduleSupport:false,stability:"stable",generator:"gogin",createUsage:"workspai create project gogin.standard <name> [--output <dir>]"},{id:"dotnet.webapi.clean",aliases:["dotnet","dotnet.webapi","dotnet.webapi.clean","aspnet","aspnetcore","asp.net","asp.net-core","csharp","c#"],label:"dotnet \u2014 ASP.NET Core Clean Web API",description:"npm-backed ASP.NET Core Web API with clean architecture boundaries.",owner:"npm",runtime:"dotnet",framework:"dotnet",moduleSupport:false,stability:"preview",generator:"dotnet-webapi-clean",createUsage:"workspai create project dotnet.webapi.clean <name> [--target-framework net8.0] [--root-namespace <Company.Product>] [--port <number>]"}],i=new Map;for(let t of o){i.set(t.id.toLowerCase(),t);for(let e of t.aliases)i.set(e.toLowerCase(),t);}function s(t){return t?i.get(t.trim().toLowerCase())??null:null}function l(t){return s(t)?.id??t}function g(){return o.filter(t=>t.owner==="core"||t.generator)}function m(t){return s(t)?.owner==="npm"}async function f(t,e){if(!t.generator)throw new Error(`Kit is not backed by an npm generator: ${t.id}`);if(t.generator==="gofiber"){let{generateGoFiberKit:r}=await import('./gofiber-standard-B6UK5GR7.js');await r(e.projectPath,{project_name:e.projectName,module_path:e.projectName,skipGit:e.skipGit,skipInstall:e.skipInstall});return}if(t.generator==="gogin"){let{generateGoGinKit:r}=await import('./gogin-standard-BXU44VEM.js');await r(e.projectPath,{project_name:e.projectName,module_path:e.projectName,skipGit:e.skipGit,skipInstall:e.skipInstall});return}if(t.generator==="springboot"){let{generateSpringBootKit:r}=await import('./springboot-standard-PEHDKH2L.js');await r(e.projectPath,{project_name:e.projectName,artifact_id:e.projectName,java_version:a(e.args,"--java-version")?.trim(),spring_boot_version:a(e.args,"--spring-boot-version")?.trim(),springdoc_version:a(e.args,"--springdoc-version")?.trim(),group_id:a(e.args,"--group-id")?.trim(),package_name:a(e.args,"--package-name")?.trim(),description:a(e.args,"--description")?.trim(),port:a(e.args,"--port")?.trim(),skipGit:e.skipGit,skipInstall:e.skipInstall});return}if(t.generator==="dotnet-webapi-clean"){let{generateDotnetWebApiCleanKit:r}=await import('./dotnet-webapi-clean-BYUUHX5Y.js');await r(e.projectPath,{project_name:e.projectName,target_framework:a(e.args,"--target-framework")?.trim(),root_namespace:a(e.args,"--root-namespace")?.trim(),description:a(e.args,"--description")?.trim(),port:a(e.args,"--port")?.trim(),skipGit:e.skipGit,skipInstall:e.skipInstall});return}throw new Error(`Unhandled npm kit generator: ${t.generator}`)}function a(t,e){let r=t.indexOf(e);if(r>=0&&r+1<t.length)return t[r+1];let n=t.find(p=>p.startsWith(`${e}=`));return n?n.slice(e.length+1):void 0}export{s as a,l as b,g as c,m as d,f as e};
|