rapidkit 0.41.0 → 0.41.2
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 +88 -11
- package/contracts/extension-cli-compatibility.v1.json +1 -1
- package/contracts/runtime-command-surface.v1.json +3 -1
- package/contracts/workspace-intelligence/agent-action-outcome.v1.json +17 -1
- package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +24 -0
- package/contracts/workspace-intelligence/workspace-dependency-graph.v1.json +61 -1
- package/dist/analyze-QYHMGLSG.js +1 -0
- package/dist/autopilot-release-YDEUKRW6.js +1 -0
- package/dist/{chunk-WA6JYVJM.js → chunk-33LR2QEM.js} +1 -1
- package/dist/{chunk-DMUEGR36.js → chunk-3PTJID76.js} +1 -1
- package/dist/chunk-46AGNYI7.js +50 -0
- package/dist/chunk-AQ4XZZC6.js +1 -0
- package/dist/{chunk-MGUJWRZA.js → chunk-BFEBZABL.js} +3 -3
- package/dist/chunk-DWXRVGOY.js +2 -0
- package/dist/chunk-E5ZVQL3C.js +13 -0
- package/dist/chunk-ELU3G6DQ.js +9 -0
- package/dist/chunk-EN6YCX36.js +1 -0
- package/dist/chunk-FMBSON6H.js +33 -0
- package/dist/chunk-GBJBQ43T.js +1 -0
- package/dist/chunk-HYAT2EG7.js +1 -0
- package/dist/{chunk-FPUNOIAR.js → chunk-ITJ6RKUW.js} +3 -3
- package/dist/{chunk-Y2SCTWL4.js → chunk-JNXT6KJV.js} +2 -2
- package/dist/{chunk-XOVB2ZP5.js → chunk-JU3VNLTY.js} +1 -1
- package/dist/{chunk-44GSDNPQ.js → chunk-KIUSCFHF.js} +1 -1
- package/dist/{chunk-KTQZUWAM.js → chunk-RSYUNEH7.js} +13 -13
- package/dist/chunk-VDTAPIHB.js +2 -0
- package/dist/chunk-WCICO7ZB.js +13 -0
- package/dist/chunk-WRMCPKGA.js +1 -0
- package/dist/{chunk-73IS6RIM.js → chunk-ZPXMZCYG.js} +1 -1
- package/dist/{create-UGXMC4CT.js → create-RNP5ACQL.js} +1 -1
- package/dist/demo-kit-N5U3NGAE.js +149 -0
- package/dist/{doctor-LCKG5S76.js → doctor-XM6QDTDC.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +118 -117
- package/dist/{pipeline-MKNYPNGD.js → pipeline-YD2DO7XY.js} +1 -1
- package/dist/platform-capabilities-TSLK667K.js +1 -0
- package/dist/{pythonRapidkitExec-MNWRC4F2.js → pythonRapidkitExec-SGKW76XM.js} +1 -1
- package/dist/{workspace-FDMJD5XI.js → workspace-E554C5SM.js} +1 -1
- package/dist/{workspace-agent-sync-WJIZCZX5.js → workspace-agent-sync-BHE2V4KS.js} +1 -1
- package/dist/{workspace-context-RYOQYGOP.js → workspace-context-VJTXW3K4.js} +1 -1
- package/dist/{workspace-contract-ITFCJCHI.js → workspace-contract-OO4GMENV.js} +1 -1
- package/dist/workspace-explain-XJ22ZXJY.js +1 -0
- package/dist/workspace-explain-contract-24RQ7KIW.js +1 -0
- package/dist/{workspace-foundation-SILFUKL5.js → workspace-foundation-LISDH53T.js} +1 -1
- package/dist/{workspace-intelligence-YOZQBAK5.js → workspace-intelligence-EC63CRVF.js} +1 -1
- package/dist/workspace-mcp-serve-KOM2V35Q.js +3 -0
- package/dist/{workspace-model-VMMLHJWI.js → workspace-model-YL7W3573.js} +1 -1
- package/dist/workspace-registry-summary-X5WRUU3T.js +1 -0
- package/dist/workspace-run-F5FADRY5.js +1 -0
- package/dist/workspace-verify-IAUHP6Y6.js +1 -0
- package/dist/{workspace-watch-3MEZRSEE.js → workspace-watch-H2AETGFI.js} +1 -1
- package/docs/DEVELOPMENT.md +1 -1
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +1 -1
- package/docs/README.md +1 -1
- package/docs/commands-reference.md +10 -2
- package/docs/contracts/ARTIFACT_CATALOG.md +1 -1
- package/docs/contracts/README.md +11 -0
- package/package.json +7 -3
- package/scripts/enterprise-package-smoke.mjs +433 -0
- package/scripts/prepack-enterprise.mjs +40 -0
- package/templates/generator.js +175 -0
- package/templates/kits/fastapi-ddd/README.md.j2 +122 -0
- package/templates/kits/fastapi-ddd/common/env.example.j2 +10 -0
- package/templates/kits/fastapi-ddd/env.example.j2 +1 -0
- package/templates/kits/fastapi-ddd/pyproject.toml.j2 +64 -0
- package/templates/kits/fastapi-ddd/src/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/app/__init__.py.j2 +11 -0
- package/templates/kits/fastapi-ddd/src/app/application/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/application/interfaces.py.j2 +43 -0
- package/templates/kits/fastapi-ddd/src/app/application/use_cases/__init__.py.j2 +6 -0
- package/templates/kits/fastapi-ddd/src/app/application/use_cases/health.py.j2 +14 -0
- package/templates/kits/fastapi-ddd/src/app/application/use_cases/notes.py.j2 +24 -0
- package/templates/kits/fastapi-ddd/src/app/config/__init__.py.j2 +16 -0
- package/templates/kits/fastapi-ddd/src/app/domain/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/app/domain/models/__init__.py.j2 +6 -0
- package/templates/kits/fastapi-ddd/src/app/domain/models/health.py.j2 +16 -0
- package/templates/kits/fastapi-ddd/src/app/domain/models/note.py.j2 +27 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/repositories/__init__.py.j2 +6 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/repositories/health.py.j2 +17 -0
- package/templates/kits/fastapi-ddd/src/app/infrastructure/repositories/notes.py.j2 +28 -0
- package/templates/kits/fastapi-ddd/src/app/main.py.j2 +61 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/dependencies/__init__.py.j2 +19 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/router.py.j2 +10 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/routes/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/routes/health.py.j2 +27 -0
- package/templates/kits/fastapi-ddd/src/app/presentation/api/routes/notes.py.j2 +50 -0
- package/templates/kits/fastapi-ddd/src/app/shared/__init__.py.j2 +5 -0
- package/templates/kits/fastapi-ddd/src/app/shared/result.py.j2 +28 -0
- package/templates/kits/fastapi-ddd/src/cli.py.j2 +167 -0
- package/templates/kits/fastapi-ddd/src/main.py.j2 +35 -0
- package/templates/kits/fastapi-ddd/src/modules/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-ddd/src/routing/__init__.py.j2 +13 -0
- package/templates/kits/fastapi-ddd/src/routing/health.py.j2 +7 -0
- package/templates/kits/fastapi-ddd/src/routing/notes.py.j2 +7 -0
- package/templates/kits/fastapi-ddd/tests/__init__.py.j2 +1 -0
- package/templates/kits/fastapi-ddd/tests/test_app_factory.py.j2 +22 -0
- package/templates/kits/fastapi-ddd/tests/test_health.py.j2 +17 -0
- package/templates/kits/fastapi-ddd/tests/test_notes.py.j2 +27 -0
- package/templates/kits/fastapi-standard/README.md.j2 +145 -0
- package/templates/kits/fastapi-standard/common/env.example.j2 +10 -0
- package/templates/kits/fastapi-standard/env.example.j2 +1 -0
- package/templates/kits/fastapi-standard/pyproject.toml.j2 +64 -0
- package/templates/kits/fastapi-standard/src/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-standard/src/cli.py.j2 +168 -0
- package/templates/kits/fastapi-standard/src/main.py.j2 +66 -0
- package/templates/kits/fastapi-standard/src/modules/__init__.py.j2 +3 -0
- package/templates/kits/fastapi-standard/src/routing/__init__.py.j2 +16 -0
- package/templates/kits/fastapi-standard/src/routing/examples.py.j2 +71 -0
- package/templates/kits/fastapi-standard/src/routing/health.py.j2 +22 -0
- package/templates/kits/fastapi-standard/tests/__init__.py.j2 +1 -0
- package/templates/kits/fastapi-standard/tests/test_examples.py.j2 +29 -0
- package/templates/kits/fastapi-standard/tests/test_health.py.j2 +17 -0
- package/templates/kits/nestjs-standard/Dockerfile.j2 +41 -0
- package/templates/kits/nestjs-standard/README.md.j2 +139 -0
- package/templates/kits/nestjs-standard/docker-compose.yml.j2 +94 -0
- package/templates/kits/nestjs-standard/docs/README.md.j2 +15 -0
- package/templates/kits/nestjs-standard/env.example.j2 +18 -0
- package/templates/kits/nestjs-standard/eslint.config.cjs.j2 +9 -0
- package/templates/kits/nestjs-standard/jest.config.ts.j2 +22 -0
- package/templates/kits/nestjs-standard/nest-cli.json.j2 +10 -0
- package/templates/kits/nestjs-standard/package.json.j2 +101 -0
- package/templates/kits/nestjs-standard/src/app.controller.ts.j2 +14 -0
- package/templates/kits/nestjs-standard/src/app.module.ts.j2 +26 -0
- package/templates/kits/nestjs-standard/src/app.service.ts.j2 +16 -0
- package/templates/kits/nestjs-standard/src/auth/auth.controller.ts.j2 +20 -0
- package/templates/kits/nestjs-standard/src/auth/auth.module.ts.j2 +13 -0
- package/templates/kits/nestjs-standard/src/auth/auth.service.ts.j2 +6 -0
- package/templates/kits/nestjs-standard/src/auth/entities/token.entity.ts.j2 +3 -0
- package/templates/kits/nestjs-standard/src/auth/entities/user.entity.ts.j2 +3 -0
- package/templates/kits/nestjs-standard/src/auth/entities/webauthn.entity.ts.j2 +3 -0
- package/templates/kits/nestjs-standard/src/config/configuration.ts.j2 +85 -0
- package/templates/kits/nestjs-standard/src/config/index.ts.j2 +2 -0
- package/templates/kits/nestjs-standard/src/config/validation.ts.j2 +21 -0
- package/templates/kits/nestjs-standard/src/examples/dto/create-note.dto.ts.j2 +11 -0
- package/templates/kits/nestjs-standard/src/examples/examples.controller.ts.j2 +24 -0
- package/templates/kits/nestjs-standard/src/examples/examples.module.ts.j2 +10 -0
- package/templates/kits/nestjs-standard/src/examples/examples.service.ts.j2 +33 -0
- package/templates/kits/nestjs-standard/src/main.ts.j2 +53 -0
- package/templates/kits/nestjs-standard/src/modules/index.ts.j2 +25 -0
- package/templates/kits/nestjs-standard/test/app.controller.spec.ts.j2 +24 -0
- package/templates/kits/nestjs-standard/test/app.e2e-spec.ts.j2 +60 -0
- package/templates/kits/nestjs-standard/test/examples.controller.spec.ts.j2 +28 -0
- package/templates/kits/nestjs-standard/test/jest-e2e.json.j2 +15 -0
- package/templates/kits/nestjs-standard/tsconfig.build.json.j2 +12 -0
- package/templates/kits/nestjs-standard/tsconfig.json.j2 +26 -0
- package/dist/analyze-JVMUCQ22.js +0 -1
- package/dist/autopilot-release-GM5ALPWO.js +0 -1
- package/dist/chunk-424B73UF.js +0 -1
- package/dist/chunk-56RL5OB6.js +0 -2
- package/dist/chunk-AO6PG3K2.js +0 -9
- package/dist/chunk-AT3EQ2S7.js +0 -2
- package/dist/chunk-FVCZGUVX.js +0 -1
- package/dist/chunk-GX7UU7LL.js +0 -33
- package/dist/chunk-P5ODFWB2.js +0 -13
- package/dist/chunk-QN2LPLHO.js +0 -1
- package/dist/chunk-RIZCWYRR.js +0 -1
- package/dist/chunk-YOQ2546V.js +0 -50
- package/dist/chunk-Z5LKRG57.js +0 -1
- package/dist/chunk-ZQRFVFKK.js +0 -13
- package/dist/demo-kit-2VI4H6OJ.js +0 -141
- package/dist/workspace-explain-VKSUKP3O.js +0 -1
- package/dist/workspace-explain-contract-CLHQ3XEH.js +0 -1
- package/dist/workspace-mcp-serve-OOLITFCK.js +0 -3
- package/dist/workspace-registry-summary-ZXGKL2NT.js +0 -1
- package/dist/workspace-run-IHB2TPMD.js +0 -1
- package/dist/workspace-verify-3CAKAZIL.js +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-JEI6BTZI.js';import {d as d$1,b}from'./chunk-HYAT2EG7.js';import {f}from'./chunk-DWXRVGOY.js';import {a}from'./chunk-AQ4XZZC6.js';import {c,e,d}from'./chunk-GBJBQ43T.js';import {j}from'./chunk-EN6YCX36.js';import {j as j$1,a as a$2}from'./chunk-3PTJID76.js';import y from'path';import $ from'fs-extra';function B(e$1){switch(e$1){case "why":return d;case "trace":return e;default:return c}}async function C(e){try{return await $.pathExists(e)?await $.readJson(e):null}catch{return null}}function M(e,o){if(!e)return null;let s=o.trim().toLowerCase();return e.projects.find(r=>r.slug.toLowerCase()===s||r.relativePath.toLowerCase()===s)??null}function F(e,o,s){let r=s.trim().toLowerCase(),t=(e.graph?.nodes.map(i=>i.id)??e.projects.map(i=>i.name)).find(i=>i.toLowerCase()===r);if(t)return t;let d=e.projects.find(i=>[i.name,i.path,y.basename(i.path)].filter(u=>u.trim().length>0).some(u=>u.toLowerCase()===r));if(d)return d.name;let p=M(o,s);if(p){let i=e.projects.find(u=>u.path===p.relativePath||u.path.endsWith(`/${p.relativePath}`));if(i)return i.name}return s}function z(e,o){if(!e)return [];let s=o.trim().toLowerCase(),r=new Set;for(let a of e.projects){a.contracts.dependsOn?.some(t=>t.toLowerCase()===s)&&r.add(a.slug);for(let t of a.contracts.consumes??[])for(let d of e.projects)d.contracts.publishes?.includes(t)&&d.slug===s&&r.add(a.slug);}return [...r].sort()}function G(e,o){if(!e)return [];let s=o.trim().toLowerCase();return e.steps.filter(r=>r.scope==="project"&&r.project?.toLowerCase()===s&&r.command?.display).map(r=>r.command.display).slice(0,8)}function l(e,o,s){return {id:e,title:o,body:s.trim()}}async function ae(e){let o=y.resolve(e.workspacePath),s=(e.now??new Date).toISOString(),r=e.model??await j({workspacePath:o,includeEvidence:true}),a$2=e.contract;if(a$2===void 0)try{a$2=(await j$1({workspacePath:o})).contract;}catch{a$2=null;}let t=e.verify;t===void 0&&(t=await C(y.join(o,d$1)));let d=e.impact;if(d===void 0&&(d=await C(y.join(o,f))),e.target.kind==="release-blocked"){let n=t?.blockingReasons??[],c=(r.summary?.projectCount??r.projects.length)===0,g=[l("verdict",c?"Workspace scaffold posture":"Release verdict",t?c?`Scaffold posture: **${t.summary.verdict}** (exit ${t.summary.exitCode}). Freshness: **${t.freshness.verdict}**. No registered projects yet \u2014 release gates apply after the first project is added.`:`Verdict: **${t.summary.verdict}** (exit ${t.summary.exitCode}). Risk: **${t.impact.risk}**. Freshness: **${t.freshness.verdict}**.`:"No workspace verify report found. Run `npx rapidkit workspace verify --json --write` first."),l("blockers",c?"Pre-project signals":"Blocking reasons",n.length?n.map(k=>`- ${k}`).join(`
|
|
2
|
+
`):c?"No pre-project signals in the latest verify report.":"No blocking reasons in the latest verify report.")];return t?.resolutionHints?.length&&g.push(l("resolution","Resolution hints",t.resolutionHints.map(k=>`- **${k.blockerId}** (${k.resolutionClass}): ${k.commandRetryHint??k.fixHints[0]?.detail??"See fix hints"}`).join(`
|
|
3
|
+
`))),{schemaVersion:a,generatedAt:s,workspacePath:o,target:e.target,summary:t?c?b(n.length,t.summary.verdict):`Release blocked: ${t.summary.verdict} with ${n.length} blocking reason(s).`:"Release posture unknown \u2014 verify report missing.",sections:g,releaseRisk:t?.impact.risk,blockingReasons:n,resolutionHints:t?.resolutionHints}}if(e.target.kind==="blocker"){let n=e.target,m=t?.resolutionHints?.find(g=>g.blockerId===n.blockerId),c=t?.blockingReasons.find(g=>g.includes(n.blockerId))??t?.blockingReasons[0];return {schemaVersion:a,generatedAt:s,workspacePath:o,target:n,summary:m?`Blocker ${n.blockerId}: ${m.resolutionClass}`:`Blocker ${n.blockerId} (no structured hint)`,sections:[l("reason","Blocking signal",c??"No matching blocking reason in verify."),l("hint","Resolution class",m?`${m.resolutionClass}
|
|
4
|
+
|
|
5
|
+
${m.commandRetryHint??""}
|
|
6
|
+
|
|
7
|
+
${m.fixHints.map(g=>`- ${g.detail}`).join(`
|
|
8
|
+
`)}`:"Run workspace verify to emit resolutionHints for this blocker.")],blockingReasons:c?[c]:[],resolutionHints:m?[m]:[]}}if(e.target.kind==="trace"){let n=y.isAbsolute(e.target.diffRef)?e.target.diffRef:y.join(o,e.target.diffRef),m=await C(n),c=m?.summary?.changedProjects??[...new Set((m?.changes??[]).map(f=>f.project).filter(Boolean))],k=(r.summary?.projectCount??r.projects.length)===0,A=d?.transitiveImpact?.map(f=>`${f.project?.name??f.target} (d${f.distance??0}, via ${f.via??"\u2014"})`)??[],j=t?.affectedSubgraph;return {schemaVersion:a,generatedAt:s,workspacePath:o,target:e.target,summary:c?.length?`Trace from ${c.length} changed project(s) through blast radius to gate coverage.`:k?"Trace: workspace scaffold baseline \u2014 no project changes in the latest diff.":"Trace: diff baseline present with no project changes.",sections:[l("origin","Change origin",c?.length?c.map(f=>`- ${f}`).join(`
|
|
9
|
+
`):"No changed projects in diff."),l("blast-radius","Transitive impact",A.length?A.map(f=>`- ${f}`).join(`
|
|
10
|
+
`):"No transitive impact report."),l("gate","Subgraph gate",j?`Directly changed: ${j.directlyChanged}; transitive dependents: ${j.transitiveDependents}; covered: ${j.covered}; uncovered: ${j.uncovered}; unverifiable: ${j.unverifiable}.`:"No verify subgraph coverage available.")],releaseRisk:d?.summary?.risk??t?.impact.risk,blockingReasons:t?.blockingReasons}}let p=e.target.project,i=F(r,a$2,p),u=r.graph,h=u?a$1(u,i):{found:false,centrality:null,directDependents:[],transitiveDependents:[]},v=M(a$2,p),R=z(a$2,p),W=G(t,p),w=r.projects.find(n=>n.name.toLowerCase()===p.toLowerCase()),b$1=[l("overview","Project overview",w?`${w.name} (${w.frameworkDisplayName}, ${w.runtime}) at \`${w.path}\`.`:`Project **${p}** ${h.found?"exists in graph":"not found in workspace model"}.`),l("consumers","Consumers / dependents",[`Direct dependents: ${h.directDependents.join(", ")||"none"}`,`Contract consumers: ${R.join(", ")||"none"}`,`Transitive dependents (blast radius): ${h.transitiveDependents.length}`].join(`
|
|
11
|
+
`)),l("contracts","Critical contracts",v?[`Owns: ${v.contracts.owns.join(", ")||"none"}`,`Publishes: ${v.contracts.publishes.join(", ")||"none"}`,`Consumes: ${v.contracts.consumes.join(", ")||"none"}`,`APIs: ${v.contracts.apis.map(n=>n.name).join(", ")||"none"}`].join(`
|
|
12
|
+
`):"No workspace.contract.json entry for this project."),l("verification","Required verification",W.length?W.map(n=>`- ${n}`).join(`
|
|
13
|
+
`):"- `npx rapidkit workspace verify --json`\n- Project test/build via `workspace run` when configured")];h.centrality&&b$1.push(l("centrality","Graph centrality",`fanIn ${h.centrality.fanIn}, fanOut ${h.centrality.fanOut}, reach ${h.centrality.reach}, hotspot ${h.centrality.isHotspot?"yes":"no"}.`));let E=p.trim().toLowerCase(),x=n=>n.project?.name?.toLowerCase()===E||n.target.toLowerCase()===E,I=d?.affectedProjects?.find(x)?.risk??d?.transitiveImpact?.find(x)?.risk??t?.impact.risk??"unknown";return {schemaVersion:a,generatedAt:s,workspacePath:o,target:e.target,summary:`${p}: ${R.length} consumer(s), release risk **${I}**.`,sections:b$1,releaseRisk:String(I)}}async function ie(e,o,s="explain"){let r=B(s),a=y.join(o,r);return await $.ensureDir(y.dirname(a)),await $.writeJson(a,a$2(e),{spaces:2}),r}export{B as a,ae as b,ie as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a from'os';import o from'path';import p from'fs-extra';function l(n=process.platform){return n==="win32"?"windows":n==="linux"?"linux":n==="darwin"?"macos":"other"}function s(n=process.platform){return l(n)==="windows"}function E(n=process.platform){return s(n)}var u=new Set(["npx","npm","yarn","pnpm"]);function P(n){return n==="npx"?"npx-cli.js":"npm-cli.js"}function g(n,r){let e=r.npm_execpath;if(!e)return null;let t=o.basename(e).toLowerCase();if(n==="npx"&&t!=="npx-cli.js"){let i=o.join(o.dirname(e),"npx-cli.js");return p.existsSync(i)?i:null}if(n==="npm"&&t==="npx-cli.js"){let i=o.join(o.dirname(e),"npm-cli.js");return p.existsSync(i)?i:null}return p.existsSync(e)?e:null}function x(n){if(n!=="npm"&&n!=="npx")return [];let r=P(n),e=o.dirname(process.execPath),t=o.dirname(e);return [o.join(t,"lib","node_modules","npm","bin",r),o.join(t,"lib64","node_modules","npm","bin",r),o.join("/usr","lib","node_modules","npm","bin",r),o.join("/usr","local","lib","node_modules","npm","bin",r),o.join("/usr","share","nodejs","npm","bin",r)]}function J(n,r=process.platform){return h(n,r).command}function h(n,r=process.platform,e=process.env){let t=n.trim();if(!u.has(t))return {command:t,prefixArgs:[]};let i=o.dirname(process.execPath),d=s(r)?".cmd":"",f=[o.join(i,`${t}${d}`),o.join(i,t)];for(let c of f)if(p.existsSync(c))return {command:c,prefixArgs:[]};let m=g(t,e);if(m)return {command:process.execPath,prefixArgs:[m]};for(let c of x(t))if(p.existsSync(c))return {command:process.execPath,prefixArgs:[c]};return t==="npm"?{command:"corepack",prefixArgs:["npm"]}:{command:t,prefixArgs:[]}}function S(n,r=process.platform){let e=s(r)?";":":",t=o.dirname(process.execPath),i=(n??process.env.PATH??"").split(e).filter(Boolean);return i.includes(t)||i.unshift(t),i.join(e)}var j=["npm_config_package","npm_config__package"];function C(n=process.env,r=process.platform){let e=o.join(a.tmpdir(),"rapidkit-corepack"),t={...n,PATH:S(n.PATH,r),COREPACK_HOME:n.COREPACK_HOME??e};for(let i of j)delete t[i];return t}function _(n=process.platform){return s(n)?"python":"python3"}function R(n=process.platform){return s(n)?["python","py","python3"]:["python3","python"]}function v(n=14,r=10,e=process.platform){let t=[];if(s(e)){for(let i=n;i>=r;i-=1)t.push({command:"py",args:[`-3.${i}`,"--version"]});return t.push({command:"py",args:["-3","--version"]}),t.push({command:"python",args:["--version"]}),t}for(let i=n;i>=r;i-=1)t.push({command:`python3.${i}`,args:["--version"]});return t.push({command:"python3",args:["--version"]}),t.push({command:"python",args:["--version"]}),t}function D(n,r=process.platform){return s(r)?o.join(n,"Scripts"):o.join(n,"bin")}function w(n,r=process.platform){return s(r)?o.join(n,"Scripts","python.exe"):o.join(n,"bin","python")}function O(n,r=process.platform){return s(r)?o.join(n,"Scripts","rapidkit.exe"):o.join(n,"bin","rapidkit")}function B(n,r=process.platform){return s(r)?o.join(n,"Scripts","activate"):o.join(n,"bin","activate")}function K(n,r=process.platform){return s(r)?[o.join(n,"rapidkit.cmd"),o.join(n,".rapidkit","rapidkit.cmd")]:[o.join(n,"rapidkit"),o.join(n,".rapidkit","rapidkit")]}function L(n=process.env,r=process.platform){let e=n.XDG_CONFIG_HOME||n.APPDATA||o.join(a.homedir(),".config");return s(r)?o.join(e,"rapidkit"):o.join(a.homedir(),".rapidkit")}function T(n=process.env,r=process.platform){let e=[];return s(r)?(n.USERPROFILE&&e.push(o.join(n.USERPROFILE,".local","bin")),n.APPDATA&&e.push(o.join(n.APPDATA,"Python","Scripts")),n.LOCALAPPDATA&&e.push(o.join(n.LOCALAPPDATA,"Programs","Python","Scripts"))):e.push(o.join(a.homedir(),".local","bin")),[...new Set(e.filter(Boolean))]}export{l as a,s as b,E as c,J as d,h as e,S as f,C as g,_ as h,R as i,v as j,D as k,w as l,O as m,B as n,K as o,L as p,T as q};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-VDTAPIHB.js';import {a as a$2}from'./chunk-KMUWWZRT.js';import {a as a$1,e}from'./chunk-64RTZBHU.js';import l from'chalk';import Y from'fs';import y from'path';import {execa}from'execa';var Z="autopilot-release-last-run.json",ee="autopilot-release.json";function $(s){try{return JSON.parse(s)}catch{return null}}function ge(s){let t=y.resolve(s),o=a$2(t);if(!o)throw new Error("No RapidKit workspace found in current directory or parents");return o}async function b(s,t){let o=process.argv[1];if(!o)return {exitCode:1,stdout:"",stderr:"RapidKit entrypoint is unavailable for autopilot execution.",crashed:true};try{let a=await execa(process.execPath,[o,...s],{cwd:t,reject:false,env:{...process.env,RAPIDKIT_AUTOPILOT_CHILD:"1"}});return {exitCode:Number(a.exitCode??1),stdout:a.stdout,stderr:a.stderr,crashed:false}}catch(a){return {exitCode:1,stdout:"",stderr:a instanceof Error?a.message:String(a),crashed:true}}}function te(s){let t=s.toLowerCase();return t==="pass"?"pass":t==="warn"?"warn":t==="fail"?"fail":"warn"}function se(s){return s.summary.failed>0||s.gates.results.some(t=>t.status==="fail")?"fail":s.gates.results.some(t=>t.status==="warn")?"warn":"pass"}function we(s){let t=s.filter(a=>a.status!=="skipped");if(t.length===0)return 100;let o=t.reduce((a,e)=>e.status==="pass"?a+1:e.status==="warn"?a+.6:a,0);return Math.round(o/t.length*100)}function he(s){return s.executionError?["Re-run: npx rapidkit autopilot release --mode audit --json","Inspect .rapidkit/reports/autopilot-release-last-run.json for execution failure details"]:s.blockers.length>0?["Run: npx rapidkit doctor workspace --plan","Run: npx rapidkit readiness --json --strict","Run: npx rapidkit workspace run test --affected --strict"]:s.hasWarnings&&s.mode!=="enforce"?["Review warning-level findings in autopilot report","Optionally run: npx rapidkit autopilot release --mode safe-fix"]:["Workspace is release-ready based on current autopilot policy"]}async function U(s,t){await Y.promises.mkdir(y.dirname(s),{recursive:true}),await Y.promises.writeFile(s,`${JSON.stringify(t,null,2)}
|
|
2
2
|
`,"utf-8");}async function je(s){let t=ge(s.workspacePath),o=s.mode,a$2=[],e$1=[],F,B,C,O,J,G=0,f=false,I=0,T=0,D=-1,N=-1,c="skipped",p="skipped",re=o==="enforce"?["doctor","workspace","--json","--strict"]:["doctor","workspace","--json","--ci"];if(s.skipPipelineStages)a$2.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 b([...re],t),m=Date.now()-r;if(c="pass",i.crashed)c="fail",f=true,e$1.push(`doctor workspace execution error: ${i.stderr||"unknown error"}`);else if(i.exitCode===1)c="fail",e$1.push("doctor workspace command failed or reported errors");else if(i.exitCode===2)c="warn",e$1.push("doctor workspace reported warnings");else if(i.exitCode!==0)c="fail",e$1.push("doctor workspace command failed");else {let d=$(i.stdout),j=d&&d.healthScore&&typeof d.healthScore=="object"?d.healthScore:{},k=Number(j.errors??0),E=Number(j.warnings??0);Number.isFinite(k)&&k>0?(c="fail",e$1.push(`doctor workspace reports ${k} error(s)`)):Number.isFinite(E)&&E>0&&(c="warn");}D=a$2.push({name:"doctor-workspace",status:c,durationMs:m,summary:c==="pass"?"doctor workspace passed":c==="warn"?"doctor workspace reported warnings":"doctor workspace reported errors"})-1,o==="enforce"&&c==="warn"&&e$1.push("doctor workspace reported warnings under enforce mode");let g=Date.now(),w=await b(["analyze","--json"],t),v=Date.now()-g;B=y.join(t,".rapidkit","reports","analyze-last-run.json");let n="pass";if(w.crashed)n="fail",f=true,e$1.push(`analyze execution error: ${w.stderr||"unknown error"}`);else if(w.exitCode!==0)n=w.exitCode===2?"warn":"fail",e$1.push(w.exitCode===2?"analyze reported needs-attention verdict":"analyze command failed or reported blocked verdict");else {let d=$(w.stdout),j=d&&d.summary&&typeof d.summary=="object"?d.summary:{},k=String(j.verdict??"ready");k==="blocked"?(n="fail",e$1.push("analyze reported blocked verdict")):k==="needs-attention"&&(n="warn");}a$2.push({name:"analyze",status:n,durationMs:v,summary:n==="pass"?"analyze passed":n==="warn"?"analyze reported needs-attention":"analyze reported blocked verdict"}),o==="enforce"&&n==="warn"&&e$1.push("analyze reported warnings under enforce mode");let P=Date.now(),h=await b(["readiness","--json"],t),R=Date.now()-P;if(p="fail",h.crashed)p="fail",f=true,e$1.push(`readiness execution error: ${h.stderr||"unknown error"}`);else if(h.exitCode!==0)p="fail",e$1.push("readiness command failed");else {let d=$(h.stdout),j=String(d?.overallStatus??"fail");if(p=te(j),typeof d?.evidencePath=="string"&&d.evidencePath.trim().length>0&&(F=d.evidencePath),p==="fail"){let k=Array.isArray(d?.blockingReasons)?d?.blockingReasons.filter(E=>typeof E=="string"):[];k.length>0?e$1.push(...k.map(E=>`readiness: ${E}`)):e$1.push("readiness overall status is fail");}}N=a$2.push({name:"readiness",status:p,durationMs:R,summary:`readiness overall status is ${p}`})-1,o==="enforce"&&p==="warn"&&e$1.push("readiness reported warnings under enforce mode");}let ae=Date.now(),M=await b(["doctor","workspace","--plan","--json"],t),oe=Date.now()-ae,S="warn";if(M.crashed)S="fail",f=true,e$1.push(`doctor remediation plan execution error: ${M.stderr||"unknown error"}`);else if(M.exitCode!==0)S="fail",e$1.push("doctor remediation plan command failed");else {let r=$(M.stdout),i=r&&r.remediationPlan&&typeof r.remediationPlan=="object"?r.remediationPlan:null,m=Number(i?.totalSteps??0),g=Number(i?.executableSteps??0);Number.isFinite(m)&&m>0&&(I=m),Number.isFinite(g)&&g>0&&(T=g),Number.isFinite(m)&&m===0?S="pass":S="warn";}if(a$2.push({name:"remediation-plan",status:S,durationMs:oe,summary:S==="pass"?"no remediation steps required":"remediation steps available"}),o==="enforce"&&S==="warn"&&e$1.push("remediation plan has pending steps under enforce mode"),o==="safe-fix"){let r=Date.now(),i=await b(["doctor","workspace","--apply"],t),m=Date.now()-r,g=i.crashed||i.exitCode!==0?"fail":"pass";if(i.crashed)f=true,e$1.push(`doctor remediation apply execution error: ${i.stderr||"unknown error"}`);else if(g==="fail")e$1.push("doctor remediation apply failed");else {G=T>0?T:I>0?I:1;let w=await b(["doctor","workspace","--json"],t);if(w.crashed)c="fail",f=true,e$1.push(`post-apply doctor execution error: ${w.stderr||"unknown error"}`);else if(w.exitCode!==0)c="fail",e$1.push("post-apply doctor workspace command failed");else {let n=$(w.stdout),P=n&&n.healthScore&&typeof n.healthScore=="object"?n.healthScore:{},h=Number(P.errors??0),R=Number(P.warnings??0);Number.isFinite(h)&&h>0?(c="fail",e$1.push(`post-apply doctor reports ${h} error(s)`)):Number.isFinite(R)&&R>0?c="warn":c="pass";}D>=0&&(a$2[D].status=c,a$2[D].summary=`doctor workspace post-apply status is ${c}`);let v=await b(["readiness","--json"],t);if(v.crashed)p="fail",f=true,e$1.push(`post-apply readiness execution error: ${v.stderr||"unknown error"}`);else if(v.exitCode!==0)p="fail",e$1.push("post-apply readiness command failed");else {let n=$(v.stdout),P=String(n?.overallStatus??"fail");if(p=te(P),typeof n?.evidencePath=="string"&&n.evidencePath.trim().length>0&&(F=n.evidencePath),p==="fail"){let h=Array.isArray(n?.blockingReasons)?n?.blockingReasons.filter(R=>typeof R=="string"):[];h.length>0?e$1.push(...h.map(R=>`post-apply readiness: ${R}`)):e$1.push("post-apply readiness overall status is fail");}}N>=0&&(a$2[N].status=p,a$2[N].summary=`readiness post-apply overall status is ${p}`);}a$2.push({name:"remediation-apply",status:g,durationMs:m,summary:g==="pass"?"safe remediation apply completed":"safe remediation apply failed"});}else a$2.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({workspacePath:t,stage:"test",affected:true,since:s.since,parallel:s.parallel,maxWorkers:s.maxWorkers,strict:true,json:true,enforceGates:false});C=y.join(t,".rapidkit","reports",a$1),await e(t,r),O=C;let i=se(r);if(i==="fail")x="fail",A="workspace test stage failed for selected projects",e$1.push("workspace run test failed for selected projects");else {i==="warn"&&(x="warn",A="workspace test stage completed with warnings",o==="enforce"&&e$1.push("workspace run test reported warnings under enforce mode"));let m=await a({workspacePath:t,stage:"build",affected:true,since:s.since,parallel:s.parallel,maxWorkers:s.maxWorkers,strict:true,json:true,enforceGates:false});await e(t,m),J=C;let g=se(m);g==="fail"?(x="fail",A="workspace build stage failed for selected projects",e$1.push("workspace run build failed for selected projects")):g==="warn"&&(x="warn",A="workspace test/build completed with warnings",o==="enforce"&&e$1.push("workspace run test/build reported warnings under enforce mode"));}}catch(r){x="fail",A="workspace test/build orchestration failed",f=true,e$1.push(`workspace run orchestration error: ${r instanceof Error?r.message:String(r)}`);}let ie=Date.now()-ne;a$2.push({name:"workspace-run-test-build",status:x,durationMs:ie,summary:A});let z=a$2.filter(r=>r.status==="warn").length,le=a$2.filter(r=>r.status==="fail").length,L=o==="enforce"?a$2.some(r=>r.status==="warn"||r.status==="fail"):le>0,W=[...new Set(e$1)],ce=f||L?Math.max(1,W.length):0,de=we(a$2),pe=f||L?"blocked":z>0?"partial":"approved",ue=f?3:L?1:z>0?2:0,fe=he({mode:o,executionError:f,blockers:W,hasWarnings:z>0}),V=y.join(t,".rapidkit","reports"),H=y.join(V,Z),q=y.join(V,ee),u={schemaVersion:"autopilot-release-v1",generatedAt:new Date().toISOString(),workspacePath:t,mode:o,summary:{releaseScore:de,verdict:pe,blockers:ce,warnings:z,safeFixesApplied:G,manualActions:W.length,exitCode:ue},stages:a$2,blockingReasons:W,nextActions:fe,artifacts:{reportPath:H,aliasEvidencePath:q,analyzeEvidencePath:B,readinessEvidencePath:F,workspaceRunEvidencePath:C,workspaceRunTestPath:O,workspaceRunBuildPath:J},enterpriseControls:{jsonReady:true,evidencePath:`.rapidkit/reports/${Z}`,aliasEvidencePath:`.rapidkit/reports/${ee}`}};if(await U(H,u),await U(q,u),s.output&&await U(y.resolve(s.output),u),!s.json){console.log(l.bold.cyan(`
|
|
3
3
|
\u{1F680} RapidKit Autopilot Release
|
|
4
4
|
`)),console.log(l.bold(`Workspace: ${l.cyan(y.basename(t))}`)),console.log(l.gray(`Path: ${t}`)),console.log(l.white(`Mode: ${o}`)),console.log(l.white(`Verdict: ${u.summary.verdict==="approved"?l.green("approved"):u.summary.verdict==="partial"?l.yellow("partial"):l.red("blocked")}`)),console.log(l.white(`Release score: ${u.summary.releaseScore}`));for(let r of u.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(u.blockingReasons.length>0){console.log(l.bold.red(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-
|
|
1
|
+
export{c as PYTHON_FREE_WORKSPACE_PROFILES,a as buildWorkspaceManifest,f as createProject,g as registerWorkspaceAtPath,d as resolvePythonFreeFallbackProfile,b as syncWorkspaceFoundationFiles,e as writeWorkspaceLauncher}from'./chunk-RSYUNEH7.js';
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {b}from'./chunk-Q2KZIBV4.js';import {promises}from'fs';import s from'path';import L from'nunjucks';import t from'chalk';import h from'ora';import {fileURLToPath}from'url';import {execa}from'execa';import T from'crypto';var N=fileURLToPath(import.meta.url),K=s.dirname(N);function O(e=32){let i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",v=T.randomBytes(e),r="";for(let p=0;p<e;p++)r+=i[v[p]%i.length];return r}async function Q(e,i){let r=(i.template||"fastapi")==="fastapi",p=r?"FastAPI":"NestJS",d=i.kit_name||(r?"fastapi.standard":"nestjs.standard"),A=d.replace(".","/"),w=h(`Generating ${p} project...`).start();try{let u=s.resolve(K,".."),l;d==="fastapi.ddd"?l="fastapi-ddd":d.startsWith("fastapi")?l="fastapi-standard":l="nestjs-standard";let k=s.join(u,"templates","kits",l),x=L.configure(k,{autoescape:false,trimBlocks:true,lstripBlocks:true});x.addFilter("generate_secret",function(a,o=32){return O(o)});let R={project_name:i.project_name,author:i.author||"RapidKit User",description:i.description||(r?"FastAPI service generated with RapidKit":"NestJS application generated with RapidKit"),app_version:i.app_version||"0.1.0",license:i.license||"MIT",package_manager:i.package_manager||"npm",node_version:i.node_version||"20.0.0",database_type:i.database_type||"postgresql",include_caching:i.include_caching||false,created_at:new Date().toISOString(),rapidkit_version:b()},j;r?j=["src/main.py.j2","src/__init__.py.j2","src/cli.py.j2","src/routing/__init__.py.j2","src/routing/health.py.j2","src/routing/examples.py.j2","src/modules/__init__.py.j2","tests/__init__.py.j2","tests/test_health.py.j2","tests/test_examples.py.j2","README.md.j2","pyproject.toml.j2","Makefile.j2","env.example.j2",".rapidkit/__init__.py.j2",".rapidkit/project.json.j2",".rapidkit/cli.py.j2",".rapidkit/rapidkit.j2",".rapidkit/activate.j2","rapidkit.j2","rapidkit.cmd.j2"]:j=["src/main.ts.j2","src/app.module.ts.j2","src/app.controller.ts.j2","src/app.service.ts.j2","src/config/configuration.ts.j2","src/config/validation.ts.j2","src/config/index.ts.j2","src/modules/index.ts.j2","src/examples/examples.module.ts.j2","src/examples/examples.controller.ts.j2","src/examples/examples.service.ts.j2","src/examples/dto/create-note.dto.ts.j2","test/app.controller.spec.ts.j2","test/examples.controller.spec.ts.j2","test/app.e2e-spec.ts.j2","test/jest-e2e.json.j2","package.json.j2","tsconfig.json.j2","tsconfig.build.json.j2","nest-cli.json.j2","jest.config.ts.j2","eslint.config.cjs.j2","env.example.j2","docker-compose.yml.j2","Dockerfile.j2","README.md.j2",".rapidkit/project.json.j2",".rapidkit/rapidkit.j2",".rapidkit/rapidkit.cmd.j2",".rapidkit/activate.j2","rapidkit.j2","rapidkit.cmd.j2"];for(let a of j){let o=s.join(k,a);try{await promises.access(o);}catch{continue}let f=await promises.readFile(o,"utf-8"),m;try{m=x.renderString(f,R);}catch(C){throw console.error(`Failed to render template: ${a}`),C}let c=a==="env.example.j2"?".env.example":a.replace(/\.j2$/,""),_=s.join(e,c);await promises.mkdir(s.dirname(_),{recursive:true}),await promises.writeFile(_,m),(c.endsWith(".rapidkit/rapidkit")||c.endsWith(".rapidkit/cli.py")||c.endsWith(".rapidkit/activate")||c==="rapidkit")&&await promises.chmod(_,493);}if(r){let a=s.join(k,".rapidkit","context.json"),o=s.join(e,".rapidkit","context.json");try{await promises.mkdir(s.join(e,".rapidkit"),{recursive:true}),await promises.copyFile(a,o);}catch{await promises.mkdir(s.join(e,".rapidkit"),{recursive:true});let m=i.engine||"pip";await promises.writeFile(o,JSON.stringify({engine:m,created_by:"rapidkit-npm-fallback"},null,2));}}let $=s.join(e,".rapidkit");await promises.mkdir($,{recursive:true});let D=s.join($,"project.json"),F={kit_name:d,profile:A,created_at:new Date().toISOString(),created_by:"rapidkit-npm-fallback",runtime:r?"python":"node"};await promises.writeFile(D,JSON.stringify(F,null,2),"utf-8");let y=s.join(e,"rapidkit");await promises.access(y).then(()=>true).catch(()=>false)||(await promises.writeFile(y,`#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
SCRIPT_DIR="$(cd "$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
|
|
4
|
+
cd "$SCRIPT_DIR"
|
|
5
|
+
RAPIDKIT_LOCAL_LAUNCHER_BYPASS=1 npx rapidkit "$@"
|
|
6
|
+
`),await promises.chmod(y,493));let I=s.join(e,"rapidkit.cmd");await promises.access(I).then(()=>true).catch(()=>false)||await promises.writeFile(I,`@echo off
|
|
7
|
+
set RAPIDKIT_LOCAL_LAUNCHER_BYPASS=1
|
|
8
|
+
npx rapidkit %*
|
|
9
|
+
`);let E=r?`# Python
|
|
10
|
+
__pycache__/
|
|
11
|
+
*.py[cod]
|
|
12
|
+
*$py.class
|
|
13
|
+
*.so
|
|
14
|
+
.Python
|
|
15
|
+
build/
|
|
16
|
+
develop-eggs/
|
|
17
|
+
dist/
|
|
18
|
+
downloads/
|
|
19
|
+
eggs/
|
|
20
|
+
.eggs/
|
|
21
|
+
lib/
|
|
22
|
+
lib64/
|
|
23
|
+
parts/
|
|
24
|
+
sdist/
|
|
25
|
+
var/
|
|
26
|
+
wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
|
|
31
|
+
# Virtual environments
|
|
32
|
+
.venv/
|
|
33
|
+
venv/
|
|
34
|
+
ENV/
|
|
35
|
+
env/
|
|
36
|
+
|
|
37
|
+
# IDEs
|
|
38
|
+
.vscode/
|
|
39
|
+
.idea/
|
|
40
|
+
*.swp
|
|
41
|
+
*.swo
|
|
42
|
+
*~
|
|
43
|
+
|
|
44
|
+
# OS
|
|
45
|
+
.DS_Store
|
|
46
|
+
Thumbs.db
|
|
47
|
+
|
|
48
|
+
# Project specific
|
|
49
|
+
.env
|
|
50
|
+
.env.local
|
|
51
|
+
`:`# Node artifacts
|
|
52
|
+
node_modules/
|
|
53
|
+
dist/
|
|
54
|
+
.tmp/
|
|
55
|
+
.env
|
|
56
|
+
.env.*
|
|
57
|
+
!.env.example
|
|
58
|
+
|
|
59
|
+
# Logs
|
|
60
|
+
logs/
|
|
61
|
+
*.log
|
|
62
|
+
npm-debug.log*
|
|
63
|
+
yarn-debug.log*
|
|
64
|
+
yarn-error.log*
|
|
65
|
+
pnpm-debug.log*
|
|
66
|
+
|
|
67
|
+
# OS
|
|
68
|
+
.DS_Store
|
|
69
|
+
Thumbs.db
|
|
70
|
+
|
|
71
|
+
# IDEs
|
|
72
|
+
.idea/
|
|
73
|
+
.vscode/
|
|
74
|
+
|
|
75
|
+
# Coverage
|
|
76
|
+
coverage/
|
|
77
|
+
`;if(await promises.writeFile(s.join(e,".gitignore"),E),w.succeed(`${p} project generated!`),!i.skipGit){let a=h("Initializing git repository...").start();try{await execa("git",["init"],{cwd:e}),await execa("git",["add","."],{cwd:e}),await execa("git",["commit","-m",`Initial commit: ${p} project via RapidKit`],{cwd:e}),a.succeed("Git repository initialized");}catch{a.warn("Could not initialize git repository");}}if(!r&&!i.skipInstall){let a=i.package_manager||"npm",o=h(`Installing dependencies with ${a}...`).start();try{await execa(a,a==="yarn"?["install"]:a==="pnpm"?["install"]:["install"],{cwd:e}),o.succeed("Dependencies installed");}catch{o.warn(`Could not install dependencies. Run '${a} install' manually.`);}}let S=s.basename(e);console.log(`
|
|
78
|
+
${t.yellow("\u26A0\uFE0F Limited offline mode:")} This project was created using basic templates.
|
|
79
|
+
${t.gray("For full kit features, install Python 3.10+ and rapidkit-core:")}
|
|
80
|
+
${t.cyan(" sudo apt install python3 python3-pip python3-venv")}
|
|
81
|
+
${t.cyan(" pip install rapidkit-core")}
|
|
82
|
+
`),console.log(r?`
|
|
83
|
+
${t.green("\u2728 FastAPI project created successfully!")}
|
|
84
|
+
|
|
85
|
+
${t.bold("\u{1F4C2} Project structure:")}
|
|
86
|
+
${e}/
|
|
87
|
+
\u251C\u2500\u2500 .rapidkit/ # RapidKit CLI module
|
|
88
|
+
\u251C\u2500\u2500 src/
|
|
89
|
+
\u2502 \u251C\u2500\u2500 main.py # FastAPI application
|
|
90
|
+
\u2502 \u251C\u2500\u2500 cli.py # CLI commands
|
|
91
|
+
\u2502 \u251C\u2500\u2500 routing/ # API routes
|
|
92
|
+
\u2502 \u2514\u2500\u2500 modules/ # Module system
|
|
93
|
+
\u251C\u2500\u2500 tests/ # Test suite
|
|
94
|
+
\u251C\u2500\u2500 pyproject.toml # Poetry configuration
|
|
95
|
+
\u2514\u2500\u2500 README.md
|
|
96
|
+
|
|
97
|
+
${t.bold("\u{1F680} Get started:")}
|
|
98
|
+
${t.cyan(`cd ${S}`)}
|
|
99
|
+
${t.cyan("npx rapidkit init")} ${t.gray("# Install dependencies")}
|
|
100
|
+
${t.cyan("npx rapidkit dev")} ${t.gray("# Start dev server")}
|
|
101
|
+
|
|
102
|
+
${t.bold("\u{1F4DA} Available commands:")}
|
|
103
|
+
npx rapidkit init # Install dependencies (poetry install)
|
|
104
|
+
npx rapidkit dev # Start dev server with hot reload
|
|
105
|
+
npx rapidkit start # Start production server
|
|
106
|
+
npx rapidkit test # Run tests
|
|
107
|
+
npx rapidkit lint # Lint code
|
|
108
|
+
npx rapidkit format # Format code
|
|
109
|
+
|
|
110
|
+
${t.gray("Alternative: make dev, ./rapidkit dev, poetry run dev")}
|
|
111
|
+
${t.gray("\u{1F4A1} Tip: Install globally (npm i -g rapidkit) to use without npx")}
|
|
112
|
+
`:`
|
|
113
|
+
${t.green("\u2728 NestJS project created successfully!")}
|
|
114
|
+
|
|
115
|
+
${t.bold("\u{1F4C2} Project structure:")}
|
|
116
|
+
${e}/
|
|
117
|
+
\u251C\u2500\u2500 .rapidkit/ # RapidKit CLI module
|
|
118
|
+
\u251C\u2500\u2500 src/
|
|
119
|
+
\u2502 \u251C\u2500\u2500 main.ts # Application entry point
|
|
120
|
+
\u2502 \u251C\u2500\u2500 app.module.ts # Root module
|
|
121
|
+
\u2502 \u251C\u2500\u2500 config/ # Configuration
|
|
122
|
+
\u2502 \u2514\u2500\u2500 examples/ # Example module
|
|
123
|
+
\u251C\u2500\u2500 test/ # Test files
|
|
124
|
+
\u251C\u2500\u2500 package.json # Dependencies
|
|
125
|
+
\u2514\u2500\u2500 README.md
|
|
126
|
+
|
|
127
|
+
${t.bold("\u{1F680} Get started:")}
|
|
128
|
+
${t.cyan(`cd ${S}`)}
|
|
129
|
+
${t.cyan("npx rapidkit init")} ${t.gray("# Install dependencies")}
|
|
130
|
+
${t.cyan("cp .env.example .env")}
|
|
131
|
+
${t.cyan("npx rapidkit dev")} ${t.gray("# Start dev server")}
|
|
132
|
+
|
|
133
|
+
${t.bold("\u{1F4DA} Available commands:")}
|
|
134
|
+
npx rapidkit init # Install dependencies
|
|
135
|
+
npx rapidkit dev # Start dev server with hot reload
|
|
136
|
+
npx rapidkit start # Start production server
|
|
137
|
+
npx rapidkit build # Build for production
|
|
138
|
+
npx rapidkit test # Run tests
|
|
139
|
+
npx rapidkit lint # Lint code
|
|
140
|
+
npx rapidkit format # Format code
|
|
141
|
+
|
|
142
|
+
${t.bold("\u{1F310} API endpoints:")}
|
|
143
|
+
http://localhost:8000/health # Health check
|
|
144
|
+
http://localhost:8000/docs # Swagger docs
|
|
145
|
+
http://localhost:8000/examples/notes # Example API
|
|
146
|
+
|
|
147
|
+
${t.gray("Alternative: npm run start:dev, ./rapidkit dev")}
|
|
148
|
+
${t.gray("\u{1F4A1} Tip: Install globally (npm i -g rapidkit) to use without npx")}
|
|
149
|
+
`);}catch(u){throw w.fail(`Failed to generate ${p} project`),u}}export{Q as generateDemoKit};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as computeDoctorGateExitCode,b as runDoctor}from'./chunk-
|
|
1
|
+
export{a as computeDoctorGateExitCode,b as runDoctor}from'./chunk-46AGNYI7.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ declare function getGlobalCommandCapabilities(): {
|
|
|
83
83
|
workspace: {
|
|
84
84
|
command: string;
|
|
85
85
|
subcommands: ("init" | "import" | "snapshot" | "archive" | "list" | "diff" | "sync" | "registry" | "foundation" | "model" | "impact" | "verify" | "graph" | "watch" | "context" | "agent-sync" | "explain" | "why" | "trace" | "feedback" | "mcp" | "policy" | "contract" | "share" | "export" | "hydrate" | "run")[];
|
|
86
|
-
intelligenceSubcommands: ("snapshot" | "diff" | "model" | "impact" | "verify" | "context" | "agent-sync" | "explain")[];
|
|
86
|
+
intelligenceSubcommands: ("snapshot" | "diff" | "model" | "impact" | "verify" | "context" | "agent-sync" | "explain" | "why" | "trace")[];
|
|
87
87
|
};
|
|
88
88
|
commandMap: any;
|
|
89
89
|
};
|