rapidkit 0.42.0 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -9
- package/contracts/agent-customization-pack.v1.json +29 -29
- package/contracts/create-planner-capabilities.v1.json +2 -2
- package/contracts/extension-cli-compatibility.v1.json +2 -2
- package/contracts/runtime-command-surface.v1.json +2 -2
- package/contracts/workspace-registry.v1.json +1 -1
- package/contracts/workspace-run-last.v1.json +1 -1
- package/dist/autopilot-release-5J55NPXF.js +1 -0
- package/dist/{chunk-YWUWRSNO.js → chunk-4EIQRQSA.js} +1 -1
- package/dist/{chunk-QOH5TIRZ.js → chunk-6WDDATKQ.js} +1 -1
- package/dist/{chunk-2ZLIVGO7.js → chunk-7M2VBCAX.js} +1 -1
- package/dist/{chunk-FEA53XL6.js → chunk-7V7C6GXV.js} +1 -1
- package/dist/{chunk-DZU4KPPW.js → chunk-CXWWNQDF.js} +1 -1
- package/dist/{chunk-5QAVZET2.js → chunk-DMITBXR2.js} +1 -1
- package/dist/{chunk-4ZSDU5OO.js → chunk-FLFZC7ZV.js} +1 -1
- package/dist/{chunk-QKVEWX4L.js → chunk-JN6R5UP4.js} +2 -2
- package/dist/chunk-KEMWZUGO.js +5 -0
- package/dist/{chunk-IS2XUPMP.js → chunk-KQRXY2GJ.js} +1 -1
- package/dist/{chunk-FSIZLBTL.js → chunk-KUOCSDIY.js} +1 -1
- package/dist/{chunk-FB35IONI.js → chunk-MOAQ3WU6.js} +1 -1
- package/dist/{chunk-F7GYXSBT.js → chunk-NN3IV4U6.js} +1 -1
- package/dist/chunk-QKVDG6FD.js +32 -0
- package/dist/{chunk-LANBSCGS.js → chunk-RQIHAPF3.js} +1 -1
- package/dist/{chunk-M44C2P3R.js → chunk-S4U2FRJV.js} +1 -1
- package/dist/{chunk-YM5Q3PV6.js → chunk-TQULVWUA.js} +1 -1
- package/dist/{chunk-5PFGOXBQ.js → chunk-WKCBS5DC.js} +1 -1
- package/dist/{create-EAE2AJJL.js → create-TPFUONHK.js} +1 -1
- package/dist/{demo-kit-N5U3NGAE.js → demo-kit-4NCHGEA6.js} +1 -1
- package/dist/{doctor-E6JE4Q3B.js → doctor-O2B3XNAB.js} +1 -1
- package/dist/{dotnet-webapi-clean-K33C77EI.js → dotnet-webapi-clean-LV3MADHG.js} +1 -1
- package/dist/{gofiber-standard-BQ4HCXL2.js → gofiber-standard-25DZS5UY.js} +1 -1
- package/dist/{gogin-standard-PUBCYW3A.js → gogin-standard-FMVHPLO5.js} +1 -1
- package/dist/index.js +21 -20
- package/dist/{pipeline-TRA4MMZC.js → pipeline-PX6ZUINW.js} +1 -1
- package/dist/{springboot-standard-XFVQI37R.js → springboot-standard-LMZF7OJS.js} +1 -1
- package/dist/{workspace-IBTKZX7T.js → workspace-MPKEUHFP.js} +1 -1
- package/dist/{workspace-agent-sync-LEYLJ42D.js → workspace-agent-sync-XD32GG5V.js} +1 -1
- package/dist/{workspace-context-NTG3D4DI.js → workspace-context-QFES7YBC.js} +1 -1
- package/dist/workspace-explain-Q7TJCHD5.js +1 -0
- package/dist/{workspace-foundation-6AUEEJQQ.js → workspace-foundation-2OVUZXPT.js} +1 -1
- package/dist/{workspace-intelligence-C6NT557E.js → workspace-intelligence-FJP5ONDB.js} +1 -1
- package/dist/{workspace-mcp-serve-GM7A3IVM.js → workspace-mcp-serve-DFJIUTL5.js} +1 -1
- package/dist/{workspace-model-AOTSEAVW.js → workspace-model-IDRCH3VI.js} +1 -1
- package/dist/workspace-run-NULA72JV.js +1 -0
- package/dist/{workspace-verify-7R3XBNKE.js → workspace-verify-K4RSQIXT.js} +1 -1
- package/dist/{workspace-watch-SGY2DEZ5.js → workspace-watch-PFJDHPXI.js} +1 -1
- package/package.json +1 -1
- package/dist/autopilot-release-MVFRZMHD.js +0 -1
- package/dist/chunk-3HBNF2A3.js +0 -32
- package/dist/chunk-Q2KZIBV4.js +0 -5
- package/dist/workspace-explain-P2EBRNP6.js +0 -1
- package/dist/workspace-run-ATFFJCMK.js +0 -1
package/README.md
CHANGED
|
@@ -7,6 +7,23 @@
|
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
8
|
[](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
|
-
|
|
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
|
|
588
|
+
The Workspai VS Code extension provides the dashboard, sidebar, Incident Studio,
|
|
589
|
+
AI workflows, and developer-facing workspace operations.
|
|
550
590
|
|
|
551
|
-
| Component
|
|
552
|
-
|
|
|
553
|
-
| CLI
|
|
554
|
-
|
|
|
555
|
-
|
|
|
556
|
-
|
|
|
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
|
|
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
|
-
".
|
|
8
|
-
".
|
|
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
|
-
".
|
|
16
|
-
".
|
|
15
|
+
".workspai/reports/INDEX.json",
|
|
16
|
+
".workspai/reports/agent-customization-pack.json",
|
|
17
17
|
"AGENTS.md",
|
|
18
|
-
".github/instructions/
|
|
19
|
-
".github/prompts/
|
|
20
|
-
".github/skills/
|
|
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
|
-
".
|
|
23
|
-
".
|
|
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": ".
|
|
99
|
+
"path": ".workspai/reports/workspace-context-agent.json",
|
|
100
100
|
"label": "Agent context pack",
|
|
101
101
|
"required": true
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
|
-
"path": ".
|
|
104
|
+
"path": ".workspai/reports/workspace-skills-index.json",
|
|
105
105
|
"label": "Operational skills index",
|
|
106
106
|
"required": true
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
|
-
"path": ".
|
|
109
|
+
"path": ".workspai/reports/workspace-model.json",
|
|
110
110
|
"label": "Workspace model graph",
|
|
111
111
|
"required": false
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
|
-
"path": ".
|
|
114
|
+
"path": ".workspai/reports/doctor-last-run.json",
|
|
115
115
|
"label": "Workspace doctor",
|
|
116
116
|
"required": false
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
"path": ".
|
|
119
|
+
"path": ".workspai/reports/doctor-project-last-run.json",
|
|
120
120
|
"label": "Project doctor",
|
|
121
121
|
"required": false
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
"path": ".
|
|
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": ".
|
|
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": ".
|
|
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": ".
|
|
139
|
+
"path": ".workspai/reports/analyze-last-run.json",
|
|
140
140
|
"label": "Workspace analyze",
|
|
141
141
|
"required": false
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
|
-
"path": ".
|
|
144
|
+
"path": ".workspai/reports/pipeline-last-run.json",
|
|
145
145
|
"label": "Governance pipeline",
|
|
146
146
|
"required": false
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
|
-
"path": ".
|
|
149
|
+
"path": ".workspai/reports/release-readiness-last-run.json",
|
|
150
150
|
"label": "Release readiness",
|
|
151
151
|
"required": false
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
|
-
"path": ".
|
|
154
|
+
"path": ".workspai/reports/workspace-impact-last-run.json",
|
|
155
155
|
"label": "Workspace impact",
|
|
156
156
|
"required": false
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
|
-
"path": ".
|
|
159
|
+
"path": ".workspai/reports/workspace-verify-last-run.json",
|
|
160
160
|
"label": "Workspace verify",
|
|
161
161
|
"required": false
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
|
-
"path": ".
|
|
164
|
+
"path": ".workspai/reports/workspace-model-snapshot.json",
|
|
165
165
|
"label": "Workspace model snapshot",
|
|
166
166
|
"required": false
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
|
-
"path": ".
|
|
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": ".
|
|
174
|
+
"path": ".workspai/reports/workspace-explain-last-run.json",
|
|
175
175
|
"label": "Workspace explain",
|
|
176
176
|
"required": false
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
|
-
"path": ".
|
|
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": ".
|
|
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
|
-
".
|
|
216
|
-
".
|
|
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": "
|
|
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
|
|
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": "
|
|
4
|
-
"minimumVerifiedCliVersion": "0.
|
|
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": "
|
|
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
|
|
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": "
|
|
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": "
|
|
4
|
+
"title": "Workspai Workspace Run Evidence",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"required": [
|
|
7
7
|
"schemaVersion",
|
|
@@ -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';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-CDCYRBAY.js';import {j}from'./chunk-
|
|
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 +1 @@
|
|
|
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-M44C2P3R.js';import {m,f,c as c$1,n,e}from'./chunk-FB35IONI.js';import {n as n$1,b as b$3}from'./chunk-FSIZLBTL.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a as a$1,c,i,g as g$1,h}from'./chunk-4KUIFXHM.js';import {a as a$2}from'./chunk-5QAVZET2.js';import E from'fs';import a from'path';var g=["init","dev","start","build","test","lint","format","help"],W={python:{runtime:"python",displayName:"Python",tier:"first-class",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:true,doctorSupport:"full",notes:["Core-backed Python projects support RapidKit modules and lifecycle commands."]},node:{runtime:"node",displayName:"Node.js",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:true,doctorSupport:"full",notes:["Node projects support npm-owned lifecycle commands; NestJS is the first-class Node framework."]},go:{runtime:"go",displayName:"Go",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:false,doctorSupport:"readiness",notes:["Go projects support workspace governance and lifecycle commands via Go tooling."]},java:{runtime:"java",displayName:"Java / Spring Boot",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:false,doctorSupport:"readiness",notes:["Java projects support Maven/Gradle lifecycle commands and workspace governance."]},dotnet:{runtime:"dotnet",displayName:".NET / ASP.NET Core",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:false,doctorSupport:"readiness",notes:[".NET projects support dotnet CLI lifecycle commands and workspace governance."]},php:{runtime:"php",displayName:"PHP",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["PHP projects are importable and governed as observed projects until a kit exists."]},ruby:{runtime:"ruby",displayName:"Ruby",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Ruby projects are importable and governed as observed projects until a kit exists."]},rust:{runtime:"rust",displayName:"Rust",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Rust projects are importable and governed as observed projects until a kit exists."]},elixir:{runtime:"elixir",displayName:"Elixir",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Elixir projects are importable and governed as observed projects until a kit exists."]},clojure:{runtime:"clojure",displayName:"Clojure",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Clojure projects are importable and governed as observed projects until a kit exists."]},scala:{runtime:"scala",displayName:"Scala",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Scala projects are importable and governed as observed projects until a kit exists."]},kotlin:{runtime:"kotlin",displayName:"Kotlin",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Kotlin projects are importable and governed as observed projects until a kit exists."]},deno:{runtime:"deno",displayName:"Deno",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Deno projects are importable and governed as observed projects until a kit exists."]},bun:{runtime:"bun",displayName:"Bun",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Bun projects are importable and governed as observed projects until a kit exists."]},unknown:{runtime:"unknown",displayName:"Unknown",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Unknown projects are tracked safely but require manual command configuration."]}},ce=["fastapi","nestjs"],le=["django","flask","nextjs","remix","nuxt","react","vite","vue","sveltekit","svelte","angular","astro","solid","express","fastify","koa","echo","gofiber","gogin","springboot","dotnet","laravel","symfony","rails","sinatra","actix","axum","rocket","phoenix","clojure","scala","kotlin","deno","bun"];function S(e){return W[e||"unknown"]??W.unknown}function q(e){return ce.includes(e)?"first-class":le.includes(e)?"extended":"observed"}function Y(e){let t=S(e.runtime);return {lifecycleCommands:t.lifecycleCommands,moduleCommands:e.moduleSupport&&t.moduleCommands,unsupportedLifecycleCommands:g.filter(n=>!t.lifecycleCommands.includes(n))}}var de=["python","node","go","java","dotnet"];function C(e){return !!e&&de.includes(e)}function N(e,t){return t!=="lint"&&t!=="format"&&t!=="docs"?false:e==="python"}function H(e){let t=S(e),n=C(t.runtime),r=pe[t.runtime]??[],i=fe[t.runtime]??[];return {runtime:t.runtime,displayName:t.displayName,lifecycleCommands:t.lifecycleCommands,hasExecutor:n,packageManagers:r,primaryFiles:i,notes:t.notes}}var pe={python:["poetry","pip","uv"],node:["npm","pnpm","yarn","bun"],go:["go"],java:["maven","gradle"],dotnet:["dotnet"],php:["composer"],ruby:["bundle"],rust:["cargo"],elixir:["mix"],kotlin:["gradle"],deno:["deno"],bun:["bun"]},fe={python:["pyproject.toml","requirements.txt","requirements.in"],node:["package.json"],go:["go.mod"],java:["pom.xml","build.gradle","build.gradle.kts"],dotnet:["*.csproj","*.sln"],php:["composer.json"],ruby:["Gemfile"],rust:["Cargo.toml"],elixir:["mix.exs"],kotlin:["settings.gradle.kts"],deno:["deno.json","deno.jsonc"],bun:["package.json","bunfig.toml"]};function x(e,t){let n=g$1({runtime:typeof e?.runtime=="string"?e.runtime:void 0,framework:typeof e?.framework=="string"?e.framework:void 0,kitName:typeof e?.kit_name=="string"?e.kit_name:typeof e?.kit=="string"?e.kit:void 0});return n.runtime!=="unknown"?n.runtime:i(t,e).runtime}function z(e){let t=e;for(;;){let n=a.join(t,".rapidkit","project.json");if(E.existsSync(n))try{return JSON.parse(E.readFileSync(n,"utf8"))}catch{return null}let r=a.dirname(t);if(r===t)break;t=r;}return null}function Ye(e,t){return x(e,t)==="go"}function He(e,t){return x(e,t)==="node"}function Ve(e,t){return x(e,t)==="java"}function Xe(e,t){return x(e,t)==="dotnet"}function ze(e,t){return x(e,t)==="python"}function ye(e){let t=a.join(e,".rapidkit","context.json");if(!E.existsSync(t))return null;try{return JSON.parse(E.readFileSync(t,"utf8"))}catch{return null}}function ge(e){let t=e?.engine;return t==="npm"||t==="pip"||t==="python"?t:"unknown"}function Ce(e,t){if(e?.module_support===false||t?.module_support===false||!e&&t)return false;let n=typeof e?.kit_name=="string"?e.kit_name:typeof e?.kit=="string"?e.kit:typeof t?.kit=="string"?t.kit:void 0,r=n?a$2(n):void 0;return r?.owner==="core"&&r.moduleSupport===true}function be(e,t,n){let r=g$1({runtime:typeof t?.runtime=="string"?t.runtime:typeof n?.runtime=="string"?n.runtime:void 0,framework:typeof t?.framework=="string"?t.framework:typeof n?.framework=="string"?n.framework:void 0,kitName:typeof t?.kit_name=="string"?t.kit_name:typeof t?.kit=="string"?t.kit:typeof n?.kit=="string"?n.kit:void 0});return r.key!=="unknown"?r:i(e,t)}function Q(e){let t=a.resolve(e),n=a.join(t,".rapidkit","project.json"),r=a.join(t,".rapidkit","context.json");if(!E.existsSync(n)&&!E.existsSync(r))return null;let i=z(t),m=ye(t),k=be(t,i,m);return {projectRoot:t,projectJson:i,contextJson:m,detection:k,moduleSupport:Ce(i,m),engine:ge(m)}}var ke=["build","dev","start","test","lint","format"],L=["init","test","build","start"],st=["lint","format","docs"];function mt(e){return !!e&&ke.includes(e)}var Se={dev:["dev","start:dev"],start:["start","start:prod","preview"],build:["build"],test:["test","test:unit","test:ci"],lint:["lint"],format:["format","prettier"]},ee={nestjs:{dev:["dev","start:dev"],start:["start","start:prod"],build:["build"],test:["test","test:e2e"],lint:["lint"],format:["format"]},express:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},fastify:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},koa:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]}};function xe(e){let t=a.join(e,"package.json");if(!E.existsSync(t))return {};try{let r=JSON.parse(E.readFileSync(t,"utf8")).scripts??{};return Object.fromEntries(Object.entries(r).filter(i=>typeof i[1]=="string"))}catch{return {}}}function je(e,t){let n=t?c(t):"unknown",r=n!=="unknown"?a$1(n,e):[],i=t?ee[t]?.[e]??[]:[],m=Se[e]??[],k=[...r,...i,...m];return [...new Set(k)]}function te(e,t,n){let r=xe(e),i=new Set(Object.keys(r));if(i.has(t))return {scriptName:t,source:"package.json"};for(let m of je(t,n?.framework))if(i.has(m))return {scriptName:m,source:a$1(c(n?.framework??"unknown"),t).includes(m)||ee[n?.framework??""]?.[t]?.includes(m)?"framework-candidate":"generic-candidate"};return null}function O(e){return E.existsSync(a.join(e,"package.json"))}function ne(e){let t=H(e);return t.runtime==="unknown"&&e!=="unknown"?null:{runtime:t.runtime,displayName:t.displayName,supportedCommands:t.lifecycleCommands,packageManagers:t.packageManagers,primaryFiles:t.primaryFiles,notes:t.notes,hasExecutor:t.hasExecutor}}function s(e){try{return E.existsSync(e)}catch{return false}}function p(e){try{return s(e)?E.readFileSync(e,"utf8"):""}catch{return ""}}function u(e,t){let n=p(a.join(e,"Makefile"));return n?new RegExp(`^${t}\\s*:`).test(n):false}function Re(e){let t=[e];for(;t.length>0;){let n=t.shift();if(!n)break;let r=[];try{r=E.readdirSync(n,{withFileTypes:true});}catch{continue}for(let i of r){if(i.name==="node_modules"||i.name===".git"||i.name==="dist")continue;let m=a.join(n,i.name);if(i.isFile()&&i.name.endsWith(".csproj"))return true;i.isDirectory()&&t.push(m);}}return false}function re(e,t){let n=s(a.join(e,"pyproject.toml")),r=s(a.join(e,"requirements.txt"))||s(a.join(e,"requirements.in")),i=s(a.join(e,"manage.py"));switch(t){case "init":return n||r;case "dev":case "start":return n||i||r;case "test":return n||r||s(a.join(e,"tests"));case "build":return n||r;case "lint":case "format":return n||r||i||s(a.join(e,"setup.py"))||s(a.join(e,"setup.cfg"));default:return false}}function he(e,t){if(!s(a.join(e,"go.mod")))return false;switch(t){case "init":return true;case "dev":return u(e,"run")||s(a.join(e,"main.go"));case "test":return true;case "build":return true;case "start":return u(e,"run")||s(a.join(e,"main.go"))||s(a.join(e,"cmd"));case "lint":return s(a.join(e,".golangci.yml"))||s(a.join(e,".golangci.yaml"))||u(e,"lint");case "format":return u(e,"fmt")||u(e,"format");default:return false}}function Ne(e,t){let n=s(a.join(e,"pom.xml")),r=s(a.join(e,"build.gradle"))||s(a.join(e,"build.gradle.kts"));if(!n&&!r)return false;switch(t){case "init":case "test":case "build":case "dev":case "start":return true;case "lint":return u(e,"lint")||p(a.join(e,"pom.xml")).includes("checkstyle")||p(a.join(e,"build.gradle")).includes("checkstyle")||p(a.join(e,"build.gradle.kts")).includes("checkstyle");case "format":return u(e,"format")||p(a.join(e,"build.gradle")).includes("spotless")||p(a.join(e,"build.gradle.kts")).includes("spotless");default:return false}}function ve(e,t){if(!Re(e))return false;switch(t){case "init":case "dev":case "test":case "build":case "start":return true;case "lint":return u(e,"lint")||p(a.join(e,"Directory.Build.props")).includes("EnforceCodeStyleInBuild");case "format":return u(e,"format")||s(a.join(e,".editorconfig"));default:return false}}function Ee(e,t,n){return t==="init"?O(e):te(e,t,{framework:n})!==null}function Pe(e,t,n){switch(t){case "php":return n==="init"&&s(a.join(e,"composer.json"));case "ruby":return n==="init"&&s(a.join(e,"Gemfile"));case "rust":return s(a.join(e,"Cargo.toml"))?n==="init"||n==="test"||n==="build"||n==="start":false;case "elixir":return n==="init"&&s(a.join(e,"mix.exs"));case "deno":return s(a.join(e,"deno.json"))||s(a.join(e,"deno.jsonc"))?n==="init"||n==="dev"||n==="test"||n==="start":n==="init"&&s(a.join(e,"package.json"));case "bun":return s(a.join(e,"bunfig.toml"))||s(a.join(e,"bun.lock"))?n==="init"||n==="dev"||n==="test"||n==="build"||n==="start":n==="init"&&s(a.join(e,"package.json"));default:return false}}function P(e,t,n,r){if(N(t,n))return re(e,n);if(!C(t))return Pe(e,t,n);switch(t){case "node":return Ee(e,n,r);case "python":return re(e,n);case "go":return he(e,n);case "java":return Ne(e,n);case "dotnet":return ve(e,n);default:return false}}function we(e,t,n){return ["init","dev","start","build","test","lint","format"].filter(i=>P(e,t,i,n))}function oe(e){let t=Y({runtime:e.runtime,moduleSupport:e.moduleSupport});if(!e.projectPath)return t;let n=we(e.projectPath,e.runtime,e.framework),r=new Set(["help"]);for(let m of n)t.lifecycleCommands.includes(m)&&r.add(m);e.runtime==="node"&&O(e.projectPath)&&r.add("init");let i=[...r].sort();return {lifecycleCommands:i,moduleCommands:t.moduleCommands,unsupportedLifecycleCommands:t.lifecycleCommands.filter(m=>!i.includes(m)).sort()}}var T=["version","commands","doctor","project","help"],w=["init","dev","start","build","test","lint","format"],B=["add","modules","upgrade","diff","merge","reconcile","rollback","uninstall","checkpoint","snapshot","optimize"],I=["create","list","info","frameworks","license"];T.filter(e=>e!=="help");function Me(e){let t=a.resolve(e);for(;;){let n=a.join(t,".rapidkit"),r=a.join(n,"project.json"),i=a.join(n,"context.json");if(E.existsSync(r)||E.existsSync(i))return t;let m=a.dirname(t);if(m===t)break;t=m;}return null}function j(e,t){return {command:e,...t}}var _e=new Set(["dev","lint","format"]),Ae=new Set(L);function Le(e,t){return t?Ae.has(e)?{executionScope:"fleet",fleetEligible:true}:_e.has(e)?{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}}function Fe(e,t){return N(t.runtime,e)?"core":"runtime"}function Oe(e,t,n,r){return !e||!r.lifecycleCommands.includes(t)?false:P(e,n.runtime,t,n.key)}function De(e,t){let n=!!e&&(t.runtime==="python"||C(t.runtime)&&P(e,t.runtime,"build",t.key));return j("docs",{owner:t.runtime==="python"?"core":"runtime",status:n?"supported":"unsupported",reason:n?t.runtime==="python"?"Documentation generation is delegated to Python Core for this project.":"Project documentation commands are available through the npm wrapper for this runtime.":"Documentation commands require a supported Python or npm-executor project manifest."})}function Te(e){let t=a.resolve(e),n=Me(e);return n||(h(t).length>0?t:null)}function Be(e=process.cwd()){let t=Te(e),n=t?Q(t):null,r=n?.detection??i(e,n?.projectJson??null),i$1=n?.moduleSupport??false,m=n?.engine??"unknown",k=ne(r.runtime),U=S(r.runtime),se=oe({runtime:r.runtime,moduleSupport:i$1,projectPath:t??void 0,framework:r.key}),d={};for(let o of T)d[o]=j(o,{owner:o==="project"?"core":"npm",status:"supported",reason:o==="project"?"Project detection is a Core contract; workspace project lifecycle remains npm-owned.":o==="help"?"Help is available for every RapidKit project through the npm CLI.":"Universal command available across RapidKit project types."});for(let o of w){let f=Oe(t,o,r,se),G=Fe(o,r),M=Le(o,f);d[o]=j(o,{owner:G,status:f?"supported":"unsupported",executionScope:M.executionScope,fleetEligible:M.fleetEligible,reason:f?G==="core"?`Delegated to Python Core for ${r.displayName} projects.`:M.fleetEligible?`Handled by runtime adapter and eligible for workspace fleet stages (${o}).`:o==="dev"?"Local development command only; workspace fleet excludes dev by design.":r.runtime==="node"?`Handled by npm/pnpm/yarn via the resolved ${o} script in package.json.`:`Handled by the ${k?.displayName??r.displayName} runtime adapter for local project execution.`:t?r.runtime==="node"?`No ${o} script was found in package.json for this ${r.displayName} project.`:C(r.runtime)?`The ${r.displayName} runtime is tracked, but ${o} is not available from detected project manifests.`:`${r.displayName} is tracked as an observed runtime; ${o} requires project manifests or explicit scripts.`:"No RapidKit project was detected."});}d.docs=De(t,r);for(let o of B)d[o]=j(o,{owner:i$1?"core":"none",status:i$1?"supported":"unsupported",reason:i$1?"Core module/template command supported for this project.":`Core module/template commands are not available for ${r.displayName} projects.`});for(let o of I)d[o]=j(o,{owner:o==="create"?"npm":"core",status:"global",reason:o==="create"?"Create is orchestrated by npm for multi-language workspace support.":"Engine catalog command; not specific to the selected project runtime."});let R=Object.values(d),K=R.filter(o=>w.includes(o.command)).filter(o=>o.status==="supported"),me=L.filter(o=>K.some(f=>f.fleetEligible===true&&f.command===o)),ue=K.filter(o=>o.executionScope==="local-only").map(o=>o.command).sort();return {schemaVersion:1,scope:"project",projectRoot:t,engine:m,runtime:r.runtime,framework:r.key,frameworkDisplayName:r.displayName,frameworkConfidence:r.confidence,frameworkSupportTier:q(r.key),runtimeSupportTier:U.tier,runtimeDoctorSupport:U.doctorSupport,moduleSupport:i$1,fleetStages:me,localOnlyCommands:ue,commandMap:d,supportedCommands:R.filter(o=>o.status==="supported").map(o=>o.command).sort(),unsupportedCommands:R.filter(o=>o.status==="unsupported").map(o=>o.command).sort(),globalCommands:R.filter(o=>o.status==="global").map(o=>o.command).sort()}}function Kt(e,t=process.cwd()){let n=e[0];return n?Be(t).commandMap[n]??null:null}function Gt(e){if(e[0]==="project"&&e[1]==="commands")return true;if(e[0]==="commands"&&e.includes("--scope")){let t=e.indexOf("--scope");return e[t+1]==="project"}return e.some(t=>t==="--scope=project")&&e[0]==="commands"}function Jt(e,t){return [`RapidKit command not supported for this project: ${e.command}`,"",`Project: ${t.projectRoot??"not detected"}`,`Runtime: ${t.runtime}`,`Framework: ${t.frameworkDisplayName}`,`Reason: ${e.reason??"Unsupported for this project type."}`,"","Run `rapidkit project commands` to inspect supported commands for this project."].join(`
|
|
1
|
+
import {a as a$1,c,i,g as g$1,h}from'./chunk-4KUIFXHM.js';import {a as a$2}from'./chunk-DMITBXR2.js';import E from'fs';import a from'path';var g=["init","dev","start","build","test","lint","format","help"],W={python:{runtime:"python",displayName:"Python",tier:"first-class",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:true,doctorSupport:"full",notes:["Core-backed Python projects support RapidKit modules and lifecycle commands."]},node:{runtime:"node",displayName:"Node.js",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:true,doctorSupport:"full",notes:["Node projects support npm-owned lifecycle commands; NestJS is the first-class Node framework."]},go:{runtime:"go",displayName:"Go",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:false,doctorSupport:"readiness",notes:["Go projects support workspace governance and lifecycle commands via Go tooling."]},java:{runtime:"java",displayName:"Java / Spring Boot",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:false,doctorSupport:"readiness",notes:["Java projects support Maven/Gradle lifecycle commands and workspace governance."]},dotnet:{runtime:"dotnet",displayName:".NET / ASP.NET Core",tier:"extended",scaffoldSupport:true,importSupport:true,lifecycleCommands:g,moduleCommands:false,doctorSupport:"readiness",notes:[".NET projects support dotnet CLI lifecycle commands and workspace governance."]},php:{runtime:"php",displayName:"PHP",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["PHP projects are importable and governed as observed projects until a kit exists."]},ruby:{runtime:"ruby",displayName:"Ruby",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Ruby projects are importable and governed as observed projects until a kit exists."]},rust:{runtime:"rust",displayName:"Rust",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Rust projects are importable and governed as observed projects until a kit exists."]},elixir:{runtime:"elixir",displayName:"Elixir",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Elixir projects are importable and governed as observed projects until a kit exists."]},clojure:{runtime:"clojure",displayName:"Clojure",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Clojure projects are importable and governed as observed projects until a kit exists."]},scala:{runtime:"scala",displayName:"Scala",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Scala projects are importable and governed as observed projects until a kit exists."]},kotlin:{runtime:"kotlin",displayName:"Kotlin",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Kotlin projects are importable and governed as observed projects until a kit exists."]},deno:{runtime:"deno",displayName:"Deno",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Deno projects are importable and governed as observed projects until a kit exists."]},bun:{runtime:"bun",displayName:"Bun",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Bun projects are importable and governed as observed projects until a kit exists."]},unknown:{runtime:"unknown",displayName:"Unknown",tier:"observed",scaffoldSupport:false,importSupport:true,lifecycleCommands:["help"],moduleCommands:false,doctorSupport:"observed",notes:["Unknown projects are tracked safely but require manual command configuration."]}},ce=["fastapi","nestjs"],le=["django","flask","nextjs","remix","nuxt","react","vite","vue","sveltekit","svelte","angular","astro","solid","express","fastify","koa","echo","gofiber","gogin","springboot","dotnet","laravel","symfony","rails","sinatra","actix","axum","rocket","phoenix","clojure","scala","kotlin","deno","bun"];function S(e){return W[e||"unknown"]??W.unknown}function q(e){return ce.includes(e)?"first-class":le.includes(e)?"extended":"observed"}function Y(e){let t=S(e.runtime);return {lifecycleCommands:t.lifecycleCommands,moduleCommands:e.moduleSupport&&t.moduleCommands,unsupportedLifecycleCommands:g.filter(n=>!t.lifecycleCommands.includes(n))}}var de=["python","node","go","java","dotnet"];function C(e){return !!e&&de.includes(e)}function N(e,t){return t!=="lint"&&t!=="format"&&t!=="docs"?false:e==="python"}function H(e){let t=S(e),n=C(t.runtime),r=pe[t.runtime]??[],i=fe[t.runtime]??[];return {runtime:t.runtime,displayName:t.displayName,lifecycleCommands:t.lifecycleCommands,hasExecutor:n,packageManagers:r,primaryFiles:i,notes:t.notes}}var pe={python:["poetry","pip","uv"],node:["npm","pnpm","yarn","bun"],go:["go"],java:["maven","gradle"],dotnet:["dotnet"],php:["composer"],ruby:["bundle"],rust:["cargo"],elixir:["mix"],kotlin:["gradle"],deno:["deno"],bun:["bun"]},fe={python:["pyproject.toml","requirements.txt","requirements.in"],node:["package.json"],go:["go.mod"],java:["pom.xml","build.gradle","build.gradle.kts"],dotnet:["*.csproj","*.sln"],php:["composer.json"],ruby:["Gemfile"],rust:["Cargo.toml"],elixir:["mix.exs"],kotlin:["settings.gradle.kts"],deno:["deno.json","deno.jsonc"],bun:["package.json","bunfig.toml"]};function x(e,t){let n=g$1({runtime:typeof e?.runtime=="string"?e.runtime:void 0,framework:typeof e?.framework=="string"?e.framework:void 0,kitName:typeof e?.kit_name=="string"?e.kit_name:typeof e?.kit=="string"?e.kit:void 0});return n.runtime!=="unknown"?n.runtime:i(t,e).runtime}function z(e){let t=e;for(;;){let n=a.join(t,".rapidkit","project.json");if(E.existsSync(n))try{return JSON.parse(E.readFileSync(n,"utf8"))}catch{return null}let r=a.dirname(t);if(r===t)break;t=r;}return null}function Ye(e,t){return x(e,t)==="go"}function He(e,t){return x(e,t)==="node"}function Ve(e,t){return x(e,t)==="java"}function Xe(e,t){return x(e,t)==="dotnet"}function ze(e,t){return x(e,t)==="python"}function ye(e){let t=a.join(e,".rapidkit","context.json");if(!E.existsSync(t))return null;try{return JSON.parse(E.readFileSync(t,"utf8"))}catch{return null}}function ge(e){let t=e?.engine;return t==="npm"||t==="pip"||t==="python"?t:"unknown"}function Ce(e,t){if(e?.module_support===false||t?.module_support===false||!e&&t)return false;let n=typeof e?.kit_name=="string"?e.kit_name:typeof e?.kit=="string"?e.kit:typeof t?.kit=="string"?t.kit:void 0,r=n?a$2(n):void 0;return r?.owner==="core"&&r.moduleSupport===true}function be(e,t,n){let r=g$1({runtime:typeof t?.runtime=="string"?t.runtime:typeof n?.runtime=="string"?n.runtime:void 0,framework:typeof t?.framework=="string"?t.framework:typeof n?.framework=="string"?n.framework:void 0,kitName:typeof t?.kit_name=="string"?t.kit_name:typeof t?.kit=="string"?t.kit:typeof n?.kit=="string"?n.kit:void 0});return r.key!=="unknown"?r:i(e,t)}function Q(e){let t=a.resolve(e),n=a.join(t,".rapidkit","project.json"),r=a.join(t,".rapidkit","context.json");if(!E.existsSync(n)&&!E.existsSync(r))return null;let i=z(t),m=ye(t),k=be(t,i,m);return {projectRoot:t,projectJson:i,contextJson:m,detection:k,moduleSupport:Ce(i,m),engine:ge(m)}}var ke=["build","dev","start","test","lint","format"],L=["init","test","build","start"],st=["lint","format","docs"];function mt(e){return !!e&&ke.includes(e)}var Se={dev:["dev","start:dev"],start:["start","start:prod","preview"],build:["build"],test:["test","test:unit","test:ci"],lint:["lint"],format:["format","prettier"]},ee={nestjs:{dev:["dev","start:dev"],start:["start","start:prod"],build:["build"],test:["test","test:e2e"],lint:["lint"],format:["format"]},express:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},fastify:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]},koa:{dev:["dev","start:dev"],start:["start"],build:["build"],test:["test"],lint:["lint"],format:["format"]}};function xe(e){let t=a.join(e,"package.json");if(!E.existsSync(t))return {};try{let r=JSON.parse(E.readFileSync(t,"utf8")).scripts??{};return Object.fromEntries(Object.entries(r).filter(i=>typeof i[1]=="string"))}catch{return {}}}function je(e,t){let n=t?c(t):"unknown",r=n!=="unknown"?a$1(n,e):[],i=t?ee[t]?.[e]??[]:[],m=Se[e]??[],k=[...r,...i,...m];return [...new Set(k)]}function te(e,t,n){let r=xe(e),i=new Set(Object.keys(r));if(i.has(t))return {scriptName:t,source:"package.json"};for(let m of je(t,n?.framework))if(i.has(m))return {scriptName:m,source:a$1(c(n?.framework??"unknown"),t).includes(m)||ee[n?.framework??""]?.[t]?.includes(m)?"framework-candidate":"generic-candidate"};return null}function O(e){return E.existsSync(a.join(e,"package.json"))}function ne(e){let t=H(e);return t.runtime==="unknown"&&e!=="unknown"?null:{runtime:t.runtime,displayName:t.displayName,supportedCommands:t.lifecycleCommands,packageManagers:t.packageManagers,primaryFiles:t.primaryFiles,notes:t.notes,hasExecutor:t.hasExecutor}}function s(e){try{return E.existsSync(e)}catch{return false}}function p(e){try{return s(e)?E.readFileSync(e,"utf8"):""}catch{return ""}}function u(e,t){let n=p(a.join(e,"Makefile"));return n?new RegExp(`^${t}\\s*:`).test(n):false}function Re(e){let t=[e];for(;t.length>0;){let n=t.shift();if(!n)break;let r=[];try{r=E.readdirSync(n,{withFileTypes:true});}catch{continue}for(let i of r){if(i.name==="node_modules"||i.name===".git"||i.name==="dist")continue;let m=a.join(n,i.name);if(i.isFile()&&i.name.endsWith(".csproj"))return true;i.isDirectory()&&t.push(m);}}return false}function re(e,t){let n=s(a.join(e,"pyproject.toml")),r=s(a.join(e,"requirements.txt"))||s(a.join(e,"requirements.in")),i=s(a.join(e,"manage.py"));switch(t){case "init":return n||r;case "dev":case "start":return n||i||r;case "test":return n||r||s(a.join(e,"tests"));case "build":return n||r;case "lint":case "format":return n||r||i||s(a.join(e,"setup.py"))||s(a.join(e,"setup.cfg"));default:return false}}function he(e,t){if(!s(a.join(e,"go.mod")))return false;switch(t){case "init":return true;case "dev":return u(e,"run")||s(a.join(e,"main.go"));case "test":return true;case "build":return true;case "start":return u(e,"run")||s(a.join(e,"main.go"))||s(a.join(e,"cmd"));case "lint":return s(a.join(e,".golangci.yml"))||s(a.join(e,".golangci.yaml"))||u(e,"lint");case "format":return u(e,"fmt")||u(e,"format");default:return false}}function Ne(e,t){let n=s(a.join(e,"pom.xml")),r=s(a.join(e,"build.gradle"))||s(a.join(e,"build.gradle.kts"));if(!n&&!r)return false;switch(t){case "init":case "test":case "build":case "dev":case "start":return true;case "lint":return u(e,"lint")||p(a.join(e,"pom.xml")).includes("checkstyle")||p(a.join(e,"build.gradle")).includes("checkstyle")||p(a.join(e,"build.gradle.kts")).includes("checkstyle");case "format":return u(e,"format")||p(a.join(e,"build.gradle")).includes("spotless")||p(a.join(e,"build.gradle.kts")).includes("spotless");default:return false}}function ve(e,t){if(!Re(e))return false;switch(t){case "init":case "dev":case "test":case "build":case "start":return true;case "lint":return u(e,"lint")||p(a.join(e,"Directory.Build.props")).includes("EnforceCodeStyleInBuild");case "format":return u(e,"format")||s(a.join(e,".editorconfig"));default:return false}}function Ee(e,t,n){return t==="init"?O(e):te(e,t,{framework:n})!==null}function Pe(e,t,n){switch(t){case "php":return n==="init"&&s(a.join(e,"composer.json"));case "ruby":return n==="init"&&s(a.join(e,"Gemfile"));case "rust":return s(a.join(e,"Cargo.toml"))?n==="init"||n==="test"||n==="build"||n==="start":false;case "elixir":return n==="init"&&s(a.join(e,"mix.exs"));case "deno":return s(a.join(e,"deno.json"))||s(a.join(e,"deno.jsonc"))?n==="init"||n==="dev"||n==="test"||n==="start":n==="init"&&s(a.join(e,"package.json"));case "bun":return s(a.join(e,"bunfig.toml"))||s(a.join(e,"bun.lock"))?n==="init"||n==="dev"||n==="test"||n==="build"||n==="start":n==="init"&&s(a.join(e,"package.json"));default:return false}}function P(e,t,n,r){if(N(t,n))return re(e,n);if(!C(t))return Pe(e,t,n);switch(t){case "node":return Ee(e,n,r);case "python":return re(e,n);case "go":return he(e,n);case "java":return Ne(e,n);case "dotnet":return ve(e,n);default:return false}}function we(e,t,n){return ["init","dev","start","build","test","lint","format"].filter(i=>P(e,t,i,n))}function oe(e){let t=Y({runtime:e.runtime,moduleSupport:e.moduleSupport});if(!e.projectPath)return t;let n=we(e.projectPath,e.runtime,e.framework),r=new Set(["help"]);for(let m of n)t.lifecycleCommands.includes(m)&&r.add(m);e.runtime==="node"&&O(e.projectPath)&&r.add("init");let i=[...r].sort();return {lifecycleCommands:i,moduleCommands:t.moduleCommands,unsupportedLifecycleCommands:t.lifecycleCommands.filter(m=>!i.includes(m)).sort()}}var T=["version","commands","doctor","project","help"],w=["init","dev","start","build","test","lint","format"],B=["add","modules","upgrade","diff","merge","reconcile","rollback","uninstall","checkpoint","snapshot","optimize"],I=["create","list","info","frameworks","license"];T.filter(e=>e!=="help");function Me(e){let t=a.resolve(e);for(;;){let n=a.join(t,".rapidkit"),r=a.join(n,"project.json"),i=a.join(n,"context.json");if(E.existsSync(r)||E.existsSync(i))return t;let m=a.dirname(t);if(m===t)break;t=m;}return null}function j(e,t){return {command:e,...t}}var _e=new Set(["dev","lint","format"]),Ae=new Set(L);function Le(e,t){return t?Ae.has(e)?{executionScope:"fleet",fleetEligible:true}:_e.has(e)?{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}:{executionScope:"local-only",fleetEligible:false}}function Fe(e,t){return N(t.runtime,e)?"core":"runtime"}function Oe(e,t,n,r){return !e||!r.lifecycleCommands.includes(t)?false:P(e,n.runtime,t,n.key)}function De(e,t){let n=!!e&&(t.runtime==="python"||C(t.runtime)&&P(e,t.runtime,"build",t.key));return j("docs",{owner:t.runtime==="python"?"core":"runtime",status:n?"supported":"unsupported",reason:n?t.runtime==="python"?"Documentation generation is delegated to Python Core for this project.":"Project documentation commands are available through the npm wrapper for this runtime.":"Documentation commands require a supported Python or npm-executor project manifest."})}function Te(e){let t=a.resolve(e),n=Me(e);return n||(h(t).length>0?t:null)}function Be(e=process.cwd()){let t=Te(e),n=t?Q(t):null,r=n?.detection??i(e,n?.projectJson??null),i$1=n?.moduleSupport??false,m=n?.engine??"unknown",k=ne(r.runtime),U=S(r.runtime),se=oe({runtime:r.runtime,moduleSupport:i$1,projectPath:t??void 0,framework:r.key}),d={};for(let o of T)d[o]=j(o,{owner:o==="project"?"core":"npm",status:"supported",reason:o==="project"?"Project detection is a Core contract; workspace project lifecycle remains npm-owned.":o==="help"?"Help is available for every RapidKit project through the npm CLI.":"Universal command available across RapidKit project types."});for(let o of w){let f=Oe(t,o,r,se),G=Fe(o,r),M=Le(o,f);d[o]=j(o,{owner:G,status:f?"supported":"unsupported",executionScope:M.executionScope,fleetEligible:M.fleetEligible,reason:f?G==="core"?`Delegated to Python Core for ${r.displayName} projects.`:M.fleetEligible?`Handled by runtime adapter and eligible for workspace fleet stages (${o}).`:o==="dev"?"Local development command only; workspace fleet excludes dev by design.":r.runtime==="node"?`Handled by npm/pnpm/yarn via the resolved ${o} script in package.json.`:`Handled by the ${k?.displayName??r.displayName} runtime adapter for local project execution.`:t?r.runtime==="node"?`No ${o} script was found in package.json for this ${r.displayName} project.`:C(r.runtime)?`The ${r.displayName} runtime is tracked, but ${o} is not available from detected project manifests.`:`${r.displayName} is tracked as an observed runtime; ${o} requires project manifests or explicit scripts.`:"No RapidKit project was detected."});}d.docs=De(t,r);for(let o of B)d[o]=j(o,{owner:i$1?"core":"none",status:i$1?"supported":"unsupported",reason:i$1?"Core module/template command supported for this project.":`Core module/template commands are not available for ${r.displayName} projects.`});for(let o of I)d[o]=j(o,{owner:o==="create"?"npm":"core",status:"global",reason:o==="create"?"Create is orchestrated by npm for multi-language workspace support.":"Engine catalog command; not specific to the selected project runtime."});let R=Object.values(d),K=R.filter(o=>w.includes(o.command)).filter(o=>o.status==="supported"),me=L.filter(o=>K.some(f=>f.fleetEligible===true&&f.command===o)),ue=K.filter(o=>o.executionScope==="local-only").map(o=>o.command).sort();return {schemaVersion:1,scope:"project",projectRoot:t,engine:m,runtime:r.runtime,framework:r.key,frameworkDisplayName:r.displayName,frameworkConfidence:r.confidence,frameworkSupportTier:q(r.key),runtimeSupportTier:U.tier,runtimeDoctorSupport:U.doctorSupport,moduleSupport:i$1,fleetStages:me,localOnlyCommands:ue,commandMap:d,supportedCommands:R.filter(o=>o.status==="supported").map(o=>o.command).sort(),unsupportedCommands:R.filter(o=>o.status==="unsupported").map(o=>o.command).sort(),globalCommands:R.filter(o=>o.status==="global").map(o=>o.command).sort()}}function Kt(e,t=process.cwd()){let n=e[0];return n?Be(t).commandMap[n]??null:null}function Gt(e){if(e[0]==="project"&&e[1]==="commands")return true;if(e[0]==="commands"&&e.includes("--scope")){let t=e.indexOf("--scope");return e[t+1]==="project"}return e.some(t=>t==="--scope=project")&&e[0]==="commands"}function Jt(e,t){return [`RapidKit command not supported for this project: ${e.command}`,"",`Project: ${t.projectRoot??"not detected"}`,`Runtime: ${t.runtime}`,`Framework: ${t.frameworkDisplayName}`,`Reason: ${e.reason??"Unsupported for this project type."}`,"","Run `rapidkit project commands` to inspect supported commands for this project."].join(`
|
|
2
2
|
`)}export{S as a,q as b,C as c,z as d,Ye as e,He as f,Ve as g,Xe as h,ze as i,Q as j,ke as k,st as l,mt as m,te as n,oe as o,Me as p,Be as q,Kt as r,Gt as s,Jt as t};
|