rapidkit 0.41.5 → 0.42.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 +53 -9
- package/contracts/agent-customization-pack.v1.json +29 -29
- package/contracts/create-planner-capabilities.v1.json +2 -2
- package/contracts/extension-cli-compatibility.v1.json +2 -2
- package/contracts/runtime-command-surface.v1.json +2 -2
- package/contracts/workspace-registry.v1.json +1 -1
- package/contracts/workspace-run-last.v1.json +1 -1
- package/dist/analyze-XSPWKPA4.js +1 -0
- package/dist/autopilot-release-5J55NPXF.js +1 -0
- package/dist/chunk-2LBPX5K3.js +2 -0
- package/dist/chunk-4EIQRQSA.js +1 -0
- package/dist/{chunk-UZW5QFRW.js → chunk-4KUIFXHM.js} +3 -3
- package/dist/{chunk-3VI4Y7LZ.js → chunk-6WDDATKQ.js} +1 -1
- package/dist/chunk-7M2VBCAX.js +2 -0
- package/dist/chunk-7V7C6GXV.js +4 -0
- package/dist/{chunk-HCJV2ITA.js → chunk-CXWWNQDF.js} +1 -1
- package/dist/chunk-DMITBXR2.js +1 -0
- package/dist/chunk-FLFZC7ZV.js +4 -0
- package/dist/{chunk-GDWLW7GF.js → chunk-JN6R5UP4.js} +2 -2
- package/dist/chunk-KEMWZUGO.js +5 -0
- package/dist/{chunk-TXUBE6KV.js → chunk-KQRXY2GJ.js} +1 -1
- package/dist/chunk-KUOCSDIY.js +1 -0
- package/dist/{chunk-THSTNVE3.js → chunk-MOAQ3WU6.js} +1 -1
- package/dist/{chunk-SO2SSVWN.js → chunk-MQGVCTUL.js} +1 -1
- package/dist/chunk-NN3IV4U6.js +916 -0
- package/dist/chunk-QKVDG6FD.js +32 -0
- package/dist/chunk-RQIHAPF3.js +13 -0
- package/dist/{chunk-FI4VMG2I.js → chunk-S4U2FRJV.js} +1 -1
- package/dist/{chunk-T5GS4BUP.js → chunk-TQULVWUA.js} +1 -1
- package/dist/{chunk-U5IRABWC.js → chunk-WKCBS5DC.js} +2 -2
- package/dist/{create-P3USIH52.js → create-TPFUONHK.js} +1 -1
- package/dist/{demo-kit-N5U3NGAE.js → demo-kit-4NCHGEA6.js} +1 -1
- package/dist/{doctor-KYNACWFC.js → doctor-O2B3XNAB.js} +1 -1
- package/dist/{dotnet-webapi-clean-K33C77EI.js → dotnet-webapi-clean-LV3MADHG.js} +1 -1
- package/dist/{gofiber-standard-BQ4HCXL2.js → gofiber-standard-25DZS5UY.js} +1 -1
- package/dist/{gogin-standard-PUBCYW3A.js → gogin-standard-FMVHPLO5.js} +1 -1
- package/dist/index.js +161 -159
- package/dist/{pipeline-SU3FJUKI.js → pipeline-PX6ZUINW.js} +1 -1
- package/dist/{springboot-standard-XFVQI37R.js → springboot-standard-LMZF7OJS.js} +1 -1
- package/dist/{workspace-5DKOA7TN.js → workspace-MPKEUHFP.js} +1 -1
- package/dist/{workspace-agent-sync-HZ4UBSZ2.js → workspace-agent-sync-XD32GG5V.js} +1 -1
- package/dist/{workspace-context-R3XWWLFP.js → workspace-context-QFES7YBC.js} +1 -1
- package/dist/workspace-explain-Q7TJCHD5.js +1 -0
- package/dist/{workspace-foundation-H6IPS4MW.js → workspace-foundation-2OVUZXPT.js} +1 -1
- package/dist/{workspace-intelligence-5BBKUJAG.js → workspace-intelligence-FJP5ONDB.js} +1 -1
- package/dist/{workspace-marker-HAC7BMEG.js → workspace-marker-5GAJSOFP.js} +1 -1
- package/dist/{workspace-mcp-serve-TQTJ4HWI.js → workspace-mcp-serve-DFJIUTL5.js} +1 -1
- package/dist/{workspace-model-YAC5BKLL.js → workspace-model-IDRCH3VI.js} +1 -1
- package/dist/workspace-python-engine-state-AEEZ7QYB.js +2 -0
- package/dist/workspace-run-NULA72JV.js +1 -0
- package/dist/{workspace-verify-5RZSDKGR.js → workspace-verify-K4RSQIXT.js} +1 -1
- package/dist/{workspace-watch-P2PGSYDD.js → workspace-watch-PFJDHPXI.js} +1 -1
- package/docs/commands-reference.md +30 -3
- package/package.json +2 -2
- package/dist/analyze-JYHEGUSH.js +0 -1
- package/dist/autopilot-release-ZADU63OD.js +0 -1
- package/dist/chunk-7BEZH5LE.js +0 -2
- package/dist/chunk-DAPZJHMN.js +0 -4
- package/dist/chunk-E5ZVQL3C.js +0 -13
- package/dist/chunk-LRF6PQOZ.js +0 -1
- package/dist/chunk-P5NZE2RV.js +0 -883
- package/dist/chunk-Q2KZIBV4.js +0 -5
- package/dist/chunk-Q4HEXEDW.js +0 -4
- package/dist/chunk-T7B3GF3Q.js +0 -1
- package/dist/chunk-U7TS7W2V.js +0 -32
- package/dist/chunk-YBS2HGO3.js +0 -2
- package/dist/workspace-explain-5RDFGHUN.js +0 -1
- package/dist/workspace-run-P5UOJSLQ.js +0 -1
package/dist/chunk-Q2KZIBV4.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import {f}from'./chunk-OLDPVVSV.js';import {b as b$1}from'./chunk-2FIX2MDC.js';import {execa}from'execa';import m from'chalk';import {createRequire}from'module';import {promises}from'fs';import l from'path';import g from'os';var v="rapidkit",A=createRequire(import.meta.url),C=A("../package.json"),i=C?.version??"0.0.0";function b(r){let e=r.trim().match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);if(!e)return null;let t=e[4]?e[4].split(".").map(o=>o.match(/^\d+$/)?Number(o):o):[];return {major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3]),prerelease:t}}function k(r,n){let e=b(r),t=b(n);if(!e||!t)return 0;if(e.major!==t.major)return e.major>t.major?1:-1;if(e.minor!==t.minor)return e.minor>t.minor?1:-1;if(e.patch!==t.patch)return e.patch>t.patch?1:-1;if(e.prerelease.length===0&&t.prerelease.length===0)return 0;if(e.prerelease.length===0)return 1;if(t.prerelease.length===0)return -1;let o=Math.max(e.prerelease.length,t.prerelease.length);for(let u=0;u<o;u+=1){let a=e.prerelease[u],s=t.prerelease[u];if(a===void 0)return -1;if(s===void 0)return 1;if(a===s)continue;let d=typeof a=="number",h=typeof s=="number";return d&&h?a>s?1:-1:d?-1:h||String(a)>String(s)?1:-1}return 0}var _=14400*1e3;function y(){let r=process.env.RAPIDKIT_CACHE_DIR?.trim()||(process.env.VITEST_WORKER_ID?l.join(g.homedir(),".rapidkit","cache",`vitest-${process.env.VITEST_WORKER_ID}`):l.join(g.homedir(),".rapidkit","cache"));return l.join(r,"update-check.json")}async function U(){try{let r=await promises.readFile(y(),"utf-8"),n=JSON.parse(r);return typeof n.latestVersion=="string"&&typeof n.checkedAt=="number"&&n.currentVersion===i&&Date.now()-n.checkedAt<_?n:null}catch{return null}}async function N(r){try{let n=y();await promises.mkdir(l.dirname(n),{recursive:true}),await promises.writeFile(n,JSON.stringify({latestVersion:r,checkedAt:Date.now(),currentVersion:i}),"utf-8");}catch{}}async function F(){try{f.debug("Checking for updates...");let r=await U();if(r){let t=Math.round((Date.now()-r.checkedAt)/6e4);f.debug(`Update check: cache hit (${t}m old)`),k(r.latestVersion,i)>0&&(console.log(m.yellow(`
|
|
2
|
-
\u26A0\uFE0F Update available: ${i} \u2192 ${r.latestVersion}`)),console.log(m.cyan(`Run: npm install -g rapidkit@latest
|
|
3
|
-
`)));return}let{stdout:n}=await execa("npm",["view",v,"version"],{timeout:b$1()}),e=n.trim();await N(e),e&&k(e,i)>0?(console.log(m.yellow(`
|
|
4
|
-
\u26A0\uFE0F Update available: ${i} \u2192 ${e}`)),console.log(m.cyan(`Run: npm install -g rapidkit@latest
|
|
5
|
-
`))):f.debug("You are using the latest version");}catch{f.debug("Could not check for updates");}}function M(){return i}export{F as a,M as b};
|
package/dist/chunk-Q4HEXEDW.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import {f,e}from'./chunk-PCXSTKZ5.js';import {a,b}from'./chunk-KMUWWZRT.js';import {c as c$1}from'./chunk-NFUXULIF.js';import {a as a$1,b as b$1,d as d$1,c,f as f$1}from'./chunk-YBS2HGO3.js';import u from'chalk';import d from'fs';import h from'fs-extra';import l from'path';var $="release-readiness-v1";function I(t,e){let a=l.resolve(t);if(!b(a))return a;let s=l.join(e,".rapidkit","workspace.contract.json");if(d.existsSync(s))try{let i=JSON.parse(d.readFileSync(s,"utf-8")),n=Array.isArray(i.projects)?i.projects:[];for(let c of n){let f=p(c),g=typeof f.relativePath=="string"?f.relativePath.trim():"";if(g)return l.join(e,g)}}catch{}let r=x(e),o=Array.isArray(r.payload?.projects)?r.payload.projects:[];for(let i of o){let n=p(i),c=typeof n.path=="string"?n.path.trim():"";if(c)return l.resolve(c)}return a}function V(t){let e=a$1(t);return b$1(e,t)?"go":d$1(e,t)?"java":c(e,t)?"node":f$1(e,t)?"python":"unknown"}function O(t,e){if(!d.existsSync(t))return null;let a=d.readdirSync(t).filter(s=>s.endsWith(".json")&&e.some(r=>r.test(s))).map(s=>l.join(t,s));return a.length===0?null:(a.sort((s,r)=>d.statSync(r).mtimeMs-d.statSync(s).mtimeMs),a[0])}function p(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}async function z(t){let{readWorkspaceRegistrySummary:e,resolveWorkspaceRegisteredProjects:a}=await import('./workspace-registry-summary-X5WRUU3T.js'),s=await e(t);return s?s.projectCount:(await a(t)).summary.projectCount}function L(t,e,a){let s=l.join(t,".rapidkit","toolchain.lock");if(!d.existsSync(s))return {gate:"env",status:"fail",summary:"toolchain.lock is missing",details:["Run rapidkit bootstrap to pin runtime versions and generate a reproducible toolchain."],evidencePath:s};try{let r=JSON.parse(d.readFileSync(s,"utf-8")),o=p(r.runtime),n=["python","node","go","java"].filter(c=>{let f=p(o[c]);return typeof f.version=="string"&&f.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 rapidkit setup <runtime> and re-run bootstrap."],evidencePath:s};if(e!=="unknown"){let c=p(o[e]);if(typeof c.version!="string"||c.version.trim().length===0)return {gate:"env",status:"fail",summary:`${a?.hasRegisteredProjects?"Project runtime":"Workspace"} (${e}) is not pinned in toolchain.lock`,details:[`Run rapidkit setup ${e} and rapidkit bootstrap to lock ${e} for this workspace.`],evidencePath:s}}return {gate:"env",status:"pass",summary:`Pinned runtimes: ${n.join(", ")}`,details:[],evidencePath:s}}catch{return {gate:"env",status:"fail",summary:"toolchain.lock is invalid JSON",details:["Regenerate lockfile with rapidkit bootstrap."],evidencePath:s}}}function x(t){let e=l.join(t,".rapidkit","reports","doctor-last-run.json");if(!d.existsSync(e))return {payload:null,path:e};try{let a=JSON.parse(d.readFileSync(e,"utf-8"));return c$1(a,"workspace")?{payload:a,path:e}:{payload:null,path:e}}catch{return {payload:null,path:e}}}function D(t){let e=x(t);if(!e.payload)return {gate:{gate:"doctor",status:"fail",summary:"Doctor evidence is missing",details:["Run rapidkit doctor workspace --json before release readiness checks."],evidencePath:e.path},payload:null};let a=p(e.payload.summary),s=Number(a.totalIssues??0);return a.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}:s>0?{gate:{gate:"doctor",status:"warn",summary:`Doctor found ${s} issue(s)`,details:["Run rapidkit 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 J(t){let e=l.join(t,".rapidkit","reports","analyze-last-run.json");if(!d.existsSync(e))return {gate:"analyze",status:"fail",summary:"Analyze evidence is missing",details:["Run rapidkit analyze --json before release readiness checks."],evidencePath:e};try{let a=JSON.parse(d.readFileSync(e,"utf-8")),s=p(a.summary),r=String(s.verdict??"").toLowerCase(),o=Number(s.score??0),i=p(s.findings),n=Number(i.fail??0);return r==="blocked"||n>0?{gate:"analyze",status:"fail",summary:`Analyze verdict is blocked (score ${o}/100)`,details:["Resolve analyze findings and regenerate analyze-last-run.json."],evidencePath:e}:r==="needs-attention"?{gate:"analyze",status:"warn",summary:`Analyze needs attention (score ${o}/100)`,details:["Review analyze warnings before release."],evidencePath:e}:{gate:"analyze",status:"pass",summary:`Analyze passed (score ${o}/100)`,details:[],evidencePath:e}}catch{return {gate:"analyze",status:"fail",summary:"Analyze evidence is invalid JSON",details:["Re-run rapidkit analyze --json to regenerate evidence."],evidencePath:e}}}function W(t){try{let e=JSON.parse(d.readFileSync(t,"utf-8")),a=String(e.status??"").toLowerCase(),s=p(e.summary),r=Number(s.failedChecks??0);return a==="fail"||r>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}:a==="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 F(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 a=l.join(t,".rapidkit","reports"),s=O(a,[/verify-pack-contract/i,/^verify.*\.json$/i]);if(s)return W(s);let r=l.join(a,"workspace-contract-verify-last-run.json"),o=O(a,[/workspace-contract-verify-last-run/i,/workspace-contract-verify/i]);if(o)try{let i=JSON.parse(d.readFileSync(o,"utf-8")),n=String(i.status??"").toLowerCase();if(n==="passed"||n==="pass")return {gate:"verify",status:"pass",summary:"Workspace contract verification passed (CLI cache)",details:[],evidencePath:o};if(n==="failed"||n==="fail")return {gate:"verify",status:"fail",summary:"Workspace contract verification failed (CLI cache)",details:(Array.isArray(i.violations)?i.violations:[]).slice(0,5),evidencePath:o}}catch{}try{let{verifyWorkspaceContract:i}=await import('./workspace-contract-OO4GMENV.js'),n=await i({workspacePath:t}),c={schemaVersion:"v1",source:"cli",generatedAt:new Date().toISOString(),status:n.status,contractPath:n.contractPath,projectCount:n.projectCount,checks:n.checks,violations:n.violations};return await h.ensureDir(a),await h.writeJSON(r,c,{spaces:2}),n.status==="failed"?{gate:"verify",status:"fail",summary:"Workspace contract verification failed (CLI)",details:n.violations.slice(0,5),evidencePath:r}:{gate:"verify",status:"pass",summary:"Workspace contract verification passed (CLI)",details:[],evidencePath:r}}catch(i){return {gate:"verify",status:"fail",summary:"No verify evidence and workspace contract verification unavailable",details:["Run rapidkit workspace contract verify --json or export verify-pack contract from CI.",i instanceof Error?i.message:String(i)],evidencePath:l.join(a,"*verify*.json")}}}function M(t,e){let a=l.join(e,".rapidkit","reports","doctor-last-run.json");if(!t)return {gate:"dependency",status:"warn",summary:"Dependency risk check skipped (doctor evidence missing)",details:["Run rapidkit doctor workspace --json to include dependency findings."],evidencePath:a};let s=Array.isArray(t.projects)?t.projects:[],r=s.reduce((i,n)=>{let c=Number(n.vulnerabilities??0);return Number.isFinite(c)?i+Math.max(0,c):i},0),o=s.filter(i=>i.depsInstalled===false).length;return r>0?{gate:"dependency",status:"fail",summary:`${r} dependency vulnerability(ies) reported`,details:["Resolve vulnerabilities (npm/pip/go audit pipelines) before release."],evidencePath:a}:o>0?{gate:"dependency",status:"warn",summary:`${o} project(s) report missing dependencies`,details:["Run project init/bootstrap and regenerate doctor evidence."],evidencePath:a}:{gate:"dependency",status:"pass",summary:"No dependency vulnerabilities reported",details:[],evidencePath:a}}function _(t){return t.some(e=>e.status==="fail")?"fail":t.some(e=>e.status==="warn")?"warn":"pass"}async function K(t,e){let a=l.join(t,".rapidkit","reports","release-readiness-last-run.json");return await h.ensureDir(l.dirname(a)),await h.writeJSON(a,e,{spaces:2}),a}async function H(t={}){let e$1=l.resolve(t.startPath??process.cwd()),a$1=a(e$1)??e$1,s=await z(a$1)>0,r=s&&b(e$1)?a$1:I(e$1,a$1),o=r===a$1?"unknown":V(r),n=L(a$1,s?o:"unknown",{hasRegisteredProjects:s}),c=D(a$1),f$1=J(a$1),g=await F(a$1,{skipVerify:t.skipVerify}),G=M(c.payload,a$1),k=[n,c.gate,f$1,g,G],v=_(k),m={schemaVersion:$,generatedAt:new Date().toISOString(),workspacePath:a$1,projectPath:r,action:t.action,overallStatus:v,blocking:v==="fail",blockingReasons:k.filter(y=>y.status==="fail").map(y=>`${y.gate}: ${y.summary}`),gates:k};if(t.writeReport!==false){let y=f(m,{commandId:"workspaceReadiness",exitCode:v==="fail"?2:v==="warn"?1:0,generatedAt:m.generatedAt,blockers:m.blockingReasons,runId:e()});m.evidencePath=await K(a$1,y);}return m}function B(t){return t==="pass"?u.green("PASS"):t==="warn"?u.yellow("WARN"):u.red("FAIL")}function U(t){return t==="pass"?u.green("PASS"):t==="warn"?u.yellow("WARN"):u.red("FAIL")}async function ne(t){let e=await H({writeReport:true,skipVerify:t.skipVerify===true});if(t.json)console.log(JSON.stringify(e,null,2));else {console.log(u.bold.cyan(`
|
|
2
|
-
\u{1F6A6} RapidKit Release Readiness
|
|
3
|
-
`)),console.log(u.bold(`Workspace: ${u.cyan(l.basename(e.workspacePath))}`)),console.log(u.gray(`Path: ${e.workspacePath}`)),console.log(`Overall: ${U(e.overallStatus)}`);for(let a of e.gates){console.log(` - ${a.gate}: ${B(a.status)} ${a.summary}`);for(let s of a.details)console.log(u.gray(` ${s}`));a.evidencePath&&console.log(u.gray(` evidence: ${a.evidencePath}`));}e.evidencePath&&console.log(u.gray(`
|
|
4
|
-
Evidence saved: ${e.evidencePath}`));}t.strict&&e.overallStatus!=="pass"&&process.exit(1);}export{H as a,ne as b};
|
package/dist/chunk-T7B3GF3Q.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-CDCYRBAY.js';import {r,j}from'./chunk-E5ZVQL3C.js';import {f}from'./chunk-OLDPVVSV.js';import {b}from'./chunk-MIWDCR6I.js';import f$1,{promises}from'fs';import i from'path';import j$1,{homedir}from'os';import {pathToFileURL}from'url';import l from'process';function R(t){let r=t.label.indexOf(" \u2014 ");return r>=0?t.label.slice(r+3).trim():t.label.trim()}function E(){let t=r().map(r=>({value:r.id,label:R(r),hint:r.description,name:r.label})),e=j().map(r=>({value:r.kitId,label:r.displayName,hint:r.commandDisplay("my-app"),name:`${r.displayName} \u2014 ${r.framework}`}));return [...t,...e]}var _=".rapidkitrc.json",F=["rapidkit.config.js","rapidkit.config.mjs","rapidkit.config.cjs"];async function yt(){let t=i.join(j$1.homedir(),_);try{let e=await promises.readFile(t,"utf-8"),r=JSON.parse(e);return f.debug(`Loaded config from ${t}`),r}catch{return f.debug("No user config found, using defaults"),{}}}async function vt(t=process.cwd()){let e=t,r=i.parse(e).root;for(;e!==r;){for(let n of F){let o=i.join(e,n);try{await promises.access(o),f.debug(`Found config file: ${o}`);let m=await import(pathToFileURL(o).href),P=m.default||m;return f.debug(`Loaded RapidKit config from ${n}`),P}catch{continue}}e=i.dirname(e);}return f.debug("No RapidKit config file found, using defaults"),{}}function bt(t,e,r){return {author:r.author||e.workspace?.defaultAuthor||t.author,pythonVersion:r.pythonVersion||e.workspace?.pythonVersion||t.pythonVersion,defaultInstallMethod:r.defaultInstallMethod||e.workspace?.installMethod||t.defaultInstallMethod,defaultKit:r.defaultKit||e.projects?.defaultKit||t.defaultKit,skipGit:r.skipGit??e.projects?.skipGit??t.skipGit,license:r.license||t.license,testRapidKitPath:r.testRapidKitPath||t.testRapidKitPath}}function wt(t){return process.env.RAPIDKIT_DEV_PATH||t.testRapidKitPath||void 0}var x="workspai",Rt="Workspai";function L(t){return f$1.existsSync(i.join(t,".rapidkit-workspace"))||f$1.existsSync(i.join(t,".rapidkit","workspace.json"))}function g(t=homedir()){return i.join(t,"rapidkit","workspaces")}function K(t=homedir()){return i.join(t,"Workspai","rapidkits")}function y(t,e=homedir()){return i.join(g(e),t)}function U(t,e=homedir()){return [y(t,e),i.join(K(e),t)]}function D(t,e={}){let r=e.homeDir??homedir();return e.outputDir?i.resolve(e.outputDir,t):y(t,r)}function Et(t,e=homedir()){for(let r of U(t,e))if(f$1.existsSync(r))return r}function jt(t,e="my-workspace"){let r=1;for(;;){let n=r===1?e:`${e}-${r}`,o=i.join(t,n);if(!f$1.existsSync(o))return {name:n,targetPath:o};r+=1;}}function S(t=homedir()){return [i.join(g(t),x),i.join(K(t),x)]}function Mt(t=homedir()){for(let e of S(t))if(L(e))return e;return y(x,t)}function T(t,e){let r=t.indexOf(e);if(r>=0&&r+1<t.length)return t[r+1];let n=t.find(o=>o.startsWith(`${e}=`));if(n)return n.slice(e.length+1)}function N(t){return t.includes("--here")}function W(t,e=l.cwd()){if(N(t))return i.resolve(e);let r=T(t,"--output");if(r)return i.resolve(r)}function $t(t,e=l.cwd()){let r=i.resolve(t),n=i.resolve(e),o=i.relative(n,r);return o.length>0&&!o.startsWith("..")&&!i.isAbsolute(o)?`cd ${o}`:`cd ${r}`}function Gt(t,e={}){let r=e.argv??[],n=e.outputParent??W(r,l.cwd());return D(t.trim(),{homeDir:e.homeDir,outputDir:n})}function Ot(t,e,r={}){return t?i.resolve(t)===i.resolve(e)?true:r.outputParent===void 0:false}async function Vt(t,e={}){let r=e.cwd??l.cwd(),n=e.homeDir??homedir(),o=W(t,r);if(o!==void 0)return o;let h=e.hasYes??(t.includes("--yes")||t.includes("-y"));if(!(e.interactive??(!h&&!!l.stdin.isTTY&&!b())))return;let P=g(n),{location:A}=await b$1([{type:"rawlist",name:"location",message:"Where should the workspace be created?",choices:[{value:"managed",label:"Managed home",hint:P},{value:"here",label:"Current directory",hint:r}],default:0}]);if(A==="here")return i.resolve(r)}export{E as a,yt as b,vt as c,bt as d,wt as e,Rt as f,g,Et as h,jt as i,Mt as j,$t as k,Gt as l,Ot as m,Vt as n};
|
package/dist/chunk-U7TS7W2V.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {b,c,d}from'./chunk-T5GS4BUP.js';import {d as d$1}from'./chunk-3VI4Y7LZ.js';import {b as b$1,f,a,g as g$1}from'./chunk-GBJBQ43T.js';import {n,k as k$1,b as b$2,j as j$1}from'./chunk-LRF6PQOZ.js';import {j}from'./chunk-3PTJID76.js';import s from'path';import g from'fs-extra';var _=["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"];var Se="workspace-operational-skill.v1";function je(e){if(typeof e!="string")return null;let t=e.trim();return !t||t.includes("/")||t.includes("..")?null:t}function pe(e){let t=je(e.skillId);if(!t)throw new Error(`Invalid skill id: ${e.skillId}`);return {schemaVersion:Se,skillId:t,canonicalPath:f(t),title:e.title,triggers:[...e.triggers].sort((r,i)=>r.localeCompare(i)),requiredReports:[...e.requiredReports].sort((r,i)=>r.localeCompare(i)),scopedProjects:[...e.scopedProjects??[]].sort((r,i)=>r.localeCompare(i)),verificationCommands:[...e.verificationCommands],answerContractSections:[..._],...e.promptStem?{promptStem:e.promptStem}:{},markdown:e.markdown}}var ve="workspace-skills-index.v1";function de(e){let t=[...e.skills].sort((i,o)=>i.skillId.localeCompare(o.skillId)),r=e.inputsHash??b$2({skillIds:t.map(i=>i.skillId),paths:t.map(i=>i.canonicalPath)});return {schemaVersion:ve,generatedAt:e.generatedAt,inputsHash:r,skills:t.map(i=>({skillId:i.skillId,path:i.canonicalPath,schemaVersion:i.schemaVersion,title:i.title}))}}var le=[".rapidkit/reports/INDEX.json",b,d$1],Pe=[{skillId:"rapidkit-diagnose-api-failure",title:"Diagnose API failure",triggers:["api failure","500 error","integration test failed","service unreachable"],objective:"Investigate a failing API or service using RapidKit evidence before editing application code.",steps:["Read `.rapidkit/reports/INDEX.json` and identify fail/warn reports for the scoped project.","Read `.rapidkit/reports/doctor-last-run.json`, `doctor-project-last-run.json`, and project-scoped run evidence if present.","If a fix was requested, read `artifact-remediation-plan-last-run.json` for cross-artifact next steps, then `doctor-remediation-plan-last-run.json` for Doctor-specific file edits.","Map the failure to workspace vs project scope; cite exit codes and blocker messages.","Propose the smallest safe fix (config, env, dependency) with explicit verification commands."]},{skillId:"rapidkit-release-readiness",title:"Release readiness",triggers:["release","ship","production","readiness gate"],objective:"Assess whether this workspace is release-ready using governed RapidKit gates.",steps:["Read `.rapidkit/reports/release-readiness-last-run.json` and `pipeline-last-run.json`.","Read `.rapidkit/reports/workspace-verify-last-run.json` for verdict and blocking reasons.","Read `.rapidkit/reports/artifact-remediation-plan-last-run.json` when a Studio or agent repair path is needed.","List blocking gates first; never claim ready without cited report fields.","Provide one safe next command and a verification checklist."]},{skillId:"rapidkit-safe-schema-migration",title:"Safe schema migration",triggers:["migration","schema change","database migration","db migrate"],objective:"Plan and verify a schema migration with blast-radius awareness.",steps:["Identify affected projects from workspace model and dependency graph.","Run or review impact/verify evidence for transitive dependents.","Require project-scoped test/build commands before promoting the migration.","Document rollback and verification signals."]},{skillId:"rapidkit-dependency-upgrade",title:"Dependency upgrade",triggers:["upgrade dependency","bump package","security advisory","outdated deps"],objective:"Upgrade dependencies with graph-aware verification.",steps:["Scope the upgrade to the owning project from workspace model.","Check transitive dependents via workspace graph / impact reports.","Prefer workspace run test/build for affected projects.","Re-run `workspace verify` after evidence refresh."]},{skillId:"rapidkit-rename-contract",title:"Rename contract safely",triggers:["rename contract","rename event","breaking api","contract change"],objective:"Rename or change a shared contract with consumer awareness.",steps:["Read `.rapidkit/workspace.contract.json` for publishes/consumes/owns edges.","List all consumer projects before proposing renames.","Update contract file and regenerate workspace model.","Verify contract gate and integration tests for consumers."]}];function D(e){return `npx rapidkit ${e}`.trim()}function Ce(e){let t=[`# ${e.template.title}`,"",`> Workspace: **${e.workspaceName}** \xB7 Skill: \`${e.template.skillId}\``,"","## Objective","",e.template.objective,"","## Triggers","",...e.template.triggers.map(r=>`- ${r}`),"","## Required evidence (read first)","",...le.map(r=>`- \`${r}\``),"","## Procedure","",...e.template.steps.map((r,i)=>`${i+1}. ${r}`),""];if(e.scopedProjects.length>0&&t.push("## Scoped projects","",...e.scopedProjects.map(r=>`- ${r}`),""),e.contractSummary&&t.push("## Contract context","",e.contractSummary,""),e.verificationCommands.length>0){t.push("## Verification commands (this workspace)","");for(let r of e.verificationCommands)t.push(`- \`${r}\``);t.push("");}return t.push("## Answer contract","","Return: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.","","## Refresh stale evidence","","```bash",D("workspace agent-sync --write --refresh-context"),"```",""),t.join(`
|
|
2
|
-
`)}function Ee(e){return e?.safeCommands?.length?e.safeCommands.slice(0,8).map(t=>t.display):[D("workspace verify --json"),D("doctor workspace --json")]}function Ie(e){return e?.projects?.length?e.projects.slice(0,12).map(r=>{let i=r.contracts.owns.join(", ")||"none",o=r.contracts.publishes.join(", ")||"none",p=r.contracts.consumes.join(", ")||"none";return `- **${r.slug}**: owns \`${i}\`; publishes \`${o}\`; consumes \`${p}\``}).join(`
|
|
3
|
-
`):void 0}function ue(e){let t=e.model.workspace.name,r=e.model.projects.map(p=>p.name).sort(),i=Ee(e.context??null),o=Ie(e.contract??null);return Pe.map(p=>{let c=Ce({template:p,workspaceName:t,scopedProjects:r,verificationCommands:i,contractSummary:o});return pe({skillId:p.skillId,title:p.title,triggers:p.triggers,requiredReports:[...le],scopedProjects:r,verificationCommands:i,promptStem:g$1[p.skillId],markdown:c})})}async function ge(e){let t=s.resolve(e.workspacePath),r=[],i=b$2({skills:e.skills.map(p=>({id:p.skillId,path:p.canonicalPath,hash:b$2({markdown:p.markdown})}))}),o=de({generatedAt:e.generatedAt,skills:e.skills,inputsHash:i});if(e.write){for(let c of e.skills){let n=s.join(t,c.canonicalPath);await g.ensureDir(s.dirname(n)),await g.writeFile(n,c.markdown,"utf8"),r.push(c.canonicalPath);}let p=s.join(t,b$1);await g.ensureDir(s.dirname(p)),await g.writeJson(p,o,{spaces:2}),r.push(b$1);}return {skills:e.skills,index:o,writtenPaths:r}}function me(e){return ["## Operational skills (canonical)","","Read workspace-native playbooks from `.rapidkit/skills/` before generic repo scans:","",...e.skills.map(r=>`- \`${r.path}\` \u2014 ${r.title} (\`${r.skillId}\`)`),"","Regenerate:","","```bash",D("workspace agent-sync --write --refresh-context"),"```",""].join(`
|
|
4
|
-
`)}var Oe={"rapidkit-diagnose-api-failure":".github/prompts/rapidkit-diagnose.prompt.md","rapidkit-release-readiness":".github/prompts/rapidkit-release-readiness.prompt.md"},B="## Workspace verification (hydrated)";function Te(e){let t=[B,"","Verification commands for this workspace:","",...e.verificationCommands.length?e.verificationCommands.map(r=>`- \`${r}\``):["- `npx rapidkit workspace verify --json`"]];return e.scopedProjects.length>0&&t.push("","Scoped projects:","",...e.scopedProjects.map(r=>`- ${r}`)),t.push(""),t.join(`
|
|
5
|
-
`)}async function ke(e){let t=s.resolve(e.workspacePath),r=[];for(let i of e.skills){let o=Oe[i.skillId];if(!o)continue;let p=s.join(t,o);if(!await g.pathExists(p))continue;let c=await g.readFile(p,"utf8"),n=Te(i),m=c.includes(B)?c.replace(new RegExp(`${B}[\\s\\S]*$`),n.trimEnd()):`${c.trimEnd()}
|
|
6
|
-
|
|
7
|
-
${n}`;e.write&&await g.writeFile(p,`${m.trimEnd()}
|
|
8
|
-
`,"utf8"),r.push(o);}return r}var We="rapidkit-agent-customization-pack.v1";function fe(){return {schemaVersion:We,presets:{minimal:{meaning:"Generate the portable grounding index, AGENTS.md, and provider-specific lightweight instructions.",requiredOutputs:[".rapidkit/reports/INDEX.json",".rapidkit/reports/agent-customization-pack.json","AGENTS.md"]},enterprise:{meaning:"Generate the full VS Code-native pack: instructions, prompts, skills, custom agents, and validation metadata.",requiredOutputs:[".rapidkit/reports/INDEX.json",".rapidkit/reports/agent-customization-pack.json","AGENTS.md",".github/instructions/rapidkit-workspace.instructions.md",".github/prompts/rapidkit-diagnose.prompt.md",".github/skills/rapidkit-workspace-intelligence/SKILL.md",".github/agents/workspai-advisor.agent.md",".rapidkit/reports/rapidkit-mcp-design.json",b$1]}},targets:{all:{meaning:"Generate every supported customization surface.",outputFamilies:["portable","vscode","copilot","cursor","claude"]},vscode:{meaning:"Generate VS Code-native customizations for Copilot Chat and agent workflows.",outputFamilies:["instructions","prompts","skills","agents","hooks"]},agents:{meaning:"Generate portable AGENTS.md grounding for any agent.",outputFamilies:["portable"]},copilot:{meaning:"Generate GitHub Copilot instructions, prompts, and skills.",outputFamilies:["instructions","prompts","skills"]},cursor:{meaning:"Generate Cursor rules.",outputFamilies:["rules"]},claude:{meaning:"Generate Claude Code grounding files.",outputFamilies:["rules","portable"]},codex:{meaning:"Use AGENTS.md and the report index as the Codex grounding layer.",outputFamilies:["portable"]},orca:{meaning:"Use AGENTS.md and the report index as the Orca/Grok grounding layer.",outputFamilies:["portable"]}},standardAnswerContract:[..._],requiredReports:O.map(e=>({path:e.relativePath,label:e.label,required:e.required})),strictRules:["Required reports must exist.","Generated report paths must stay inside the workspace root.","Generated customization text must be English-only.","Agent answers must not claim pass, ready, or healthy without cited evidence.","Commands must distinguish display guidance from execution requests.","Agent hook files must be advisory and disabled by default unless the user explicitly enables them.","MCP design artifacts must stay read-mostly until write tools have explicit approval boundaries."],outputKinds:["report","grounding","instruction","prompt","skill","skill-resource","operational-skill","skills-index","explain-report","agent","rule","hook","mcp-design"],pathLayers:{l1CanonicalRoots:[".rapidkit/reports/",`${a}/`],l2PrefixedMirrorRoots:[".github/",".cursor/",".claude/"],l3SharedIndustryFiles:["AGENTS.md",".github/copilot-instructions.md","CLAUDE.md"]}}}var Ne="rapidkit-agent-reports-index.v1",_e="rapidkit-agent-customization-pack.v1",J=".rapidkit/reports/INDEX.json",he=".rapidkit/AGENT-GROUNDING.md",G=".rapidkit/reports/agent-customization-pack.json",O=[{relativePath:b,label:"Agent context pack",required:true},{relativePath:b$1,label:"Operational skills index",required:true},{relativePath:".rapidkit/reports/workspace-model.json",label:"Workspace model graph",required:false},{relativePath:".rapidkit/reports/doctor-last-run.json",label:"Workspace doctor",required:false},{relativePath:".rapidkit/reports/doctor-project-last-run.json",label:"Project doctor",required:false},{relativePath:".rapidkit/reports/doctor-remediation-plan-last-run.json",label:"Doctor remediation plan",required:false},{relativePath:".rapidkit/reports/artifact-remediation-plan-last-run.json",label:"Artifact remediation plan",required:false},{relativePath:".rapidkit/reports/doctor-fix-result-last-run.json",label:"Doctor fix result",required:false},{relativePath:".rapidkit/reports/analyze-last-run.json",label:"Workspace analyze",required:false},{relativePath:".rapidkit/reports/pipeline-last-run.json",label:"Governance pipeline",required:false},{relativePath:".rapidkit/reports/release-readiness-last-run.json",label:"Release readiness",required:false},{relativePath:".rapidkit/reports/workspace-impact-last-run.json",label:"Workspace impact",required:false},{relativePath:".rapidkit/reports/workspace-verify-last-run.json",label:"Workspace verify",required:false},{relativePath:".rapidkit/reports/workspace-model-snapshot.json",label:"Workspace model snapshot",required:false},{relativePath:".rapidkit/reports/workspace-model-diff-last-run.json",label:"Workspace model diff",required:false},{relativePath:".rapidkit/reports/workspace-explain-last-run.json",label:"Workspace explain",required:false},{relativePath:".rapidkit/reports/workspace-contract-verify-last-run.json",label:"Workspace contract verify",required:false},{relativePath:".rapidkit/reports/workspace-intelligence-history.json",label:"Workspace intelligence history",required:false}];function k(e){return `npx rapidkit ${e}`.trim()}function be(e){return e&&typeof e=="object"?e:null}function Z(e,t=12){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0).slice(0,t):[]}function De(e){let t=Z(e.blockers,12);if(t.length>0)return t;let r=Z(e.blockingReasons,12);if(r.length>0)return r;let i=be(e.summary);return i&&Array.isArray(i.blockingReasons)?Z(i.blockingReasons,12):[]}function Ge(e){for(let t of ["generatedAt","timestamp"]){let r=e[t];if(typeof r=="string"&&r.trim())return r.trim()}}function Ke(e,t,r){if(!e)return true;let i=Date.parse(e);return Number.isFinite(i)?r.getTime()-i>t*60*60*1e3:true}function Le(e){let t=e&&e.length>0?e:["all"];return t.includes("all")?new Set(["all","vscode","agents","copilot","cursor","claude","codex","orca"]):new Set(t)}function w(e,t){return e.has("all")||e.has(t)}function Me(e){return w(e,"copilot")||w(e,"vscode")}function qe(e){return e??"enterprise"}function $e(e){return e===b$1?"skills-index":e.includes("workspace-explain-last-run.json")?"explain-report":e.startsWith(".rapidkit/skills/")&&e.endsWith(".md")?"operational-skill":e.includes("hooks")||e.endsWith("rapidkit-agent-hooks.json")?"hook":e.includes("mcp")||e.endsWith("rapidkit-mcp-design.json")?"mcp-design":e.endsWith(".json")?"report":e.includes("/instructions/")||e.endsWith("copilot-instructions.md")?"instruction":e.includes("/prompts/")?"prompt":e.includes("/skills/")&&e.endsWith("/SKILL.md")?"skill":e.includes("/skills/")?"skill-resource":e.includes("/agents/")?"agent":e.includes("/rules/")||e.endsWith(".mdc")?"rule":"grounding"}function He(e){return e.startsWith(".github/")?["vscode","copilot"]:e.startsWith(".cursor/")?["cursor"]:e.startsWith(".claude/")||e==="CLAUDE.md"?["claude"]:e==="AGENTS.md"||e.startsWith(".rapidkit/")?["agents","codex","orca","vscode"]:e.startsWith(".vscode/")?["vscode"]:["agents"]}function Ve(e,t){return fe().presets[t].requiredOutputs.includes(e)}function ze(e){return e.schemaVersion===j$1&&typeof e.generatedAt=="string"&&e.summary!=null&&typeof e.summary=="object"&&!Array.isArray(e.summary)&&Array.isArray(e.projects)}async function Fe(e,t){if(t)return t;let r=s.join(e,k$1);if(await g.pathExists(r))try{let i=await g.readJson(r);if(ze(i))return i}catch{}return n({workspacePath:e,includeEvidence:true})}function Ue(e){return e.length>0&&!s.isAbsolute(e)&&!e.split(/[\\/]+/).includes("..")}function Xe(e){return Object.fromEntries(["all","vscode","agents","copilot","cursor","claude","codex","orca"].map(r=>[r,{enabled:e.targets.includes("all")||e.targets.includes(r),outputs:e.outputs.filter(i=>i.targets.includes(r)).map(i=>i.path).sort()}]))}async function Be(e){try{if(!await g.pathExists(e))return null;let t=await g.readJson(e);return be(t)}catch{return null}}async function we(e){let t=e.now??new Date,r=e.staleAfterHours??24,i=[],o=[];for(let c of O){let n=s.join(e.workspacePath,c.relativePath),m=await Be(n),j=m!==null;j&&m&&o.push(...De(m)),i.push({path:c.relativePath,label:c.label,required:c.required,exists:j,generatedAt:m?Ge(m):void 0,commandId:typeof m?.commandId=="string"?m.commandId:void 0,exitCode:typeof m?.exitCode=="number"?m.exitCode:void 0});}let p=[...new Set(o.map(c=>c.trim()).filter(Boolean))].slice(0,16);return {schemaVersion:Ne,generatedAt:t.toISOString(),workspaceRoot:e.workspacePath,readOrder:O.map(c=>c.relativePath),blockers:p,staleAfterHours:r,reports:i,refreshCommand:k("workspace agent-sync --write --refresh-context")}}function Ae(e){let t=["# RapidKit agent grounding","","Cross-tool instructions for Copilot, Cursor, Claude Code, Codex, Grok, and other agents.","","## Read order (mandatory before workspace diagnosis)","","1. `.rapidkit/reports/INDEX.json` \u2014 latest blockers, timestamps, and report paths","2. `.rapidkit/reports/workspace-context-agent.json` \u2014 canonical agent context pack","3. Evidence artifacts listed in the index (doctor, analyze, pipeline, readiness, impact, verify)","","Do **not** full-repo scan until these reports are read or regenerated.","","## Regenerate intelligence","","```bash",k("workspace agent-sync --write --refresh-context"),k("workspace context --for-agent --json --write"),k("pipeline --json --write"),"```",""];if(e.index.blockers.length>0){t.push("## Current blockers","");for(let r of e.index.blockers.slice(0,12))t.push(`- ${r}`);t.push("");}if(e.context?.safeCommands?.length){t.push("## Safe commands (prefer these)","");for(let r of e.context.safeCommands.slice(0,10))t.push(`- \`${r.display}\` \u2014 ${r.description}`);t.push("");}return t.push("## Rules","","- Treat `.rapidkit/reports/*` as the source of truth for health, gates, and release posture.","- Prefer deterministic RapidKit CLI commands over heuristic framework guesses.","- If evidence is missing or stale, run the refresh commands above before proposing fixes.","- Keep project-scoped advice aligned with the active project named in the context pack.",""),t.join(`
|
|
9
|
-
`)}function Je(e){return ["# RapidKit agent grounding","",`Generated: ${e.generatedAt}`,"","This file is tool-agnostic. Synced agents should read it together with `.rapidkit/reports/INDEX.json`.","","## Mandatory read order","",...e.readOrder.map((t,r)=>`${r+1}. \`${t}\``),"",e.blockers.length>0?"## Blockers":"",...e.blockers.length>0?e.blockers.map(t=>`- ${t}`):[],"","## Refresh","","```bash",e.refreshCommand,"```",""].filter(t=>t!=="").join(`
|
|
10
|
-
`)}function Ze(){return ["# RapidKit workspace grounding","","Before answering workspace, release, or architecture questions:","","1. Read `AGENTS.md` (managed RapidKit section).","2. Read `.rapidkit/reports/INDEX.json` and `.rapidkit/reports/workspace-context-agent.json`.","3. Use evidence reports before scanning the full repository.","","Regenerate stale intelligence:","","```bash",k("workspace agent-sync --write --refresh-context"),"```",""].join(`
|
|
11
|
-
`)}function Ye(){return ["## Claude Code","","- Load `.rapidkit/reports/INDEX.json` before diagnosing blockers.","- Use `.claude/rules/rapidkit-evidence.md` when editing files under `.rapidkit/`.","- Refresh grounding with `npx rapidkit workspace agent-sync --write`.",""].join(`
|
|
12
|
-
`)}function Qe(){return ["---","description: RapidKit workspace evidence and intelligence grounding","globs: []","alwaysApply: true","---","","Before proposing fixes in this workspace:","","1. Read `AGENTS.md` and `.rapidkit/reports/INDEX.json`.","2. Read `.rapidkit/reports/workspace-context-agent.json`.","3. Prefer evidence in `.rapidkit/reports/*` over full-repo exploration.","","Refresh when stale:","","```bash",k("workspace agent-sync --write --refresh-context"),"```",""].join(`
|
|
13
|
-
`)}function et(){return ["---",'applyTo: ".rapidkit/**,**/.rapidkit/**"',"description: RapidKit evidence and intelligence artifacts","---","","When working under `.rapidkit/`:","","- Treat JSON reports as canonical gate and health evidence.","- Start from `reports/INDEX.json` for read order and blockers.","- Do not invent pass/fail state \u2014 cite `exitCode`, `blockers`, and `generatedAt` fields.",""].join(`
|
|
14
|
-
`)}function tt(){return ["---",'applyTo: "**"',"description: RapidKit workspace scope, evidence, and command discipline","---","","# RapidKit Workspace Intelligence","","Use RapidKit reports as the workspace source of truth before giving architectural, repair, release, or project lifecycle advice.","","## Scope rules","","- Start from `.rapidkit/reports/INDEX.json` and `.rapidkit/reports/workspace-context-agent.json`.","- Distinguish workspace-level blockers from project-level blockers.","- When a project is active, cite its name, path, framework, and evidence source.","- Do not translate unsupported stack requests into unrelated native kits.","","## Answer contract","","Return answers with: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.",""].join(`
|
|
15
|
-
`)}function rt(){return ["# RapidKit evidence","","Applies when reading or editing `.rapidkit/reports/*`.","","- Start from `INDEX.json`, then `workspace-context-agent.json`.","- Use report blockers as the primary fix target.","- Regenerate with `npx rapidkit workspace agent-sync --write`.",""].join(`
|
|
16
|
-
`)}function it(){return ["---","description: Diagnose RapidKit workspace blockers from evidence reports","---","","Diagnose this workspace using RapidKit evidence only.","","Read:","","- `.rapidkit/reports/INDEX.json`","- `.rapidkit/reports/workspace-context-agent.json`","- Any fail/warn reports referenced in the index","","Return:","","1. Root cause grounded in report blockers","2. Smallest safe fix path (commands + file edits)","3. One verification command to prove recovery",""].join(`
|
|
17
|
-
`)}function K(e){return ["---",`description: ${e.description}`,"---","",e.objective,"","Read first:","","- `.rapidkit/reports/INDEX.json`","- `.rapidkit/reports/workspace-context-agent.json`","- Any report referenced by the current blocker or task","","Return:","",...e.expectedOutput.map((t,r)=>`${r+1}. ${t}`),"","Use the standard RapidKit answer contract: Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.",""].join(`
|
|
18
|
-
`)}function S(e){return ["# "+e.title,"",...e.lines,""].join(`
|
|
19
|
-
`)}function nt(){return S({title:"MCP Tool Design",lines:["RapidKit MCP is a future read-mostly bridge. Use the CLI reports today; do not assume a running MCP server exists.","","Candidate read tools:","- `getWorkspaceModel` \u2014 read `.rapidkit/reports/workspace-model.json`.","- `getEvidenceIndex` \u2014 read `.rapidkit/reports/INDEX.json`.","- `getBlockers` \u2014 derive current blockers from INDEX and gate reports.","- `getSafeCommands` \u2014 read safe commands from `workspace-context-agent.json`.","- `getProjectContext` \u2014 return one project-scoped slice of the workspace model.","- `getArtifact` \u2014 read one explicit artifact path inside the workspace root.","- `listOperationalSkills` \u2014 read `.rapidkit/reports/workspace-skills-index.json`.","- `getWorkspaceExplain` \u2014 read/build workspace explain for release-blocked or project scope.","- `refreshWorkspaceIntelligence` \u2014 explicit user-approved refresh command only.","","Write or repair tools require explicit approval boundaries and are intentionally not part of the first read-mostly design."]})}function st(e){return `${JSON.stringify({schemaVersion:"rapidkit-mcp-design.v1",generatedAt:e.generatedAt,workspaceRoot:e.workspacePath,status:"design-only",mode:"read-mostly",safety:{writeToolsEnabled:false,approvalRequiredForRefresh:true,artifactReadsMustStayInsideWorkspace:true},candidateTools:[{name:"getWorkspaceModel",reads:[".rapidkit/reports/workspace-model.json"],mutates:false},{name:"getEvidenceIndex",reads:[".rapidkit/reports/INDEX.json"],mutates:false},{name:"getBlockers",reads:[".rapidkit/reports/INDEX.json",".rapidkit/reports/workspace-verify-last-run.json",".rapidkit/reports/pipeline-last-run.json"],mutates:false},{name:"getSafeCommands",reads:[".rapidkit/reports/workspace-context-agent.json"],mutates:false},{name:"getProjectContext",reads:[".rapidkit/reports/workspace-model.json",".rapidkit/reports/workspace-context-agent.json"],mutates:false},{name:"getArtifact",reads:["requested workspace-relative artifact path"],mutates:false},{name:"listOperationalSkills",reads:[".rapidkit/reports/workspace-skills-index.json"],mutates:false},{name:"getWorkspaceExplain",reads:[".rapidkit/reports/workspace-explain-last-run.json",".rapidkit/reports/workspace-verify-last-run.json",".rapidkit/reports/workspace-impact-last-run.json"],mutates:false},{name:"refreshWorkspaceIntelligence",command:k("workspace agent-sync --write --refresh-context"),mutates:true,approvalRequired:true}]},null,2)}
|
|
20
|
-
`}function ot(e){return `${JSON.stringify({schemaVersion:"rapidkit-agent-hooks.v1",generatedAt:e.generatedAt,workspaceRoot:e.workspacePath,enabledByDefault:false,mode:"advisory",hooks:[{name:"rapidkit-pre-tool-use-workspace-boundary",event:"PreToolUse",purpose:"Block or warn on state-changing commands outside the active workspace root.",defaultAction:"warn",rules:["Allow read-only commands.","Warn before write/delete commands outside workspaceRoot.","Never run destructive commands without explicit user approval."]},{name:"rapidkit-post-tool-use-verify-suggestion",event:"PostToolUse",purpose:"Suggest non-destructive verification commands after edits.",defaultAction:"suggest",commands:[k("doctor workspace"),k("workspace verify --strict --json")]},{name:"rapidkit-user-prompt-submit-scope-hint",event:"UserPromptSubmit",purpose:"Inject lightweight workspace scope and evidence index hints.",defaultAction:"inject-context-hint",reads:[".rapidkit/reports/INDEX.json",".rapidkit/reports/workspace-context-agent.json"]}]},null,2)}
|
|
21
|
-
`}function at(e){let t=["---","name: rapidkit-workspace-intelligence","description: Use RapidKit workspace intelligence reports to answer, repair, verify, and release with evidence","---","","# RapidKit Workspace Intelligence","","Use this skill for workspace architecture, project lifecycle, blocker repair, release readiness, agent grounding, and CI evidence questions.","","## Decision flow","","1. Load `resources/scope-model.md`.","2. Load `.rapidkit/reports/INDEX.json`.","3. Load `.rapidkit/reports/workspace-context-agent.json`.","4. Load `.rapidkit/reports/workspace-skills-index.json` when operational playbooks are needed.","5. Load the smallest evidence report required for the task.","6. Answer with Scope, Evidence, Diagnosis, Fix Plan, Run, Verify, Assumptions.","","## Rules","","- Prefer RapidKit reports over full-repo scans.","- Never claim a gate passed without a cited report.","- Separate display commands from execution requests.","- Keep project-scoped fixes inside the active project unless workspace evidence says otherwise.",""];return e?.trim()&&t.push(e.trim(),""),t.join(`
|
|
22
|
-
`)}function L(e){return ["---",`name: ${e.name}`,`description: ${e.description}`,`tools: [${e.tools.map(t=>`'${t}'`).join(", ")}]`,"---","",`You are the ${e.name} agent for RapidKit Workspace Intelligence.`,"",`Mode: ${e.mode}.`,"","Start every task by reading `.rapidkit/reports/INDEX.json` and `.rapidkit/reports/workspace-context-agent.json`.","","Use this answer contract:","","- Scope","- Evidence","- Diagnosis","- Fix Plan","- Run","- Verify","- Assumptions","","Do not invent health, readiness, or policy status. Cite report paths and command outputs.",""].join(`
|
|
23
|
-
`)}function ct(){return ["---","name: rapidkit-grounding","description: Load RapidKit workspace intelligence reports before diagnosing or changing code","---","","# RapidKit grounding","","Use when the user asks about workspace health, release gates, doctor/pipeline failures, or project structure.","","## Workflow","","1. Read `.rapidkit/reports/INDEX.json`","2. Read `.rapidkit/reports/workspace-context-agent.json`","3. Read fail/warn evidence artifacts listed in the index","4. Propose the smallest safe fix with explicit verification commands","","## Refresh stale evidence","","```bash",k("workspace agent-sync --write --refresh-context"),"```",""].join(`
|
|
24
|
-
`)}async function u(e,t,r){return r?(await g.ensureDir(s.dirname(e)),await g.writeFile(e,t,"utf8"),"written"):"skipped"}async function Y(e){if(!e.write)return "skipped";let t=await g.pathExists(e.absolutePath)?await g.readFile(e.absolutePath,"utf8"):null,{upsertManagedAgentSection:r}=await import('./managed-agent-markers-AXUM75OE.js'),i=r(t,e.generatedBody),o=e.preamble?`${e.preamble.trimEnd()}
|
|
25
|
-
|
|
26
|
-
${i}`:i;return await g.ensureDir(s.dirname(e.absolutePath)),await g.writeFile(e.absolutePath,o,"utf8"),"written"}function Vt(e){if(!e?.trim())return;let t=new Set(["all","vscode","agents","copilot","cursor","claude","codex","orca"]),r=e.split(",").map(i=>i.trim().toLowerCase()).filter(i=>t.has(i));return r.length>0?r:void 0}function pt(e){let t=[...e.outputs].sort((r,i)=>r.path.localeCompare(i.path));return {schemaVersion:_e,generatedAt:e.generatedAt,workspaceRoot:e.workspacePath,preset:e.preset,targets:[...e.targets].sort(),sourceReports:e.index.reports.filter(r=>r.exists).map(r=>r.path).sort(),outputInventory:t,capabilityMatrix:Xe({targets:e.targets,outputs:t}),drift:{missingRequired:e.missingRequired,staleReports:e.staleReports,strictViolations:e.strictViolations},answerContract:["Scope","Evidence","Diagnosis","Fix Plan","Run","Verify","Assumptions"],refreshCommand:k(`workspace agent-sync --write --refresh-context --preset ${e.preset}`),experimental:{hooksEnabled:e.experimentalHooks,mcpReady:t.some(r=>r.kind==="mcp-design")}}}async function zt(e){let t=s.resolve(e.workspacePath),r=new Date,i=e.staleAfterHours??24,o=Le(e.targets),p=[...o].sort(),c$1=qe(e.preset),n$1=e.write===true,m=e.strict===true,j$1,v=null,M;e.refreshContext&&(M=await n({workspacePath:t,includeEvidence:true}),v=await c({workspacePath:t,model:M,agent:e.agent??"generic",scope:e.scope,includeEvidence:true}),n$1&&(j$1=await d(v,t)));let A=await we({workspacePath:t,staleAfterHours:i,now:r}),P=[],q=[],$=[],H=[],d$1=(a,l)=>{a==="written"?q.push(l):$.push(l),H.push({path:l,kind:$e(l),targets:He(l),required:Ve(l,c$1),status:a==="written"?"written":e.dryRun?"planned":"skipped"});};d$1(await u(s.join(t,J),`${JSON.stringify(A,null,2)}
|
|
27
|
-
`,n$1),J),d$1(await u(s.join(t,he),`${Je(A)}
|
|
28
|
-
`,n$1),he);let Q="",Re=await Fe(t,M),V=null;try{V=(await j({workspacePath:t})).contract;}catch{V=null;}let xe=ue({model:Re,context:v,contract:V}),z=await ge({workspacePath:t,skills:xe,generatedAt:r.toISOString(),write:n$1});for(let a of z.skills)d$1(n$1?"written":"skipped",a.canonicalPath);if(d$1(n$1?"written":"skipped",b$1),Q=me(z.index),(w(o,"agents")||w(o,"vscode"))&&d$1(await Y({absolutePath:s.join(t,"AGENTS.md"),generatedBody:Ae({index:A,context:v}),write:n$1}),"AGENTS.md"),w(o,"claude")){let a=s.join(t,"CLAUDE.md");if(n$1){let{upsertManagedAgentSection:l}=await import('./managed-agent-markers-AXUM75OE.js'),f=await g.pathExists(a)?await g.readFile(a,"utf8"):"",b=l(f,Ye()),R=b.includes("@AGENTS.md")?b:`@AGENTS.md
|
|
29
|
-
|
|
30
|
-
${b}`;await g.ensureDir(s.dirname(a)),await g.writeFile(a,R,"utf8"),q.push("CLAUDE.md");}else $.push("CLAUDE.md");d$1(await u(s.join(t,".claude/rules/rapidkit-evidence.md"),`${rt()}
|
|
31
|
-
`,n$1),".claude/rules/rapidkit-evidence.md");}if(w(o,"cursor")&&d$1(await u(s.join(t,".cursor/rules/rapidkit-grounding.mdc"),Qe(),n$1),".cursor/rules/rapidkit-grounding.mdc"),Me(o)){if(d$1(await Y({absolutePath:s.join(t,".github/copilot-instructions.md"),generatedBody:Ze(),write:n$1}),".github/copilot-instructions.md"),d$1(await u(s.join(t,".github/instructions/rapidkit-workspace.instructions.md"),tt(),n$1),".github/instructions/rapidkit-workspace.instructions.md"),d$1(await u(s.join(t,".github/instructions/rapidkit-evidence.instructions.md"),et(),n$1),".github/instructions/rapidkit-evidence.instructions.md"),d$1(await u(s.join(t,".github/prompts/rapidkit-diagnose.prompt.md"),it(),n$1),".github/prompts/rapidkit-diagnose.prompt.md"),c$1==="enterprise"){let a=[[".github/prompts/rapidkit-repair.prompt.md",K({description:"Repair RapidKit blockers with evidence and verification",objective:"Plan the smallest safe repair for the current RapidKit blocker.",expectedOutput:["Blocker and affected workspace/project scope","Evidence paths and exact failing signals","Minimal fix plan","Human-run commands","Verification command and expected success signal"]})],[".github/prompts/rapidkit-release-readiness.prompt.md",K({description:"Assess RapidKit release readiness from evidence",objective:"Assess whether this workspace is release-ready using RapidKit gates.",expectedOutput:["Readiness verdict with cited reports","Blocking gates","Safe next command","Verification checklist"]})],[".github/prompts/rapidkit-project-onboard.prompt.md",K({description:"Onboard a project into RapidKit Workspace Intelligence",objective:"Guide project onboarding using workspace model and create planner capabilities.",expectedOutput:["Target project scope","Native create, external create-adopt, or adopt-only lane","Safe commands","Post-onboarding verification"]})],[".github/prompts/rapidkit-adopt-project.prompt.md",K({description:"Adopt an existing project into RapidKit governance",objective:"Adopt an existing project without changing its runtime behavior.",expectedOutput:["Detected stack and confidence","Adoption plan","Generated metadata expectations","Doctor and workspace model verification"]})]];for(let[l,f]of a)d$1(await u(s.join(t,l),f,n$1),l);if(e.hydratePrompts===true)for(let l of await ke({workspacePath:t,skills:z.skills,write:n$1}))d$1(n$1?"written":"skipped",l);}if(d$1(await u(s.join(t,".github/skills/rapidkit-grounding/SKILL.md"),ct(),n$1),".github/skills/rapidkit-grounding/SKILL.md"),c$1==="enterprise"){d$1(await u(s.join(t,".github/skills/rapidkit-workspace-intelligence/SKILL.md"),at(Q),n$1),".github/skills/rapidkit-workspace-intelligence/SKILL.md");let a=[["artifact-map.md",S({title:"Artifact Map",lines:O.map(f=>`- \`${f.relativePath}\` \u2014 ${f.label}`)})],["command-map.md",S({title:"Command Map",lines:["- `npx rapidkit workspace agent-sync --write --refresh-context` \u2014 refresh agent grounding.","- `npx rapidkit workspace model --json --write` \u2014 refresh workspace model.","- `npx rapidkit doctor workspace` \u2014 refresh health evidence.","- `npx rapidkit workspace verify --strict --json` \u2014 verify release gates."]})],["scope-model.md",S({title:"Scope Model",lines:["- Workspace scope is the default source of truth.","- Project scope is selected only when the active task targets a specific project.","- Always name the workspace and project when giving repair or lifecycle advice."]})],["runtime-support.md",S({title:"Runtime Support",lines:["- Native create is available only for RapidKit-owned scaffold contracts.","- Unsupported stacks should use external-create-adopt when a stable ecosystem generator exists.","- Existing projects should use adopt-only when native create is unavailable."]})],["create-planner-capabilities.md",S({title:"Create Planner Capabilities",lines:["- Use `contracts/create-planner-capabilities.v1.json` to decide native-create, external-create-adopt, or adopt-only.","- Do not map PHP, WordPress, Laravel, Rails, or Symfony requests to unrelated native kits.","- Explain unsupported native create requests and guide users to adopt/import."]})],["mcp-tools.md",nt()]];for(let[f,b]of a){let R=`.github/skills/rapidkit-workspace-intelligence/resources/${f}`;d$1(await u(s.join(t,R),b,n$1),R);}let l=[["workspai-advisor.agent.md",L({name:"Workspai Advisor",description:"Read-only workspace and project guidance using RapidKit evidence",mode:"read-only",tools:["search","read"]})],["workspai-repair.agent.md",L({name:"Workspai Repair",description:"Turn RapidKit blockers into minimal fixes and verification steps",mode:"repair",tools:["search","read","edit"]})],["workspai-release.agent.md",L({name:"Workspai Release",description:"Assess readiness, governance gates, and release safety from evidence",mode:"release",tools:["search","read"]})],["workspai-project-onboarder.agent.md",L({name:"Workspai Project Onboarder",description:"Guide create, import, and adopt flows with RapidKit contracts",mode:"onboard",tools:["search","read","edit"]})]];for(let[f,b]of l){let R=`.github/agents/${f}`;d$1(await u(s.join(t,R),b,n$1),R);}}}c$1==="enterprise"&&d$1(await u(s.join(t,".rapidkit/reports/rapidkit-mcp-design.json"),st({workspacePath:t,generatedAt:A.generatedAt}),n$1),".rapidkit/reports/rapidkit-mcp-design.json"),c$1==="enterprise"&&e.experimentalHooks===true&&d$1(await u(s.join(t,".vscode/rapidkit-agent-hooks.json"),ot({workspacePath:t,generatedAt:A.generatedAt}),n$1),".vscode/rapidkit-agent-hooks.json"),(w(o,"codex")||w(o,"orca"))&&(w(o,"agents")||d$1(await Y({absolutePath:s.join(t,"AGENTS.md"),generatedBody:Ae({index:A,context:v}),write:n$1}),"AGENTS.md"));let F=n$1?await we({workspacePath:t,staleAfterHours:i,now:r}):A,T=F.reports.filter(a=>a.required&&!a.exists).map(a=>a.path),W=F.reports.filter(a=>a.exists&&Ke(a.generatedAt,i,r)).map(a=>a.path);if(m){T.length>0&&P.push(`Missing required reports: ${T.join(", ")}`),W.length>0&&P.push(`Stale reports (>${i}h): ${W.join(", ")}`);let a=H.map(l=>l.path).filter(l=>!Ue(l));a.length>0&&P.push(`Unsafe generated output paths: ${a.join(", ")}`);}let ee=pt({workspacePath:t,generatedAt:r.toISOString(),preset:c$1,targets:p,index:F,outputs:[...H,{path:G,kind:"report",targets:["agents","vscode","copilot","codex","orca"],required:true,status:n$1?"written":e.dryRun?"planned":"skipped"}],missingRequired:T,staleReports:W,strictViolations:P,experimentalHooks:e.experimentalHooks===true});return d$1(await u(s.join(t,G),`${JSON.stringify(ee,null,2)}
|
|
32
|
-
`,n$1),G),{workspacePath:t,indexPath:s.join(t,J),packPath:s.join(t,G),pack:ee,contextPath:j$1,writtenFiles:q,skippedFiles:$,blockers:A.blockers,missingRequired:T,staleReports:W,strictViolations:P}}export{Se as a,ve as b,Ne as c,_e as d,J as e,he as f,G as g,O as h,we as i,Vt as j,zt as k,We as l};
|
package/dist/chunk-YBS2HGO3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1,c,i,g as g$1,h}from'./chunk-UZW5QFRW.js';import E from'fs';import a from'path';function S(e,t){let n=g$1({runtime:typeof e?.runtime=="string"?e.runtime:void 0,framework:typeof e?.framework=="string"?e.framework:void 0,kitName:typeof e?.kit_name=="string"?e.kit_name:typeof e?.kit=="string"?e.kit:void 0});return n.runtime!=="unknown"?n.runtime:i(t,e).runtime}function q(e){let t=e;for(;;){let n=a.join(t,".rapidkit","project.json");if(E.existsSync(n))try{return JSON.parse(E.readFileSync(n,"utf8"))}catch{return null}let r=a.dirname(t);if(r===t)break;t=r;}return null}function Ke(e,t){return S(e,t)==="go"}function Ge(e,t){return S(e,t)==="node"}function Je(e,t){return S(e,t)==="java"}function $e(e,t){return S(e,t)==="dotnet"}function We(e,t){return S(e,t)==="python"}var ue={dev:["dev","start:dev"],start:["start","start:prod","preview"],build:["build"],test:["test","test:unit","test:ci"],lint:["lint"],format:["format","prettier"]},H={nestjs:{dev:["dev","start:dev"],start:["start","start:prod"],build:["build"],test:["test","test:e2e"],lint:["lint"],format:["format"]},express:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},fastify:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},koa:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]}};function ce(e){let t=a.join(e,"package.json");if(!E.existsSync(t))return {};try{let r=JSON.parse(E.readFileSync(t,"utf8")).scripts??{};return Object.fromEntries(Object.entries(r).filter(i=>typeof i[1]=="string"))}catch{return {}}}function le(e,t){let n=t?c(t):"unknown",r=n!=="unknown"?a$1(n,e):[],i=t?H[t]?.[e]??[]:[],m=ue[e]??[],f=[...r,...i,...m];return [...new Set(f)]}function V(e,t,n){let r=ce(e),i=new Set(Object.keys(r));if(i.has(t))return {scriptName:t,source:"package.json"};for(let m of le(t,n?.framework))if(i.has(m))return {scriptName:m,source:a$1(c(n?.framework??"unknown"),t).includes(m)||H[n?.framework??""]?.[t]?.includes(m)?"framework-candidate":"generic-candidate"};return null}function F(e){return E.existsSync(a.join(e,"package.json"))}var de=["build","dev","start","test","lint","format"],O=["init","test","build","start"],Ze=["lint","format","docs"];function et(e){return !!e&&de.includes(e)}var g=["init","dev","start","build","test","lint","format","help"],X={python:{runtime:"python",displayName:"Python",tier:"first-class",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:true,doctorSupport:"full",notes:["Core-backed Python projects support RapidKit modules and lifecycle commands."]},node:{runtime:"node",displayName:"Node.js",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:true,doctorSupport:"full",notes:["Node projects support npm-owned lifecycle commands; NestJS is the first-class Node framework."]},go:{runtime:"go",displayName:"Go",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:false,doctorSupport:"readiness",notes:["Go projects support workspace governance and lifecycle commands via Go tooling."]},java:{runtime:"java",displayName:"Java / Spring Boot",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:false,doctorSupport:"readiness",notes:["Java projects support Maven/Gradle lifecycle commands and workspace governance."]},dotnet:{runtime:"dotnet",displayName:".NET / ASP.NET Core",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:false,doctorSupport:"readiness",notes:[".NET projects support dotnet CLI lifecycle commands and workspace governance."]},php:{runtime:"php",displayName:"PHP",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["PHP projects are importable and governed as observed projects until a kit exists."]},ruby:{runtime:"ruby",displayName:"Ruby",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Ruby projects are importable and governed as observed projects until a kit exists."]},rust:{runtime:"rust",displayName:"Rust",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Rust projects are importable and governed as observed projects until a kit exists."]},elixir:{runtime:"elixir",displayName:"Elixir",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Elixir projects are importable and governed as observed projects until a kit exists."]},clojure:{runtime:"clojure",displayName:"Clojure",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Clojure projects are importable and governed as observed projects until a kit exists."]},scala:{runtime:"scala",displayName:"Scala",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Scala projects are importable and governed as observed projects until a kit exists."]},kotlin:{runtime:"kotlin",displayName:"Kotlin",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Kotlin projects are importable and governed as observed projects until a kit exists."]},deno:{runtime:"deno",displayName:"Deno",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Deno projects are importable and governed as observed projects until a kit exists."]},bun:{runtime:"bun",displayName:"Bun",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Bun projects are importable and governed as observed projects until a kit exists."]},unknown:{runtime:"unknown",displayName:"Unknown",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Unknown projects are tracked safely but require manual command configuration."]}},pe=["fastapi","nestjs"],fe=["django","flask","nextjs","remix","nuxt","react","vite","vue","sveltekit","svelte","angular","astro","solid","express","fastify","koa","echo","gofiber","gogin","springboot","dotnet","laravel","symfony","rails","sinatra","actix","axum","rocket","phoenix","clojure","scala","kotlin","deno","bun"];function x(e){return X[e||"unknown"]??X.unknown}function z(e){return pe.includes(e)?"first-class":fe.includes(e)?"extended":"observed"}function Q(e){let t=x(e.runtime);return {lifecycleCommands:t.lifecycleCommands,moduleCommands:e.moduleSupport&&t.moduleCommands,unsupportedLifecycleCommands:g.filter(n=>!t.lifecycleCommands.includes(n))}}var ye=["python","node","go","java","dotnet"];function b(e){return !!e&&ye.includes(e)}function N(e,t){return t!=="lint"&&t!=="format"&&t!=="docs"?false:e==="python"}function Z(e){let t=x(e),n=b(t.runtime),r=Ce[t.runtime]??[],i=ge[t.runtime]??[];return {runtime:t.runtime,displayName:t.displayName,lifecycleCommands:t.lifecycleCommands,hasExecutor:n,packageManagers:r,primaryFiles:i,notes:t.notes}}var Ce={python:["poetry","pip","uv"],node:["npm","pnpm","yarn","bun"],go:["go"],java:["maven","gradle"],dotnet:["dotnet"],php:["composer"],ruby:["bundle"],rust:["cargo"],elixir:["mix"],kotlin:["gradle"],deno:["deno"],bun:["bun"]},ge={python:["pyproject.toml","requirements.txt","requirements.in"],node:["package.json"],go:["go.mod"],java:["pom.xml","build.gradle","build.gradle.kts"],dotnet:["*.csproj","*.sln"],php:["composer.json"],ruby:["Gemfile"],rust:["Cargo.toml"],elixir:["mix.exs"],kotlin:["settings.gradle.kts"],deno:["deno.json","deno.jsonc"],bun:["package.json","bunfig.toml"]};function be(e){let t=a.join(e,".rapidkit","context.json");if(!E.existsSync(t))return null;try{return JSON.parse(E.readFileSync(t,"utf8"))}catch{return null}}function ke(e){let t=e?.engine;return t==="npm"||t==="pip"||t==="python"?t:"unknown"}function Se(e,t,n){return e?.module_support===false||t?.module_support===false?false:e?.module_support===true||t?.module_support===true?true:!e&&t?false:n.runtime==="python"||n.runtime==="node"}function xe(e,t,n){let r=g$1({runtime:typeof t?.runtime=="string"?t.runtime:typeof n?.runtime=="string"?n.runtime:void 0,framework:typeof t?.framework=="string"?t.framework:typeof n?.framework=="string"?n.framework:void 0,kitName:typeof t?.kit_name=="string"?t.kit_name:typeof t?.kit=="string"?t.kit:typeof n?.kit=="string"?n.kit:void 0});return r.key!=="unknown"?r:i(e,t)}function ee(e){let t=a.resolve(e),n=a.join(t,".rapidkit","project.json"),r=a.join(t,".rapidkit","context.json");if(!E.existsSync(n)&&!E.existsSync(r))return null;let i=q(t),m=be(t),f=xe(t,i,m);return {projectRoot:t,projectJson:i,contextJson:m,detection:f,moduleSupport:Se(i,m,f),engine:ke(m)}}function te(e){let t=Z(e);return t.runtime==="unknown"&&e!=="unknown"?null:{runtime:t.runtime,displayName:t.displayName,supportedCommands:t.lifecycleCommands,packageManagers:t.packageManagers,primaryFiles:t.primaryFiles,notes:t.notes,hasExecutor:t.hasExecutor}}function s(e){try{return E.existsSync(e)}catch{return false}}function p(e){try{return s(e)?E.readFileSync(e,"utf8"):""}catch{return ""}}function u(e,t){let n=p(a.join(e,"Makefile"));return n?new RegExp(`^${t}\\s*:`).test(n):false}function je(e){let t=[e];for(;t.length>0;){let n=t.shift();if(!n)break;let r=[];try{r=E.readdirSync(n,{withFileTypes:true});}catch{continue}for(let i of r){if(i.name==="node_modules"||i.name===".git"||i.name==="dist")continue;let m=a.join(n,i.name);if(i.isFile()&&i.name.endsWith(".csproj"))return true;i.isDirectory()&&t.push(m);}}return false}function ne(e,t){let n=s(a.join(e,"pyproject.toml")),r=s(a.join(e,"requirements.txt"))||s(a.join(e,"requirements.in")),i=s(a.join(e,"manage.py"));switch(t){case "init":return n||r;case "dev":case "start":return n||i||r;case "test":return n||r||s(a.join(e,"tests"));case "build":return n||r;case "lint":case "format":return n||r||i||s(a.join(e,"setup.py"))||s(a.join(e,"setup.cfg"));default:return false}}function Re(e,t){if(!s(a.join(e,"go.mod")))return false;switch(t){case "init":return true;case "dev":return u(e,"run")||s(a.join(e,"main.go"));case "test":return true;case "build":return true;case "start":return u(e,"run")||s(a.join(e,"main.go"))||s(a.join(e,"cmd"));case "lint":return s(a.join(e,".golangci.yml"))||s(a.join(e,".golangci.yaml"))||u(e,"lint");case "format":return u(e,"fmt")||u(e,"format");default:return false}}function he(e,t){let n=s(a.join(e,"pom.xml")),r=s(a.join(e,"build.gradle"))||s(a.join(e,"build.gradle.kts"));if(!n&&!r)return false;switch(t){case "init":case "test":case "build":case "dev":case "start":return true;case "lint":return u(e,"lint")||p(a.join(e,"pom.xml")).includes("checkstyle")||p(a.join(e,"build.gradle")).includes("checkstyle")||p(a.join(e,"build.gradle.kts")).includes("checkstyle");case "format":return u(e,"format")||p(a.join(e,"build.gradle")).includes("spotless")||p(a.join(e,"build.gradle.kts")).includes("spotless");default:return false}}function Ne(e,t){if(!je(e))return false;switch(t){case "init":case "dev":case "test":case "build":case "start":return true;case "lint":return u(e,"lint")||p(a.join(e,"Directory.Build.props")).includes("EnforceCodeStyleInBuild");case "format":return u(e,"format")||s(a.join(e,".editorconfig"));default:return false}}function ve(e,t,n){return t==="init"?F(e):V(e,t,{framework:n})!==null}function Ee(e,t,n){switch(t){case "php":return n==="init"&&s(a.join(e,"composer.json"));case "ruby":return n==="init"&&s(a.join(e,"Gemfile"));case "rust":return s(a.join(e,"Cargo.toml"))?n==="init"||n==="test"||n==="build"||n==="start":false;case "elixir":return n==="init"&&s(a.join(e,"mix.exs"));case "deno":return s(a.join(e,"deno.json"))||s(a.join(e,"deno.jsonc"))?n==="init"||n==="dev"||n==="test"||n==="start":n==="init"&&s(a.join(e,"package.json"));case "bun":return s(a.join(e,"bunfig.toml"))||s(a.join(e,"bun.lock"))?n==="init"||n==="dev"||n==="test"||n==="build"||n==="start":n==="init"&&s(a.join(e,"package.json"));default:return false}}function P(e,t,n,r){if(N(t,n))return ne(e,n);if(!b(t))return Ee(e,t,n);switch(t){case "node":return ve(e,n,r);case "python":return ne(e,n);case "go":return Re(e,n);case "java":return he(e,n);case "dotnet":return Ne(e,n);default:return false}}function Pe(e,t,n){return ["init","dev","start","build","test","lint","format"].filter(i=>P(e,t,i,n))}function re(e){let t=Q({runtime:e.runtime,moduleSupport:e.moduleSupport});if(!e.projectPath)return t;let n=Pe(e.projectPath,e.runtime,e.framework),r=new Set(["help"]);for(let m of n)t.lifecycleCommands.includes(m)&&r.add(m);e.runtime==="node"&&F(e.projectPath)&&r.add("init");let i=[...r].sort();return {lifecycleCommands:i,moduleCommands:t.moduleCommands,unsupportedLifecycleCommands:t.lifecycleCommands.filter(m=>!i.includes(m)).sort()}}var T=["version","commands","doctor","project","help"],w=["init","dev","start","build","test","lint","format"],B=["add","modules","upgrade","diff","merge","reconcile","rollback","uninstall","checkpoint","snapshot","optimize"],I=["create","list","info","frameworks","license"];T.filter(e=>e!=="help");function we(e){let t=a.resolve(e);for(;;){let n=a.join(t,".rapidkit"),r=a.join(n,"project.json"),i=a.join(n,"context.json");if(E.existsSync(r)||E.existsSync(i))return t;let m=a.dirname(t);if(m===t)break;t=m;}return null}function j(e,t){return {command:e,...t}}var Me=new Set(["dev","lint","format"]),_e=new Set(O);function Ae(e,t){return t?_e.has(e)?{executionScope:"fleet",fleetEligible:true}:Me.has(e)?{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}}function Le(e,t){return N(t.runtime,e)?"core":"runtime"}function Fe(e,t,n,r){return !e||!r.lifecycleCommands.includes(t)?false:P(e,n.runtime,t,n.key)}function Oe(e,t){let n=!!e&&(t.runtime==="python"||b(t.runtime)&&P(e,t.runtime,"build",t.key));return j("docs",{owner:t.runtime==="python"?"core":"runtime",status:n?"supported":"unsupported",reason:n?t.runtime==="python"?"Documentation generation is delegated to Python Core for this project.":"Project documentation commands are available through the npm wrapper for this runtime.":"Documentation commands require a supported Python or npm-executor project manifest."})}function De(e){let t=a.resolve(e),n=we(e);return n||(h(t).length>0?t:null)}function Te(e=process.cwd()){let t=De(e),n=t?ee(t):null,r=n?.detection??i(e,n?.projectJson??null),i$1=n?.moduleSupport??false,m=n?.engine??"unknown",f=te(r.runtime),U=x(r.runtime),ae=re({runtime:r.runtime,moduleSupport:i$1,projectPath:t??void 0,framework:r.key}),d={};for(let o of T)d[o]=j(o,{owner:o==="project"?"core":"npm",status:"supported",reason:o==="project"?"Project detection is a Core contract; workspace project lifecycle remains npm-owned.":o==="help"?"Help is available for every RapidKit project through the npm CLI.":"Universal command available across RapidKit project types."});for(let o of w){let y=Fe(t,o,r,ae),G=Le(o,r),M=Ae(o,y);d[o]=j(o,{owner:G,status:y?"supported":"unsupported",executionScope:M.executionScope,fleetEligible:M.fleetEligible,reason:y?G==="core"?`Delegated to Python Core for ${r.displayName} projects.`:M.fleetEligible?`Handled by runtime adapter and eligible for workspace fleet stages (${o}).`:o==="dev"?"Local development command only; workspace fleet excludes dev by design.":r.runtime==="node"?`Handled by npm/pnpm/yarn via the resolved ${o} script in package.json.`:`Handled by the ${f?.displayName??r.displayName} runtime adapter for local project execution.`:t?r.runtime==="node"?`No ${o} script was found in package.json for this ${r.displayName} project.`:b(r.runtime)?`The ${r.displayName} runtime is tracked, but ${o} is not available from detected project manifests.`:`${r.displayName} is tracked as an observed runtime; ${o} requires project manifests or explicit scripts.`:"No RapidKit project was detected."});}d.docs=Oe(t,r);for(let o of B)d[o]=j(o,{owner:i$1?"core":"none",status:i$1?"supported":"unsupported",reason:i$1?"Core module/template command supported for this project.":`Core module/template commands are not available for ${r.displayName} projects.`});for(let o of I)d[o]=j(o,{owner:o==="create"?"npm":"core",status:"global",reason:o==="create"?"Create is orchestrated by npm for multi-language workspace support.":"Engine catalog command; not specific to the selected project runtime."});let R=Object.values(d),K=R.filter(o=>w.includes(o.command)).filter(o=>o.status==="supported"),se=O.filter(o=>K.some(y=>y.fleetEligible===true&&y.command===o)),me=K.filter(o=>o.executionScope==="local-only").map(o=>o.command).sort();return {schemaVersion:1,scope:"project",projectRoot:t,engine:m,runtime:r.runtime,framework:r.key,frameworkDisplayName:r.displayName,frameworkConfidence:r.confidence,frameworkSupportTier:z(r.key),runtimeSupportTier:U.tier,runtimeDoctorSupport:U.doctorSupport,moduleSupport:i$1,fleetStages:se,localOnlyCommands:me,commandMap:d,supportedCommands:R.filter(o=>o.status==="supported").map(o=>o.command).sort(),unsupportedCommands:R.filter(o=>o.status==="unsupported").map(o=>o.command).sort(),globalCommands:R.filter(o=>o.status==="global").map(o=>o.command).sort()}}function It(e,t=process.cwd()){let n=e[0];return n?Te(t).commandMap[n]??null:null}function Ut(e){if(e[0]==="project"&&e[1]==="commands")return true;if(e[0]==="commands"&&e.includes("--scope")){let t=e.indexOf("--scope");return e[t+1]==="project"}return e.some(t=>t==="--scope=project")&&e[0]==="commands"}function Kt(e,t){return [`RapidKit command not supported for this project: ${e.command}`,"",`Project: ${t.projectRoot??"not detected"}`,`Runtime: ${t.runtime}`,`Framework: ${t.frameworkDisplayName}`,`Reason: ${e.reason??"Unsupported for this project type."}`,"","Run `rapidkit project commands` to inspect supported commands for this project."].join(`
|
|
2
|
-
`)}export{q as a,Ke as b,Ge as c,Je as d,$e as e,We as f,V as g,de as h,Ze as i,et as j,x as k,z as l,b as m,ee as n,re as o,we as p,Te as q,It as r,Ut as s,Kt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{b as buildWorkspaceExplain,a as resolveWorkspaceExplainArtifactPath,c as writeWorkspaceExplainReport}from'./chunk-TXUBE6KV.js';export{d as WORKSPACE_MODEL_DIFF_REPORT_PATH}from'./chunk-THSTNVE3.js';export{c as WORKSPACE_EXPLAIN_REPORT_PATH,e as WORKSPACE_TRACE_REPORT_PATH,d as WORKSPACE_WHY_REPORT_PATH}from'./chunk-GBJBQ43T.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{a as runWorkspaceStage}from'./chunk-DAPZJHMN.js';export{a as WORKSPACE_RUN_LAST_REPORT_FILENAME}from'./chunk-64RTZBHU.js';
|