workspai 0.48.0 → 0.50.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 +151 -75
- package/contracts/analyze-last-run.v1.json +2 -2
- package/contracts/artifact-remediation-plan.v1.json +3 -9
- package/contracts/autopilot-release.v1.json +2 -0
- package/contracts/bootstrap-compliance.v1.json +2 -1
- package/contracts/cli-log-event.v1.json +1 -1
- package/contracts/cli-runtime-command-inventory.v1.snapshot.json +84 -0
- package/contracts/compatibility-matrix.v1.json +2 -0
- package/contracts/create-planner-capabilities.v1.json +144 -32
- package/contracts/doctor-project-evidence.v1.json +191 -11
- package/contracts/doctor-project-scan.v2.json +2 -0
- package/contracts/doctor-remediation-plan.v1.json +2 -2
- package/contracts/doctor-remediation-plan.v2.json +2 -2
- package/contracts/doctor-workspace-cache.v2.json +2 -0
- package/contracts/doctor-workspace-evidence.v1.json +189 -10
- package/contracts/extension-cli-compatibility.v1.json +11 -1
- package/contracts/infra-plan.v1.json +2 -0
- package/contracts/ingestion-plan.v1.json +85 -0
- package/contracts/ingestion-result.v1.json +59 -0
- package/contracts/mirror-ops.v1.json +2 -1
- package/contracts/pipeline-last-run.v1.json +2 -2
- package/contracts/private-product-manifest.v1.json +2 -0
- package/contracts/product-factory-plan.v1.json +2 -0
- package/contracts/project-archive.v1.json +2 -0
- package/contracts/project-entry-capability.v1.json +2 -3
- package/contracts/project-test-coverage.v1.json +189 -0
- package/contracts/project-workspace-link.v1.json +66 -0
- package/contracts/project-workspace-resolution.v1.json +28 -0
- package/contracts/published-contract-catalog.v1.json +50 -0
- package/contracts/release-readiness.v1.json +2 -2
- package/contracts/runtime-command-surface.v1.json +1456 -123
- package/contracts/transparency-evidence.v1.json +2 -1
- package/contracts/workspace-archive-capabilities.v1.json +11 -5
- package/contracts/workspace-archive-manifest.v1.json +236 -0
- package/contracts/workspace-archive-operation-result.v1.json +236 -0
- package/contracts/workspace-contract.v1.json +1 -1
- package/contracts/workspace-intelligence/agent-action-outcome.v1.json +2 -2
- package/contracts/workspace-intelligence/agent-customization-pack-report.v1.json +1 -1
- package/contracts/workspace-intelligence/agent-hooks.v1.json +2 -0
- package/contracts/workspace-intelligence/agent-reports-index.v1.json +1 -1
- package/contracts/workspace-intelligence/blocker-resolution.v1.json +3 -9
- package/contracts/workspace-intelligence/doctor-fix-result.v1.json +2 -2
- package/contracts/workspace-intelligence/doctor-graph-diagnosis.v1.json +208 -0
- package/contracts/workspace-intelligence/fact-freshness.v1.json +2 -2
- package/contracts/workspace-intelligence/mcp-design.v1.json +2 -0
- package/contracts/workspace-intelligence/model-usage-event.v1.json +1 -1
- package/contracts/workspace-intelligence/project-context-agent.v1.json +360 -0
- package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-context.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-contract-verify.v1.json +2 -2
- package/contracts/workspace-intelligence/workspace-dependency-graph.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-explain.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-graph-stream.v1.json +262 -0
- package/contracts/workspace-intelligence/workspace-graph-token-efficiency.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-impact.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-intelligence-evaluation-comparison.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-intelligence-history.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +2 -2
- package/contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +48 -5
- package/contracts/workspace-intelligence/workspace-knowledge-search.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-model-diff.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-model-snapshot.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-model.v1.json +97 -5
- package/contracts/workspace-intelligence/workspace-operational-skill.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-skills-index.v1.json +1 -1
- package/contracts/workspace-intelligence/workspace-verify.v1.json +1 -1
- package/contracts/workspace-intelligence-architecture.v1.json +33 -7
- package/contracts/workspace-intelligence-chain.v1.json +1 -1
- package/contracts/workspace-list.v1.json +2 -0
- package/contracts/workspace-model-cache.v1.json +2 -0
- package/contracts/workspace-registry.v1.json +1 -1
- package/contracts/workspace-run-last.v1.json +1 -1
- package/contracts/workspace-share-bundle.v1.json +2 -1
- package/contracts/workspace-snapshot.v1.json +2 -0
- package/contracts/workspace-snapshot.v2.json +2 -0
- package/contracts/workspace-sync.v1.json +2 -0
- package/contracts/workspace-watch-event.v1.json +2 -0
- package/dist/analyze-ZFQWTCJQ.js +1 -0
- package/dist/{artifact-remediation-plan-SPOUHMK5.js → artifact-remediation-plan-ICN3KOFG.js} +1 -1
- package/dist/autopilot-release-VKXQ7BS7.js +1 -0
- package/dist/chunk-2AXEGYPL.js +1 -0
- package/dist/chunk-2D4UOYOJ.js +1 -0
- package/dist/chunk-2OIBHUVH.js +1 -0
- package/dist/chunk-3GRKUP5W.js +33 -0
- package/dist/{managed-agent-markers-AXUM75OE.js → chunk-3RBUSW7H.js} +1 -1
- package/dist/chunk-5EXZBCAZ.js +4 -0
- package/dist/chunk-6UTM5AJI.js +1 -0
- package/dist/chunk-AFIFZTOY.js +2 -0
- package/dist/{chunk-BMWFQXGW.js → chunk-AHLMIL2T.js} +1 -1
- package/dist/chunk-AL237TSJ.js +7 -0
- package/dist/chunk-AL2A7Q4X.js +86 -0
- package/dist/{chunk-VU7NZHPM.js → chunk-BHYTI3RH.js} +1 -1
- package/dist/{chunk-ESLPI3XZ.js → chunk-BQGBU2Y3.js} +1 -1
- package/dist/chunk-C35UXTDM.js +2 -0
- package/dist/chunk-C3FLCDRN.js +2 -0
- package/dist/chunk-CZC5P2MF.js +1 -0
- package/dist/{chunk-Y5UJLPS4.js → chunk-DDQ3XK3H.js} +13 -13
- package/dist/{chunk-CRHYBQI3.js → chunk-DQ3PI7EP.js} +1 -1
- package/dist/chunk-EWZZUQBR.js +1 -0
- package/dist/{chunk-4KUIFXHM.js → chunk-GNQRYISX.js} +3 -3
- package/dist/chunk-I42F552T.js +2 -0
- package/dist/chunk-IDQKVJUF.js +2 -0
- package/dist/{chunk-3VFA7D5T.js → chunk-IND3TUVU.js} +1 -1
- package/dist/chunk-IPJ5URDF.js +1 -0
- package/dist/{chunk-I46XEIPL.js → chunk-JFUD73OZ.js} +52 -52
- package/dist/chunk-KKAOTTYO.js +8 -0
- package/dist/chunk-KMLPHFLD.js +2 -0
- package/dist/{chunk-NHN4QXPP.js → chunk-KVSYBHUR.js} +1 -1
- package/dist/chunk-KXG6E5VK.js +1 -0
- package/dist/chunk-L2YK5RV2.js +1 -0
- package/dist/chunk-LAJM2SBP.js +15 -0
- package/dist/{chunk-5S3DJQEP.js → chunk-LZQUZGXB.js} +1 -1
- package/dist/chunk-MOSXTVPU.js +1 -0
- package/dist/chunk-MV7KF75Q.js +13 -0
- package/dist/chunk-MVLIONQD.js +1 -0
- package/dist/chunk-RJIYCDVC.js +1 -0
- package/dist/{chunk-BGPXQQNY.js → chunk-RTVRZFIJ.js} +1 -1
- package/dist/chunk-RVQLMTTI.js +2 -0
- package/dist/chunk-SHXJ2GDR.js +75 -0
- package/dist/{chunk-32OJDBIG.js → chunk-SS2VV3D5.js} +1 -1
- package/dist/chunk-TDTCMZK7.js +10 -0
- package/dist/chunk-UETZ7USY.js +36 -0
- package/dist/chunk-VKTUWUS6.js +1 -0
- package/dist/chunk-VRW6KXNK.js +6 -0
- package/dist/chunk-Y5YAP4F3.js +2 -0
- package/dist/chunk-YPKNQCLK.js +2 -0
- package/dist/{create-DBQNAMKP.js → create-I23DC7SN.js} +1 -1
- package/dist/{demo-kit-DZ7TPG7K.js → demo-kit-KHH63TNA.js} +2 -2
- package/dist/{doctor-4NNUDNGZ.js → doctor-DOOMYLIH.js} +1 -1
- package/dist/{dotnet-webapi-clean-A6MVDYXX.js → dotnet-webapi-clean-VXEF4SHM.js} +5 -5
- package/dist/{gofiber-standard-I5YPQG5V.js → gofiber-standard-AQGSC7ON.js} +3 -3
- package/dist/{gogin-standard-VY2L4QT5.js → gogin-standard-7DU3OCBX.js} +3 -3
- package/dist/index.d.ts +41 -6
- package/dist/index.js +268 -356
- package/dist/managed-agent-markers-COE5DJ3W.js +1 -0
- package/dist/pipeline-U77HSINC.js +5 -0
- package/dist/platform-capabilities-PR6YL4KC.js +1 -0
- package/dist/project-intelligence-lens-BKKVPCLC.js +1 -0
- package/dist/project-test-coverage-4TEHZJFC.js +1 -0
- package/dist/{pythonRapidkitExec-CVCIK225.js → pythonRapidkitExec-YR7P5LWG.js} +1 -1
- package/dist/rust-axum-4HXDICIB.js +140 -0
- package/dist/{springboot-standard-55XKCBIZ.js → springboot-standard-EK6GYN5T.js} +7 -7
- package/dist/workspace-ZEYUVR26.js +1 -0
- package/dist/{workspace-agent-sync-662QHXGF.js → workspace-agent-sync-DKYJLUDP.js} +1 -1
- package/dist/workspace-archive-4JNT4S7N.js +1 -0
- package/dist/{workspace-context-23YYCUCP.js → workspace-context-IHUFMZT3.js} +1 -1
- package/dist/workspace-contract-PVLGPBBV.js +1 -0
- package/dist/workspace-explain-64HNKAHO.js +1 -0
- package/dist/workspace-explain-contract-H7O26QJU.js +1 -0
- package/dist/{workspace-feedback-SUVH2LUJ.js → workspace-feedback-RATRXFUC.js} +1 -1
- package/dist/{workspace-foundation-WXJ6I7ES.js → workspace-foundation-D33LJLGT.js} +1 -1
- package/dist/workspace-graph-stream-THNG2T7R.js +1 -0
- package/dist/{workspace-history-BANOJRQ2.js → workspace-history-EWFPT74O.js} +1 -1
- package/dist/workspace-intelligence-MCNSWWDV.js +1 -0
- package/dist/{workspace-intelligence-evaluation-IPH7M3WV.js → workspace-intelligence-evaluation-7CABG5Y6.js} +1 -1
- package/dist/workspace-intelligence-runner-TG2VLHNZ.js +1 -0
- package/dist/workspace-intelligence-runtime-registry-ZZ3GRAL2.js +1 -0
- package/dist/{workspace-knowledge-graph-ARDC6HHG.js → workspace-knowledge-graph-2EYR7N56.js} +1 -1
- package/dist/{workspace-marker-SMBC3Z2Q.js → workspace-marker-7NHMDIRL.js} +1 -1
- package/dist/workspace-mcp-serve-FLAVKWYW.js +3 -0
- package/dist/workspace-model-FMFYLHE4.js +1 -0
- package/dist/workspace-model-hash-ZXYPIGCW.js +1 -0
- package/dist/workspace-onboarding-MYROZDI2.js +1 -0
- package/dist/{workspace-python-engine-state-2MLKJYQG.js → workspace-python-engine-state-J4QKW55K.js} +1 -1
- package/dist/{workspace-registry-summary-ORDK7A36.js → workspace-registry-summary-6VXIAQLX.js} +1 -1
- package/dist/workspace-run-2ZI5UMJ2.js +1 -0
- package/dist/{workspace-verify-EBVL7FWT.js → workspace-verify-FKYI65UQ.js} +1 -1
- package/dist/workspace-watch-RP5KMVP2.js +1 -0
- package/docs/GLOSSARY.md +17 -16
- package/docs/OPEN_SOURCE_USER_SCENARIOS.md +18 -10
- package/docs/README.md +49 -14
- package/docs/README_CONTENT_CONTRACT.md +19 -10
- package/docs/ci-workflows.md +3 -3
- package/docs/commands-reference.md +41 -10
- package/docs/contracts/ARTIFACT_CATALOG.md +72 -27
- package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +2 -0
- package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +3 -3
- package/docs/contracts/rapidkit-cli-contracts.json +2 -2
- package/docs/create-planner-capabilities.md +36 -5
- package/docs/creating-workspaces-and-projects.md +75 -15
- package/docs/doctor-command.md +148 -39
- package/docs/examples/ci-agent-grounding.yml +1 -1
- package/docs/from-code-to-shared-understanding.md +6 -3
- package/docs/graph-benchmark-methodology.md +2 -2
- package/docs/workspace-intelligence-evaluation.md +13 -6
- package/docs/workspace-intelligence-runner.md +17 -6
- package/docs/workspace-knowledge-graph.md +102 -7
- package/docs/workspace-operations.md +154 -10
- package/package.json +10 -5
- package/scripts/enterprise-package-smoke.mjs +13 -1
- package/templates/kits/fastapi-ddd/README.md.j2 +1 -1
- package/dist/analyze-EEEU3MIF.js +0 -1
- package/dist/autopilot-release-XGVXPOZI.js +0 -1
- package/dist/chunk-22DT744Z.js +0 -1
- package/dist/chunk-37CVKXBD.js +0 -1
- package/dist/chunk-3NU32T4A.js +0 -2
- package/dist/chunk-3ZK2GU7C.js +0 -1
- package/dist/chunk-4HDYADHT.js +0 -13
- package/dist/chunk-52PBRX7F.js +0 -1
- package/dist/chunk-54EP5CEV.js +0 -8
- package/dist/chunk-5XATWNME.js +0 -1
- package/dist/chunk-7YHK5NM3.js +0 -2
- package/dist/chunk-AFL3ACCR.js +0 -2
- package/dist/chunk-BFLJ2R4D.js +0 -80
- package/dist/chunk-EYJ2CQSK.js +0 -1
- package/dist/chunk-FTY7GGXJ.js +0 -33
- package/dist/chunk-FXQJX34Z.js +0 -1
- package/dist/chunk-GSWPGELT.js +0 -2
- package/dist/chunk-GZTYAEWX.js +0 -1
- package/dist/chunk-HDXNIN4N.js +0 -1
- package/dist/chunk-HZDXO65G.js +0 -36
- package/dist/chunk-J5ENLXDF.js +0 -1
- package/dist/chunk-KB44JP4M.js +0 -2
- package/dist/chunk-LHOZXC2M.js +0 -2
- package/dist/chunk-MER6ZBN2.js +0 -13
- package/dist/chunk-NAJCUQ4X.js +0 -2
- package/dist/chunk-OA537ZQ5.js +0 -1
- package/dist/chunk-OW42TZFB.js +0 -1
- package/dist/chunk-P3D5YQB2.js +0 -1
- package/dist/chunk-PHXQR6PX.js +0 -2
- package/dist/chunk-PRTR2DQ2.js +0 -1
- package/dist/chunk-QNONOO4F.js +0 -4
- package/dist/chunk-RHQW3DTP.js +0 -1
- package/dist/chunk-T4YR4RAI.js +0 -2
- package/dist/chunk-Y45WZR5N.js +0 -5
- package/dist/chunk-YJZOMRAS.js +0 -1
- package/dist/pipeline-TQM43A3K.js +0 -5
- package/dist/platform-capabilities-2B4QMZXE.js +0 -1
- package/dist/workspace-NCWRINEF.js +0 -1
- package/dist/workspace-archive-P76EDIUG.js +0 -10
- package/dist/workspace-contract-TU2I7GC2.js +0 -1
- package/dist/workspace-dependency-graph-BP4EXYQ5.js +0 -1
- package/dist/workspace-explain-MWUEN643.js +0 -1
- package/dist/workspace-explain-contract-ZPI3JXJU.js +0 -1
- package/dist/workspace-intelligence-MFJE7W67.js +0 -1
- package/dist/workspace-intelligence-runner-THYLHHMF.js +0 -1
- package/dist/workspace-mcp-serve-EZR6O76D.js +0 -3
- package/dist/workspace-model-7OU2M3LE.js +0 -1
- package/dist/workspace-model-hash-MHXK5MEI.js +0 -1
- package/dist/workspace-run-RLIYSOTN.js +0 -1
- package/dist/workspace-watch-3BPGLFLB.js +0 -1
|
@@ -138,13 +138,79 @@ CLI queries · Context · MCP · Agents · IDEs · CI
|
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
The graph does not rewrite or replace the canonical Workspace Model. It is a
|
|
141
|
-
derived representation bound to an exact model revision by SHA-256
|
|
142
|
-
|
|
141
|
+
derived representation bound to an exact model revision by the SHA-256 hash of
|
|
142
|
+
the model's stable structural projection. Volatile timestamps, run correlation,
|
|
143
|
+
live evidence references, and freshness fields are intentionally excluded from
|
|
144
|
+
that structural identity. Context, Doctor, MCP, and graph-stream consumers
|
|
145
|
+
reject a graph whose source binding no longer matches the current model.
|
|
143
146
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
The
|
|
147
|
-
|
|
147
|
+
### Model and graph relationship
|
|
148
|
+
|
|
149
|
+
The current integrated CLI follows this order:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
workspace files + registered projects + contracts + selected evidence
|
|
153
|
+
|
|
|
154
|
+
v
|
|
155
|
+
canonical Workspace Model
|
|
156
|
+
| |
|
|
157
|
+
| +-- compact project dependency topology
|
|
158
|
+
|
|
|
159
|
+
v
|
|
160
|
+
provider scan + facts/proofs + identity reconciliation
|
|
161
|
+
|
|
|
162
|
+
v
|
|
163
|
+
Workspace Knowledge Graph
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The model owns the canonical workspace boundary: project identity, runtime and
|
|
167
|
+
framework observations, policies, contract state, evidence references, and the
|
|
168
|
+
compact project topology used by the intelligence loop. The Knowledge Graph
|
|
169
|
+
receives that project inventory and topology, then enriches it from bounded
|
|
170
|
+
source providers. It can add files, symbols, packages, APIs, infrastructure,
|
|
171
|
+
tests, owners, decisions, and proof-carrying relations, but it cannot mutate the
|
|
172
|
+
model that authorized the build.
|
|
173
|
+
|
|
174
|
+
The canonical project inventory reconciles filesystem discovery, imported and
|
|
175
|
+
adopted registries, and `workspace.contract.json` declarations. A project that
|
|
176
|
+
is still declared by the contract but missing on disk is preserved in the
|
|
177
|
+
model and reported as `project.path.missing`; it is never silently removed from
|
|
178
|
+
the graph boundary. A persisted Knowledge Graph is accepted only when its
|
|
179
|
+
workspace identity and project topology also match that model.
|
|
180
|
+
|
|
181
|
+
The two artifacts are published under one workspace lock using a
|
|
182
|
+
rollback-capable artifact transaction. Each file replacement is atomic; if any
|
|
183
|
+
write fails, Workspai restores both preimages. `graph.source.kind` is fixed to
|
|
184
|
+
`workspace-model`, `graph.source.artifact` is fixed to
|
|
185
|
+
`.workspai/reports/workspace-model.json`, and `graph.source.hash` contains the
|
|
186
|
+
stable structural hash of the persisted model. A current-state consumer must
|
|
187
|
+
reject the graph when that binding no longer matches `workspace-model.json`.
|
|
188
|
+
|
|
189
|
+
This is therefore not a circular source-of-truth relationship. In the current
|
|
190
|
+
CLI, the direction is **Model → Knowledge Graph**. Providers may use the same
|
|
191
|
+
workspace sources that informed the model, but their output enriches the
|
|
192
|
+
derived graph; it does not flow back into the model during that run. A future
|
|
193
|
+
fact-first package may make normalized facts the shared input to both
|
|
194
|
+
representations, but that is not the shipped contract today.
|
|
195
|
+
|
|
196
|
+
The model also contains a smaller project dependency graph under the canonical
|
|
197
|
+
`projectTopology` field. That projection is used for impact, blast radius,
|
|
198
|
+
verify, explain, watch, and affected fleet runs. The richer Knowledge Graph is
|
|
199
|
+
used for proof-backed retrieval and cross-domain understanding. The deprecated
|
|
200
|
+
`graph` field is emitted only as a v1 compatibility alias and must remain
|
|
201
|
+
structurally identical to `projectTopology`; new consumers must not depend on
|
|
202
|
+
the alias.
|
|
203
|
+
|
|
204
|
+
These rules are machine-owned, not Markdown conventions:
|
|
205
|
+
|
|
206
|
+
- `workspace-intelligence-architecture.v1.json` declares the one-way direction,
|
|
207
|
+
artifact authority, mutation rule, publication rule, and stale-consumer rule;
|
|
208
|
+
- `workspace-knowledge-graph.v1.json` permits only the canonical model source
|
|
209
|
+
kind and artifact path;
|
|
210
|
+
- `workspace-intelligence-chain.v1.json` requires the Model stage to produce
|
|
211
|
+
both artifacts;
|
|
212
|
+
- runtime source-binding guards enforce the structural hash before persisted
|
|
213
|
+
graph consumption.
|
|
148
214
|
|
|
149
215
|
## Sources and providers
|
|
150
216
|
|
|
@@ -161,9 +227,32 @@ deduplication, typed relations, reconciliation, quality metrics, diagnostics,
|
|
|
161
227
|
and deterministic ordering. Regex-backed source observations are explicitly
|
|
162
228
|
marked as observed/medium-confidence; authored contracts remain authoritative.
|
|
163
229
|
|
|
230
|
+
Local source imports are resolved to indexed file entities when the target can
|
|
231
|
+
be proven. External packages remain module entities, while unresolved relative
|
|
232
|
+
imports are labelled `unresolved-local` and produce a diagnostic. This prevents
|
|
233
|
+
an unknown local path from being silently presented as a third-party
|
|
234
|
+
dependency.
|
|
235
|
+
|
|
236
|
+
### Binding quality, not just graph size
|
|
237
|
+
|
|
238
|
+
Entity and relation counts do not tell you whether a graph can answer useful
|
|
239
|
+
engineering questions. `graph.quality.bindingCoverage` therefore reports four
|
|
240
|
+
independent dimensions:
|
|
241
|
+
|
|
242
|
+
- authored or observed endpoints connected to implementation evidence;
|
|
243
|
+
- registered projects connected to test evidence;
|
|
244
|
+
- registered projects connected to deployment evidence;
|
|
245
|
+
- registered projects connected to ownership evidence.
|
|
246
|
+
|
|
247
|
+
Each dimension reports eligible, bound, and unknown counts plus a ratio. A
|
|
248
|
+
`null` ratio means the dimension was not applicable; zero means applicable
|
|
249
|
+
surfaces were found but none were bound. Consumers must not turn either state
|
|
250
|
+
into a false “complete” claim.
|
|
251
|
+
|
|
164
252
|
## Outputs and consumers
|
|
165
253
|
|
|
166
|
-
`workspace model --write` publishes these two artifacts
|
|
254
|
+
`workspace model --write` publishes these two artifacts as one locked,
|
|
255
|
+
rollback-capable artifact set:
|
|
167
256
|
|
|
168
257
|
```text
|
|
169
258
|
.workspai/reports/workspace-model.json
|
|
@@ -173,6 +262,12 @@ marked as observed/medium-confidence; authored contracts remain authoritative.
|
|
|
173
262
|
The Knowledge Graph is consumed by:
|
|
174
263
|
|
|
175
264
|
- `workspace graph search|entities|evidence|path|overlay`;
|
|
265
|
+
- `doctor workspace|project`, which maps unresolved probes to structural root
|
|
266
|
+
candidates, reachable affected surfaces, proof paths, and graph-connected
|
|
267
|
+
test/pipeline verification targets. When a runtime audit names affected
|
|
268
|
+
dependencies, Doctor binds those subjects to exact package/module entities
|
|
269
|
+
instead of selecting an arbitrary project package. Names that cannot be
|
|
270
|
+
resolved remain explicit unknowns;
|
|
176
271
|
- `workspace context`, which validates the model hash and publishes graph
|
|
177
272
|
availability and query commands;
|
|
178
273
|
- `workspace agent-sync`, which places it in the evidence index and generated
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
# Workspace Operations
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this guide to bring existing software into Workspai, move or share workspace
|
|
4
|
+
state safely, and manage supporting local services. It explains what each
|
|
5
|
+
operation changes before you run it.
|
|
4
6
|
|
|
5
7
|
Command syntax: [commands-reference.md](./commands-reference.md).
|
|
6
8
|
|
|
7
|
-
##
|
|
9
|
+
## Choose the operation by intent
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
Workspai keeps project onboarding and workspace portability separate. Choose
|
|
12
|
+
the operation by what should happen to the source:
|
|
13
|
+
|
|
14
|
+
| Resource | Source | Intent | Command | Source moved or copied? | Registered? |
|
|
15
|
+
| --------- | ---------------- | ---------------------------- | ---------------------------- | ----------------------- | ----------- |
|
|
16
|
+
| Project | Local folder | Keep the project where it is | `workspai adopt` | No | Yes |
|
|
17
|
+
| Project | Local folder | Copy it into a workspace | `workspai import` | Copied | Yes |
|
|
18
|
+
| Project | Git URL | Clone it into a workspace | `workspai import --git` | Cloned | Yes |
|
|
19
|
+
| Workspace | Existing folder | Use it where it is | `workspai workspace connect` | No | Yes |
|
|
20
|
+
| Workspace | Portable archive | Restore and start using it | `workspai workspace import` | Materialized | Yes |
|
|
21
|
+
| Workspace | Portable archive | Extract files only | `workspai workspace hydrate` | Materialized | No |
|
|
22
|
+
|
|
23
|
+
All registered routes reconcile the canonical registry, workspace contract,
|
|
24
|
+
and project entry surfaces. `hydrate` deliberately stops after safe extraction
|
|
25
|
+
so automation can inspect the materialized files before registration.
|
|
26
|
+
|
|
27
|
+
RapidKit Core module commands remain available only when existing project
|
|
28
|
+
metadata identifies a kit that supports modules.
|
|
13
29
|
|
|
14
30
|
```bash
|
|
15
31
|
npx workspai import ../orders-api
|
|
@@ -17,6 +33,8 @@ npx workspai import https://github.com/acme/orders-api.git --git
|
|
|
17
33
|
npx workspai import ../orders-api --workspace ./my-workspace --name orders-api --json
|
|
18
34
|
npx workspai adopt ../marketing-web --workspace ./my-workspace
|
|
19
35
|
npx workspai adopt --json
|
|
36
|
+
npx workspai workspace connect ../existing-workspace --json
|
|
37
|
+
npx workspai workspace import team.workspai-archive.zip --output ./team --json
|
|
20
38
|
```
|
|
21
39
|
|
|
22
40
|
### Import behavior
|
|
@@ -24,7 +42,9 @@ npx workspai adopt --json
|
|
|
24
42
|
- Local folders are copied; git sources are cloned with shallow history.
|
|
25
43
|
- Outside any workspace (no `--workspace`), Workspai creates or reuses the managed `workspai` workspace. New defaults use `~/.workspai/workspaces/workspai`; valid legacy candidates under `~/rapidkit/workspaces/workspai` and `~/Workspai/rapidkits/workspai` can still be reused.
|
|
26
44
|
- Existing workspaces under legacy managed roots remain registered after upgrade.
|
|
27
|
-
-
|
|
45
|
+
- Workspai writes a validated machine-local workspace binding into the
|
|
46
|
+
imported project. Workspace commands can then be launched from that project
|
|
47
|
+
without changing directories.
|
|
28
48
|
- Failed workspace sync rolls back imported files and registry entries.
|
|
29
49
|
|
|
30
50
|
### Adopt behavior
|
|
@@ -33,12 +53,107 @@ npx workspai adopt --json
|
|
|
33
53
|
- Default workspace resolution matches import, including canonical creation and valid legacy managed-default reuse.
|
|
34
54
|
- Writes `.workspai/project.json`, `.workspai/adopt.json`, and `.workspai/adopt-readiness.json`.
|
|
35
55
|
- Registry and contract sync include adopted projects for `workspace model`, `workspace context`, Dashboard, and agents.
|
|
56
|
+
- Managed grounding writes a portable project lens, project grounding, and a
|
|
57
|
+
bounded managed section in `AGENTS.md`. User-authored `AGENTS.md` content is
|
|
58
|
+
preserved.
|
|
36
59
|
- `--dry-run --json` previews detection without writing metadata.
|
|
37
60
|
|
|
61
|
+
### Existing workspace behavior
|
|
62
|
+
|
|
63
|
+
- `workspace connect` registers a valid local Workspai workspace in place. It
|
|
64
|
+
does not copy its projects.
|
|
65
|
+
- `workspace import` verifies an archive, materializes it atomically, removes
|
|
66
|
+
machine-local bindings from the source machine, registers the workspace, and
|
|
67
|
+
reconciles its portable contract snapshot and project entry links.
|
|
68
|
+
- Archive import never silently overwrites an explicit `--output` destination.
|
|
69
|
+
- External adopted projects are not copied into an archive. The manifest keeps
|
|
70
|
+
only their portable identity and reports that they must be relinked.
|
|
71
|
+
- `workspace hydrate` is the lower-level extraction primitive. Use it when a
|
|
72
|
+
deployment or migration process—not Workspai—owns registration.
|
|
73
|
+
|
|
74
|
+
Every registered onboarding route emits the same versioned ingestion plan in
|
|
75
|
+
JSON. The plan states the resource, source kind, materialization mode,
|
|
76
|
+
ownership, registration intent, destination, and grounding policy. Consumers
|
|
77
|
+
should use that contract instead of inferring behavior from command names.
|
|
78
|
+
`workspace hydrate` remains an unregistered archive primitive and emits the
|
|
79
|
+
versioned archive operation result instead.
|
|
80
|
+
|
|
81
|
+
### Automatic consumer sync
|
|
82
|
+
|
|
83
|
+
Workspace creation publishes the initial contract, canonical model, Knowledge
|
|
84
|
+
Graph, structural baseline, context, report index, `AGENTS.md`, operational
|
|
85
|
+
skills, and supported IDE/agent surfaces—even before the first project exists.
|
|
86
|
+
Successful project creation, adoption, import, workspace connection, and
|
|
87
|
+
workspace import refresh those same projections in the background. The
|
|
88
|
+
structural baseline is created once and preserved; current model, graph, diff,
|
|
89
|
+
impact, context, and project grounding move forward with workspace membership.
|
|
90
|
+
|
|
91
|
+
Doctor, Analyze, Readiness, and Verify remain explicit checks because they may
|
|
92
|
+
run project tools or enforce release policy. Use `workspace intelligence run`
|
|
93
|
+
when you want that governed decision chain, rather than only lifecycle sync.
|
|
94
|
+
|
|
95
|
+
### Work from the project directory
|
|
96
|
+
|
|
97
|
+
After `adopt`, `import`, or project creation, the project is a first-class
|
|
98
|
+
entry point into its canonical workspace:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
cd /absolute/path/to/project
|
|
102
|
+
npx workspai project workspace status --json
|
|
103
|
+
npx workspai doctor project --json
|
|
104
|
+
npx workspai workspace graph search "authentication endpoint" --limit 12 --json
|
|
105
|
+
npx workspai workspace intelligence run --for-agent generic --strict --json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Workspace resolution has one stable precedence:
|
|
109
|
+
`--workspace` → parent workspace → validated local link → reverse registry.
|
|
110
|
+
Workspai returns a specific error for an invalid explicit workspace, malformed
|
|
111
|
+
or stale link, ambiguous registration, or an unlinked project. It never picks
|
|
112
|
+
one workspace silently when ownership is ambiguous.
|
|
113
|
+
|
|
114
|
+
The project receives four distinct surfaces:
|
|
115
|
+
|
|
116
|
+
| File | Purpose | Portable |
|
|
117
|
+
| ---------------------------------------------- | ----------------------------------------------------------------------------- | --------------------- |
|
|
118
|
+
| `.workspai/workspace-link.local.json` | Machine-local canonical workspace binding | No; always gitignored |
|
|
119
|
+
| `.workspai/reports/project-context-agent.json` | Bounded project view of model, graph, proofs, diagnostics, and safe commands | Yes |
|
|
120
|
+
| `.workspai/PROJECT-GROUNDING.md` | Human- and agent-readable project entry guide | Yes |
|
|
121
|
+
| `AGENTS.md` managed section | Tells compatible agents where to start and when to cross the project boundary | Yes |
|
|
122
|
+
|
|
123
|
+
The bounded context includes project identity and commands, dependencies and
|
|
124
|
+
dependents, related API/deployment/test surfaces, current project findings,
|
|
125
|
+
portable proof locators, and model/graph freshness. It deliberately references
|
|
126
|
+
rather than duplicates workspace-wide evidence.
|
|
127
|
+
|
|
128
|
+
Use `--project-grounding managed` (default) to publish all portable surfaces,
|
|
129
|
+
`local` to keep the project lens and grounding gitignored without managing
|
|
130
|
+
`AGENTS.md`, or `off` to disable project grounding for that operation. The
|
|
131
|
+
machine-local link remains enabled in every mode because it owns command
|
|
132
|
+
resolution; it is private to the current machine and never belongs in a commit.
|
|
133
|
+
Mode reconciliation is convergent: changing modes removes stale managed
|
|
134
|
+
sections, portable files, or ignore rules that the new mode no longer owns,
|
|
135
|
+
while preserving user-authored `AGENTS.md` and `.gitignore` content.
|
|
136
|
+
|
|
137
|
+
If a workspace moved, or a cloned project has no valid local link, reconcile
|
|
138
|
+
it explicitly:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
npx workspai project workspace relink --workspace /absolute/path/to/my-workspace --json
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Relink succeeds only when the project is already a member of the canonical
|
|
145
|
+
workspace contract.
|
|
146
|
+
|
|
38
147
|
### JSON output (`--json`)
|
|
39
148
|
|
|
40
|
-
- Import returns `workspacePath`, `workspaceResolution`,
|
|
41
|
-
|
|
149
|
+
- Import returns `workspacePath`, `workspaceResolution`,
|
|
150
|
+
`defaultWorkspaceCreated`, `projectWorkspaceCommand`,
|
|
151
|
+
`commandsResolveWorkspaceFromProject`, and `importedProject`. The imported
|
|
152
|
+
project includes its `source`.
|
|
153
|
+
- Adopt returns `workspacePath`, `workspaceResolution`,
|
|
154
|
+
`defaultWorkspaceCreated`, `wouldCreateDefaultWorkspace`,
|
|
155
|
+
`projectWorkspaceCommand`, `commandsResolveWorkspaceFromProject`, `dryRun`,
|
|
156
|
+
and `adoptedProject`.
|
|
42
157
|
- Project results include detected `name`, `path`, `stack`, `runtime`, `framework`, `supportTier`, `moduleSupport`, and `confidence` where available.
|
|
43
158
|
|
|
44
159
|
Imported projects receive `.workspai/import-readiness.json`. Adopted projects add frontend-aware detection for Next.js, React, Vite, Vue, Angular, SvelteKit, Nuxt, Astro, Remix, and Solid.
|
|
@@ -129,6 +244,20 @@ queryable through the read-mostly MCP server. This keeps CLI, CI, IDE and agent
|
|
|
129
244
|
consumers on one contract revision without injecting the full graph into every
|
|
130
245
|
agent prompt.
|
|
131
246
|
|
|
247
|
+
The relationship is one-way and contract-enforced: the Workspace Model owns the
|
|
248
|
+
canonical project boundary and compact dependency topology in
|
|
249
|
+
`workspace-model.json.projectTopology`; providers enrich
|
|
250
|
+
that inventory into the Knowledge Graph. The graph source kind and artifact
|
|
251
|
+
path are fixed to the model, its source hash identifies the stable structural
|
|
252
|
+
model projection, and persisted current-state consumers reject a mismatched
|
|
253
|
+
graph. `workspace contract graph` follows the same model-first build path; it
|
|
254
|
+
does not create a competing contract- or source-owned Knowledge Graph.
|
|
255
|
+
|
|
256
|
+
The deprecated `workspace-model.json.graph` field is a temporary v1
|
|
257
|
+
compatibility alias. It is emitted with the same value as `projectTopology`,
|
|
258
|
+
excluded as a duplicate from the canonical hash, and rejected when the two
|
|
259
|
+
fields diverge. New integrations must consume `projectTopology`.
|
|
260
|
+
|
|
132
261
|
The overlay follows
|
|
133
262
|
`workspace-knowledge-graph-change-overlay.v1`: graph revisions are identified
|
|
134
263
|
by content-derived fingerprints (timestamps do not create false changes), and
|
|
@@ -160,9 +289,21 @@ npx workspai workspace archive inspect team-workspace.workspai-archive.zip
|
|
|
160
289
|
npx workspai workspace archive verify team-workspace.workspai-archive.zip --strict
|
|
161
290
|
npx workspai workspace archive doctor team-workspace.workspai-archive.zip
|
|
162
291
|
npx workspai workspace hydrate team-workspace.workspai-archive.zip --output ./team-workspace
|
|
292
|
+
npx workspai workspace import team-workspace.workspai-archive.zip --output ./team-workspace
|
|
293
|
+
npx workspai workspace connect /path/to/existing-workspace
|
|
163
294
|
```
|
|
164
295
|
|
|
165
|
-
Export excludes dependency folders, build output, git history, logs, `.env`,
|
|
296
|
+
Export excludes dependency folders, build output, git history, logs, `.env`,
|
|
297
|
+
private keys, machine-local project links, derived registries, and raw
|
|
298
|
+
absolute-path workspace contracts by default. The manifest carries a
|
|
299
|
+
path-neutral contract snapshot so manual ports, APIs, ownership, events, and
|
|
300
|
+
dependency declarations survive transfer. External projects and their absolute
|
|
301
|
+
paths are excluded and reported as explicit relink actions. Use `--include-env`
|
|
302
|
+
only for trusted internal handoffs. Hydrate accepts legacy
|
|
303
|
+
`.rapidkit-workspace` and `.rapidkit/*` archive entries, but restores them as
|
|
304
|
+
canonical `.workspai-workspace` and `.workspai/*` paths. Workspace import then
|
|
305
|
+
reconciles the portable snapshot with project metadata on the destination
|
|
306
|
+
machine and rebuilds machine-local bindings.
|
|
166
307
|
|
|
167
308
|
Archive export, verification, and hydrate stream file payloads instead of loading the workspace into memory. Exports use ZIP64, so multi-gigabyte workspaces and archives with more than 65,535 files are supported. Stored ZIP entries are the default; use `--archive-compression deflate` when transfer size matters more than export CPU time.
|
|
168
309
|
|
|
@@ -220,6 +361,9 @@ Artifacts:
|
|
|
220
361
|
| `autopilot release` | Wrapper orchestrator | End-to-end release gate evidence |
|
|
221
362
|
| `import` | Workspace ingestion | Rollback-safe sync |
|
|
222
363
|
| `adopt` | Workspace adoption | In-place linking + registry sync |
|
|
364
|
+
| `workspace connect` | Workspace ingestion | In-place workspace registration + reconciliation |
|
|
365
|
+
| `workspace import` | Workspace ingestion | Verified archive restore + registration |
|
|
366
|
+
| `workspace hydrate` | Archive primitive | Verified extraction without registration |
|
|
223
367
|
| `workspace model/context/diff/impact/verify` | Workspace intelligence | Model, context packs, blast radius |
|
|
224
368
|
| `workspace intelligence run` | Workspace intelligence | Canonical contract-backed chain and strict gate |
|
|
225
369
|
| `snapshot` | Workspace recovery | Metadata or full snapshots |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workspai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Open-source workspace intelligence CLI for software systems: create, adopt, govern, verify, and align polyglot workspaces for humans, CI, IDEs, and AI agents.",
|
|
6
6
|
"keywords": [
|
|
@@ -35,13 +35,17 @@
|
|
|
35
35
|
"generator",
|
|
36
36
|
"scaffold"
|
|
37
37
|
],
|
|
38
|
-
"author": "
|
|
38
|
+
"author": "Chistiq",
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"repository": {
|
|
41
41
|
"type": "git",
|
|
42
|
-
"url": "git+https://github.com/
|
|
42
|
+
"url": "git+https://github.com/chistiq/workspai.git",
|
|
43
43
|
"directory": "packages/cli"
|
|
44
44
|
},
|
|
45
|
+
"homepage": "https://www.workspai.com/",
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/chistiq/workspai/issues"
|
|
48
|
+
},
|
|
45
49
|
"bin": {
|
|
46
50
|
"workspai": "dist/index.js"
|
|
47
51
|
},
|
|
@@ -91,7 +95,7 @@
|
|
|
91
95
|
"validate:contracts": "corepack npm run check:shared-contracts && vitest run src/__tests__/contracts/",
|
|
92
96
|
"test:parity-contract": "corepack npm run check:shared-contracts && vitest run src/__tests__/contracts/import-stack-parity.snapshot.test.ts",
|
|
93
97
|
"test:watch": "vitest",
|
|
94
|
-
"test:coverage": "vitest run --coverage --reporter=default --reporter=json --outputFile.json=test-results/vitest.json",
|
|
98
|
+
"test:coverage": "corepack npm run test:prebuild && vitest run --coverage --reporter=default --reporter=json --outputFile.json=test-results/vitest.json",
|
|
95
99
|
"test:prepare-embeddings": "node scripts/prepare-mock-embeddings.mjs",
|
|
96
100
|
"generate-embeddings": "npx tsx src/ai/generate-embeddings.ts",
|
|
97
101
|
"verify:package-cli": "node scripts/verify-package-cli.mjs",
|
|
@@ -117,10 +121,11 @@
|
|
|
117
121
|
"security:fix": "corepack npm audit fix",
|
|
118
122
|
"metrics": "tsx scripts/metrics.ts",
|
|
119
123
|
"validate:docs-examples": "node scripts/validate-doc-examples.mjs",
|
|
124
|
+
"check:github-release-notes": "node scripts/github-release-notes.mjs --check",
|
|
120
125
|
"check:markdown-links": "node scripts/check-markdown-links.mjs",
|
|
121
126
|
"check:docs-drift": "node scripts/docs-drift-guard.mjs",
|
|
122
127
|
"smoke:readme": "node scripts/smoke-readme-commands.mjs",
|
|
123
|
-
"validate:docs": "corepack npm run check:markdown-links && corepack npm run check:docs-drift && corepack npm run validate:docs-examples && corepack npm run smoke:readme",
|
|
128
|
+
"validate:docs": "corepack npm run check:markdown-links && corepack npm run check:docs-drift && corepack npm run validate:docs-examples && corepack npm run check:github-release-notes && corepack npm run smoke:readme",
|
|
124
129
|
"smoke:frontend-generators": "tsup && node scripts/smoke-frontend-generators.mjs",
|
|
125
130
|
"smoke:frontend-generators:network": "tsup && node scripts/smoke-frontend-generators.mjs --execute",
|
|
126
131
|
"sync:contracts": "node scripts/sync-contracts.mjs",
|
|
@@ -8,6 +8,11 @@ import process from 'node:process';
|
|
|
8
8
|
|
|
9
9
|
const repoRoot = process.cwd();
|
|
10
10
|
const cliPath = path.join(repoRoot, 'dist', 'index.js');
|
|
11
|
+
const isolatedHome = fs.mkdtempSync(path.join(os.tmpdir(), 'workspai-enterprise-home-'));
|
|
12
|
+
|
|
13
|
+
process.on('exit', () => {
|
|
14
|
+
fs.rmSync(isolatedHome, { recursive: true, force: true });
|
|
15
|
+
});
|
|
11
16
|
|
|
12
17
|
function fail(message) {
|
|
13
18
|
console.error(`[enterprise-package-smoke] ${message}`);
|
|
@@ -19,7 +24,14 @@ function log(message) {
|
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
function cliEnv(extraEnv = {}) {
|
|
22
|
-
const env = {
|
|
27
|
+
const env = {
|
|
28
|
+
...process.env,
|
|
29
|
+
HOME: isolatedHome,
|
|
30
|
+
USERPROFILE: isolatedHome,
|
|
31
|
+
XDG_CONFIG_HOME: path.join(isolatedHome, '.config'),
|
|
32
|
+
XDG_CACHE_HOME: path.join(isolatedHome, '.cache'),
|
|
33
|
+
...extraEnv,
|
|
34
|
+
};
|
|
23
35
|
delete env.NODE_ENV;
|
|
24
36
|
delete env.NODE_OPTIONS;
|
|
25
37
|
for (const key of Object.keys(env)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{ project_name }}
|
|
2
2
|
|
|
3
|
-
Domain-driven FastAPI service generated with [RapidKit Core](https://github.com/
|
|
3
|
+
Domain-driven FastAPI service generated with [RapidKit Core](https://github.com/chistiq/rapidkit-core). It can be adopted into Workspai workspace intelligence when you want workspace-level context, evidence, and release governance.
|
|
4
4
|
|
|
5
5
|
## Quick start
|
|
6
6
|
|
package/dist/analyze-EEEU3MIF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-54EP5CEV.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-5S3DJQEP.js';
|
package/dist/chunk-22DT744Z.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {c,d,a,b}from'./chunk-5XATWNME.js';import s from'fs';import o from'path';function R(i){let n=o.resolve(i);for(;;){if(s.existsSync(o.join(n,c))||s.existsSync(o.join(n,d))||s.existsSync(o.join(n,a,"workspace.json"))||s.existsSync(o.join(n,b,"workspace.json")))return n;let r=o.dirname(n);if(r===n)return null;n=r;}}function l(i){let n=o.resolve(i),r=s.existsSync(o.join(n,c))||s.existsSync(o.join(n,d))||s.existsSync(o.join(n,a,"workspace.json"))||s.existsSync(o.join(n,b,"workspace.json")),p=s.existsSync(o.join(n,a,"project.json"))||s.existsSync(o.join(n,a,"context.json"))||s.existsSync(o.join(n,b,"project.json"))||s.existsSync(o.join(n,b,"context.json"));return r&&!p}export{R as a,l as b};
|
package/dist/chunk-37CVKXBD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {g,f,b as b$3}from'./chunk-J5ENLXDF.js';import {d}from'./chunk-OA537ZQ5.js';import {i}from'./chunk-MER6ZBN2.js';import {a as a$4,m}from'./chunk-T4YR4RAI.js';import {a as a$2}from'./chunk-FXQJX34Z.js';import {c,b as b$2,i as i$1,w,f as f$2}from'./chunk-PHXQR6PX.js';import {i as i$2,h as h$1}from'./chunk-4KUIFXHM.js';import {f as f$1,d as d$1,a as a$5,e}from'./chunk-32OJDBIG.js';import {a as a$1}from'./chunk-GSWPGELT.js';import {a as a$3}from'./chunk-GZTYAEWX.js';import {b as b$1,a}from'./chunk-BMWFQXGW.js';import {p,o}from'./chunk-5XATWNME.js';import p$1 from'path';import C from'fs-extra';import Qe from'crypto';import {createRequire}from'module';var Ue=new Set(["service","frontend","worker","library","infra","docs","test-suite","unknown"]);async function Ie(e){try{if(!await C.pathExists(e))return null;let t=await C.readJSON(e);return t&&typeof t=="object"?t:null}catch{return null}}async function Je(e){for(let t of e){let s=await Ie(t);if(s)return s}return null}function Me(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Ue.has(t)?t:null}async function Oe(e,t){let s=t??await Je(p(e,"project.json")),n=Me(s?.kind)??Me(s?.type);if(n)return n;let a=typeof s?.kit_name=="string"?s.kit_name:s?.kit,r=typeof s?.framework=="string"?s.framework:null,o=typeof s?.runtime=="string"?s.runtime:null,i=`${typeof a=="string"?a:""} ${r??""} ${o??""}`.trim().toLowerCase();if(/\b(frontend|nextjs|next\.js|react|vue|svelte|vite|angular|astro|remix|nuxt)\b/.test(i))return "frontend";if(/\b(fastapi|nestjs|springboot|spring boot|gofiber|gogin|dotnet|webapi|django|flask|express|fastify|python|node|java|go|rust|php|ruby|elixir)\b/.test(i))return "service";let c=await Ie(p$1.join(e,"package.json"));if(c){let d={...c.dependencies??{},...c.devDependencies??{}},u=c.scripts??{},l=Object.values(u).filter(f=>typeof f=="string").join(" ").toLowerCase();if(d.next||d.react||d.vue||d.svelte||d.vite||d["@angular/core"]||l.includes("next ")||l.includes("vite "))return "frontend";if(c.private===true&&!d.express&&!d["@nestjs/core"])return "library"}return await C.pathExists(p$1.join(e,"Dockerfile"))||await C.pathExists(p$1.join(e,"docker-compose.yml"))||await C.pathExists(p$1.join(e,"terraform.tf"))?"infra":"service"}var qe=new Set(c().map(e=>e.id)),Xe=[...i().map(e=>({id:e.kitId,aliases:[...e.aliases],ecosystem:e.framework,status:"available",canExecuteCreate:true,officialCommands:[e.commandDisplay("<name>",{skipGit:false,skipInstall:false})],adoptAfterCreate:true})),{id:"wordpress-site",aliases:["wordpress","wordpress-site","wp","wp-site"],ecosystem:"wordpress",status:"planned",canExecuteCreate:false,officialCommands:["wp core download","wp config create","wp db create","wp core install"],adoptAfterCreate:true},{id:"wordpress-block",aliases:["wordpress-block","wp-block","gutenberg-block"],ecosystem:"wordpress",status:"planned",canExecuteCreate:false,officialCommands:["npx @wordpress/create-block@latest <slug>"],adoptAfterCreate:true},{id:"laravel",aliases:["laravel","php-laravel"],ecosystem:"php",status:"planned",canExecuteCreate:false,officialCommands:["composer create-project laravel/laravel <name>"],adoptAfterCreate:true},{id:"symfony",aliases:["symfony","php-symfony"],ecosystem:"php",status:"planned",canExecuteCreate:false,officialCommands:["composer create-project symfony/skeleton <name>"],adoptAfterCreate:true},{id:"rails",aliases:["rails","ruby-on-rails","ruby-rails"],ecosystem:"ruby",status:"planned",canExecuteCreate:false,officialCommands:["rails new <name>"],adoptAfterCreate:true}],T=new Map;for(let e of Xe){T.set(e.id,e);for(let t of e.aliases)T.set(t,e);}var Ye=new Set(["php","ruby","rust","elixir","clojure","scala","kotlin","unknown"]);function F(e){return e?.trim().toLowerCase()||void 0}function _e(e){let t=F(e.kitId)??F(e.framework)??F(e.runtime)??"unknown";if(e.projectExists)return {lane:"existing",status:"available",canExecuteCreate:false,requested:t,reason:"Existing projects enter Workspace Intelligence through adopt/import."};let s=e.kitId?b$2(e.kitId):void 0;if(s&&qe.has(s))return {lane:"native",status:"available",canExecuteCreate:true,requested:t,resolved:s,reason:"Workspai owns the create contract, project marker, registry, doctor, and workspace model path."};let n=T.get(t)??T.get(F(e.framework)??"")??T.get(F(e.runtime)??"");if(n)return {lane:"official",status:n.status,canExecuteCreate:n.canExecuteCreate,requested:t,resolved:n.id,officialCommands:n.officialCommands,fallbackLane:n.canExecuteCreate?void 0:"existing",reason:n.status==="available"?"Workspai runs the official ecosystem generator, then registers the project in Workspace Intelligence.":"Official generator support is planned but not enabled; use adopt/import until Workspai owns the post-create contract."};let a=F(e.runtime);return a&&Ye.has(a)?{lane:"existing",status:"available",canExecuteCreate:false,requested:t,resolved:a,reason:"Runtime can be governed through Workspace Intelligence, but native create is not supported."}:{lane:"existing",status:"available",canExecuteCreate:false,requested:t,reason:"No native create contract is available; use adopt/import to enter Workspace Intelligence."}}function Wt(e){return !e.canExecuteCreate&&(e.lane==="official"||e.lane==="existing"&&e.resolved!==void 0)}var ae="workspace-model-cache.v1",oe=".workspai/cache/workspace-model.v1.json",De=["package.json","pyproject.toml","requirements.txt","go.mod","go.sum","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","workspai.project.json",".workspai/project.json",".workspai/context.json","rapidkit.project.json",".rapidkit/project.json",".rapidkit/context.json"],Ne=[".workspai/workspace.contract.json",".workspai/workspace.json","workspai.workspace.json",".workspai/policies.yml",".workspai/policies.yaml",".rapidkit/workspace.contract.json",".rapidkit/workspace.json","rapidkit.workspace.json",".rapidkit/policies.yml",".rapidkit/policies.yaml"],et=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs"]),tt=new Set([".git",".workspai",".rapidkit","node_modules","dist","build","out","target","coverage",".next",".turbo",".cache",".venv"]),rt=1500,V=null;function ie(){if(V)return V;try{V=createRequire(import.meta.url)("../package.json")?.version??"0.0.0";}catch{V="0.0.0";}return V}async function X(e){try{let t=await C.readFile(e);return Qe.createHash("sha256").update(t).digest("hex")}catch{return null}}async function st(e){let t={};for(let a of De){let r=await X(p$1.join(e,a));r&&(t[a]=r);}let s=[],n=[e];for(;n.length>0&&s.length<rt;){let a=n.shift();if(!a)continue;let r=[];try{r=await C.readdir(a,{withFileTypes:true});}catch{continue}let o=[];for(let i of r)if(i.isDirectory()){if(tt.has(i.name)||i.name.startsWith("."))continue;o.push(p$1.join(a,i.name));}else if(i.isFile()&&et.has(p$1.extname(i.name))){let c=p$1.join(a,i.name),d=await C.stat(c).catch(()=>null);if(d){let u=p$1.relative(e,c).split(p$1.sep).join("/");s.push(`${u}:${d.size}:${Math.round(d.mtimeMs)}`);}}o.sort((i,c)=>i.localeCompare(c)),n.push(...o);}return s.sort((a,r)=>a.localeCompare(r)),b$3({manifests:t,source:s})}async function Y(e,t){let s=p$1.resolve(e),n={},a=[...new Set(t.map(r=>p$1.relative(s,p$1.resolve(r)).split(p$1.sep).join("/")))].sort((r,o)=>r.localeCompare(o));for(let r of a)n[r]=await st(p$1.join(s,r));return n}async function Q(e){let t=p$1.resolve(e),s={};for(let n of Ne){let a=await X(p$1.join(t,n));a&&(s[n]=a);}return s}async function Z(e){let t=p$1.resolve(e.workspacePath),s=[...new Set(e.projectPaths.map(r=>p$1.relative(t,p$1.resolve(r)).split(p$1.sep).join("/")))].sort((r,o)=>r.localeCompare(o)),n=[];for(let r of s){let o={};for(let i of De){let c=await X(p$1.join(t,r,i));c&&(o[i]=c);}n.push({project:r,manifests:o});}let a={};for(let r of Ne){let o=await X(p$1.join(t,r));o&&(a[r]=o);}return b$3({cacheSchema:ae,cliVersion:e.cliVersion,flags:e.flags,workspaceJson:e.workspaceJson??null,marker:e.marker??null,projects:n,workspaceFiles:a})}async function ce(e){let t=await d$1(e,oe)??a$5(e,oe);try{if(!await C.pathExists(t))return null;let s=await C.readJson(t);return !s||s.schemaVersion!==ae||typeof s.inputsHash!="string"||typeof s.cliVersion!="string"||!s.model?null:s}catch{return null}}async function ee(e$1,t){let s={schemaVersion:ae,...t};return e(e$1,oe,s)}var Te="rapidkit-fact-freshness-v1",G={durable:720*60*60,derived:10080*60,evidenceBacked:1440*60,live:300,verifyBeforeUse:1440*60};function nt(e){switch(e){case "durable":return G.durable;case "derived":return G.derived;case "evidence-backed":return G.evidenceBacked;case "live":return G.live;case "verify-before-use":return G.verifyBeforeUse}}function ot(e){if(e.status)return e.status;if(e.ttlSeconds===null)return "unknown";let t=Date.parse(e.generatedAt);if(!Number.isFinite(t))return "unknown";let s=t+e.ttlSeconds*1e3;return e.now.getTime()>s?"stale":"fresh"}function at(e){let t=e.now??new Date,s=e.generatedAt??t.toISOString(),n=Date.parse(s),a=Number.isFinite(n),r=a?s:t.toISOString(),o=e.ttlSeconds===void 0?nt(e.kind):e.ttlSeconds,i=ot({generatedAt:r,ttlSeconds:o,status:e.status??(a?void 0:"unknown"),now:t}),c=Date.parse(r),d=o===null||!Number.isFinite(c)?void 0:new Date(c+o*1e3),u=e.verifyBeforeUse??(e.kind==="live"||e.kind==="verify-before-use"||e.category!=="structure"||i!=="fresh");return {schemaVersion:Te,kind:e.kind,category:e.category,generatedAt:r,ttlSeconds:o,...d?{expiresAt:d.toISOString()}:{},status:i,verifyBeforeUse:u,...e.sourceArtifact?{sourceArtifact:e.sourceArtifact}:{},...e.sourcePath?{sourcePath:e.sourcePath}:{},inputsHash:e.inputsHash??b$3(e.value??null),reason:e.reason}}function h(e){return {id:e.id,label:e.label,scope:e.scope,value:e.value,...e.project?{project:e.project}:{},freshness:at({...e.freshness,value:e.value})}}function Ve(e){let t=e.generatedAt??(e.now??new Date).toISOString(),s={durable:0,derived:0,"evidence-backed":0,live:0,"verify-before-use":0},n={structure:0,verification:0,state:0},a=0,r=0,o=0,i=0;for(let c of e.facts)s[c.freshness.kind]+=1,n[c.freshness.category]+=1,c.freshness.status==="stale"&&(a+=1),c.freshness.status==="unknown"&&(r+=1),c.freshness.kind==="live"&&(o+=1),c.freshness.verifyBeforeUse&&(i+=1);return {schemaVersion:Te,generatedAt:t,status:a>0?"stale":r>0?"unknown":"fresh",totalFacts:e.facts.length,staleFacts:a,unknownFacts:r,liveFacts:o,verifyBeforeUseFacts:i,byKind:s,byCategory:n}}var it=b$1.model,te=a.model,ct=["package.json","pyproject.toml","requirements.txt","go.mod","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","mix.exs","deno.json","deno.jsonc","bun.lock","bun.lockb","deps.edn","project.clj","build.sbt","docker-compose.yml","docker-compose.yaml","terraform.tf"],lt=new Set([".git",".hg",".svn",".workspai",".rapidkit",".venv","node_modules","dist","build","target","coverage","htmlcov",".next",".turbo"]);function Ge(e,t){return (p$1.relative(e,t)||".").split(p$1.sep).join("/")}async function Ke(e){try{if(!await C.pathExists(e))return null;let t=await C.readJSON(e);return t&&typeof t=="object"?t:null}catch{return null}}async function dt(e,t){for(let s of t)if(await C.pathExists(p$1.join(e,s)))return true;return false}function le(e){let t=Number.parseInt(process.env.RAPIDKIT_WORKSPACE_MODEL_SCAN_DEPTH??"",10),s=typeof e=="number"&&Number.isFinite(e)?e:Number.isFinite(t)?t:4;return Math.min(12,Math.max(1,Math.trunc(s)))}async function de(e,t){let s=p$1.resolve(e),n=[{dirPath:s,depth:0}],a=new Set,r=new Set;for(;n.length>0;){let o=n.shift();if(!o)continue;let i=p$1.resolve(o.dirPath);if(r.has(i))continue;if(r.add(i),i!==s&&await dt(i,ct)){a.add(i);continue}if(o.depth>=t)continue;let c=[];try{c=await C.readdir(i,{withFileTypes:true});}catch{continue}for(let d of c)!d.isDirectory()||lt.has(d.name)||d.name.startsWith(".")&&d.name!==".config"||n.push({dirPath:p$1.join(i,d.name),depth:o.depth+1});}return Array.from(a).sort((o,i)=>o.localeCompare(i))}function pe(e){let t=new Set,s=[];for(let n of e){let a=p$1.resolve(n);t.has(a)||(t.add(a),s.push(a));}return s.sort((n,a)=>n.localeCompare(a))}function $e(e,t){let s=e?.[t];return typeof s=="string"&&s.trim()?s.trim():void 0}function pt(e,t){return e?.[t]===true}function ut(e,t,s){let n=e?.frontend&&typeof e.frontend=="object"&&!Array.isArray(e.frontend)?e.frontend:void 0,a=$e(n,"generator"),r=$e(n,"command_display"),o=typeof t=="string"&&t.startsWith("frontend.");if(!(!a&&!o))return {...a?{id:a}:{},...t?{kit:t}:{},displayName:s,source:pt(n,"official_generator")?"official-generator":"metadata",...r?{commandDisplay:r}:{}}}async function mt(e){let t=[".workspai/project.json",".workspai/context.json",".rapidkit/project.json",".rapidkit/context.json","package.json","pyproject.toml","requirements.txt","go.mod","pom.xml","build.gradle","build.gradle.kts","Cargo.toml","composer.json","Gemfile","mix.exs","deno.json","Dockerfile","docker-compose.yml","README.md"],s=[];for(let n of t)await C.pathExists(p$1.join(e,n))&&s.push(n);return s}async function S(e,t,s,n=t){let a=await d$1(e,t),r=a!==null,o={path:n.split(p$1.sep).join("/"),exists:r};if(a&&s){let i=await Ke(a);typeof i?.generatedAt=="string"&&(o.generatedAt=i.generatedAt);let c=i?.status??i?.result??i?.verdict;typeof c=="string"&&(o.status=c);}return o}async function ft(e,t,s){let n=Ge(e,t),a=".workspai/reports",r=c=>S(t,`${a}/${c}`,s,`${n}/${a}/${c}`),o=await r("doctor-project-last-run.json");return {doctor:o?.exists===true?o:await r("doctor-last-run.json"),remediationPlan:await r("doctor-remediation-plan-last-run.json"),fixResult:await r("doctor-fix-result-last-run.json"),analyze:await r("analyze-last-run.json"),readiness:await r("release-readiness-last-run.json")}}async function gt(e,t,s){let n=i$1(t),a=i$2(t,n),r=w(t),o=f$2(a.runtime),i=await Oe(t,n),c=typeof n?.name=="string"&&n.name.trim()?n.name.trim():p$1.basename(t),d=typeof n?.kit_name=="string"?n.kit_name:typeof n?.kit=="string"?n.kit:void 0,u=typeof n?.engine=="string"?n.engine:r.engine!=="unknown"?r.engine:void 0,l=ut(n,d,a.displayName),f=_e({kitId:d,framework:a.key,runtime:a.runtime});return {name:c,path:Ge(e,t),...s.includeAbsolutePaths?{absolutePath:t}:{},kind:i,runtime:a.runtime,runtimeCandidates:h$1(t),framework:a.key,frameworkDisplayName:a.displayName,confidence:a.confidence,detectionSource:a.source,supportTier:a.supportTier,runtimeSupportTier:o.tier,runtimeDoctorSupport:o.doctorSupport,moduleSupport:r.moduleSupport,...d?{kit:d}:{},...u?{engine:u}:{},...l?{generator:l}:{},createCapability:f,commands:{supported:r.supportedCommands,unsupported:r.unsupportedCommands,global:r.globalCommands,fleetStages:r.fleetStages,localOnly:r.localOnlyCommands,map:r.commandMap},importantFiles:await mt(t),evidence:await ft(e,t,s.includeEvidence),provenance:{path:"filesystem discovery",runtime:a.source,framework:a.source,commands:"project command capability matrix",createCapability:"create planner capability contract",evidence:"project .workspai/reports"}}}async function ue(e){for(let t of o(e,"workspace.json")){let s=await Ke(t);if(s)return s}return null}function kt(e){return e.length===0?"empty-workspace":e.some(t=>t.kind==="frontend")&&e.length>1?"full-stack-workspace":e.some(t=>t.kind==="frontend")?"frontend-workspace":e.length>1?"backend-platform":"backend-workspace"}function ht(e){let t=new Set;for(let s of e){let n=`${s.name} ${s.path}`.toLowerCase();for(let a of ["auth","billing","payment","notification","order","admin","report","search","analytics"])n.includes(a)&&t.add(a);}return Array.from(t).sort()}function b(e,t,s,n){return {severity:e,code:t,message:s,target:n}}function Be(e){let t=[];e.workspace.name.trim()||t.push(b("error","workspace.name.missing","Workspace name could not be resolved.","workspace")),e.workspace.type==="observed-workspace"&&t.push(b("warning","workspace.marker.missing","Workspace marker is missing; model is based on filesystem observation.","workspace.marker")),e.summary.projectCount===0&&t.push(b("warning","workspace.projects.empty","No project roots were detected in this workspace.","projects")),e.contracts.exists||t.push(b("warning","workspace.contract.missing","Workspace contract is missing; dependency and API edges may be incomplete.",e.contracts.workspaceContractPath));let s=new Map;for(let r of e.projects){let o=r.name.toLowerCase(),i=s.get(o)??[];i.push(r),s.set(o,i),r.importantFiles.length||t.push(b("warning","project.markers.missing",`Project ${r.name} has no important manifest files recorded.`,r.path)),r.runtime==="unknown"&&t.push(b("warning","project.runtime.unknown",`Project ${r.name} runtime could not be confidently detected.`,r.path));let c=["test","build"];for(let l of c)r.commands.supported.includes(l)&&r.commands.unsupported.includes(l)&&t.push(b("error","project.commands.conflict",`Project ${r.name} marks ${l} as both supported and unsupported.`,r.path));let d=new Set(r.commands.fleetStages),u=new Set(r.commands.localOnly);for(let l of r.commands.fleetStages){u.has(l)&&t.push(b("error","project.commands.scope-conflict",`Project ${r.name} marks ${l} as both fleet and local-only.`,r.path));let f=r.commands.map[l];(!f||f.status!=="supported"||f.fleetEligible!==true||f.executionScope!=="fleet")&&t.push(b("error","project.commands.fleet-stage-invalid",`Project ${r.name} advertises ${l} as a fleet stage without a supported fleet capability.`,r.path));}for(let l of r.commands.localOnly){let f=r.commands.map[l];(!f||f.status!=="supported"||f.executionScope!=="local-only"||f.fleetEligible===true)&&t.push(b("error","project.commands.local-only-invalid",`Project ${r.name} advertises ${l} as local-only without a matching local-only capability.`,r.path));}for(let l of Object.values(r.commands.map))l.status==="supported"&&(l.fleetEligible===true&&!d.has(l.command)&&t.push(b("error","project.commands.fleet-stage-missing",`Project ${r.name} capability ${l.command} is fleet-eligible but missing from fleetStages.`,r.path)),l.executionScope==="local-only"&&l.fleetEligible!==true&&!u.has(l.command)&&t.push(b("error","project.commands.local-only-missing",`Project ${r.name} capability ${l.command} is local-only but missing from localOnly commands.`,r.path)));}for(let[r,o]of s.entries())o.length>1&&t.push(b("error","project.name.duplicate",`Project name "${r}" is ambiguous across ${o.length} project roots.`,o.map(i=>i.path).join(", ")));let n=t.filter(r=>r.severity==="error").length,a=t.filter(r=>r.severity==="warning").length;return {status:n>0?"failed":a>0?"warning":"passed",errors:n,warnings:a,issues:t}}function cr(e){return Be(e)}function y(e){return e.join(".")}function yt(e,t){let s=te,n=e.generatedAt,a=[h({id:"workspace.name",label:"Workspace name",scope:"workspace",value:e.workspace.name,freshness:{kind:"durable",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["workspace","name"]),reason:"Workspace identity is structural metadata and changes through workspace setup."}}),h({id:"workspace.type",label:"Workspace type",scope:"workspace",value:e.identity.workspaceType,freshness:{kind:"derived",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["identity","workspaceType"]),reason:"Workspace type is derived from the current project inventory."}}),h({id:"workspace.projectCount",label:"Project count",scope:"workspace",value:e.summary.projectCount,freshness:{kind:"derived",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["summary","projectCount"]),reason:"Project count is derived from workspace discovery and should be refreshed after structural changes."}}),h({id:"workspace.runtimeFamilies",label:"Runtime families",scope:"workspace",value:e.identity.runtimeFamilies,freshness:{kind:"derived",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["identity","runtimeFamilies"]),reason:"Runtime coverage is inferred from project surfaces."}}),h({id:"workspace.policyMode",label:"Workspace policy mode",scope:"policy",value:e.policies.mode,freshness:{kind:"durable",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["policies","mode"]),reason:"Policy mode is configuration, not runtime state."}}),h({id:"workspace.contract.exists",label:"Workspace contract presence",scope:"contract",value:e.contracts.exists,freshness:{kind:"derived",category:"structure",generatedAt:n,now:t,sourceArtifact:s,sourcePath:y(["contracts","exists"]),reason:"Contract presence is derived from workspace files and should be refreshed before release gating."}})];e.graph&&a.push(h({id:"graph.edgeCount",label:"Dependency graph edge count",scope:"graph",value:e.graph.stats.edgeCount,freshness:{kind:"derived",category:"structure",generatedAt:e.graph.generatedAt??n,now:t,sourceArtifact:s,sourcePath:y(["graph","stats","edgeCount"]),reason:"Graph topology is derived from manifests, imports, and workspace contracts."}}),h({id:"graph.evidenceCoverageRatio",label:"Dependency graph evidence coverage",scope:"graph",value:e.graph.stats.evidenceCoverageRatio,freshness:{kind:"derived",category:"structure",generatedAt:e.graph.generatedAt??n,now:t,sourceArtifact:s,sourcePath:y(["graph","stats","evidenceCoverageRatio"]),reason:"Graph evidence coverage changes when dependency evidence or contract edges change."}}));for(let[r,o]of e.projects.entries()){let i=`projects[${r}]`,c={kind:"derived",category:"structure",generatedAt:n,now:t,sourceArtifact:s,reason:"Project facts are derived from workspace discovery, project metadata, and framework probes."};a.push(h({id:`project.${o.name}.kind`,label:`${o.name} kind`,scope:"project",project:o.name,value:o.kind,freshness:{...c,sourcePath:y([i,"kind"])}}),h({id:`project.${o.name}.runtime`,label:`${o.name} runtime`,scope:"project",project:o.name,value:o.runtime,freshness:{...c,sourcePath:y([i,"runtime"])}}),h({id:`project.${o.name}.framework`,label:`${o.name} framework`,scope:"project",project:o.name,value:o.frameworkDisplayName,freshness:{...c,sourcePath:y([i,"frameworkDisplayName"])}}),h({id:`project.${o.name}.supportTier`,label:`${o.name} support tier`,scope:"project",project:o.name,value:o.supportTier,freshness:{...c,sourcePath:y([i,"supportTier"])}}),h({id:`project.${o.name}.safeFleetStages`,label:`${o.name} safe fleet stages`,scope:"command",project:o.name,value:o.commands.fleetStages,freshness:{...c,sourcePath:y([i,"commands","fleetStages"]),reason:"Safe command availability is derived from package and project command surfaces."}}));for(let[d,u]of Object.entries(o.evidence))a.push(h({id:`project.${o.name}.evidence.${d}`,label:`${o.name} ${d} evidence`,scope:"evidence",project:o.name,value:u?{path:u.path,exists:u.exists,status:u.status??null}:{exists:false},freshness:{kind:u?.exists?"evidence-backed":"verify-before-use",category:"verification",generatedAt:u?.generatedAt??n,now:t,status:u?.exists?void 0:"unknown",sourceArtifact:u?.path??s,sourcePath:y([i,"evidence",d]),verifyBeforeUse:true,reason:u?.exists?"Evidence reports can expire or become stale after source changes.":"Missing evidence must be generated before this fact is used for verification."}}));}for(let[r,o]of Object.entries(e.evidence))a.push(h({id:`workspace.evidence.${r}`,label:`Workspace ${r} evidence`,scope:"evidence",value:o?{path:o.path,exists:o.exists,status:o.status??null}:null,freshness:{kind:o?.exists?"evidence-backed":"verify-before-use",category:"verification",generatedAt:o?.generatedAt??n,now:t,status:o?.exists?void 0:"unknown",sourceArtifact:o?.path??s,sourcePath:y(["evidence",r]),verifyBeforeUse:true,reason:o?.exists?"Workspace evidence can expire or become stale after project, dependency, or policy changes.":"Missing workspace evidence must be generated before release or repair decisions."}}));return a}async function re(e){let t=p$1.resolve(e.workspacePath),s=e.includeAbsolutePaths===true,n=e.includeEvidence===true,a$4=le(e.observableScanDepth),r=e.now??new Date,[o$1,i,c,d,u]=await Promise.all([a$1(t),ue(t),a$2(t),a$3(t,{descendIntoMatchedProjects:false}),de(t,a$4)]),l=pe([...d,...u,...c.map(m=>p$1.isAbsolute(m.path)?m.path:p$1.join(t,m.path))]),f=e.reuseProjectModels,w=await Promise.all(l.map(m=>{if(f){let ze=p$1.relative(t,p$1.resolve(m)).split(p$1.sep).join("/"),me=f.get(ze);if(me)return Promise.resolve(me)}return gt(t,m,{includeAbsolutePaths:s,includeEvidence:n})})),x=typeof i?.workspace_name=="string"?i.workspace_name:typeof i?.name=="string"?i.name:o$1?.name||p$1.basename(t),j=typeof i?.profile=="string"?i.profile:typeof i?.mode=="string"?i.mode:void 0,R=Array.from(new Set(w.map(m=>m.kind))).sort(),E=Array.from(new Set(w.map(m=>m.runtime))).sort(),se=Array.from(new Set(w.map(m=>m.framework))).sort(),M=[".workspai/policies.yml",".workspai/policies.yaml",".rapidkit/policies.yml",".rapidkit/policies.yaml"].find(m=>C.existsSync(p$1.join(t,m))),I=o(t,"workspace.contract.json").map(m=>p$1.relative(t,m).split(p$1.sep).join("/")).find(m=>C.existsSync(p$1.join(t,m)))??".workspai/workspace.contract.json",P=await C.pathExists(p$1.join(t,I)),K={schemaVersion:it,generatedAt:r.toISOString(),workspace:{name:x,root:t,...j?{profile:j}:{},type:o$1?"rapidkit-workspace":"observed-workspace",...o$1?{marker:{createdBy:o$1.createdBy,version:o$1.version,createdAt:o$1.createdAt}}:{}},identity:{workspaceType:kt(w),surfaces:R,runtimeFamilies:E,businessCapabilities:ht(w)},discovery:{observableScanDepth:a$4},projects:w,policies:{mode:typeof i?.policy_mode=="string"?i.policy_mode:typeof i?.policyMode=="string"?i.policyMode:"warn",source:M??null,exists:!!M},contracts:{workspaceContractPath:I,exists:P,status:P?"known":"missing"},evidence:{doctor:await S(t,a.doctor,n),projectDoctor:await S(t,".workspai/reports/doctor-project-last-run.json",n),doctorRemediationPlan:await S(t,".workspai/reports/doctor-remediation-plan-last-run.json",n),artifactRemediationPlan:await S(t,".workspai/reports/artifact-remediation-plan-last-run.json",n),doctorFixResult:await S(t,".workspai/reports/doctor-fix-result-last-run.json",n),analyze:await S(t,a.analyze,n),readiness:await S(t,a.readiness,n),pipeline:await S(t,".workspai/reports/pipeline-last-run.json",n)},summary:{projectCount:w.length,runtimes:E,frameworks:se,firstClassProjects:w.filter(m=>m.supportTier==="first-class").length,observedProjects:w.filter(m=>m.supportTier==="observed").length}},O=await Le(t,K,{contractExists:P,now:r,incrementalGraph:e.incrementalGraph}),_={...K,graph:O},k=Be(_),v=yt({..._},r),W=Ve({facts:v,generatedAt:r.toISOString(),now:r});return {..._,facts:v,factFreshness:W,validation:k}}async function lr(e){if(e.cache!==true)return {model:await re(e),cache:"disabled"};let t=p$1.resolve(e.workspacePath),s=le(e.observableScanDepth),n=ie(),[a,r,o,i,c]=await Promise.all([a$1(t),ue(t),a$2(t),a$3(t,{descendIntoMatchedProjects:false}),de(t,s)]),d=pe([...i,...c,...o.map(j=>p$1.isAbsolute(j.path)?j.path:p$1.join(t,j.path))]),u=await Z({workspacePath:t,cliVersion:n,flags:{includeAbsolutePaths:e.includeAbsolutePaths===true,includeEvidence:e.includeEvidence===true,observableScanDepth:s},projectPaths:d,workspaceJson:r,marker:a}),l=await ce(t);if(l&&l.cliVersion===n&&l.inputsHash===u)return {model:l.model,cache:"hit"};let f=await re({...e}),[w,x]=await Promise.all([Y(t,d),Q(t)]);return await ee(t,{cliVersion:n,inputsHash:u,generatedAt:(e.now??new Date).toISOString(),model:f,projectSignatures:w,workspaceFileSignatures:x}),{model:f,cache:"miss"}}function wt(e,t){let s=new Set,n=new Set,a=new Set;for(let[r,o]of Object.entries(t))r in e?e[r]!==o&&s.add(r):n.add(r);for(let r of Object.keys(e))r in t||a.add(r);return {changed:s,added:n,removed:a}}function vt(e={},t={}){let s=new Set([...Object.keys(e),...Object.keys(t)]);for(let n of s)if(e[n]!==t[n])return false;return true}async function dr(e){let t=p$1.resolve(e.workspacePath),s=le(e.observableScanDepth),n=ie(),a=e.now??new Date,[r,o,i,c,d]=await Promise.all([a$1(t),ue(t),a$2(t),a$3(t,{descendIntoMatchedProjects:false}),de(t,s)]),u=pe([...c,...d,...i.map(k=>p$1.isAbsolute(k.path)?k.path:p$1.join(t,k.path))]),l=await ce(t),f=async()=>{let k=await re({...e}),v=await Z({workspacePath:t,cliVersion:n,flags:{includeAbsolutePaths:e.includeAbsolutePaths===true,includeEvidence:e.includeEvidence===true,observableScanDepth:s},projectPaths:u,workspaceJson:o,marker:r}),[W,m]=await Promise.all([Y(t,u),Q(t)]);return await ee(t,{cliVersion:n,inputsHash:v,generatedAt:a.toISOString(),model:k,projectSignatures:W,workspaceFileSignatures:m}),{model:k,mode:"full"}};if(!l||l.cliVersion!==n||!l.projectSignatures||!l.model?.graph)return f();let w=await Q(t);if(!vt(l.workspaceFileSignatures,w))return f();let x=await Y(t,u),{changed:j,added:R,removed:E}=wt(l.projectSignatures,x);if(j.size===0&&R.size===0&&E.size===0)return {model:l.model,mode:"unchanged"};let se=new Set([...j,...R]),M=new Map;for(let k of l.model.projects){let v=k.path.split(p$1.sep).join("/");!se.has(v)&&!E.has(v)&&M.set(v,k);}let I=new Set,P=false;for(let k of l.model.projects){let v=k.path.split(p$1.sep).join("/");j.has(v)&&I.add(k.name);}let K=R.size>0||E.size>0,O=await re({...e,reuseProjectModels:M,incrementalGraph:{previousGraph:l.model.graph,changedProjectIds:I,structuralChange:K||P}});for(let k of l.model.projects){let v=k.path.split(p$1.sep).join("/");if(!j.has(v))continue;let W=O.projects.find(m=>m.path.split(p$1.sep).join("/")===v);if(W&&W.name!==k.name){P=true;break}}if(P)return f();let _=await Z({workspacePath:t,cliVersion:n,flags:{includeAbsolutePaths:e.includeAbsolutePaths===true,includeEvidence:e.includeEvidence===true,observableScanDepth:s},projectPaths:u,workspaceJson:o,marker:r});return await ee(t,{cliVersion:n,inputsHash:_,generatedAt:a.toISOString(),model:O,projectSignatures:x,workspaceFileSignatures:w}),{model:O,mode:"incremental"}}async function He(e){try{let{contract:t}=await m({workspacePath:e});return t&&typeof t=="object"?t:null}catch{return null}}async function Le(e,t,s){let n=s.contractExists?await He(e):null;try{return s.incrementalGraph?await g({workspacePath:e,model:t,contract:n,now:s.now,previousGraph:s.incrementalGraph.previousGraph,changedProjectIds:s.incrementalGraph.changedProjectIds,structuralChange:s.incrementalGraph.structuralChange}):await f({workspacePath:e,model:t,contract:n,now:s.now})}catch{let a=t.projects.map(r=>({id:r.name,path:r.path}));return {schemaVersion:"workspace-dependency-graph.v1",generatedAt:s.now.toISOString(),nodes:a,edges:[],stats:{nodeCount:a.length,edgeCount:0,inferredEdges:0,contractEdges:0,manualEdges:0,authoritativeEdges:0,lowConfidenceEdges:0,orphanCount:a.length,connectedNodeCount:0,density:0,edgeCoverageRatio:a.length>0?0:1,evidenceCoverageRatio:1,hotspotCount:0,hasCycle:false},diagnostics:a.length>1?[{code:"graph.inference.failed",severity:"warning",message:"Dependency graph inference failed; model contains projects but no dependency edges.",recommendation:"Run workspace model again after fixing graph inputs, or add workspace contract/manual graph overrides.",nodeIds:a.map(r=>r.id).sort((r,o)=>r.localeCompare(o))}]:void 0}}}async function pr(e,t){let s=e.contracts.exists?await He(t):null,{buildWorkspaceKnowledgeGraph:n}=await import('./workspace-knowledge-graph-ARDC6HHG.js'),a$1=a$4(e),r=await n({workspacePath:t,workspace:{name:e.workspace.name,...e.workspace.profile?{profile:e.workspace.profile}:{}},projects:e.projects.map(i=>({id:i.name,path:i.path,...i.absolutePath?{absolutePath:i.absolutePath}:{},runtime:i.runtime,framework:i.framework,...i.kit?{kit:i.kit}:{}})),projectTopology:e.graph??await Le(t,e,{contractExists:e.contracts.exists,now:new Date(e.generatedAt)}),contract:s,now:new Date(e.generatedAt),source:{kind:"workspace-model",artifact:te,hashAlgorithm:"sha256",hash:d(a$1)}}),[,o]=await f$1(t,te,[{relativePath:a.knowledgeGraph,payload:r},{relativePath:te,payload:a$1}]);return o}export{Te as a,h as b,Ve as c,_e as d,Wt as e,Oe as f,it as g,te as h,cr as i,yt as j,re as k,lr as l,dr as m,pr as n};
|
package/dist/chunk-3NU32T4A.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-KB44JP4M.js';import {a,c,b,i}from'./chunk-BMWFQXGW.js';import h from'path';var w=Object.keys(a).flatMap(t=>{let o=t,a$1=b[o],r=c[o];return !a$1||!r?[]:[{artifactPath:a[o],schemaVersion:a$1,contractPath:r}]}),m=[{artifactPath:".workspai/workspace.contract.json",schemaVersion:1,contractPath:"contracts/workspace-contract.v1.json"},{artifactPath:".workspai/cache/workspace-model.v1.json",schemaVersion:"workspace-model-cache.v1",contractPath:"contracts/workspace-model-cache.v1.json"},{artifactPath:".workspai/workspace-registry.v1.json",schemaVersion:"workspace-registry.v1",contractPath:"contracts/workspace-registry.v1.json"},{artifactPath:".workspai/compatibility-matrix.json",schemaVersion:"rapidkit.compatibility-matrix.v1",contractPath:"contracts/compatibility-matrix.v1.json"},{artifactPath:".workspai/reports/doctor-workspace-cache.json",schemaVersion:"doctor-workspace-cache-v2",contractPath:"contracts/doctor-workspace-cache.v2.json"},{artifactPath:".workspai/reports/bootstrap-compliance.latest.json",schemaVersion:"bootstrap-compliance.v1",contractPath:"contracts/bootstrap-compliance.v1.json"},{artifactPath:".workspai/reports/mirror-ops.latest.json",schemaVersion:"mirror-ops.v1",contractPath:"contracts/mirror-ops.v1.json"},{artifactPath:".workspai/reports/transparency-evidence.latest.json",schemaVersion:"transparency-evidence.v1",contractPath:"contracts/transparency-evidence.v1.json"},{artifactPath:".workspai/reports/share-bundle.json",schemaVersion:"1.1",schemaVersionField:"schema_version",contractPath:"contracts/workspace-share-bundle.v1.json"},{artifactPath:".workspai/reports/doctor-project-last-run.json",schemaVersion:"doctor-project-evidence-v1",contractPath:"contracts/doctor-project-evidence.v1.json"},{artifactPath:".workspai/reports/doctor-remediation-plan-last-run.json",schemaVersion:"doctor-remediation-plan-v2",contractPath:"contracts/doctor-remediation-plan.v2.json"},{artifactPath:".workspai/reports/artifact-remediation-plan-last-run.json",schemaVersion:"artifact-remediation-plan-v1",contractPath:"contracts/artifact-remediation-plan.v1.json"},{artifactPath:".workspai/reports/doctor-fix-result-last-run.json",schemaVersion:"rapidkit-doctor-fix-result-v1",contractPath:"contracts/workspace-intelligence/doctor-fix-result.v1.json"},{artifactPath:".workspai/reports/pipeline-last-run.json",schemaVersion:"rapidkit-pipeline-v1",contractPath:"contracts/pipeline-last-run.v1.json"},{artifactPath:".workspai/reports/autopilot-release-last-run.json",schemaVersion:"autopilot-release-v1",contractPath:"contracts/autopilot-release.v1.json"},{artifactPath:".workspai/reports/autopilot-release.json",schemaVersion:"autopilot-release-v1",contractPath:"contracts/autopilot-release.v1.json"},{artifactPath:".workspai/reports/workspace-run-last.json",schemaVersion:"workspace-run-v1",contractPath:"contracts/workspace-run-last.v1.json"},{artifactPath:".workspai/reports/workspai-mcp-design.json",schemaVersion:"workspai-mcp-design.v1",contractPath:"contracts/workspace-intelligence/mcp-design.v1.json"},{artifactPath:".workspai/reports/workspace-why-last-run.json",schemaVersion:b.explain,contractPath:c.explain},{artifactPath:".workspai/reports/workspace-trace-last-run.json",schemaVersion:b.explain,contractPath:c.explain},{artifactPath:".vscode/workspai-agent-hooks.json",schemaVersion:"workspai-agent-hooks.v1",contractPath:"contracts/workspace-intelligence/agent-hooks.v1.json"},{artifactPath:".workspai/reports/infra-plan.json",schemaVersion:"rapidkit.infra-plan.v1",contractPath:"contracts/infra-plan.v1.json"}],d={".workspai/workspace.contract.json":[["workspace","sync"],["workspace","contract","sync"]],[a.intelligenceRun]:[["workspace","intelligence","run"]],[a.snapshot]:[["workspace","snapshot"]],[a.history]:[["workspace","feedback","record","--json"]],[a.evaluationLive]:[["workspace","eval","init"],["workspace","eval","record","--json"]],[a.evaluationLastRun]:[["workspace","eval","report","--json"]],".workspai/cache/workspace-model.v1.json":[["workspace","model"]],".workspai/workspace-registry.v1.json":[["workspace","sync"]],".workspai/compatibility-matrix.json":[["bootstrap"]],".workspai/reports/doctor-workspace-cache.json":[["doctor","workspace"]],".workspai/reports/bootstrap-compliance.latest.json":[["bootstrap"]],".workspai/reports/mirror-ops.latest.json":[["mirror","status"]],".workspai/reports/transparency-evidence.latest.json":[["mirror","sync"]],".workspai/reports/share-bundle.json":[["workspace","share"]],".workspai/reports/doctor-project-last-run.json":[["doctor","project"]],".workspai/reports/doctor-remediation-plan-last-run.json":[["workspace","remediation-plan"]],".workspai/reports/artifact-remediation-plan-last-run.json":[["workspace","remediation-plan"]],".workspai/reports/doctor-fix-result-last-run.json":[["doctor","workspace"]],".workspai/reports/pipeline-last-run.json":[["pipeline"]],".workspai/reports/autopilot-release-last-run.json":[["autopilot","release"]],".workspai/reports/autopilot-release.json":[["autopilot","release"]],".workspai/reports/workspace-run-last.json":[["workspace","run"]],".workspai/reports/workspai-mcp-design.json":[["workspace","agent-sync","--write"]],".workspai/reports/workspace-why-last-run.json":[["workspace","why"]],".workspai/reports/workspace-trace-last-run.json":[["workspace","trace"]],".vscode/workspai-agent-hooks.json":[["workspace","agent-sync"]],".workspai/reports/infra-plan.json":[["infra","plan"]]};function j(t){let o=Object.values(i).filter(r=>r.produces.includes(t)).map(r=>[...r.command]),a=d[t]??[];return [...o,...a.map(r=>[...r])]}var k=Object.freeze(Object.fromEntries([...w,...m].map(t=>[t.artifactPath,{...t,producerCommands:j(t.artifactPath)}])));function u(t){return t.split(h.sep).join("/").replace(/^\.\//,"")}var f=[{pattern:/^\.workspai\/reports\/bootstrap-compliance-[^/]+\.json$/,canonicalPath:".workspai/reports/bootstrap-compliance.latest.json"},{pattern:/^\.workspai\/reports\/mirror-ops-[^/]+\.json$/,canonicalPath:".workspai/reports/mirror-ops.latest.json"},{pattern:/^\.workspai\/reports\/transparency-evidence-[^/]+\.json$/,canonicalPath:".workspai/reports/transparency-evidence.latest.json"}];function P(t){let o=u(t),a=k[o];if(a)return a;let r=f.find(c=>c.pattern.test(o));return r?k[r.canonicalPath]??null:null}function y(t,o,a=t){let r=P(t);if(!r)return;let c=r.schemaVersionField??"schemaVersion",i=o&&typeof o=="object"?o[c]:void 0;if(i!==r.schemaVersion)throw new Error(`${a} schemaVersion is ${String(i)}, expected ${r.schemaVersion}`);a$1(o,r.contractPath,a);}
|
|
2
|
-
export{P as a,y as b};
|
package/dist/chunk-3ZK2GU7C.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var r="rapidkit-doctor-fix-result-v1",i="npx workspai workspace verify --from-impact .workspai/reports/workspace-impact-last-run.json --json";function n(e){return {schemaVersion:r,generatedAt:new Date().toISOString(),appliedFixes:e.appliedFixes,remainingBlockers:e.remainingBlockers,verifyRecommended:e.verifyRecommended??i}}export{r as a,i as b,n as c};
|
package/dist/chunk-4HDYADHT.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-JEI6BTZI.js';import {a}from'./chunk-VU7NZHPM.js';import {c,e,d}from'./chunk-CRHYBQI3.js';import {d as d$1,b}from'./chunk-OW42TZFB.js';import {g}from'./chunk-AFL3ACCR.js';import {k}from'./chunk-37CVKXBD.js';import {m,a as a$2}from'./chunk-T4YR4RAI.js';import {e as e$1}from'./chunk-32OJDBIG.js';import {b as b$1}from'./chunk-3NU32T4A.js';import {a as a$3}from'./chunk-KB44JP4M.js';import j from'path';import W from'fs-extra';function G(e$1){switch(e$1){case "why":return d;case "trace":return e;default:return c}}async function P(e,n,o){try{if(!await W.pathExists(e))return null;let r=await W.readJson(e);return n?b$1(n,r,e):o&&a$3(r,o,e),r}catch(r){if((n||o)&&await W.pathExists(e))throw r;return null}}function z(e,n){if(!e)return null;let o=n.trim().toLowerCase();return e.projects.find(r=>r.slug.toLowerCase()===o||r.relativePath.toLowerCase()===o)??null}function J(e,n,o){let r=o.trim().toLowerCase(),t=(e.graph?.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,j.basename(a.path)].filter(u=>u.trim().length>0).some(u=>u.toLowerCase()===r));if(d)return d.name;let c=z(n,o);if(c){let a=e.projects.find(u=>u.path===c.relativePath||u.path.endsWith(`/${c.relativePath}`));if(a)return a.name}return o}function X(e,n){if(!e)return [];let o=n.trim().toLowerCase(),r=new Set;for(let l of e.projects){l.contracts.dependsOn?.some(t=>t.toLowerCase()===o)&&r.add(l.slug);for(let t of l.contracts.consumes??[])for(let d of e.projects)d.contracts.publishes?.includes(t)&&d.slug===o&&r.add(l.slug);}return [...r].sort()}function Y(e,n){if(!e)return [];let o=n.trim().toLowerCase();return e.steps.filter(r=>r.scope==="project"&&r.project?.toLowerCase()===o&&r.command?.display).map(r=>r.command.display).slice(0,8)}function p(e,n,o){return {id:e,title:n,body:o.trim()}}async function me(e){let n=j.resolve(e.workspacePath),o=(e.now??new Date).toISOString(),r=e.model??await k({workspacePath:n,includeEvidence:true}),l=e.contract;if(l===void 0)try{l=(await m({workspacePath:n})).contract;}catch{l=null;}let t=e.verify;t===void 0&&(t=await P(j.join(n,d$1),d$1));let d=e.impact;if(d===void 0&&(d=await P(j.join(n,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
|
-
`):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
|
-
`))),{schemaVersion:a,generatedAt:o,workspacePath:n,target:e.target,summary:t?i?b(s.length,t.summary.verdict):`${s.length>0||t.summary.verdict==="blocked"?"Release blocked":"Release posture"}: ${t.summary.verdict} with ${s.length} blocking reason(s).`:"Release posture unknown \u2014 verify report missing.",sections:g,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:o,workspacePath:n,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
|
-
|
|
5
|
-
${m.commandRetryHint??""}
|
|
6
|
-
|
|
7
|
-
${m.fixHints.map(g=>`- ${g.detail}`).join(`
|
|
8
|
-
`)}`:"Run workspace verify to emit resolutionHints for this blocker.")],blockingReasons:i?[i]:[],resolutionHints:m?[m]:[]}}if(e.target.kind==="trace"){let s=j.isAbsolute(e.target.diffRef)?e.target.diffRef:j.join(n,e.target.diffRef),m=await P(s,void 0,"contracts/workspace-intelligence/workspace-model-diff.v1.json"),i=m?.summary?.changedProjects??[...new Set((m?.changes??[]).map(f=>f.project).filter(Boolean))],h=(r.summary?.projectCount??r.projects.length)===0,T=d?.transitiveImpact?.map(f=>`${f.project?.name??f.target} (d${f.distance??0}, via ${f.via??"\u2014"})`)??[],y=t?.affectedSubgraph;return {schemaVersion:a,generatedAt:o,workspacePath:n,target:e.target,summary:i?.length?`Trace from ${i.length} changed project(s) through blast radius to gate coverage.`:h?"Trace: workspace scaffold baseline \u2014 no project changes in the latest diff.":"Trace: diff baseline present with no project changes.",sections:[p("origin","Change origin",i?.length?i.map(f=>`- ${f}`).join(`
|
|
9
|
-
`):"No changed projects in diff."),p("blast-radius","Transitive impact",T.length?T.map(f=>`- ${f}`).join(`
|
|
10
|
-
`):"No transitive impact report."),p("gate","Subgraph gate",y?`Directly changed: ${y.directlyChanged}; transitive dependents: ${y.transitiveDependents}; covered: ${y.covered}; uncovered: ${y.uncovered}; unverifiable: ${y.unverifiable}.`:"No verify subgraph coverage available.")],releaseRisk:d?.summary?.risk??t?.impact.risk,blockingReasons:t?.blockingReasons}}let c=e.target.project,a$2=J(r,l,c),u=r.graph,k$1=u?a$1(u,a$2):{found:false,centrality:null,directDependents:[],transitiveDependents:[]},v=z(l,c),E=X(l,c),b$1=Y(t,c),w=r.projects.find(s=>s.name.toLowerCase()===c.toLowerCase()),x=[p("overview","Project overview",w?`${w.name} (${w.frameworkDisplayName}, ${w.runtime}) at \`${w.path}\`.`:`Project **${c}** ${k$1.found?"exists in graph":"not found in workspace model"}.`),p("consumers","Consumers / dependents",[`Direct dependents: ${k$1.directDependents.join(", ")||"none"}`,`Contract consumers: ${E.join(", ")||"none"}`,`Transitive dependents (blast radius): ${k$1.transitiveDependents.length}`].join(`
|
|
11
|
-
`)),p("contracts","Critical contracts",v?[`Owns: ${v.contracts?.owns?.join(", ")||"none"}`,`Publishes: ${v.contracts.publishes.join(", ")||"none"}`,`Consumes: ${v.contracts.consumes.join(", ")||"none"}`,`APIs: ${v.contracts.apis.map(s=>s.name).join(", ")||"none"}`].join(`
|
|
12
|
-
`):"No workspace.contract.json entry for this project."),p("verification","Required verification",b$1.length?b$1.map(s=>`- ${s}`).join(`
|
|
13
|
-
`):"- `npx workspai workspace verify --json`\n- Project test/build via `workspace run` when configured")];k$1.centrality&&x.push(p("centrality","Graph centrality",`fanIn ${k$1.centrality.fanIn}, fanOut ${k$1.centrality.fanOut}, reach ${k$1.centrality.reach}, hotspot ${k$1.centrality.isHotspot?"yes":"no"}.`));let I=c.trim().toLowerCase(),A=s=>s.project?.name?.toLowerCase()===I||s.target.toLowerCase()===I,S=d?.affectedProjects?.find(A)?.risk??d?.transitiveImpact?.find(A)?.risk??t?.impact.risk??"unknown";return {schemaVersion:a,generatedAt:o,workspacePath:n,target:e.target,summary:`${c}: ${E.length} consumer(s), release risk **${S}**.`,sections:x,releaseRisk:String(S)}}async function fe(e,n,o="explain"){let r=G(o);return await e$1(n,r,a$2(e)),r}export{G as a,me as b,fe as c};
|
package/dist/chunk-52PBRX7F.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var i="workspai-workspace-archive-capabilities-v1",r="workspai-workspace-archive-manifest-v1",s="workspai-workspace-archive-operation-result-v1";var a="contracts/workspace-archive-manifest.v1.json",o="contracts/workspace-archive-operation-result.v1.json",n={archiveCompression:{signature:"--archive-compression <mode>",description:"Archive compression: store (default) or deflate",appliesTo:["export"]},maxDownloadSize:{signature:"--max-download-size <size>",description:"Maximum remote archive download size (secure default: 5gb)",appliesTo:["inspect","verify","doctor","hydrate"]},maxExpandedSize:{signature:"--max-expanded-size <size>",description:"Maximum expanded archive payload size (secure default: 20gb)",appliesTo:["inspect","verify","doctor","hydrate"]},downloadTimeoutMs:{signature:"--download-timeout-ms <ms>",description:"Remote archive download timeout in milliseconds; 0 disables it",appliesTo:["inspect","verify","doctor","hydrate"]},allowPrivateNetwork:{signature:"--allow-private-network",description:"Allow archive downloads from loopback/private networks (unsafe for untrusted input)",appliesTo:["inspect","verify","doctor","hydrate"]}};export{i as a,r as b,s as c,a as d,o as e,n as f};
|