workspai 0.68.0 → 0.70.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 (177) hide show
  1. package/README.md +38 -18
  2. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +459 -0
  3. package/contracts/extension-cli-compatibility.v1.json +11 -0
  4. package/contracts/published-contract-catalog.v1.json +55 -0
  5. package/contracts/runtime-command-surface.v1.json +282 -0
  6. package/contracts/workspace-intelligence/architecture-change-lease.v1.json +50 -0
  7. package/contracts/workspace-intelligence/architecture-surprise-report.v1.json +46 -0
  8. package/contracts/workspace-intelligence/change-operation-result.v1.json +43 -0
  9. package/contracts/workspace-intelligence/decision-checkpoint.v1.json +18 -0
  10. package/contracts/workspace-intelligence/decision-event.v1.json +154 -0
  11. package/contracts/workspace-intelligence/decision-transaction.v1.json +29 -0
  12. package/contracts/workspace-intelligence/goal-index.v1.json +13 -0
  13. package/contracts/workspace-intelligence/goal-pack.v1.json +2 -1
  14. package/contracts/workspace-intelligence/predicted-architecture-change.v1.json +34 -0
  15. package/contracts/workspace-intelligence/proof-carrying-change-capsule-export.v1.json +14 -0
  16. package/contracts/workspace-intelligence/proof-carrying-change-capsule-validation.v1.json +16 -0
  17. package/contracts/workspace-intelligence/proof-carrying-change-capsule.v1.json +63 -0
  18. package/contracts/workspace-intelligence/proof-carrying-change-list.v1.json +80 -0
  19. package/contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json +9 -1
  20. package/dist/analyze-OGWDSPXQ.js +1 -0
  21. package/dist/{artifact-remediation-plan-I7IKC5MR.js → artifact-remediation-plan-URQL5MBN.js} +1 -1
  22. package/dist/autopilot-release-QQDFEPT7.js +1 -0
  23. package/dist/capabilities-command-NFGX42CH.js +1 -0
  24. package/dist/chunk-37SWTS2B.js +1 -0
  25. package/dist/{chunk-KDY4X7SQ.js → chunk-3S2U7WRM.js} +1 -1
  26. package/dist/{chunk-BHM6RHTA.js → chunk-3WHE7V4M.js} +1 -1
  27. package/dist/{chunk-2C5XJBYI.js → chunk-4R7STECB.js} +64 -64
  28. package/dist/chunk-AGZWDYMF.js +12 -0
  29. package/dist/chunk-COICGD62.js +1 -0
  30. package/dist/chunk-DNZHKBQ3.js +49 -0
  31. package/dist/{chunk-4WVOAX2V.js → chunk-DWL3PPLA.js} +1 -1
  32. package/dist/chunk-EBQS5T7Q.js +7 -0
  33. package/dist/chunk-EP6Q2QBU.js +1 -0
  34. package/dist/chunk-EZPLMAW2.js +1 -0
  35. package/dist/chunk-FE5R6EUV.js +2 -0
  36. package/dist/chunk-FIK343LI.js +1 -0
  37. package/dist/chunk-GED7JURY.js +157 -0
  38. package/dist/{chunk-3Z4SVBMR.js → chunk-GL3KLNIG.js} +1 -1
  39. package/dist/{chunk-TMRCPT7S.js → chunk-GYN6RPNU.js} +1 -1
  40. package/dist/{chunk-6E2Y3XGT.js → chunk-HCFOVANQ.js} +1 -1
  41. package/dist/{chunk-7DDEMDG2.js → chunk-IET57ZKN.js} +2 -2
  42. package/dist/{chunk-5OV2WXAR.js → chunk-IFHM2SI6.js} +1 -1
  43. package/dist/{chunk-3BMYMZQB.js → chunk-IGJA6GBQ.js} +1 -1
  44. package/dist/chunk-IHKG5C6G.js +1 -0
  45. package/dist/chunk-IRLKWRLP.js +3 -0
  46. package/dist/{chunk-FX5J6JCK.js → chunk-IVYPC36J.js} +1 -1
  47. package/dist/{chunk-DFVG4DDZ.js → chunk-JK6XEF7K.js} +3 -3
  48. package/dist/chunk-K33JJVQZ.js +2 -0
  49. package/dist/{chunk-3XF7O66C.js → chunk-LE2I2E6R.js} +5 -5
  50. package/dist/chunk-LU6CYDLN.js +1 -0
  51. package/dist/{chunk-QMQBX3RV.js → chunk-MGL6DBOR.js} +1 -1
  52. package/dist/chunk-N4B2M44I.js +1 -0
  53. package/dist/chunk-N6FJZ62B.js +2 -0
  54. package/dist/chunk-NSH7TTSV.js +1 -0
  55. package/dist/chunk-O5XQP5E7.js +1 -0
  56. package/dist/chunk-ODK4LCEL.js +1 -0
  57. package/dist/chunk-PTSEDZIV.js +2 -0
  58. package/dist/chunk-QNHKUSBH.js +1 -0
  59. package/dist/{chunk-SLFOUSRW.js → chunk-QYEQVNBF.js} +1 -1
  60. package/dist/chunk-QZODGRAI.js +2 -0
  61. package/dist/chunk-S2TOSHQW.js +4 -0
  62. package/dist/chunk-S42KDOGG.js +1 -0
  63. package/dist/chunk-TEMFNVO2.js +2 -0
  64. package/dist/chunk-TKXRP2B4.js +1 -0
  65. package/dist/{chunk-IXXQMD34.js → chunk-TLMP2MGH.js} +1 -1
  66. package/dist/chunk-UNXG3ZFV.js +1 -0
  67. package/dist/chunk-UT57IFS4.js +8 -0
  68. package/dist/{chunk-2MTJWPQ4.js → chunk-V52R2W2Q.js} +1 -1
  69. package/dist/chunk-WUXJCSYO.js +9 -0
  70. package/dist/chunk-XSSNM4F5.js +5 -0
  71. package/dist/chunk-XVTN5DDV.js +1 -0
  72. package/dist/{chunk-OFYY4725.js → chunk-Z7JIUA6I.js} +1 -1
  73. package/dist/chunk-ZLCLGIM6.js +1 -0
  74. package/dist/chunk-ZPOZ6MDX.js +4 -0
  75. package/dist/{create-U5PQHOZ4.js → create-BBALBC3U.js} +1 -1
  76. package/dist/doctor-WWVY7NB6.js +1 -0
  77. package/dist/goal-lifecycle-CEUTKUNV.js +1 -0
  78. package/dist/goal-pack-JQL3YOKT.js +1 -0
  79. package/dist/index.d.ts +35 -2
  80. package/dist/index.js +239 -239
  81. package/dist/pipeline-V46WWMP4.js +5 -0
  82. package/dist/{project-agent-entry-MH7364BE.js → project-agent-entry-MRAYG7QD.js} +1 -1
  83. package/dist/{project-intelligence-lens-ZCCHUKVI.js → project-intelligence-lens-4BKPN4PE.js} +1 -1
  84. package/dist/{project-test-coverage-JPWTBSSJ.js → project-test-coverage-4RRCHY5W.js} +1 -1
  85. package/dist/proof-carrying-change-B7ONTBYO.js +1 -0
  86. package/dist/verified-goal-YNSBL7L3.js +1 -0
  87. package/dist/{workspace-B33BFZZ3.js → workspace-FJ6JRYWA.js} +1 -1
  88. package/dist/{workspace-agent-sync-T3MJO2MX.js → workspace-agent-sync-V33UGII3.js} +1 -1
  89. package/dist/{workspace-archive-NOSGRKRZ.js → workspace-archive-OSMU3CK6.js} +1 -1
  90. package/dist/{workspace-context-KOCEP4MJ.js → workspace-context-O6UBCBEA.js} +1 -1
  91. package/dist/{workspace-contract-MQ3QE52V.js → workspace-contract-S2JYDA4K.js} +1 -1
  92. package/dist/workspace-explain-RP6VJ6QM.js +1 -0
  93. package/dist/workspace-explain-contract-KV7RTEJU.js +1 -0
  94. package/dist/{workspace-feedback-3YLIUFQ7.js → workspace-feedback-D6HJLKBQ.js} +1 -1
  95. package/dist/{workspace-foundation-O7O3QIS4.js → workspace-foundation-7QXEJJKZ.js} +1 -1
  96. package/dist/{workspace-graph-stream-XTGGBD7D.js → workspace-graph-stream-YY65R5EC.js} +1 -1
  97. package/dist/workspace-graph-token-efficiency-WNAFAN2F.js +1 -0
  98. package/dist/{workspace-history-7HDZZ4G5.js → workspace-history-WWPS4U7H.js} +1 -1
  99. package/dist/{workspace-intelligence-TFEQBPUP.js → workspace-intelligence-LMR42ICR.js} +1 -1
  100. package/dist/{workspace-intelligence-benchmark-PLVUBGWO.js → workspace-intelligence-benchmark-S5OXVNLC.js} +1 -1
  101. package/dist/{workspace-intelligence-evaluation-OJIQS5SN.js → workspace-intelligence-evaluation-QDSOOUHH.js} +1 -1
  102. package/dist/{workspace-intelligence-runner-6ZAV6RO4.js → workspace-intelligence-runner-FXFSTCHC.js} +1 -1
  103. package/dist/workspace-intelligence-runtime-registry-ZLPF7BAY.js +1 -0
  104. package/dist/{workspace-knowledge-graph-AUXYL3L6.js → workspace-knowledge-graph-3564KQXT.js} +1 -1
  105. package/dist/workspace-knowledge-graph-change-overlay-FIIAFLO6.js +1 -0
  106. package/dist/{workspace-knowledge-graph-contract-X52KXBXJ.js → workspace-knowledge-graph-contract-FVX5T7SU.js} +1 -1
  107. package/dist/{workspace-knowledge-graph-query-A7TKONWY.js → workspace-knowledge-graph-query-WHCGPBGS.js} +1 -1
  108. package/dist/workspace-knowledge-graph-snapshot-P27RPMV5.js +1 -0
  109. package/dist/workspace-mcp-serve-ZK46EZUD.js +3 -0
  110. package/dist/{workspace-model-GVXNLSQM.js → workspace-model-6UMQAGUK.js} +1 -1
  111. package/dist/{workspace-onboarding-ECZ2KJ2A.js → workspace-onboarding-C57OQ7XZ.js} +1 -1
  112. package/dist/{workspace-readme-6N5Y2ZSJ.js → workspace-readme-HA6XLDME.js} +2 -2
  113. package/dist/{workspace-registry-summary-5SFBTRGQ.js → workspace-registry-summary-GLQO4ZUF.js} +1 -1
  114. package/dist/workspace-repair-engine-5ZSSF3T5.js +3 -0
  115. package/dist/workspace-run-UGWGT3K2.js +1 -0
  116. package/dist/{workspace-verify-D3QTMAUI.js → workspace-verify-LQHXBH2D.js} +1 -1
  117. package/dist/{workspace-watch-XYJEW2Z2.js → workspace-watch-Z32443UP.js} +1 -1
  118. package/docs/README.md +35 -31
  119. package/docs/ci-workflows.md +1 -1
  120. package/docs/commands-reference.md +26 -0
  121. package/docs/contracts/ARTIFACT_CATALOG.md +37 -18
  122. package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +17 -0
  123. package/docs/contracts/PROOF_CARRYING_CHANGE_CONTRACT_PLAN.md +68 -0
  124. package/docs/proof-carrying-change.implementation.v1.json +119 -0
  125. package/docs/proof-carrying-change.md +236 -0
  126. package/docs/real-world-qualification.md +8 -3
  127. package/package.json +1 -1
  128. package/dist/analyze-JDEWUBC6.js +0 -1
  129. package/dist/autopilot-release-OELUFNLL.js +0 -1
  130. package/dist/capabilities-command-RAAYENQ6.js +0 -1
  131. package/dist/chunk-2KX6KHEC.js +0 -1
  132. package/dist/chunk-3KU3YUWD.js +0 -2
  133. package/dist/chunk-3NF3M3RE.js +0 -1
  134. package/dist/chunk-3OGPTLI2.js +0 -1
  135. package/dist/chunk-5ME4W4LN.js +0 -1
  136. package/dist/chunk-5XUAAQSV.js +0 -5
  137. package/dist/chunk-5YZ2W57R.js +0 -8
  138. package/dist/chunk-7DZNZ3GM.js +0 -3
  139. package/dist/chunk-BG6IX6HA.js +0 -1
  140. package/dist/chunk-BMAFHX6A.js +0 -1
  141. package/dist/chunk-BUYLM6QV.js +0 -1
  142. package/dist/chunk-C2VTO5WT.js +0 -2
  143. package/dist/chunk-CPR2CMOY.js +0 -1
  144. package/dist/chunk-CSZPE637.js +0 -2
  145. package/dist/chunk-EHLGPLIU.js +0 -1
  146. package/dist/chunk-FPDH3N3A.js +0 -7
  147. package/dist/chunk-GVQKAINC.js +0 -49
  148. package/dist/chunk-IKUFNK46.js +0 -2
  149. package/dist/chunk-JYMO7QXQ.js +0 -1
  150. package/dist/chunk-KY2GOSO5.js +0 -1
  151. package/dist/chunk-LEOFD3W5.js +0 -12
  152. package/dist/chunk-LPCZHKD5.js +0 -1
  153. package/dist/chunk-N5HPMATQ.js +0 -1
  154. package/dist/chunk-P3622IM5.js +0 -4
  155. package/dist/chunk-Q7UGDNSM.js +0 -1
  156. package/dist/chunk-RVAOJOXA.js +0 -2
  157. package/dist/chunk-TCLKGPXF.js +0 -2
  158. package/dist/chunk-VIN7NJW3.js +0 -9
  159. package/dist/chunk-W5VKBDSD.js +0 -157
  160. package/dist/chunk-WRZSQDZV.js +0 -1
  161. package/dist/chunk-Y4Z6CEII.js +0 -1
  162. package/dist/chunk-ZEEV5J4I.js +0 -1
  163. package/dist/chunk-ZGHJIQXL.js +0 -1
  164. package/dist/doctor-D7YI7LSA.js +0 -1
  165. package/dist/goal-lifecycle-BMS6GSIU.js +0 -1
  166. package/dist/goal-pack-RBSVQMMX.js +0 -1
  167. package/dist/pipeline-QOMXH2EK.js +0 -5
  168. package/dist/verified-goal-XUXU2X5H.js +0 -1
  169. package/dist/workspace-explain-DTFCKYXK.js +0 -1
  170. package/dist/workspace-explain-contract-WMREJWHF.js +0 -1
  171. package/dist/workspace-graph-token-efficiency-5LJKQU2J.js +0 -1
  172. package/dist/workspace-intelligence-runtime-registry-UKFB3BI7.js +0 -1
  173. package/dist/workspace-knowledge-graph-change-overlay-XG6FC4IX.js +0 -1
  174. package/dist/workspace-knowledge-graph-snapshot-GPBDAKAU.js +0 -1
  175. package/dist/workspace-mcp-serve-TDUXJUAA.js +0 -3
  176. package/dist/workspace-repair-engine-CKJCTWKX.js +0 -3
  177. package/dist/workspace-run-ZZ5WHL7W.js +0 -1
@@ -111,6 +111,19 @@
111
111
  "uniqueItems": true,
112
112
  "items": { "type": "string", "minLength": 1 }
113
113
  },
114
+ "changeTransactionId": {
115
+ "type": "string",
116
+ "pattern": "^change-[a-z0-9][a-z0-9-]{7,95}$"
117
+ },
118
+ "changeTransactionIds": {
119
+ "type": "array",
120
+ "maxItems": 25,
121
+ "uniqueItems": true,
122
+ "items": {
123
+ "type": "string",
124
+ "pattern": "^change-[a-z0-9][a-z0-9-]{7,95}$"
125
+ }
126
+ },
114
127
  "verificationReceipt": {
115
128
  "type": "object",
116
129
  "required": [
@@ -269,12 +269,13 @@
269
269
  },
270
270
  "commands": {
271
271
  "type": "object",
272
- "required": ["refreshEvidence", "inspectGraph", "proposeRepair"],
272
+ "required": ["refreshEvidence", "inspectGraph", "beginChange", "proposeRepair"],
273
273
  "properties": {
274
274
  "refreshEvidence": {
275
275
  "const": "workspai workspace intelligence run --for-agent generic --strict --json"
276
276
  },
277
277
  "inspectGraph": { "type": "string", "pattern": "^workspai workspace graph search " },
278
+ "beginChange": { "type": "string", "pattern": "^workspai change begin --goal [^ ]+ --json$" },
278
279
  "planVerifiedGoal": { "type": "string", "pattern": "^workspai workspace goal plan " },
279
280
  "proposeRepair": {
280
281
  "const": "workspai workspace repair propose --file <proposal.json> --json"
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workspai.dev/schemas/workspace-intelligence/predicted-architecture-change.v1.json",
4
+ "title": "Workspai Predicted Architecture Change",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "changeId", "goalId", "generatedAt", "baselineGeneration", "nonCanonical", "proofEligible", "operations", "assumptions", "predictedRisk"],
7
+ "properties": {
8
+ "schemaVersion": { "const": "workspai.predicted-architecture-change.v1" },
9
+ "changeId": { "type": "string", "pattern": "^change-[a-z0-9][a-z0-9-]{7,95}$" },
10
+ "goalId": { "type": "string", "minLength": 1 },
11
+ "generatedAt": { "type": "string", "format": "date-time" },
12
+ "baselineGeneration": { "$ref": "decision-event.v1.json#/$defs/sha256" },
13
+ "nonCanonical": { "const": true },
14
+ "proofEligible": { "const": false },
15
+ "operations": {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "object",
19
+ "required": ["operation", "targetKind", "targetId", "rationale", "confidence"],
20
+ "properties": {
21
+ "operation": { "enum": ["add", "remove", "change"] },
22
+ "targetKind": { "enum": ["entity", "relation", "proof", "artifact"] },
23
+ "targetId": { "type": "string", "minLength": 1 },
24
+ "rationale": { "type": "string", "minLength": 1 },
25
+ "confidence": { "enum": ["high", "medium", "low"] }
26
+ },
27
+ "additionalProperties": false
28
+ }
29
+ },
30
+ "assumptions": { "type": "array", "items": { "type": "string" } },
31
+ "predictedRisk": { "enum": ["none", "low", "medium", "high"] }
32
+ },
33
+ "additionalProperties": false
34
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workspai.dev/schemas/workspace-intelligence/proof-carrying-change-capsule-export.v1.json",
4
+ "title": "Workspai Proof-Carrying Change Capsule Export",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "changeId", "outputPath", "validation"],
7
+ "properties": {
8
+ "schemaVersion": { "const": "workspai.proof-carrying-change-capsule-export.v1" },
9
+ "changeId": { "type": "string", "pattern": "^change-[a-z0-9][a-z0-9-]{7,95}$" },
10
+ "outputPath": { "type": "string", "minLength": 1 },
11
+ "validation": { "$ref": "proof-carrying-change-capsule-validation.v1.json" }
12
+ },
13
+ "additionalProperties": false
14
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workspai.dev/schemas/workspace-intelligence/proof-carrying-change-capsule-validation.v1.json",
4
+ "title": "Workspai Proof-Carrying Change Capsule Validation",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "changeId", "validatedAt", "valid", "errors", "capsule"],
7
+ "properties": {
8
+ "schemaVersion": { "const": "workspai.proof-carrying-change-capsule-validation.v1" },
9
+ "changeId": { "type": "string", "pattern": "^change-[a-z0-9][a-z0-9-]{7,95}$" },
10
+ "validatedAt": { "type": "string", "format": "date-time" },
11
+ "valid": { "type": "boolean" },
12
+ "errors": { "type": "array", "items": { "type": "string", "minLength": 1 } },
13
+ "capsule": { "$ref": "proof-carrying-change-capsule.v1.json" }
14
+ },
15
+ "additionalProperties": false
16
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workspai.dev/schemas/workspace-intelligence/proof-carrying-change-capsule.v1.json",
4
+ "title": "Workspai Proof-Carrying Change Capsule",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "changeId", "goalId", "generatedAt", "status", "workspace", "scope", "decision", "intent", "baseline", "prediction", "actualOverlay", "surpriseReport", "effects", "verification", "assurances", "remainingUncertainty", "integrity"],
7
+ "properties": {
8
+ "schemaVersion": { "const": "workspai.proof-carrying-change-capsule.v1" },
9
+ "changeId": { "type": "string", "pattern": "^change-[a-z0-9][a-z0-9-]{7,95}$" },
10
+ "goalId": { "type": "string", "minLength": 1 },
11
+ "generatedAt": { "type": "string", "format": "date-time" },
12
+ "status": { "enum": ["open", "blocked", "verified", "sealed", "aborted"] },
13
+ "workspace": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string", "minLength": 1 } }, "additionalProperties": false },
14
+ "scope": { "$ref": "decision-event.v1.json#/$defs/scope" },
15
+ "decision": {
16
+ "type": "object",
17
+ "required": ["transaction", "eventHeadDigest", "effectHeadDigest", "state", "generation"],
18
+ "properties": {
19
+ "transaction": { "$ref": "decision-event.v1.json#/$defs/artifactReference" },
20
+ "eventHeadDigest": { "$ref": "decision-event.v1.json#/$defs/sha256" },
21
+ "effectHeadDigest": { "$ref": "decision-event.v1.json#/$defs/sha256" },
22
+ "state": { "type": "string", "minLength": 1 },
23
+ "generation": { "type": "integer", "minimum": 1 }
24
+ },
25
+ "additionalProperties": false
26
+ },
27
+ "intent": { "$ref": "decision-event.v1.json#/$defs/artifactReference" },
28
+ "baseline": { "$ref": "architecture-change-lease.v1.json#/properties/baseline" },
29
+ "prediction": { "oneOf": [{ "$ref": "decision-event.v1.json#/$defs/artifactReference" }, { "type": "null" }] },
30
+ "actualOverlay": { "oneOf": [{ "$ref": "decision-event.v1.json#/$defs/artifactReference" }, { "type": "null" }] },
31
+ "surpriseReport": { "oneOf": [{ "$ref": "decision-event.v1.json#/$defs/artifactReference" }, { "type": "null" }] },
32
+ "effects": { "type": "array", "items": { "$ref": "decision-event.v1.json#/$defs/artifactReference" } },
33
+ "deletedArtifacts": { "type": "array", "items": { "$ref": "decision-event.v1.json#/$defs/deletedArtifactReference" }, "uniqueItems": true },
34
+ "verification": { "type": "array", "items": { "$ref": "decision-event.v1.json#/$defs/artifactReference" } },
35
+ "assurances": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "object",
39
+ "required": ["id", "status", "summary"],
40
+ "properties": {
41
+ "id": { "enum": ["intent-bound", "baseline-pinned", "effects-receipted", "architecture-reobserved", "independently-verified"] },
42
+ "status": { "enum": ["passed", "failed", "pending"] },
43
+ "summary": { "type": "string", "minLength": 1 }
44
+ },
45
+ "additionalProperties": false
46
+ },
47
+ "minItems": 5,
48
+ "maxItems": 5
49
+ },
50
+ "remainingUncertainty": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
51
+ "integrity": {
52
+ "type": "object",
53
+ "required": ["algorithm", "semantics", "capsuleDigest"],
54
+ "properties": {
55
+ "algorithm": { "const": "sha256" },
56
+ "semantics": { "const": "canonical-json-v1" },
57
+ "capsuleDigest": { "$ref": "decision-event.v1.json#/$defs/sha256" }
58
+ },
59
+ "additionalProperties": false
60
+ }
61
+ },
62
+ "additionalProperties": false
63
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workspai.dev/schemas/workspace-intelligence/proof-carrying-change-list.v1.json",
4
+ "title": "Workspai Proof-Carrying Change List",
5
+ "type": "object",
6
+ "required": ["schemaVersion", "generatedAt", "workspace", "changes", "summary"],
7
+ "properties": {
8
+ "schemaVersion": { "const": "workspai.proof-carrying-change-list.v1" },
9
+ "generatedAt": { "type": "string", "format": "date-time" },
10
+ "workspace": {
11
+ "type": "object",
12
+ "required": ["name"],
13
+ "properties": { "name": { "type": "string", "minLength": 1 } },
14
+ "additionalProperties": false
15
+ },
16
+ "changes": {
17
+ "type": "array",
18
+ "items": {
19
+ "type": "object",
20
+ "required": [
21
+ "changeId",
22
+ "goalId",
23
+ "state",
24
+ "status",
25
+ "createdAt",
26
+ "updatedAt",
27
+ "scope",
28
+ "assurance",
29
+ "blockers",
30
+ "capsuleArtifact",
31
+ "valid",
32
+ "errors"
33
+ ],
34
+ "properties": {
35
+ "changeId": { "type": "string", "pattern": "^change-[a-z0-9][a-z0-9-]{7,95}$" },
36
+ "goalId": { "type": ["string", "null"] },
37
+ "state": { "type": ["string", "null"] },
38
+ "status": { "enum": ["open", "blocked", "verified", "sealed", "aborted", "invalid"] },
39
+ "createdAt": {
40
+ "oneOf": [{ "type": "string", "format": "date-time" }, { "type": "null" }]
41
+ },
42
+ "updatedAt": {
43
+ "oneOf": [{ "type": "string", "format": "date-time" }, { "type": "null" }]
44
+ },
45
+ "scope": {
46
+ "oneOf": [{ "$ref": "decision-event.v1.json#/$defs/scope" }, { "type": "null" }]
47
+ },
48
+ "assurance": {
49
+ "type": "object",
50
+ "required": ["passed", "total"],
51
+ "properties": {
52
+ "passed": { "type": "integer", "minimum": 0 },
53
+ "total": { "type": "integer", "minimum": 0 }
54
+ },
55
+ "additionalProperties": false
56
+ },
57
+ "blockers": { "type": "array", "items": { "type": "string" } },
58
+ "capsuleArtifact": { "type": "string", "minLength": 1 },
59
+ "valid": { "type": "boolean" },
60
+ "errors": { "type": "array", "items": { "type": "string", "minLength": 1 } }
61
+ },
62
+ "additionalProperties": false
63
+ }
64
+ },
65
+ "summary": {
66
+ "type": "object",
67
+ "required": ["total", "open", "blocked", "sealed", "aborted", "invalid"],
68
+ "properties": {
69
+ "total": { "type": "integer", "minimum": 0 },
70
+ "open": { "type": "integer", "minimum": 0 },
71
+ "blocked": { "type": "integer", "minimum": 0 },
72
+ "sealed": { "type": "integer", "minimum": 0 },
73
+ "aborted": { "type": "integer", "minimum": 0 },
74
+ "invalid": { "type": "integer", "minimum": 0 }
75
+ },
76
+ "additionalProperties": false
77
+ }
78
+ },
79
+ "additionalProperties": false
80
+ }
@@ -35,6 +35,7 @@
35
35
  "allOf": [
36
36
  { "$ref": "#/$defs/changeSet" },
37
37
  {
38
+ "type": "object",
38
39
  "properties": {
39
40
  "added": {
40
41
  "type": "array",
@@ -53,6 +54,7 @@
53
54
  "allOf": [
54
55
  { "$ref": "#/$defs/changeSet" },
55
56
  {
57
+ "type": "object",
56
58
  "properties": {
57
59
  "added": {
58
60
  "type": "array",
@@ -71,6 +73,7 @@
71
73
  "allOf": [
72
74
  { "$ref": "#/$defs/changeSet" },
73
75
  {
76
+ "type": "object",
74
77
  "properties": {
75
78
  "added": {
76
79
  "type": "array",
@@ -145,7 +148,12 @@
145
148
  },
146
149
  "changeSet": {
147
150
  "type": "object",
148
- "required": ["added", "removed", "changed"]
151
+ "required": ["added", "removed", "changed"],
152
+ "properties": {
153
+ "added": {},
154
+ "removed": {},
155
+ "changed": {}
156
+ }
149
157
  },
150
158
  "entityChange": {
151
159
  "type": "object",
@@ -0,0 +1 @@
1
+ export{b as printAnalyzeReport,a as runAnalyze}from'./chunk-WUXJCSYO.js';
@@ -1 +1 @@
1
- export{a as buildArtifactRemediationPlan,b as writeArtifactRemediationPlan}from'./chunk-7DZNZ3GM.js';
1
+ export{a as buildArtifactRemediationPlan,b as writeArtifactRemediationPlan}from'./chunk-IRLKWRLP.js';
@@ -0,0 +1 @@
1
+ export{b as AUTOPILOT_RELEASE_ALIAS_FILENAME,a as AUTOPILOT_RELEASE_LAST_RUN_FILENAME,c as runAutopilotRelease}from'./chunk-UT57IFS4.js';
@@ -0,0 +1 @@
1
+ export{b as runDoctorCapabilities}from'./chunk-JK6XEF7K.js';
@@ -0,0 +1 @@
1
+ import {f,h as h$1}from'./chunk-FE5R6EUV.js';import {t,s}from'./chunk-ODK4LCEL.js';import {t as t$1}from'./chunk-VQZ5PI5J.js';import u from'fs';import A from'path';var a=s.workspaceRunLast.schemaVersion,W="workspace-run-last.json",o=t.workspaceRunLast;var P=new Set(["init","test","build","start"]);function _(e){return P.has(e)}async function d(e){try{return await u.promises.access(e,u.constants.F_OK),true}catch{return false}}async function w(e){try{let r=await u.promises.readFile(e,"utf-8");return JSON.parse(r)}catch{return null}}function m(e){return !e||typeof e!="object"||Array.isArray(e)?null:e}function h(e){let r=e.stage;return typeof r!="string"||r.trim().length===0||!Array.isArray(e.projects)?false:_(r)||/^[a-z][a-z0-9_-]*$/i.test(r)}function T(e){let r=m(e);return !r||r.schemaVersion===a?false:h(r)}function C(e){let r=m(e);return r?r.schemaVersion===a&&r.stages!=null:false}function p(e){if(C(e))return e;if(T(e)){let r=e.stage;return {schemaVersion:a,generatedAt:e.generatedAt,workspacePath:e.workspacePath,latestStage:r,stages:{[r]:e},enterpriseControls:e.enterpriseControls??{jsonReady:true,evidencePath:o}}}return null}function U(e,r){let n=p(e);if(!n)return null;let t=r??n.latestStage;return n.stages[t]??null}async function V(e){let r=(await Promise.all(t$1(A.resolve(e),"reports",W).map(async t=>await d(t)?t:null))).find(t=>typeof t=="string");if(!r)return null;let n=await w(r);return p(n)}async function j(e,r){let n=A.resolve(e);return f(n,o,async()=>{let t=(await Promise.all(t$1(n,"reports",W).map(async s=>await d(s)?s:null))).find(s=>typeof s=="string"),R=t?await w(t):null,i=p(R);if(t&&!i)throw new Error(`Workspace run evidence is unreadable or invalid; refusing to overwrite: ${t}`);let l=i?{...i.stages}:{};l[r.stage]=r;let g={schemaVersion:a,generatedAt:r.generatedAt,workspacePath:r.workspacePath,latestStage:r.stage,stages:l,enterpriseControls:{jsonReady:true,evidencePath:o}};return await h$1(n,o,g),g})}export{W as a,o as b,U as c,V as d,j as e};
@@ -1,4 +1,4 @@
1
- import {l,f,e as e$2,g as g$1}from'./chunk-IXXQMD34.js';import {b as b$4}from'./chunk-5OV2WXAR.js';import {b as b$7,a as a$3}from'./chunk-D5LLTUTY.js';import {b as b$2}from'./chunk-B6FJ6RG6.js';import {a as a$2}from'./chunk-Q7UGDNSM.js';import {e,g,h as h$1,c as c$1,i as i$1,f as f$1,b as b$6,d as d$4}from'./chunk-46QH3ZVI.js';import {g as g$2}from'./chunk-TCLKGPXF.js';import {d as d$1,b as b$1}from'./chunk-2LIVMG5C.js';import {h,e as e$1,b as b$3,d as d$2}from'./chunk-PKKSRXUS.js';import {a}from'./chunk-TQEMLBAG.js';import {i,b as b$5,k as k$1,j,m,t,s as s$1,q}from'./chunk-RGNCL5OB.js';import {b,a as a$1,c,d as d$3}from'./chunk-VQZ5PI5J.js';import {promises}from'fs';import*as k from'fs-extra';import d from'path';import s from'chalk';import {execa}from'execa';function ct(e){let n=e.projectCount??0,t=n===1?"project":"projects",o=e.pythonEngine==="installed"?`Python ${e.pythonVersion||"3.10+"} \xB7 ${e.installMethod||"local environment"}`:e.pythonEngine==="skipped"?"Python engine not installed":"Runtime-neutral foundation";return ["","\u2713 Workspace ready",`${e.workspaceName} \xB7 ${e.profile} \xB7 ${n} registered ${t}`,`Location ${e.workspacePath}`,`Runtime ${o}`,...e.note?[`Note ${e.note}`]:[],"","Workspace Intelligence"," \u2713 Contract and project registry"," \u2713 Canonical model and proof-backed graph"," \u2713 Agent context, grounding, and evidence index","","Next",` ${g$1(e.workspacePath)}`," npx workspai create"," npx workspai workspace intelligence run --for-agent generic --strict --json","","Evidence .workspai/reports/INDEX.json","Guide README.md",""]}function B(e){let n=ct(e);for(let t of n)t==="\u2713 Workspace ready"?console.log(s.green.bold(t)):t==="Workspace Intelligence"||t==="Next"?console.log(s.cyan.bold(t)):t.startsWith(" \u2713")?console.log(s.green(t)):t.startsWith("Location")||t.startsWith("Runtime")?console.log(s.gray(t)):console.log(t);}function T(){return i()}var pt="transactions";function dt(){return d.join(q(),pt)}async function He(){let e=dt();return await b$7(e),a$3({journalDirectory:e})}async function Ue(e){for(let n of s$1())await e.captureFile(n);}async function se(e){let n=await He();try{return await Ue(n),await n.captureOwnedTree(e),n}catch(t){return F(n,t)}}async function ut(e){let n=await He();try{await Ue(n),await n.captureOwnedTree(d.join(e,a$1)),await n.captureOwnedTree(d.join(e,".venv"));let t=[c,".gitignore",d.join(a$1,"workspace.json"),d.join(a$1,"toolchain.lock"),d.join(a$1,"policies.yml"),d.join(a$1,"cache-config.yml"),g$2,a$2,"pyproject.toml","poetry.toml","poetry.lock","rapidkit","rapidkit.cmd","README.md",".rapidkit-global"];for(let o of t)await n.captureFile(d.join(e,o));return n}catch(t){return F(n,t)}}async function J(e){await e.commit(),e.journalPath&&await promises.rm(d.dirname(e.journalPath),{recursive:true,force:true}).catch(n=>e$1.debug(`Could not remove committed lifecycle journal: ${n}`));}async function F(e,n){try{await e.rollback();}catch(t){throw new AggregateError([n,t],"Workspace lifecycle failed and rollback was incomplete.")}throw n}async function Q(e,n,t,o,a){let l=d$1(n,h(),t,a?.pythonEngine?{coreStatus:a.pythonEngine,...a.pythonEngineReason?{coreReason:a.pythonEngineReason}:{},...o?{pythonVersion:o}:{}}:void 0);o&&!a?.pythonEngine&&(l.metadata||(l.metadata={}),l.metadata.python={pythonVersion:o}),await b$1(e,l);}async function H(e){await k.outputFile(d.join(e,".gitignore"),`.venv/
1
+ import {l,f,e as e$2,g as g$1}from'./chunk-TLMP2MGH.js';import {b as b$4}from'./chunk-IFHM2SI6.js';import {b as b$7,a as a$3}from'./chunk-D5LLTUTY.js';import {b as b$2}from'./chunk-B6FJ6RG6.js';import {a as a$2}from'./chunk-EP6Q2QBU.js';import {e,g,h as h$1,c as c$1,i as i$1,f as f$1,b as b$6,d as d$4}from'./chunk-46QH3ZVI.js';import {g as g$2}from'./chunk-PTSEDZIV.js';import {d as d$1,b as b$1}from'./chunk-2LIVMG5C.js';import {h,e as e$1,b as b$3,d as d$2}from'./chunk-PKKSRXUS.js';import {a}from'./chunk-TQEMLBAG.js';import {i,b as b$5,k as k$1,j,m,t,s as s$1,q}from'./chunk-RGNCL5OB.js';import {b,a as a$1,c,d as d$3}from'./chunk-VQZ5PI5J.js';import {promises}from'fs';import*as k from'fs-extra';import d from'path';import s from'chalk';import {execa}from'execa';function ct(e){let n=e.projectCount??0,t=n===1?"project":"projects",o=e.pythonEngine==="installed"?`Python ${e.pythonVersion||"3.10+"} \xB7 ${e.installMethod||"local environment"}`:e.pythonEngine==="skipped"?"Python engine not installed":"Runtime-neutral foundation";return ["","\u2713 Workspace ready",`${e.workspaceName} \xB7 ${e.profile} \xB7 ${n} registered ${t}`,`Location ${e.workspacePath}`,`Runtime ${o}`,...e.note?[`Note ${e.note}`]:[],"","Workspace Intelligence"," \u2713 Contract and project registry"," \u2713 Canonical model and proof-backed graph"," \u2713 Agent context, grounding, and evidence index","","Next",` ${g$1(e.workspacePath)}`," npx workspai create"," npx workspai workspace intelligence run --for-agent generic --strict --json","","Evidence .workspai/reports/INDEX.json","Guide README.md",""]}function B(e){let n=ct(e);for(let t of n)t==="\u2713 Workspace ready"?console.log(s.green.bold(t)):t==="Workspace Intelligence"||t==="Next"?console.log(s.cyan.bold(t)):t.startsWith(" \u2713")?console.log(s.green(t)):t.startsWith("Location")||t.startsWith("Runtime")?console.log(s.gray(t)):console.log(t);}function T(){return i()}var pt="transactions";function dt(){return d.join(q(),pt)}async function He(){let e=dt();return await b$7(e),a$3({journalDirectory:e})}async function Ue(e){for(let n of s$1())await e.captureFile(n);}async function se(e){let n=await He();try{return await Ue(n),await n.captureOwnedTree(e),n}catch(t){return F(n,t)}}async function ut(e){let n=await He();try{await Ue(n),await n.captureOwnedTree(d.join(e,a$1)),await n.captureOwnedTree(d.join(e,".venv"));let t=[c,".gitignore",d.join(a$1,"workspace.json"),d.join(a$1,"toolchain.lock"),d.join(a$1,"policies.yml"),d.join(a$1,"cache-config.yml"),g$2,a$2,"pyproject.toml","poetry.toml","poetry.lock","rapidkit","rapidkit.cmd","README.md",".rapidkit-global"];for(let o of t)await n.captureFile(d.join(e,o));return n}catch(t){return F(n,t)}}async function J(e){await e.commit(),e.journalPath&&await promises.rm(d.dirname(e.journalPath),{recursive:true,force:true}).catch(n=>e$1.debug(`Could not remove committed lifecycle journal: ${n}`));}async function F(e,n){try{await e.rollback();}catch(t){throw new AggregateError([n,t],"Workspace lifecycle failed and rollback was incomplete.")}throw n}async function Q(e,n,t,o,a){let l=d$1(n,h(),t,a?.pythonEngine?{coreStatus:a.pythonEngine,...a.pythonEngineReason?{coreReason:a.pythonEngineReason}:{},...o?{pythonVersion:o}:{}}:void 0);o&&!a?.pythonEngine&&(l.metadata||(l.metadata={}),l.metadata.python={pythonVersion:o}),await b$1(e,l);}async function H(e){await k.outputFile(d.join(e,".gitignore"),`.venv/
2
2
  __pycache__/
3
3
  *.pyc
4
4
  .env
@@ -1,4 +1,4 @@
1
- import {a}from'./chunk-GR6442P7.js';import {a as a$1}from'./chunk-AFIFZTOY.js';import {i}from'./chunk-ZGHJIQXL.js';import {k as k$1,t,q as q$1,w}from'./chunk-VQZ5PI5J.js';import z from'crypto';import Y from'os';import l from'path';import {once}from'events';import {createWriteStream,createReadStream}from'fs';import*as Q from'readline';import {Transform,Readable}from'stream';import {pipeline}from'stream/promises';import {lookup}from'dns/promises';import T from'net';import p from'fs-extra';import*as ee from'yauzl';import*as te from'yazl';var qe="workspai-workspace-archive-capabilities-v1",q="workspai-workspace-archive-manifest-v1",k="workspai-workspace-archive-operation-result-v1";var K="contracts/workspace-archive-manifest.v1.json",Z="contracts/workspace-archive-operation-result.v1.json",Ke={archiveCompression:{signature:"--archive-compression <mode>",description:"Archive compression: store (default) or deflate",appliesTo:["export"]},maxDownloadSize:{signature:"--max-download-size <size>",description:"Maximum remote archive download size (secure default: 5gb)",appliesTo:["inspect","verify","doctor","hydrate","import"]},maxExpandedSize:{signature:"--max-expanded-size <size>",description:"Maximum expanded archive payload size (secure default: 20gb)",appliesTo:["inspect","verify","doctor","hydrate","import"]},downloadTimeoutMs:{signature:"--download-timeout-ms <ms>",description:"Remote archive download timeout in milliseconds; 0 disables it",appliesTo:["inspect","verify","doctor","hydrate","import"]},allowPrivateNetwork:{signature:"--allow-private-network",description:"Allow archive downloads from loopback/private networks (unsafe for untrusted input)",appliesTo:["inspect","verify","doctor","hydrate","import"]}};var A=".workspai/archive-manifest.json",R=".rapidkit/archive-manifest.json",de="workspai.workspace.archive",ye=300*1e3,ve=5*1024*1024*1024,we=20*1024*1024*1024,J=2e5,ge=5*1024*1024*1024,ke=1e3,M=5,Ee=64*1024*1024;function Ae(r){let t=r.toLowerCase().split("%")[0];if(T.isIPv4(t)){let e=t.split(".").map(Number);return e[0]===0||e[0]===10||e[0]===127||e[0]===169&&e[1]===254||e[0]===172&&e[1]>=16&&e[1]<=31||e[0]===192&&e[1]===168||e[0]===100&&e[1]>=64&&e[1]<=127||e[0]>=224}return T.isIPv6(t)?t==="::"||t==="::1"||t.startsWith("fc")||t.startsWith("fd")||/^fe[89ab]/.test(t)||t.startsWith("ff")||t.startsWith("::ffff:127.")||t.startsWith("::ffff:10.")||t.startsWith("::ffff:192.168."):true}async function X(r,t){let e=new URL(r);if(e.protocol!=="https:"&&e.protocol!=="http:")throw new Error(`Workspace archive URL protocol is not supported: ${e.protocol}`);if(e.protocol!=="https:"&&!t)throw new Error("Remote workspace archives require HTTPS unless private-network access is explicitly enabled.");if(e.username||e.password)throw new Error("Workspace archive URL must not contain embedded credentials.");if(t)return e;let i=e.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(i==="localhost"||i.endsWith(".localhost"))throw new Error("Workspace archive URL resolves to a private or local network address.");let a=T.isIP(i)?[{address:i}]:await lookup(i,{all:true,verbatim:true});if(a.length===0||a.some(({address:s})=>Ae(s)))throw new Error("Workspace archive URL resolves to a private or local network address.");return e}async function Pe(r,t,e){let i=await X(r,e);for(let a=0;a<=M;a+=1){let s=await fetch(i,{signal:t,redirect:"manual",credentials:"omit"});if(![301,302,303,307,308].includes(s.status))return s;let n=s.headers.get("location");if(await s.body?.cancel(),!n)throw new Error("Workspace archive redirect is missing a Location header.");if(a===M)throw new Error(`Workspace archive download exceeded ${M} redirects.`);i=await X(new URL(n,i).href,e);}throw new Error("Workspace archive redirect policy failed.")}var We=new Set(["__pycache__",".venv","venv","node_modules",".git","dist","build","target",".pytest_cache",".mypy_cache",".ruff_cache","htmlcov",".next",".turbo",".cache"]),be=new Set([".DS_Store","Thumbs.db",".coverage","npm-debug.log","yarn-error.log","pnpm-debug.log","workspace-link.local.json","imported-projects.json","workspace-registry.v1.json"]),Se=[/^\.env$/i,/^\.env\.(?!example$|sample$|template$).+/i,/^.*\.pem$/i,/^.*\.key$/i,/^id_rsa$/i,/^id_ed25519$/i];function _(r){return r.replace(/\\/g,"/")}function re(r){return r.trim().replace(/\.workspai-archive\.zip$/i,"").replace(/\.rapidkit-archive\.zip$/i,"").replace(/\.zip$/i,"").trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^[-_.]+|[-_.]+$/g,"").slice(0,64)||"imported-workspace"}function ie(r){let t=_(r).trim();if(!t||t.startsWith("/")||t.startsWith("~")||/^[a-zA-Z]:\//.test(t)||t.includes("\0"))return false;let e=t.split("/").filter(Boolean);return e.length>0&&!e.some(i=>i===".."||i===".")}function ae(r){if(!ie(r))throw new Error(`Archive contains an unsafe path: ${r}`)}function Re(r,t){let e=l.relative(t,r);return e===""||!!e&&!e.startsWith("..")&&!l.isAbsolute(e)}function _e(r,t){let e=_(r),i$1=e.split("/").filter(Boolean);if(i$1.some((n,o)=>(n===".workspai"||n===".rapidkit")&&["cache","reports"].includes(i$1[o+1]||""))||i$1.some(n=>We.has(n)||a(n)))return true;let s=i$1[i$1.length-1]||"";return e===i.workspaceContract||e===".rapidkit/workspace.contract.json"||be.has(s)||/\.(?:workspai|rapidkit)-archive\.zip$/i.test(s)||!t?.includeEnv&&Se.some(n=>n.test(s))?true:s.endsWith(".pyc")||s.endsWith(".log")}async function Ce(r){for(let t of [l.join(r,".workspai","workspace.contract.json"),l.join(r,".rapidkit","workspace.contract.json")])if(await p.pathExists(t))try{return await p.readJson(t)}catch(e){throw new Error(`Workspace contract could not be inspected safely for archive portability: ${t}: ${e instanceof Error?e.message:String(e)}`)}return null}function xe(r){return (r?.projects??[]).filter(t=>typeof t.externalPath=="string"||typeof t.relativePath=="string"&&t.relativePath.startsWith("external/")).map(t=>({name:t.slug||t.relativePath||"external-project",relationship:["adopted","linked","imported","managed","restored"].includes(String(t.relationship))?t.relationship:"adopted",included:false,requiredAction:"relink"})).sort((t,e)=>t.name.localeCompare(e.name))}function Oe(r){if(r)return {...r,workspace:{...r.workspace},projects:r.projects.filter(t=>typeof t.externalPath!="string"&&!t.relativePath.startsWith("external/")).map(({externalPath:t,...e})=>({...e,modules:[...e.modules],ports:e.ports.map(i=>({...i})),contracts:{owns:[...e.contracts.owns],apis:e.contracts.apis.map(i=>({...i})),publishes:[...e.contracts.publishes],consumes:[...e.contracts.consumes],dependsOn:[...e.contracts.dependsOn],env:[...e.contracts.env]}}))}}async function*se(r,t,e){let i=(await p.readdir(t,{withFileTypes:true})).sort((a,s)=>a.name.localeCompare(s.name));for(let a of i){let s=l.join(t,a.name),n=_(l.relative(r,s));if(!(!n||_e(n,e))){if(a.isDirectory()){yield*se(r,s,e);continue}a.isFile()&&(yield {relativePath:n,fullPath:s});}}}async function ze(r){for(let t$1 of t(r,"workspace.json"))try{let e=await p.readJson(t$1);if(typeof e.workspace_name=="string"&&e.workspace_name.trim())return e.workspace_name.trim();if(typeof e.name=="string"&&e.name.trim())return e.name.trim()}catch{}return l.basename(l.resolve(r))}async function Ne(r){let t=await p.stat(r.fullPath),e=z.createHash("sha256"),i=0;for await(let s of createReadStream(r.fullPath)){let n=Buffer.isBuffer(s)?s:Buffer.from(s);i+=n.length,e.update(n);}let a=await p.stat(r.fullPath);if(t.size!==a.size||t.mtimeMs!==a.mtimeMs||i!==a.size)throw new Error(`Workspace file changed while preparing archive: ${r.relativePath}`);return {...r,size:i,mtimeMs:a.mtimeMs,sha256:e.digest("hex")}}async function E(r,t){r.write(t)||await once(r,"drain");}async function ne(r){await new Promise((t,e)=>{r.once("error",e),r.end(t);});}async function*O(r){let t=Q.createInterface({input:createReadStream(r),crlfDelay:1/0});for await(let e of t){let i=e.trim();i&&(yield JSON.parse(i));}}async function Me(r){let t=createWriteStream(r.manifestPath,{flags:"wx"});try{await E(t,`{
1
+ import {a}from'./chunk-GR6442P7.js';import {a as a$1}from'./chunk-AFIFZTOY.js';import {t}from'./chunk-ODK4LCEL.js';import {k as k$1,t as t$1,q as q$1,w}from'./chunk-VQZ5PI5J.js';import z from'crypto';import Y from'os';import l from'path';import {once}from'events';import {createWriteStream,createReadStream}from'fs';import*as Q from'readline';import {Transform,Readable}from'stream';import {pipeline}from'stream/promises';import {lookup}from'dns/promises';import T from'net';import p from'fs-extra';import*as ee from'yauzl';import*as te from'yazl';var qe="workspai-workspace-archive-capabilities-v1",q="workspai-workspace-archive-manifest-v1",k="workspai-workspace-archive-operation-result-v1";var K="contracts/workspace-archive-manifest.v1.json",Z="contracts/workspace-archive-operation-result.v1.json",Ke={archiveCompression:{signature:"--archive-compression <mode>",description:"Archive compression: store (default) or deflate",appliesTo:["export"]},maxDownloadSize:{signature:"--max-download-size <size>",description:"Maximum remote archive download size (secure default: 5gb)",appliesTo:["inspect","verify","doctor","hydrate","import"]},maxExpandedSize:{signature:"--max-expanded-size <size>",description:"Maximum expanded archive payload size (secure default: 20gb)",appliesTo:["inspect","verify","doctor","hydrate","import"]},downloadTimeoutMs:{signature:"--download-timeout-ms <ms>",description:"Remote archive download timeout in milliseconds; 0 disables it",appliesTo:["inspect","verify","doctor","hydrate","import"]},allowPrivateNetwork:{signature:"--allow-private-network",description:"Allow archive downloads from loopback/private networks (unsafe for untrusted input)",appliesTo:["inspect","verify","doctor","hydrate","import"]}};var A=".workspai/archive-manifest.json",R=".rapidkit/archive-manifest.json",de="workspai.workspace.archive",ye=300*1e3,ve=5*1024*1024*1024,we=20*1024*1024*1024,J=2e5,ge=5*1024*1024*1024,ke=1e3,M=5,Ee=64*1024*1024;function Ae(r){let t=r.toLowerCase().split("%")[0];if(T.isIPv4(t)){let e=t.split(".").map(Number);return e[0]===0||e[0]===10||e[0]===127||e[0]===169&&e[1]===254||e[0]===172&&e[1]>=16&&e[1]<=31||e[0]===192&&e[1]===168||e[0]===100&&e[1]>=64&&e[1]<=127||e[0]>=224}return T.isIPv6(t)?t==="::"||t==="::1"||t.startsWith("fc")||t.startsWith("fd")||/^fe[89ab]/.test(t)||t.startsWith("ff")||t.startsWith("::ffff:127.")||t.startsWith("::ffff:10.")||t.startsWith("::ffff:192.168."):true}async function X(r,t){let e=new URL(r);if(e.protocol!=="https:"&&e.protocol!=="http:")throw new Error(`Workspace archive URL protocol is not supported: ${e.protocol}`);if(e.protocol!=="https:"&&!t)throw new Error("Remote workspace archives require HTTPS unless private-network access is explicitly enabled.");if(e.username||e.password)throw new Error("Workspace archive URL must not contain embedded credentials.");if(t)return e;let i=e.hostname.replace(/^\[|\]$/g,"").toLowerCase();if(i==="localhost"||i.endsWith(".localhost"))throw new Error("Workspace archive URL resolves to a private or local network address.");let a=T.isIP(i)?[{address:i}]:await lookup(i,{all:true,verbatim:true});if(a.length===0||a.some(({address:s})=>Ae(s)))throw new Error("Workspace archive URL resolves to a private or local network address.");return e}async function Pe(r,t,e){let i=await X(r,e);for(let a=0;a<=M;a+=1){let s=await fetch(i,{signal:t,redirect:"manual",credentials:"omit"});if(![301,302,303,307,308].includes(s.status))return s;let n=s.headers.get("location");if(await s.body?.cancel(),!n)throw new Error("Workspace archive redirect is missing a Location header.");if(a===M)throw new Error(`Workspace archive download exceeded ${M} redirects.`);i=await X(new URL(n,i).href,e);}throw new Error("Workspace archive redirect policy failed.")}var We=new Set(["__pycache__",".venv","venv","node_modules",".git","dist","build","target",".pytest_cache",".mypy_cache",".ruff_cache","htmlcov",".next",".turbo",".cache"]),be=new Set([".DS_Store","Thumbs.db",".coverage","npm-debug.log","yarn-error.log","pnpm-debug.log","workspace-link.local.json","imported-projects.json","workspace-registry.v1.json"]),Se=[/^\.env$/i,/^\.env\.(?!example$|sample$|template$).+/i,/^.*\.pem$/i,/^.*\.key$/i,/^id_rsa$/i,/^id_ed25519$/i];function _(r){return r.replace(/\\/g,"/")}function re(r){return r.trim().replace(/\.workspai-archive\.zip$/i,"").replace(/\.rapidkit-archive\.zip$/i,"").replace(/\.zip$/i,"").trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/-+/g,"-").replace(/^[-_.]+|[-_.]+$/g,"").slice(0,64)||"imported-workspace"}function ie(r){let t=_(r).trim();if(!t||t.startsWith("/")||t.startsWith("~")||/^[a-zA-Z]:\//.test(t)||t.includes("\0"))return false;let e=t.split("/").filter(Boolean);return e.length>0&&!e.some(i=>i===".."||i===".")}function ae(r){if(!ie(r))throw new Error(`Archive contains an unsafe path: ${r}`)}function Re(r,t){let e=l.relative(t,r);return e===""||!!e&&!e.startsWith("..")&&!l.isAbsolute(e)}function _e(r,t$1){let e=_(r),i=e.split("/").filter(Boolean);if(i.some((n,o)=>(n===".workspai"||n===".rapidkit")&&["cache","reports"].includes(i[o+1]||""))||i.some(n=>We.has(n)||a(n)))return true;let s=i[i.length-1]||"";return e===t.workspaceContract||e===".rapidkit/workspace.contract.json"||be.has(s)||/\.(?:workspai|rapidkit)-archive\.zip$/i.test(s)||!t$1?.includeEnv&&Se.some(n=>n.test(s))?true:s.endsWith(".pyc")||s.endsWith(".log")}async function Ce(r){for(let t of [l.join(r,".workspai","workspace.contract.json"),l.join(r,".rapidkit","workspace.contract.json")])if(await p.pathExists(t))try{return await p.readJson(t)}catch(e){throw new Error(`Workspace contract could not be inspected safely for archive portability: ${t}: ${e instanceof Error?e.message:String(e)}`)}return null}function xe(r){return (r?.projects??[]).filter(t=>typeof t.externalPath=="string"||typeof t.relativePath=="string"&&t.relativePath.startsWith("external/")).map(t=>({name:t.slug||t.relativePath||"external-project",relationship:["adopted","linked","imported","managed","restored"].includes(String(t.relationship))?t.relationship:"adopted",included:false,requiredAction:"relink"})).sort((t,e)=>t.name.localeCompare(e.name))}function Oe(r){if(r)return {...r,workspace:{...r.workspace},projects:r.projects.filter(t=>typeof t.externalPath!="string"&&!t.relativePath.startsWith("external/")).map(({externalPath:t,...e})=>({...e,modules:[...e.modules],ports:e.ports.map(i=>({...i})),contracts:{owns:[...e.contracts.owns],apis:e.contracts.apis.map(i=>({...i})),publishes:[...e.contracts.publishes],consumes:[...e.contracts.consumes],dependsOn:[...e.contracts.dependsOn],env:[...e.contracts.env]}}))}}async function*se(r,t,e){let i=(await p.readdir(t,{withFileTypes:true})).sort((a,s)=>a.name.localeCompare(s.name));for(let a of i){let s=l.join(t,a.name),n=_(l.relative(r,s));if(!(!n||_e(n,e))){if(a.isDirectory()){yield*se(r,s,e);continue}a.isFile()&&(yield {relativePath:n,fullPath:s});}}}async function ze(r){for(let t of t$1(r,"workspace.json"))try{let e=await p.readJson(t);if(typeof e.workspace_name=="string"&&e.workspace_name.trim())return e.workspace_name.trim();if(typeof e.name=="string"&&e.name.trim())return e.name.trim()}catch{}return l.basename(l.resolve(r))}async function Ne(r){let t=await p.stat(r.fullPath),e=z.createHash("sha256"),i=0;for await(let s of createReadStream(r.fullPath)){let n=Buffer.isBuffer(s)?s:Buffer.from(s);i+=n.length,e.update(n);}let a=await p.stat(r.fullPath);if(t.size!==a.size||t.mtimeMs!==a.mtimeMs||i!==a.size)throw new Error(`Workspace file changed while preparing archive: ${r.relativePath}`);return {...r,size:i,mtimeMs:a.mtimeMs,sha256:e.digest("hex")}}async function E(r,t){r.write(t)||await once(r,"drain");}async function ne(r){await new Promise((t,e)=>{r.once("error",e),r.end(t);});}async function*O(r){let t=Q.createInterface({input:createReadStream(r),crlfDelay:1/0});for await(let e of t){let i=e.trim();i&&(yield JSON.parse(i));}}async function Me(r){let t=createWriteStream(r.manifestPath,{flags:"wx"});try{await E(t,`{
2
2
  `);for(let[i,a]of Object.entries(r.manifestBase))await E(t,` ${JSON.stringify(i)}: ${JSON.stringify(a,null,2)},
3
3
  `);await E(t,` "files": [
4
4
  `);let e=true;for await(let i of O(r.spoolPath)){let{mtimeMs:a,...s}=i;await E(t,`${e?"":`,