workspai 0.46.0 → 0.48.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 (143) hide show
  1. package/README.md +225 -81
  2. package/contracts/agent-customization-pack.v1.json +11 -1
  3. package/contracts/bootstrap-compliance.v1.json +14 -0
  4. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +4 -0
  5. package/contracts/extension-cli-compatibility.v1.json +13 -2
  6. package/contracts/mirror-ops.v1.json +16 -0
  7. package/contracts/published-contract-catalog.v1.json +59 -1
  8. package/contracts/runtime-command-surface.v1.json +294 -2
  9. package/contracts/transparency-evidence.v1.json +13 -0
  10. package/contracts/workspace-contract.v1.json +78 -0
  11. package/contracts/workspace-intelligence/model-usage-event.v1.json +82 -0
  12. package/contracts/workspace-intelligence/workspace-context.v1.json +20 -0
  13. package/contracts/workspace-intelligence/workspace-graph-token-efficiency.v1.json +72 -0
  14. package/contracts/workspace-intelligence/workspace-intelligence-evaluation-comparison.v1.json +53 -0
  15. package/contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json +120 -0
  16. package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +6 -1
  17. package/contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json +200 -0
  18. package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +260 -0
  19. package/contracts/workspace-intelligence/workspace-knowledge-search.v1.json +60 -0
  20. package/contracts/workspace-intelligence-architecture.v1.json +37 -5
  21. package/contracts/workspace-intelligence-chain.v1.json +58 -6
  22. package/contracts/workspace-share-bundle.v1.json +16 -0
  23. package/dist/analyze-EEEU3MIF.js +1 -0
  24. package/dist/artifact-remediation-plan-SPOUHMK5.js +3 -0
  25. package/dist/autopilot-release-XGVXPOZI.js +1 -0
  26. package/dist/chunk-32OJDBIG.js +2 -0
  27. package/dist/chunk-37CVKXBD.js +1 -0
  28. package/dist/chunk-3NU32T4A.js +2 -0
  29. package/dist/chunk-3VFA7D5T.js +1 -0
  30. package/dist/chunk-4HDYADHT.js +13 -0
  31. package/dist/chunk-54EP5CEV.js +8 -0
  32. package/dist/chunk-5S3DJQEP.js +8 -0
  33. package/dist/chunk-AFL3ACCR.js +2 -0
  34. package/dist/{chunk-VFDM65IE.js → chunk-BFLJ2R4D.js} +22 -22
  35. package/dist/chunk-BGPXQQNY.js +4 -0
  36. package/dist/chunk-BMWFQXGW.js +1 -0
  37. package/dist/{chunk-UQWOVV6V.js → chunk-CRHYBQI3.js} +1 -1
  38. package/dist/chunk-CV5HKU4P.js +1 -0
  39. package/dist/chunk-ESLPI3XZ.js +1 -0
  40. package/dist/chunk-FB7SCXAZ.js +1 -0
  41. package/dist/{chunk-WPEEC5BX.js → chunk-HDXNIN4N.js} +1 -1
  42. package/dist/chunk-HZDXO65G.js +36 -0
  43. package/dist/{chunk-J5PIZCAU.js → chunk-I46XEIPL.js} +1 -1
  44. package/dist/chunk-J5ENLXDF.js +1 -0
  45. package/dist/chunk-KB44JP4M.js +2 -0
  46. package/dist/chunk-LHOZXC2M.js +2 -0
  47. package/dist/chunk-NAJCUQ4X.js +2 -0
  48. package/dist/chunk-OA537ZQ5.js +1 -0
  49. package/dist/chunk-OW42TZFB.js +1 -0
  50. package/dist/chunk-P3D5YQB2.js +1 -0
  51. package/dist/chunk-PHXQR6PX.js +2 -0
  52. package/dist/{chunk-ZKAI3PJE.js → chunk-PRTR2DQ2.js} +1 -1
  53. package/dist/{chunk-QA5BGEQW.js → chunk-QNONOO4F.js} +1 -1
  54. package/dist/chunk-RHQW3DTP.js +1 -0
  55. package/dist/chunk-T4YR4RAI.js +2 -0
  56. package/dist/chunk-THIOE2PB.js +2 -0
  57. package/dist/{chunk-4LGXSBCN.js → chunk-VU7NZHPM.js} +1 -1
  58. package/dist/chunk-WDKNMTJQ.js +1 -0
  59. package/dist/{chunk-YUATNVOT.js → chunk-Y5UJLPS4.js} +16 -16
  60. package/dist/{chunk-6IIZJQLV.js → chunk-YJZOMRAS.js} +1 -1
  61. package/dist/{create-WCV3L6XH.js → create-DBQNAMKP.js} +1 -1
  62. package/dist/{doctor-5BWM2EMJ.js → doctor-4NNUDNGZ.js} +1 -1
  63. package/dist/{dotnet-webapi-clean-6TVFBTVI.js → dotnet-webapi-clean-A6MVDYXX.js} +4 -4
  64. package/dist/{gofiber-standard-2BL7GWZB.js → gofiber-standard-I5YPQG5V.js} +1 -1
  65. package/dist/{gogin-standard-XGP3KBXA.js → gogin-standard-VY2L4QT5.js} +1 -1
  66. package/dist/index.d.ts +56 -14
  67. package/dist/index.js +322 -320
  68. package/dist/pipeline-TQM43A3K.js +5 -0
  69. package/dist/{springboot-standard-JJNUID6M.js → springboot-standard-55XKCBIZ.js} +4 -4
  70. package/dist/{workspace-7OXW5YTJ.js → workspace-NCWRINEF.js} +1 -1
  71. package/dist/{workspace-agent-sync-O4IA6VOA.js → workspace-agent-sync-662QHXGF.js} +1 -1
  72. package/dist/{workspace-archive-H74NBBNW.js → workspace-archive-P76EDIUG.js} +1 -1
  73. package/dist/{workspace-context-R7IPUBPG.js → workspace-context-23YYCUCP.js} +1 -1
  74. package/dist/workspace-contract-TU2I7GC2.js +1 -0
  75. package/dist/workspace-dependency-graph-BP4EXYQ5.js +1 -0
  76. package/dist/workspace-explain-MWUEN643.js +1 -0
  77. package/dist/workspace-explain-contract-ZPI3JXJU.js +1 -0
  78. package/dist/{workspace-feedback-REOS36ZZ.js → workspace-feedback-SUVH2LUJ.js} +1 -1
  79. package/dist/{workspace-foundation-KXT4QI5O.js → workspace-foundation-WXJ6I7ES.js} +1 -1
  80. package/dist/workspace-graph-token-efficiency-CFGFCJ5V.js +1 -0
  81. package/dist/{workspace-history-OGOVSKZG.js → workspace-history-BANOJRQ2.js} +1 -1
  82. package/dist/workspace-intelligence-MFJE7W67.js +1 -0
  83. package/dist/workspace-intelligence-evaluation-IPH7M3WV.js +1 -0
  84. package/dist/workspace-intelligence-runner-THYLHHMF.js +1 -0
  85. package/dist/workspace-knowledge-graph-ARDC6HHG.js +1 -0
  86. package/dist/workspace-knowledge-graph-change-overlay-XG6FC4IX.js +1 -0
  87. package/dist/workspace-knowledge-graph-export-UYAYFTWX.js +10 -0
  88. package/dist/workspace-knowledge-graph-query-VOSPPH4W.js +1 -0
  89. package/dist/workspace-mcp-serve-EZR6O76D.js +3 -0
  90. package/dist/workspace-model-7OU2M3LE.js +1 -0
  91. package/dist/workspace-model-hash-MHXK5MEI.js +1 -0
  92. package/dist/{workspace-registry-summary-SZ46R5PD.js → workspace-registry-summary-ORDK7A36.js} +1 -1
  93. package/dist/workspace-run-RLIYSOTN.js +1 -0
  94. package/dist/{workspace-verify-MFQ7IXGD.js → workspace-verify-EBVL7FWT.js} +1 -1
  95. package/dist/workspace-watch-3BPGLFLB.js +1 -0
  96. package/docs/AI_DYNAMIC_INTEGRATION.md +73 -428
  97. package/docs/AI_EXAMPLES.md +37 -395
  98. package/docs/AI_FEATURES.md +76 -456
  99. package/docs/AI_QUICKSTART.md +49 -212
  100. package/docs/GLOSSARY.md +64 -0
  101. package/docs/OPEN_SOURCE_USER_SCENARIOS.md +68 -7
  102. package/docs/README.md +70 -41
  103. package/docs/README_CONTENT_CONTRACT.md +154 -0
  104. package/docs/commands-reference.md +64 -4
  105. package/docs/config-file-guide.md +6 -2
  106. package/docs/contracts/ARTIFACT_CATALOG.md +76 -37
  107. package/docs/contracts/README.md +47 -8
  108. package/docs/graph-benchmark-methodology.md +121 -0
  109. package/docs/workspace-intelligence-evaluation.md +147 -0
  110. package/docs/workspace-knowledge-graph.md +316 -0
  111. package/docs/workspace-operations.md +49 -0
  112. package/package.json +2 -1
  113. package/dist/analyze-BEBEZSZK.js +0 -1
  114. package/dist/artifact-remediation-plan-FFQSESAM.js +0 -3
  115. package/dist/autopilot-release-WUR4CQIT.js +0 -1
  116. package/dist/chunk-2G7FASAO.js +0 -2
  117. package/dist/chunk-4EPHWD27.js +0 -8
  118. package/dist/chunk-CVHMUSRX.js +0 -1
  119. package/dist/chunk-DIPD72H4.js +0 -2
  120. package/dist/chunk-EFYHGCGX.js +0 -2
  121. package/dist/chunk-FWRXA435.js +0 -2
  122. package/dist/chunk-HDURFXW5.js +0 -2
  123. package/dist/chunk-HMUKBW2S.js +0 -4
  124. package/dist/chunk-K4WNYXKK.js +0 -33
  125. package/dist/chunk-LG6RFLPZ.js +0 -1
  126. package/dist/chunk-N7DV5L7C.js +0 -1
  127. package/dist/chunk-PRBVYW3T.js +0 -1
  128. package/dist/chunk-QZLIURER.js +0 -13
  129. package/dist/chunk-RIEF2DDX.js +0 -8
  130. package/dist/chunk-SXMTSV5M.js +0 -1
  131. package/dist/chunk-SXPY523X.js +0 -1
  132. package/dist/chunk-V3LRQZ36.js +0 -1
  133. package/dist/chunk-WYFPXTTS.js +0 -2
  134. package/dist/pipeline-ORIWVVYM.js +0 -5
  135. package/dist/workspace-contract-HKCMOMFE.js +0 -1
  136. package/dist/workspace-explain-GOPQYTPQ.js +0 -1
  137. package/dist/workspace-explain-contract-SVFJAAEI.js +0 -1
  138. package/dist/workspace-intelligence-7IESQSXY.js +0 -1
  139. package/dist/workspace-intelligence-runner-6GJ5M4HB.js +0 -1
  140. package/dist/workspace-mcp-serve-FRVWBO36.js +0 -3
  141. package/dist/workspace-model-PPYX7B4S.js +0 -1
  142. package/dist/workspace-run-V3KKHTVF.js +0 -1
  143. package/dist/workspace-watch-SOPZHRWA.js +0 -1
@@ -0,0 +1,260 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://getrapidkit.com/schemas/workspace-knowledge-graph.v1.json",
4
+ "title": "Workspai Evidence-backed Workspace Knowledge Graph",
5
+ "description": "Portable, provider-neutral workspace entities, relations and proof paths with the canonical project dependency topology embedded as a projection.",
6
+ "type": "object",
7
+ "required": [
8
+ "schemaVersion",
9
+ "generatedAt",
10
+ "source",
11
+ "workspace",
12
+ "projectTopology",
13
+ "entities",
14
+ "relations",
15
+ "proofs",
16
+ "providers",
17
+ "quality",
18
+ "diagnostics"
19
+ ],
20
+ "properties": {
21
+ "schemaVersion": { "const": "workspace-knowledge-graph.v1" },
22
+ "generatedAt": { "type": "string", "format": "date-time" },
23
+ "source": {
24
+ "type": "object",
25
+ "required": ["kind", "artifact", "hashAlgorithm", "hash"],
26
+ "properties": {
27
+ "kind": { "enum": ["workspace-model", "workspace-contract", "workspace-sources"] },
28
+ "artifact": { "type": "string", "minLength": 1 },
29
+ "hashAlgorithm": { "const": "sha256" },
30
+ "hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
31
+ },
32
+ "additionalProperties": false
33
+ },
34
+ "workspace": {
35
+ "type": "object",
36
+ "required": ["name"],
37
+ "properties": {
38
+ "name": { "type": "string", "minLength": 1 },
39
+ "profile": { "type": "string" }
40
+ },
41
+ "additionalProperties": false
42
+ },
43
+ "projectTopology": { "$ref": "workspace-dependency-graph.v1.json" },
44
+ "entities": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "object",
48
+ "required": ["id", "kind", "label", "identity", "attributes", "proofIds"],
49
+ "properties": {
50
+ "id": { "type": "string", "minLength": 1 },
51
+ "kind": {
52
+ "enum": [
53
+ "workspace",
54
+ "project",
55
+ "service",
56
+ "api",
57
+ "endpoint",
58
+ "schema",
59
+ "package",
60
+ "module",
61
+ "file",
62
+ "symbol",
63
+ "database",
64
+ "queue",
65
+ "container",
66
+ "deployment",
67
+ "pipeline",
68
+ "environment",
69
+ "document",
70
+ "decision",
71
+ "test-suite",
72
+ "owner"
73
+ ]
74
+ },
75
+ "label": { "type": "string", "minLength": 1 },
76
+ "projectId": { "type": "string", "minLength": 1 },
77
+ "identity": {
78
+ "type": "object",
79
+ "required": ["key", "scope", "aliases", "fingerprint"],
80
+ "properties": {
81
+ "key": { "type": "string", "minLength": 1 },
82
+ "scope": { "enum": ["workspace", "project"] },
83
+ "aliases": { "type": "array", "items": { "type": "string" } },
84
+ "fingerprint": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
85
+ },
86
+ "additionalProperties": false
87
+ },
88
+ "attributes": {
89
+ "type": "object",
90
+ "additionalProperties": {
91
+ "type": ["string", "number", "boolean", "null", "array"],
92
+ "items": { "type": ["string", "number", "boolean", "null"] }
93
+ }
94
+ },
95
+ "proofIds": {
96
+ "type": "array",
97
+ "items": { "type": "string", "minLength": 1 },
98
+ "uniqueItems": true
99
+ }
100
+ },
101
+ "additionalProperties": false
102
+ }
103
+ },
104
+ "relations": {
105
+ "type": "array",
106
+ "items": {
107
+ "type": "object",
108
+ "required": ["id", "from", "to", "kind", "derivation", "trust", "confidence", "proofIds"],
109
+ "properties": {
110
+ "id": { "type": "string", "minLength": 1 },
111
+ "from": { "type": "string", "minLength": 1 },
112
+ "to": { "type": "string", "minLength": 1 },
113
+ "kind": {
114
+ "enum": [
115
+ "contains",
116
+ "defines",
117
+ "imports",
118
+ "depends-on",
119
+ "exposes",
120
+ "implements",
121
+ "calls",
122
+ "reads-from",
123
+ "writes-to",
124
+ "publishes",
125
+ "consumes",
126
+ "deploys",
127
+ "runs-on",
128
+ "routes-to",
129
+ "documents",
130
+ "decided-by",
131
+ "tests",
132
+ "owns",
133
+ "generated-by",
134
+ "configured-by",
135
+ "references"
136
+ ]
137
+ },
138
+ "derivation": { "enum": ["extracted", "inferred", "authored"] },
139
+ "trust": { "enum": ["authoritative", "corroborated", "observed", "ambiguous"] },
140
+ "confidence": { "enum": ["high", "medium", "low"] },
141
+ "proofIds": {
142
+ "type": "array",
143
+ "items": { "type": "string", "minLength": 1 },
144
+ "minItems": 1,
145
+ "uniqueItems": true
146
+ }
147
+ },
148
+ "additionalProperties": false
149
+ }
150
+ },
151
+ "proofs": {
152
+ "type": "array",
153
+ "items": {
154
+ "type": "object",
155
+ "required": [
156
+ "id",
157
+ "provider",
158
+ "artifact",
159
+ "observedAt",
160
+ "derivation",
161
+ "trust",
162
+ "confidence",
163
+ "freshness"
164
+ ],
165
+ "properties": {
166
+ "id": { "type": "string", "minLength": 1 },
167
+ "provider": { "type": "string", "minLength": 1 },
168
+ "artifact": {
169
+ "type": "string",
170
+ "minLength": 1,
171
+ "not": { "pattern": "^(?:/|[A-Za-z]:[\\\\/])" }
172
+ },
173
+ "pointer": { "type": "string" },
174
+ "line": { "type": "integer", "minimum": 1 },
175
+ "column": { "type": "integer", "minimum": 1 },
176
+ "contentHash": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
177
+ "observedAt": { "type": "string", "format": "date-time" },
178
+ "derivation": { "enum": ["extracted", "inferred", "authored"] },
179
+ "trust": { "enum": ["authoritative", "corroborated", "observed", "ambiguous"] },
180
+ "confidence": { "enum": ["high", "medium", "low"] },
181
+ "freshness": { "enum": ["fresh", "stale", "unknown"] },
182
+ "detail": { "type": "string" }
183
+ },
184
+ "additionalProperties": false
185
+ }
186
+ },
187
+ "providers": {
188
+ "type": "array",
189
+ "items": {
190
+ "type": "object",
191
+ "required": [
192
+ "id",
193
+ "version",
194
+ "status",
195
+ "permission",
196
+ "discoveredEntities",
197
+ "discoveredRelations",
198
+ "proofCount",
199
+ "diagnostics"
200
+ ],
201
+ "properties": {
202
+ "id": { "type": "string", "minLength": 1 },
203
+ "version": { "type": "string", "minLength": 1 },
204
+ "status": { "enum": ["passed", "partial", "skipped", "failed"] },
205
+ "permission": { "enum": ["filesystem-read", "git-read", "runtime-probe", "network"] },
206
+ "discoveredEntities": { "type": "integer", "minimum": 0 },
207
+ "discoveredRelations": { "type": "integer", "minimum": 0 },
208
+ "proofCount": { "type": "integer", "minimum": 0 },
209
+ "diagnostics": { "type": "array", "items": { "type": "string" } }
210
+ },
211
+ "additionalProperties": false
212
+ }
213
+ },
214
+ "quality": {
215
+ "type": "object",
216
+ "required": [
217
+ "entityCount",
218
+ "relationCount",
219
+ "proofCount",
220
+ "entityProofCoverageRatio",
221
+ "relationProofCoverageRatio",
222
+ "providerSuccessRatio",
223
+ "conflictCount",
224
+ "unknownCount",
225
+ "portable",
226
+ "secretValuesEmitted"
227
+ ],
228
+ "properties": {
229
+ "entityCount": { "type": "integer", "minimum": 0 },
230
+ "relationCount": { "type": "integer", "minimum": 0 },
231
+ "proofCount": { "type": "integer", "minimum": 0 },
232
+ "entityProofCoverageRatio": { "type": "number", "minimum": 0, "maximum": 1 },
233
+ "relationProofCoverageRatio": { "type": "number", "minimum": 0, "maximum": 1 },
234
+ "providerSuccessRatio": { "type": "number", "minimum": 0, "maximum": 1 },
235
+ "conflictCount": { "type": "integer", "minimum": 0 },
236
+ "unknownCount": { "type": "integer", "minimum": 0 },
237
+ "portable": { "const": true },
238
+ "secretValuesEmitted": { "const": false }
239
+ },
240
+ "additionalProperties": false
241
+ },
242
+ "diagnostics": {
243
+ "type": "array",
244
+ "items": {
245
+ "type": "object",
246
+ "required": ["code", "severity", "message"],
247
+ "properties": {
248
+ "code": { "type": "string", "minLength": 1 },
249
+ "severity": { "enum": ["info", "warning", "error"] },
250
+ "message": { "type": "string", "minLength": 1 },
251
+ "entityIds": { "type": "array", "items": { "type": "string" } },
252
+ "relationIds": { "type": "array", "items": { "type": "string" } },
253
+ "recommendation": { "type": "string" }
254
+ },
255
+ "additionalProperties": false
256
+ }
257
+ }
258
+ },
259
+ "additionalProperties": false
260
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://getrapidkit.com/schemas/workspace-knowledge-search.v1.json",
4
+ "title": "Workspai Bounded Knowledge Graph Search",
5
+ "description": "A deterministic, bounded, proof-carrying retrieval projection intended for agents, MCP clients, IDEs, and CI consumers.",
6
+ "type": "object",
7
+ "required": [
8
+ "schemaVersion",
9
+ "query",
10
+ "kind",
11
+ "limit",
12
+ "totalMatches",
13
+ "truncated",
14
+ "entities",
15
+ "relatedEntities",
16
+ "relations",
17
+ "proofs"
18
+ ],
19
+ "properties": {
20
+ "schemaVersion": { "const": "workspace-knowledge-search.v1" },
21
+ "query": { "type": "string", "minLength": 1 },
22
+ "kind": {
23
+ "oneOf": [
24
+ { "type": "null" },
25
+ { "$ref": "workspace-knowledge-graph.v1.json#/properties/entities/items/properties/kind" }
26
+ ]
27
+ },
28
+ "limit": { "type": "integer", "minimum": 1, "maximum": 100 },
29
+ "totalMatches": { "type": "integer", "minimum": 0 },
30
+ "truncated": { "type": "boolean" },
31
+ "entities": {
32
+ "type": "array",
33
+ "maxItems": 100,
34
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/entities/items" }
35
+ },
36
+ "relatedEntities": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "object",
40
+ "required": ["id", "kind", "label"],
41
+ "properties": {
42
+ "id": { "type": "string", "minLength": 1 },
43
+ "kind": { "$ref": "workspace-knowledge-graph.v1.json#/properties/entities/items/properties/kind" },
44
+ "label": { "type": "string", "minLength": 1 },
45
+ "projectId": { "type": "string", "minLength": 1 }
46
+ },
47
+ "additionalProperties": false
48
+ }
49
+ },
50
+ "relations": {
51
+ "type": "array",
52
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/relations/items" }
53
+ },
54
+ "proofs": {
55
+ "type": "array",
56
+ "items": { "$ref": "workspace-knowledge-graph.v1.json#/properties/proofs/items" }
57
+ }
58
+ },
59
+ "additionalProperties": false
60
+ }
@@ -101,7 +101,7 @@
101
101
  "scripts",
102
102
  "framework markers",
103
103
  "package dependencies",
104
- "supported source imports (currently bounded JavaScript and TypeScript scanning)"
104
+ "bounded multi-language source observations for supported file extensions"
105
105
  ],
106
106
  "entersAt": "model"
107
107
  },
@@ -159,6 +159,7 @@
159
159
  "label": "System understanding",
160
160
  "artifacts": [
161
161
  ".workspai/reports/workspace-model.json",
162
+ ".workspai/reports/workspace-knowledge-graph.json",
162
163
  ".workspai/reports/workspace-model-diff-last-run.json",
163
164
  ".workspai/reports/workspace-impact-last-run.json"
164
165
  ],
@@ -298,13 +299,43 @@
298
299
  "commands": [
299
300
  "workspace graph emit",
300
301
  "workspace graph explain",
302
+ "workspace graph entities",
303
+ "workspace graph evidence",
304
+ "workspace graph path",
305
+ "workspace graph search",
306
+ "workspace graph benchmark",
307
+ "workspace graph overlay",
301
308
  "workspace graph dot",
302
- "workspace graph mermaid"
309
+ "workspace graph mermaid",
310
+ "workspace graph jsonld",
311
+ "workspace graph graphml",
312
+ "workspace graph gexf"
303
313
  ],
304
314
  "reads": [
305
- ".workspai/reports/workspace-model.json#graph"
315
+ ".workspai/reports/workspace-model.json",
316
+ ".workspai/reports/workspace-knowledge-graph.json"
317
+ ],
318
+ "role": "Query the proof-backed graph derived from the canonical workspace model.",
319
+ "chainStep": false
320
+ },
321
+ {
322
+ "id": "evaluation",
323
+ "commands": [
324
+ "workspace eval init",
325
+ "workspace eval record",
326
+ "workspace eval status",
327
+ "workspace eval report",
328
+ "workspace eval compare"
329
+ ],
330
+ "reads": [
331
+ ".workspai/reports/workspace-intelligence-evaluation-live.json",
332
+ ".workspai/reports/workspace-intelligence-evaluation-last-run.json"
333
+ ],
334
+ "produces": [
335
+ ".workspai/reports/workspace-intelligence-evaluation-live.json",
336
+ ".workspai/reports/workspace-intelligence-evaluation-last-run.json"
306
337
  ],
307
- "role": "Inspect or render the graph already embedded in the workspace model.",
338
+ "role": "Measure model usage, activity, cost provenance, and verified outcomes without storing prompt or response bodies.",
308
339
  "chainStep": false
309
340
  },
310
341
  {
@@ -345,7 +376,8 @@
345
376
  "workspace model --json --write"
346
377
  ],
347
378
  "artifacts": [
348
- ".workspai/reports/workspace-model.json"
379
+ ".workspai/reports/workspace-model.json",
380
+ ".workspai/reports/workspace-knowledge-graph.json"
349
381
  ]
350
382
  },
351
383
  {
@@ -6,7 +6,7 @@
6
6
  "invariants": [
7
7
  "Missing or unreadable input is unknown or unavailable; it must not be presented as verified absence.",
8
8
  "Freshness and provenance travel with evidence and must not be discarded by projections.",
9
- "The current graph is a workspace dependency graph, not a complete cross-language symbol or call graph.",
9
+ "The current graph is an evidence-backed workspace knowledge graph with bounded source intelligence, not a complete cross-language symbol or call graph.",
10
10
  "Simple and standard presentations summarize the contract; their contractRefs must preserve complete traceability.",
11
11
  "Conditional provider outputs must be resolved through their dedicated inventory contract.",
12
12
  "Auxiliary capabilities expose or refresh intelligence but are not mandatory execution-chain steps.",
@@ -102,6 +102,12 @@
102
102
  "schemaVersion": "workspace-model.v1",
103
103
  "schemaContract": "contracts/workspace-intelligence/workspace-model.v1.json"
104
104
  },
105
+ {
106
+ "id": "knowledgeGraph",
107
+ "path": ".workspai/reports/workspace-knowledge-graph.json",
108
+ "schemaVersion": "workspace-knowledge-graph.v1",
109
+ "schemaContract": "contracts/workspace-intelligence/workspace-knowledge-graph.v1.json"
110
+ },
105
111
  {
106
112
  "id": "snapshot",
107
113
  "path": ".workspai/reports/workspace-model-snapshot.json",
@@ -197,6 +203,18 @@
197
203
  "path": ".workspai/reports/workspace-intelligence-run-last-run.json",
198
204
  "schemaVersion": "workspace-intelligence-run.v1",
199
205
  "schemaContract": "contracts/workspace-intelligence/workspace-intelligence-run.v1.json"
206
+ },
207
+ {
208
+ "id": "evaluationLive",
209
+ "path": ".workspai/reports/workspace-intelligence-evaluation-live.json",
210
+ "schemaVersion": "workspace-intelligence-evaluation.v1",
211
+ "schemaContract": "contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json"
212
+ },
213
+ {
214
+ "id": "evaluationLastRun",
215
+ "path": ".workspai/reports/workspace-intelligence-evaluation-last-run.json",
216
+ "schemaVersion": "workspace-intelligence-evaluation.v1",
217
+ "schemaContract": "contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json"
200
218
  }
201
219
  ]
202
220
  },
@@ -252,7 +270,7 @@
252
270
  "scripts",
253
271
  "framework markers",
254
272
  "package dependencies",
255
- "supported source imports (currently bounded JavaScript and TypeScript scanning)"
273
+ "bounded multi-language source observations for supported file extensions"
256
274
  ],
257
275
  "entersAt": "model"
258
276
  },
@@ -310,6 +328,7 @@
310
328
  "label": "System understanding",
311
329
  "artifacts": [
312
330
  ".workspai/reports/workspace-model.json",
331
+ ".workspai/reports/workspace-knowledge-graph.json",
313
332
  ".workspai/reports/workspace-model-diff-last-run.json",
314
333
  ".workspai/reports/workspace-impact-last-run.json"
315
334
  ],
@@ -489,13 +508,43 @@
489
508
  "commands": [
490
509
  "workspace graph emit",
491
510
  "workspace graph explain",
511
+ "workspace graph entities",
512
+ "workspace graph evidence",
513
+ "workspace graph path",
514
+ "workspace graph search",
515
+ "workspace graph benchmark",
516
+ "workspace graph overlay",
492
517
  "workspace graph dot",
493
- "workspace graph mermaid"
518
+ "workspace graph mermaid",
519
+ "workspace graph jsonld",
520
+ "workspace graph graphml",
521
+ "workspace graph gexf"
522
+ ],
523
+ "reads": [
524
+ ".workspai/reports/workspace-model.json",
525
+ ".workspai/reports/workspace-knowledge-graph.json"
526
+ ],
527
+ "role": "Query the proof-backed graph derived from the canonical workspace model.",
528
+ "chainStep": false
529
+ },
530
+ {
531
+ "id": "evaluation",
532
+ "commands": [
533
+ "workspace eval init",
534
+ "workspace eval record",
535
+ "workspace eval status",
536
+ "workspace eval report",
537
+ "workspace eval compare"
494
538
  ],
495
539
  "reads": [
496
- ".workspai/reports/workspace-model.json#graph"
540
+ ".workspai/reports/workspace-intelligence-evaluation-live.json",
541
+ ".workspai/reports/workspace-intelligence-evaluation-last-run.json"
497
542
  ],
498
- "role": "Inspect or render the graph already embedded in the workspace model.",
543
+ "produces": [
544
+ ".workspai/reports/workspace-intelligence-evaluation-live.json",
545
+ ".workspai/reports/workspace-intelligence-evaluation-last-run.json"
546
+ ],
547
+ "role": "Measure model usage, activity, cost provenance, and verified outcomes without storing prompt or response bodies.",
499
548
  "chainStep": false
500
549
  },
501
550
  {
@@ -726,7 +775,8 @@
726
775
  ],
727
776
  "consumesArtifacts": [],
728
777
  "produces": [
729
- ".workspai/reports/workspace-model.json"
778
+ ".workspai/reports/workspace-model.json",
779
+ ".workspai/reports/workspace-knowledge-graph.json"
730
780
  ],
731
781
  "dependsOn": [],
732
782
  "exitPolicy": "stop-on-error",
@@ -1206,6 +1256,7 @@
1206
1256
  ".workspai/reports/workspace-impact-last-run.json",
1207
1257
  ".workspai/reports/workspace-explain-last-run.json",
1208
1258
  ".workspai/reports/workspace-model.json",
1259
+ ".workspai/reports/workspace-knowledge-graph.json",
1209
1260
  ".workspai/reports/agent-customization-pack.json",
1210
1261
  ".workspai/reports/workspace-skills-index.json"
1211
1262
  ],
@@ -1218,6 +1269,7 @@
1218
1269
  "ideAndCi": {
1219
1270
  "requiredArtifacts": [
1220
1271
  ".workspai/reports/workspace-model.json",
1272
+ ".workspai/reports/workspace-knowledge-graph.json",
1221
1273
  ".workspai/reports/workspace-impact-last-run.json",
1222
1274
  ".workspai/reports/workspace-verify-last-run.json"
1223
1275
  ],
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://getrapidkit.com/schemas/workspace-share-bundle.v1.json",
4
+ "type": "object",
5
+ "required": ["schema_version", "generated_at", "generated_by", "workspace", "summary", "reports", "projects"],
6
+ "properties": {
7
+ "schema_version": { "const": "1.1" },
8
+ "generated_at": { "type": "string", "format": "date-time" },
9
+ "generated_by": { "const": "workspai" },
10
+ "workspace": { "type": "object" },
11
+ "summary": { "type": "object" },
12
+ "reports": { "type": "object" },
13
+ "projects": { "type": "array", "items": { "type": "object" } }
14
+ },
15
+ "additionalProperties": true
16
+ }
@@ -0,0 +1 @@
1
+ export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-54EP5CEV.js';
@@ -0,0 +1,3 @@
1
+ import {a as a$1}from'./chunk-2E6WGUN6.js';import {a,e,b}from'./chunk-32OJDBIG.js';import y from'path';import {existsSync}from'fs';import x from'fs-extra';var I=[{artifactKind:"bootstrap-compliance",cardId:"bootstrap",fileNames:["bootstrap-compliance.latest.json"]},{artifactKind:"doctor-workspace",cardId:"doctor",fileNames:["doctor-remediation-plan-last-run.json"]},{artifactKind:"analyze",cardId:"analyze",fileNames:["analyze-last-run.json"]},{artifactKind:"readiness",cardId:"readiness",fileNames:["release-readiness-last-run.json"]},{artifactKind:"pipeline",cardId:"pipeline",fileNames:["pipeline-last-run.json"]},{artifactKind:"workspace-run",cardId:"workspaceRun",fileNames:["workspace-run-last.json"]},{artifactKind:"workspace-verify",cardId:"workspaceVerify",fileNames:["workspace-verify-last-run.json"]}];function m(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function f(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"&&r.trim().length>0):[]}function k(e){return [...new Set(e.map(r=>r.trim()).filter(Boolean))]}function K(e,r,t){return t?r:y.relative(e,r)}function C(e){let r=e?.trim()||"npx workspai bootstrap";if(!/(?:^|\s)--ci(?:\s|$)/.test(r)&&/(?:^|\s)--json(?:\s|$)/.test(r))return r.replace(/(?:^|\s)--json(?:\s|$)/,i=>{let n=i.startsWith(" ")?" ":"",c=i.endsWith(" ")?" ":"";return `${n}--ci --json${c}`}).trim();let t=/(?:^|\s)--ci(?:\s|$)/.test(r)?r:`${r} --ci`;return /(?:^|\s)--json(?:\s|$)/.test(t)?t:`${t} --json`}function M(e){return `${JSON.stringify({schemaVersion:"rapidkit.compatibility-matrix.v1",generatedAt:e,source:"workspai workspace remediation-plan",runtimes:{},notes:["Minimal enterprise baseline. Add runtime and toolchain entries as governance matures."]},null,2)}
2
+ `}function N(e){return `${JSON.stringify({schema_version:"1.0",enabled:false,strategy:"on-demand",artifacts:[],created_at:e,note:"Minimal enterprise baseline. Set enabled: true and add artifact entries to activate mirroring."},null,2)}
3
+ `}function $(e){let r=e.payload,t=f(r.blockers),i=f(r.blockingReasons),n=f(r.failures),c=f(r.reasons),d=f(r.policyViolations),a=m(r.summary),l=f(a?.blockers);if(e.artifactKind==="analyze"){let o=(Array.isArray(r.findings)?r.findings:[]).map(s=>m(s)).filter(s=>!!s).map(s=>String(s.message??s.title??s.id??"").trim()).filter(Boolean);return k([...t,...o,...i])}if(e.artifactKind==="workspace-run"){let u=m(r.stages),o=Object.entries(u??{}).flatMap(([s,b])=>{let h=m(b);return (Array.isArray(h?.projects)?h.projects:[]).map(p=>m(p)).filter(p=>!!p).filter(p=>p.status==="failed"||p.ok===false).map(p=>`${s}: ${String(p.project??p.name??"project")} failed`)});return k([...t,...o,...i])}return k([...t,...i,...n,...c,...d,...l])}function g(e){return {id:e.id,artifactKind:e.artifactKind,cardId:e.cardId,title:e.title,order:e.order,phase:e.phase,scope:"workspace",status:e.status??"ready",mode:e.mode,risk:e.risk,requiresApproval:true,blocker:e.blocker,summary:e.summary,...e.command?{command:e.command}:{},verifyCommand:e.verifyCommand,cwd:"workspace",files:e.files??[],...e.operation?{operation:e.operation}:{},rollback:{available:!!e.operation,strategy:e.operation?"idempotent":"none"},notes:e.notes??[]}}function P(e){let r=[],t=C("npx workspai bootstrap --json");for(let i of e.blockers)i.includes("profile.enterprise.ci")&&r.push(g({id:"bootstrap.enterprise-ci",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Run bootstrap in deterministic CI mode",order:10,phase:"bootstrap-preflight",blocker:i,summary:"Enterprise bootstrap compliance requires --ci for deterministic execution.",mode:"run-command",risk:"safe",command:t,verifyCommand:t})),i.includes("profile.enterprise.compatibility-matrix")&&r.push(g({id:"bootstrap.compatibility-matrix",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Create enterprise compatibility matrix baseline",order:20,phase:"bootstrap-config",blocker:i,summary:"Create the missing compatibility matrix baseline without overwriting user data.",mode:"edit-file",risk:"safe",verifyCommand:t,files:[".workspai/compatibility-matrix.json"],operation:{type:"file-create",path:".workspai/compatibility-matrix.json",content:M(e.generatedAt),overwrite:false}})),i.includes("profile.enterprise.mirror-config")&&r.push(g({id:"bootstrap.mirror-config",artifactKind:"bootstrap-compliance",cardId:"bootstrap",title:"Create enterprise mirror config baseline",order:30,phase:"bootstrap-config",blocker:i,summary:"Create the missing mirror configuration baseline without enabling mirroring.",mode:"edit-file",risk:"safe",verifyCommand:t,files:[".workspai/mirror-config.json"],operation:{type:"file-create",path:".workspai/mirror-config.json",content:N(e.generatedAt),overwrite:false}}));return r}function S(e){if(e.report.artifactKind==="readiness"&&/dependenc(?:y|ies).*vulnerabil|vulnerabil.*dependenc(?:y|ies)|security audit/i.test(e.blocker))return g({id:`${e.report.cardId}.doctor-owner.${e.order}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:"Resolve dependency vulnerability through Doctor",order:e.order,phase:"dependency-remediation",blocker:e.blocker,summary:"Release Readiness is the aggregate gate; use the project-scoped Doctor remediation capability that owns this dependency failure.",mode:"verify-before-fix",risk:"guarded",status:"review-required",command:"npx workspai doctor workspace --plan --json",verifyCommand:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",notes:["Read doctor-remediation-plan-last-run.json and execute the matching surface-security-hygiene capability before rerunning Readiness.","Do not treat a Readiness refresh as remediation for a source dependency vulnerability."]});let t={analyze:{title:"Refresh analyze evidence",phase:"analysis",command:"npx workspai analyze --strict --json",verify:"npx workspai analyze --strict --json"},readiness:{title:"Refresh release readiness",phase:"release-readiness",command:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json",verify:e.ciMode?"npx workspai readiness --strict --json":"npx workspai readiness --json"},pipeline:{title:"Rerun governance pipeline",phase:"governance-pipeline",command:"npx workspai pipeline --json --strict",verify:"npx workspai pipeline --json --strict"},"workspace-run":{title:"Rerun failed workspace stage",phase:"fleet-run",command:e.ciMode?"npx workspai workspace run test --strict --json":"npx workspai workspace run test --json",verify:e.ciMode?"npx workspai workspace run test --strict --json":"npx workspai workspace run test --json"},"workspace-verify":{title:"Refresh workspace verify gate",phase:"verification",command:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json",verify:e.ciMode?"npx workspai workspace verify --strict --json":"npx workspai workspace verify --json"},"doctor-workspace":{title:"Use Doctor remediation plan",phase:"doctor-remediation",command:"npx workspai doctor workspace --plan --json",verify:"npx workspai doctor workspace --json"}}[e.report.artifactKind]??{title:"Refresh artifact evidence",phase:"evidence-refresh",command:"npx workspai pipeline --json --strict",verify:"npx workspai pipeline --json --strict"};return g({id:`${e.report.cardId}.refresh.${e.order}`,artifactKind:e.report.artifactKind,cardId:e.report.cardId,title:t.title,order:e.order,phase:t.phase,blocker:e.blocker,summary:"No deterministic file operation is available for this artifact yet; refresh the evidence and continue with the card-specific plan.",mode:e.report.artifactKind==="doctor-workspace"?"verify-before-fix":"run-command",risk:"guarded",status:e.report.artifactKind==="doctor-workspace"?"review-required":"ready",command:t.command,verifyCommand:t.verify,notes:e.report.artifactKind==="doctor-workspace"?["Read doctor-remediation-plan-last-run.json for ordered file-level steps."]:[]})}async function O(e){let r=[a(e,".workspai/reports"),b(e,".workspai/reports")],t=[],i=new Set;for(let n of I)for(let c of n.fileNames){let d=(await Promise.all(r.map(a=>y.join(a,c)))).find(a=>existsSync(a));if(!(!d||i.has(`${n.artifactKind}:${c}`))){i.add(`${n.artifactKind}:${c}`);try{let a=await x.readJSON(d),l=m(a);if(!l)continue;t.push({artifactKind:n.artifactKind,cardId:n.cardId,fileName:c,absolutePath:d,payload:l});}catch{t.push({artifactKind:n.artifactKind,cardId:n.cardId,fileName:c,absolutePath:d,payload:{blockers:[`${n.artifactKind}: report exists but could not be parsed.`]}});}}}return t}async function F(e){let r=y.resolve(e.workspacePath),t=e.includeAbsolutePaths===true,i=e.ciMode===true,n=new Date().toISOString(),c=a(r,".workspai/reports"),d=await O(r),a$2=[],l=1;for(let o of d){let s=$(o);if(s.length!==0){if(o.artifactKind==="bootstrap-compliance"){a$2.push(...P({blockers:s,generatedAt:n})),l=a$2.length+1;continue}for(let b of s.slice(0,8))a$2.push(S({report:o,blocker:b,order:l,ciMode:i})),l+=1;}}let u={safe:a$2.filter(o=>o.risk==="safe").length,guarded:a$2.filter(o=>o.risk==="guarded").length,invasive:a$2.filter(o=>o.risk==="invasive").length};return {schemaVersion:a$1,generatedAt:n,workspace:{name:y.basename(r),...t?{path:r}:{}},source:{command:"workspace remediation-plan",reportsDir:K(r,c,t),includeAbsolutePaths:t,ciMode:i},summary:{artifactsScanned:d.length,cardsCovered:k(a$2.map(o=>o.cardId)).length,totalActions:a$2.length,executableActions:a$2.filter(o=>o.status==="ready").length,risk:u},actions:a$2}}async function W(e$1,r){return e(r,".workspai/reports/artifact-remediation-plan-last-run.json",e$1)}export{F as buildArtifactRemediationPlan,W as writeArtifactRemediationPlan};
@@ -0,0 +1 @@
1
+ export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-5S3DJQEP.js';
@@ -0,0 +1,2 @@
1
+ import {b}from'./chunk-3NU32T4A.js';import {r,s}from'./chunk-5XATWNME.js';import c from'path';import {randomUUID}from'crypto';import {open}from'fs/promises';import i from'fs-extra';function x(e,t){let s=c.resolve(e),r=t.trim();if(!r||c.isAbsolute(r))throw new Error(`Workspace artifact path must be non-empty and relative: ${t}`);let l=c.resolve(s,r),a=c.relative(s,l);if(a===".."||a.startsWith(`..${c.sep}`)||c.isAbsolute(a))throw new Error(`Workspace artifact path escapes workspace root: ${t}`);return l}function p(e,t){return x(e,r(t))}function $(e,t){return x(e,s(t))}async function W(e,t){let s=c.resolve(e);await i.ensureDir(s);let r=c.dirname(t);await i.ensureDir(r);let[l,a]=await Promise.all([i.realpath(s),i.realpath(r)]),o=c.relative(l,a);if(o===".."||o.startsWith(`..${c.sep}`)||c.isAbsolute(o))throw new Error(`Workspace artifact parent resolves outside workspace root: ${r}`)}async function M(e,t){let s=c.resolve(e),[r,l]=await Promise.all([i.realpath(s),i.realpath(t)]),a=c.relative(r,l);if(a===".."||a.startsWith(`..${c.sep}`)||c.isAbsolute(a))throw new Error(`Workspace artifact resolves outside workspace root: ${t}`)}function R(e){let t=e?.code;return process.platform==="win32"&&(t==="EPERM"||t==="EINVAL"||t==="ENOSYS")}async function T(e){try{await e.sync();}catch(t){if(!R(t))throw t}}async function y(e,t,s){await W(e,t);let r=c.dirname(t),l=`${c.basename(t)}.`,a=Date.now();for(let w of await i.readdir(r)){if(!w.startsWith(l)||!w.endsWith(".tmp"))continue;let f=c.join(r,w),n=await i.stat(f).catch(()=>null);n&&a-n.mtimeMs>3e4&&await i.remove(f).catch(()=>{});}let o=`${t}.${process.pid}.${randomUUID()}.tmp`;try{await s(o);let w=await open(o,"r");try{await T(w);}finally{await w.close();}let f=Number(process.env.WORKSPAI_TEST_ATOMIC_WRITE_DELAY_MS??0);Number.isFinite(f)&&f>0&&await new Promise(n=>setTimeout(n,Math.min(f,3e4)));try{await i.rename(o,t);}catch(n){let d=n.code;if(d!=="EEXIST"&&d!=="EPERM")throw n;await i.move(o,t,{overwrite:true});}}finally{await i.remove(o).catch(()=>{});}}async function _(e,t,s,r={}){let l=p(e,t);await W(e,l);let a=`${l}.lock`,o=r.timeoutMs??1e4,w=r.staleAfterMs??3e4,f=Date.now(),n;for(;!n;)try{n=await open(a,"wx"),await n.writeFile(`${JSON.stringify({pid:process.pid,createdAt:new Date().toISOString()})}
2
+ `),await T(n);}catch(d){if(d.code!=="EEXIST")throw n&&(await n.close().catch(()=>{}),n=void 0,await i.remove(a).catch(()=>{})),d;let[A,S]=await Promise.all([i.stat(a).catch(()=>null),i.readJson(a).catch(()=>null)]),u=Number(S?.pid),m=Number.isInteger(u)&&u>0,h=false;if(m)try{process.kill(u,0),h=true;}catch(g){h=g.code==="EPERM";}let I=!m&&!!(A&&Date.now()-A.mtimeMs>w);if(m&&!h||I){await i.remove(a).catch(()=>{});continue}if(Date.now()-f>=o)throw new Error(`Timed out waiting for workspace artifact lock: ${t}`);await new Promise(g=>setTimeout(g,20));}try{return await s()}finally{await n.close().catch(()=>{}),await i.remove(a).catch(()=>{});}}async function z(e,t){let s=[p(e,t),$(e,t)];for(let r of s)if(await i.pathExists(r))return await M(e,r),r;return null}async function B(e,t,s){b(t,s);let r=p(e,t);return await y(e,r,l=>i.writeJson(l,s,{spaces:2})),r}async function H(e,t,s){if(s.length===0)return [];let r=s.map(a=>({...a,path:p(e,a.relativePath)})),l=r.find((a,o)=>r.findIndex(w=>w.path===a.path)!==o);if(l)throw new Error(`Duplicate workspace artifact transaction target: ${l.relativePath}`);for(let a of r)b(a.relativePath,a.payload);return _(e,t,async()=>{let a=await Promise.all(r.map(async o=>({path:o.path,exists:await i.pathExists(o.path),contents:await i.readFile(o.path).catch(()=>null)})));try{for(let o=0;o<r.length;o+=1){let w=r[o];await y(e,w.path,n=>i.writeJson(n,w.payload,{spaces:2}));let f=Number(process.env.WORKSPAI_TEST_FAIL_ARTIFACT_SET_AFTER??0);if(Number.isInteger(f)&&f===o+1)throw new Error(`Injected artifact-set failure after ${f} write(s).`)}return r.map(o=>o.path)}catch(o){let f=(await Promise.allSettled(a.map(async n=>{if(!n.exists||n.contents===null){await i.remove(n.path);return}await y(e,n.path,d=>i.writeFile(d,n.contents));}))).filter(n=>n.status==="rejected");throw f.length>0?new AggregateError([o,...f.map(n=>n.reason)],"Workspace artifact transaction failed and rollback was incomplete."):o}})}export{p as a,$ as b,_ as c,z as d,B as e,H as f};