workspai 0.60.0 → 0.61.0
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 +90 -33
- package/contracts/analyze-last-run.v1.json +7 -1
- package/contracts/extension-cli-compatibility.v1.json +1 -1
- package/contracts/studio-card-repair-capabilities.v1.json +1 -1
- package/contracts/workspace-intelligence/goal-index.v1.json +24 -0
- package/contracts/workspace-intelligence/goal-lifecycle-result.v1.json +25 -1
- package/contracts/workspace-intelligence/workspace-repair-transaction.v1.json +1 -0
- package/dist/analyze-K6JDMF5C.js +1 -0
- package/dist/autopilot-release-7Q5JT7YN.js +1 -0
- package/dist/{chunk-WJ7MZB3I.js → chunk-2FPANIX3.js} +1 -1
- package/dist/{chunk-WLFJHRB3.js → chunk-2JVRDBJC.js} +1 -1
- package/dist/{chunk-KPEVYWOC.js → chunk-4KNDIFJ5.js} +1 -1
- package/dist/{chunk-7COD67YY.js → chunk-5YNZR74I.js} +1 -1
- package/dist/chunk-ASOFWN6J.js +1 -0
- package/dist/{chunk-S4CWUZ4K.js → chunk-BQCGULHR.js} +1 -1
- package/dist/{chunk-FUCFNB3P.js → chunk-GWMC6SSY.js} +1 -1
- package/dist/{chunk-AHKXQRLX.js → chunk-JEGG4EEZ.js} +1 -1
- package/dist/chunk-JRIEP4BY.js +2 -0
- package/dist/{chunk-KKAGBP4T.js → chunk-NJ6WJ7VU.js} +1 -1
- package/dist/chunk-RALI2ESF.js +49 -0
- package/dist/chunk-VRQLHCE2.js +8 -0
- package/dist/chunk-YGONW6VG.js +1 -0
- package/dist/{chunk-XZ55OA4C.js → chunk-ZJ62F4U3.js} +1 -1
- package/dist/{create-IRNHMUEN.js → create-TPUFKW6B.js} +1 -1
- package/dist/{goal-lifecycle-VQDUWZVG.js → goal-lifecycle-BNLXDHED.js} +1 -1
- package/dist/{goal-pack-U3ZP7A2A.js → goal-pack-2PF775AU.js} +1 -1
- package/dist/index.js +19 -19
- package/dist/{pipeline-5O36G4ZV.js → pipeline-BY2YL7C6.js} +1 -1
- package/dist/{project-agent-entry-CN4K6JNZ.js → project-agent-entry-VXCOXRJB.js} +1 -1
- package/dist/{project-intelligence-lens-N7REBQ3A.js → project-intelligence-lens-BA6JLXQH.js} +1 -1
- package/dist/{verified-goal-CIYKNDOU.js → verified-goal-5OV4BALK.js} +1 -1
- package/dist/{workspace-UUU4VMZB.js → workspace-J4OGSSNO.js} +1 -1
- package/dist/workspace-agent-sync-MU7W3C4S.js +1 -0
- package/dist/{workspace-context-YAK5XX27.js → workspace-context-MDACPLHD.js} +1 -1
- package/dist/workspace-explain-NWP3JTFR.js +1 -0
- package/dist/{workspace-explain-contract-ZL4NMLZI.js → workspace-explain-contract-JWFM22L4.js} +1 -1
- package/dist/{workspace-foundation-AISQHJA3.js → workspace-foundation-3X5OBEMM.js} +1 -1
- package/dist/{workspace-intelligence-runner-7KCGHRID.js → workspace-intelligence-runner-DEW3CZKA.js} +1 -1
- package/dist/{workspace-mcp-serve-ALIZV72K.js → workspace-mcp-serve-S5IXSJJL.js} +1 -1
- package/dist/{workspace-onboarding-XNBC6H2G.js → workspace-onboarding-LK5IK6LE.js} +1 -1
- package/dist/workspace-repair-engine-3OLRNXD6.js +3 -0
- package/dist/workspace-run-JTEIX4WA.js +1 -0
- package/docs/README.md +16 -14
- package/docs/ci-workflows.md +1 -1
- package/docs/goal-packs.md +10 -6
- package/docs/workspace-repair-engine.md +48 -2
- package/package.json +1 -1
- package/dist/analyze-FYNMI5KT.js +0 -1
- package/dist/autopilot-release-O5PPB6HQ.js +0 -1
- package/dist/chunk-6YFCS2AI.js +0 -1
- package/dist/chunk-7ITSLGPZ.js +0 -8
- package/dist/chunk-KBR4Y4RW.js +0 -1
- package/dist/chunk-OU7DF6MP.js +0 -2
- package/dist/chunk-XXQRHS5I.js +0 -39
- package/dist/workspace-agent-sync-LQNIMGLN.js +0 -1
- package/dist/workspace-explain-QH4FXQW5.js +0 -1
- package/dist/workspace-repair-engine-7WGJWUBN.js +0 -3
- package/dist/workspace-run-I6E6VI6N.js +0 -1
- /package/dist/{chunk-PZLHQEGC.js → chunk-JMFCMPWI.js} +0 -0
package/README.md
CHANGED
|
@@ -3,35 +3,93 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/workspai)
|
|
4
4
|
[](https://www.npmjs.com/package/workspai)
|
|
5
5
|
[](LICENSE)
|
|
6
|
+
[](https://marketplace.visualstudio.com/items?itemName=rapidkit.rapidkit-vscode)
|
|
6
7
|
|
|
7
|
-
## Give your AI agent the system
|
|
8
|
+
## Give your AI agent the system, not just the repository
|
|
8
9
|
|
|
9
|
-
Your coding agent
|
|
10
|
-
session. Workspai builds a current, evidence-backed view of your projects,
|
|
11
|
-
APIs, dependencies, infrastructure, and change boundaries, then gives agents
|
|
12
|
-
the bounded context they need.
|
|
10
|
+
**Your AI coding agent wastes time guessing your project structure. Workspai fixes that.**
|
|
13
11
|
|
|
14
12
|
> One workspace. One truth. Humans and AI aligned.
|
|
15
13
|
|
|
14
|
+
## Workspace Intelligence for software systems
|
|
15
|
+
|
|
16
16
|
```bash
|
|
17
17
|
npx workspai adopt .
|
|
18
18
|
npx workspai workspace intelligence run --for-agent generic
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
Two commands. Your project becomes a fully understood workspace:
|
|
22
|
+
|
|
23
|
+
### Before vs After
|
|
24
|
+
|
|
25
|
+
| Before Workspai | After Workspai |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| Agent scans thousands of files for context | Agent reads one bounded context document |
|
|
28
|
+
| No dependency map between services | Searchable graph with source-level proof |
|
|
29
|
+
| Broken test blocks release, no one knows why | Doctor names the failing project and fix path |
|
|
30
|
+
| Every AI session starts from scratch | Sessions resume from durable evidence |
|
|
31
|
+
|
|
32
|
+
Here is what you get:
|
|
33
|
+
|
|
34
|
+
| What it produces | Why it matters |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| **Workspace Model** | A canonical inventory of every project, runtime, framework, and dependency |
|
|
37
|
+
| **Knowledge Graph** | Searchable relationships between projects, backed by source-level proof |
|
|
38
|
+
| **Health & Readiness** | Doctor checks, verification gates, and release posture based on evidence, not guesses |
|
|
39
|
+
| **Agent Context** | Bounded, focused instructions so AI tools read what they need, not the entire repo |
|
|
40
|
+
| **Agent Rules** | Ready-to-use grounding for Cursor, Copilot, Claude, Codex, Gemini, and more |
|
|
41
|
+
| **Agent Skills** | Dynamic, project-aware operational skills (diagnose, repair, release) generated from real workspace state |
|
|
42
|
+
| **MCP Server** | 14 read-oriented tools so MCP clients can query evidence, graph, blockers, and context live |
|
|
43
|
+
|
|
21
44
|
`generic` is the safe default when you do not yet know which agent will use the
|
|
22
45
|
project: Workspai builds one portable context and prepares discovery adapters
|
|
23
46
|
for every supported host, without duplicating the Model or Graph.
|
|
24
47
|
|
|
25
|
-
|
|
48
|
+
### What the output looks like
|
|
49
|
+
|
|
50
|
+
After a single run, `.workspai/` contains everything agents and CI need:
|
|
26
51
|
|
|
27
52
|
```text
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
53
|
+
your-workspace/ # ── Workspace level ──
|
|
54
|
+
├── .workspai/
|
|
55
|
+
│ ├── workspace.json # workspace identity & profile
|
|
56
|
+
│ ├── workspace.contract.json # project registry, ports, APIs
|
|
57
|
+
│ ├── reports/ # intelligence artifacts
|
|
58
|
+
│ │ ├── workspace-model.json # projects, runtimes, deps
|
|
59
|
+
│ │ ├── workspace-knowledge-graph.json # proof-backed relationships
|
|
60
|
+
│ │ ├── workspace-context-agent.json # bounded context for AI agents
|
|
61
|
+
│ │ ├── workspace-skills-index.json # operational skills inventory
|
|
62
|
+
│ │ ├── workspace-verify-last-run.json # pass/fail with evidence
|
|
63
|
+
│ │ ├── INDEX.json # evidence inventory & read order
|
|
64
|
+
│ │ └── ... # impact, doctor, analyze, explain, etc.
|
|
65
|
+
│ └── skills/ # generated operational skills
|
|
66
|
+
│ └── workspai-*.md # diagnose, upgrade, release, etc.
|
|
67
|
+
│
|
|
68
|
+
│ # Workspace-level agent grounding (per host):
|
|
69
|
+
├── AGENTS.md · CLAUDE.md · GEMINI.md · QWEN.md
|
|
70
|
+
├── .cursor/rules/workspai-*.mdc # 5 rules + skill
|
|
71
|
+
├── .claude/rules/workspai-*.md # workspace + evidence
|
|
72
|
+
├── .grok/rules/ · .windsurf/rules/ # grounding + evidence
|
|
73
|
+
├── .amazonq/rules/ · .github/ # Copilot, prompts, agents, skills
|
|
74
|
+
│
|
|
75
|
+
│ # ── Project level (repeated per project) ──
|
|
76
|
+
├── nova-api/
|
|
77
|
+
│ ├── .workspai/
|
|
78
|
+
│ │ ├── project.json # project identity & metadata
|
|
79
|
+
│ │ ├── workspace-link.local.json # machine-local workspace binding
|
|
80
|
+
│ │ ├── agent-entry.v1.json # canonical agent entry point
|
|
81
|
+
│ │ ├── PROJECT-GROUNDING.md # project-level grounding
|
|
82
|
+
│ │ └── reports/
|
|
83
|
+
│ │ └── project-context-agent.json # scoped project context
|
|
84
|
+
│ ├── AGENTS.md · CLAUDE.md · GEMINI.md · QWEN.md
|
|
85
|
+
│ └── .amazonq/rules/workspai-agent-entry.md
|
|
86
|
+
│
|
|
87
|
+
└── summit-web/ # (same structure per project)
|
|
32
88
|
```
|
|
33
89
|
|
|
34
|
-
|
|
90
|
+
Your agent reads `workspace-context-agent.json` at the workspace level for system-wide
|
|
91
|
+
awareness, then `agent-entry.v1.json` at the project level for scoped context. Two reads
|
|
92
|
+
instead of scanning thousands of files.
|
|
35
93
|
|
|
36
94
|

|
|
37
95
|
|
|
@@ -40,16 +98,15 @@ Agents bounded context instead of an unfiltered repository dump
|
|
|
40
98
|
[How it works](#how-workspace-intelligence-works) ·
|
|
41
99
|
[Documentation](docs/README.md)
|
|
42
100
|
|
|
43
|
-
##
|
|
101
|
+
## Why Workspai
|
|
44
102
|
|
|
45
103
|
Workspai is an open-source CLI that brings related software projects together,
|
|
46
104
|
so people and AI tools can understand and work with the same system.
|
|
47
105
|
|
|
48
|
-
- **See the system:**
|
|
49
|
-
|
|
50
|
-
- **
|
|
51
|
-
|
|
52
|
-
context for AI tools.
|
|
106
|
+
- **See the whole system:** every project, service, and dependency in one model.
|
|
107
|
+
- **Ask with proof:** trace any answer back to the exact file and line.
|
|
108
|
+
- **Change safely:** know impact before you commit, verify after, and give AI agents
|
|
109
|
+
only the context they need.
|
|
53
110
|
|
|
54
111
|

|
|
55
112
|
|
|
@@ -100,7 +157,7 @@ workspai --help
|
|
|
100
157
|
|
|
101
158
|
`wspai` is an optional short alias for the same CLI.
|
|
102
159
|
|
|
103
|
-
## Give your agent a goal
|
|
160
|
+
## Give your agent a goal, not an open-ended prompt
|
|
104
161
|
|
|
105
162
|
Describe the outcome in plain language from the adopted project:
|
|
106
163
|
|
|
@@ -135,27 +192,26 @@ a machine-readable decision and can use `--scope` and `--runtime`.
|
|
|
135
192
|
|
|
136
193
|
## What happens after the first run
|
|
137
194
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
- `workspace-model.json` — the canonical description of the system.
|
|
141
|
-
- `workspace-knowledge-graph.json` — searchable relationships with proof.
|
|
142
|
-
- `workspace-verify-last-run.json` — the latest verification decision.
|
|
143
|
-
- `workspace-context-agent.json` — bounded context for agents and IDEs.
|
|
144
|
-
- `INDEX.json` — the current evidence inventory and recommended read order.
|
|
195
|
+
Everything shown in the [output tree above](#what-the-output-looks-like) is
|
|
196
|
+
generated in one run. The key files for each audience:
|
|
145
197
|
|
|
146
|
-
|
|
147
|
-
|
|
198
|
+
| Audience | What to read |
|
|
199
|
+
| --- | --- |
|
|
200
|
+
| **AI agent** | `agent-entry.v1.json` (project) → `workspace-context-agent.json` (workspace) |
|
|
201
|
+
| **Developer** | Terminal summary, or `workspace-explain-last-run.json` for diagnosis |
|
|
202
|
+
| **CI / automation** | `workspace-verify-last-run.json` (exit code 0 = pass, 2 = blocked) |
|
|
203
|
+
| **MCP client** | `workspace mcp serve` (14 read-oriented tools over JSON-RPC) |
|
|
204
|
+
| **IDE extension** | Same artifacts + watch events |
|
|
148
205
|
|
|
149
|
-
An agent can prove that it entered through
|
|
150
|
-
repository:
|
|
206
|
+
An agent can prove that it entered through governed evidence before scanning
|
|
207
|
+
the repository:
|
|
151
208
|
|
|
152
209
|
```bash
|
|
153
210
|
npx workspai agent bootstrap --for-agent codex --strict --json
|
|
154
211
|
```
|
|
155
212
|
|
|
156
|
-
The
|
|
157
|
-
|
|
158
|
-
handoff. A blocked receipt prevents complete architecture or verification
|
|
213
|
+
The receipt validates workspace membership, artifact integrity, Model/Graph
|
|
214
|
+
freshness, and the active Goal handoff. A blocked receipt prevents architecture
|
|
159
215
|
claims; it never falls back silently to a broad source scan. [Learn about
|
|
160
216
|
canonical-first agent entry](docs/agent-entry.md).
|
|
161
217
|
|
|
@@ -223,6 +279,7 @@ The deterministic model, graph, and checks do not require an AI API key.
|
|
|
223
279
|
| Verify current evidence | `npx workspai workspace verify --strict --json` |
|
|
224
280
|
| Inspect a governed repair before execution | `npx workspai workspace repair capabilities --json` |
|
|
225
281
|
| Refresh agent and IDE context | `npx workspai workspace agent-sync --write --preset enterprise --json` |
|
|
282
|
+
| Start MCP server for workspace queries | `npx workspai workspace mcp serve` |
|
|
226
283
|
|
|
227
284
|
For every command and flag, use the
|
|
228
285
|
[Command Reference](docs/commands-reference.md).
|
|
@@ -235,7 +292,7 @@ Workspai exposes the same governed data through several stable surfaces:
|
|
|
235
292
|
- JSON output for scripts and CI;
|
|
236
293
|
- versioned artifacts under `.workspai/reports/`;
|
|
237
294
|
- focused context and instructions for AI agents;
|
|
238
|
-
- MCP
|
|
295
|
+
- MCP server with 14 read-oriented workspace tools (`workspace mcp serve`);
|
|
239
296
|
- watch events and reports for IDEs and dashboards;
|
|
240
297
|
- JSON, JSON-LD, Mermaid, DOT, GraphML, and GEXF graph exports.
|
|
241
298
|
|
|
@@ -81,7 +81,13 @@
|
|
|
81
81
|
"title": { "type": "string" },
|
|
82
82
|
"detail": { "type": "string" },
|
|
83
83
|
"target": { "type": "string" },
|
|
84
|
-
"remediation": { "type": "string" }
|
|
84
|
+
"remediation": { "type": "string" },
|
|
85
|
+
"files": {
|
|
86
|
+
"type": "array",
|
|
87
|
+
"description": "Expected project-relative source paths that close this finding when created or repaired.",
|
|
88
|
+
"items": { "type": "string", "minLength": 1 },
|
|
89
|
+
"uniqueItems": true
|
|
90
|
+
}
|
|
85
91
|
},
|
|
86
92
|
"additionalProperties": true
|
|
87
93
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "rapidkit-extension-cli-compatibility.v1",
|
|
3
3
|
"cli": "workspai",
|
|
4
|
-
"minimumVerifiedCliVersion": "0.
|
|
4
|
+
"minimumVerifiedCliVersion": "0.61.0",
|
|
5
5
|
"publishedContractSchemas": {
|
|
6
6
|
"workspaceContract": 1,
|
|
7
7
|
"runtimeCommandSurface": "rapidkit-runtime-command-surface-v1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "workspai.studio-card-repair-capabilities.v1",
|
|
3
|
-
"invariant": "A card repair closes only after its exact producer refreshes, its selected causal action set is absent, and aggregate Workspace Verify completes without an execution failure. Unrelated workspace blockers are reported separately and do not reopen the selected card.",
|
|
3
|
+
"invariant": "A card repair starts with its declared repairPolicy but every unresolved policy path transfers to governed causal source repair. It closes only after its exact producer refreshes, its selected causal action set is absent, and aggregate Workspace Verify completes without an execution failure. Unrelated workspace blockers are reported separately and do not reopen the selected card.",
|
|
4
4
|
"cards": [
|
|
5
5
|
{
|
|
6
6
|
"cardId": "doctor",
|
|
@@ -110,6 +110,30 @@
|
|
|
110
110
|
"maxItems": 25,
|
|
111
111
|
"uniqueItems": true,
|
|
112
112
|
"items": { "type": "string", "minLength": 1 }
|
|
113
|
+
},
|
|
114
|
+
"verificationReceipt": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"required": [
|
|
117
|
+
"verifiedGoalId",
|
|
118
|
+
"attempt",
|
|
119
|
+
"statusHash",
|
|
120
|
+
"modelHash",
|
|
121
|
+
"graphFingerprint",
|
|
122
|
+
"graphFingerprintSemantics",
|
|
123
|
+
"recordedAt"
|
|
124
|
+
],
|
|
125
|
+
"properties": {
|
|
126
|
+
"verifiedGoalId": { "type": "string", "minLength": 1 },
|
|
127
|
+
"attempt": { "type": "integer", "minimum": 1 },
|
|
128
|
+
"statusHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
129
|
+
"modelHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
130
|
+
"graphFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
131
|
+
"graphFingerprintSemantics": {
|
|
132
|
+
"enum": ["workspace-knowledge-graph-inputs-v1", "canonical-json-v1"]
|
|
133
|
+
},
|
|
134
|
+
"recordedAt": { "type": "string", "format": "date-time" }
|
|
135
|
+
},
|
|
136
|
+
"additionalProperties": false
|
|
113
137
|
}
|
|
114
138
|
},
|
|
115
139
|
"additionalProperties": false
|
|
@@ -131,7 +131,31 @@
|
|
|
131
131
|
"goalPack": { "type": "string" },
|
|
132
132
|
"agentHandoff": { "type": "string" },
|
|
133
133
|
"verifiedGoalId": { "type": "string" },
|
|
134
|
-
"repairTransactionId": { "type": "string" }
|
|
134
|
+
"repairTransactionId": { "type": "string" },
|
|
135
|
+
"verificationReceipt": {
|
|
136
|
+
"type": "object",
|
|
137
|
+
"required": [
|
|
138
|
+
"verifiedGoalId",
|
|
139
|
+
"attempt",
|
|
140
|
+
"statusHash",
|
|
141
|
+
"modelHash",
|
|
142
|
+
"graphFingerprint",
|
|
143
|
+
"graphFingerprintSemantics",
|
|
144
|
+
"recordedAt"
|
|
145
|
+
],
|
|
146
|
+
"properties": {
|
|
147
|
+
"verifiedGoalId": { "type": "string", "minLength": 1 },
|
|
148
|
+
"attempt": { "type": "integer", "minimum": 1 },
|
|
149
|
+
"statusHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
150
|
+
"modelHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
151
|
+
"graphFingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
152
|
+
"graphFingerprintSemantics": {
|
|
153
|
+
"enum": ["workspace-knowledge-graph-inputs-v1", "canonical-json-v1"]
|
|
154
|
+
},
|
|
155
|
+
"recordedAt": { "type": "string", "format": "date-time" }
|
|
156
|
+
},
|
|
157
|
+
"additionalProperties": false
|
|
158
|
+
}
|
|
135
159
|
},
|
|
136
160
|
"additionalProperties": false
|
|
137
161
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-VRQLHCE2.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-NJ6WJ7VU.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {g,b,i as i$1,d as d$2,e as e$1,f}from'./chunk-XZ55OA4C.js';import {c}from'./chunk-GPOZILMY.js';import {c as c$1}from'./chunk-X7FYEKLI.js';import {d as d$3,b as b$1,a as a$1}from'./chunk-3RBUSW7H.js';import {d as d$1}from'./chunk-EWZZUQBR.js';import {a}from'./chunk-AFIFZTOY.js';import {h,e,i}from'./chunk-NZ3WZYD5.js';import {t,h as h$1,g as g$1}from'./chunk-MOSXTVPU.js';import le from'crypto';import H from'fs';import k from'fs/promises';import d from'path';import {execa}from'execa';import he from'fs-extra';var ke=h.projectContextAgent.schemaVersion,Ze=["managed","local","off"],de="<!-- WORKSPAI:PROJECT-GROUNDING:START -->",pe="<!-- WORKSPAI:PROJECT-GROUNDING:END -->";function oe(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}async function E(e){try{return JSON.parse(await k.readFile(e,"utf8"))}catch(t){return null}}function G(e){return e.replace(/\\/g,"/").replace(/^\.\/+/,"")}function x(e,t,n){let o=e.replace(/\\/g,"/"),i=/^[A-Za-z]:\//.test(o);if(!d.isAbsolute(e)&&!i)return G(o);if(i&&process.platform!=="win32")return null;let c=d.resolve(e),s=d.relative(n,c);if(s&&!s.startsWith("..")&&!d.isAbsolute(s))return G(s);let l=d.relative(t,c);return l&&!l.startsWith("..")&&!d.isAbsolute(l)?`workspace:${G(l)}`:null}function P(e,t,n){return [[n,"project:"],[n.replace(/\\/g,"/"),"project:"],[t,"workspace:"],[t.replace(/\\/g,"/"),"workspace:"]].reduce((i,[c,s])=>c.length>0?i.split(c).join(s):i,e)}function ge(e,t){return oe(e?.adoption)?.mode==="linked"?"adopted":oe(e?.import)?"imported":t}function we(e){if(!e.model)return null;let t=G(e.relativePath);return e.model.projects.find(n=>n.name===e.projectName||G(n.path)===t)??null}function ne(e,t){e[t]=(e[t]??0)+1;}var ye=["project","language","service","api","endpoint","schema","protocol","runtime-unit","lifecycle-stage","database","queue","container","deployment","pipeline","environment","test-suite","owner","decision","document","package","file","module","symbol"];function je(e,t=160){let n={language:32,api:32,service:32,endpoint:32,schema:32,protocol:32,"runtime-unit":32,"lifecycle-stage":32,file:8,module:8,symbol:8},o=[];for(let i of ye){let c=e.filter(s=>s.kind===i).sort((s,l)=>s.label.localeCompare(l.label)||s.id.localeCompare(l.id)).slice(0,n[i]??32);for(let s of c){if(o.length>=t)return o;o.push(s);}}return o}function Pe(e,t){if(!e)return {entityCount:0,relationCount:0,proofCount:0,entitiesByKind:{},relationsByKind:{},languages:{},semantic:{protocolConceptCount:0,protocolImplementationBindings:0,equivalenceBindings:0,generationBindings:0,runtimeUnitCount:0,lifecycleStageCount:0,runtimeCoverage:[]},relatedProjects:[],proofArtifacts:[],entities:[],relations:[],proofs:[],topology:{status:"unavailable",dependencies:[],dependents:[]},diagnostics:[]};let n=e.entities.find(r=>r.kind==="project"&&(r.id===t||r.label===t||r.projectId===t)),o=new Set(e.entities.filter(r=>r.projectId===t||r.id===n?.id||r.kind==="project"&&r.label===t).map(r=>r.id));n&&o.add(n.id);let i=e.relations.filter(r=>o.has(r.from)||o.has(r.to)),c=new Set(o);for(let r of i)c.add(r.from),c.add(r.to);let s=e.entities.filter(r=>c.has(r.id)),l=new Set,g={},u={},f={},w=new Set(s.filter(r=>r.kind==="language").map(r=>r.attributes.language).filter(r=>typeof r=="string"));for(let r of s){ne(g,r.kind);let a=typeof r.attributes.language=="string"?r.attributes.language:void 0;if(a&&r.kind==="language")f[a]={fileCount:typeof r.attributes.fileCount=="number"?r.attributes.fileCount:0,symbolCount:f[a]?.symbolCount??0,generatedFileCount:typeof r.attributes.generatedFileCount=="number"?r.attributes.generatedFileCount:0};else if(a&&(r.kind==="file"||r.kind==="symbol")){let h=f[a]??{fileCount:0,symbolCount:0,generatedFileCount:0};r.kind==="file"&&!w.has(a)?(h.fileCount+=1,r.attributes.generated===true&&(h.generatedFileCount+=1)):r.kind==="symbol"&&(h.symbolCount+=1),f[a]=h;}for(let h of r.proofIds)l.add(h);}for(let r of i){ne(u,r.kind);for(let a of r.proofIds)l.add(a);}let y=e.proofs.filter(r=>l.has(r.id)),b=[...new Set(e.entities.filter(r=>c.has(r.id)&&r.projectId&&r.projectId!==t).map(r=>r.projectId))].sort(),m=e.diagnostics.filter(r=>r.entityIds?.some(a=>c.has(a))||r.relationIds?.some(a=>i.some(h=>h.id===a))).map(r=>({code:r.code,severity:r.severity,message:r.message,...r.recommendation?{recommendation:r.recommendation}:{}})),p=(r,a)=>({project:a,kind:r.kind,source:r.source,confidence:r.confidence,evidence:[...new Set(r.evidence.map(h=>h.file.replace(/\\/g,"/")))].sort()}),v=e.projectTopology.edges.filter(r=>r.from===t).map(r=>p(r,r.to)).sort((r,a)=>`${r.project}:${r.kind}`.localeCompare(`${a.project}:${a.kind}`)),C=e.projectTopology.edges.filter(r=>r.to===t).map(r=>p(r,r.from)).sort((r,a)=>`${r.project}:${r.kind}`.localeCompare(`${a.project}:${a.kind}`)),R=je(s),N=s.filter(r=>r.kind==="runtime-unit"),j=new Set(R.map(r=>r.id)),_=[...i].sort((r,a)=>{let h=Number(j.has(r.from)||j.has(r.to));return Number(j.has(a.from)||j.has(a.to))-h||r.id.localeCompare(a.id)}).slice(0,128),$=new Set([...R.flatMap(r=>r.proofIds),..._.flatMap(r=>r.proofIds)]);return {entityCount:s.length,relationCount:i.length,proofCount:y.length,entitiesByKind:g,relationsByKind:u,languages:Object.fromEntries(Object.entries(f).sort(([r],[a])=>r.localeCompare(a))),semantic:{protocolConceptCount:g.protocol??0,protocolImplementationBindings:u["implements-protocol"]??0,equivalenceBindings:u["equivalent-to"]??0,generationBindings:(u["generated-from"]??0)+(u["generated-by"]??0),runtimeUnitCount:N.length,lifecycleStageCount:g["lifecycle-stage"]??0,runtimeCoverage:[...new Set(N.map(r=>r.attributes.runtime).filter(r=>typeof r=="string"))].sort()},relatedProjects:b,proofArtifacts:[...new Set(y.map(r=>r.artifact))].sort(),entities:R,relations:_,proofs:y.filter(r=>$.has(r.id)).sort((r,a)=>r.id.localeCompare(a.id)).slice(0,128),topology:{status:v.length>0||C.length>0?"proven":e.projectTopology.nodes.some(r=>r.id===t)?"unproven":"unavailable",dependencies:v,dependents:C},diagnostics:m}}function ue(e,t,n){return Array.isArray(e)?e.map(o=>typeof o=="string"?P(o,t,n):o):typeof e=="string"?P(e,t,n):e}function be(e,t,n){return {id:e.id,kind:e.kind,label:P(e.label,t,n),attributes:Object.fromEntries(Object.entries(e.attributes).map(([o,i])=>[o,ue(i,t,n)])),proofIds:[...e.proofIds].sort()}}function ve(e,t,n){let o=(...c)=>e.filter(s=>c.includes(s.kind)).map(s=>be(s,t,n)).slice(0,32),i=[];for(let c of e){for(let[s,l]of Object.entries(c.attributes))if(/(?:^|[-_.])ports?(?:$|[-_.])/i.test(s)&&(i.push({entityId:c.id,label:P(c.label,t,n),attribute:s,value:ue(l,t,n)}),i.length>=32))break;if(i.length>=32)break}return {services:o("service"),packages:o("package"),protocols:o("protocol"),runtimeUnits:o("runtime-unit"),lifecycleStages:o("lifecycle-stage"),apis:o("api"),endpoints:o("endpoint"),dataStores:o("database","queue"),deployments:o("container","deployment","environment"),pipelines:o("pipeline"),tests:o("test-suite"),owners:o("owner"),decisions:o("decision"),ports:i}}function Ae(e,t,n){let o=x(e.artifact,t,n);return o?{id:e.id,provider:e.provider,artifact:o,...e.pointer?{pointer:P(e.pointer,t,n)}:{},...e.line!==void 0?{line:e.line}:{},derivation:e.derivation,trust:e.trust,confidence:e.confidence,freshness:e.freshness}:null}async function Ee(e,t,n){let o=[],i=await E(d.join(e,".workspai","reports","INDEX.json"));if(Array.isArray(i?.blockers))for(let s of i.blockers)typeof s=="string"&&(s.startsWith(`${n}:`)||s.includes(`project:${n}`)||s.includes(`project ${n}`))&&o.push({source:"workspace-report-index",severity:"error",message:P(s,e,t)});let c=await E(d.join(e,".workspai","reports","doctor-project-last-run.json"));if(c?.projectName===n)for(let s of c$1({project:c.project}))o.push({source:"doctor-project",severity:s.status==="blocking"?"error":"warning",message:P(s.message,e,t),...s.id?{code:s.id}:{}});return [...new Map(o.map(s=>[`${s.source}:${s.code??""}:${s.message}`,s])).values()].slice(0,32)}function U(e,t=[]){return typeof e=="string"?/^[A-Za-z]:[\\/]/.test(e)||/(?:^|[\s("'`])[A-Za-z]:[\\/]/.test(e)||/(?:^|[\s("'`])\/(?:Users|home|private|var|opt|srv|mnt|Volumes|tmp)\//.test(e)||t.some(n=>n.length>0&&(e.includes(n)||e.includes(n.replace(/\\/g,"/")))):Array.isArray(e)?e.some(n=>U(n,t)):e&&typeof e=="object"?Object.values(e).some(n=>U(n,t)):false}function Ce(e){return le.createHash("sha256").update(JSON.stringify(e)).digest("hex")}async function Re(e$1){let t$1=d.resolve(e$1.workspacePath),n=d.resolve(e$1.projectPath),o=t(n,"project.json").find(a=>H.existsSync(a)),i$1=o?await E(o):null,c=await E(d.join(t$1,".workspai","workspace.contract.json")),s=d.resolve(n),l=c?.projects?.find(a=>a.externalPath?d.resolve(a.externalPath)===s:!a.relativePath||a.relativePath.startsWith("external/")?false:d.resolve(t$1,a.relativePath)===s)??c?.projects?.find(a=>a.slug===e$1.projectName||a.slug===d.basename(n)),g=e$1.projectName??(typeof i$1?.name=="string"?i$1.name:void 0)??l?.slug??d.basename(n),u=l?.relativePath??(()=>{let a=G(d.relative(t$1,n));return !a||a.startsWith("..")?`external/${g}`:a})(),f=await E(d.join(t$1,e.model)),w=await E(d.join(t$1,e.knowledgeGraph)),y=f?d$1(f):void 0,b$1=!!(y&&w?.source.hash===y),m=we({model:f,projectName:g,relativePath:u}),p=Pe(b$1?w:null,g),v=await Ee(t$1,n,g),C=p.proofs.map(a=>a.freshness),R=w?!b$1||C.includes("stale")?"stale":C.includes("unknown")?"unknown":"fresh":"missing",N=f?f.factFreshness?.status??"unknown":"missing",j=[...f?[]:[{code:"project.context.model-missing",severity:"warning",message:"The canonical Workspace Model has not been generated yet. Refresh workspace intelligence before relying on project topology."}],...f&&!m?[{code:"project.context.project-not-materialized",severity:"warning",message:"The project is registered in the workspace contract but is not present in the current Workspace Model."}]:[],...w?[]:[{code:"project.context.graph-missing",severity:"warning",message:"The Workspace Knowledge Graph has not been generated yet. Run the workspace intelligence loop to build proof-backed relationships."}],...w&&!b$1?[{code:"project.context.graph-model-mismatch",severity:"warning",message:"The persisted Knowledge Graph does not match the current Workspace Model and was excluded from this project lens."}]:[]],_=ge(i$1,e$1.relationship??l?.relationship??"managed"),$={schemaVersion:ke,generatedAt:(e$1.now??new Date).toISOString(),workspace:{name:c?.workspace?.name??f?.workspace.name??d.basename(t$1),...c?.workspace?.profile||f?.workspace.profile?{profile:c?.workspace?.profile??f?.workspace.profile}:{},relationship:_,contract:`workspace:${i.workspaceContract}`,model:`workspace:${e.model}`,knowledgeGraph:`workspace:${e.knowledgeGraph}`,access:{localBinding:i.projectWorkspaceLink,canonicalEvidenceAvailableAtGeneration:true,identityIsFilesystemPath:false,resolverCommand:"workspai project workspace status --json",portableUriScheme:"workspace:",resolvedPathPolicy:"runtime-private-never-persist"}},project:{name:g,relativePath:u,...m?.kind?{kind:m.kind}:{},...m?.runtime||l?.runtime?{runtime:m?.runtime??l?.runtime}:{},...m?.runtimeCandidates?.length?{runtimeCandidates:[...m.runtimeCandidates].sort()}:{},...m?.framework||l?.framework?{framework:m?.framework??l?.framework}:{},...m?.kit||l?.kit?{kit:m?.kit??l?.kit}:{},...m?.supportTier?{supportTier:m.supportTier}:{},commands:{supported:[...m?.commands.supported??[]].sort(),unsupported:[...m?.commands.unsupported??[]].sort(),fleetStages:[...m?.commands.fleetStages??[]].sort()},importantFiles:[...new Set((m?.importantFiles??[]).map(a=>x(a,t$1,n)).filter(a=>a!==null))].sort()},intelligence:{...f?.generatedAt?{modelGeneratedAt:f.generatedAt}:{},...w?.generatedAt?{graphGeneratedAt:w.generatedAt}:{},...w?.source.hash?{graphModelHash:w.source.hash}:{},entityCount:p.entityCount,relationCount:p.relationCount,proofCount:p.proofCount,entitiesByKind:p.entitiesByKind,relationsByKind:p.relationsByKind,languages:p.languages,semantic:p.semantic,relatedProjects:p.relatedProjects,freshness:{model:N,graph:R,graphMatchesModel:b$1},topology:{...p.topology,dependencies:p.topology.dependencies.map(a=>({...a,evidence:a.evidence.map(h=>x(h,t$1,n)).filter(h=>h!==null)})),dependents:p.topology.dependents.map(a=>({...a,evidence:a.evidence.map(h=>x(h,t$1,n)).filter(h=>h!==null)}))},surfaces:ve(p.entities,t$1,n),diagnostics:[...j,...p.diagnostics].map(a=>({...a,message:P(a.message,t$1,n),...a.recommendation?{recommendation:P(a.recommendation,t$1,n)}:{}}))},evidence:{readOrder:[b,".workspai/PROJECT-GROUNDING.md",i.projectContextAgent,"AGENTS.md","workspace:.workspai/goals/index.json",`workspace:${i.goalPackLastRun}`,"workspace:.workspai/reports/INDEX.json","workspace:.workspai/reports/workspace-context-agent.json",`workspace:${e.model}`,`workspace:${e.knowledgeGraph}`],projectProofArtifacts:[...new Set(p.proofArtifacts.map(a=>x(a,t$1,n)).filter(a=>a!==null))],relations:p.relations.map(a=>({id:a.id,from:a.from,to:a.to,kind:a.kind,derivation:a.derivation,trust:a.trust,confidence:a.confidence,proofIds:[...a.proofIds].sort()})),proofs:p.proofs.map(a=>Ae(a,t$1,n)).filter(a=>a!==null)},blockers:v,agentRouting:{enforcement:"required",mandatoryPreflight:{command:"workspai agent bootstrap --for-agent generic --strict --json",successCondition:"ready"},workspaceLocator:{command:"workspai project workspace status --json",successCondition:"resolved",outputClassification:"machine-local",persistence:"forbidden",disclosure:"forbidden",portableUriScheme:"workspace:"},workspaceEvidenceRequiredFor:["repository-analysis","architecture-analysis","change-impact","cross-project-change","contract-change","infrastructure-change","release-readiness"],requiredReadOrder:[b,"command:workspai agent bootstrap --for-agent generic --strict --json","command:workspai project workspace status --json",i.projectContextAgent,"workspace:.workspai/reports/INDEX.json","workspace:.workspai/reports/workspace-context-agent.json",`command:npx workspai workspace graph search ${JSON.stringify(g)} --scope ${JSON.stringify(`project:${g}`)} --limit 12 --json`],degradedMode:{allowCompleteArchitectureClaims:false,requireDisclosure:true}},commands:{refresh:"workspai workspace intelligence run --for-agent generic --strict --json",verify:"workspai workspace verify --strict --json",graphSearch:`workspai workspace graph search ${JSON.stringify(g)} --scope ${JSON.stringify(`project:${g}`)} --limit 12 --json`,doctor:"workspai doctor project --json",workspaceStatus:"workspai project workspace status --json"}};if(U($,[t$1,n]))throw new Error("Project context lens rejected a non-portable absolute path.");let r={...$,integrity:{algorithm:"sha256",...y?{modelHash:y}:{},payloadHash:Ce($),portable:true,absolutePathsEmitted:false}};return a(r,"contracts/workspace-intelligence/project-context-agent.v1.json","Project context agent"),r}function Te(e){let t=e.intelligence.relatedProjects.length>0?e.intelligence.relatedProjects.map(i=>`\`${i}\``).join(", "):"No proven cross-project relation is currently available.",n=e.intelligence.diagnostics.length>0?e.intelligence.diagnostics.slice(0,8).map(i=>`- **${i.severity} \xB7 ${i.code}:** ${i.message}`).join(`
|
|
1
|
+
import {g,b,i as i$1,d as d$2,e as e$1,f}from'./chunk-ZJ62F4U3.js';import {c}from'./chunk-GPOZILMY.js';import {c as c$1}from'./chunk-X7FYEKLI.js';import {d as d$3,b as b$1,a as a$1}from'./chunk-3RBUSW7H.js';import {d as d$1}from'./chunk-EWZZUQBR.js';import {a}from'./chunk-AFIFZTOY.js';import {h,e,i}from'./chunk-NZ3WZYD5.js';import {t,h as h$1,g as g$1}from'./chunk-MOSXTVPU.js';import le from'crypto';import H from'fs';import k from'fs/promises';import d from'path';import {execa}from'execa';import he from'fs-extra';var ke=h.projectContextAgent.schemaVersion,Ze=["managed","local","off"],de="<!-- WORKSPAI:PROJECT-GROUNDING:START -->",pe="<!-- WORKSPAI:PROJECT-GROUNDING:END -->";function oe(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}async function E(e){try{return JSON.parse(await k.readFile(e,"utf8"))}catch(t){return null}}function G(e){return e.replace(/\\/g,"/").replace(/^\.\/+/,"")}function x(e,t,n){let o=e.replace(/\\/g,"/"),i=/^[A-Za-z]:\//.test(o);if(!d.isAbsolute(e)&&!i)return G(o);if(i&&process.platform!=="win32")return null;let c=d.resolve(e),s=d.relative(n,c);if(s&&!s.startsWith("..")&&!d.isAbsolute(s))return G(s);let l=d.relative(t,c);return l&&!l.startsWith("..")&&!d.isAbsolute(l)?`workspace:${G(l)}`:null}function P(e,t,n){return [[n,"project:"],[n.replace(/\\/g,"/"),"project:"],[t,"workspace:"],[t.replace(/\\/g,"/"),"workspace:"]].reduce((i,[c,s])=>c.length>0?i.split(c).join(s):i,e)}function ge(e,t){return oe(e?.adoption)?.mode==="linked"?"adopted":oe(e?.import)?"imported":t}function we(e){if(!e.model)return null;let t=G(e.relativePath);return e.model.projects.find(n=>n.name===e.projectName||G(n.path)===t)??null}function ne(e,t){e[t]=(e[t]??0)+1;}var ye=["project","language","service","api","endpoint","schema","protocol","runtime-unit","lifecycle-stage","database","queue","container","deployment","pipeline","environment","test-suite","owner","decision","document","package","file","module","symbol"];function je(e,t=160){let n={language:32,api:32,service:32,endpoint:32,schema:32,protocol:32,"runtime-unit":32,"lifecycle-stage":32,file:8,module:8,symbol:8},o=[];for(let i of ye){let c=e.filter(s=>s.kind===i).sort((s,l)=>s.label.localeCompare(l.label)||s.id.localeCompare(l.id)).slice(0,n[i]??32);for(let s of c){if(o.length>=t)return o;o.push(s);}}return o}function Pe(e,t){if(!e)return {entityCount:0,relationCount:0,proofCount:0,entitiesByKind:{},relationsByKind:{},languages:{},semantic:{protocolConceptCount:0,protocolImplementationBindings:0,equivalenceBindings:0,generationBindings:0,runtimeUnitCount:0,lifecycleStageCount:0,runtimeCoverage:[]},relatedProjects:[],proofArtifacts:[],entities:[],relations:[],proofs:[],topology:{status:"unavailable",dependencies:[],dependents:[]},diagnostics:[]};let n=e.entities.find(r=>r.kind==="project"&&(r.id===t||r.label===t||r.projectId===t)),o=new Set(e.entities.filter(r=>r.projectId===t||r.id===n?.id||r.kind==="project"&&r.label===t).map(r=>r.id));n&&o.add(n.id);let i=e.relations.filter(r=>o.has(r.from)||o.has(r.to)),c=new Set(o);for(let r of i)c.add(r.from),c.add(r.to);let s=e.entities.filter(r=>c.has(r.id)),l=new Set,g={},u={},f={},w=new Set(s.filter(r=>r.kind==="language").map(r=>r.attributes.language).filter(r=>typeof r=="string"));for(let r of s){ne(g,r.kind);let a=typeof r.attributes.language=="string"?r.attributes.language:void 0;if(a&&r.kind==="language")f[a]={fileCount:typeof r.attributes.fileCount=="number"?r.attributes.fileCount:0,symbolCount:f[a]?.symbolCount??0,generatedFileCount:typeof r.attributes.generatedFileCount=="number"?r.attributes.generatedFileCount:0};else if(a&&(r.kind==="file"||r.kind==="symbol")){let h=f[a]??{fileCount:0,symbolCount:0,generatedFileCount:0};r.kind==="file"&&!w.has(a)?(h.fileCount+=1,r.attributes.generated===true&&(h.generatedFileCount+=1)):r.kind==="symbol"&&(h.symbolCount+=1),f[a]=h;}for(let h of r.proofIds)l.add(h);}for(let r of i){ne(u,r.kind);for(let a of r.proofIds)l.add(a);}let y=e.proofs.filter(r=>l.has(r.id)),b=[...new Set(e.entities.filter(r=>c.has(r.id)&&r.projectId&&r.projectId!==t).map(r=>r.projectId))].sort(),m=e.diagnostics.filter(r=>r.entityIds?.some(a=>c.has(a))||r.relationIds?.some(a=>i.some(h=>h.id===a))).map(r=>({code:r.code,severity:r.severity,message:r.message,...r.recommendation?{recommendation:r.recommendation}:{}})),p=(r,a)=>({project:a,kind:r.kind,source:r.source,confidence:r.confidence,evidence:[...new Set(r.evidence.map(h=>h.file.replace(/\\/g,"/")))].sort()}),v=e.projectTopology.edges.filter(r=>r.from===t).map(r=>p(r,r.to)).sort((r,a)=>`${r.project}:${r.kind}`.localeCompare(`${a.project}:${a.kind}`)),C=e.projectTopology.edges.filter(r=>r.to===t).map(r=>p(r,r.from)).sort((r,a)=>`${r.project}:${r.kind}`.localeCompare(`${a.project}:${a.kind}`)),R=je(s),N=s.filter(r=>r.kind==="runtime-unit"),j=new Set(R.map(r=>r.id)),_=[...i].sort((r,a)=>{let h=Number(j.has(r.from)||j.has(r.to));return Number(j.has(a.from)||j.has(a.to))-h||r.id.localeCompare(a.id)}).slice(0,128),$=new Set([...R.flatMap(r=>r.proofIds),..._.flatMap(r=>r.proofIds)]);return {entityCount:s.length,relationCount:i.length,proofCount:y.length,entitiesByKind:g,relationsByKind:u,languages:Object.fromEntries(Object.entries(f).sort(([r],[a])=>r.localeCompare(a))),semantic:{protocolConceptCount:g.protocol??0,protocolImplementationBindings:u["implements-protocol"]??0,equivalenceBindings:u["equivalent-to"]??0,generationBindings:(u["generated-from"]??0)+(u["generated-by"]??0),runtimeUnitCount:N.length,lifecycleStageCount:g["lifecycle-stage"]??0,runtimeCoverage:[...new Set(N.map(r=>r.attributes.runtime).filter(r=>typeof r=="string"))].sort()},relatedProjects:b,proofArtifacts:[...new Set(y.map(r=>r.artifact))].sort(),entities:R,relations:_,proofs:y.filter(r=>$.has(r.id)).sort((r,a)=>r.id.localeCompare(a.id)).slice(0,128),topology:{status:v.length>0||C.length>0?"proven":e.projectTopology.nodes.some(r=>r.id===t)?"unproven":"unavailable",dependencies:v,dependents:C},diagnostics:m}}function ue(e,t,n){return Array.isArray(e)?e.map(o=>typeof o=="string"?P(o,t,n):o):typeof e=="string"?P(e,t,n):e}function be(e,t,n){return {id:e.id,kind:e.kind,label:P(e.label,t,n),attributes:Object.fromEntries(Object.entries(e.attributes).map(([o,i])=>[o,ue(i,t,n)])),proofIds:[...e.proofIds].sort()}}function ve(e,t,n){let o=(...c)=>e.filter(s=>c.includes(s.kind)).map(s=>be(s,t,n)).slice(0,32),i=[];for(let c of e){for(let[s,l]of Object.entries(c.attributes))if(/(?:^|[-_.])ports?(?:$|[-_.])/i.test(s)&&(i.push({entityId:c.id,label:P(c.label,t,n),attribute:s,value:ue(l,t,n)}),i.length>=32))break;if(i.length>=32)break}return {services:o("service"),packages:o("package"),protocols:o("protocol"),runtimeUnits:o("runtime-unit"),lifecycleStages:o("lifecycle-stage"),apis:o("api"),endpoints:o("endpoint"),dataStores:o("database","queue"),deployments:o("container","deployment","environment"),pipelines:o("pipeline"),tests:o("test-suite"),owners:o("owner"),decisions:o("decision"),ports:i}}function Ae(e,t,n){let o=x(e.artifact,t,n);return o?{id:e.id,provider:e.provider,artifact:o,...e.pointer?{pointer:P(e.pointer,t,n)}:{},...e.line!==void 0?{line:e.line}:{},derivation:e.derivation,trust:e.trust,confidence:e.confidence,freshness:e.freshness}:null}async function Ee(e,t,n){let o=[],i=await E(d.join(e,".workspai","reports","INDEX.json"));if(Array.isArray(i?.blockers))for(let s of i.blockers)typeof s=="string"&&(s.startsWith(`${n}:`)||s.includes(`project:${n}`)||s.includes(`project ${n}`))&&o.push({source:"workspace-report-index",severity:"error",message:P(s,e,t)});let c=await E(d.join(e,".workspai","reports","doctor-project-last-run.json"));if(c?.projectName===n)for(let s of c$1({project:c.project}))o.push({source:"doctor-project",severity:s.status==="blocking"?"error":"warning",message:P(s.message,e,t),...s.id?{code:s.id}:{}});return [...new Map(o.map(s=>[`${s.source}:${s.code??""}:${s.message}`,s])).values()].slice(0,32)}function U(e,t=[]){return typeof e=="string"?/^[A-Za-z]:[\\/]/.test(e)||/(?:^|[\s("'`])[A-Za-z]:[\\/]/.test(e)||/(?:^|[\s("'`])\/(?:Users|home|private|var|opt|srv|mnt|Volumes|tmp)\//.test(e)||t.some(n=>n.length>0&&(e.includes(n)||e.includes(n.replace(/\\/g,"/")))):Array.isArray(e)?e.some(n=>U(n,t)):e&&typeof e=="object"?Object.values(e).some(n=>U(n,t)):false}function Ce(e){return le.createHash("sha256").update(JSON.stringify(e)).digest("hex")}async function Re(e$1){let t$1=d.resolve(e$1.workspacePath),n=d.resolve(e$1.projectPath),o=t(n,"project.json").find(a=>H.existsSync(a)),i$1=o?await E(o):null,c=await E(d.join(t$1,".workspai","workspace.contract.json")),s=d.resolve(n),l=c?.projects?.find(a=>a.externalPath?d.resolve(a.externalPath)===s:!a.relativePath||a.relativePath.startsWith("external/")?false:d.resolve(t$1,a.relativePath)===s)??c?.projects?.find(a=>a.slug===e$1.projectName||a.slug===d.basename(n)),g=e$1.projectName??(typeof i$1?.name=="string"?i$1.name:void 0)??l?.slug??d.basename(n),u=l?.relativePath??(()=>{let a=G(d.relative(t$1,n));return !a||a.startsWith("..")?`external/${g}`:a})(),f=await E(d.join(t$1,e.model)),w=await E(d.join(t$1,e.knowledgeGraph)),y=f?d$1(f):void 0,b$1=!!(y&&w?.source.hash===y),m=we({model:f,projectName:g,relativePath:u}),p=Pe(b$1?w:null,g),v=await Ee(t$1,n,g),C=p.proofs.map(a=>a.freshness),R=w?!b$1||C.includes("stale")?"stale":C.includes("unknown")?"unknown":"fresh":"missing",N=f?f.factFreshness?.status??"unknown":"missing",j=[...f?[]:[{code:"project.context.model-missing",severity:"warning",message:"The canonical Workspace Model has not been generated yet. Refresh workspace intelligence before relying on project topology."}],...f&&!m?[{code:"project.context.project-not-materialized",severity:"warning",message:"The project is registered in the workspace contract but is not present in the current Workspace Model."}]:[],...w?[]:[{code:"project.context.graph-missing",severity:"warning",message:"The Workspace Knowledge Graph has not been generated yet. Run the workspace intelligence loop to build proof-backed relationships."}],...w&&!b$1?[{code:"project.context.graph-model-mismatch",severity:"warning",message:"The persisted Knowledge Graph does not match the current Workspace Model and was excluded from this project lens."}]:[]],_=ge(i$1,e$1.relationship??l?.relationship??"managed"),$={schemaVersion:ke,generatedAt:(e$1.now??new Date).toISOString(),workspace:{name:c?.workspace?.name??f?.workspace.name??d.basename(t$1),...c?.workspace?.profile||f?.workspace.profile?{profile:c?.workspace?.profile??f?.workspace.profile}:{},relationship:_,contract:`workspace:${i.workspaceContract}`,model:`workspace:${e.model}`,knowledgeGraph:`workspace:${e.knowledgeGraph}`,access:{localBinding:i.projectWorkspaceLink,canonicalEvidenceAvailableAtGeneration:true,identityIsFilesystemPath:false,resolverCommand:"workspai project workspace status --json",portableUriScheme:"workspace:",resolvedPathPolicy:"runtime-private-never-persist"}},project:{name:g,relativePath:u,...m?.kind?{kind:m.kind}:{},...m?.runtime||l?.runtime?{runtime:m?.runtime??l?.runtime}:{},...m?.runtimeCandidates?.length?{runtimeCandidates:[...m.runtimeCandidates].sort()}:{},...m?.framework||l?.framework?{framework:m?.framework??l?.framework}:{},...m?.kit||l?.kit?{kit:m?.kit??l?.kit}:{},...m?.supportTier?{supportTier:m.supportTier}:{},commands:{supported:[...m?.commands.supported??[]].sort(),unsupported:[...m?.commands.unsupported??[]].sort(),fleetStages:[...m?.commands.fleetStages??[]].sort()},importantFiles:[...new Set((m?.importantFiles??[]).map(a=>x(a,t$1,n)).filter(a=>a!==null))].sort()},intelligence:{...f?.generatedAt?{modelGeneratedAt:f.generatedAt}:{},...w?.generatedAt?{graphGeneratedAt:w.generatedAt}:{},...w?.source.hash?{graphModelHash:w.source.hash}:{},entityCount:p.entityCount,relationCount:p.relationCount,proofCount:p.proofCount,entitiesByKind:p.entitiesByKind,relationsByKind:p.relationsByKind,languages:p.languages,semantic:p.semantic,relatedProjects:p.relatedProjects,freshness:{model:N,graph:R,graphMatchesModel:b$1},topology:{...p.topology,dependencies:p.topology.dependencies.map(a=>({...a,evidence:a.evidence.map(h=>x(h,t$1,n)).filter(h=>h!==null)})),dependents:p.topology.dependents.map(a=>({...a,evidence:a.evidence.map(h=>x(h,t$1,n)).filter(h=>h!==null)}))},surfaces:ve(p.entities,t$1,n),diagnostics:[...j,...p.diagnostics].map(a=>({...a,message:P(a.message,t$1,n),...a.recommendation?{recommendation:P(a.recommendation,t$1,n)}:{}}))},evidence:{readOrder:[b,".workspai/PROJECT-GROUNDING.md",i.projectContextAgent,"AGENTS.md","workspace:.workspai/goals/index.json",`workspace:${i.goalPackLastRun}`,"workspace:.workspai/reports/INDEX.json","workspace:.workspai/reports/workspace-context-agent.json",`workspace:${e.model}`,`workspace:${e.knowledgeGraph}`],projectProofArtifacts:[...new Set(p.proofArtifacts.map(a=>x(a,t$1,n)).filter(a=>a!==null))],relations:p.relations.map(a=>({id:a.id,from:a.from,to:a.to,kind:a.kind,derivation:a.derivation,trust:a.trust,confidence:a.confidence,proofIds:[...a.proofIds].sort()})),proofs:p.proofs.map(a=>Ae(a,t$1,n)).filter(a=>a!==null)},blockers:v,agentRouting:{enforcement:"required",mandatoryPreflight:{command:"workspai agent bootstrap --for-agent generic --strict --json",successCondition:"ready"},workspaceLocator:{command:"workspai project workspace status --json",successCondition:"resolved",outputClassification:"machine-local",persistence:"forbidden",disclosure:"forbidden",portableUriScheme:"workspace:"},workspaceEvidenceRequiredFor:["repository-analysis","architecture-analysis","change-impact","cross-project-change","contract-change","infrastructure-change","release-readiness"],requiredReadOrder:[b,"command:workspai agent bootstrap --for-agent generic --strict --json","command:workspai project workspace status --json",i.projectContextAgent,"workspace:.workspai/reports/INDEX.json","workspace:.workspai/reports/workspace-context-agent.json",`command:npx workspai workspace graph search ${JSON.stringify(g)} --scope ${JSON.stringify(`project:${g}`)} --limit 12 --json`],degradedMode:{allowCompleteArchitectureClaims:false,requireDisclosure:true}},commands:{refresh:"workspai workspace intelligence run --for-agent generic --strict --json",verify:"workspai workspace verify --strict --json",graphSearch:`workspai workspace graph search ${JSON.stringify(g)} --scope ${JSON.stringify(`project:${g}`)} --limit 12 --json`,doctor:"workspai doctor project --json",workspaceStatus:"workspai project workspace status --json"}};if(U($,[t$1,n]))throw new Error("Project context lens rejected a non-portable absolute path.");let r={...$,integrity:{algorithm:"sha256",...y?{modelHash:y}:{},payloadHash:Ce($),portable:true,absolutePathsEmitted:false}};return a(r,"contracts/workspace-intelligence/project-context-agent.v1.json","Project context agent"),r}function Te(e){let t=e.intelligence.relatedProjects.length>0?e.intelligence.relatedProjects.map(i=>`\`${i}\``).join(", "):"No proven cross-project relation is currently available.",n=e.intelligence.diagnostics.length>0?e.intelligence.diagnostics.slice(0,8).map(i=>`- **${i.severity} \xB7 ${i.code}:** ${i.message}`).join(`
|
|
2
2
|
`):"- No project-scoped graph diagnostic is currently recorded.",o=e.blockers.length>0?e.blockers.slice(0,12).map(i=>`- **${i.severity}${i.code?` \xB7 ${i.code}`:""}:** ${i.message}`).join(`
|
|
3
3
|
`):"- No current project-scoped blocker is recorded.";return `# Workspai project grounding
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-JEI6BTZI.js';import {a}from'./chunk-PXWKMPPI.js';import {c,e,d}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-JEI6BTZI.js';import {a}from'./chunk-PXWKMPPI.js';import {c,e,d}from'./chunk-ASOFWN6J.js';import {d as d$1,b}from'./chunk-O6R7SE6Y.js';import {g}from'./chunk-NBJ6AP7K.js';import {p as p$1,l}from'./chunk-NA2NXX5P.js';import {m,a as a$2}from'./chunk-KG3TUTXU.js';import {e as e$1}from'./chunk-CCDGHPEJ.js';import {b as b$2}from'./chunk-D65FCQIO.js';import {a as a$3}from'./chunk-AFIFZTOY.js';import v from'path';import b$1 from'fs-extra';function J(e$1){switch(e$1){case "why":return d;case "trace":return e;default:return c}}async function P(e,o,n){try{if(!await b$1.pathExists(e))return null;let r=await b$1.readJson(e);return o?b$2(o,r,e):n&&a$3(r,n,e),r}catch(r){if((o||n)&&await b$1.pathExists(e))throw r;return null}}function G(e,o){if(!e)return null;let n=o.trim().toLowerCase();return e.projects.find(r=>r.slug.toLowerCase()===n||r.relativePath.toLowerCase()===n)??null}function X(e,o,n){let r=n.trim().toLowerCase(),t=(l(e)?.nodes.map(a=>a.id)??e.projects.map(a=>a.name)).find(a=>a.toLowerCase()===r);if(t)return t;let d=e.projects.find(a=>[a.name,a.path,v.basename(a.path)].filter(u=>u.trim().length>0).some(u=>u.toLowerCase()===r));if(d)return d.name;let c=G(o,n);if(c){let a=e.projects.find(u=>u.path===c.relativePath||u.path.endsWith(`/${c.relativePath}`));if(a)return a.name}return n}function Y(e,o){if(!e)return [];let n=o.trim().toLowerCase(),r=new Set;for(let l of e.projects){l.contracts.dependsOn?.some(t=>t.toLowerCase()===n)&&r.add(l.slug);for(let t of l.contracts.consumes??[])for(let d of e.projects)d.contracts.publishes?.includes(t)&&d.slug===n&&r.add(l.slug);}return [...r].sort()}function q(e,o){if(!e)return [];let n=o.trim().toLowerCase();return e.steps.filter(r=>r.scope==="project"&&r.project?.toLowerCase()===n&&r.command?.display).map(r=>r.command.display).slice(0,8)}function p(e,o,n){return {id:e,title:o,body:n.trim()}}async function fe(e){let o=v.resolve(e.workspacePath),n=(e.now??new Date).toISOString(),r=e.model??await p$1({workspacePath:o,includeEvidence:true}),l$1=e.contract;if(l$1===void 0)try{l$1=(await m({workspacePath:o})).contract;}catch{l$1=null;}let t=e.verify;t===void 0&&(t=await P(v.join(o,d$1),d$1));let d=e.impact;if(d===void 0&&(d=await P(v.join(o,g),g)),e.target.kind==="release-blocked"){let s=t?.blockingReasons??[],i=(r.summary?.projectCount??r.projects.length)===0,g=[p("verdict",i?"Workspace scaffold posture":"Release verdict",t?i?`Scaffold posture: **${t.summary.verdict}** (exit ${t.summary.exitCode}). Freshness: **${t.freshness.verdict}**. No registered projects yet \u2014 release gates apply after the first project is added.`:`Verdict: **${t.summary.verdict}** (exit ${t.summary.exitCode}). Risk: **${t.impact.risk}**. Freshness: **${t.freshness.verdict}**.`:"No workspace verify report found. Run `npx workspai workspace verify --json --write` first."),p("blockers",i?"Pre-project signals":"Blocking reasons",s.length?s.map(h=>`- ${h}`).join(`
|
|
2
2
|
`):i?"No pre-project signals in the latest verify report.":"No blocking reasons in the latest verify report.")];return t?.resolutionHints?.length&&g.push(p("resolution","Resolution hints",t.resolutionHints.map(h=>`- **${h.blockerId}** (${h.resolutionClass}): ${h.commandRetryHint??h.fixHints[0]?.detail??"See fix hints"}`).join(`
|
|
3
3
|
`))),{schemaVersion:a,generatedAt:n,workspacePath:o,target:e.target,summary:t?i?b(s.length,t.summary.verdict):s.length>0||t.summary.verdict==="blocked"?`Release blocked: ${t.summary.verdict} with ${s.length} blocking reason(s).`:t.summary.verdict==="needs-attention"?"Release needs attention: advisory or incomplete verification evidence remains; no blocking reason was reported.":`Release posture: ${t.summary.verdict}; no blocking reason was reported.`:"Release posture unknown \u2014 verify report missing.",sections:g,releaseVerdict:t?.summary.verdict,evidenceFreshness:t?.freshness.verdict,blocking:!!(t&&(t.summary.verdict==="blocked"||s.length>0)),releaseRisk:t?.impact.risk,blockingReasons:s,resolutionHints:t?.resolutionHints}}if(e.target.kind==="blocker"){let s=e.target,m=t?.resolutionHints?.find(g=>g.blockerId===s.blockerId),i=t?.blockingReasons.find(g=>g.includes(s.blockerId))??t?.blockingReasons[0];return {schemaVersion:a,generatedAt:n,workspacePath:o,target:s,summary:m?`Blocker ${s.blockerId}: ${m.resolutionClass}`:`Blocker ${s.blockerId} (no structured hint)`,sections:[p("reason","Blocking signal",i??"No matching blocking reason in verify."),p("hint","Resolution class",m?`${m.resolutionClass}
|
|
4
4
|
|
|
@@ -2,7 +2,7 @@ import {c as c$1}from'./chunk-HCFWT42C.js';import {a}from'./chunk-A5FBGRJA.js';i
|
|
|
2
2
|
`);}async function re(e,r){let t=p.dirname(e);await promises.mkdir(t,{recursive:true});let o=`${e}.${process.pid}.${randomUUID()}.tmp`;try{await promises.writeFile(o,r);let a=await promises.open(o,"r");try{await te(a);}finally{await a.close();}try{await promises.rename(o,e);}catch(s){let i=s.code;if(i!=="EEXIST"&&i!=="EPERM")throw s;await ne.move(o,e,{overwrite:true});}}finally{await promises.rm(o,{force:true}).catch(()=>{});}}async function q(e){try{return {exists:true,content:await promises.readFile(e)}}catch(r){if(r.code==="ENOENT")return {exists:false};throw r}}async function Q(e,r){if(!r.exists){await promises.rm(e,{force:true});return}await re(e,r.content);}async function ue(e,r){let t=p.join(e,"workspaces.json.lock"),o=randomUUID();await promises.mkdir(e,{recursive:true});let a=Date.now(),s;for(;!s;)try{s=await promises.open(t,"wx"),await s.writeFile(`${JSON.stringify({pid:process.pid,lockId:o,createdAt:new Date().toISOString()})}
|
|
3
3
|
`),await te(s);}catch(i){if(i.code!=="EEXIST")throw i;let n=await promises.stat(t).catch(()=>null);if(n&&Date.now()-n.mtimeMs>ce){let d=await promises.readFile(t,"utf8").then(m=>JSON.parse(m)).catch(()=>null),u=Number(d?.pid),w=false;if(Number.isInteger(u)&&u>0)try{process.kill(u,0),w=true;}catch(m){w=m.code==="EPERM";}if(!w){await promises.rm(t,{force:true}).catch(()=>{});continue}}if(Date.now()-a>pe)throw new Error(`Timed out waiting for workspace registry lock: ${t}`);await new Promise(d=>setTimeout(d,25));}try{return await r()}finally{await s.close().catch(()=>{}),await promises.readFile(t,"utf8").then(n=>JSON.parse(n).lockId===o).catch(()=>false)&&await promises.rm(t,{force:true}).catch(()=>{});}}async function _(e){let r$1=q$1(),t=p.join(r$1,"workspaces.json"),o=p.join(r(),"workspaces.json"),a=[...new Set(s$1())];return ue(r$1,async()=>{let[s,i]=await Promise.all([q(t),q(o)]),n=await ee(a);await e(n);let d=b(n);try{await K(t,d),await K(o,d);}catch(u){let m=(await Promise.allSettled([Q(t,s),Q(o,i)])).filter(g=>g.status==="rejected").map(g=>g.reason);throw m.length>0?new AggregateError([u,...m],"Workspace registry transaction failed and could not be fully restored"):u}return d})}async function oe(e,r){let t=a(e);await _(o=>{let a=o.workspaces.find(s=>s.path===t);if(a){a.name=r,a.mode=a.mode||"full",a.projects=Array.isArray(a.projects)?a.projects:[];return}o.workspaces.push({name:r,path:t,mode:"full",projects:[]});});}async function ze(e){let r=a(e),o=(await ee()).workspaces.find(a=>a.path===r);return o?{...o,projects:o.projects.map(a=>({...a}))}:null}async function Ge(e,r){let t=a(e);await _(o=>{let a=o.workspaces.findIndex(i=>i.path===t);if(!r){a>=0&&o.workspaces.splice(a,1);return}let s=B(r);a>=0?o.workspaces[a]=s:o.workspaces.push(s);});}async function Me(e){let r=a(e);await _(t=>{t.workspaces=t.workspaces.filter(o=>o.path!==r);});}async function ke(e,r){try{await oe(e,r);}catch{console.warn(c.gray("Note: Could not register workspace in shared registry"));}}async function Ve(e,r=false){let t$1=a(e),o={workspacePath:t$1,workspaceFound:false,added:[],skipped:0};try{let a$1=await F(),s=a$1.workspaces.find(g=>g.path===t$1);if(!s){if(await ke(t$1,p.basename(p.resolve(e))),a$1=await F(),s=a$1.workspaces.find(g=>g.path===t$1),!s)return r||console.log("\u26A0\uFE0F Workspace could not be registered in registry"),o;r||console.log("\u2714 Registered workspace in shared registry");}Array.isArray(s.projects)||(s.projects=[]);let i=0,n=0,d=[],u=[],w=[e],m=new Set;for(;w.length>0;){let g=w.shift();if(!g||m.has(g))continue;m.add(g);let y=await promises.readdir(g,{withFileTypes:true});for(let h of y){if(!h.isDirectory()||h.name.startsWith(".")||["node_modules","dist","build","target","coverage","htmlcov"].includes(h.name))continue;let j=p.join(g,h.name),f=a(j);try{let k=false;for(let $ of [...t(f,"context.json"),...t(f,"project.json")])try{await promises.access($),k=true;break}catch{}if(k){let $=p.basename(f),R=s.projects.some(C=>C.path===f);u.push({name:$,path:f}),R?n++:(s.projects.push({name:$,path:f}),i++,d.push(f),r||console.log(`\u2714 Added: ${p.relative(e,f)}`));continue}}catch{}w.push(j);}}return await _(g=>{let y=g.workspaces.find(f=>f.path===t$1);if(!y)return;let h=`${t$1}${p.sep}`,j=(y.projects||[]).filter(f=>f.path!==t$1&&!f.path.startsWith(h));y.projects=B({...y,projects:[...j,...u]}).projects;}),i>0?r||console.log(`
|
|
4
4
|
\u2705 Synced ${i} project(s) to registry`):r||console.log(`
|
|
5
|
-
\u2705 All projects already registered (${n} found)`),{workspacePath:t$1,workspaceFound:true,added:d,skipped:n}}catch(a){return r||console.error("\u274C Failed to sync projects:",a.message),o}}async function we(e,r,t){let o=a(e),a$1=a(t);await _(s=>{let i=s.workspaces.find(u=>u.path===o);if(!i)throw new Error(`Workspace is not registered: ${o}`);i.projects=Array.isArray(i.projects)?i.projects:[];let n=i.projects.findIndex(u=>u.path===a$1||u.name===r),d={name:r,path:a$1};n>=0?i.projects[n]=d:i.projects.push(d);});}async function Ye(e,r,t){try{await we(e,r,t);}catch{}}async function He(e,r){let t=P("Creating Workspai workspace...").start();try{await promises.mkdir(e,{recursive:true}),await promises.mkdir(p.join(e,".workspai"),{recursive:true});let o={workspace_name:r.name,author:r.author,rapidkit_version:h(),created_at:new Date().toISOString(),type:"workspace"};await promises.writeFile(p.join(e,".workspai","config.json"),JSON.stringify(o,null,2));let{syncWorkspaceFoundationFiles:a}=await import('./create-
|
|
5
|
+
\u2705 All projects already registered (${n} found)`),{workspacePath:t$1,workspaceFound:true,added:d,skipped:n}}catch(a){return r||console.error("\u274C Failed to sync projects:",a.message),o}}async function we(e,r,t){let o=a(e),a$1=a(t);await _(s=>{let i=s.workspaces.find(u=>u.path===o);if(!i)throw new Error(`Workspace is not registered: ${o}`);i.projects=Array.isArray(i.projects)?i.projects:[];let n=i.projects.findIndex(u=>u.path===a$1||u.name===r),d={name:r,path:a$1};n>=0?i.projects[n]=d:i.projects.push(d);});}async function Ye(e,r,t){try{await we(e,r,t);}catch{}}async function He(e,r){let t=P("Creating Workspai workspace...").start();try{await promises.mkdir(e,{recursive:true}),await promises.mkdir(p.join(e,".workspai"),{recursive:true});let o={workspace_name:r.name,author:r.author,rapidkit_version:h(),created_at:new Date().toISOString(),type:"workspace"};await promises.writeFile(p.join(e,".workspai","config.json"),JSON.stringify(o,null,2));let{syncWorkspaceFoundationFiles:a}=await import('./create-TPUFKW6B.js');await a(e,{workspaceName:r.name,installMethod:"venv",writeMarker:true,writeGitignore:false,onlyIfMissing:true});let s=fe();await promises.writeFile(p.join(e,"rapidkit"),s),await promises.chmod(p.join(e,"rapidkit"),493);let i=he();await promises.writeFile(p.join(e,"rapidkit.cmd"),i);let n=ye(r.name);await promises.writeFile(p.join(e,"README.md"),n),await promises.writeFile(p.join(e,".gitignore"),`# Workspai workspace
|
|
6
6
|
.env
|
|
7
7
|
.env.*
|
|
8
8
|
!.env.example
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {f,e as e$2,g as g$1}from'./chunk-NVQUBUTY.js';import {b as b$4}from'./chunk-
|
|
1
|
+
import {f,e as e$2,g as g$1}from'./chunk-NVQUBUTY.js';import {b as b$4}from'./chunk-JEGG4EEZ.js';import {b as b$7,a as a$3}from'./chunk-THIOE2PB.js';import {b as b$2}from'./chunk-B6FJ6RG6.js';import {a as a$2}from'./chunk-KCJ3VS6R.js';import {e,g,f as f$1,b as b$6,c as c$1,d as d$3}from'./chunk-PTNLVI62.js';import {d,b as b$1}from'./chunk-Y5YAP4F3.js';import {d as d$4}from'./chunk-KG3TUTXU.js';import {h,e as e$1,b as b$3,d as d$1}from'./chunk-X6TNBARH.js';import {a as a$1}from'./chunk-TQEMLBAG.js';import {b,a,c,d as d$2}from'./chunk-MOSXTVPU.js';import {b as b$5,k,j,m,i,t,s,q as q$1}from'./chunk-RJIYCDVC.js';import {promises}from'fs';import*as P from'fs-extra';import p from'path';import r from'chalk';import {execa}from'execa';function st(e){let n=e.projectCount??0,t=n===1?"project":"projects",a=e.pythonEngine==="installed"?`Python ${e.pythonVersion||"3.10+"} \xB7 ${e.installMethod||"local environment"}`:e.pythonEngine==="skipped"?"Python engine not installed":"Runtime-neutral foundation";return ["","\u2713 Workspace ready",`${e.workspaceName} \xB7 ${e.profile} \xB7 ${n} registered ${t}`,`Location ${e.workspacePath}`,`Runtime ${a}`,...e.note?[`Note ${e.note}`]:[],"","Workspace Intelligence"," \u2713 Contract and project registry"," \u2713 Canonical model and proof-backed graph"," \u2713 Agent context, grounding, and evidence index","","Next",` ${g$1(e.workspacePath)}`," npx workspai create"," npx workspai workspace intelligence run --for-agent generic --strict --json","","Evidence .workspai/reports/INDEX.json","Guide README.md",""]}function q(e){let n=st(e);for(let t of n)t==="\u2713 Workspace ready"?console.log(r.green.bold(t)):t==="Workspace Intelligence"||t==="Next"?console.log(r.cyan.bold(t)):t.startsWith(" \u2713")?console.log(r.green(t)):t.startsWith("Location")||t.startsWith("Runtime")?console.log(r.gray(t)):console.log(t);}function M(){return i()}var lt="transactions";function ct(){return p.join(q$1(),lt)}async function Ve(){let e=ct();return await b$7(e),a$3({journalDirectory:e})}async function Ge(e){for(let n of s())await e.captureFile(n);}async function ae(e){let n=await Ve();try{return await Ge(n),await n.captureOwnedTree(e),n}catch(t){return K(n,t)}}async function pt(e){let n=await Ve();try{await Ge(n),await n.captureOwnedTree(p.join(e,a)),await n.captureOwnedTree(p.join(e,".venv"));let t=[c,".gitignore",p.join(a,"workspace.json"),p.join(a,"toolchain.lock"),p.join(a,"policies.yml"),p.join(a,"cache-config.yml"),d$4,a$2,"pyproject.toml","poetry.toml","poetry.lock","rapidkit","rapidkit.cmd","README.md",".rapidkit-global"];for(let a of t)await n.captureFile(p.join(e,a));return n}catch(t){return K(n,t)}}async function z(e){await e.commit(),e.journalPath&&await promises.rm(p.dirname(e.journalPath),{recursive:true,force:true}).catch(n=>e$1.debug(`Could not remove committed lifecycle journal: ${n}`));}async function K(e,n){try{await e.rollback();}catch(t){throw new AggregateError([n,t],"Workspace lifecycle failed and rollback was incomplete.")}throw n}async function B(e,n,t,a,s){let l=d(n,h(),t,s?.pythonEngine?{coreStatus:s.pythonEngine,...s.pythonEngineReason?{coreReason:s.pythonEngineReason}:{},...a?{pythonVersion:a}:{}}:void 0);a&&!s?.pythonEngine&&(l.metadata||(l.metadata={}),l.metadata.python={pythonVersion:a}),await b$1(e,l);}async function G(e){await P.outputFile(p.join(e,".gitignore"),`.venv/
|
|
2
2
|
__pycache__/
|
|
3
3
|
*.pyc
|
|
4
4
|
.env
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {i,e}from'./chunk-NZ3WZYD5.js';var _=".workspai/skills";var p=e.skillsIndex,a=e.explain,c=i.workspaceWhy,P=i.workspaceTrace,O=".workspai/AGENT-GROUNDING.md",I=".rapidkit/AGENT-GROUNDING.md",A=".cursor/rules/workspai-grounding.mdc",R=".cursor/rules/workspai-evidence.mdc",E=".cursor/rules/workspai-diagnose.mdc",T=".cursor/rules/workspai-repair.mdc",L=".cursor/rules/workspai-release.mdc",S=".cursor/rules/rapidkit-grounding.mdc",d=".windsurfrules",k=".windsurf/rules/workspai-grounding.md",C=".windsurf/rules/workspai-evidence.md",u=".grok/rules/workspai-grounding.md",N=".grok/rules/workspai-evidence.md",l=".claude/rules/workspai-evidence.md",K=".claude/rules/workspai-workspace.md",m=".claude/rules/rapidkit-evidence.md",g=".amazonq/rules/workspai-workspace.md",G=".github/instructions/workspai-workspace.instructions.md",x=".github/instructions/rapidkit-workspace.instructions.md",w=".github/instructions/workspai-evidence.instructions.md",H=".github/instructions/rapidkit-evidence.instructions.md",D=".github/prompts/workspai-diagnose.prompt.md",U=".github/prompts/rapidkit-diagnose.prompt.md",W=".github/prompts/workspai-repair.prompt.md",h=".github/prompts/rapidkit-repair.prompt.md",b=".github/prompts/workspai-release-readiness.prompt.md",M=".github/prompts/rapidkit-release-readiness.prompt.md",Y=".github/prompts/workspai-project-onboard.prompt.md",f=".github/prompts/rapidkit-project-onboard.prompt.md",v=".github/prompts/workspai-adopt-project.prompt.md",B=".github/prompts/rapidkit-adopt-project.prompt.md",V=".github/skills/workspai-grounding/SKILL.md",y=".github/skills/rapidkit-grounding/SKILL.md",F=".github/skills/workspai-workspace-intelligence/SKILL.md",j=".github/skills/rapidkit-workspace-intelligence/SKILL.md",J=".cursor/skills/workspai-grounding/SKILL.md",X=".claude/skills/workspai-grounding/SKILL.md",$=".agents/skills/workspai-grounding/SKILL.md",z=".grok/skills/workspai-grounding/SKILL.md",q=i.workspaiMcpDesign,Q=i.legacyMcpDesign,Z=i.agentHooks,ss=".vscode/rapidkit-agent-hooks.json";function os(r){let o=r.trim();if(!o||o.includes("..")||o.includes("/"))throw new Error(`Invalid operational skill id: ${r}`);return `${_}/${o}.md`}var ts={"workspai-diagnose-api-failure":"workspai-diagnose","workspai-release-readiness":"workspai-release-readiness","workspai-safe-schema-migration":"workspai-safe-schema-migration","workspai-dependency-upgrade":"workspai-dependency-upgrade","workspai-rename-contract":"workspai-rename-contract"};export{D as A,U as B,W as C,h as D,b as E,M as F,Y as G,f as H,v as I,B as J,V as K,y as L,F as M,j as N,J as O,X as P,$ as Q,z as R,q as S,Q as T,Z as U,ss as V,os as W,ts as X,_ as a,p as b,a as c,c as d,P as e,O as f,I as g,A as h,R as i,E as j,T as k,L as l,S as m,d as n,k as o,C as p,u as q,N as r,l as s,K as t,m as u,g as v,G as w,x,w as y,H as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-LPCWROQ3.js';import {f,e as e$1,g as g$1,i}from'./chunk-NZ3WZYD5.js';var g=f.repairTransaction,v=e$1.repairTransaction,b=g$1.repairTransaction;var k="workspai.workspace-repair-proposal.v1",x="contracts/workspace-intelligence/workspace-repair-proposal.v1.json";var m="workspai.workspace-repair-capabilities.v1",y="workspai.workspace-repair-consumer-protocol.v1",w=[{id:"node",ecosystem:"JavaScript / TypeScript",manifests:["package.json"],lockfiles:["package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb"],packageManagers:["npm","pnpm","yarn","bun"],support:"full",stages:{reconcile:"native",audit:"native",test:"declared",build:"declared"},requiredToolFamilies:["selected package manager"]},{id:"python",ecosystem:"Python",manifests:["pyproject.toml","requirements.txt"],lockfiles:["uv.lock","poetry.lock","requirements.txt"],packageManagers:["uv","poetry","pip"],support:"conditional",stages:{reconcile:"conditional",audit:"conditional",test:"conditional",build:"declared"},requiredToolFamilies:["isolated Python","selected environment manager","pip-audit or governed Doctor audit"],limitation:"A bounded isolated environment and an installed audit surface are required."},{id:"go",ecosystem:"Go",manifests:["go.mod"],lockfiles:["go.sum"],packageManagers:["go modules"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["go","govulncheck"],limitation:"govulncheck must be installed; the engine never fetches an unreviewed tool."},{id:"rust",ecosystem:"Rust",manifests:["Cargo.toml"],lockfiles:["Cargo.lock"],packageManagers:["cargo"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["cargo","cargo-audit"],limitation:"The cargo-audit subcommand must already be installed."},{id:"php-composer",ecosystem:"PHP",manifests:["composer.json"],lockfiles:["composer.lock"],packageManagers:["composer"],support:"full",stages:{reconcile:"native",audit:"native",test:"declared",build:"declared"},requiredToolFamilies:["composer"]},{id:"ruby-bundler",ecosystem:"Ruby",manifests:["Gemfile"],lockfiles:["Gemfile.lock"],packageManagers:["bundler"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"declared",build:"declared"},requiredToolFamilies:["bundle","bundle-audit"],limitation:"bundle-audit and the declared Rake tasks must already exist."},{id:"elixir-mix",ecosystem:"Elixir",manifests:["mix.exs"],lockfiles:["mix.lock"],packageManagers:["mix"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["mix","Hex audit task"],limitation:"The project must expose the Hex audit task used by its dependency policy."},{id:"deno",ecosystem:"Deno",manifests:["deno.json","deno.jsonc"],lockfiles:["deno.lock"],packageManagers:["deno"],support:"full",stages:{reconcile:"native",audit:"native",test:"declared",build:"declared"},requiredToolFamilies:["deno"]},{id:"dotnet",ecosystem:".NET",manifests:["*.sln","*.csproj","*.fsproj","*.vbproj"],lockfiles:["Directory.Packages.props","packages.lock.json"],packageManagers:["NuGet / dotnet"],support:"full",stages:{reconcile:"native",audit:"native",test:"native",build:"native"},requiredToolFamilies:["dotnet"]},{id:"jvm-maven",ecosystem:"JVM / Maven",manifests:["pom.xml"],lockfiles:[],packageManagers:["Maven Wrapper","Maven"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["mvnw or mvn","governed Doctor audit"],limitation:"A project-specific dependency audit command must be declared by Doctor evidence."},{id:"jvm-gradle",ecosystem:"JVM / Gradle",manifests:["build.gradle.kts","build.gradle"],lockfiles:["gradle.lockfile","gradle/libs.versions.toml"],packageManagers:["Gradle Wrapper","Gradle"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["gradlew or gradle","governed Doctor audit"],limitation:"A project-specific dependency audit command must be declared by Doctor evidence."},{id:"clojure",ecosystem:"Clojure",manifests:["deps.edn","project.clj"],lockfiles:[],packageManagers:["Clojure CLI","Leiningen"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"conditional",build:"conditional"},requiredToolFamilies:["clojure or lein","governed project audit"],limitation:"Tests and builds run only when the selected Clojure project surface declares a deterministic entrypoint."},{id:"scala-sbt",ecosystem:"Scala / sbt",manifests:["build.sbt"],lockfiles:[],packageManagers:["sbt"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["sbt","governed project audit"],limitation:"A project-specific dependency audit command must be declared by Doctor evidence."}];function T(){return {schemaVersion:m,owner:"Workspai CLI",workflow:["plan","preconditions","approval","target-precondition","checkpoint","execute","reconcile","audit","test","build","target-producer-verify","canonical-verify","close-or-rollback-or-decision"],invariants:{multiAdapterProjects:true,missingTools:"decision-required",unsupportedEcosystems:"decision-required",silentFallbackToModelExecution:false,mutationAuthority:"cli-only",targetClosure:"selected-causal-action-set",changeReceipt:"checkpoint-hash-delta",consumerTimeline:"durable-transaction-events",typedDecisionCauses:true,registeredLinkedProjectMutationBoundary:true,sourceProposalIntegrity:"project-bound-hash-pinned",completionAuthority:"cli-verification-receipt",goalSourceTransition:"closed-integrity-bound-v1",goalAttemptBudget:"durable-serialized-v1",consumerHandshakeRequired:true,ephemeralProposalsAreEvidence:false,approvalBoundToPlanHash:true,canonicalVerificationRequired:true,rollbackConflictDetection:true},consumerProtocol:{protocolVersion:y,versionProbe:{args:["--version","--json"],schemaVersion:"rapidkit-version-v1"},capabilityProbe:{args:["workspace","repair","capabilities","--json"],schemaVersion:m},invocation:{command:"workspace repair",workspaceResolution:["process-cwd","--workspace"],actions:["capabilities","plan","propose","approve","decide","execute","resume","status","list","rollback","cancel"]},contracts:{operationResult:a$1,proposal:k,transaction:g},transientPaths:[".workspai/repair/inbox/*.json",".workspai/repair/engine.lock"]},adapters:w}}var N="workspai.studio-card-repair-capabilities.v1",R="npx workspai workspace verify --json",r=e$1,a=i;function e(f,n,c,o={}){return {cardId:f,scope:o.scope??"workspace",producerCommand:n,producerArtifact:c,verifyCommand:n,verifyArtifact:c,aggregateVerifyCommand:R,targetClosure:"exact-producer-and-causal-action-set",workspacePosture:"reported-separately",repairPolicy:o.repairPolicy??"refresh-producer",remediationArtifacts:o.remediationArtifacts??[]}}var M=[e("doctor","npx workspai doctor workspace --json",r.doctor,{repairPolicy:"diagnose-and-repair",remediationArtifacts:[a.doctorRemediationPlan,a.artifactRemediationPlan]}),e("projectDoctor","npx workspai doctor project --json",a.doctorProject,{scope:"project",repairPolicy:"diagnose-and-repair",remediationArtifacts:[a.doctorRemediationPlan,a.artifactRemediationPlan]}),e("pipeline","npx workspai pipeline --json --strict",a.pipelineLastRun,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("analyze","npx workspai analyze --json",r.analyze,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("readiness","npx workspai readiness --json",r.readiness,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("bootstrap","npx workspai bootstrap --ci --json",a.bootstrapCompliance,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("workspaceSync","npx workspai workspace sync --json",a.workspaceRegistry),e("foundation","npx workspai workspace foundation ensure --json",".workspai/workspace.json"),e("contract","npx workspai workspace contract verify --strict --json",r.contractVerify,{repairPolicy:"source-repair-then-produce"}),e("autopilot","npx workspai autopilot release --json",a.autopilotReleaseLastRun,{repairPolicy:"source-repair-then-produce"}),e("workspaceRun","npx workspai workspace run test --json",a.workspaceRunLast,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("setup","npx workspai setup --json",".workspai/toolchain.lock",{repairPolicy:"source-repair-then-produce"}),e("importReadiness","npx workspai doctor project --json",a.doctorProject,{scope:"project",repairPolicy:"diagnose-and-repair",remediationArtifacts:[a.artifactRemediationPlan]}),e("snapshot","npx workspai snapshot create --json",".workspai/reports/snapshot-last-run.json"),e("workspaceModel","npx workspai workspace model --json --write",r.model),e("intelligenceSnapshot","npx workspai workspace snapshot --json",r.snapshot),e("workspaceDiff",`npx workspai workspace diff --from ${r.snapshot} --json`,r.diff),e("workspaceImpact",`npx workspai workspace impact --from ${r.diff} --json`,r.impact),e("workspaceIntelligenceRun","npx workspai workspace intelligence run --for-agent generic --strict --json",r.intelligenceRun,{repairPolicy:"source-repair-then-produce"}),e("workspaceVerify",R,r.verify,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[a.artifactRemediationPlan]}),e("workspaceExplain","npx workspai workspace explain release-blocked --json --write",r.explain),e("workspaceWhy","npx workspai workspace why release-blocked --json --write",a.workspaceWhy),e("workspaceTrace",`npx workspai workspace trace --from ${r.diff} --json --write`,a.workspaceTrace),e("workspaceWatch","npx workspai workspace watch --once --json",r.model),e("workspaceContextAgent","npx workspai workspace context --for-agent --json --write",r.agentContext),e("agentGrounding","npx workspai workspace agent-sync --write --refresh-context --json --preset enterprise --target vscode",r.agentCustomizationPack),e("share",`npx workspai workspace share --output ${a.workspaceShareBundle} --json`,a.workspaceShareBundle),e("archive","npx workspai workspace export --output team-workspace.workspai-archive.zip --json",".workspai/archive-manifest.json"),e("mirror","npx workspai mirror status --json",a.mirrorOps),e("cache","npx workspai cache status --json",".workspai/cache-config.yml"),e("policy","npx workspai workspace policy show --json",".workspai/policies.yml",{repairPolicy:"source-repair-then-produce"}),e("infra","npx workspai infra plan --json",a.infraPlan,{repairPolicy:"source-repair-then-produce"})];export{g as a,v as b,b as c,k as d,x as e,m as f,w as g,T as h,N as i,M as j};
|
|
1
|
+
import {a as a$1}from'./chunk-LPCWROQ3.js';import {f,e as e$1,g as g$1,i}from'./chunk-NZ3WZYD5.js';var g=f.repairTransaction,v=e$1.repairTransaction,b=g$1.repairTransaction;var k="workspai.workspace-repair-proposal.v1",x="contracts/workspace-intelligence/workspace-repair-proposal.v1.json";var m="workspai.workspace-repair-capabilities.v1",y="workspai.workspace-repair-consumer-protocol.v1",w=[{id:"node",ecosystem:"JavaScript / TypeScript",manifests:["package.json"],lockfiles:["package-lock.json","npm-shrinkwrap.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb"],packageManagers:["npm","pnpm","yarn","bun"],support:"full",stages:{reconcile:"native",audit:"native",test:"declared",build:"declared"},requiredToolFamilies:["selected package manager"]},{id:"python",ecosystem:"Python",manifests:["pyproject.toml","requirements.txt"],lockfiles:["uv.lock","poetry.lock","requirements.txt"],packageManagers:["uv","poetry","pip"],support:"conditional",stages:{reconcile:"conditional",audit:"conditional",test:"conditional",build:"declared"},requiredToolFamilies:["isolated Python","selected environment manager","pip-audit or governed Doctor audit"],limitation:"A bounded isolated environment and an installed audit surface are required."},{id:"go",ecosystem:"Go",manifests:["go.mod"],lockfiles:["go.sum"],packageManagers:["go modules"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["go","govulncheck"],limitation:"govulncheck must be installed; the engine never fetches an unreviewed tool."},{id:"rust",ecosystem:"Rust",manifests:["Cargo.toml"],lockfiles:["Cargo.lock"],packageManagers:["cargo"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["cargo","cargo-audit"],limitation:"The cargo-audit subcommand must already be installed."},{id:"php-composer",ecosystem:"PHP",manifests:["composer.json"],lockfiles:["composer.lock"],packageManagers:["composer"],support:"full",stages:{reconcile:"native",audit:"native",test:"declared",build:"declared"},requiredToolFamilies:["composer"]},{id:"ruby-bundler",ecosystem:"Ruby",manifests:["Gemfile"],lockfiles:["Gemfile.lock"],packageManagers:["bundler"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"declared",build:"declared"},requiredToolFamilies:["bundle","bundle-audit"],limitation:"bundle-audit and the declared Rake tasks must already exist."},{id:"elixir-mix",ecosystem:"Elixir",manifests:["mix.exs"],lockfiles:["mix.lock"],packageManagers:["mix"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["mix","Hex audit task"],limitation:"The project must expose the Hex audit task used by its dependency policy."},{id:"deno",ecosystem:"Deno",manifests:["deno.json","deno.jsonc"],lockfiles:["deno.lock"],packageManagers:["deno"],support:"full",stages:{reconcile:"native",audit:"native",test:"declared",build:"declared"},requiredToolFamilies:["deno"]},{id:"dotnet",ecosystem:".NET",manifests:["*.sln","*.csproj","*.fsproj","*.vbproj"],lockfiles:["Directory.Packages.props","packages.lock.json"],packageManagers:["NuGet / dotnet"],support:"full",stages:{reconcile:"native",audit:"native",test:"native",build:"native"},requiredToolFamilies:["dotnet"]},{id:"jvm-maven",ecosystem:"JVM / Maven",manifests:["pom.xml"],lockfiles:[],packageManagers:["Maven Wrapper","Maven"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["mvnw or mvn","governed Doctor audit"],limitation:"A project-specific dependency audit command must be declared by Doctor evidence."},{id:"jvm-gradle",ecosystem:"JVM / Gradle",manifests:["build.gradle.kts","build.gradle"],lockfiles:["gradle.lockfile","gradle/libs.versions.toml"],packageManagers:["Gradle Wrapper","Gradle"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["gradlew or gradle","governed Doctor audit"],limitation:"A project-specific dependency audit command must be declared by Doctor evidence."},{id:"clojure",ecosystem:"Clojure",manifests:["deps.edn","project.clj"],lockfiles:[],packageManagers:["Clojure CLI","Leiningen"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"conditional",build:"conditional"},requiredToolFamilies:["clojure or lein","governed project audit"],limitation:"Tests and builds run only when the selected Clojure project surface declares a deterministic entrypoint."},{id:"scala-sbt",ecosystem:"Scala / sbt",manifests:["build.sbt"],lockfiles:[],packageManagers:["sbt"],support:"conditional",stages:{reconcile:"native",audit:"conditional",test:"native",build:"native"},requiredToolFamilies:["sbt","governed project audit"],limitation:"A project-specific dependency audit command must be declared by Doctor evidence."}];function T(){return {schemaVersion:m,owner:"Workspai CLI",workflow:["plan","preconditions","approval","target-precondition","checkpoint","execute","reconcile","audit","test","build","target-producer-verify","canonical-verify","close-or-rollback-or-decision"],invariants:{multiAdapterProjects:true,missingTools:"decision-required",unsupportedEcosystems:"decision-required",silentFallbackToModelExecution:false,mutationAuthority:"cli-only",targetClosure:"selected-causal-action-set",changeReceipt:"checkpoint-hash-delta",consumerTimeline:"durable-transaction-events",typedDecisionCauses:true,registeredLinkedProjectMutationBoundary:true,sourceProposalIntegrity:"project-bound-hash-pinned",completionAuthority:"cli-verification-receipt",goalSourceTransition:"closed-integrity-bound-v1",goalAttemptBudget:"durable-serialized-v1",consumerHandshakeRequired:true,ephemeralProposalsAreEvidence:false,approvalBoundToPlanHash:true,canonicalVerificationRequired:true,rollbackConflictDetection:true},consumerProtocol:{protocolVersion:y,versionProbe:{args:["--version","--json"],schemaVersion:"rapidkit-version-v1"},capabilityProbe:{args:["workspace","repair","capabilities","--json"],schemaVersion:m},invocation:{command:"workspace repair",workspaceResolution:["process-cwd","--workspace"],actions:["capabilities","plan","propose","approve","decide","execute","resume","status","list","rollback","cancel"]},contracts:{operationResult:a$1,proposal:k,transaction:g},transientPaths:[".workspai/repair/inbox/*.json",".workspai/repair/engine.lock"]},adapters:w}}var N="workspai.studio-card-repair-capabilities.v1",R="npx workspai workspace verify --json",a=e$1,r=i;function e(f,n,c,o={}){return {cardId:f,scope:o.scope??"workspace",producerCommand:n,producerArtifact:c,verifyCommand:n,verifyArtifact:c,aggregateVerifyCommand:R,targetClosure:"exact-producer-and-causal-action-set",workspacePosture:"reported-separately",repairPolicy:o.repairPolicy??"refresh-producer",remediationArtifacts:o.remediationArtifacts??[]}}var M=[e("doctor","npx workspai doctor workspace --json",a.doctor,{repairPolicy:"diagnose-and-repair",remediationArtifacts:[r.doctorRemediationPlan,r.artifactRemediationPlan]}),e("projectDoctor","npx workspai doctor project --json",r.doctorProject,{scope:"project",repairPolicy:"diagnose-and-repair",remediationArtifacts:[r.doctorRemediationPlan,r.artifactRemediationPlan]}),e("pipeline","npx workspai pipeline --json --strict",r.pipelineLastRun,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[r.artifactRemediationPlan]}),e("analyze","npx workspai analyze --json",a.analyze,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[r.artifactRemediationPlan]}),e("readiness","npx workspai readiness --json",a.readiness,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[r.artifactRemediationPlan]}),e("bootstrap","npx workspai bootstrap --ci --json",r.bootstrapCompliance,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[r.artifactRemediationPlan]}),e("workspaceSync","npx workspai workspace sync --json",r.workspaceRegistry),e("foundation","npx workspai workspace foundation ensure --json",".workspai/workspace.json"),e("contract","npx workspai workspace contract verify --strict --json",a.contractVerify,{repairPolicy:"source-repair-then-produce"}),e("autopilot","npx workspai autopilot release --json",r.autopilotReleaseLastRun,{repairPolicy:"source-repair-then-produce"}),e("workspaceRun","npx workspai workspace run test --json",r.workspaceRunLast,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[r.artifactRemediationPlan]}),e("setup","npx workspai setup --json",".workspai/toolchain.lock",{repairPolicy:"source-repair-then-produce"}),e("importReadiness","npx workspai doctor project --json",r.doctorProject,{scope:"project",repairPolicy:"diagnose-and-repair",remediationArtifacts:[r.artifactRemediationPlan]}),e("snapshot","npx workspai snapshot create --json",".workspai/reports/snapshot-last-run.json"),e("workspaceModel","npx workspai workspace model --json --write",a.model),e("intelligenceSnapshot","npx workspai workspace snapshot --json",a.snapshot),e("workspaceDiff",`npx workspai workspace diff --from ${a.snapshot} --json`,a.diff),e("workspaceImpact",`npx workspai workspace impact --from ${a.diff} --json`,a.impact),e("workspaceIntelligenceRun","npx workspai workspace intelligence run --for-agent generic --strict --json",a.intelligenceRun,{repairPolicy:"source-repair-then-produce"}),e("workspaceVerify",R,a.verify,{repairPolicy:"source-repair-then-produce",remediationArtifacts:[r.artifactRemediationPlan]}),e("workspaceExplain","npx workspai workspace explain release-blocked --json --write",a.explain),e("workspaceWhy","npx workspai workspace why release-blocked --json --write",r.workspaceWhy),e("workspaceTrace",`npx workspai workspace trace --from ${a.diff} --json --write`,r.workspaceTrace),e("workspaceWatch","npx workspai workspace watch --once --json",a.model),e("workspaceContextAgent","npx workspai workspace context --for-agent --json --write",a.agentContext),e("agentGrounding","npx workspai workspace agent-sync --write --refresh-context --json --preset enterprise --target vscode",a.agentCustomizationPack),e("share",`npx workspai workspace share --output ${r.workspaceShareBundle} --json`,r.workspaceShareBundle),e("archive","npx workspai workspace export --output team-workspace.workspai-archive.zip --json",".workspai/archive-manifest.json"),e("mirror","npx workspai mirror status --json",r.mirrorOps),e("cache","npx workspai cache status --json",".workspai/cache-config.yml"),e("policy","npx workspai workspace policy show --json",".workspai/policies.yml",{repairPolicy:"source-repair-then-produce"}),e("infra","npx workspai infra plan --json",r.infraPlan,{repairPolicy:"source-repair-then-produce"})];export{g as a,v as b,b as c,k as d,x as e,m as f,w as g,T as h,N as i,M as j};
|