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.
Files changed (68) hide show
  1. package/README.md +53 -9
  2. package/contracts/agent-customization-pack.v1.json +29 -29
  3. package/contracts/create-planner-capabilities.v1.json +2 -2
  4. package/contracts/extension-cli-compatibility.v1.json +2 -2
  5. package/contracts/runtime-command-surface.v1.json +2 -2
  6. package/contracts/workspace-registry.v1.json +1 -1
  7. package/contracts/workspace-run-last.v1.json +1 -1
  8. package/dist/analyze-XSPWKPA4.js +1 -0
  9. package/dist/autopilot-release-5J55NPXF.js +1 -0
  10. package/dist/chunk-2LBPX5K3.js +2 -0
  11. package/dist/chunk-4EIQRQSA.js +1 -0
  12. package/dist/{chunk-UZW5QFRW.js → chunk-4KUIFXHM.js} +3 -3
  13. package/dist/{chunk-3VI4Y7LZ.js → chunk-6WDDATKQ.js} +1 -1
  14. package/dist/chunk-7M2VBCAX.js +2 -0
  15. package/dist/chunk-7V7C6GXV.js +4 -0
  16. package/dist/{chunk-HCJV2ITA.js → chunk-CXWWNQDF.js} +1 -1
  17. package/dist/chunk-DMITBXR2.js +1 -0
  18. package/dist/chunk-FLFZC7ZV.js +4 -0
  19. package/dist/{chunk-GDWLW7GF.js → chunk-JN6R5UP4.js} +2 -2
  20. package/dist/chunk-KEMWZUGO.js +5 -0
  21. package/dist/{chunk-TXUBE6KV.js → chunk-KQRXY2GJ.js} +1 -1
  22. package/dist/chunk-KUOCSDIY.js +1 -0
  23. package/dist/{chunk-THSTNVE3.js → chunk-MOAQ3WU6.js} +1 -1
  24. package/dist/{chunk-SO2SSVWN.js → chunk-MQGVCTUL.js} +1 -1
  25. package/dist/chunk-NN3IV4U6.js +916 -0
  26. package/dist/chunk-QKVDG6FD.js +32 -0
  27. package/dist/chunk-RQIHAPF3.js +13 -0
  28. package/dist/{chunk-FI4VMG2I.js → chunk-S4U2FRJV.js} +1 -1
  29. package/dist/{chunk-T5GS4BUP.js → chunk-TQULVWUA.js} +1 -1
  30. package/dist/{chunk-U5IRABWC.js → chunk-WKCBS5DC.js} +2 -2
  31. package/dist/{create-P3USIH52.js → create-TPFUONHK.js} +1 -1
  32. package/dist/{demo-kit-N5U3NGAE.js → demo-kit-4NCHGEA6.js} +1 -1
  33. package/dist/{doctor-KYNACWFC.js → doctor-O2B3XNAB.js} +1 -1
  34. package/dist/{dotnet-webapi-clean-K33C77EI.js → dotnet-webapi-clean-LV3MADHG.js} +1 -1
  35. package/dist/{gofiber-standard-BQ4HCXL2.js → gofiber-standard-25DZS5UY.js} +1 -1
  36. package/dist/{gogin-standard-PUBCYW3A.js → gogin-standard-FMVHPLO5.js} +1 -1
  37. package/dist/index.js +161 -159
  38. package/dist/{pipeline-SU3FJUKI.js → pipeline-PX6ZUINW.js} +1 -1
  39. package/dist/{springboot-standard-XFVQI37R.js → springboot-standard-LMZF7OJS.js} +1 -1
  40. package/dist/{workspace-5DKOA7TN.js → workspace-MPKEUHFP.js} +1 -1
  41. package/dist/{workspace-agent-sync-HZ4UBSZ2.js → workspace-agent-sync-XD32GG5V.js} +1 -1
  42. package/dist/{workspace-context-R3XWWLFP.js → workspace-context-QFES7YBC.js} +1 -1
  43. package/dist/workspace-explain-Q7TJCHD5.js +1 -0
  44. package/dist/{workspace-foundation-H6IPS4MW.js → workspace-foundation-2OVUZXPT.js} +1 -1
  45. package/dist/{workspace-intelligence-5BBKUJAG.js → workspace-intelligence-FJP5ONDB.js} +1 -1
  46. package/dist/{workspace-marker-HAC7BMEG.js → workspace-marker-5GAJSOFP.js} +1 -1
  47. package/dist/{workspace-mcp-serve-TQTJ4HWI.js → workspace-mcp-serve-DFJIUTL5.js} +1 -1
  48. package/dist/{workspace-model-YAC5BKLL.js → workspace-model-IDRCH3VI.js} +1 -1
  49. package/dist/workspace-python-engine-state-AEEZ7QYB.js +2 -0
  50. package/dist/workspace-run-NULA72JV.js +1 -0
  51. package/dist/{workspace-verify-5RZSDKGR.js → workspace-verify-K4RSQIXT.js} +1 -1
  52. package/dist/{workspace-watch-P2PGSYDD.js → workspace-watch-PFJDHPXI.js} +1 -1
  53. package/docs/commands-reference.md +30 -3
  54. package/package.json +2 -2
  55. package/dist/analyze-JYHEGUSH.js +0 -1
  56. package/dist/autopilot-release-ZADU63OD.js +0 -1
  57. package/dist/chunk-7BEZH5LE.js +0 -2
  58. package/dist/chunk-DAPZJHMN.js +0 -4
  59. package/dist/chunk-E5ZVQL3C.js +0 -13
  60. package/dist/chunk-LRF6PQOZ.js +0 -1
  61. package/dist/chunk-P5NZE2RV.js +0 -883
  62. package/dist/chunk-Q2KZIBV4.js +0 -5
  63. package/dist/chunk-Q4HEXEDW.js +0 -4
  64. package/dist/chunk-T7B3GF3Q.js +0 -1
  65. package/dist/chunk-U7TS7W2V.js +0 -32
  66. package/dist/chunk-YBS2HGO3.js +0 -2
  67. package/dist/workspace-explain-5RDFGHUN.js +0 -1
  68. package/dist/workspace-run-P5UOJSLQ.js +0 -1
package/README.md CHANGED
@@ -7,6 +7,23 @@
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
8
8
  [![Built by RapidKit](https://img.shields.io/badge/Built%20by-RapidKit-0f172a?logo=github)](https://www.getrapidkit.com)
9
9
 
10
+ > **Migration notice: RapidKit npm is moving to Workspai**
11
+ >
12
+ > The `rapidkit` npm package is now in compatibility mode and is planned for
13
+ > deprecation in a future release. New installs and new workspaces should use
14
+ > the Workspai CLI instead of the legacy `rapidkit` package:
15
+ >
16
+ > ```bash
17
+ > npm install -g workspai
18
+ > npx workspai --help
19
+ > ```
20
+ >
21
+ > New npm package: [workspai](https://www.npmjs.com/package/workspai)
22
+ > New repository: [rapidkitlabs/workspai](https://github.com/rapidkitlabs/workspai)
23
+ >
24
+ > The `rapidkit` package remains available during the migration window so
25
+ > existing users and scripts can move safely.
26
+
10
27
  Not another AI coding assistant.
11
28
  Not another agent framework.
12
29
  Not another context engine.
@@ -23,6 +40,14 @@ contracts, and release gates.
23
40
 
24
41
  ### Install
25
42
 
43
+ Recommended for new projects:
44
+
45
+ ```bash
46
+ npm install -g workspai
47
+ ```
48
+
49
+ Legacy compatibility package:
50
+
26
51
  ```bash
27
52
  npm install -g rapidkit
28
53
  ```
@@ -32,6 +57,7 @@ npm install -g rapidkit
32
57
  Browse all commands without a global install (first run fetches from npm):
33
58
 
34
59
  ```bash
60
+ npx workspai --help
35
61
  npx rapidkit --help
36
62
  ```
37
63
 
@@ -467,6 +493,14 @@ CI template: [docs/examples/ci-agent-grounding.yml](docs/examples/ci-agent-groun
467
493
 
468
494
  ## Install
469
495
 
496
+ Recommended for new installs:
497
+
498
+ ```bash
499
+ npm install -g workspai
500
+ ```
501
+
502
+ Legacy compatibility package:
503
+
470
504
  ```bash
471
505
  npm install -g rapidkit
472
506
  ```
@@ -544,16 +578,23 @@ Full syntax: [docs/commands-reference.md](docs/commands-reference.md). CI workfl
544
578
 
545
579
  RapidKit and Workspai form a single workspace intelligence platform.
546
580
 
547
- RapidKit provides the workspace intelligence engine: model, context, impact, verification, evidence, contracts, and governance.
581
+ Workspai is the new npm CLI and monorepo for workspace intelligence: model,
582
+ context, impact, verification, evidence, contracts, governance, and the short
583
+ alias package.
584
+
585
+ The legacy `rapidkit` npm package remains available as a compatibility package
586
+ during the migration window, but new installs should use `workspai`.
548
587
 
549
- Workspai Workspace + Intelligence — provides the VS Code surface: dashboard, sidebar, Incident Studio, AI workflows, and developer-facing workspace operations.
588
+ The Workspai VS Code extension provides the dashboard, sidebar, Incident Studio,
589
+ AI workflows, and developer-facing workspace operations.
550
590
 
551
- | Component | Repository | Role |
552
- | --------- | ---------------------------------------------------------------------- | ------------------------------------------- |
553
- | CLI | [rapidkit-npm](https://github.com/rapidkitlabs/rapidkit-npm) | Commands, governance, adoption, CI evidence |
554
- | VS Code | [rapidkit-vscode](https://github.com/rapidkitlabs/rapidkit-vscode) | Workspai dashboard, sidebar, AI studio |
555
- | Core | [rapidkit-core](https://github.com/rapidkitlabs/rapidkit-core) | Python engine, modules, doctor |
556
- | Examples | [rapidkit-examples](https://github.com/rapidkitlabs/rapidkit-examples) | Starter workspaces |
591
+ | Component | Repository | Role |
592
+ | ---------- | ---------------------------------------------------------------------- | ------------------------------------------- |
593
+ | npm CLI | [workspai](https://github.com/rapidkitlabs/workspai) | Commands, governance, adoption, CI evidence |
594
+ | Legacy npm | [rapidkit-npm](https://github.com/rapidkitlabs/rapidkit-npm) | Compatibility package during migration |
595
+ | VS Code | [rapidkit-vscode](https://github.com/rapidkitlabs/rapidkit-vscode) | Workspai dashboard, sidebar, AI studio |
596
+ | Core | [rapidkit-core](https://github.com/rapidkitlabs/rapidkit-core) | Python engine, modules, doctor |
597
+ | Examples | [rapidkit-examples](https://github.com/rapidkitlabs/rapidkit-examples) | Starter workspaces |
557
598
 
558
599
  ## VS Code extension
559
600
 
@@ -570,7 +611,10 @@ Search **Workspai** in the marketplace or install via:
570
611
  | Enterprise evidence loop | Partial | Full dashboard |
571
612
  | Module catalog (FastAPI/NestJS) | Limited | Browser UI |
572
613
 
573
- The extension invokes this npm CLI. For the latest `adopt` and frontend generator features, install matching CLI version: `npm install -g rapidkit@latest` or `npm link` from this repo ([Development](#development)).
614
+ The extension invokes the npm CLI. For the latest `adopt` and frontend generator
615
+ features, install the new Workspai CLI: `npm install -g workspai`. Maintainers
616
+ working on this legacy package can still use `npm link` from this repo
617
+ ([Development](#development)).
574
618
 
575
619
  ## Documentation
576
620
 
@@ -4,23 +4,23 @@
4
4
  "minimal": {
5
5
  "meaning": "Generate the portable grounding index, AGENTS.md, and provider-specific lightweight instructions.",
6
6
  "requiredOutputs": [
7
- ".rapidkit/reports/INDEX.json",
8
- ".rapidkit/reports/agent-customization-pack.json",
7
+ ".workspai/reports/INDEX.json",
8
+ ".workspai/reports/agent-customization-pack.json",
9
9
  "AGENTS.md"
10
10
  ]
11
11
  },
12
12
  "enterprise": {
13
13
  "meaning": "Generate the full VS Code-native pack: instructions, prompts, skills, custom agents, and validation metadata.",
14
14
  "requiredOutputs": [
15
- ".rapidkit/reports/INDEX.json",
16
- ".rapidkit/reports/agent-customization-pack.json",
15
+ ".workspai/reports/INDEX.json",
16
+ ".workspai/reports/agent-customization-pack.json",
17
17
  "AGENTS.md",
18
- ".github/instructions/rapidkit-workspace.instructions.md",
19
- ".github/prompts/rapidkit-diagnose.prompt.md",
20
- ".github/skills/rapidkit-workspace-intelligence/SKILL.md",
18
+ ".github/instructions/workspai-workspace.instructions.md",
19
+ ".github/prompts/workspai-diagnose.prompt.md",
20
+ ".github/skills/workspai-workspace-intelligence/SKILL.md",
21
21
  ".github/agents/workspai-advisor.agent.md",
22
- ".rapidkit/reports/rapidkit-mcp-design.json",
23
- ".rapidkit/reports/workspace-skills-index.json"
22
+ ".workspai/reports/workspai-mcp-design.json",
23
+ ".workspai/reports/workspace-skills-index.json"
24
24
  ]
25
25
  }
26
26
  },
@@ -96,92 +96,92 @@
96
96
  ],
97
97
  "requiredReports": [
98
98
  {
99
- "path": ".rapidkit/reports/workspace-context-agent.json",
99
+ "path": ".workspai/reports/workspace-context-agent.json",
100
100
  "label": "Agent context pack",
101
101
  "required": true
102
102
  },
103
103
  {
104
- "path": ".rapidkit/reports/workspace-skills-index.json",
104
+ "path": ".workspai/reports/workspace-skills-index.json",
105
105
  "label": "Operational skills index",
106
106
  "required": true
107
107
  },
108
108
  {
109
- "path": ".rapidkit/reports/workspace-model.json",
109
+ "path": ".workspai/reports/workspace-model.json",
110
110
  "label": "Workspace model graph",
111
111
  "required": false
112
112
  },
113
113
  {
114
- "path": ".rapidkit/reports/doctor-last-run.json",
114
+ "path": ".workspai/reports/doctor-last-run.json",
115
115
  "label": "Workspace doctor",
116
116
  "required": false
117
117
  },
118
118
  {
119
- "path": ".rapidkit/reports/doctor-project-last-run.json",
119
+ "path": ".workspai/reports/doctor-project-last-run.json",
120
120
  "label": "Project doctor",
121
121
  "required": false
122
122
  },
123
123
  {
124
- "path": ".rapidkit/reports/doctor-remediation-plan-last-run.json",
124
+ "path": ".workspai/reports/doctor-remediation-plan-last-run.json",
125
125
  "label": "Doctor remediation plan",
126
126
  "required": false
127
127
  },
128
128
  {
129
- "path": ".rapidkit/reports/artifact-remediation-plan-last-run.json",
129
+ "path": ".workspai/reports/artifact-remediation-plan-last-run.json",
130
130
  "label": "Artifact remediation plan",
131
131
  "required": false
132
132
  },
133
133
  {
134
- "path": ".rapidkit/reports/doctor-fix-result-last-run.json",
134
+ "path": ".workspai/reports/doctor-fix-result-last-run.json",
135
135
  "label": "Doctor fix result",
136
136
  "required": false
137
137
  },
138
138
  {
139
- "path": ".rapidkit/reports/analyze-last-run.json",
139
+ "path": ".workspai/reports/analyze-last-run.json",
140
140
  "label": "Workspace analyze",
141
141
  "required": false
142
142
  },
143
143
  {
144
- "path": ".rapidkit/reports/pipeline-last-run.json",
144
+ "path": ".workspai/reports/pipeline-last-run.json",
145
145
  "label": "Governance pipeline",
146
146
  "required": false
147
147
  },
148
148
  {
149
- "path": ".rapidkit/reports/release-readiness-last-run.json",
149
+ "path": ".workspai/reports/release-readiness-last-run.json",
150
150
  "label": "Release readiness",
151
151
  "required": false
152
152
  },
153
153
  {
154
- "path": ".rapidkit/reports/workspace-impact-last-run.json",
154
+ "path": ".workspai/reports/workspace-impact-last-run.json",
155
155
  "label": "Workspace impact",
156
156
  "required": false
157
157
  },
158
158
  {
159
- "path": ".rapidkit/reports/workspace-verify-last-run.json",
159
+ "path": ".workspai/reports/workspace-verify-last-run.json",
160
160
  "label": "Workspace verify",
161
161
  "required": false
162
162
  },
163
163
  {
164
- "path": ".rapidkit/reports/workspace-model-snapshot.json",
164
+ "path": ".workspai/reports/workspace-model-snapshot.json",
165
165
  "label": "Workspace model snapshot",
166
166
  "required": false
167
167
  },
168
168
  {
169
- "path": ".rapidkit/reports/workspace-model-diff-last-run.json",
169
+ "path": ".workspai/reports/workspace-model-diff-last-run.json",
170
170
  "label": "Workspace model diff",
171
171
  "required": false
172
172
  },
173
173
  {
174
- "path": ".rapidkit/reports/workspace-explain-last-run.json",
174
+ "path": ".workspai/reports/workspace-explain-last-run.json",
175
175
  "label": "Workspace explain",
176
176
  "required": false
177
177
  },
178
178
  {
179
- "path": ".rapidkit/reports/workspace-contract-verify-last-run.json",
179
+ "path": ".workspai/reports/workspace-contract-verify-last-run.json",
180
180
  "label": "Workspace contract verify",
181
181
  "required": false
182
182
  },
183
183
  {
184
- "path": ".rapidkit/reports/workspace-intelligence-history.json",
184
+ "path": ".workspai/reports/workspace-intelligence-history.json",
185
185
  "label": "Workspace intelligence history",
186
186
  "required": false
187
187
  }
@@ -212,8 +212,8 @@
212
212
  ],
213
213
  "pathLayers": {
214
214
  "l1CanonicalRoots": [
215
- ".rapidkit/reports/",
216
- ".rapidkit/skills/"
215
+ ".workspai/reports/",
216
+ ".workspai/skills/"
217
217
  ],
218
218
  "l2PrefixedMirrorRoots": [
219
219
  ".github/",
@@ -3,11 +3,11 @@
3
3
  "lanes": {
4
4
  "native-create": {
5
5
  "status": "available",
6
- "meaning": "RapidKit owns the scaffold contract, marker, registry, doctor, bootstrap, and workspace model path."
6
+ "meaning": "Workspai owns the scaffold contract, marker, registry, doctor, bootstrap, and workspace model path."
7
7
  },
8
8
  "external-create-adopt": {
9
9
  "status": "planned",
10
- "meaning": "A stable ecosystem generator exists, but RapidKit does not yet own the post-create contract."
10
+ "meaning": "A stable ecosystem generator exists, but Workspai does not yet own the post-create contract."
11
11
  },
12
12
  "adopt-only": {
13
13
  "status": "available",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "rapidkit-extension-cli-compatibility.v1",
3
- "cli": "rapidkit-npm",
4
- "minimumVerifiedCliVersion": "0.41.5",
3
+ "cli": "workspai",
4
+ "minimumVerifiedCliVersion": "0.43.1",
5
5
  "publishedContractSchemas": {
6
6
  "runtimeCommandSurface": "rapidkit-runtime-command-surface-v1",
7
7
  "cliLogEvent": "cli-log-event-v1",
@@ -126,11 +126,11 @@
126
126
  "lanes": {
127
127
  "native-create": {
128
128
  "status": "available",
129
- "meaning": "RapidKit owns the scaffold contract, marker, registry, doctor, bootstrap, and workspace model path."
129
+ "meaning": "Workspai owns the scaffold contract, marker, registry, doctor, bootstrap, and workspace model path."
130
130
  },
131
131
  "external-create-adopt": {
132
132
  "status": "planned",
133
- "meaning": "A stable ecosystem generator exists, but RapidKit does not yet own the post-create contract."
133
+ "meaning": "A stable ecosystem generator exists, but Workspai does not yet own the post-create contract."
134
134
  },
135
135
  "adopt-only": {
136
136
  "status": "available",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://getrapidkit.com/schemas/workspace-registry.v1.json",
4
- "title": "RapidKit Workspace Registry Summary",
4
+ "title": "Workspai Workspace Registry Summary",
5
5
  "type": "object",
6
6
  "required": [
7
7
  "schemaVersion",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://getrapidkit.com/schemas/workspace-run-last.v1.json",
4
- "title": "RapidKit Workspace Run Evidence",
4
+ "title": "Workspai Workspace Run Evidence",
5
5
  "type": "object",
6
6
  "required": [
7
7
  "schemaVersion",
@@ -0,0 +1 @@
1
+ export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-MQGVCTUL.js';
@@ -0,0 +1 @@
1
+ export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-CXWWNQDF.js';
@@ -0,0 +1,2 @@
1
+ import n from'fs-extra';import o from'path';async function i(a){let t=o.join(a,".rapidkit-workspace");try{if(await n.pathExists(t))return await n.readJson(t)}catch{return null}return null}async function s(a,t){let e=o.join(a,".rapidkit-workspace"),r=await i(a);r?.metadata&&(t.metadata={...r.metadata,...t.metadata}),await n.outputFile(e,JSON.stringify(t,null,2)+`
2
+ `,"utf-8");}async function m(a,t){let e=await i(a);return e?(e.metadata={...e.metadata,...t,vscode:t.vscode?{...e.metadata?.vscode,...t.vscode}:e.metadata?.vscode,npm:t.npm?{...e.metadata?.npm,...t.npm}:e.metadata?.npm,python:t.python?{...e.metadata?.python,...t.python}:e.metadata?.python},await s(a,e),true):false}function u(a,t,e,r){return {signature:"RAPIDKIT_WORKSPACE",createdBy:"rapidkit-npm",version:t,createdAt:new Date().toISOString(),name:a,metadata:{npm:{packageVersion:t,installMethod:e,lastUsedAt:new Date().toISOString()},...r?{python:r}:{}}}}function g(a){if(!a||typeof a!="object")return false;let t=a;return t.signature==="RAPIDKIT_WORKSPACE"&&typeof t.createdBy=="string"&&typeof t.version=="string"&&typeof t.createdAt=="string"&&typeof t.name=="string"}export{i as a,s as b,m as c,u as d,g as e};
@@ -0,0 +1 @@
1
+ import {b as b$1}from'./chunk-CDCYRBAY.js';import {j}from'./chunk-RQIHAPF3.js';import {c}from'./chunk-DMITBXR2.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=c().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};
@@ -1,5 +1,5 @@
1
- import a from'fs';import s from'path';var m={nextjs:{key:"nextjs",runtime:"node",displayName:"Next.js",supportTier:"extended",importStack:"nextjs",aliases:["next","nextjs","next.js"],dependencyHints:["next"],scriptHints:["next dev","next build","next start"],fileHints:["next.config.js","next.config.mjs","next.config.ts"]},remix:{key:"remix",runtime:"node",displayName:"Remix",supportTier:"extended",importStack:"remix",aliases:["remix"],dependencyHints:["@remix-run/react","@remix-run/node","@remix-run/dev"],scriptHints:["remix dev","remix vite:dev"],fileHints:["remix.config.js","remix.config.mjs"]},nuxt:{key:"nuxt",runtime:"node",displayName:"Nuxt",supportTier:"extended",importStack:"nuxt",aliases:["nuxt","nuxtjs","nuxt.js"],dependencyHints:["nuxt","nuxt3"],scriptHints:["nuxt dev","nuxt build","nuxi dev","nuxi build"],fileHints:["nuxt.config.js","nuxt.config.ts","nuxt.config.mjs"]},react:{key:"react",runtime:"node",displayName:"React",supportTier:"extended",importStack:"react",aliases:["react"],dependencyHints:["react","react-dom"],scriptHints:["react-scripts start","react-scripts build"],fileHints:[]},vite:{key:"vite",runtime:"node",displayName:"Vite",supportTier:"extended",importStack:"vite",aliases:["vite"],dependencyHints:["vite"],scriptHints:["vite","vite dev","vite build"],fileHints:["vite.config.js","vite.config.ts","vite.config.mjs"]},vue:{key:"vue",runtime:"node",displayName:"Vue",supportTier:"extended",importStack:"vue",aliases:["vue","vuejs","vue.js"],dependencyHints:["vue","@vue/cli-service"],scriptHints:["vue-cli-service serve","vue-cli-service build"],fileHints:["vue.config.js"]},sveltekit:{key:"sveltekit",runtime:"node",displayName:"SvelteKit",supportTier:"extended",importStack:"sveltekit",aliases:["sveltekit","svelte-kit"],dependencyHints:["@sveltejs/kit"],scriptHints:["svelte-kit dev","svelte-kit build"],fileHints:["svelte.config.js"]},svelte:{key:"svelte",runtime:"node",displayName:"Svelte",supportTier:"extended",importStack:"svelte",aliases:["svelte"],dependencyHints:["svelte"],scriptHints:["svelte"],fileHints:[]},angular:{key:"angular",runtime:"node",displayName:"Angular",supportTier:"extended",importStack:"angular",aliases:["angular","@angular/core"],dependencyHints:["@angular/core","@angular/cli"],scriptHints:["ng serve","ng build"],fileHints:["angular.json"]},astro:{key:"astro",runtime:"node",displayName:"Astro",supportTier:"extended",importStack:"astro",aliases:["astro"],dependencyHints:["astro"],scriptHints:["astro dev","astro build"],fileHints:["astro.config.js","astro.config.ts","astro.config.mjs"]},solid:{key:"solid",runtime:"node",displayName:"Solid",supportTier:"extended",importStack:"solid",aliases:["solid","solidjs","solid-js"],dependencyHints:["solid-js"],scriptHints:[],fileHints:[]},unknown:{key:"unknown",runtime:"unknown",displayName:"Unknown frontend",supportTier:"observed",importStack:"unknown",aliases:["unknown"],dependencyHints:[],scriptHints:[],fileHints:[]}},B={nextjs:{dev:["dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},remix:{dev:["dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},nuxt:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},react:{dev:["dev","start"],start:["serve"],build:["build"],test:["test"],lint:["lint"],format:["format"]},vite:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},vue:{dev:["dev","serve"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},sveltekit:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},svelte:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},angular:{dev:["start","serve"],start:["serve"],build:["build"],test:["test"],lint:["lint"],format:["format"]},astro:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},solid:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]}};function Y(e,n){let t=typeof e=="string"?S(e):e;return t==="unknown"?[]:B[t]?.[n]??[]}function R(e){try{return a.existsSync(e)?JSON.parse(a.readFileSync(e,"utf8")):null}catch{return null}}function H(e){let n=R(s.join(e,"package.json"));if(!n)return {dependencies:{},scriptText:""};let t={...n.dependencies??{},...n.devDependencies??{},...n.peerDependencies??{}},i=n.scripts??{},o=Object.values(i).filter(u=>typeof u=="string").join(" ").toLowerCase();return {dependencies:t,scriptText:o}}function C(e,n){return n.some(t=>a.existsSync(s.join(e,t)))}function w(e){return e.vite?e.react||e["react-dom"]||e["@vitejs/plugin-react"]?"react":e.vue||e["@vitejs/plugin-vue"]?"vue":e.svelte||e["@sveltejs/vite-plugin-svelte"]?"svelte":e["solid-js"]||e["vite-plugin-solid"]?"solid":null:null}function l(e,n,t){let i=m[e]??m.unknown;return {key:i.key,runtime:i.runtime,displayName:i.displayName,supportTier:i.supportTier,importStack:i.importStack,confidence:n,source:t}}function M(e){return m[e]??m.unknown}function S(e){let n=(e??"").trim().toLowerCase().replace(/[_\s]+/g,"-");if(!n)return "unknown";for(let t of Object.values(m))if(t.aliases.includes(n))return t.key;return "unknown"}function b(e,n){let t=S(typeof n?.framework=="string"?n.framework:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0);if(t!=="unknown")return l(t,"high","framework");let{dependencies:i,scriptText:o}=H(e);for(let u of ["nextjs","remix","nuxt","sveltekit","angular","astro","vue","solid","vite","react","svelte"]){let f=m[u];if(f.dependencyHints.some(c=>i[c])){if(u==="vite"){let c=w(i);if(c)return l(c,"high","manifest")}return l(u,"high","manifest")}if(f.fileHints.length>0&&C(e,f.fileHints)){if(u==="vite"){let c=w(i);if(c)return l(c,"high","manifest")}return l(u,"high","manifest")}if(f.scriptHints.some(c=>o.includes(c)))return l(u,"medium","manifest")}return l("unknown","low","unknown")}var k={fastapi:{key:"fastapi",runtime:"python",displayName:"FastAPI",supportTier:"first-class",importStack:"fastapi",aliases:["fastapi"],kitPrefixes:["fastapi"]},django:{key:"django",runtime:"python",displayName:"Django",supportTier:"extended",importStack:"django",aliases:["django"]},flask:{key:"flask",runtime:"python",displayName:"Flask",supportTier:"extended",importStack:"flask",aliases:["flask"]},python:{key:"python",runtime:"python",displayName:"Python",supportTier:"observed",importStack:"unknown",aliases:["python"]},nestjs:{key:"nestjs",runtime:"node",displayName:"NestJS",supportTier:"first-class",importStack:"nestjs",aliases:["nestjs","nest"],kitPrefixes:["nestjs"]},nextjs:{key:"nextjs",runtime:"node",displayName:"Next.js",supportTier:"extended",importStack:"nextjs",aliases:["nextjs","next.js","next"]},remix:{key:"remix",runtime:"node",displayName:"Remix",supportTier:"extended",importStack:"remix",aliases:["remix"]},nuxt:{key:"nuxt",runtime:"node",displayName:"Nuxt",supportTier:"extended",importStack:"nuxt",aliases:["nuxt","nuxtjs","nuxt.js"]},react:{key:"react",runtime:"node",displayName:"React",supportTier:"extended",importStack:"react",aliases:["react"]},vite:{key:"vite",runtime:"node",displayName:"Vite",supportTier:"extended",importStack:"vite",aliases:["vite"]},vue:{key:"vue",runtime:"node",displayName:"Vue",supportTier:"extended",importStack:"vue",aliases:["vue","vuejs","vue.js"]},sveltekit:{key:"sveltekit",runtime:"node",displayName:"SvelteKit",supportTier:"extended",importStack:"sveltekit",aliases:["sveltekit","svelte-kit"]},svelte:{key:"svelte",runtime:"node",displayName:"Svelte",supportTier:"extended",importStack:"svelte",aliases:["svelte"]},angular:{key:"angular",runtime:"node",displayName:"Angular",supportTier:"extended",importStack:"angular",aliases:["angular","@angular/core"]},astro:{key:"astro",runtime:"node",displayName:"Astro",supportTier:"extended",importStack:"astro",aliases:["astro"]},solid:{key:"solid",runtime:"node",displayName:"Solid",supportTier:"extended",importStack:"solid",aliases:["solid","solidjs","solid-js"]},express:{key:"express",runtime:"node",displayName:"Express",supportTier:"extended",importStack:"express",aliases:["express"]},fastify:{key:"fastify",runtime:"node",displayName:"Fastify",supportTier:"extended",importStack:"unknown",aliases:["fastify"]},koa:{key:"koa",runtime:"node",displayName:"Koa",supportTier:"extended",importStack:"koa",aliases:["koa"]},node:{key:"node",runtime:"node",displayName:"Node.js",supportTier:"observed",importStack:"unknown",aliases:["node","nodejs","typescript","javascript"]},gofiber:{key:"gofiber",runtime:"go",displayName:"Go/Fiber",supportTier:"extended",importStack:"go",aliases:["gofiber","fiber","go-fiber","go/fiber"],kitPrefixes:["gofiber"]},gogin:{key:"gogin",runtime:"go",displayName:"Go/Gin",supportTier:"extended",importStack:"go",aliases:["gogin","gin","go-gin","go/gin"],kitPrefixes:["gogin"]},echo:{key:"echo",runtime:"go",displayName:"Echo",supportTier:"extended",importStack:"go",aliases:["echo"]},go:{key:"go",runtime:"go",displayName:"Go",supportTier:"observed",importStack:"go",aliases:["go","golang"],kitPrefixes:["go"]},springboot:{key:"springboot",runtime:"java",displayName:"Spring Boot",supportTier:"extended",importStack:"springboot",aliases:["springboot","spring","spring-boot"],kitPrefixes:["springboot"]},java:{key:"java",runtime:"java",displayName:"Java",supportTier:"observed",importStack:"unknown",aliases:["java"]},laravel:{key:"laravel",runtime:"php",displayName:"Laravel",supportTier:"extended",importStack:"unknown",aliases:["laravel"]},symfony:{key:"symfony",runtime:"php",displayName:"Symfony",supportTier:"extended",importStack:"unknown",aliases:["symfony"]},php:{key:"php",runtime:"php",displayName:"PHP",supportTier:"observed",importStack:"unknown",aliases:["php"]},rails:{key:"rails",runtime:"ruby",displayName:"Ruby on Rails",supportTier:"extended",importStack:"rails",aliases:["rails","ruby-on-rails","ruby on rails"]},sinatra:{key:"sinatra",runtime:"ruby",displayName:"Sinatra",supportTier:"extended",importStack:"unknown",aliases:["sinatra"]},ruby:{key:"ruby",runtime:"ruby",displayName:"Ruby",supportTier:"observed",importStack:"unknown",aliases:["ruby"]},dotnet:{key:"dotnet",runtime:"dotnet",displayName:"ASP.NET Core",supportTier:"extended",importStack:"dotnet",aliases:["dotnet","asp.net","aspnet","asp.net core","csharp","c#"],kitPrefixes:["dotnet","aspnet","aspnetcore"]},actix:{key:"actix",runtime:"rust",displayName:"Actix-web",supportTier:"extended",importStack:"unknown",aliases:["actix","actix-web"]},axum:{key:"axum",runtime:"rust",displayName:"Axum",supportTier:"extended",importStack:"unknown",aliases:["axum"]},rocket:{key:"rocket",runtime:"rust",displayName:"Rocket",supportTier:"extended",importStack:"unknown",aliases:["rocket"]},rust:{key:"rust",runtime:"rust",displayName:"Rust",supportTier:"observed",importStack:"unknown",aliases:["rust"]},phoenix:{key:"phoenix",runtime:"elixir",displayName:"Phoenix",supportTier:"extended",importStack:"unknown",aliases:["phoenix"]},elixir:{key:"elixir",runtime:"elixir",displayName:"Elixir",supportTier:"observed",importStack:"unknown",aliases:["elixir"]},clojure:{key:"clojure",runtime:"clojure",displayName:"Clojure",supportTier:"extended",importStack:"unknown",aliases:["clojure"]},scala:{key:"scala",runtime:"scala",displayName:"Scala",supportTier:"extended",importStack:"unknown",aliases:["scala"]},kotlin:{key:"kotlin",runtime:"kotlin",displayName:"Kotlin",supportTier:"extended",importStack:"unknown",aliases:["kotlin"]},deno:{key:"deno",runtime:"deno",displayName:"Deno",supportTier:"extended",importStack:"unknown",aliases:["deno"]},bun:{key:"bun",runtime:"bun",displayName:"Bun",supportTier:"extended",importStack:"unknown",aliases:["bun"]},unknown:{key:"unknown",runtime:"unknown",displayName:"Unknown",supportTier:"observed",importStack:"unknown",aliases:["unknown"]}},F=new Map;for(let e of Object.values(k))for(let n of e.aliases)F.set(n,e.key);function r(e,n,t){let i=k[e]??k.unknown;return {key:i.key,runtime:i.runtime,displayName:i.displayName,supportTier:i.supportTier,importStack:i.importStack,confidence:n,source:t}}function N(e){return e.trim().toLowerCase().replace(/[_\s]+/g,"-")}function d(e){try{return a.existsSync(e)?a.readFileSync(e,"utf8").toLowerCase():""}catch{return ""}}function K(e){try{return a.existsSync(e)?JSON.parse(a.readFileSync(e,"utf8")):null}catch{return null}}function x(e,n){if(n<0||!a.existsSync(e))return [];let t=[],i=[];try{i=a.readdirSync(e,{withFileTypes:true});}catch{return []}for(let o of i){let u=s.join(e,o.name);o.isDirectory()?t.push(...x(u,n-1)):t.push(u);}return t}function g(e,n,t=2){return x(e,t).some(i=>i.toLowerCase().endsWith(n.toLowerCase()))}function j(e,n,t=2){return x(e,t).filter(i=>i.toLowerCase().endsWith(n.toLowerCase()))}function D(e){let n=N(e??"");if(!n)return "unknown";for(let t of Object.values(k))if(t.kitPrefixes?.some(i=>n.startsWith(i)))return t.key;return "unknown"}function p(e){return e?F.get(N(e))??"unknown":"unknown"}function ee(e){return p(e)}function ne(e){let n=p(e);return n!=="unknown"?k[n].runtime:"unknown"}function L(e){let n=D(e.kitName);if(n!=="unknown")return r(n,"high","kit");let t=p(e.framework);if(t!=="unknown")return r(t,"high","framework");let i=p(e.runtime);return i!=="unknown"?r(i,"medium","runtime"):r("unknown","low","unknown")}function E(e){let n=K(s.join(e,"package.json"));if(!n)return r("unknown","low","unknown");let t={...n.dependencies??{},...n.devDependencies??{}},i=n.scripts??{},o=Object.values(i).filter(u=>typeof u=="string").join(" ").toLowerCase();return t["@nestjs/core"]||o.includes("nest start")?r("nestjs","high","manifest"):t.express?r("express","high","manifest"):t.fastify?r("fastify","high","manifest"):t.koa?r("koa","high","manifest"):r("node","medium","marker")}function A(e){let n=[d(s.join(e,"pyproject.toml")),d(s.join(e,"requirements.txt")),d(s.join(e,"requirements.in"))].join(`
1
+ import a from'fs';import s from'path';var k={nextjs:{key:"nextjs",runtime:"node",displayName:"Next.js",supportTier:"extended",importStack:"nextjs",aliases:["next","nextjs","next.js"],dependencyHints:["next"],scriptHints:["next dev","next build","next start"],fileHints:["next.config.js","next.config.mjs","next.config.ts"]},remix:{key:"remix",runtime:"node",displayName:"Remix",supportTier:"extended",importStack:"remix",aliases:["remix"],dependencyHints:["@remix-run/react","@remix-run/node","@remix-run/dev"],scriptHints:["remix dev","remix vite:dev"],fileHints:["remix.config.js","remix.config.mjs"]},nuxt:{key:"nuxt",runtime:"node",displayName:"Nuxt",supportTier:"extended",importStack:"nuxt",aliases:["nuxt","nuxtjs","nuxt.js"],dependencyHints:["nuxt","nuxt3"],scriptHints:["nuxt dev","nuxt build","nuxi dev","nuxi build"],fileHints:["nuxt.config.js","nuxt.config.ts","nuxt.config.mjs"]},react:{key:"react",runtime:"node",displayName:"React",supportTier:"extended",importStack:"react",aliases:["react"],dependencyHints:["react","react-dom"],scriptHints:["react-scripts start","react-scripts build"],fileHints:[]},vite:{key:"vite",runtime:"node",displayName:"Vite",supportTier:"extended",importStack:"vite",aliases:["vite"],dependencyHints:["vite"],scriptHints:["vite","vite dev","vite build"],fileHints:["vite.config.js","vite.config.ts","vite.config.mjs"]},vue:{key:"vue",runtime:"node",displayName:"Vue",supportTier:"extended",importStack:"vue",aliases:["vue","vuejs","vue.js"],dependencyHints:["vue","@vue/cli-service"],scriptHints:["vue-cli-service serve","vue-cli-service build"],fileHints:["vue.config.js"]},sveltekit:{key:"sveltekit",runtime:"node",displayName:"SvelteKit",supportTier:"extended",importStack:"sveltekit",aliases:["sveltekit","svelte-kit"],dependencyHints:["@sveltejs/kit"],scriptHints:["svelte-kit dev","svelte-kit build"],fileHints:["svelte.config.js"]},svelte:{key:"svelte",runtime:"node",displayName:"Svelte",supportTier:"extended",importStack:"svelte",aliases:["svelte"],dependencyHints:["svelte"],scriptHints:["svelte"],fileHints:[]},angular:{key:"angular",runtime:"node",displayName:"Angular",supportTier:"extended",importStack:"angular",aliases:["angular","@angular/core"],dependencyHints:["@angular/core","@angular/cli"],scriptHints:["ng serve","ng build"],fileHints:["angular.json"]},astro:{key:"astro",runtime:"node",displayName:"Astro",supportTier:"extended",importStack:"astro",aliases:["astro"],dependencyHints:["astro"],scriptHints:["astro dev","astro build"],fileHints:["astro.config.js","astro.config.ts","astro.config.mjs"]},solid:{key:"solid",runtime:"node",displayName:"Solid",supportTier:"extended",importStack:"solid",aliases:["solid","solidjs","solid-js"],dependencyHints:["solid-js"],scriptHints:[],fileHints:[]},unknown:{key:"unknown",runtime:"unknown",displayName:"Unknown frontend",supportTier:"observed",importStack:"unknown",aliases:["unknown"],dependencyHints:[],scriptHints:[],fileHints:[]}},B={nextjs:{dev:["dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},remix:{dev:["dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},nuxt:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},react:{dev:["dev","start"],start:["serve"],build:["build"],test:["test"],lint:["lint"],format:["format"]},vite:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},vue:{dev:["dev","serve"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},sveltekit:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},svelte:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},angular:{dev:["start","serve"],start:["serve"],build:["build"],test:["test"],lint:["lint"],format:["format"]},astro:{dev:["dev"],start:["start","preview"],build:["build"],test:["test"],lint:["lint"],format:["format"]},solid:{dev:["dev"],start:["preview","start"],build:["build"],test:["test"],lint:["lint"],format:["format"]}};function Y(e,n){let t=typeof e=="string"?S(e):e;return t==="unknown"?[]:B[t]?.[n]??[]}function R(e){try{return a.existsSync(e)?JSON.parse(a.readFileSync(e,"utf8")):null}catch{return null}}function C(e){let n=R(s.join(e,"package.json"));if(!n)return {dependencies:{},scriptText:""};let t={...n.dependencies??{},...n.devDependencies??{},...n.peerDependencies??{}},i=n.scripts??{},o=Object.values(i).filter(u=>typeof u=="string").join(" ").toLowerCase();return {dependencies:t,scriptText:o}}function H(e,n){return n.some(t=>a.existsSync(s.join(e,t)))}function w(e){return e.vite?e.react||e["react-dom"]||e["@vitejs/plugin-react"]?"react":e.vue||e["@vitejs/plugin-vue"]?"vue":e.svelte||e["@sveltejs/vite-plugin-svelte"]?"svelte":e["solid-js"]||e["vite-plugin-solid"]?"solid":null:null}function m(e,n,t){let i=k[e]??k.unknown;return {key:i.key,runtime:i.runtime,displayName:i.displayName,supportTier:i.supportTier,importStack:i.importStack,confidence:n,source:t}}function P(e){return k[e]??k.unknown}function S(e){let n=(e??"").trim().toLowerCase().replace(/[_\s]+/g,"-");if(!n)return "unknown";for(let t of Object.values(k))if(t.aliases.includes(n))return t.key;return "unknown"}function b(e,n){let t=S(typeof n?.framework=="string"?n.framework:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0);if(t!=="unknown")return m(t,"high","framework");let{dependencies:i,scriptText:o}=C(e);for(let u of ["nextjs","remix","nuxt","sveltekit","angular","astro","vue","solid","vite","react","svelte"]){let y=k[u];if(y.dependencyHints.some(l=>i[l])){if(u==="vite"){let l=w(i);if(l)return m(l,"high","manifest")}return m(u,"high","manifest")}if(y.fileHints.length>0&&H(e,y.fileHints)){if(u==="vite"){let l=w(i);if(l)return m(l,"high","manifest")}return m(u,"high","manifest")}if(y.scriptHints.some(l=>o.includes(l)))return m(u,"medium","manifest")}return m("unknown","low","unknown")}var p={fastapi:{key:"fastapi",runtime:"python",displayName:"FastAPI",supportTier:"first-class",importStack:"fastapi",aliases:["fastapi"],kitPrefixes:["fastapi"]},django:{key:"django",runtime:"python",displayName:"Django",supportTier:"extended",importStack:"django",aliases:["django"]},flask:{key:"flask",runtime:"python",displayName:"Flask",supportTier:"extended",importStack:"flask",aliases:["flask"]},python:{key:"python",runtime:"python",displayName:"Python",supportTier:"observed",importStack:"unknown",aliases:["python"]},nestjs:{key:"nestjs",runtime:"node",displayName:"NestJS",supportTier:"first-class",importStack:"nestjs",aliases:["nestjs","nest"],kitPrefixes:["nestjs"]},nextjs:{key:"nextjs",runtime:"node",displayName:"Next.js",supportTier:"extended",importStack:"nextjs",aliases:["nextjs","next.js","next"]},remix:{key:"remix",runtime:"node",displayName:"Remix",supportTier:"extended",importStack:"remix",aliases:["remix"]},nuxt:{key:"nuxt",runtime:"node",displayName:"Nuxt",supportTier:"extended",importStack:"nuxt",aliases:["nuxt","nuxtjs","nuxt.js"]},react:{key:"react",runtime:"node",displayName:"React",supportTier:"extended",importStack:"react",aliases:["react"]},vite:{key:"vite",runtime:"node",displayName:"Vite",supportTier:"extended",importStack:"vite",aliases:["vite"]},vue:{key:"vue",runtime:"node",displayName:"Vue",supportTier:"extended",importStack:"vue",aliases:["vue","vuejs","vue.js"]},sveltekit:{key:"sveltekit",runtime:"node",displayName:"SvelteKit",supportTier:"extended",importStack:"sveltekit",aliases:["sveltekit","svelte-kit"]},svelte:{key:"svelte",runtime:"node",displayName:"Svelte",supportTier:"extended",importStack:"svelte",aliases:["svelte"]},angular:{key:"angular",runtime:"node",displayName:"Angular",supportTier:"extended",importStack:"angular",aliases:["angular","@angular/core"]},astro:{key:"astro",runtime:"node",displayName:"Astro",supportTier:"extended",importStack:"astro",aliases:["astro"]},solid:{key:"solid",runtime:"node",displayName:"Solid",supportTier:"extended",importStack:"solid",aliases:["solid","solidjs","solid-js"]},express:{key:"express",runtime:"node",displayName:"Express",supportTier:"extended",importStack:"express",aliases:["express"]},fastify:{key:"fastify",runtime:"node",displayName:"Fastify",supportTier:"extended",importStack:"unknown",aliases:["fastify"]},koa:{key:"koa",runtime:"node",displayName:"Koa",supportTier:"extended",importStack:"koa",aliases:["koa"]},node:{key:"node",runtime:"node",displayName:"Node.js",supportTier:"observed",importStack:"unknown",aliases:["node","nodejs","typescript","javascript"]},gofiber:{key:"gofiber",runtime:"go",displayName:"Go/Fiber",supportTier:"extended",importStack:"go",aliases:["gofiber","fiber","go-fiber","go/fiber"],kitPrefixes:["gofiber"]},gogin:{key:"gogin",runtime:"go",displayName:"Go/Gin",supportTier:"extended",importStack:"go",aliases:["gogin","gin","go-gin","go/gin"],kitPrefixes:["gogin"]},echo:{key:"echo",runtime:"go",displayName:"Echo",supportTier:"extended",importStack:"go",aliases:["echo"]},go:{key:"go",runtime:"go",displayName:"Go",supportTier:"observed",importStack:"go",aliases:["go","golang"],kitPrefixes:["go"]},springboot:{key:"springboot",runtime:"java",displayName:"Spring Boot",supportTier:"extended",importStack:"springboot",aliases:["springboot","spring","spring-boot"],kitPrefixes:["springboot"]},java:{key:"java",runtime:"java",displayName:"Java",supportTier:"observed",importStack:"unknown",aliases:["java"]},laravel:{key:"laravel",runtime:"php",displayName:"Laravel",supportTier:"extended",importStack:"unknown",aliases:["laravel"]},symfony:{key:"symfony",runtime:"php",displayName:"Symfony",supportTier:"extended",importStack:"unknown",aliases:["symfony"]},php:{key:"php",runtime:"php",displayName:"PHP",supportTier:"observed",importStack:"unknown",aliases:["php"]},rails:{key:"rails",runtime:"ruby",displayName:"Ruby on Rails",supportTier:"extended",importStack:"rails",aliases:["rails","ruby-on-rails","ruby on rails"]},sinatra:{key:"sinatra",runtime:"ruby",displayName:"Sinatra",supportTier:"extended",importStack:"unknown",aliases:["sinatra"]},ruby:{key:"ruby",runtime:"ruby",displayName:"Ruby",supportTier:"observed",importStack:"unknown",aliases:["ruby"]},dotnet:{key:"dotnet",runtime:"dotnet",displayName:"ASP.NET Core",supportTier:"extended",importStack:"dotnet",aliases:["dotnet","asp.net","aspnet","asp.net core","csharp","c#"],kitPrefixes:["dotnet","aspnet","aspnetcore"]},actix:{key:"actix",runtime:"rust",displayName:"Actix-web",supportTier:"extended",importStack:"unknown",aliases:["actix","actix-web"]},axum:{key:"axum",runtime:"rust",displayName:"Axum",supportTier:"extended",importStack:"unknown",aliases:["axum"]},rocket:{key:"rocket",runtime:"rust",displayName:"Rocket",supportTier:"extended",importStack:"unknown",aliases:["rocket"]},rust:{key:"rust",runtime:"rust",displayName:"Rust",supportTier:"observed",importStack:"unknown",aliases:["rust"]},phoenix:{key:"phoenix",runtime:"elixir",displayName:"Phoenix",supportTier:"extended",importStack:"unknown",aliases:["phoenix"]},elixir:{key:"elixir",runtime:"elixir",displayName:"Elixir",supportTier:"observed",importStack:"unknown",aliases:["elixir"]},clojure:{key:"clojure",runtime:"clojure",displayName:"Clojure",supportTier:"extended",importStack:"unknown",aliases:["clojure"]},scala:{key:"scala",runtime:"scala",displayName:"Scala",supportTier:"extended",importStack:"unknown",aliases:["scala"]},kotlin:{key:"kotlin",runtime:"kotlin",displayName:"Kotlin",supportTier:"extended",importStack:"unknown",aliases:["kotlin"]},deno:{key:"deno",runtime:"deno",displayName:"Deno",supportTier:"extended",importStack:"unknown",aliases:["deno"]},bun:{key:"bun",runtime:"bun",displayName:"Bun",supportTier:"extended",importStack:"unknown",aliases:["bun"]},c:{key:"c",runtime:"c",displayName:"C",supportTier:"observed",importStack:"unknown",aliases:["c","clang","gcc"]},cpp:{key:"cpp",runtime:"cpp",displayName:"C++",supportTier:"observed",importStack:"unknown",aliases:["cpp","c++","cplusplus","cc","clang++","g++"]},unknown:{key:"unknown",runtime:"unknown",displayName:"Unknown",supportTier:"observed",importStack:"unknown",aliases:["unknown"]}},F=new Map;for(let e of Object.values(p))for(let n of e.aliases)F.set(n,e.key);function r(e,n,t){let i=p[e]??p.unknown;return {key:i.key,runtime:i.runtime,displayName:i.displayName,supportTier:i.supportTier,importStack:i.importStack,confidence:n,source:t}}function N(e){return e.trim().toLowerCase().replace(/[_\s]+/g,"-")}function d(e){try{return a.existsSync(e)?a.readFileSync(e,"utf8").toLowerCase():""}catch{return ""}}function K(e){try{return a.existsSync(e)?JSON.parse(a.readFileSync(e,"utf8")):null}catch{return null}}function x(e,n){if(n<0||!a.existsSync(e))return [];let t=[],i=[];try{i=a.readdirSync(e,{withFileTypes:true});}catch{return []}for(let o of i){let u=s.join(e,o.name);o.isDirectory()?t.push(...x(u,n-1)):t.push(u);}return t}function c(e,n,t=2){return x(e,t).some(i=>i.toLowerCase().endsWith(n.toLowerCase()))}function j(e,n,t=2){return x(e,t).filter(i=>i.toLowerCase().endsWith(n.toLowerCase()))}function D(e){let n=N(e??"");if(!n)return "unknown";for(let t of Object.values(p))if(t.kitPrefixes?.some(i=>n.startsWith(i)))return t.key;return "unknown"}function f(e){return e?F.get(N(e))??"unknown":"unknown"}function ee(e){return f(e)}function ne(e){let n=f(e);return n!=="unknown"?p[n].runtime:"unknown"}function L(e){let n=D(e.kitName);if(n!=="unknown")return r(n,"high","kit");let t=f(e.framework);if(t!=="unknown")return r(t,"high","framework");let i=f(e.runtime);return i!=="unknown"?r(i,"medium","runtime"):r("unknown","low","unknown")}function E(e){let n=K(s.join(e,"package.json"));if(!n)return r("unknown","low","unknown");let t={...n.dependencies??{},...n.devDependencies??{}},i=n.scripts??{},o=Object.values(i).filter(u=>typeof u=="string").join(" ").toLowerCase();return t["@nestjs/core"]||o.includes("nest start")?r("nestjs","high","manifest"):t.express?r("express","high","manifest"):t.fastify?r("fastify","high","manifest"):t.koa?r("koa","high","manifest"):r("node","medium","marker")}function A(e){let n=[d(s.join(e,"pyproject.toml")),d(s.join(e,"requirements.txt")),d(s.join(e,"requirements.in"))].join(`
2
2
  `);return n.includes("fastapi")?r("fastapi","high","manifest"):n.includes("django")?r("django","high","manifest"):n.includes("flask")?r("flask","high","manifest"):n.trim()?r("python","medium","marker"):r("unknown","low","unknown")}function _(e){let n=[d(s.join(e,"go.mod")),d(s.join(e,"main.go"))].join(`
3
3
  `);return n.includes("github.com/gofiber/fiber")?r("gofiber","high","manifest"):n.includes("github.com/gin-gonic/gin")?r("gogin","high","manifest"):n.includes("github.com/labstack/echo")?r("echo","high","manifest"):n.trim()?r("go","medium","marker"):r("unknown","low","unknown")}function I(e){let n=[d(s.join(e,"pom.xml")),d(s.join(e,"build.gradle")),d(s.join(e,"build.gradle.kts"))].join(`
4
- `);return n.includes("spring-boot")||n.includes("org.springframework")?r("springboot","high","manifest"):n.trim()?r("java","medium","marker"):r("unknown","low","unknown")}function O(e){let n=d(s.join(e,"composer.json"));return n.includes("laravel/framework")?r("laravel","high","manifest"):n.includes("symfony/")?r("symfony","high","manifest"):n.trim()?r("php","medium","marker"):r("unknown","low","unknown")}function P(e){let n=d(s.join(e,"Gemfile"));return n.includes("gem 'rails'")||n.includes('gem "rails"')?r("rails","high","manifest"):n.includes("gem 'sinatra'")||n.includes('gem "sinatra"')?r("sinatra","high","manifest"):n.trim()?r("ruby","medium","marker"):r("unknown","low","unknown")}function z(e){let t=[...j(e,".csproj",3),...j(e,".sln",2)].map(i=>d(i)).join(`
5
- `);return t.includes("microsoft.net.sdk.web")||t.includes("microsoft.aspnetcore")||t.includes("swashbuckle.aspnetcore")?r("dotnet","high","manifest"):t.trim()?r("dotnet","medium","marker"):r("unknown","low","unknown")}function G(e){let n=d(s.join(e,"Cargo.toml"));return n.includes("actix-web")?r("actix","high","manifest"):n.includes("axum")?r("axum","high","manifest"):n.includes("rocket")?r("rocket","high","manifest"):n.trim()?r("rust","medium","marker"):r("unknown","low","unknown")}function V(e){let n=d(s.join(e,"mix.exs"));return n.includes("phoenix")?r("phoenix","high","manifest"):n.trim()?r("elixir","medium","marker"):r("unknown","low","unknown")}function W(e){let n=[],t=i=>{n.includes(i)||n.push(i);};return a.existsSync(s.join(e,"go.mod"))&&t("go"),a.existsSync(s.join(e,"Cargo.toml"))&&t("rust"),(a.existsSync(s.join(e,"pom.xml"))||a.existsSync(s.join(e,"build.gradle"))||a.existsSync(s.join(e,"build.gradle.kts")))&&t("java"),a.existsSync(s.join(e,"mix.exs"))&&t("elixir"),a.existsSync(s.join(e,"composer.json"))&&t("php"),(g(e,".csproj")||g(e,".sln"))&&t("dotnet"),a.existsSync(s.join(e,"package.json"))&&t("node"),a.existsSync(s.join(e,"Gemfile"))&&t("ruby"),(a.existsSync(s.join(e,"pyproject.toml"))||a.existsSync(s.join(e,"setup.py"))||a.existsSync(s.join(e,"requirements.txt"))||a.existsSync(s.join(e,"requirements.in")))&&t("python"),(a.existsSync(s.join(e,"deps.edn"))||a.existsSync(s.join(e,"project.clj")))&&t("clojure"),a.existsSync(s.join(e,"build.sbt"))&&t("scala"),(a.existsSync(s.join(e,"deno.json"))||a.existsSync(s.join(e,"deno.jsonc")))&&t("deno"),(a.existsSync(s.join(e,"bun.lockb"))||a.existsSync(s.join(e,"bun.lock")))&&t("bun"),(a.existsSync(s.join(e,"settings.gradle.kts"))||g(s.join(e,"src"),".kt",3))&&t("kotlin"),n}function te(e,n){let t=L({framework:typeof n?.framework=="string"?n.framework:void 0,runtime:typeof n?.runtime=="string"?n.runtime:void 0,kitName:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0});if(t.key!=="unknown")return t;let i=W(e);if(i.includes("node")){let o=b(e,n);if(o.key!=="unknown")return o;let u=E(e);if(u.key!=="unknown")return u}if(i.includes("python")){let o=A(e);if(o.key!=="unknown")return o}if(i.includes("go")){let o=_(e);if(o.key!=="unknown")return o}if(i.includes("java")){let o=I(e);if(o.key!=="unknown")return o}if(i.includes("php")){let o=O(e);if(o.key!=="unknown")return o}if(i.includes("ruby")){let o=P(e);if(o.key!=="unknown")return o}if(i.includes("rust")){let o=G(e);if(o.key!=="unknown")return o}if(i.includes("elixir")){let o=V(e);if(o.key!=="unknown")return o}if(i.includes("dotnet")){let o=z(e);if(o.key!=="unknown")return o}return i.includes("clojure")?r("clojure","medium","marker"):i.includes("scala")?r("scala","medium","marker"):i.includes("kotlin")?r("kotlin","medium","marker"):i.includes("deno")?r("deno","high","marker"):i.includes("bun")?r("bun","high","marker"):i.length>0?r(p(i[0]),"medium","runtime"):r("unknown","low","unknown")}export{Y as a,M as b,S as c,b as d,ee as e,ne as f,L as g,W as h,te as i};
4
+ `);return n.includes("spring-boot")||n.includes("org.springframework")?r("springboot","high","manifest"):n.trim()?r("java","medium","marker"):r("unknown","low","unknown")}function O(e){let n=d(s.join(e,"composer.json"));return n.includes("laravel/framework")?r("laravel","high","manifest"):n.includes("symfony/")?r("symfony","high","manifest"):n.trim()?r("php","medium","marker"):r("unknown","low","unknown")}function z(e){let n=d(s.join(e,"Gemfile"));return n.includes("gem 'rails'")||n.includes('gem "rails"')?r("rails","high","manifest"):n.includes("gem 'sinatra'")||n.includes('gem "sinatra"')?r("sinatra","high","manifest"):n.trim()?r("ruby","medium","marker"):r("unknown","low","unknown")}function G(e){let t=[...j(e,".csproj",3),...j(e,".sln",2)].map(i=>d(i)).join(`
5
+ `);return t.includes("microsoft.net.sdk.web")||t.includes("microsoft.aspnetcore")||t.includes("swashbuckle.aspnetcore")?r("dotnet","high","manifest"):t.trim()?r("dotnet","medium","marker"):r("unknown","low","unknown")}function V(e){let n=d(s.join(e,"Cargo.toml"));return n.includes("actix-web")?r("actix","high","manifest"):n.includes("axum")?r("axum","high","manifest"):n.includes("rocket")?r("rocket","high","manifest"):n.trim()?r("rust","medium","marker"):r("unknown","low","unknown")}function W(e){let n=d(s.join(e,"mix.exs"));return n.includes("phoenix")?r("phoenix","high","manifest"):n.trim()?r("elixir","medium","marker"):r("unknown","low","unknown")}function q(e){let n=[],t=i=>{n.includes(i)||n.push(i);};return a.existsSync(s.join(e,"go.mod"))&&t("go"),a.existsSync(s.join(e,"Cargo.toml"))&&t("rust"),(a.existsSync(s.join(e,"pom.xml"))||a.existsSync(s.join(e,"build.gradle"))||a.existsSync(s.join(e,"build.gradle.kts")))&&t("java"),a.existsSync(s.join(e,"mix.exs"))&&t("elixir"),a.existsSync(s.join(e,"composer.json"))&&t("php"),(c(e,".csproj")||c(e,".sln"))&&t("dotnet"),a.existsSync(s.join(e,"package.json"))&&t("node"),a.existsSync(s.join(e,"Gemfile"))&&t("ruby"),(a.existsSync(s.join(e,"pyproject.toml"))||a.existsSync(s.join(e,"setup.py"))||a.existsSync(s.join(e,"requirements.txt"))||a.existsSync(s.join(e,"requirements.in")))&&t("python"),(a.existsSync(s.join(e,"deps.edn"))||a.existsSync(s.join(e,"project.clj")))&&t("clojure"),a.existsSync(s.join(e,"build.sbt"))&&t("scala"),(a.existsSync(s.join(e,"deno.json"))||a.existsSync(s.join(e,"deno.jsonc")))&&t("deno"),(a.existsSync(s.join(e,"bun.lockb"))||a.existsSync(s.join(e,"bun.lock")))&&t("bun"),(a.existsSync(s.join(e,"CMakeLists.txt"))||a.existsSync(s.join(e,"meson.build"))||c(e,".cpp",3)||c(e,".cc",3)||c(e,".cxx",3)||c(e,".hpp",3)||c(e,".hh",3)||c(e,".hxx",3))&&t("cpp"),(c(e,".c",3)||c(e,".h",3))&&t("c"),(a.existsSync(s.join(e,"settings.gradle.kts"))||c(s.join(e,"src"),".kt",3))&&t("kotlin"),n}function te(e,n){let t=L({framework:typeof n?.framework=="string"?n.framework:void 0,runtime:typeof n?.runtime=="string"?n.runtime:void 0,kitName:typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0});if(t.key!=="unknown")return t;let i=q(e);if(i.includes("node")){let o=b(e,n);if(o.key!=="unknown")return o;let u=E(e);if(u.key!=="unknown")return u}if(i.includes("python")){let o=A(e);if(o.key!=="unknown")return o}if(i.includes("go")){let o=_(e);if(o.key!=="unknown")return o}if(i.includes("java")){let o=I(e);if(o.key!=="unknown")return o}if(i.includes("php")){let o=O(e);if(o.key!=="unknown")return o}if(i.includes("ruby")){let o=z(e);if(o.key!=="unknown")return o}if(i.includes("rust")){let o=V(e);if(o.key!=="unknown")return o}if(i.includes("elixir")){let o=W(e);if(o.key!=="unknown")return o}if(i.includes("dotnet")){let o=G(e);if(o.key!=="unknown")return o}return i.includes("clojure")?r("clojure","medium","marker"):i.includes("scala")?r("scala","medium","marker"):i.includes("kotlin")?r("kotlin","medium","marker"):i.includes("deno")?r("deno","high","marker"):i.includes("bun")?r("bun","high","marker"):i.includes("cpp")?r("cpp","medium","marker"):i.includes("c")?r("c","medium","marker"):i.length>0?r(f(i[0]),"medium","runtime"):r("unknown","low","unknown")}export{Y as a,P as b,S as c,b as d,ee as e,ne as f,L as g,q as h,te as i};
@@ -1 +1 @@
1
- import {a,b as b$2}from'./chunk-PYCJWW4B.js';import {b as b$1,c,d}from'./chunk-FI4VMG2I.js';import {m,f,c as c$1,n,e}from'./chunk-THSTNVE3.js';import {c as c$2}from'./chunk-64RTZBHU.js';import {n as n$1,b as b$3}from'./chunk-LRF6PQOZ.js';import {a as a$1}from'./chunk-3PTJID76.js';import u from'path';import y from'fs-extra';var K="rapidkit-blocker-resolution-v1";function J(e){let t=e.blockers.map(r=>r.trim()).filter(Boolean).slice(0,12),s=e.stderrTail?.trim().slice(-400)??"";return b$3({blockers:t,exitCode:e.exitCode??null,stderrTail:s})}function te(e){let t=e.trim().toLowerCase();return t?t.includes("missing evidence")||t.includes(": missing")||t.includes("artifact missing")||t.includes("not found on disk")?"artifact-missing":t.includes("policy.")||t.includes("contract")?"config-fixable":t.includes("impact")||t.includes("untracked")||t.includes("grounding")?"semantic-attention":t.includes("failed")||t.includes("blocked")||t.includes(": fail")?"command-failed-repeat":"config-fixable":"unresolvable-without-human"}function se(e){let t=te(e.reason),s=J({blockers:[e.reason]}),r=t==="artifact-missing"?[{actionKind:"run-once",detail:e.sourceCommand?`Run the source command once: ${e.sourceCommand}`:"Run the mapped workspace intelligence command once to generate the missing artifact.",studioActionId:"run-analyze"}]:t==="semantic-attention"?[{actionKind:"commit-files",detail:"Review workspace-level grounding files (AGENTS.md, agent-sync outputs) and commit or refresh the impact baseline."},{actionKind:"refresh-baseline",detail:"Refresh snapshot + diff + impact before re-running verify."}]:[{actionKind:"edit-file",detail:"Apply the smallest safe file or policy fix for this blocker before re-running verification.",studioActionId:"fix-lens"}];return {schemaVersion:K,blockerId:e.blockerId,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,resolutionClass:t,blockerSignature:s,commandRetryHint:t==="artifact-missing"?"Run the source command once, then verify.":"Do not re-run the same failing command; fix the source issue first, then verify.",fixHints:r,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}}function U(e){return Array.from(new Set(e.blockingReasons.map(s=>s.trim()).filter(Boolean))).slice(0,12).map((s,r)=>se({reason:s,blockerId:`blocker-${r+1}`,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}))}function re(e){let t=e.toLowerCase();return t.includes("stale")||t.includes("missing evidence")||t.includes("no projects")||t.includes("projects.empty")||t.includes("projects discovered")||t.includes("projects.missing")||t.includes("not yet run")||t.includes("doctor-last-run")||t.includes("doctor-project-last-run")||t.includes("doctor-remediation-plan-last-run")||t.includes("doctor-fix-result-last-run")||t.includes("pipeline-last-run")||t.includes("release-readiness")||t.includes("analyze-last-run")||t.includes("analyze reported")||t.includes("analyze verdict")||t.includes("analyze needs attention")||t.includes("toolchain.lock")||t.includes("not pinned")||t.includes("readiness:")||t.includes("env:")||t.includes("workspace-run-last")||t.includes("pre-project")||t.includes("before adding projects")||t.includes("workspace.projects.missing")||t.includes("no backend projects")||t.includes("index.json")||t.includes("workspace-intelligence-history")||t.includes("validation warning")||t.includes("workspace model validation")||t.includes("workspace.marker")||t.includes("no project roots")||t.includes("no infrastructure services")||t.includes("infra/overrides")||t.includes("infra dependencies")||t.includes("contract verify")||t.includes("contract inspect")||t.includes("publish verify evidence")}function ne(e){return e.length===0||e.every(t=>re(t))}function G(e){return e.projectCount>0||e.policyErrorCount>0?{verdict:e.verdict,exitCode:e.exitCode}:e.verdict==="blocked"&&ne(e.blockingReasons)?{verdict:"needs-attention",exitCode:1}:{verdict:e.verdict,exitCode:e.exitCode}}function Be(e,t){let s=t&&t!=="ready"?` (${t.replace(/-/g," ")})`:"";return e===0?`Workspace scaffold ready${s} \u2014 add your first project to continue.`:`Workspace scaffold${s}: ${e} pre-project signal(s) \u2014 add your first project to continue.`}var X="workspace-verify.v1",I=".rapidkit/reports/workspace-verify-last-run.json";function ie(e,t){return u.isAbsolute(t)?t:u.join(e,t)}async function Y(e$1){let t=await y.readJson(e$1);if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Workspace impact input is not a JSON object: ${e$1}`);let s=t;if(s.schemaVersion!==e)throw new Error(`Unsupported workspace impact schema: ${String(s.schemaVersion)}`);return s}function oe(e){let t=new Set,s=[];for(let r of e){let n=`${r.scope}:${r.project??""}:${r.display}`;t.has(n)||(t.add(n),s.push(r));}return s}function ae(e,t){if(!e||e==="workspace")return true;let s=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return t.scope==="workspace"?true:(t.project??"").trim().toLowerCase()===s}function ce(e,t){if(e.id==="workspace.doctor")return u.join(t,".rapidkit","reports","doctor-last-run.json");if(e.id==="workspace.contract.verify")return u.join(t,".rapidkit","reports","workspace-contract-verify-last-run.json");if(e.id==="workspace.readiness")return u.join(t,".rapidkit","reports","release-readiness-last-run.json");if(e.id==="workspace.analyze")return u.join(t,".rapidkit","reports","analyze-last-run.json");if(e.id==="workspace.pipeline")return u.join(t,".rapidkit","reports","pipeline-last-run.json");if(e.id==="workspace.doctor-fix")return u.join(t,".rapidkit","reports","doctor-fix-result-last-run.json");if(e.id.startsWith("project.")&&e.id.includes("."))return u.join(t,".rapidkit","reports","workspace-run-last.json")}function b(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function le(e){let t=b(e.healthScore),s=typeof t?.errors=="number"?t.errors:0,r=typeof t?.percent=="number"?t.percent:void 0;return s>0?{status:"fail",message:`Doctor evidence reports ${s} error(s).`}:typeof r=="number"&&r<70?{status:"warn",message:`Doctor health score is ${r}%.`}:{status:"pass",message:"Doctor evidence is present and healthy."}}function de(e){let t=typeof e.overallStatus=="string"?e.overallStatus:"unknown";return t==="fail"?{status:"fail",message:"Release readiness evidence reports blocking failures."}:t==="warn"?{status:"warn",message:"Release readiness evidence reports warnings."}:t==="pass"?{status:"pass",message:"Release readiness evidence passed."}:{status:"warn",message:`Release readiness evidence status is ${t}.`}}function ue(e){let t=typeof e.status=="string"?e.status:"unknown";return t==="failed"||t==="fail"?{status:"fail",message:"Workspace contract verify evidence failed."}:t==="passed"||t==="pass"?{status:"pass",message:"Workspace contract verify evidence passed."}:{status:"warn",message:`Workspace contract verify evidence status is ${t}.`}}function pe(e){let t=b(e.summary);if(t?.blocking===true||e.blocking===true)return {status:"fail",message:"Analyze evidence reports blocking findings."};let r=typeof t?.status=="string"?t.status:void 0;return r==="warn"||r==="warning"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is present."}}function fe(e){let t=e.schemaVersion==="rapidkit-doctor-fix-result-v1"?e:e.fixResult;if(!t||typeof t!="object"||Array.isArray(t))return {status:"skipped",message:"Doctor fix result not present; run doctor workspace --fix --json to record fixes."};let s=t,r=Array.isArray(s.remainingBlockers)?s.remainingBlockers:[];if(r.length>0)return {status:"fail",message:`Doctor fix result reports ${r.length} remaining blocker(s).`};let n=Array.isArray(s.appliedFixes)?s.appliedFixes:[];return n.length===0?{status:"pass",message:"Doctor fix result recorded with no remaining blockers."}:{status:"pass",message:`Doctor fix result recorded ${n.length} applied fix(es) with no remaining blockers.`}}async function ge(e,t){let s=u.join(e,".rapidkit","reports","doctor-remediation-plan-last-run.json");try{let r=b(await y.readJson(s));if(!r||(Array.isArray(r.steps)?r.steps:[]).length>0)return false;let i=typeof r.generatedAt=="string"?r.generatedAt:void 0;if(!i||!t)return true;let d=Date.parse(i),o=Date.parse(t);return !Number.isFinite(d)||!Number.isFinite(o)?true:d>=o}catch{return false}}function me(e){return e.id.endsWith(".init")?"init":e.id.endsWith(".test")?"test":e.id.endsWith(".build")?"build":e.id.endsWith(".start")?"start":null}function ke(e){let t=b(e.summary),s=typeof t?.verdict=="string"?t.verdict:void 0;return s==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:s==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:s==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function ye(e,t,s){let r=me(t),n=c$2(e,r??void 0);if(!n)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let i=n.stage;if(r&&i!==r)return {status:"missing",message:`Workspace run evidence is for stage "${i}", expected "${r}".`};let d=Array.isArray(n.projects)?n.projects:[],o=t.project?.toLowerCase();if(!o)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let a=d.find(f=>{let g=b(f);if(!g)return false;let c=typeof g.projectName=="string"?g.projectName.toLowerCase():"",l=["projectPath","relativePath","path"].map(p=>g[p]).filter(p=>typeof p=="string"&&p.trim().length>0).map(p=>p.replace(/\\/g,"/").toLowerCase());return c===o||l.some(p=>p.endsWith(`/${o}`)||p===o)});if(a){let f=v(n.generatedAt,s,`Workspace run evidence for ${t.project??t.id}`);if(f)return {status:"fail",message:f};let g=b(a),c=typeof g?.status=="string"?g.status:"unknown";return c==="failed"?{status:"fail",message:`Workspace run evidence failed for ${t.project}.`}:c==="passed"?{status:"pass",message:`Workspace run evidence passed for ${t.project}.`}:c==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${t.project}.`}:{status:"warn",message:`Workspace run evidence status is ${c} for ${t.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${t.project}.`}}function v(e,t,s){if(!t)return null;if(typeof e!="string"||e.trim().length===0)return `${s} is stale: missing generatedAt timestamp (required after impact ${t}).`;let r=Date.parse(e),n=Date.parse(t);return Number.isFinite(r)?Number.isFinite(n)&&r<n?`${s} is stale: generated at ${e}, before impact ${t}.`:null:`${s} is stale: invalid generatedAt timestamp (required after impact ${t}).`}async function he(e,t,s,r){let n=ce(e,t),i=n?u.relative(t,n).split(u.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!s)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"skipped",required:e.required,message:"Workspace contract is not present; contract verify skipped."};if(!n||!await y.pathExists(n))return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:i,message:i?`Missing evidence report: ${i}`:"No evidence mapping exists for this command."};let d=b(await y.readJson(n));if(!d)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:i,message:"Evidence report is not a JSON object."};let o;if(e.id==="workspace.doctor"){let a=v(d.generatedAt,r,"Doctor evidence");a?o={status:"fail",message:a}:o=le(d);}else if(e.id==="workspace.readiness"){let a=v(d.generatedAt,r,"Release readiness evidence");a?o={status:"fail",message:a}:o=de(d);}else if(e.id==="workspace.contract.verify"){let a=v(d.generatedAt,r,"Workspace contract verify evidence");a?o={status:"fail",message:a}:o=ue(d);}else if(e.id==="workspace.analyze"){let a=v(d.generatedAt,r,"Analyze evidence");a?o={status:"fail",message:a}:o=pe(d);}else if(e.id==="workspace.pipeline"){let a=v(d.generatedAt,r,"Pipeline evidence");a?o={status:"fail",message:a}:o=ke(d);}else if(e.id==="workspace.doctor-fix"){let a=d.schemaVersion==="rapidkit-doctor-fix-result-v1"?d:d.fixResult,f=b(a),g=typeof f?.generatedAt=="string"?f.generatedAt:void 0,c=v(g,r,"Doctor fix result");c?o={status:"fail",message:c}:await ge(t,g)?o={status:"skipped",message:"No current doctor remediation steps are pending."}:o=fe(d);}else if(e.id.startsWith("project."))o=ye(d,e,r);else {let a=v(d.generatedAt,r,"Evidence report");a?o={status:"fail",message:a}:o={status:"pass",message:"Evidence report is present."};}return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:o.status,required:e.required,evidencePath:i,message:o.message}}function ve(e,t={blockingReasons:[],needsAttention:false}){let s=e.filter(c=>c.status==="pass").length,r=e.filter(c=>c.status==="warn").length,n=e.filter(c=>c.status==="fail").length,i=e.filter(c=>c.status==="missing").length,d=e.filter(c=>c.status==="skipped").length,o=e.filter(c=>c.required&&(c.status==="fail"||c.status==="missing")).map(c=>`${c.id}: ${c.message}`),a=e.filter(c=>c.required&&c.status==="missing").length,f="ready",g=0;return o.length>0||t.blockingReasons.length>0?(f="blocked",g=2):(r>0||a>0||t.needsAttention)&&(f="needs-attention",g=1),{verdict:f,exitCode:g,stepsPassed:s,stepsWarn:r,stepsFailed:n,stepsMissing:i,stepsSkipped:d}}function be(e,t){let s=W(e.affectedProjects.map(l=>l.project?.name).filter(l=>typeof l=="string")),r=new Set(s.map(l=>l.toLowerCase())),n=W(e.transitiveImpact.map(l=>l.project?.name).filter(l=>typeof l=="string").filter(l=>!r.has(l.toLowerCase()))),i=new Map;for(let l of t){if(l.scope!=="project"||!l.project)continue;let p=l.project.toLowerCase(),h=i.get(p)??[];h.push(l),i.set(p,h);}let d=[],o=[],a=[],f=[],g=false,c=(l,p)=>{let h=i.get(l.toLowerCase())??[];if(h.length===0){a.push(l);return}let R=h.filter(m=>m.status==="fail"),C=h.filter(m=>m.status==="missing"),w=C.filter(m=>m.required),j=h.some(m=>m.status==="pass"||m.status==="warn");if(R.length>0){o.push(l),f.push(`graph.subgraph.${l}: ${p} has failed verification evidence (${R.map(m=>m.id).join(", ")}).`);return}if(w.length>0){o.push(l),f.push(`graph.subgraph.${l}: ${p} has missing required verification evidence (${w.map(m=>m.id).join(", ")}).`);return}if(C.length>0){o.push(l),g=true;return}if(j){d.push(l);return}a.push(l);};for(let l of s)c(l,"directly-changed");for(let l of n)c(l,"transitive dependent");return {subgraph:{totalProjects:s.length+n.length,directlyChanged:s,transitiveDependents:n,covered:W(d),uncovered:W(o),unverifiable:W(a)},blockingReasons:f,needsAttention:g}}function W(e){return [...new Set(e)].sort((t,s)=>t.localeCompare(s))}async function we(e$1){let t=u.resolve(e$1.workspacePath);if(e$1.fromImpactPath){let i=ie(t,e$1.fromImpactPath);return {impact:await Y(i),fromImpactRef:u.relative(t,i).split(u.sep).join("/"),impactFromDisk:true}}let s=u.join(t,f);if(await y.pathExists(s))return {impact:await Y(s),fromImpactRef:f,impactFromDisk:true};let r=u.join(t,c$1);if(await y.pathExists(r))return {impact:await n({workspacePath:t,fromPath:c$1,scope:e$1.scope,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now}),fromImpactRef:c$1,impactFromDisk:false};let n$2=await n$1({workspacePath:t,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now});return {impact:{schemaVersion:e,generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",diffRef:".rapidkit/reports/workspace-model-diff-last-run.json",workspace:{name:n$2.workspace.name,profile:n$2.workspace.profile,type:n$2.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0,blastRadius:{directlyAffected:0,transitivelyAffected:0,maxDistance:0,graphEdges:n$2.graph?.edges.length??0}},affectedProjects:[],transitiveImpact:[],criticalPathHotspots:[],workspaceImpact:[],verificationPlan:[],agentBrief:{headline:"Baseline workspace verify run.",bullets:["No impact report or snapshot was available; baseline gates were evaluated."],unsafeAssumptions:["Do not claim runtime verification passed unless evidence exists."]},diff:{schemaVersion:"workspace-model-diff.v1",generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",toRef:".rapidkit/reports/workspace-model.json",fromHash:"baseline",toHash:"baseline",summary:{changed:false,addedProjects:0,removedProjects:0,changedProjects:0,workspaceChanges:0,validationChanges:0,gitChangedFiles:0},git:{available:false,dirty:false,changedFiles:0,untrackedFiles:0,deletedFiles:0},changes:[],currentModel:n$2}},impactFromDisk:false}}function Re(e,t){if(t)return e.generatedAt}async function Je(e){let t=u.resolve(e.workspacePath),{impact:s,fromImpactRef:r,impactFromDisk:n}=await we(e),i=s.diff.currentModel,d$1=Re(s,n),o=oe([...m(),...s.verificationPlan]).filter(k=>ae(e.scope,k)),a$1=[];for(let k of o)a$1.push(await he(k,t,i.contracts.exists===true,d$1));let f=be(s,a$1),g=a(i.graph??{nodes:[],edges:[]}),c$1=b$1(i),l=await We(t),p=c(c$1,l?.freshness?.projectHashes),h={verdict:p.verdict,baseline:p.baseline,changed:p.changed,added:p.added,removed:p.removed,projectHashes:d(c$1)},R=b$2(g),C=i.policies?.mode??"warn",w=await Ce(i,t),j=je(C,w),m$1=ve(a$1,{blockingReasons:[...f.blockingReasons,...R,...j.blockingReasons],needsAttention:f.needsAttention||j.needsAttention}),Q=a$1.filter(k=>k.status==="missing"&&k.evidencePath).map(k=>k.evidencePath),x=[...a$1.filter(k=>k.required&&(k.status==="fail"||k.status==="missing")).map(k=>`${k.id}: ${k.message}`),...f.blockingReasons,...R,...j.blockingReasons],Z=w.filter(k=>k.severity==="error").length,ee=i.summary?.projectCount??i.projects.length,$=G({projectCount:ee,verdict:m$1.verdict,exitCode:m$1.exitCode,blockingReasons:x,policyErrorCount:Z});m$1.verdict=$.verdict,m$1.exitCode=$.exitCode;let B=x.length>0?U({blockingReasons:x,verifyCommand:"npx rapidkit workspace verify --from-impact .rapidkit/reports/workspace-impact-last-run.json --json",verifyArtifact:I}):[];return {schemaVersion:X,generatedAt:(e.now??new Date).toISOString(),workspacePath:t,mode:"evidence",fromImpactRef:r,scope:e.scope,impact:{changed:s.summary.changed,risk:s.summary.risk,affectedProjects:s.summary.affectedProjects,recommendedCommands:s.summary.recommendedCommands},summary:m$1,steps:a$1,missingEvidence:Q,blockingReasons:x,...B.length>0?{resolutionHints:B}:{},verificationPlan:o,affectedSubgraph:f.subgraph,graphIntegrity:g,freshness:h,policyMode:C,policyViolations:w}}async function Ce(e,t){let s=[];for(let n of e.validation?.issues??[])s.push({source:"model",severity:n.severity,code:n.code,message:n.message,target:n.target});let r=u.join(t,".rapidkit","reports","workspace-contract-verify-last-run.json");try{if(await y.pathExists(r)){let n=await y.readJson(r);if(Array.isArray(n.violations))for(let i of n.violations)typeof i=="string"&&i.trim().length>0&&s.push({source:"contract",severity:"error",code:"contract.violation",message:i});}}catch{}return s.sort((n,i)=>n.source!==i.source?n.source.localeCompare(i.source):n.code!==i.code?n.code.localeCompare(i.code):n.message.localeCompare(i.message))}function je(e,t){let s=t.filter(r=>r.severity==="error");return e==="enforce"&&s.length>0?{blockingReasons:s.map(r=>`policy.${r.code}: ${r.message}`),needsAttention:false}:{blockingReasons:[],needsAttention:s.length>0}}async function We(e){let t=u.join(e,I);try{if(!await y.pathExists(t))return null;let s=await y.readJson(t);return s&&s.schemaVersion===X?s:null}catch{return null}}async function Ue(e,t){let s=u.join(t,I);return await y.ensureDir(u.dirname(s)),await y.writeJson(s,a$1(e),{spaces:2}),s}function xe(e,t){let s=t?.strict?"strict":"default",r=[];if(e.summary.verdict==="blocked")return r.push(...e.blockingReasons),r.length===0&&r.push("verify verdict is blocked."),{passed:false,mode:s,exitCode:2,reasons:r};if(s==="strict"){if(e.summary.verdict!=="ready"&&r.push(`verify verdict is ${e.summary.verdict} (strict requires ready).`),e.freshness.verdict==="stale"){let n=[...e.freshness.changed,...e.freshness.added].slice(0,5);r.push(`freshness is stale${n.length>0?`: ${n.join(", ")}`:""} (strict requires fresh).`);}if(r.length>0)return {passed:false,mode:s,exitCode:1,reasons:r}}return {passed:true,mode:s,exitCode:0,reasons:r}}function Ge(e,t){return xe(e,t).exitCode}export{K as a,Be as b,X as c,I as d,be as e,Je as f,Ue as g,xe as h,Ge as i};
1
+ import {c as c$2}from'./chunk-64RTZBHU.js';import {a,b as b$2}from'./chunk-PYCJWW4B.js';import {b as b$1,c,d}from'./chunk-S4U2FRJV.js';import {m,f,c as c$1,n,e}from'./chunk-MOAQ3WU6.js';import {n as n$1,b as b$3}from'./chunk-KUOCSDIY.js';import {a as a$1}from'./chunk-3PTJID76.js';import u from'path';import y from'fs-extra';var K="rapidkit-blocker-resolution-v1";function J(e){let t=e.blockers.map(r=>r.trim()).filter(Boolean).slice(0,12),s=e.stderrTail?.trim().slice(-400)??"";return b$3({blockers:t,exitCode:e.exitCode??null,stderrTail:s})}function te(e){let t=e.trim().toLowerCase();return t?t.includes("missing evidence")||t.includes(": missing")||t.includes("artifact missing")||t.includes("not found on disk")?"artifact-missing":t.includes("policy.")||t.includes("contract")?"config-fixable":t.includes("impact")||t.includes("untracked")||t.includes("grounding")?"semantic-attention":t.includes("failed")||t.includes("blocked")||t.includes(": fail")?"command-failed-repeat":"config-fixable":"unresolvable-without-human"}function se(e){let t=te(e.reason),s=J({blockers:[e.reason]}),r=t==="artifact-missing"?[{actionKind:"run-once",detail:e.sourceCommand?`Run the source command once: ${e.sourceCommand}`:"Run the mapped workspace intelligence command once to generate the missing artifact.",studioActionId:"run-analyze"}]:t==="semantic-attention"?[{actionKind:"commit-files",detail:"Review workspace-level grounding files (AGENTS.md, agent-sync outputs) and commit or refresh the impact baseline."},{actionKind:"refresh-baseline",detail:"Refresh snapshot + diff + impact before re-running verify."}]:[{actionKind:"edit-file",detail:"Apply the smallest safe file or policy fix for this blocker before re-running verification.",studioActionId:"fix-lens"}];return {schemaVersion:K,blockerId:e.blockerId,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,resolutionClass:t,blockerSignature:s,commandRetryHint:t==="artifact-missing"?"Run the source command once, then verify.":"Do not re-run the same failing command; fix the source issue first, then verify.",fixHints:r,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}}function U(e){return Array.from(new Set(e.blockingReasons.map(s=>s.trim()).filter(Boolean))).slice(0,12).map((s,r)=>se({reason:s,blockerId:`blocker-${r+1}`,sourceCommand:e.sourceCommand,sourceArtifact:e.sourceArtifact,verifyCommand:e.verifyCommand,verifyArtifact:e.verifyArtifact}))}function re(e){let t=e.toLowerCase();return t.includes("stale")||t.includes("missing evidence")||t.includes("no projects")||t.includes("projects.empty")||t.includes("projects discovered")||t.includes("projects.missing")||t.includes("not yet run")||t.includes("doctor-last-run")||t.includes("doctor-project-last-run")||t.includes("doctor-remediation-plan-last-run")||t.includes("doctor-fix-result-last-run")||t.includes("pipeline-last-run")||t.includes("release-readiness")||t.includes("analyze-last-run")||t.includes("analyze reported")||t.includes("analyze verdict")||t.includes("analyze needs attention")||t.includes("toolchain.lock")||t.includes("not pinned")||t.includes("readiness:")||t.includes("env:")||t.includes("workspace-run-last")||t.includes("pre-project")||t.includes("before adding projects")||t.includes("workspace.projects.missing")||t.includes("no backend projects")||t.includes("index.json")||t.includes("workspace-intelligence-history")||t.includes("validation warning")||t.includes("workspace model validation")||t.includes("workspace.marker")||t.includes("no project roots")||t.includes("no infrastructure services")||t.includes("infra/overrides")||t.includes("infra dependencies")||t.includes("contract verify")||t.includes("contract inspect")||t.includes("publish verify evidence")}function ne(e){return e.length===0||e.every(t=>re(t))}function G(e){return e.projectCount>0||e.policyErrorCount>0?{verdict:e.verdict,exitCode:e.exitCode}:e.verdict==="blocked"&&ne(e.blockingReasons)?{verdict:"needs-attention",exitCode:1}:{verdict:e.verdict,exitCode:e.exitCode}}function Be(e,t){let s=t&&t!=="ready"?` (${t.replace(/-/g," ")})`:"";return e===0?`Workspace scaffold ready${s} \u2014 add your first project to continue.`:`Workspace scaffold${s}: ${e} pre-project signal(s) \u2014 add your first project to continue.`}var X="workspace-verify.v1",I=".rapidkit/reports/workspace-verify-last-run.json";function ie(e,t){return u.isAbsolute(t)?t:u.join(e,t)}async function Y(e$1){let t=await y.readJson(e$1);if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`Workspace impact input is not a JSON object: ${e$1}`);let s=t;if(s.schemaVersion!==e)throw new Error(`Unsupported workspace impact schema: ${String(s.schemaVersion)}`);return s}function oe(e){let t=new Set,s=[];for(let r of e){let n=`${r.scope}:${r.project??""}:${r.display}`;t.has(n)||(t.add(n),s.push(r));}return s}function ae(e,t){if(!e||e==="workspace")return true;let s=(e.startsWith("project:")?e.slice(8):e).trim().toLowerCase();return t.scope==="workspace"?true:(t.project??"").trim().toLowerCase()===s}function ce(e,t){if(e.id==="workspace.doctor")return u.join(t,".rapidkit","reports","doctor-last-run.json");if(e.id==="workspace.contract.verify")return u.join(t,".rapidkit","reports","workspace-contract-verify-last-run.json");if(e.id==="workspace.readiness")return u.join(t,".rapidkit","reports","release-readiness-last-run.json");if(e.id==="workspace.analyze")return u.join(t,".rapidkit","reports","analyze-last-run.json");if(e.id==="workspace.pipeline")return u.join(t,".rapidkit","reports","pipeline-last-run.json");if(e.id==="workspace.doctor-fix")return u.join(t,".rapidkit","reports","doctor-fix-result-last-run.json");if(e.id.startsWith("project.")&&e.id.includes("."))return u.join(t,".rapidkit","reports","workspace-run-last.json")}function b(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function le(e){let t=b(e.healthScore),s=typeof t?.errors=="number"?t.errors:0,r=typeof t?.percent=="number"?t.percent:void 0;return s>0?{status:"fail",message:`Doctor evidence reports ${s} error(s).`}:typeof r=="number"&&r<70?{status:"warn",message:`Doctor health score is ${r}%.`}:{status:"pass",message:"Doctor evidence is present and healthy."}}function de(e){let t=typeof e.overallStatus=="string"?e.overallStatus:"unknown";return t==="fail"?{status:"fail",message:"Release readiness evidence reports blocking failures."}:t==="warn"?{status:"warn",message:"Release readiness evidence reports warnings."}:t==="pass"?{status:"pass",message:"Release readiness evidence passed."}:{status:"warn",message:`Release readiness evidence status is ${t}.`}}function ue(e){let t=typeof e.status=="string"?e.status:"unknown";return t==="failed"||t==="fail"?{status:"fail",message:"Workspace contract verify evidence failed."}:t==="passed"||t==="pass"?{status:"pass",message:"Workspace contract verify evidence passed."}:{status:"warn",message:`Workspace contract verify evidence status is ${t}.`}}function pe(e){let t=b(e.summary);if(t?.blocking===true||e.blocking===true)return {status:"fail",message:"Analyze evidence reports blocking findings."};let r=typeof t?.status=="string"?t.status:void 0;return r==="warn"||r==="warning"?{status:"warn",message:"Analyze evidence reports warnings."}:{status:"pass",message:"Analyze evidence is present."}}function fe(e){let t=e.schemaVersion==="rapidkit-doctor-fix-result-v1"?e:e.fixResult;if(!t||typeof t!="object"||Array.isArray(t))return {status:"skipped",message:"Doctor fix result not present; run doctor workspace --fix --json to record fixes."};let s=t,r=Array.isArray(s.remainingBlockers)?s.remainingBlockers:[];if(r.length>0)return {status:"fail",message:`Doctor fix result reports ${r.length} remaining blocker(s).`};let n=Array.isArray(s.appliedFixes)?s.appliedFixes:[];return n.length===0?{status:"pass",message:"Doctor fix result recorded with no remaining blockers."}:{status:"pass",message:`Doctor fix result recorded ${n.length} applied fix(es) with no remaining blockers.`}}async function ge(e,t){let s=u.join(e,".rapidkit","reports","doctor-remediation-plan-last-run.json");try{let r=b(await y.readJson(s));if(!r||(Array.isArray(r.steps)?r.steps:[]).length>0)return false;let i=typeof r.generatedAt=="string"?r.generatedAt:void 0;if(!i||!t)return true;let d=Date.parse(i),o=Date.parse(t);return !Number.isFinite(d)||!Number.isFinite(o)?true:d>=o}catch{return false}}function me(e){return e.id.endsWith(".init")?"init":e.id.endsWith(".test")?"test":e.id.endsWith(".build")?"build":e.id.endsWith(".start")?"start":null}function ke(e){let t=b(e.summary),s=typeof t?.verdict=="string"?t.verdict:void 0;return s==="blocked"?{status:"fail",message:"Pipeline evidence is blocked."}:s==="needs-attention"?{status:"warn",message:"Pipeline evidence needs attention."}:s==="ready"?{status:"pass",message:"Pipeline evidence is ready."}:{status:"warn",message:"Pipeline evidence status is unknown."}}function ye(e,t,s){let r=me(t),n=c$2(e,r??void 0);if(!n)return {status:"missing",message:"Workspace run evidence is missing or unreadable."};let i=n.stage;if(r&&i!==r)return {status:"missing",message:`Workspace run evidence is for stage "${i}", expected "${r}".`};let d=Array.isArray(n.projects)?n.projects:[],o=t.project?.toLowerCase();if(!o)return {status:"missing",message:"Project-scoped workspace run evidence is missing a project identifier."};let a=d.find(f=>{let g=b(f);if(!g)return false;let c=typeof g.projectName=="string"?g.projectName.toLowerCase():"",l=["projectPath","relativePath","path"].map(p=>g[p]).filter(p=>typeof p=="string"&&p.trim().length>0).map(p=>p.replace(/\\/g,"/").toLowerCase());return c===o||l.some(p=>p.endsWith(`/${o}`)||p===o)});if(a){let f=v(n.generatedAt,s,`Workspace run evidence for ${t.project??t.id}`);if(f)return {status:"fail",message:f};let g=b(a),c=typeof g?.status=="string"?g.status:"unknown";return c==="failed"?{status:"fail",message:`Workspace run evidence failed for ${t.project}.`}:c==="passed"?{status:"pass",message:`Workspace run evidence passed for ${t.project}.`}:c==="skipped"?{status:"warn",message:`Workspace run evidence skipped for ${t.project}.`}:{status:"warn",message:`Workspace run evidence status is ${c} for ${t.project}.`}}return {status:"missing",message:`Workspace run evidence does not include project ${t.project}.`}}function v(e,t,s){if(!t)return null;if(typeof e!="string"||e.trim().length===0)return `${s} is stale: missing generatedAt timestamp (required after impact ${t}).`;let r=Date.parse(e),n=Date.parse(t);return Number.isFinite(r)?Number.isFinite(n)&&r<n?`${s} is stale: generated at ${e}, before impact ${t}.`:null:`${s} is stale: invalid generatedAt timestamp (required after impact ${t}).`}async function he(e,t,s,r){let n=ce(e,t),i=n?u.relative(t,n).split(u.sep).join("/"):void 0;if(e.id==="workspace.contract.verify"&&!s)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"skipped",required:e.required,message:"Workspace contract is not present; contract verify skipped."};if(!n||!await y.pathExists(n))return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"missing",required:e.required,evidencePath:i,message:i?`Missing evidence report: ${i}`:"No evidence mapping exists for this command."};let d=b(await y.readJson(n));if(!d)return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:"fail",required:e.required,evidencePath:i,message:"Evidence report is not a JSON object."};let o;if(e.id==="workspace.doctor"){let a=v(d.generatedAt,r,"Doctor evidence");a?o={status:"fail",message:a}:o=le(d);}else if(e.id==="workspace.readiness"){let a=v(d.generatedAt,r,"Release readiness evidence");a?o={status:"fail",message:a}:o=de(d);}else if(e.id==="workspace.contract.verify"){let a=v(d.generatedAt,r,"Workspace contract verify evidence");a?o={status:"fail",message:a}:o=ue(d);}else if(e.id==="workspace.analyze"){let a=v(d.generatedAt,r,"Analyze evidence");a?o={status:"fail",message:a}:o=pe(d);}else if(e.id==="workspace.pipeline"){let a=v(d.generatedAt,r,"Pipeline evidence");a?o={status:"fail",message:a}:o=ke(d);}else if(e.id==="workspace.doctor-fix"){let a=d.schemaVersion==="rapidkit-doctor-fix-result-v1"?d:d.fixResult,f=b(a),g=typeof f?.generatedAt=="string"?f.generatedAt:void 0,c=v(g,r,"Doctor fix result");c?o={status:"fail",message:c}:await ge(t,g)?o={status:"skipped",message:"No current doctor remediation steps are pending."}:o=fe(d);}else if(e.id.startsWith("project."))o=ye(d,e,r);else {let a=v(d.generatedAt,r,"Evidence report");a?o={status:"fail",message:a}:o={status:"pass",message:"Evidence report is present."};}return {id:e.id,label:e.label,scope:e.scope,project:e.project,command:e,status:o.status,required:e.required,evidencePath:i,message:o.message}}function ve(e,t={blockingReasons:[],needsAttention:false}){let s=e.filter(c=>c.status==="pass").length,r=e.filter(c=>c.status==="warn").length,n=e.filter(c=>c.status==="fail").length,i=e.filter(c=>c.status==="missing").length,d=e.filter(c=>c.status==="skipped").length,o=e.filter(c=>c.required&&(c.status==="fail"||c.status==="missing")).map(c=>`${c.id}: ${c.message}`),a=e.filter(c=>c.required&&c.status==="missing").length,f="ready",g=0;return o.length>0||t.blockingReasons.length>0?(f="blocked",g=2):(r>0||a>0||t.needsAttention)&&(f="needs-attention",g=1),{verdict:f,exitCode:g,stepsPassed:s,stepsWarn:r,stepsFailed:n,stepsMissing:i,stepsSkipped:d}}function be(e,t){let s=W(e.affectedProjects.map(l=>l.project?.name).filter(l=>typeof l=="string")),r=new Set(s.map(l=>l.toLowerCase())),n=W(e.transitiveImpact.map(l=>l.project?.name).filter(l=>typeof l=="string").filter(l=>!r.has(l.toLowerCase()))),i=new Map;for(let l of t){if(l.scope!=="project"||!l.project)continue;let p=l.project.toLowerCase(),h=i.get(p)??[];h.push(l),i.set(p,h);}let d=[],o=[],a=[],f=[],g=false,c=(l,p)=>{let h=i.get(l.toLowerCase())??[];if(h.length===0){a.push(l);return}let R=h.filter(m=>m.status==="fail"),C=h.filter(m=>m.status==="missing"),w=C.filter(m=>m.required),j=h.some(m=>m.status==="pass"||m.status==="warn");if(R.length>0){o.push(l),f.push(`graph.subgraph.${l}: ${p} has failed verification evidence (${R.map(m=>m.id).join(", ")}).`);return}if(w.length>0){o.push(l),f.push(`graph.subgraph.${l}: ${p} has missing required verification evidence (${w.map(m=>m.id).join(", ")}).`);return}if(C.length>0){o.push(l),g=true;return}if(j){d.push(l);return}a.push(l);};for(let l of s)c(l,"directly-changed");for(let l of n)c(l,"transitive dependent");return {subgraph:{totalProjects:s.length+n.length,directlyChanged:s,transitiveDependents:n,covered:W(d),uncovered:W(o),unverifiable:W(a)},blockingReasons:f,needsAttention:g}}function W(e){return [...new Set(e)].sort((t,s)=>t.localeCompare(s))}async function we(e$1){let t=u.resolve(e$1.workspacePath);if(e$1.fromImpactPath){let i=ie(t,e$1.fromImpactPath);return {impact:await Y(i),fromImpactRef:u.relative(t,i).split(u.sep).join("/"),impactFromDisk:true}}let s=u.join(t,f);if(await y.pathExists(s))return {impact:await Y(s),fromImpactRef:f,impactFromDisk:true};let r=u.join(t,c$1);if(await y.pathExists(r))return {impact:await n({workspacePath:t,fromPath:c$1,scope:e$1.scope,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now}),fromImpactRef:c$1,impactFromDisk:false};let n$2=await n$1({workspacePath:t,includeAbsolutePaths:e$1.includeAbsolutePaths,includeEvidence:e$1.includeEvidence,observableScanDepth:e$1.observableScanDepth,now:e$1.now});return {impact:{schemaVersion:e,generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",diffRef:".rapidkit/reports/workspace-model-diff-last-run.json",workspace:{name:n$2.workspace.name,profile:n$2.workspace.profile,type:n$2.workspace.type},summary:{changed:false,risk:"none",affectedProjects:0,workspaceItems:0,recommendedCommands:0,blastRadius:{directlyAffected:0,transitivelyAffected:0,maxDistance:0,graphEdges:n$2.graph?.edges.length??0}},affectedProjects:[],transitiveImpact:[],criticalPathHotspots:[],workspaceImpact:[],verificationPlan:[],agentBrief:{headline:"Baseline workspace verify run.",bullets:["No impact report or snapshot was available; baseline gates were evaluated."],unsafeAssumptions:["Do not claim runtime verification passed unless evidence exists."]},diff:{schemaVersion:"workspace-model-diff.v1",generatedAt:(e$1.now??new Date).toISOString(),fromRef:"baseline",toRef:".rapidkit/reports/workspace-model.json",fromHash:"baseline",toHash:"baseline",summary:{changed:false,addedProjects:0,removedProjects:0,changedProjects:0,workspaceChanges:0,validationChanges:0,gitChangedFiles:0},git:{available:false,dirty:false,changedFiles:0,untrackedFiles:0,deletedFiles:0},changes:[],currentModel:n$2}},impactFromDisk:false}}function Re(e,t){if(t)return e.generatedAt}async function Je(e){let t=u.resolve(e.workspacePath),{impact:s,fromImpactRef:r,impactFromDisk:n}=await we(e),i=s.diff.currentModel,d$1=Re(s,n),o=oe([...m(),...s.verificationPlan]).filter(k=>ae(e.scope,k)),a$1=[];for(let k of o)a$1.push(await he(k,t,i.contracts.exists===true,d$1));let f=be(s,a$1),g=a(i.graph??{nodes:[],edges:[]}),c$1=b$1(i),l=await We(t),p=c(c$1,l?.freshness?.projectHashes),h={verdict:p.verdict,baseline:p.baseline,changed:p.changed,added:p.added,removed:p.removed,projectHashes:d(c$1)},R=b$2(g),C=i.policies?.mode??"warn",w=await Ce(i,t),j=je(C,w),m$1=ve(a$1,{blockingReasons:[...f.blockingReasons,...R,...j.blockingReasons],needsAttention:f.needsAttention||j.needsAttention}),Q=a$1.filter(k=>k.status==="missing"&&k.evidencePath).map(k=>k.evidencePath),x=[...a$1.filter(k=>k.required&&(k.status==="fail"||k.status==="missing")).map(k=>`${k.id}: ${k.message}`),...f.blockingReasons,...R,...j.blockingReasons],Z=w.filter(k=>k.severity==="error").length,ee=i.summary?.projectCount??i.projects.length,$=G({projectCount:ee,verdict:m$1.verdict,exitCode:m$1.exitCode,blockingReasons:x,policyErrorCount:Z});m$1.verdict=$.verdict,m$1.exitCode=$.exitCode;let B=x.length>0?U({blockingReasons:x,verifyCommand:"npx rapidkit workspace verify --from-impact .rapidkit/reports/workspace-impact-last-run.json --json",verifyArtifact:I}):[];return {schemaVersion:X,generatedAt:(e.now??new Date).toISOString(),workspacePath:t,mode:"evidence",fromImpactRef:r,scope:e.scope,impact:{changed:s.summary.changed,risk:s.summary.risk,affectedProjects:s.summary.affectedProjects,recommendedCommands:s.summary.recommendedCommands},summary:m$1,steps:a$1,missingEvidence:Q,blockingReasons:x,...B.length>0?{resolutionHints:B}:{},verificationPlan:o,affectedSubgraph:f.subgraph,graphIntegrity:g,freshness:h,policyMode:C,policyViolations:w}}async function Ce(e,t){let s=[];for(let n of e.validation?.issues??[])s.push({source:"model",severity:n.severity,code:n.code,message:n.message,target:n.target});let r=u.join(t,".rapidkit","reports","workspace-contract-verify-last-run.json");try{if(await y.pathExists(r)){let n=await y.readJson(r);if(Array.isArray(n.violations))for(let i of n.violations)typeof i=="string"&&i.trim().length>0&&s.push({source:"contract",severity:"error",code:"contract.violation",message:i});}}catch{}return s.sort((n,i)=>n.source!==i.source?n.source.localeCompare(i.source):n.code!==i.code?n.code.localeCompare(i.code):n.message.localeCompare(i.message))}function je(e,t){let s=t.filter(r=>r.severity==="error");return e==="enforce"&&s.length>0?{blockingReasons:s.map(r=>`policy.${r.code}: ${r.message}`),needsAttention:false}:{blockingReasons:[],needsAttention:s.length>0}}async function We(e){let t=u.join(e,I);try{if(!await y.pathExists(t))return null;let s=await y.readJson(t);return s&&s.schemaVersion===X?s:null}catch{return null}}async function Ue(e,t){let s=u.join(t,I);return await y.ensureDir(u.dirname(s)),await y.writeJson(s,a$1(e),{spaces:2}),s}function xe(e,t){let s=t?.strict?"strict":"default",r=[];if(e.summary.verdict==="blocked")return r.push(...e.blockingReasons),r.length===0&&r.push("verify verdict is blocked."),{passed:false,mode:s,exitCode:2,reasons:r};if(s==="strict"){if(e.summary.verdict!=="ready"&&r.push(`verify verdict is ${e.summary.verdict} (strict requires ready).`),e.freshness.verdict==="stale"){let n=[...e.freshness.changed,...e.freshness.added].slice(0,5);r.push(`freshness is stale${n.length>0?`: ${n.join(", ")}`:""} (strict requires fresh).`);}if(r.length>0)return {passed:false,mode:s,exitCode:1,reasons:r}}return {passed:true,mode:s,exitCode:0,reasons:r}}function Ge(e,t){return xe(e,t).exitCode}export{K as a,Be as b,X as c,I as d,be as e,Je as f,Ue as g,xe as h,Ge as i};