workspai 0.65.0 → 0.67.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.
Files changed (211) hide show
  1. package/README.md +28 -23
  2. package/contracts/agent-customization-pack.v1.json +4 -2
  3. package/contracts/analyze-last-run.v1.json +9 -1
  4. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +117 -0
  5. package/contracts/extension-cli-compatibility.v1.json +6 -0
  6. package/contracts/published-contract-catalog.v1.json +30 -0
  7. package/contracts/runtime-command-surface.v1.json +100 -2
  8. package/contracts/workspace-activity-board.v1.json +114 -0
  9. package/contracts/workspace-activity-event.v1.json +132 -0
  10. package/contracts/workspace-activity-monitor-fleet.v1.json +18 -0
  11. package/contracts/workspace-activity-monitor-snapshot.v1.json +161 -0
  12. package/contracts/workspace-intelligence/agent-bootstrap-receipt.v1.json +17 -0
  13. package/contracts/workspace-intelligence/mcp-design.v1.json +49 -2
  14. package/contracts/workspace-intelligence/project-agent-entry.v1.json +3 -0
  15. package/contracts/workspace-intelligence/project-context-agent.v1.json +49 -7
  16. package/contracts/workspace-intelligence/project-knowledge-graph-reference.v1.json +51 -0
  17. package/contracts/workspace-intelligence/workspace-intelligence-benchmark.v1.json +196 -0
  18. package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +97 -2
  19. package/contracts/workspace-intelligence/workspace-skills-index.v1.json +34 -0
  20. package/contracts/workspace-intelligence-architecture.v1.json +17 -0
  21. package/contracts/workspace-intelligence-chain.v1.json +17 -0
  22. package/dist/analyze-IC2KRVCG.js +1 -0
  23. package/dist/{artifact-remediation-plan-XIQNI35L.js → artifact-remediation-plan-GFFHC2ZU.js} +1 -1
  24. package/dist/autopilot-release-RECEZAZI.js +1 -0
  25. package/dist/capabilities-command-X4WZIJNR.js +1 -0
  26. package/dist/chunk-2LIVMG5C.js +2 -0
  27. package/dist/chunk-2M62CU3O.js +2 -0
  28. package/dist/chunk-2MTJWPQ4.js +1 -0
  29. package/dist/chunk-2MVIRJJR.js +1 -0
  30. package/dist/chunk-2RPFCBS4.js +1 -0
  31. package/dist/chunk-3O7LZPKA.js +4 -0
  32. package/dist/chunk-3OGPTLI2.js +1 -0
  33. package/dist/{chunk-6TBTMWNA.js → chunk-4RV4JVGR.js} +1 -1
  34. package/dist/{chunk-YYQEWAES.js → chunk-4WVOAX2V.js} +1 -1
  35. package/dist/{chunk-N4QQADXX.js → chunk-5EVDW7JM.js} +1 -1
  36. package/dist/{chunk-J3X56S7L.js → chunk-5ME4W4LN.js} +1 -1
  37. package/dist/chunk-5OA33JH2.js +2 -0
  38. package/dist/chunk-5TY74LLW.js +2 -0
  39. package/dist/chunk-6254CWUY.js +49 -0
  40. package/dist/{chunk-D5YJOQYK.js → chunk-6E2Y3XGT.js} +1 -1
  41. package/dist/chunk-ARUFY5W3.js +1 -0
  42. package/dist/chunk-B4IVVTMQ.js +2 -0
  43. package/dist/{chunk-HDNATYW7.js → chunk-BHFRP7TV.js} +1 -1
  44. package/dist/{chunk-KTN2ARZJ.js → chunk-BHM6RHTA.js} +3 -3
  45. package/dist/chunk-BRYJTW6S.js +2 -0
  46. package/dist/{chunk-HCFWT42C.js → chunk-BUYLM6QV.js} +1 -1
  47. package/dist/chunk-CPR2CMOY.js +1 -0
  48. package/dist/{chunk-XGE2FDI4.js → chunk-CZVT7T2X.js} +1 -1
  49. package/dist/chunk-EHCKITR4.js +2 -0
  50. package/dist/chunk-ENZPM52J.js +1 -0
  51. package/dist/chunk-FPDH3N3A.js +7 -0
  52. package/dist/{chunk-PXWKMPPI.js → chunk-FX5J6JCK.js} +1 -1
  53. package/dist/chunk-FY4X2VOE.js +39 -0
  54. package/dist/chunk-GIQ4SDRJ.js +1 -0
  55. package/dist/chunk-H77ZNH5O.js +1 -0
  56. package/dist/{chunk-2RL6RRT2.js → chunk-HQLBO23O.js} +50 -50
  57. package/dist/chunk-HYE5UHPV.js +2 -0
  58. package/dist/{chunk-D65FCQIO.js → chunk-IKUFNK46.js} +1 -1
  59. package/dist/{chunk-WRQWVSBJ.js → chunk-IQQMFRWM.js} +1 -1
  60. package/dist/chunk-JCGSIDMC.js +2 -0
  61. package/dist/chunk-KENOAC2Q.js +13 -0
  62. package/dist/chunk-KQ2TMI26.js +97 -0
  63. package/dist/chunk-L5Q2S5GY.js +3 -0
  64. package/dist/chunk-LPCZHKD5.js +1 -0
  65. package/dist/chunk-N4QFNOAI.js +1 -0
  66. package/dist/chunk-NMXGSVMD.js +1 -0
  67. package/dist/{chunk-GQSRNUCU.js → chunk-NVND4727.js} +3 -3
  68. package/dist/{chunk-W6FHVXNL.js → chunk-OCNPOYMA.js} +1 -1
  69. package/dist/chunk-PSYQ6IJA.js +12 -0
  70. package/dist/{chunk-VRGEPPUB.js → chunk-QMQBX3RV.js} +1 -1
  71. package/dist/{chunk-YUGKQ44M.js → chunk-SLFOUSRW.js} +1 -1
  72. package/dist/chunk-SRLWHOLF.js +1 -0
  73. package/dist/chunk-SVYY55IS.js +157 -0
  74. package/dist/chunk-SX6A656X.js +1 -0
  75. package/dist/{chunk-X6TNBARH.js → chunk-TABXSDTR.js} +2 -2
  76. package/dist/chunk-THIG2YQP.js +681 -0
  77. package/dist/chunk-TP7VKEUF.js +1 -0
  78. package/dist/chunk-U5ENEDJA.js +7 -0
  79. package/dist/chunk-UTV4DTNM.js +1 -0
  80. package/dist/chunk-VI4ZRAY6.js +1 -0
  81. package/dist/chunk-VQZ5PI5J.js +1 -0
  82. package/dist/chunk-VWBMDGPY.js +9 -0
  83. package/dist/chunk-XDPTAV2T.js +2 -0
  84. package/dist/chunk-XWKGZRHN.js +1 -0
  85. package/dist/chunk-Y35VLVF6.js +5 -0
  86. package/dist/{chunk-VYDURWN7.js → chunk-Y4Z6CEII.js} +1 -1
  87. package/dist/chunk-YYY2WXOH.js +1 -0
  88. package/dist/chunk-ZGHJIQXL.js +1 -0
  89. package/dist/chunk-ZI2E7P6O.js +4 -0
  90. package/dist/{create-ALT2ME6H.js → create-72ITVZXV.js} +1 -1
  91. package/dist/{demo-kit-QHIDCSBI.js → demo-kit-5UQH2OXC.js} +1 -1
  92. package/dist/{doctor-RW4R3O5C.js → doctor-CVYUESRQ.js} +1 -1
  93. package/dist/{dotnet-webapi-clean-AVHPJG7Y.js → dotnet-webapi-clean-YEHYIGOT.js} +1 -1
  94. package/dist/{goal-lifecycle-VYOKS6E6.js → goal-lifecycle-H55AGFCB.js} +1 -1
  95. package/dist/goal-pack-6OBZOPCD.js +1 -0
  96. package/dist/{gofiber-standard-47S2GYAO.js → gofiber-standard-C44IIQYH.js} +1 -1
  97. package/dist/{gogin-standard-EWB4XNOI.js → gogin-standard-X7VKACVR.js} +1 -1
  98. package/dist/index.d.ts +20 -2
  99. package/dist/index.js +177 -177
  100. package/dist/live-command-5VXPR43F.js +15 -0
  101. package/dist/{pipeline-U4N2DVD7.js → pipeline-SKYOXWHW.js} +1 -1
  102. package/dist/{project-agent-entry-YAQCHIMP.js → project-agent-entry-5IUBEREI.js} +1 -1
  103. package/dist/project-intelligence-lens-LQCN65P2.js +1 -0
  104. package/dist/{project-test-coverage-4S7MEQ6T.js → project-test-coverage-KD4LLFGV.js} +1 -1
  105. package/dist/{pythonRapidkitExec-VAW5XE4Z.js → pythonRapidkitExec-44ORGQ4R.js} +1 -1
  106. package/dist/{rust-axum-M5X4ZC4Z.js → rust-axum-JKZTZDRZ.js} +1 -1
  107. package/dist/{springboot-standard-Y5ADLZMQ.js → springboot-standard-PI4FLTAN.js} +1 -1
  108. package/dist/verified-goal-HN7G532B.js +1 -0
  109. package/dist/{workspace-HGUZWNAB.js → workspace-5W7FYGDQ.js} +1 -1
  110. package/dist/{workspace-agent-sync-GEN3KBAX.js → workspace-agent-sync-OZCDQORK.js} +1 -1
  111. package/dist/{workspace-archive-ZBCKJHXS.js → workspace-archive-NOSGRKRZ.js} +1 -1
  112. package/dist/{workspace-context-4WIWFW26.js → workspace-context-L65BR5L6.js} +1 -1
  113. package/dist/{workspace-contract-7DXK4GF5.js → workspace-contract-JYHNEJPV.js} +1 -1
  114. package/dist/workspace-explain-SUBK6FLO.js +1 -0
  115. package/dist/workspace-explain-contract-WMREJWHF.js +1 -0
  116. package/dist/{workspace-feedback-RQ4TGJW6.js → workspace-feedback-MWGCT5R2.js} +1 -1
  117. package/dist/{workspace-foundation-J3NNRMI3.js → workspace-foundation-VIB3PXNH.js} +1 -1
  118. package/dist/{workspace-graph-stream-PQI7OGCE.js → workspace-graph-stream-45JHE4MG.js} +1 -1
  119. package/dist/workspace-graph-token-efficiency-NPECU6Y5.js +1 -0
  120. package/dist/{workspace-history-SYCDK7FO.js → workspace-history-JKW3VJO3.js} +1 -1
  121. package/dist/{workspace-intelligence-6FS26JOQ.js → workspace-intelligence-3C47PK4L.js} +1 -1
  122. package/dist/workspace-intelligence-benchmark-SRDIHX3X.js +1 -0
  123. package/dist/workspace-intelligence-evaluation-OJIQS5SN.js +1 -0
  124. package/dist/{workspace-intelligence-runner-XYUPCSLN.js → workspace-intelligence-runner-OWN5ZI6W.js} +1 -1
  125. package/dist/{workspace-intelligence-runtime-registry-IW6J53LO.js → workspace-intelligence-runtime-registry-UKFB3BI7.js} +1 -1
  126. package/dist/workspace-knowledge-graph-AKG5NUU6.js +1 -0
  127. package/dist/{workspace-knowledge-graph-contract-L3CLAM2M.js → workspace-knowledge-graph-contract-X52KXBXJ.js} +1 -1
  128. package/dist/{workspace-knowledge-graph-query-FZXSPWGK.js → workspace-knowledge-graph-query-DXA4CROE.js} +1 -1
  129. package/dist/workspace-knowledge-graph-snapshot-SNI5K2RL.js +1 -0
  130. package/dist/{workspace-marker-7NHMDIRL.js → workspace-marker-XGAWZZDX.js} +1 -1
  131. package/dist/workspace-mcp-serve-PK226GMV.js +3 -0
  132. package/dist/workspace-model-R4ISKDB2.js +1 -0
  133. package/dist/{workspace-onboarding-X3PWRIIS.js → workspace-onboarding-Y5RPEFUD.js} +1 -1
  134. package/dist/{workspace-python-engine-state-J4QKW55K.js → workspace-python-engine-state-BE4A3BL5.js} +1 -1
  135. package/dist/{workspace-readme-G7TZ3V5T.js → workspace-readme-PL5V3UDH.js} +2 -2
  136. package/dist/{workspace-registry-summary-LJN4WHIZ.js → workspace-registry-summary-STGUGROG.js} +1 -1
  137. package/dist/workspace-repair-engine-FNLL5ZDK.js +3 -0
  138. package/dist/workspace-run-GFBFGUFM.js +1 -0
  139. package/dist/{workspace-verify-USRRIM2F.js → workspace-verify-AXVX3PF3.js} +1 -1
  140. package/dist/{workspace-watch-43YZPLF7.js → workspace-watch-RLBEJKXE.js} +1 -1
  141. package/docs/DEVELOPMENT.md +19 -0
  142. package/docs/README.md +19 -16
  143. package/docs/SETUP.md +10 -0
  144. package/docs/agent-entry.md +22 -7
  145. package/docs/ci-workflows.md +1 -1
  146. package/docs/commands-reference.md +58 -8
  147. package/docs/contracts/ARTIFACT_CATALOG.md +64 -44
  148. package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +1 -0
  149. package/docs/contracts/NAMING_AND_COEXISTENCE.md +20 -18
  150. package/docs/contracts/README.md +7 -3
  151. package/docs/real-world-qualification.md +19 -3
  152. package/docs/workspace-intelligence-benchmark.md +82 -0
  153. package/docs/workspace-knowledge-graph.md +95 -27
  154. package/docs/workspace-live-activity.md +209 -0
  155. package/docs/workspace-operations.md +32 -9
  156. package/package.json +4 -2
  157. package/dist/analyze-5PDVWECJ.js +0 -1
  158. package/dist/autopilot-release-JVIJCTKX.js +0 -1
  159. package/dist/capabilities-command-LHM3XIS6.js +0 -1
  160. package/dist/chunk-2647BYBC.js +0 -1
  161. package/dist/chunk-27UR373Z.js +0 -1
  162. package/dist/chunk-2C5ZBVBI.js +0 -2
  163. package/dist/chunk-6JWNDWOA.js +0 -1
  164. package/dist/chunk-CCDGHPEJ.js +0 -2
  165. package/dist/chunk-DFG33SBR.js +0 -2
  166. package/dist/chunk-FY4IIAIF.js +0 -1
  167. package/dist/chunk-HEZZ72V4.js +0 -94
  168. package/dist/chunk-HN7P4T3B.js +0 -681
  169. package/dist/chunk-ILIBOMYL.js +0 -1
  170. package/dist/chunk-J7QYANXK.js +0 -8
  171. package/dist/chunk-JD3A5QM6.js +0 -2
  172. package/dist/chunk-JQLJBK5N.js +0 -1
  173. package/dist/chunk-KLSSPJTV.js +0 -1
  174. package/dist/chunk-L22EABIC.js +0 -7
  175. package/dist/chunk-LNXIMF3O.js +0 -1
  176. package/dist/chunk-MDTI3UEB.js +0 -1
  177. package/dist/chunk-MOSXTVPU.js +0 -1
  178. package/dist/chunk-MYJQGGIU.js +0 -5
  179. package/dist/chunk-NOV6723U.js +0 -1
  180. package/dist/chunk-NYEAMMUL.js +0 -1
  181. package/dist/chunk-NZ3WZYD5.js +0 -1
  182. package/dist/chunk-O5B2L3R2.js +0 -1
  183. package/dist/chunk-OWB5KWSS.js +0 -13
  184. package/dist/chunk-P5PSZQPB.js +0 -2
  185. package/dist/chunk-QCKWQFCD.js +0 -1
  186. package/dist/chunk-QI3HG6IG.js +0 -144
  187. package/dist/chunk-SWGSFLTC.js +0 -1
  188. package/dist/chunk-THIOE2PB.js +0 -2
  189. package/dist/chunk-U5FCQTVL.js +0 -4
  190. package/dist/chunk-UXEO5QCF.js +0 -33
  191. package/dist/chunk-VR6XMUF3.js +0 -2
  192. package/dist/chunk-VVJK5NFY.js +0 -2
  193. package/dist/chunk-VXKWWX7S.js +0 -8
  194. package/dist/chunk-W322YDHS.js +0 -49
  195. package/dist/chunk-WPRLXKWC.js +0 -8
  196. package/dist/chunk-Y5YAP4F3.js +0 -2
  197. package/dist/chunk-YN5X2FTP.js +0 -1
  198. package/dist/chunk-YOCN7GF4.js +0 -1
  199. package/dist/goal-pack-YWPI43QL.js +0 -1
  200. package/dist/project-intelligence-lens-MRQR2LQW.js +0 -1
  201. package/dist/verified-goal-WM34TTGE.js +0 -1
  202. package/dist/workspace-explain-TE2LGOAV.js +0 -1
  203. package/dist/workspace-explain-contract-V2IVSROX.js +0 -1
  204. package/dist/workspace-graph-token-efficiency-2I4X374C.js +0 -1
  205. package/dist/workspace-intelligence-evaluation-CQDKOYZZ.js +0 -1
  206. package/dist/workspace-knowledge-graph-SWCKDTPF.js +0 -1
  207. package/dist/workspace-knowledge-graph-snapshot-M572JRB4.js +0 -1
  208. package/dist/workspace-mcp-serve-IBMTFQDY.js +0 -3
  209. package/dist/workspace-model-ZL6WCICX.js +0 -1
  210. package/dist/workspace-repair-engine-NX7I632M.js +0 -3
  211. package/dist/workspace-run-6GT5OBQ5.js +0 -1
@@ -0,0 +1,196 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workspai.dev/schemas/workspace-intelligence/workspace-intelligence-benchmark.v1.json",
4
+ "title": "Workspai Workspace Intelligence Benchmark",
5
+ "description": "A deterministic multi-scenario retrieval benchmark with an optional, separately classified evaluation measurement. Estimated retrieval reduction is never represented as measured model savings.",
6
+ "type": "object",
7
+ "required": [
8
+ "schemaVersion",
9
+ "generatedAt",
10
+ "workspace",
11
+ "suite",
12
+ "graph",
13
+ "methodology",
14
+ "corpus",
15
+ "scenarios",
16
+ "retrievalSummary",
17
+ "evaluation"
18
+ ],
19
+ "properties": {
20
+ "schemaVersion": { "const": "workspace-intelligence-benchmark.v1" },
21
+ "generatedAt": { "type": "string", "format": "date-time" },
22
+ "workspace": {
23
+ "type": "object",
24
+ "required": ["name", "path"],
25
+ "properties": {
26
+ "name": { "type": "string", "minLength": 1 },
27
+ "path": { "type": "string", "minLength": 1 }
28
+ },
29
+ "additionalProperties": false
30
+ },
31
+ "suite": {
32
+ "type": "object",
33
+ "required": ["id", "version", "title"],
34
+ "properties": {
35
+ "id": { "const": "agent-core.v1" },
36
+ "version": { "const": 1 },
37
+ "title": { "type": "string", "minLength": 1 }
38
+ },
39
+ "additionalProperties": false
40
+ },
41
+ "graph": {
42
+ "type": "object",
43
+ "required": [
44
+ "schemaVersion",
45
+ "sourceArtifact",
46
+ "sourceHash",
47
+ "entityCount",
48
+ "relationCount",
49
+ "proofCount"
50
+ ],
51
+ "properties": {
52
+ "schemaVersion": { "const": "workspace-knowledge-graph.v1" },
53
+ "sourceArtifact": { "type": "string", "minLength": 1 },
54
+ "sourceHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
55
+ "entityCount": { "type": "integer", "minimum": 0 },
56
+ "relationCount": { "type": "integer", "minimum": 0 },
57
+ "proofCount": { "type": "integer", "minimum": 0 }
58
+ },
59
+ "additionalProperties": false
60
+ },
61
+ "methodology": {
62
+ "type": "object",
63
+ "required": [
64
+ "id",
65
+ "charsPerEstimatedToken",
66
+ "deterministic",
67
+ "networkRequired",
68
+ "scenarioTargetPolicy",
69
+ "claimBoundary"
70
+ ],
71
+ "properties": {
72
+ "id": { "const": "multi-scenario-bounded-retrieval.v1" },
73
+ "charsPerEstimatedToken": { "const": 4 },
74
+ "deterministic": { "const": true },
75
+ "networkRequired": { "const": false },
76
+ "scenarioTargetPolicy": { "const": "evidence-backed-representative.v1" },
77
+ "claimBoundary": { "type": "string", "minLength": 1 }
78
+ },
79
+ "additionalProperties": false
80
+ },
81
+ "corpus": { "$ref": "#/$defs/corpus" },
82
+ "scenarios": {
83
+ "type": "array",
84
+ "minItems": 1,
85
+ "items": { "$ref": "#/$defs/scenario" }
86
+ },
87
+ "retrievalSummary": {
88
+ "type": "object",
89
+ "required": [
90
+ "provenance",
91
+ "scenarioCount",
92
+ "matchedScenarioCount",
93
+ "medianRetrievalEstimatedTokens",
94
+ "p95RetrievalEstimatedTokens",
95
+ "medianEstimatedReductionPercent",
96
+ "status"
97
+ ],
98
+ "properties": {
99
+ "provenance": { "const": "estimated" },
100
+ "scenarioCount": { "type": "integer", "minimum": 1 },
101
+ "matchedScenarioCount": { "type": "integer", "minimum": 0 },
102
+ "medianRetrievalEstimatedTokens": { "type": "integer", "minimum": 0 },
103
+ "p95RetrievalEstimatedTokens": { "type": "integer", "minimum": 0 },
104
+ "medianEstimatedReductionPercent": { "type": "number", "minimum": 0, "maximum": 100 },
105
+ "status": { "enum": ["passed", "partial", "unavailable"] }
106
+ },
107
+ "additionalProperties": false
108
+ },
109
+ "evaluation": {
110
+ "type": "object",
111
+ "required": [
112
+ "availability",
113
+ "provenance",
114
+ "trustedMeasuredReductionPercent",
115
+ "claimBoundary"
116
+ ],
117
+ "properties": {
118
+ "availability": { "enum": ["available", "unavailable"] },
119
+ "provenance": { "enum": ["measured", "mixed", "estimated", "unavailable"] },
120
+ "current": { "$ref": "#/$defs/currentEvaluation" },
121
+ "comparison": { "$ref": "workspace-intelligence-evaluation-comparison.v1.json" },
122
+ "trustedMeasuredReductionPercent": { "type": ["number", "null"] },
123
+ "claimBoundary": { "type": "string", "minLength": 1 }
124
+ },
125
+ "additionalProperties": false
126
+ }
127
+ },
128
+ "additionalProperties": false,
129
+ "$defs": {
130
+ "corpus": {
131
+ "type": "object",
132
+ "required": ["artifactCount", "characterCount", "estimatedTokens", "unreadableArtifacts"],
133
+ "properties": {
134
+ "artifactCount": { "type": "integer", "minimum": 0 },
135
+ "characterCount": { "type": "integer", "minimum": 0 },
136
+ "estimatedTokens": { "type": "integer", "minimum": 0 },
137
+ "unreadableArtifacts": {
138
+ "type": "array",
139
+ "items": { "type": "string" },
140
+ "uniqueItems": true
141
+ }
142
+ },
143
+ "additionalProperties": false
144
+ },
145
+ "scenario": {
146
+ "type": "object",
147
+ "required": [
148
+ "id",
149
+ "title",
150
+ "query",
151
+ "queryOrigin",
152
+ "targetEntityId",
153
+ "targetKind",
154
+ "targetRetrieved",
155
+ "result",
156
+ "matchCount",
157
+ "truncated",
158
+ "retrievalCharacterCount",
159
+ "retrievalEstimatedTokens",
160
+ "estimatedTokensAvoided",
161
+ "estimatedReductionPercent"
162
+ ],
163
+ "properties": {
164
+ "id": { "type": "string", "minLength": 1 },
165
+ "title": { "type": "string", "minLength": 1 },
166
+ "query": { "type": "string", "minLength": 1 },
167
+ "queryOrigin": { "const": "graph-derived" },
168
+ "targetEntityId": { "type": "string", "minLength": 1 },
169
+ "targetKind": { "type": "string", "minLength": 1 },
170
+ "targetRetrieved": { "type": "boolean" },
171
+ "result": { "enum": ["matched", "empty"] },
172
+ "matchCount": { "type": "integer", "minimum": 0, "maximum": 100 },
173
+ "truncated": { "type": "boolean" },
174
+ "retrievalCharacterCount": { "type": "integer", "minimum": 0 },
175
+ "retrievalEstimatedTokens": { "type": "integer", "minimum": 0 },
176
+ "estimatedTokensAvoided": { "type": "integer", "minimum": 0 },
177
+ "estimatedReductionPercent": { "type": "number", "minimum": 0, "maximum": 100 }
178
+ },
179
+ "additionalProperties": false
180
+ },
181
+ "currentEvaluation": {
182
+ "type": "object",
183
+ "required": ["runId", "taskId", "strategy", "status", "summary"],
184
+ "properties": {
185
+ "runId": { "type": "string", "minLength": 1 },
186
+ "taskId": { "type": "string", "minLength": 1 },
187
+ "strategy": {
188
+ "enum": ["full-corpus", "grep", "vector", "graph", "workspace-intelligence", "custom"]
189
+ },
190
+ "status": { "enum": ["live", "completed", "aborted"] },
191
+ "summary": { "$ref": "workspace-intelligence-evaluation.v1.json#/properties/summary" }
192
+ },
193
+ "additionalProperties": false
194
+ }
195
+ }
196
+ }
@@ -66,7 +66,33 @@
66
66
  "hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
67
67
  "fileCount": { "type": "integer", "minimum": 0 },
68
68
  "fileLimit": { "type": "integer", "minimum": 1 },
69
- "truncated": { "type": "boolean" }
69
+ "truncated": { "type": "boolean" },
70
+ "eligibleFileCount": { "type": "integer", "minimum": 0 },
71
+ "eligibleFileCountExact": { "type": "boolean" },
72
+ "inventoryMode": { "enum": ["complete", "emergency-bounded"] },
73
+ "inventoryStrategy": {
74
+ "enum": ["git-index-worktree-v1", "filesystem-bfs-v1"]
75
+ },
76
+ "selection": {
77
+ "type": "object",
78
+ "required": [
79
+ "strategy",
80
+ "semanticFileCount",
81
+ "semanticFileBudget",
82
+ "deepFileCount",
83
+ "deepFileBudget",
84
+ "sourceExtractionFileBudget"
85
+ ],
86
+ "properties": {
87
+ "strategy": { "const": "component-language-round-robin-v1" },
88
+ "semanticFileCount": { "type": "integer", "minimum": 0 },
89
+ "semanticFileBudget": { "type": "integer", "minimum": 1 },
90
+ "deepFileCount": { "type": "integer", "minimum": 0 },
91
+ "deepFileBudget": { "type": "integer", "minimum": 1 },
92
+ "sourceExtractionFileBudget": { "type": "integer", "minimum": 1 }
93
+ },
94
+ "additionalProperties": false
95
+ }
70
96
  },
71
97
  "additionalProperties": false
72
98
  }
@@ -260,7 +286,37 @@
260
286
  "discoveredEntities": { "type": "integer", "minimum": 0 },
261
287
  "discoveredRelations": { "type": "integer", "minimum": 0 },
262
288
  "proofCount": { "type": "integer", "minimum": 0 },
263
- "diagnostics": { "type": "array", "items": { "type": "string" } }
289
+ "diagnostics": { "type": "array", "items": { "type": "string" } },
290
+ "inputCoverage": {
291
+ "type": "array",
292
+ "items": {
293
+ "type": "object",
294
+ "required": [
295
+ "scope",
296
+ "scopeId",
297
+ "tier",
298
+ "status",
299
+ "eligibleFiles",
300
+ "suppliedFiles",
301
+ "selectionStrategy"
302
+ ],
303
+ "properties": {
304
+ "scope": { "enum": ["workspace", "project"] },
305
+ "scopeId": { "type": "string", "minLength": 1 },
306
+ "tier": {
307
+ "enum": ["complete-inventory", "adaptive-semantic", "adaptive-deep", "derived"]
308
+ },
309
+ "status": { "enum": ["complete", "bounded", "not-applicable"] },
310
+ "eligibleFiles": { "type": "integer", "minimum": 0 },
311
+ "suppliedFiles": { "type": "integer", "minimum": 0 },
312
+ "fileBudget": { "type": "integer", "minimum": 1 },
313
+ "selectionStrategy": {
314
+ "enum": ["complete", "component-language-round-robin-v1", "derived"]
315
+ }
316
+ },
317
+ "additionalProperties": false
318
+ }
319
+ }
264
320
  },
265
321
  "additionalProperties": false
266
322
  }
@@ -306,6 +362,45 @@
306
362
  },
307
363
  "additionalProperties": false
308
364
  },
365
+ "completeness": {
366
+ "type": "object",
367
+ "required": ["status", "inventory", "providers"],
368
+ "properties": {
369
+ "status": { "enum": ["complete", "bounded"] },
370
+ "inventory": {
371
+ "type": "object",
372
+ "required": [
373
+ "scopeCount",
374
+ "completeScopes",
375
+ "boundedScopes",
376
+ "eligibleFiles",
377
+ "indexedFiles",
378
+ "eligibleFileCountExact"
379
+ ],
380
+ "properties": {
381
+ "scopeCount": { "type": "integer", "minimum": 0 },
382
+ "completeScopes": { "type": "integer", "minimum": 0 },
383
+ "boundedScopes": { "type": "integer", "minimum": 0 },
384
+ "eligibleFiles": { "type": "integer", "minimum": 0 },
385
+ "indexedFiles": { "type": "integer", "minimum": 0 },
386
+ "eligibleFileCountExact": { "type": "boolean" }
387
+ },
388
+ "additionalProperties": false
389
+ },
390
+ "providers": {
391
+ "type": "object",
392
+ "required": ["complete", "bounded", "notApplicable", "failed"],
393
+ "properties": {
394
+ "complete": { "type": "integer", "minimum": 0 },
395
+ "bounded": { "type": "integer", "minimum": 0 },
396
+ "notApplicable": { "type": "integer", "minimum": 0 },
397
+ "failed": { "type": "integer", "minimum": 0 }
398
+ },
399
+ "additionalProperties": false
400
+ }
401
+ },
402
+ "additionalProperties": false
403
+ },
309
404
  "portable": { "const": true },
310
405
  "secretValuesEmitted": { "const": false }
311
406
  },
@@ -21,6 +21,40 @@
21
21
  },
22
22
  "additionalProperties": false
23
23
  }
24
+ },
25
+ "selection": {
26
+ "type": "object",
27
+ "required": ["generatedCount", "suppressedCount", "decisions"],
28
+ "properties": {
29
+ "generatedCount": { "type": "integer", "minimum": 0 },
30
+ "suppressedCount": { "type": "integer", "minimum": 0 },
31
+ "decisions": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "object",
35
+ "required": [
36
+ "skillId",
37
+ "title",
38
+ "status",
39
+ "confidence",
40
+ "reasons",
41
+ "signals",
42
+ "scopedProjects"
43
+ ],
44
+ "properties": {
45
+ "skillId": { "type": "string", "minLength": 1 },
46
+ "title": { "type": "string" },
47
+ "status": { "enum": ["generated", "suppressed"] },
48
+ "confidence": { "enum": ["high", "medium"] },
49
+ "reasons": { "type": "array", "items": { "type": "string" } },
50
+ "signals": { "type": "array", "items": { "type": "string" } },
51
+ "scopedProjects": { "type": "array", "items": { "type": "string" } }
52
+ },
53
+ "additionalProperties": false
54
+ }
55
+ }
56
+ },
57
+ "additionalProperties": false
24
58
  }
25
59
  },
26
60
  "additionalProperties": false
@@ -304,6 +304,7 @@
304
304
  "workspace graph path",
305
305
  "workspace graph search",
306
306
  "workspace graph benchmark",
307
+ "workspace graph benchmark-suite",
307
308
  "workspace graph overlay",
308
309
  "workspace graph dot",
309
310
  "workspace graph mermaid",
@@ -315,6 +316,9 @@
315
316
  ".workspai/reports/workspace-model.json",
316
317
  ".workspai/reports/workspace-knowledge-graph.json"
317
318
  ],
319
+ "produces": [
320
+ ".workspai/reports/workspace-intelligence-benchmark-last-run.json"
321
+ ],
318
322
  "role": "Query the proof-backed graph derived from the canonical workspace model.",
319
323
  "chainStep": false
320
324
  },
@@ -338,6 +342,19 @@
338
342
  "role": "Measure model usage, activity, cost provenance, and verified outcomes without storing prompt or response bodies.",
339
343
  "chainStep": false
340
344
  },
345
+ {
346
+ "id": "activity",
347
+ "commands": [
348
+ "live",
349
+ "live --json --projection monitor",
350
+ "live --json --projection board"
351
+ ],
352
+ "reads": [
353
+ "local workspace activity journals"
354
+ ],
355
+ "role": "Project observational command activity into versioned monitor and renderer-neutral board contracts without treating activity as verification evidence.",
356
+ "chainStep": false
357
+ },
341
358
  {
342
359
  "id": "watch",
343
360
  "commands": [
@@ -525,6 +525,7 @@
525
525
  "workspace graph path",
526
526
  "workspace graph search",
527
527
  "workspace graph benchmark",
528
+ "workspace graph benchmark-suite",
528
529
  "workspace graph overlay",
529
530
  "workspace graph dot",
530
531
  "workspace graph mermaid",
@@ -536,6 +537,9 @@
536
537
  ".workspai/reports/workspace-model.json",
537
538
  ".workspai/reports/workspace-knowledge-graph.json"
538
539
  ],
540
+ "produces": [
541
+ ".workspai/reports/workspace-intelligence-benchmark-last-run.json"
542
+ ],
539
543
  "role": "Query the proof-backed graph derived from the canonical workspace model.",
540
544
  "chainStep": false
541
545
  },
@@ -559,6 +563,19 @@
559
563
  "role": "Measure model usage, activity, cost provenance, and verified outcomes without storing prompt or response bodies.",
560
564
  "chainStep": false
561
565
  },
566
+ {
567
+ "id": "activity",
568
+ "commands": [
569
+ "live",
570
+ "live --json --projection monitor",
571
+ "live --json --projection board"
572
+ ],
573
+ "reads": [
574
+ "local workspace activity journals"
575
+ ],
576
+ "role": "Project observational command activity into versioned monitor and renderer-neutral board contracts without treating activity as verification evidence.",
577
+ "chainStep": false
578
+ },
562
579
  {
563
580
  "id": "watch",
564
581
  "commands": [
@@ -0,0 +1 @@
1
+ export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-VWBMDGPY.js';
@@ -1 +1 @@
1
- export{a as buildArtifactRemediationPlan,b as writeArtifactRemediationPlan}from'./chunk-WRQWVSBJ.js';
1
+ export{a as buildArtifactRemediationPlan,b as writeArtifactRemediationPlan}from'./chunk-IQQMFRWM.js';
@@ -0,0 +1 @@
1
+ export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-BHFRP7TV.js';
@@ -0,0 +1 @@
1
+ export{b as runDoctorCapabilities}from'./chunk-4RV4JVGR.js';
@@ -0,0 +1,2 @@
1
+ import {r,s}from'./chunk-VQZ5PI5J.js';import o from'fs-extra';async function i(a){for(let t of [r(a),s(a)])try{if(await o.pathExists(t))return await o.readJson(t)}catch{}return null}async function c(a,t){let e=await i(a);e?.metadata&&(t.metadata={...e.metadata,...t.metadata});let r$1=JSON.stringify(t,null,2)+`
2
+ `;await o.outputFile(r(a),r$1,"utf-8");}async function m(a,t){let e=await i(a);return e?(e.metadata={...e.metadata,...t,vscode:t.vscode?{...e.metadata?.vscode,...t.vscode}:e.metadata?.vscode,npm:t.npm?{...e.metadata?.npm,...t.npm}:e.metadata?.npm,python:t.python?{...e.metadata?.python,...t.python}:e.metadata?.python},await c(a,e),true):false}function u(a,t,e,r){return {signature:"RAPIDKIT_WORKSPACE",createdBy:"workspai-cli",version:t,createdAt:new Date().toISOString(),name:a,metadata:{npm:{packageVersion:t,installMethod:e,lastUsedAt:new Date().toISOString()},...r?{python:r}:{}}}}function f(a){if(!a||typeof a!="object")return false;let t=a;return t.signature==="RAPIDKIT_WORKSPACE"&&typeof t.createdBy=="string"&&typeof t.version=="string"&&typeof t.createdAt=="string"&&typeof t.name=="string"}export{i as a,c as b,m as c,u as d,f as e};
@@ -0,0 +1,2 @@
1
+ import {l}from'./chunk-GIQ4SDRJ.js';import {b}from'./chunk-FPDH3N3A.js';import {a as a$1}from'./chunk-ENZPM52J.js';import {j as j$1}from'./chunk-TP7VKEUF.js';import {b as b$1}from'./chunk-IKUFNK46.js';import {a}from'./chunk-AFIFZTOY.js';import {c}from'./chunk-EWZZUQBR.js';import {h,i,e}from'./chunk-ZGHJIQXL.js';import Ae from'crypto';import H from'fs';import O from'fs/promises';import m from'path';var pe=h.projectAgentEntry.schemaVersion,M=i.projectAgentEntry,Ee="workspai.agent-bootstrap-receipt.v1",We="<!-- WORKSPAI:AGENT-ENTRY:START -->",Fe="<!-- WORKSPAI:AGENT-ENTRY:END -->",q=["generic","codex","claude","gemini","qwen","kimi","grok","copilot","cursor","windsurf","amazon-q"],qe=["CLAUDE.md","GEMINI.md","QWEN.md",".amazonq/rules/workspai-agent-entry.md"];function ve(t){let s=t?.trim().toLowerCase()||"generic";if(s==="orca")return "grok";if(q.includes(s))return s;throw new Error(`Unsupported agent host "${s}". Expected one of: ${q.join(", ")}.`)}function le(t){let s=t.map(i=>i.id).sort(),n=[...q].sort();if(s.length!==n.length||s.some((i,c)=>i!==n[c]))throw new Error("Project agent entry must define each supported host exactly once.")}function V(t){let{integrity:s,...n}=t;return n}function S(t){return c(t)}function Ve(t){le(t.hosts);let s={schemaVersion:pe,generatedAt:t.context.generatedAt,project:{name:t.context.project.name,relativePath:t.context.project.relativePath,...t.context.project.runtime?{runtime:t.context.project.runtime}:{},...t.context.project.framework?{framework:t.context.project.framework}:{}},workspace:{name:t.context.workspace.name,relationship:t.context.workspace.relationship,localBinding:i.projectWorkspaceLink,identityIsFilesystemPath:false,resolverCommand:"workspai project workspace status --json",portableUriScheme:"workspace:",resolvedPathPolicy:"runtime-private-never-persist"},canonical:{projectContext:i.projectContextAgent,projectGrounding:".workspai/PROJECT-GROUNDING.md",projectKnowledgeGraph:i.projectKnowledgeGraphReference,goalIndex:`workspace:${i.goalIndex}`,workspaceIndex:`workspace:${e.agentIndex}`,workspaceContext:`workspace:${e.agentContext}`,workspaceModel:`workspace:${e.model}`,knowledgeGraph:`workspace:${e.knowledgeGraph}`,workspaceSkillsIndex:`workspace:${e.skillsIndex}`,boundedGraphSearch:"command:workspai workspace graph search <task-query> --scope project:<project> --limit 12 --json"},protocol:{mode:"canonical-first",bootstrapCommand:"workspai agent bootstrap --for-agent generic --strict --json",verifyCommand:"workspai project agent-entry verify --for-agent all --strict --json",requiredReadOrder:[M,"command:workspai agent bootstrap --for-agent generic --strict --json","command:workspai project workspace status --json",i.projectContextAgent,`workspace:${i.goalIndex}`,`workspace:${e.skillsIndex}`,"command:workspai workspace graph search <task-query> --scope project:<project> --limit 12 --json","source:targeted-live-files"],sourcePolicy:{liveSourceAuthority:"exact-implementation",workspaceEvidenceAuthority:"identity-topology-readiness-goals",broadScanBeforeBootstrap:false,sourceMutation:"governed-only",verificationClaims:"cli-evidence-only"},degradedMode:{discloseMissingEvidence:true,allowCompleteArchitectureClaims:false,allowReadOnlySourceInspection:true}},hosts:[...t.hosts].sort((i,c)=>i.id.localeCompare(c.id))},n={...s,integrity:{algorithm:"sha256",projectContextHash:t.context.integrity.payloadHash,payloadHash:S(s),portable:true,absolutePathsEmitted:false}};if(!j(n))throw new Error("Project agent entry rejected a non-portable local path.");return a(n,"contracts/workspace-intelligence/project-agent-entry.v1.json","Project agent entry"),n}function j(t){return typeof t=="string"?!(/^[A-Za-z]:[\\/]/.test(t)||/(?:^|[\s("'`])[A-Za-z]:[\\/]/.test(t)||/(?:^|[\s("'`])file:\/\//i.test(t)||/(?:^|[\s("'`])\\\\[^\\\s]+[\\]/.test(t)||/(?:^|[\s("'`])\/(?:Users|home|private|var|opt|srv|mnt|Volumes|tmp)\//.test(t)):Array.isArray(t)?t.every(j):t&&typeof t=="object"?Object.values(t).every(j):true}async function Pe(t){let s=m.join(t,M),n=JSON.parse(await O.readFile(s,"utf8"));if(a(n,"contracts/workspace-intelligence/project-agent-entry.v1.json","Project agent entry"),n.integrity.payloadHash!==S(V(n)))throw new Error("Project agent entry integrity validation failed.");if(le(n.hosts),!j(n)||n.integrity.absolutePathsEmitted)throw new Error("Project agent entry contains a non-portable local path.");return n}async function Ce(t){let s=m.join(t,i.projectContextAgent),n=JSON.parse(await O.readFile(s,"utf8"));a(n,"contracts/workspace-intelligence/project-context-agent.v1.json","Project context agent");let i$1=V(n),c=Ae.createHash("sha256").update(JSON.stringify(i$1)).digest("hex");if(n.integrity.payloadHash!==c)throw new Error("Project context agent integrity validation failed.");if(!j(n)||n.integrity.absolutePathsEmitted)throw new Error("Project context agent contains a non-portable local path.");return n}function Te(t){return t.includes("blocked")?"blocked":t.includes("degraded")?"degraded":"ready"}async function Be(t){let s=b({startPath:m.resolve(t.startPath??process.cwd()),strict:true,requireProjectMembership:true});if(!s?.projectPath)throw new Error("No canonically bound Workspai project was resolved.");let n=s.projectPath,i$1=s.workspacePath,c$1=await Pe(n),o=await Ce(n);if(c$1.integrity.projectContextHash!==o.integrity.payloadHash||c$1.project.name!==o.project.name||c$1.workspace.name!==o.workspace.name)throw new Error("Project agent entry is not bound to the current project context.");let B=t.forAgent?.trim().toLowerCase()||"generic",U=B==="all",g=U?"all":ve(B),J=g,u=U?c$1.hosts:c$1.hosts.filter(e=>e.id===g),Y=c$1.hosts.find(e=>e.id==="generic");if(u.length===0&&Y&&u.push(Y),u.length===0)throw new Error("Project agent entry does not define generic host coverage.");let A=[],l$1=(e,r,C,h)=>A.push({id:e,status:r,message:C,...h?{artifact:h}:{}});l$1("workspace-binding","passed","Canonical workspace membership is resolved."),l$1("entry-integrity","passed","Project entry manifest integrity is valid.",M),l$1("project-context-integrity","passed","Project context integrity and manifest binding are valid.",i.projectContextAgent);let L=[...new Set(u.flatMap(e=>e.entryFiles))].sort(),de=L.filter(e=>!H.existsSync(m.join(n,e))),w=u.some(e=>e.status==="blocked")||de.length>0?"blocked":u.some(e=>e.status==="degraded")?"degraded":"ready";l$1("host-discovery",w==="ready"?"passed":w==="degraded"?"warning":"failed",w==="ready"?`${g} has discoverable Workspai entry coverage.`:w==="degraded"?u.find(e=>e.reason)?.reason??`${g} entry coverage is degraded.`:`${g} entry coverage is missing required files.`,L[0]);let D=[e.agentIndex,e.agentContext,e.skillsIndex,e.model,e.knowledgeGraph],R=D.filter(e=>!H.existsSync(m.join(i$1,e)));l$1("canonical-evidence",R.length===0?"passed":"failed",R.length===0?"Required canonical workspace evidence is present.":`Required canonical evidence is missing: ${R.join(", ")}.`);let E=[],x=null,y=null;for(let e$1 of D)if(!R.includes(e$1))try{let r=JSON.parse(await O.readFile(m.join(i$1,e$1),"utf8"));b$1(e$1,r,e$1),e$1===e.model&&(x=r),e$1===e.knowledgeGraph&&(y=r);}catch{E.push(e$1);}l$1("canonical-contracts",E.length===0?"passed":"failed",E.length===0?"Canonical workspace evidence satisfies its published schemas.":`Canonical evidence failed contract validation: ${E.join(", ")}.`);let I=i.projectKnowledgeGraphReference,z=m.join(n,I),Z="failed",b$2="The project Knowledge Graph reference is missing.";if(H.existsSync(z)&&y)try{let e=JSON.parse(await O.readFile(z,"utf8"));b$1(I,e,I);let r=j$1(y,o.project.name),{integrity:C,...h}=e,f=y.source;e.project.name===o.project.name&&e.canonical.sourceHash===f?.hash&&e.canonical.projectionHash===c(r)&&e.integrity.payloadHash===c(h)?(Z="passed",b$2="The project reference integrity-binds the exact current projection of canonical workspace evidence."):b$2="The project Knowledge Graph reference is stale or does not match the canonical project projection.";}catch{b$2="The project Knowledge Graph reference failed schema or integrity validation.";}l$1("project-knowledge-graph",Z,b$2,I);let ge=x?.workspace,he=y?.workspace,fe=Array.isArray(y?.entities)?y.entities:[],me=Array.isArray(x?.projects)?x.projects:[],Q=E.length===0&&ge?.name===o.workspace.name&&he?.name===o.workspace.name&&me.some(e=>e.name===o.project.name)&&fe.some(e=>e.projectId===o.project.name);l$1("canonical-project-membership",Q?"passed":"failed",Q?"The project and workspace identities agree across the entry, Model, and Graph.":"The project or workspace identity is missing or inconsistent in canonical evidence.");let X=!o.intelligence.freshness.graphMatchesModel||["missing","stale"].includes(o.intelligence.freshness.model)||["missing","stale"].includes(o.intelligence.freshness.graph)?"failed":o.intelligence.freshness.model==="unknown"||o.intelligence.freshness.graph==="unknown"?"warning":"passed",k=false,G;if(t.validateLiveInputs!==false)try{let e=await a$1(i$1);k=e.status==="hit";let r=e.status==="hit"?"Live project inputs match the persisted Model and Knowledge Graph snapshot.":`Live project inputs require an intelligence refresh (${e.reason}).`;G={id:"live-inputs",status:k?"passed":"failed",message:r};}catch{G={id:"live-inputs",status:"failed",message:"Live project inputs could not be validated against canonical graph evidence."};}else G={id:"live-inputs",status:"warning",message:"Live input validation was skipped; persisted compatibility was checked only."};let K=X==="warning"&&o.intelligence.freshness.model==="unknown"&&o.intelligence.freshness.graph==="fresh"&&o.intelligence.freshness.graphMatchesModel&&k?"passed":X;l$1("persisted-freshness",K,K==="passed"?o.intelligence.freshness.model==="unknown"?"Model and Graph bindings are current; live input validation closes structural freshness while verify-before-use facts remain individually governed.":"Persisted Model and Knowledge Graph bindings are current.":K==="warning"?"Persisted evidence is compatible, but at least one freshness state is unknown.":"Persisted Model or Knowledge Graph evidence is missing, stale, or mismatched."),A.push(G);let d={present:false,appliesToProject:false,status:"none"},_=[],ue=m.join(i$1,i.goalIndex);if(H.existsSync(ue)){let e=null;try{e=await l({workspacePath:i$1,validateBindings:false});}catch{_.push("workspai goal --list --json"),l$1("active-goal","failed","The Goal index is present but invalid.");}if(e?.active&&(d={present:true,appliesToProject:e.active.scope.projects.includes(o.project.name),status:"invalid",id:e.active.id,objective:e.active.objective,lifecycle:e.active.lifecycle,goalPack:`workspace:${e.active.goalPack}`,agentHandoff:`workspace:${e.active.agentHandoff}`}),e)try{let r=await l({workspacePath:i$1,validateBindings:true});r.active&&(d={present:true,appliesToProject:r.active.scope.projects.includes(o.project.name),status:"ready",id:r.active.id,objective:r.active.objective,lifecycle:r.active.lifecycle,goalPack:`workspace:${r.active.goalPack}`,agentHandoff:`workspace:${r.active.agentHandoff}`}),l$1("active-goal","passed",r.active?"The active Goal Pack and agent handoff have valid canonical bindings.":"No active Goal Pack is selected.");}catch(r){let C=r instanceof Error?r.message:String(r),h=d.present&&/\bstale\b|--refresh/i.test(C);if(d.present&&(d.status=h?"stale":"invalid"),h&&d.objective){let f=e.active,re=f?.scope.kind==="project"&&f.scope.projects.length===1?`project:${f.scope.projects[0]}`:f?.scope.kind==="project-set"&&f.scope.projects.length>1?`projects:${f.scope.projects.join(",")}`:"workspace";_.push(`workspai goal ${JSON.stringify(d.objective)} --scope ${re} --for-agent generic --refresh --json`);}else _.push("workspai goal --status --json");l$1("active-goal","failed",h?"The selected Goal Pack is present but stale; regenerate it against current canonical evidence before acting.":d.present?"The selected Goal Pack is present but its canonical binding or handoff is invalid.":"The Goal index could not be validated.");}}else l$1("active-goal","passed","No Goal index is present for this workspace.");let ee=A.some(e=>e.status==="failed")?"blocked":A.some(e=>e.status==="warning")?"degraded":"ready",v=Te([w,ee]),P=o.blockers.some(e=>e.severity==="error")?"blocked":o.blockers.length>0?"degraded":"ready",ye=P==="blocked"?"blocked":P==="degraded"?"degraded":"not-verified",we=`command:workspai agent bootstrap --for-agent ${g} --strict --json`,ke=c$1.protocol.requiredReadOrder.map(e=>e==="command:workspai agent bootstrap --for-agent generic --strict --json"?we:e),te={schemaVersion:Ee,generatedAt:(t.now??new Date).toISOString(),status:v,statusScope:"agent-grounding",readiness:{agentGrounding:v,architectureEvidence:ee,projectEnvironment:P,release:ye},requestedAgent:J,resolvedHost:g,project:{name:o.project.name,relativePath:o.project.relativePath,...o.project.runtime?{runtime:o.project.runtime}:{},...o.project.framework?{framework:o.project.framework}:{}},workspace:{name:o.workspace.name,relationship:o.workspace.relationship,resolved:true,identityIsFilesystemPath:false,resolverCommand:"workspai project workspace status --json",portableUriScheme:"workspace:",resolvedPathPolicy:"runtime-private-never-persist"},entry:{artifact:M,schemaVersion:pe,hostStatus:w,entryFiles:L},canonicalEvidence:{projectContext:i.projectContextAgent,projectKnowledgeGraph:i.projectKnowledgeGraphReference,workspaceIndex:`workspace:${e.agentIndex}`,workspaceContext:`workspace:${e.agentContext}`,workspaceModel:`workspace:${e.model}`,knowledgeGraph:`workspace:${e.knowledgeGraph}`,workspaceSkillsIndex:`workspace:${e.skillsIndex}`,boundedGraphSearch:"command:workspai workspace graph search <task-query> --scope project:<project> --limit 12 --json",modelFreshness:k?"fresh":o.intelligence.freshness.model,graphFreshness:k?"fresh":o.intelligence.freshness.graph,graphMatchesModel:o.intelligence.freshness.graphMatchesModel,liveInputsValidated:k,blockerCount:o.blockers.length},activeGoal:d,requiredReadOrder:ke,claims:{architecture:v==="ready"?"allowed-with-citations":"prohibited",sourceInspection:"bounded-and-targeted",sourceMutation:"governed-cli-transaction-only",verification:"cli-evidence-only"},checks:A,nextActions:v==="ready"?[...d.present&&d.appliesToProject&&d.agentHandoff?[`read:${d.agentHandoff}`]:[],...P==="blocked"?["workspai doctor project --json","workspai workspace explain release-blocked --json"]:P==="degraded"?["workspai doctor project --json"]:[],`workspai workspace graph search <task-query> --scope project:${o.project.name} --limit 12 --json`,"inspect only the returned proof paths and target source files"]:[..._,"workspai workspace intelligence run --for-agent generic --strict --json",`workspai agent bootstrap --for-agent ${g} --strict --json`]},oe=S(V(c$1)),je=S({manifestHash:oe,projectContextHash:o.integrity.payloadHash,requestedAgent:J,status:v,generatedAt:te.generatedAt}),ne={...te,receiptId:je},$={...ne,integrity:{algorithm:"sha256",manifestHash:oe,projectContextHash:o.integrity.payloadHash,payloadHash:S(ne),portable:true,absolutePathsEmitted:false}};if(!j($))throw new Error("Agent bootstrap receipt rejected a non-portable local path.");return a($,"contracts/workspace-intelligence/agent-bootstrap-receipt.v1.json","Agent bootstrap receipt"),$}
2
+ export{pe as a,M as b,Ee as c,We as d,Fe as e,q as f,qe as g,ve as h,Ve as i,Be as j};
@@ -0,0 +1 @@
1
+ import {j,m,e}from'./chunk-U5ENEDJA.js';import {i}from'./chunk-ZGHJIQXL.js';import {u}from'./chunk-VQZ5PI5J.js';import u$1 from'path';import d from'fs-extra';import {parse}from'yaml';import w from'fs';var F=new Set(["backend","desktop","extension","service","frontend","worker","platform","library","infra","docs","test-suite","unknown"]),O=new Set([".git",".workspai","vendor","node_modules","test","tests","testdata","fixtures","samples","examples","third_party"]),I=new Set([...O,".cache",".venv","build","dist","target"]);async function L(e){let n=0,t=async(r,o)=>{if(o>5)return false;let s;try{s=await d.readdir(r,{withFileTypes:true});}catch{return false}for(let c of s.sort((f,l)=>f.name.localeCompare(l.name))){if(c.isFile()&&c.name==="main.go"){let f=await d.readFile(u$1.join(r,c.name),"utf8").catch(()=>"");if(/^\s*package\s+main\b/m.test(f)&&(n+=1,n>1))return true}if(c.isDirectory()&&!O.has(c.name)&&await t(u$1.join(r,c.name),o+1))return true}return false};return t(e,0)}async function M(e,n){if(n!=="c"&&n!=="cpp")return false;let t=new Set,r=async(o,s)=>{if(s>3||t.size>=3)return;let c;try{c=await d.readdir(o,{withFileTypes:true});}catch{return}for(let f of c)if(f.isFile()){let l=f.name.toLowerCase();l==="cmakelists.txt"||l==="meson.build"?t.add("native"):l==="pyproject.toml"||l==="setup.py"?t.add("python"):l==="description"&&u$1.basename(o).toLowerCase()==="r"?t.add("r"):l.endsWith(".gemspec")?t.add("ruby"):l==="pom.xml"||l==="build.gradle"||l==="build.gradle.kts"?t.add("java"):l==="cargo.toml"?t.add("rust"):l==="go.mod"?t.add("go"):l==="package.json"&&t.add("node");}else f.isDirectory()&&!I.has(f.name)&&await r(u$1.join(o,f.name),s+1);};return await r(e,0),t.has("native")&&t.size>=3}async function K(e){if((((await d.readFile(u$1.join(e,"pom.xml"),"utf8").catch(()=>"")).match(/<modules\b[^>]*>([\s\S]*?)<\/modules>/iu)?.[1]??"").match(/<module\b[^>]*>[^<]+<\/module>/giu)??[]).length>=2)return true;for(let r of ["settings.gradle","settings.gradle.kts"]){let o=await d.readFile(u$1.join(e,r),"utf8").catch(()=>"");if(!o)continue;if(new Set([...o.matchAll(/['"](:[^'"]+)['"]/gu)].map(c=>c[1])).size>=2)return true}return false}async function $(e){for(let n of ["compose.yaml","compose.yml","docker-compose.yaml","docker-compose.yml"]){let t=await d.readFile(u$1.join(e,n),"utf8").catch(()=>"");if(t)try{let o=parse(t)?.services??{},s=Object.entries(o).map(([i,p])=>{let g=(()=>{if(typeof p?.build=="string")return `${p.build}|Dockerfile`;if(!p?.build||typeof p.build!="object")return null;let a=p.build.context;if(typeof a!="string"||a.length===0)return null;let j="dockerfile"in p.build&&typeof p.build.dockerfile=="string"?p.build.dockerfile:"Dockerfile";return `${a}|${j}`})();return g?{serviceName:i,service:p,identity:g.replaceAll("\\","/").replace(/\/$/,"")}:null}).filter(i=>i!==null);if(new Set(s.map(i=>i.identity)).size<2)continue;let f=new Set(s.map(i=>i.serviceName)),l=new Set(s.filter(({service:i})=>Array.isArray(i.ports)&&i.ports.length>0).map(({identity:i})=>i)),y=s.some(({service:i})=>(Array.isArray(i.depends_on)?i.depends_on:i.depends_on&&typeof i.depends_on=="object"?Object.keys(i.depends_on):[]).some(g=>typeof g=="string"&&f.has(g)));if(l.size>=2||y)return true}catch{}}return false}async function A(e){try{if(!await d.pathExists(e))return null;let n=await d.readJSON(e);return n&&typeof n=="object"?n:null}catch{return null}}async function z(e){for(let n of e){let t=await A(n);if(t)return t}return null}function C(e){if(typeof e!="string")return null;let n=e.trim().toLowerCase();return F.has(n)?n==="service"?"backend":n:null}function re(e){switch(e){case "backend":case "service":case "worker":return "backend";case "frontend":case "desktop":case "extension":case "library":case "platform":return e;case "infra":return "infrastructure";case "docs":return "documentation";case "test-suite":return "quality";default:return "unknown"}}async function oe(e$1,n,t={}){let r=n??await z(u(e$1,"project.json")),o=j(r)?null:r,s=o===null&&r!==null?m(e$1,null):null,c=C(o?.kind)??C(o?.type);if(c)return c;let f=typeof o?.kit_name=="string"?o.kit_name:typeof o?.kit=="string"?o.kit:t.kit,l=typeof o?.framework=="string"?o.framework:t.framework??s?.key,y=typeof o?.runtime=="string"?o.runtime:t.runtime??s?.runtime,i=`${typeof f=="string"?f:""} ${l??""} ${y??""}`.trim().toLowerCase();if(await $(e$1))return "platform";if(/\b(tauri|electron|wails|desktop)\b/.test(i))return "desktop";if(/\b(vscode-extension|visual studio code extension|jetbrains-plugin|browser-extension)\b/.test(i))return "extension";let p=await d.readFile(u$1.join(e$1,"Cargo.toml"),"utf8").catch(()=>""),g=/^\s*\[workspace\]\s*$/m.test(p)&&!/^\s*\[package\]\s*$/m.test(p),a=await A(u$1.join(e$1,"package.json"));if(a!==null&&(Array.isArray(a.workspaces)||a.workspaces!==null&&typeof a.workspaces=="object")||g||e(e$1))return "platform";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|webapi|django|flask|express|fastify|laravel|rails|phoenix|axum|actix|rocket)\b/.test(i))return "backend";if(a){let m={...a.dependencies??{},...a.devDependencies??{}},D=a.scripts??{},b=Object.values(D).filter(k=>typeof k=="string").join(" ").toLowerCase(),_=a.engines??{},N=Array.isArray(a.categories)?a.categories.filter(k=>typeof k=="string"):[];if(m["@tauri-apps/api"]||m["@tauri-apps/cli"]||await d.pathExists(u$1.join(e$1,"src-tauri","tauri.conf.json"))||await d.pathExists(u$1.join(e$1,"src-tauri","tauri.conf.json5"))||m.electron||m["@electron-forge/cli"]||b.includes("electron-forge")||b.includes("electron "))return "desktop";if(typeof _.vscode=="string"||N.some(k=>k.toLowerCase()==="extension packs")||a.publisher&&(a.activationEvents||a.contributes))return "extension";if(m.next||m.react||m.vue||m.svelte||m.vite||m["@angular/core"]||b.includes("next ")||b.includes("vite "))return "frontend";if(a.private===true&&!m.express&&!m["@nestjs/core"])return "library"}return g||await K(e$1)||await d.pathExists(u$1.join(e$1,"go.work"))||await d.pathExists(u$1.join(e$1,"go.mod"))&&await L(e$1)?"platform":await M(e$1,y)?"library":await d.pathExists(u$1.join(e$1,"compose.yaml"))||await d.pathExists(u$1.join(e$1,"compose.yml"))||await d.pathExists(u$1.join(e$1,"docker-compose.yml"))||await d.pathExists(u$1.join(e$1,"docker-compose.yaml"))||await d.pathExists(u$1.join(e$1,"terraform.tf"))?"infra":"backend"}var B={ci:[".github/workflows",".gitlab-ci.yml",".circleci/config.yml","azure-pipelines.yml","bitbucket-pipelines.yml","cloudbuild.yaml","Jenkinsfile",".buildkite/pipeline.yml","prow"],release:[".changeset",".releaserc",".releaserc.json","release.config.js",".goreleaser.yml",".goreleaser.yaml","RELEASING.md","RELEASE.md","tools/release","scripts/release","docs/release","doc/release","build/release.sh","hack/lib/release.sh"],ownership:[".github/CODEOWNERS",".gitlab/CODEOWNERS","CODEOWNERS","docs/CODEOWNERS","OWNERS","OWNERS_ALIASES","MAINTAINERS"]},J=/(?:^|[-_.])(?:release|publish|publishing|distribution)(?:[-_.]|$)/i,V={ci:/\b(?:prow|buildkite|jenkins|teamcity|travis|external ci|test-infra)\b/i,release:/\b(?:release automation|release engineering|release infrastructure|external release)\b/i,ownership:/\b(?:external ownership|central owners|maintainer team|code owners)\b/i};async function U(e,n){let t=[];for(let r of n)try{await w.promises.access(u$1.join(e,r),w.constants.F_OK),t.push(r);}catch{}return t}async function Y(e,n){let t=["README.md","CONTRIBUTING.md","DEVELOPMENT.md","docs/devel/README.md"],r=[];for(let o of t)try{let s=u$1.join(e,o),c=await w.promises.stat(s);if(!c.isFile()||c.size>1024*1024)continue;let f=await w.promises.readFile(s,"utf8");n.test(f)&&r.push(o);}catch{}return r}async function q(e){let n=u$1.join(e,".github","workflows");try{return (await w.promises.readdir(n,{withFileTypes:true})).filter(r=>r.isFile()&&/\.(?:ya?ml)$/i.test(r.name)&&J.test(r.name)).map(r=>`.github/workflows/${r.name}`).sort()}catch{return []}}function H(e,n){let t=e?.[n];return t?.mode?{status:t.mode==="external"?"external-declared":"repository",provider:t.provider?.trim()||null,evidence:[i.workspaceContract],reference:t.reference?.trim()||null}:null}async function v(e,n,t){let r=H(n,t);if(r)return r;let o=[...await U(e,B[t]),...t==="release"?await q(e):[]];if(o.length>0)return {status:"repository",provider:null,evidence:o,reference:null};let s=await Y(e,V[t]);return s.length>0?{status:"external-observed",provider:null,evidence:s,reference:null}:{status:"unknown",provider:null,evidence:[],reference:null}}async function ue(e){let[n,t,r]=await Promise.all([v(e.projectPath,e.declaration,"ci"),v(e.projectPath,e.declaration,"release"),v(e.projectPath,e.declaration,"ownership")]);return {schemaVersion:"workspai.project-governance.v1",ci:n,release:t,ownership:r}}export{re as a,oe as b,ue as c};
@@ -0,0 +1 @@
1
+ var J="workspace-knowledge-search.v1";function b(e){return e.trim().toLowerCase()}var U=new WeakMap;function x(e){let t=U.get(e);if(t)return t;let s=new Map(e.relations.map(a=>[a.id,a])),o=new Map(e.entities.map(a=>[a.id,a])),r=new Map(e.proofs.map(a=>[a.id,a])),i=new Map,d=new Map,h=(a,p)=>{let g=d.get(a)??[];g.push(p),d.set(a,g);};for(let a of e.entities){let p=[a.id,a.label,a.identity.key,...a.kind==="project"&&a.projectId?[a.projectId]:[],...a.identity.aliases];for(let g of new Set(p.map(b))){let k=i.get(g)??[];k.push(a),i.set(g,k);}}for(let a of e.relations)h(a.from,{from:a.from,to:a.to,relationId:a.id,kind:a.kind,direction:"forward",proofIds:a.proofIds}),h(a.to,{from:a.to,to:a.from,relationId:a.id,kind:a.kind,direction:"reverse",proofIds:a.proofIds});for(let a of i.values())a.sort((p,g)=>p.id.localeCompare(g.id));for(let a of d.values())a.sort((p,g)=>p.to.localeCompare(g.to)||p.relationId.localeCompare(g.relationId));let l={entitiesById:o,relationsById:s,entitiesByAlias:i,proofsById:r,adjacency:d};return U.set(e,l),l}function D(e,t){let s=x(e),o=s.relationsById.get(t);if(o)return {found:true,targetType:"relation",relation:o};let r=b(t),i=s.entitiesByAlias.get(r)??[];return i.length===1?{found:true,targetType:"entity",entity:i[0]}:{found:false,query:t,candidates:i.map(d=>d.id).sort()}}function ke(e,t){let s=D(e,t);if(!s.found)return {query:t,found:false,target:null,proofs:[],candidates:s.candidates};let o=s.targetType==="entity"?s.entity:s.relation,r=new Set(o.proofIds);return {query:t,found:true,target:o,candidates:[],proofs:[...r].map(i=>x(e).proofsById.get(i)).filter(i=>!!i).sort((i,d)=>i.id.localeCompare(d.id))}}function me(e,t,s){let o=D(e,t),r=D(e,s);if(!o.found||o.targetType!=="entity"||!r.found||r.targetType!=="entity")return {from:t,to:s,found:false,resolvedFrom:o.found&&o.targetType==="entity"?o.entity.id:null,resolvedTo:r.found&&r.targetType==="entity"?r.entity.id:null,entityPath:[],hops:[],proofs:[]};let i=x(e),d=[o.entity.id],h=new Map,l=new Set(d),a=0;for(;a<d.length&&!l.has(r.entity.id);){let u=d[a++];for(let w of i.adjacency.get(u)??[])l.has(w.to)||(l.add(w.to),h.set(w.to,w),d.push(w.to));}if(!l.has(r.entity.id))return {from:t,to:s,found:false,resolvedFrom:o.entity.id,resolvedTo:r.entity.id,entityPath:[],hops:[],proofs:[]};let p=[],g=r.entity.id;for(;g!==o.entity.id;){let u=h.get(g);if(!u)break;p.push(u),g=u.from;}p.reverse();let k=new Set(p.flatMap(u=>u.proofIds));return {from:t,to:s,found:true,resolvedFrom:o.entity.id,resolvedTo:r.entity.id,entityPath:[o.entity.id,...p.map(u=>u.to)],hops:p,proofs:[...k].map(u=>i.proofsById.get(u)).filter(u=>!!u).sort((u,w)=>u.id.localeCompare(w.id))}}function be(e,t,s){return e.entities.filter(o=>(!t||o.kind===t)&&(!s||o.projectId===s)).sort((o,r)=>o.kind.localeCompare(r.kind)||o.label.localeCompare(r.label))}var m={relations:12,relatedEntities:12,proofs:8,proofIdsPerItem:4,aliasesPerEntity:8,attributeArrayItems:8,attributeStringCharacters:256};function ee(e){let t=[],s=new Set;for(let o=0;o<m.proofIdsPerItem&&t.length<m.proofs;o+=1)for(let r of e){let i=r.proofIds[o];if(!(!i||s.has(i))&&(s.add(i),t.push(i),t.length>=m.proofs))break}return t}function te(e,t,s){let o=e.identity.aliases.slice(0,m.aliasesPerEntity);s.aliases+=e.identity.aliases.length-o.length;let r=Object.fromEntries(Object.entries(e.attributes).map(([d,h])=>{if(Array.isArray(h)){let l=h.slice(0,m.attributeArrayItems);return s.attributeValues+=h.length-l.length,[d,l]}return typeof h=="string"&&h.length>m.attributeStringCharacters?(s.attributeValues+=1,[d,h.slice(0,m.attributeStringCharacters)]):[d,h]})),i=e.proofIds.filter(d=>t.has(d)).slice(0,m.proofIdsPerItem);return s.proofReferences+=e.proofIds.length-i.length,{...e,identity:{...e.identity,aliases:o},attributes:r,proofIds:i}}function ne(e){let t=Object.values(e.attributes).flatMap(s=>Array.isArray(s)?s:[s]);return [e.id,e.kind,e.label,e.projectId??"",e.identity.key,...e.identity.aliases,...t.map(s=>String(s??""))].join(" ").toLowerCase()}var oe=new Set(["a","an","and","are","as","at","be","been","being","by","can","check","could","did","do","does","find","for","from","give","had","has","have","how","i","in","into","is","it","its","may","might","of","on","or","our","show","should","that","the","their","them","then","there","these","they","this","those","tell","to","was","we","were","what","when","where","which","who","why","will","with","would","you","your"]),se=new Map([["authenticate","auth"],["authenticated","auth"],["authentication","auth"],["authorization","auth"],["authorizing","auth"],["config","configuration"],["configs","configuration"],["dependencies","dependency"],["diagnostics","diagnostic"],["reliable","reliability"],["tested","test"],["testing","test"],["tests","test"],["verification","verify"],["verified","verify"],["verifies","verify"],["verifying","verify"]]);function M(e){let t=s=>b(s).replace(/\bc\+\+/gu," cplusplus ").replace(/\bc#/gu," csharp ").split(/[^a-z0-9]+/u).filter(o=>o.length>1||o==="c"||o==="r").map(o=>se.get(o)??o);return [...new Set([...t(e),...t(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2"))])]}function ae(e){let t=b(e.label),s=b(e.identity.key),o=e.identity.aliases.map(b),r=ne(e);return {entity:e,label:t,identity:s,aliases:o,haystack:r,labelTokens:new Set(M(e.label)),identityTokens:new Set(M(e.identity.key)),aliasTokens:new Set(e.identity.aliases.flatMap(M)),allTokens:new Set(M(r))}}function W(e,t){return e.has(t)||t.length>=3&&[...e].some(s=>s.startsWith(t))}function N(e,t){return W(e.labelTokens,t)||W(e.identityTokens,t)||W(e.aliasTokens,t)||W(e.allTokens,t)}function re(e,t,s,o){let{label:r,identity:i,aliases:d,haystack:h}=e,l=0;(r===t||i===t||d.includes(t))&&(l+=1e4),(r.startsWith(t)||i.startsWith(t))&&(l+=250),h.includes(t)&&(l+=100);let a=0;for(let p of s){let g=o.get(p)??1,k=W(e.labelTokens,p),u=W(e.identityTokens,p),w=W(e.aliasTokens,p),f=N(e,p);f&&(a+=1),r===p?l+=80*g:k&&(l+=36*g),u&&(l+=24*g),w&&(l+=20*g),f&&(l+=10*g);}return s.length>0&&(l+=a/s.length*120),l}function ie(e,t){let s=new Set;for(let o of t){let r=e.allTokens.has(o)?o:void 0,i=r===void 0&&o.length>=3?[...e.allTokens].find(h=>h.startsWith(o)&&!s.has(h)):void 0,d=r??i;d&&!s.has(d)&&s.add(d);}return s.size}var ce=new Map([["c","c"],["clojure","clojure"],["cplusplus","cpp"],["cpp","cpp"],["typescript","typescript"],["ts","typescript"],["javascript","javascript"],["js","javascript"],["nodejs","javascript"],["python","python"],["py","python"],["go","go"],["golang","go"],["csharp","csharp"],["ada","ada"],["assembly","assembly"],["asm","assembly"],["cuda","cuda"],["dotnet","csharp"],["dart","dart"],["elixir","elixir"],["fsharp","fsharp"],["fortran","fortran"],["java","java"],["kotlin","kotlin"],["hlsl","hlsl"],["llvmir","llvm-ir"],["mlir","mlir"],["lua","lua"],["php","php"],["r","r"],["ruby","ruby"],["rust","rust"],["tablegen","tablegen"],["scala","scala"],["svelte","svelte"],["swift","swift"],["vue","vue"]]);function le(e){return new Set(e.map(t=>ce.get(t)).filter(t=>!!t))}function Q(e){let t=e.attributes.language;return typeof t=="string"?b(t):null}function de(e){return {project:1e3,service:900,api:900,package:850,endpoint:800,container:700,deployment:700,environment:650,pipeline:600,"test-suite":550,owner:500,decision:450,document:400}[e.kind]??0}var pe=new Set(["language","languages","binding","bindings","bridge","bridges","dependency","dependencies","depends","core","runtime","owner","owners","ownership","maintainer","ci","pipeline","pipelines","workflow","deploy","deployment","infrastructure","container","doc","docs","document","documentation","service","services","api","rpc","schema","schemas","message","protobuf","proto","contract"]);function ge(e,t){let s=t.has("language")||t.has("languages"),o=t.has("binding")||t.has("bindings")||t.has("bridge")||t.has("bridges"),r=t.has("dependency")||t.has("dependencies")||t.has("depends"),i=t.has("core")||t.has("runtime"),d=t.has("owner")||t.has("owners")||t.has("ownership")||t.has("maintainer"),h=t.has("ci")||t.has("pipeline")||t.has("pipelines")||t.has("workflow"),l=t.has("deploy")||t.has("deployment")||t.has("infrastructure")||t.has("container"),a=t.has("doc")||t.has("docs")||t.has("document")||t.has("documentation"),p=t.has("service")||t.has("services")||t.has("api")||t.has("rpc"),g=t.has("schema")||t.has("schemas")||t.has("message")||t.has("protobuf")||t.has("proto")||t.has("contract"),k=typeof e.attributes.mechanism=="string"?b(e.attributes.mechanism):"",u=typeof e.attributes.specification=="string"?b(e.attributes.specification):"",w=b(e.label),f=0;if(s&&e.kind==="language"){let B=typeof e.attributes.fileCount=="number"?e.attributes.fileCount:0;f+=900+Math.min(B,1e4)/10;}return o&&e.kind==="protocol"&&(f+=800),r&&e.kind==="package"&&(f+=650),i&&e.kind==="package"&&/(?:^|[_-])core(?:$|[_-])/u.test(w)&&(f+=700),i&&e.kind==="protocol"&&k.includes("core")&&(f+=300),d&&e.kind==="owner"&&(f+=850),h&&e.kind==="pipeline"&&(f+=800),l&&["deployment","container","environment"].includes(e.kind)&&(f+=775),a&&["document","decision"].includes(e.kind)&&(f+=725),p&&["api","endpoint","service"].includes(e.kind)&&(f+=700),g&&(e.kind==="schema"||(e.kind==="api"||e.kind==="protocol")&&(u.includes("protobuf")||k.includes("protobuf")))&&(f+=750),f}function he(e){return [e.has("language")||e.has("languages"),e.has("binding")||e.has("bindings")||e.has("bridge")||e.has("bridges"),e.has("dependency")||e.has("dependencies")||e.has("depends"),e.has("core")||e.has("runtime"),e.has("owner")||e.has("ownership")||e.has("maintainer"),e.has("ci")||e.has("pipeline")||e.has("workflow"),e.has("deploy")||e.has("deployment")||e.has("infrastructure"),e.has("doc")||e.has("docs")||e.has("documentation"),e.has("service")||e.has("api")||e.has("rpc"),e.has("schema")||e.has("protobuf")||e.has("proto")||e.has("contract")].filter(Boolean).length>=3}function Ie(e,t){let s=b(t.query),o=[...new Set(M(t.query))],r=new Set(M(t.projectId??"")),i=t.projectId?o.filter(n=>!r.has(n)):o,d=!!(t.projectId&&o.length>0&&i.length===0),h=i.filter(n=>!oe.has(n)),l=h.length>0?h:i,a=le(l),p=new Set(l),g=l.filter(n=>!pe.has(n)),k=he(p),u=l.length<=1?l.length:Math.min(2,Math.ceil(l.length/3)),w=t.minimumTermMatches===void 0?u:Math.min(u,Math.max(1,Math.trunc(t.minimumTermMatches))),f=Math.max(1,Math.min(Math.trunc(t.limit??12),100)),B=Math.max(0,Math.min(Math.trunc(t.relationsPerEntity??4),20)),_=new Set;if(t.projectId){let n=new Set(e.entities.filter(c=>c.kind==="project"&&(c.projectId===t.projectId||c.label===t.projectId)).map(c=>c.id));for(let c of e.relations)n.has(c.from)&&_.add(c.to),n.has(c.to)&&_.add(c.from);}let O=e.entities.filter(n=>(!t.kind||n.kind===t.kind)&&(!t.projectId||n.projectId===t.projectId||n.projectId===void 0&&_.has(n.id))).map(ae),Y=new Map(l.map(n=>{let c=O.filter(y=>N(y,n)).length;return [n,Math.log((O.length+1)/(c+1))+1]})),v=O.map(n=>{let c=ie(n,l),y=Q(n.entity),I=y&&a.has(y)?400:0,S=ge(n.entity,p),j=g.length===0||g.some(A=>N(n,A))?S:0;return {entity:n.entity,matchedTerms:c,intentScore:j,score:d?de(n.entity):re(n,s,l,Y)+I+j}}).filter(n=>{let c=Q(n.entity);return (a.size===0||c===null||a.has(c))&&(s.length===0||n.score>0&&(d||n.matchedTerms>=w||n.intentScore>0&&(k||l.length<=2)))}).sort((n,c)=>c.score-n.score||n.entity.kind.localeCompare(c.entity.kind)||n.entity.label.localeCompare(c.entity.label)),E=(k?(()=>{let n=[],c=[],y=new Map,I=new Set;for(let S of v){let j=y.get(S.entity.kind)??0,A=b(S.entity.label);j<2&&!I.has(A)?(n.push(S),y.set(S.entity.kind,j+1),I.add(A)):c.push(S);}return [...n,...c]})():v).slice(0,f).map(n=>n.entity),P=new Set(E.map(n=>n.id)),L=new Map,G=e.relations.filter(n=>{if(!(P.has(n.from)||P.has(n.to)))return false;let y=P.has(n.from)?n.from:n.to,I=L.get(y)??0;return I>=B?false:(L.set(y,I+1),true)}),K=t.projection==="agent",T=K?G.slice(0,m.relations):G,z=x(e),H=[...new Set(T.flatMap(n=>[n.from,n.to]).filter(n=>!P.has(n)))].map(n=>z.entitiesById.get(n)).filter(n=>!!n).map(({id:n,kind:c,label:y,projectId:I})=>({id:n,kind:c,label:y,...I?{projectId:I}:{}})).sort((n,c)=>n.kind.localeCompare(c.kind)||n.label.localeCompare(c.label)),q=K?H.slice(0,m.relatedEntities):H,V=new Set([...E.flatMap(n=>n.proofIds),...T.flatMap(n=>n.proofIds)]),$=K?ee([...E,...T]):[...V],R=new Set($),C={entities:v.length-E.length,relations:G.length-T.length,relatedEntities:H.length-q.length,proofs:V.size-R.size,proofReferences:0,aliases:0,attributeValues:0},F=K?E.map(n=>te(n,R,C)):E,X=K?T.map(n=>{let c=n.proofIds.filter(y=>R.has(y)).slice(0,m.proofIdsPerItem);return C.proofReferences+=n.proofIds.length-c.length,{...n,proofIds:c}}):T,Z=[...R].map(n=>z.proofsById.get(n)).filter(n=>!!n).sort((n,c)=>n.id.localeCompare(c.id));return {schemaVersion:J,query:t.query,kind:t.kind??null,...t.projectId?{projectId:t.projectId}:{},limit:f,totalMatches:v.length,truncated:v.length>F.length||K&&Object.values(C).some(n=>n>0),entities:F,relatedEntities:q,relations:X,proofs:Z,...K?{budget:{mode:"agent",limits:{...m},omitted:C}}:{}}}export{J as a,D as b,ke as c,me as d,be as e,Ie as f};
@@ -0,0 +1 @@
1
+ import {f}from'./chunk-2MVIRJJR.js';import a from'path';import d from'fs-extra';var b=4,C="workspace-graph-token-efficiency.v1";function k(e){return Math.ceil(e/b)}function y(e,o){let n=a.resolve(e,o),t=a.relative(e,n);return !t||t.startsWith("..")||a.isAbsolute(t)?null:n}async function P(e){let o=new Map,n=[a.join(e,".workspai","workspace.contract.json"),a.join(e,".rapidkit","workspace.contract.json")];for(let t of n)if(await d.pathExists(t))try{let s=await d.readJson(t);for(let r of s.projects??[])typeof r.relativePath=="string"&&typeof r.externalPath=="string"&&a.isAbsolute(r.externalPath)&&o.set(r.relativePath.replace(/\\/g,"/").replace(/\/$/,""),r.externalPath);break}catch{}return o}function A(e,o,n){if(!o||a.isAbsolute(o))return null;let t=a.resolve(e),s=o.replace(/\\/g,"/");for(let[r,c]of [...n.entries()].sort(([u],[l])=>l.length-u.length))if(s.startsWith(`${r}/`))return y(c,s.slice(r.length+1));return y(t,s)}async function S(e){let o=a.resolve(e.workspacePath),n=f(e.graph,{query:e.query,...e.kind?{kind:e.kind}:{},...e.projectId?{projectId:e.projectId}:{},limit:e.limit,projection:"agent"}),t=e.corpus;if(!t){let l=[...new Set(e.graph.proofs.map(i=>i.artifact))].sort(),p=[],v=await P(o),h=0,g=0;for(let i of l){let f=A(o,i,v);if(!f){p.push(i);continue}try{let w=await d.readFile(f,"utf8");h+=w.length,g+=1;}catch{p.push(i);}}t={artifactCount:g,characterCount:h,estimatedTokens:k(h),unreadableArtifacts:p};}let s=JSON.stringify(n).length,r=t.estimatedTokens,c=k(s),u=Math.max(0,r-c);return {schemaVersion:C,generatedAt:(e.now??new Date).toISOString(),workspacePath:o,query:e.query,graph:{schemaVersion:e.graph.schemaVersion,sourceArtifact:e.graph.source.artifact,sourceHash:e.graph.source.hash,entityCount:e.graph.entities.length,relationCount:e.graph.relations.length,proofCount:e.graph.proofs.length},methodology:{id:"indexed-corpus-vs-bounded-retrieval.v1",estimated:true,charsPerToken:b,claimBoundary:"Measures retrieval payload reduction against readable proof-source text; it does not claim equivalent answer quality or model-specific billing savings."},corpus:t,retrieval:{matchCount:n.entities.length,characterCount:s,estimatedTokens:c,truncated:n.truncated,payload:n},savings:{estimatedTokensAvoided:u,reductionRatio:c===0?0:Number((r/c).toFixed(2)),reductionPercent:r===0?0:Number((u/r*100).toFixed(2))}}}export{C as a,S as b};
@@ -0,0 +1,4 @@
1
+ import {f as f$1,e}from'./chunk-SX6A656X.js';import {a,b}from'./chunk-QMQBX3RV.js';import {a as a$1,b as b$2}from'./chunk-X7FYEKLI.js';import {c,d as d$1}from'./chunk-BUYLM6QV.js';import {j as j$1,i}from'./chunk-L5Q2S5GY.js';import {a as a$2,e as e$2}from'./chunk-XDPTAV2T.js';import {b as b$1}from'./chunk-IKUFNK46.js';import {f as f$2,e as e$1}from'./chunk-ZGHJIQXL.js';import {t}from'./chunk-VQZ5PI5J.js';import p from'chalk';import d from'fs';import f from'path';var K=e$1.readiness;function H(n){return n.vulnerableDependencies>0?`${n.vulnerableDependencies} known dependency vulnerability finding(s) reported`:`${n.blockingFindings} blocking dependency/security finding(s) reported`}var U=f$2.readiness;function q(n){let e=j(n,"workspace.contract.json");if(!d.existsSync(e))return [];try{let t=JSON.parse(d.readFileSync(e,"utf-8"));return (Array.isArray(t.projects)?t.projects:[]).map(i=>{let c=v(i),o=typeof c.externalPath=="string"?c.externalPath.trim():"",s=typeof c.relativePath=="string"?c.relativePath.trim():"",r=o||s;return r?f.resolve(n,r):""}).filter(Boolean)}catch{return []}}function B(n,e){let t=f.resolve(n);if(!b(t))return t;let a=j(e,"workspace.contract.json");if(d.existsSync(a))try{let o=JSON.parse(d.readFileSync(a,"utf-8")),s=Array.isArray(o.projects)?o.projects:[];for(let r of s){let y=v(r),m=typeof y.externalPath=="string"?y.externalPath.trim():"";if(m)return f.resolve(e,m);let g=typeof y.relativePath=="string"?y.relativePath.trim():"";if(g)return f.join(e,g)}}catch{}let i=M(e),c=Array.isArray(i.payload?.projects)?i.payload.projects:[];for(let o of c){let s=v(o),r=typeof s.path=="string"?s.path.trim():"";if(r)return f.resolve(r)}return t}function z(n){let e=j$1(n);return i(e,n)}function _(n,e){if(!d.existsSync(n))return null;let t=d.readdirSync(n).filter(a=>a.endsWith(".json")&&e.some(i=>i.test(a))).map(a=>f.join(n,a));return t.length===0?null:(t.sort((a,i)=>d.statSync(i).mtimeMs-d.statSync(a).mtimeMs),t[0])}function v(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:{}}function J(n){for(let e of n)if(d.existsSync(e))return e;return null}function j(n,...e){let t$1=t(n,...e);return J(t$1)??t$1[0]}function A(n,e){let t=a$2(n,`.workspai/reports/${e}`);return J([t,f.join(n,".rapidkit","reports",e)])??t}async function Q(n){let{readWorkspaceRegistrySummary:e,resolveWorkspaceRegisteredProjects:t}=await import('./workspace-registry-summary-STGUGROG.js'),a=await e(n);return a?a.projectCount:(await t(n)).summary.projectCount}function X(n,e,t){let a=j(n,"toolchain.lock");if(!d.existsSync(a))return {gate:"env",status:"fail",summary:"toolchain.lock is missing",details:["Run workspai bootstrap to pin runtime versions and generate a reproducible toolchain."],evidencePath:a};try{let i=JSON.parse(d.readFileSync(a,"utf-8")),c=v(i.runtime),o=["python","node","go","java","dotnet","rust","php"],s=o.filter(l=>{let u=v(c[l]);return typeof u.version=="string"&&u.version.trim().length>0});if(s.length===0)return {gate:"env",status:"fail",summary:"No runtime versions are pinned in toolchain.lock",details:["Pin at least one runtime version via workspai setup <runtime> and re-run bootstrap."],evidencePath:a};let r=[...new Set((Array.isArray(e)?e:[e]).filter(l=>l!=="unknown"))],y=r.filter(l=>o.includes(l)),m=r.filter(l=>!o.includes(l)),g=y.filter(l=>{let u=v(c[l]);return typeof u.version!="string"||u.version.trim().length===0});return g.length>0?{gate:"env",status:"fail",summary:`${t?.hasRegisteredProjects?"Project runtime":"Workspace"}${g.length===1?"":"s"} (${g.join(", ")}) ${g.length===1?"is":"are"} not pinned in toolchain.lock`,details:g.map(u=>`Run workspai setup ${u} and workspai bootstrap to lock ${u} for this workspace.`),evidencePath:a}:m.length>0?{gate:"env",status:"warn",summary:`${t?.hasRegisteredProjects?"Project runtime":"Workspace"}${m.length===1?"":"s"} (${m.join(", ")}) cannot be verified by toolchain.lock`,details:[`Pinned Workspai runtimes (${s.join(", ")}) do not prove the ${m.join(", ")} compiler or runtime toolchain.`,"Declare and verify this runtime or toolchain through the project command contract or organization CI policy."],evidencePath:a}:{gate:"env",status:"pass",summary:`Pinned runtimes: ${s.join(", ")}`,details:[],evidencePath:a}}catch{return {gate:"env",status:"fail",summary:"toolchain.lock is invalid JSON",details:["Regenerate lockfile with workspai bootstrap."],evidencePath:a}}}function M(n){let e=A(n,"doctor-last-run.json");if(!d.existsSync(e))return {payload:null,path:e};try{let t=JSON.parse(d.readFileSync(e,"utf-8"));return c(t,"workspace")?(d$1(t),{payload:t,path:e}):{payload:null,path:e}}catch{return {payload:null,path:e}}}function Y(n){let e=M(n);if(!e.payload)return {gate:{gate:"doctor",status:"fail",summary:"Doctor evidence is missing",details:["Run workspai doctor workspace --json before release readiness checks."],evidencePath:e.path},payload:null};let t=a$1(e.payload);if(t.hasSystemErrors)return {gate:{gate:"doctor",status:"fail",summary:"Doctor reported system errors",details:["Resolve system-level doctor errors before proceeding."],evidencePath:e.path},payload:e.payload};if(t.blockingFindings>0)return {gate:{gate:"doctor",status:"fail",summary:`Doctor reported ${t.blockingFindings} blocking finding(s)`,details:["Resolve the canonical Doctor findings and regenerate fresh Doctor evidence."],evidencePath:e.path},payload:e.payload};let a=[...t.advisoryFindings>0?[`${t.advisoryFindings} advisory finding(s)`]:[],...t.unknownFindings>0?[`${t.unknownFindings} unknown finding(s)`]:[],...t.contradictionCount>0?[`${t.contradictionCount} evidence contradiction(s)`]:[],...t.missingDiagnosisProjects>0?[`${t.missingDiagnosisProjects} project(s) without canonical diagnosis`]:[],...t.staleEvidence?["stale Doctor evidence"]:[],...t.unknownFreshness?["unknown Doctor evidence freshness"]:[],...t.minimumDiagnosisCompleteness<100?[`diagnosis completeness ${t.minimumDiagnosisCompleteness}%`]:[]];return a.length>0?{gate:{gate:"doctor",status:"warn",summary:"Doctor evidence requires attention",details:a,evidencePath:e.path},payload:e.payload}:{gate:{gate:"doctor",status:"pass",summary:"Doctor checks passed without issues",details:[],evidencePath:e.path},payload:e.payload}}function Z(n){let e=A(n,"analyze-last-run.json");if(!d.existsSync(e))return {gate:"analyze",status:"fail",summary:"Analyze evidence is missing",details:["Run workspai analyze --json before release readiness checks."],evidencePath:e};try{let t=JSON.parse(d.readFileSync(e,"utf-8"));b$1(e$1.analyze,t,e);let a=v(t.summary),i=String(a.verdict??"").toLowerCase(),c=Number(a.score??0),o=v(a.findings),s=Number(o.fail??0);return i==="blocked"||s>0?{gate:"analyze",status:"fail",summary:`Analyze verdict is blocked (score ${c}/100)`,details:["Resolve analyze findings and regenerate analyze-last-run.json."],evidencePath:e}:i==="needs-attention"?{gate:"analyze",status:"warn",summary:`Analyze needs attention (score ${c}/100)`,details:["Review analyze warnings before release."],evidencePath:e}:{gate:"analyze",status:"pass",summary:`Analyze passed (score ${c}/100)`,details:[],evidencePath:e}}catch{return {gate:"analyze",status:"fail",summary:"Analyze evidence is invalid or violates its contract",details:["Re-run workspai analyze --json to regenerate evidence."],evidencePath:e}}}function ee(n){try{let e=JSON.parse(d.readFileSync(n,"utf-8")),t=String(e.status??"").toLowerCase(),a=v(e.summary),i=Number(a.failedChecks??0);return t==="fail"||i>0?{gate:"verify",status:"fail",summary:"Verify-pack contract reports failed checks",details:["Fix failed verify checks and regenerate verify-pack contract evidence."],evidencePath:n}:t==="pass"?{gate:"verify",status:"pass",summary:"Verify-pack contract passed",details:[],evidencePath:n}:{gate:"verify",status:"warn",summary:"Verify-pack contract status is not explicit",details:["Ensure contract status is pass/fail and keep schema aligned with v1 contract."],evidencePath:n}}catch{return {gate:"verify",status:"fail",summary:"Verify-pack contract is invalid JSON",details:["Regenerate verify-pack contract artifact."],evidencePath:n}}}async function te(n,e){if(e.skipVerify)return {gate:"verify",status:"pass",summary:"Verify gate skipped (--skip-verify)",details:["Verification was explicitly skipped for this readiness run."]};let t=[a$2(n,".workspai/reports"),f.join(n,".rapidkit","reports")],a=t[0],i=t.map(s=>_(s,[/verify-pack-contract/i,/^verify.*\.json$/i])).find(s=>typeof s=="string")??null;if(i)return ee(i);let c=a$2(n,e$1.contractVerify),o=t.map(s=>_(s,[/workspace-contract-verify-last-run/i,/workspace-contract-verify/i])).find(s=>typeof s=="string")??null;if(o)try{let s=JSON.parse(d.readFileSync(o,"utf-8")),r=String(s.status??"").toLowerCase();if(r==="passed"||r==="pass")return {gate:"verify",status:"pass",summary:"Workspace contract verification passed (CLI cache)",details:[],evidencePath:o};if(r==="failed"||r==="fail")return {gate:"verify",status:"fail",summary:"Workspace contract verification failed (CLI cache)",details:(Array.isArray(s.violations)?s.violations:[]).slice(0,5),evidencePath:o}}catch{}try{let{verifyWorkspaceContract:s}=await import('./workspace-contract-JYHNEJPV.js'),r=await s({workspacePath:n}),y={schemaVersion:"v1",source:"cli",generatedAt:new Date().toISOString(),status:r.status,contractPath:r.contractPath,projectCount:r.projectCount,checks:r.checks,violations:r.violations};return await e$2(n,e$1.contractVerify,y),r.status==="failed"?{gate:"verify",status:"fail",summary:"Workspace contract verification failed (CLI)",details:r.violations.slice(0,5),evidencePath:c}:{gate:"verify",status:"pass",summary:"Workspace contract verification passed (CLI)",details:[],evidencePath:c}}catch(s){return {gate:"verify",status:"fail",summary:"No verify evidence and workspace contract verification unavailable",details:["Run workspai workspace contract verify --json or export verify-pack contract from CI.",s instanceof Error?s.message:String(s)],evidencePath:f.join(a,"*verify*.json")}}}function ne(n,e){let t=A(e,"doctor-last-run.json");if(!n)return {gate:"dependency",status:"warn",summary:"Dependency risk check skipped (doctor evidence missing)",details:["Run workspai doctor workspace --json to include dependency findings."],evidencePath:t};let a=b$2(n);return a.blockingFindings>0||a.vulnerableDependencies>0?{gate:"dependency",status:"fail",summary:H(a),details:["Resolve the typed dependency/security findings and regenerate focused audit evidence."],evidencePath:t}:a.auditFailed>0?{gate:"dependency",status:"fail",summary:`${a.auditFailed} dependency audit(s) failed`,details:["Repair the audit runner or dependency environment; failed audits are not clean."],evidencePath:t}:a.missingDependencies>0||a.auditUnavailable>0||a.unknownFindings>0||a.advisoryFindings>0?{gate:"dependency",status:"warn",summary:"Dependency evidence is incomplete or requires attention",details:[...a.missingDependencies>0?[`${a.missingDependencies} project(s) have no materialized dependency tree.`]:[],...a.auditUnavailable>0?[`${a.auditUnavailable} audit provider(s) are unavailable or unsupported.`]:[],...a.unknownFindings>0?[`${a.unknownFindings} dependency/security finding(s) remain unknown.`]:[],...a.advisoryFindings>0?[`${a.advisoryFindings} dependency/security advisory finding(s) remain.`]:[]],evidencePath:t}:{gate:"dependency",status:"pass",summary:"No dependency vulnerabilities reported",details:[],evidencePath:t}}function ae(n){return n.some(e=>e.status==="fail")?"fail":n.some(e=>e.status==="warn")?"warn":"pass"}async function se(n,e){return e$2(n,K,e)}async function re(n={}){let e$1=f.resolve(n.startPath??process.cwd()),t=a(e$1)??e$1,a$1=await Q(t)>0,i=a$1&&b(e$1)?t:B(e$1,t),c=i===t?"unknown":z(i),o=a$1?c:"unknown";if(a$1&&i===t){let{resolveWorkspaceRegisteredProjects:h}=await import('./workspace-registry-summary-STGUGROG.js'),T=await h(t),E=q(t);o=(E.length>0?E:T.summary.projects.map(w=>f.resolve(t,w.relativePath))).map(w=>z(w));}let s=X(t,o,{hasRegisteredProjects:a$1}),r=Y(t),y=Z(t),m=await te(t,{skipVerify:n.skipVerify}),g=ne(r.payload,t),l=[s,r.gate,y,m,g],u=ae(l),k={schemaVersion:U,generatedAt:new Date().toISOString(),workspacePath:t,projectPath:i,action:n.action,overallStatus:u,blocking:u==="fail",blockingReasons:l.filter(h=>h.status==="fail").map(h=>`${h.gate}: ${h.summary}`),gates:l};if(n.writeReport!==false){let h=f$1(k,{commandId:"workspaceReadiness",exitCode:u==="fail"?2:u==="warn"?1:0,generatedAt:k.generatedAt,blockers:k.blockingReasons,runId:e()});k.evidencePath=await se(t,h);}return k}function ie(n){return n==="pass"?p.green("PASS"):n==="warn"?p.yellow("WARN"):p.red("FAIL")}function oe(n){return n==="pass"?p.green("PASS"):n==="warn"?p.yellow("WARN"):p.red("FAIL")}async function Se(n){let e=await re({startPath:n.workspace,writeReport:true,skipVerify:n.skipVerify===true});if(n.json)console.log(JSON.stringify(e,null,2));else {console.log(p.bold.cyan(`
2
+ \u{1F6A6} Workspai Release Readiness
3
+ `)),console.log(p.bold(`Workspace: ${p.cyan(f.basename(e.workspacePath))}`)),console.log(p.gray(`Path: ${e.workspacePath}`)),console.log(`Overall: ${oe(e.overallStatus)}`);for(let t of e.gates){console.log(` - ${t.gate}: ${ie(t.status)} ${t.summary}`);for(let a of t.details)console.log(p.gray(` ${a}`));t.evidencePath&&console.log(p.gray(` evidence: ${t.evidencePath}`));}e.evidencePath&&console.log(p.gray(`
4
+ Evidence saved: ${e.evidencePath}`));}n.strict&&e.overallStatus!=="pass"&&process.exit(1);}export{re as a,Se as b};