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
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {b,c,d}from'./chunk-TQULVWUA.js';import {d as d$1}from'./chunk-6WDDATKQ.js';import {b as b$1,f,g as g$1,a}from'./chunk-GBJBQ43T.js';import {n,k as k$1,b as b$2,j as j$1}from'./chunk-KUOCSDIY.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 je="workspace-operational-skill.v1";function ve(e){if(typeof e!="string")return null;let t=e.trim();return !t||t.includes("/")||t.includes("..")?null:t}function de(e){let t=ve(e.skillId);if(!t)throw new Error(`Invalid skill id: ${e.skillId}`);return {schemaVersion:je,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 Pe="workspace-skills-index.v1";function le(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:Pe,generatedAt:e.generatedAt,inputsHash:r,skills:t.map(i=>({skillId:i.skillId,path:i.canonicalPath,schemaVersion:i.schemaVersion,title:i.title}))}}var ue=[".rapidkit/reports/INDEX.json",b,d$1],Ce=[{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 Ee(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)","",...ue.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 Ie(e){return e?.safeCommands?.length?e.safeCommands.slice(0,8).map(t=>t.display):[D("workspace verify --json"),D("doctor workspace --json")]}function Oe(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 ge(e){let t=e.model.workspace.name,r=e.model.projects.map(p=>p.name).sort(),i=Ie(e.context??null),o=Oe(e.contract??null);return Ce.map(p=>{let c=Ee({template:p,workspaceName:t,scopedProjects:r,verificationCommands:i,contractSummary:o});return de({skillId:p.skillId,title:p.title,triggers:p.triggers,requiredReports:[...ue],scopedProjects:r,verificationCommands:i,promptStem:g$1[p.skillId],markdown:c})})}async function me(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=le({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 ke(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 Te={"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 We(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 fe(e){let t=s.resolve(e.workspacePath),r=[];for(let i of e.skills){let o=Te[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=We(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 Ne="rapidkit-agent-customization-pack.v1";function J(e){return e.replace(/^\.rapidkit\//,".workspai/").replace(/rapidkit-workspace/g,"workspai-workspace").replace(/rapidkit-diagnose/g,"workspai-diagnose").replace(/rapidkit-mcp-design/g,"workspai-mcp-design")}function he(){return {schemaVersion:Ne,presets:{minimal:{meaning:"Generate the portable grounding index, AGENTS.md, and provider-specific lightweight instructions.",requiredOutputs:[".workspai/reports/INDEX.json",".workspai/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:[".workspai/reports/INDEX.json",".workspai/reports/agent-customization-pack.json","AGENTS.md",".github/instructions/workspai-workspace.instructions.md",".github/prompts/workspai-diagnose.prompt.md",".github/skills/workspai-workspace-intelligence/SKILL.md",".github/agents/workspai-advisor.agent.md",".workspai/reports/workspai-mcp-design.json",J(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:J(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:[".workspai/reports/",`${J(a)}/`],l2PrefixedMirrorRoots:[".github/",".cursor/",".claude/"],l3SharedIndustryFiles:["AGENTS.md",".github/copilot-instructions.md","CLAUDE.md"]}}}var _e="rapidkit-agent-reports-index.v1",De="rapidkit-agent-customization-pack.v1",Z=".rapidkit/reports/INDEX.json",we=".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 Re(e){return e&&typeof e=="object"?e:null}function Y(e,t=12){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0).slice(0,t):[]}function Ge(e){let t=Y(e.blockers,12);if(t.length>0)return t;let r=Y(e.blockingReasons,12);if(r.length>0)return r;let i=Re(e.summary);return i&&Array.isArray(i.blockingReasons)?Y(i.blockingReasons,12):[]}function Ke(e){for(let t of ["generatedAt","timestamp"]){let r=e[t];if(typeof r=="string"&&r.trim())return r.trim()}}function Le(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 Me(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 qe(e){return w(e,"copilot")||w(e,"vscode")}function $e(e){return e??"enterprise"}function He(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 Ve(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 ze(e,t){return he().presets[t].requiredOutputs.includes(e)}function Fe(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 Ue(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(Fe(i))return i}catch{}return n({workspacePath:e,includeEvidence:true})}function Xe(e){return e.length>0&&!s.isAbsolute(e)&&!e.split(/[\\/]+/).includes("..")}function Be(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 Je(e){try{if(!await g.pathExists(e))return null;let t=await g.readJson(e);return Re(t)}catch{return null}}async function Ae(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 Je(n),j=m!==null;j&&m&&o.push(...Ge(m)),i.push({path:c.relativePath,label:c.label,required:c.required,exists:j,generatedAt:m?Ke(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:_e,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 be(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 Ze(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 Ye(){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 Qe(){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 et(){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 tt(){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 rt(){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 it(){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 nt(){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 st(){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 ot(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 at(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 ct(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 pt(){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 Q(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 zt(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 dt(e){let t=[...e.outputs].sort((r,i)=>r.path.localeCompare(i.path));return {schemaVersion:De,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:Be({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 Ft(e){let t=s.resolve(e.workspacePath),r=new Date,i=e.staleAfterHours??24,o=Me(e.targets),p=[...o].sort(),c$1=$e(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 Ae({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:He(l),targets:Ve(l),required:ze(l,c$1),status:a==="written"?"written":e.dryRun?"planned":"skipped"});};d$1(await u(s.join(t,Z),`${JSON.stringify(A,null,2)}
|
|
27
|
+
`,n$1),Z),d$1(await u(s.join(t,we),`${Ze(A)}
|
|
28
|
+
`,n$1),we);let ee="",xe=await Ue(t,M),V=null;try{V=(await j({workspacePath:t})).contract;}catch{V=null;}let ye=ge({model:xe,context:v,contract:V}),z=await me({workspacePath:t,skills:ye,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),ee=ke(z.index),(w(o,"agents")||w(o,"vscode"))&&d$1(await Q({absolutePath:s.join(t,"AGENTS.md"),generatedBody:be({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,Qe()),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"),`${it()}
|
|
31
|
+
`,n$1),".claude/rules/rapidkit-evidence.md");}if(w(o,"cursor")&&d$1(await u(s.join(t,".cursor/rules/rapidkit-grounding.mdc"),et(),n$1),".cursor/rules/rapidkit-grounding.mdc"),qe(o)){if(d$1(await Q({absolutePath:s.join(t,".github/copilot-instructions.md"),generatedBody:Ye(),write:n$1}),".github/copilot-instructions.md"),d$1(await u(s.join(t,".github/instructions/rapidkit-workspace.instructions.md"),rt(),n$1),".github/instructions/rapidkit-workspace.instructions.md"),d$1(await u(s.join(t,".github/instructions/rapidkit-evidence.instructions.md"),tt(),n$1),".github/instructions/rapidkit-evidence.instructions.md"),d$1(await u(s.join(t,".github/prompts/rapidkit-diagnose.prompt.md"),nt(),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 fe({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"),pt(),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"),ct(ee),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",st()]];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"),ot({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"),at({workspacePath:t,generatedAt:A.generatedAt}),n$1),".vscode/rapidkit-agent-hooks.json"),(w(o,"codex")||w(o,"orca"))&&(w(o,"agents")||d$1(await Q({absolutePath:s.join(t,"AGENTS.md"),generatedBody:be({index:A,context:v}),write:n$1}),"AGENTS.md"));let F=n$1?await Ae({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&&Le(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=>!Xe(l));a.length>0&&P.push(`Unsafe generated output paths: ${a.join(", ")}`);}let te=dt({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(te,null,2)}
|
|
32
|
+
`,n$1),G),{workspacePath:t,indexPath:s.join(t,Z),packPath:s.join(t,G),pack:te,contextPath:j$1,writtenFiles:q,skippedFiles:$,blockers:A.blockers,missingRequired:T,staleReports:W,strictViolations:P}}export{je as a,Pe as b,_e as c,De as d,Z as e,we as f,G as g,O as h,Ae as i,zt as j,Ft as k,Ne as l};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {b as b$1}from'./chunk-KEMWZUGO.js';import {e,g,c as c$1}from'./chunk-WRMCPKGA.js';import S from'validate-npm-package-name';import i from'path';import {spawn}from'child_process';import s from'chalk';import l from'fs-extra';var c=class extends Error{constructor(n,r,o){super(n);this.code=r;this.details=o;this.name="RapidKitError",Error.captureStackTrace(this,this.constructor);}code;details},N=class extends c{constructor(t,n){let r=n?`Python ${t}+ required, found ${n}`:`Python ${t}+ not found`;super(r,"PYTHON_NOT_FOUND","Please install Python from https://www.python.org/downloads/");}},I=class extends c{constructor(){super("Poetry is not installed","POETRY_NOT_FOUND","Install Poetry from https://python-poetry.org/docs/#installation");}},$=class extends c{constructor(){super("pipx is not installed","PIPX_NOT_FOUND","Install pipx from https://pypa.github.io/pipx/installation/");}},E=class extends c{constructor(t){super(`Directory "${t}" already exists`,"DIRECTORY_EXISTS","Please choose a different name or remove the existing directory");}},m=class extends c{constructor(t,n){super(`Invalid project name: "${t}"`,"INVALID_PROJECT_NAME",n);}},D=class extends c{constructor(t,n){let r=`Installation failed at: ${t}`,o=`${n.message}
|
|
2
|
+
|
|
3
|
+
Troubleshooting:
|
|
4
|
+
- Check your internet connection
|
|
5
|
+
- Verify Python/Poetry installation
|
|
6
|
+
- Try running with --debug flag for more details`;super(r,"INSTALLATION_ERROR",o);}},b=class extends c{constructor(){super("RapidKit Python package is not yet available on PyPI","RAPIDKIT_NOT_AVAILABLE",`Available options:
|
|
7
|
+
1. Install Python 3.10+ and retry the same command
|
|
8
|
+
2. Use the core workflow: npx rapidkit create workspace <name>
|
|
9
|
+
3. Offline fallback (limited): npx rapidkit create project fastapi.standard <name> --output .
|
|
10
|
+
|
|
11
|
+
Legacy: set RAPIDKIT_SHOW_LEGACY=1 to reveal template-mode flags in help.`);}};function F(e){let t=S(e);if(!t.validForNewPackages){let r=t.errors||[],o=t.warnings||[],a=[...r,...o];throw new m(e,`NPM validation failed: ${a.join(", ")}`)}if(!/^[a-z][a-z0-9_-]*$/.test(e))throw new m(e,"Must start with a lowercase letter and contain only lowercase letters, numbers, hyphens, and underscores");if(["test","tests","src","dist","build","lib","python","pip","poetry","node","npm","rapidkit","rapidkit"].includes(e.toLowerCase()))throw new m(e,`"${e}" is a reserved name. Please choose a different name.`);if(e.length<2)throw new m(e,"Name must be at least 2 characters long");if(e.length>214)throw new m(e,"Name must be less than 214 characters");return true}function le(e){let t=M(e.workspacePath,e.result.projectPath)?"imported":"adopted";return {name:e.result.projectName,path:e.result.projectPath,relativePath:L(e.workspacePath,e.result.projectPath),relationship:t,stack:e.result.definition.framework,runtime:"node",framework:e.result.definition.framework,frameworkDisplayName:e.result.definition.displayName,supportTier:"extended",moduleSupport:false,confidence:"high",source:t==="adopted"?"adopted-local":"local-folder",importedAt:e.importedAt??new Date().toISOString()}}function M(e,t){let n=i.relative(i.resolve(e),i.resolve(t));return n===""||n.length>0&&!n.startsWith("..")&&!i.isAbsolute(n)}function L(e,t){return (i.relative(e,t)||".").split(i.sep).join("/")}var O=[{id:"nextjs",kitId:"frontend.nextjs",aliases:["frontend.nextjs","next","nextjs","next.js"],displayName:"Next.js",framework:"nextjs",defaultPort:3e3,commandDisplay:e=>`npx create-next-app@latest ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","create-next-app@latest",e,"--yes",...t.skipGit?["--disable-git"]:[],...t.skipInstall?["--skip-install"]:[]]})},{id:"remix",kitId:"frontend.remix",aliases:["frontend.remix","remix","remix-run","react-router"],displayName:"React Router",framework:"remix",defaultPort:5173,commandDisplay:e=>`npx create-react-router@latest ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","create-react-router@latest",e,"--yes",...t.skipInstall?["--no-install"]:["--install"],"--no-git-init"]})},{id:"vite-react",kitId:"frontend.vite-react",aliases:["frontend.vite-react","vite-react","react","vite.react"],displayName:"React + Vite",framework:"react",defaultPort:5173,commandDisplay:e=>`npm create vite@latest ${e} -- --template react-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","react-ts","--no-interactive"]})},{id:"vite-vue",kitId:"frontend.vite-vue",aliases:["frontend.vite-vue","vite-vue","vue","vite.vue"],displayName:"Vue + Vite",framework:"vue",defaultPort:5173,commandDisplay:e=>`npm create vite@latest ${e} -- --template vue-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","vue-ts","--no-interactive"]})},{id:"vite-svelte",kitId:"frontend.vite-svelte",aliases:["frontend.vite-svelte","vite-svelte","svelte","vite.svelte"],displayName:"Svelte + Vite",framework:"svelte",defaultPort:5173,commandDisplay:e=>`npm create vite@latest ${e} -- --template svelte-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","svelte-ts","--no-interactive"]})},{id:"vite-solid",kitId:"frontend.vite-solid",aliases:["frontend.vite-solid","vite-solid","solid","solidjs","vite.solid"],displayName:"Solid + Vite",framework:"solid",defaultPort:5173,commandDisplay:e=>`npm create vite@latest ${e} -- --template solid-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","solid-ts","--no-interactive"]})},{id:"vite-vanilla",kitId:"frontend.vite-vanilla",aliases:["frontend.vite-vanilla","vite","vanilla","vite-vanilla"],displayName:"Vite",framework:"vite",defaultPort:5173,commandDisplay:e=>`npm create vite@latest ${e} -- --template vanilla-ts`,commandExec:e=>({command:"npm",args:["create","vite@latest",e,"--","--template","vanilla-ts","--no-interactive"]})},{id:"nuxt",kitId:"frontend.nuxt",aliases:["frontend.nuxt","nuxt","nuxtjs","nuxt.js"],displayName:"Nuxt",framework:"nuxt",defaultPort:3e3,commandDisplay:(e,t)=>`npx create-nuxt@latest ${e} --template minimal --packageManager npm --gitInit ${t?.skipGit?"false":"true"}${t?.skipInstall?" --no-install":""}`,commandExec:(e,t)=>({command:"npx",args:["--yes","create-nuxt@latest",e,"--template","minimal","--packageManager","npm","--gitInit",t.skipGit?"false":"true",...t.skipInstall?["--no-install"]:[]]})},{id:"angular",kitId:"frontend.angular",aliases:["frontend.angular","angular","ng"],displayName:"Angular",framework:"angular",defaultPort:4200,minNodeMajor:18,minNodeMessage:"Angular scaffolding requires Node.js 18.19+ or 20.11+. Upgrade Node, or choose another frontend kit.",commandDisplay:e=>`npx @angular/cli@19 new ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","@angular/cli@19","new",e,"--defaults","--skip-git",...t.skipInstall?["--skip-install"]:[]]})},{id:"astro",kitId:"frontend.astro",aliases:["frontend.astro","astro"],displayName:"Astro",framework:"astro",defaultPort:4321,commandDisplay:e=>`npm create astro@4 ${e}`,commandExec:(e,t)=>({command:"npm",args:["create","astro@4",e,"--","--yes",...t.skipInstall?["--no-install"]:[],...t.skipGit?["--no-git"]:[]]})},{id:"sveltekit",kitId:"frontend.sveltekit",aliases:["frontend.sveltekit","sveltekit","svelte-kit"],displayName:"SvelteKit",framework:"sveltekit",defaultPort:5173,commandDisplay:e=>`npx sv@latest create ${e}`,commandExec:(e,t)=>({command:"npx",args:["--yes","sv@latest","create",e,"--template","minimal","--types","ts","--no-add-ons",...t.skipInstall?["--no-install"]:["--install","npm"]]})}],v=new Map;for(let e of O){v.set(e.id,e),v.set(e.kitId,e);for(let t of e.aliases)v.set(t.toLowerCase(),e);}function de(){return [...O]}function f(e){return e?v.get(e.trim().toLowerCase())??null:null}function ce(e){return !!f(e)}function me(e){if(e[0]!=="create"||e[1]!=="frontend")return null;let t=e[2],n=e[3],r=e.slice(4),o=f(t);return o?["create","project",o.kitId,n??"",...r].filter(Boolean):["create","project",`frontend.${t??""}`,n??"",...r].filter(Boolean)}function G(e,t){return `rapidkit create project ${f(e)?.id??e.replace(/^frontend\./,"")} ${t}`}function A(e,t){return `npx ${G(e,t)}`}function V(e){let t=f(e);return t?`${G(t.id,"<name>")} [--output <dir>] [--skip-install] [--dry-run]`:"rapidkit create project <nextjs|remix|vite-react|vite-vue|vite-svelte|vite-solid|vite-vanilla|nuxt|angular|astro|sveltekit> <name> [--output <dir>] [--skip-install] [--dry-run]"}async function pe(e){let t=e.args;if(t[0]!=="create"||t[1]!=="project")throw new Error("Frontend create expects normalized args: create project <frontend.kit> <name>");let n=f(t[2]);if(!n)throw new Error(`Unknown frontend generator: ${t[2]??"(missing)"}`);let r=t[3];if(!r)throw new Error(`Usage: ${V(n.id)}`);F(r),Y(n);let o=W(t,"--output")||process.cwd(),a=i.resolve(o,r),p=e.dryRun===true||t.includes("--dry-run"),x=t.includes("--skip-install"),g=t.includes("--skip-git")||t.includes("--no-git"),d=n.commandExec(r,{skipGit:g,skipInstall:x}),u=n.commandDisplay(r,{skipGit:g,skipInstall:x});if(await l.pathExists(a))throw new Error(`Directory "${a}" already exists`);if(p)return J({definition:n,projectName:r,projectPath:a,commandPlan:d}),{definition:n,projectName:r,projectPath:a,dryRun:p,commandDisplay:u,commandExec:[d.command,...d.args]};await l.ensureDir(i.dirname(a));let k=await C(d.command,d.args,i.dirname(a)),y=await z(a);if(k!==0&&!y)throw new Error(`Official ${n.displayName} generator failed with exit code ${k}`);return k!==0&&y&&console.log(s.yellow(`\u26A0\uFE0F Official ${n.displayName} generator exited with code ${k}, but the scaffold looks complete. Continuing RapidKit project setup...`)),g||await B(a),await U({definition:n,projectName:r,projectPath:a,commandDisplay:u,commandExec:[d.command,...d.args],skipGit:g,skipInstall:x}),console.log(s.green(`\u2705 ${n.displayName} project created at ${a}`)),console.log(s.gray(` Display command: ${A(n.id,r)}`)),console.log(s.gray(" Next: cd "+r+" && npx rapidkit dev")),{definition:n,projectName:r,projectPath:a,dryRun:p,commandDisplay:u,commandExec:[d.command,...d.args]}}async function U(e){let t=new Date().toISOString(),n=await b$1(),r={schema_version:"1.0",name:e.projectName,slug:e.projectName,kind:"frontend",project_type:"frontend",runtime:"node",framework:e.definition.framework,framework_display_name:e.definition.displayName,kit_name:e.definition.kitId,kit:e.definition.kitId,engine:"npm",support_tier:"extended",module_support:false,modules:[],rapidkit_version:n,generated_by:"rapidkit-npm",generated_at:t,frontend:{generator:e.definition.id,official_generator:true,default_port:e.definition.defaultPort,command_display:e.commandDisplay,command_exec:e.commandExec,skip_install:e.skipInstall,skip_git:e.skipGit},contracts:{owns:[],apis:[],publishes:[],consumes:[],dependsOn:[],env:[]}},o={project:e.projectName,runtime:"node",framework:e.definition.framework,kind:"frontend",source:"official-generator"},a={kind:"rapidkit.frontend_create",schema_version:"1.0",generated_at:t,project:{name:e.projectName,path:e.projectPath,kind:"frontend",runtime:"node",framework:e.definition.framework,framework_display_name:e.definition.displayName,kit_name:e.definition.kitId},generator:{id:e.definition.id,command_display:e.commandDisplay,command_exec:e.commandExec}};await l.ensureDir(i.join(e.projectPath,".rapidkit")),await l.writeJson(i.join(e.projectPath,".rapidkit","project.json"),r,{spaces:2}),await l.writeJson(i.join(e.projectPath,".rapidkit","context.json"),o,{spaces:2}),await l.writeJson(i.join(e.projectPath,".rapidkit","frontend-create.json"),a,{spaces:2});}function J(e){console.log(s.bold(`
|
|
12
|
+
RapidKit frontend create plan: ${e.definition.displayName}`)),console.log(s.gray(`Project: ${e.projectName}`)),console.log(s.gray(`Target: ${e.projectPath}`)),console.log(s.gray(`Show: ${A(e.definition.id,e.projectName)}`)),console.log(s.gray(`Run: ${[e.commandPlan.command,...e.commandPlan.args].join(" ")}`)),console.log(s.gray(`Default: http://localhost:${e.definition.defaultPort}`));}function K(){let e=Number.parseInt(process.versions.node.split(".")[0]??"",10);return Number.isFinite(e)?e:0}function Y(e){if(!(!e.minNodeMajor||K()>=e.minNodeMajor))throw new Error(e.minNodeMessage??`${e.displayName} requires Node.js ${e.minNodeMajor}+ (current: ${process.versions.node}).`)}async function z(e){if(!await l.pathExists(e))return false;let t=i.join(e,"package.json");return await l.pathExists(t)?true:(await l.readdir(e)).length>0}async function B(e){let t=i.join(e,".git");if(await l.pathExists(t))return;if(await C("git",["init"],e)===0){console.log(s.gray(" Git repository initialized."));return}console.log(s.yellow("\u26A0\uFE0F Git initialization was skipped or failed. You can run `git init` manually inside the project."));}async function C(e$1,t,n){let r=e(e$1);return await new Promise(o=>{let a=spawn(r.command,[...r.prefixArgs,...t],{cwd:n,stdio:"inherit",shell:c$1(),env:g()});a.on("close",p=>o(p??1)),a.on("error",()=>o(1));})}function W(e,t){let n=e.indexOf(t);if(n>=0&&n+1<e.length)return e[n+1];let r=e.find(o=>o.startsWith(`${t}=`));return r?r.slice(t.length+1):void 0}
|
|
13
|
+
export{c as a,N as b,I as c,$ as d,E as e,D as f,b as g,F as h,le as i,de as j,f as k,ce as l,me as m,V as n,pe as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-KUOCSDIY.js';import {a,b as b$1}from'./chunk-S5KTATOU.js';function f(r){let s=new Map;for(let n of r.projects)s.has(n.name)||s.set(n.name,b(n));return s}function j(r){let s=f(r),n=r.graph??{nodes:r.projects.map(t=>({id:t.name,path:t.path})),edges:[]},a$1=a(n),o=new Map;for(let t of n.nodes){let e=s.get(t.id)??b({missing:t.id}),g=[...b$1(a$1,[t.id],{direction:"dependencies"}).keys()].filter(c=>c!==t.id).sort((c,l)=>c.localeCompare(l)).map(c=>({id:c,hash:s.get(c)??"<unknown>"}));o.set(t.id,{id:t.id,ownHash:e,transitiveInputsHash:b({own:e,dependencies:g})});}return o}function v(r,s){if(!s||Object.keys(s).length===0)return {verdict:"unknown",baseline:"none",changed:[],added:[],removed:[]};let n=[],a=[];for(let[e,i]of r.entries())e in s?s[e]!==i.transitiveInputsHash&&n.push(e):a.push(e);let o=[];for(let e of Object.keys(s))r.has(e)||o.push(e);return n.sort((e,i)=>e.localeCompare(i)),a.sort((e,i)=>e.localeCompare(i)),o.sort((e,i)=>e.localeCompare(i)),{verdict:n.length>0||a.length>0||o.length>0?"stale":"fresh",baseline:"recorded",changed:n,added:a,removed:o}}function w(r){let s={};for(let[n,a]of [...r.entries()].sort((o,t)=>o[0].localeCompare(t[0])))s[n]=a.transitiveInputsHash;return s}export{f as a,j as b,v as c,w as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {n,d,e}from'./chunk-
|
|
1
|
+
import {n,d,e}from'./chunk-KUOCSDIY.js';import {a}from'./chunk-3PTJID76.js';import u from'path';import v from'fs-extra';var $="workspace-context.v1",M=".rapidkit/reports/workspace-context-agent.json";function F(e){if(typeof e!="string"||!e.trim()||e==="true")return "generic";let t=e.trim().toLowerCase();return t==="codex"||t==="claude"||t==="cursor"||t==="orca"?t:"generic"}function x(e){return `npx --yes --package rapidkit rapidkit ${e}`.trim()}function C(e){return `npx rapidkit ${e}`.trim()}function i(e){return {id:e.id,scope:e.scope,display:C(e.args),execute:x(e.args),description:e.description,...e.project?{project:e.project}:{},freshness:d({id:`command.${e.id}`,label:`${e.id} command`,scope:"command",value:{display:C(e.args),execute:x(e.args)},...e.project?{project:e.project}:{},freshness:{kind:"derived",category:"structure",generatedAt:e.generatedAt,now:e.now,sourceArtifact:".rapidkit/reports/workspace-model.json",sourcePath:`safeCommands.${e.id}`,reason:"Safe command surfaces are derived from workspace model command capabilities."}}).freshness}}function W(e,t){return `workspace run ${t} --scope project:${e.name}`}function R(e){return (e.startsWith("project:")?e.slice(8):e).trim().toLowerCase()}function E(e){return [e.name,e.path,u.basename(e.path),e.absolutePath].filter(t=>typeof t=="string"&&t.trim().length>0).map(t=>t.trim().toLowerCase())}function T(e,t,o){let r={generatedAt:e.generatedAt,now:o},a=[i({id:"workspace.model",scope:"workspace",args:"workspace model --json",description:"Read the canonical workspace intelligence model.",...r}),i({id:"workspace.doctor",scope:"workspace",args:"doctor workspace --json",description:"Check workspace health before claiming verification.",...r}),i({id:"workspace.pipeline",scope:"workspace",args:"pipeline --json",description:"Run the governed sync, doctor, analyze, readiness, and autopilot loop.",...r}),i({id:"workspace.contract.verify",scope:"workspace",args:"workspace contract verify --json",description:"Verify workspace contract and dependency edges.",...r}),i({id:"workspace.verify",scope:"workspace",args:"workspace verify --json",description:"Evaluate evidence freshness and verification gates before release decisions.",...r})],c=t?[t]:e.projects;for(let n of c)n.commands.fleetStages.includes("test")&&a.push(i({id:`project.${n.name}.test`,scope:"project",project:n.name,args:W(n,"test"),description:`Run tests for ${n.name} through workspace orchestration.`,...r})),n.commands.fleetStages.includes("build")&&a.push(i({id:`project.${n.name}.build`,scope:"project",project:n.name,args:W(n,"build"),description:`Build ${n.name} through workspace orchestration.`,...r}));return a}function O(e){return e.commands.fleetStages.filter(t=>t==="test"||t==="build").map(t=>`workspace run ${t}`)}function D(e,t){if(!t?.startsWith("project:"))return;let o=R(t);if(o)return e.projects.find(r=>E(r).includes(o))}function V(e,t,o){let r=[...e.validation?.issues??[]];t?.startsWith("project:")&&!o&&r.push({severity:"error",code:"context.scope.project.missing",message:`Requested project scope was not found: ${t}`,target:t});let a=r.filter(n=>n.severity==="error").length,c=r.filter(n=>n.severity==="warning").length;return {status:a>0?"failed":c>0?"warning":"passed",errors:a,warnings:c,issues:r}}function I(e){let t=[],o=[];for(let[r,a]of Object.entries(e.evidence))a?.exists?t.push(`${r}: ${a.path}`):o.push(r);return {available:t.sort(),missing:o.sort()}}function N(e){let t=e.summary.projectCount,o=e.summary.runtimes.length?e.summary.runtimes.join(", "):"no runtime",r=e.identity.surfaces.length?e.identity.surfaces.join(", "):"no detected surfaces";return `${e.workspace.name} is a ${e.identity.workspaceType} with ${t} project${t===1?"":"s"}, ${o} runtime coverage, and ${r}.`}function _(e){let t=["Do not claim a command passed unless a report or command output proves it.","Do not infer secrets or environment values from file names.","Do not change project scope without checking the selected project."];return e.contracts.exists||t.push("Workspace contract is missing; dependency and API edges may be incomplete."),e.summary.observedProjects>0&&t.push("Some projects are observed rather than first-class; command support may be partial."),t}async function L(e$1){let t=e$1.model??await n({workspacePath:e$1.workspacePath,includeEvidence:e$1.includeEvidence===true,observableScanDepth:e$1.observableScanDepth,now:e$1.now}),o=F(e$1.agent),r=D(t,e$1.scope),a=V(t,e$1.scope,r);if(e$1.strict===true&&a.status!=="passed"){let s=a.issues.map(p=>`${p.severity}:${p.code}:${p.target}`).join(", ");throw new Error(`Workspace context strict validation failed: ${s}`)}let c=e$1.now??new Date,n$1=t.facts??[],b=new Set((r?[r]:t.projects).map(s=>s.name)),g=n$1.filter(s=>s.project?b.has(s.project):true),S=(r?[r]:t.projects).map(s=>{let p=g.filter(P=>P.project===s.name);return {name:s.name,path:s.path,kind:s.kind,runtime:s.runtime,framework:s.frameworkDisplayName,...s.generator?{generator:s.generator}:{},createCapability:s.createCapability,supportTier:s.supportTier,safeCommands:O(s),importantFiles:s.importantFiles,facts:p}}),d$1=I(t),f=N(t),k=T(t,r,c),A=k.map(s=>d({id:`context.command.${s.id}`,label:`${s.id} safe command`,scope:"command",value:{display:s.display,execute:s.execute,scope:s.scope},...s.project?{project:s.project}:{},freshness:{kind:"derived",category:"structure",generatedAt:t.generatedAt,now:c,sourceArtifact:".rapidkit/reports/workspace-context-agent.json",sourcePath:`safeCommands.${s.id}`,reason:"Context safe commands are derived from workspace model command capabilities."}})),h=[...g,...A],m=e({facts:h,generatedAt:c.toISOString(),now:c});return {schemaVersion:$,generatedAt:c.toISOString(),agent:o,workspaceSummary:f,modelRef:".rapidkit/reports/workspace-model.json",workspace:{name:t.workspace.name,root:t.workspace.root,type:t.identity.workspaceType,...t.workspace.profile?{profile:t.workspace.profile}:{}},scope:{requested:e$1.scope??"workspace",...r?{activeProject:r.name}:{}},projects:S,safeCommands:k,facts:h,factFreshness:m,evidence:d$1,policies:{mode:t.policies.mode,source:t.policies.source},contracts:{exists:t.contracts.exists,path:t.contracts.workspaceContractPath},validation:a,agentInstructions:["Read `.rapidkit/reports/INDEX.json` first, then this context pack and linked evidence reports.","Use this context as the workspace source of truth before inspecting random files.","Prefer workspace-level evidence over generic framework assumptions.","Use `display` commands when explaining steps to a human.","Use `execute` commands when launching commands from automation or tooling.","Treat `facts[].freshness.verifyBeforeUse` as a hard refresh requirement before using that fact in advice, fixes, or release decisions.","Do not carry extracted facts beyond their freshness contract; re-read or regenerate evidence when the contract says stale, unknown, live, or verify-before-use.","Keep project-scoped advice tied to the active project scope.","Regenerate stale grounding with `npx rapidkit workspace agent-sync --write --refresh-context`."],unsafeAssumptions:[..._(t),...m.verifyBeforeUseFacts>0?[`${m.verifyBeforeUseFacts} fact(s) require verification before use; do not treat them as durable workspace structure.`]:[]],humanSummary:[f,`Evidence available: ${d$1.available.length}. Missing evidence groups: ${d$1.missing.join(", ")||"none"}.`,r?`Active project scope: ${r.name} (${r.frameworkDisplayName}).`:"Scope: whole workspace."].join(`
|
|
2
2
|
`)}}async function G(e,t){let o=u.join(t,M);return await v.ensureDir(u.dirname(o)),await v.writeJSON(o,a(e),{spaces:2}),o}export{$ as a,M as b,L as c,G as d};
|