@ashlr/hub 3.4.0 → 3.5.1

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 (304) hide show
  1. package/CHANGELOG.md +107 -1
  2. package/README.md +3 -0
  3. package/dist/build-identity.json +2 -2
  4. package/dist/cli/index.js +11 -0
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/cli/local-runtime.js +40 -9
  7. package/dist/cli/local-runtime.js.map +1 -1
  8. package/dist/core/fleet/external-skill-audit.js +1 -1
  9. package/dist/core/fleet/external-skill-audit.js.map +1 -1
  10. package/dist/core/local-eval/classify.d.ts +57 -0
  11. package/dist/core/local-eval/classify.js +121 -0
  12. package/dist/core/local-eval/classify.js.map +1 -0
  13. package/dist/core/local-eval/configuration.d.ts +37 -0
  14. package/dist/core/local-eval/configuration.js +171 -0
  15. package/dist/core/local-eval/configuration.js.map +1 -0
  16. package/dist/core/local-eval/index.d.ts +15 -0
  17. package/dist/core/local-eval/index.js +16 -0
  18. package/dist/core/local-eval/index.js.map +1 -0
  19. package/dist/core/local-eval/main.d.ts +31 -0
  20. package/dist/core/local-eval/main.js +174 -0
  21. package/dist/core/local-eval/main.js.map +1 -0
  22. package/dist/core/local-eval/report.d.ts +25 -0
  23. package/dist/core/local-eval/report.js +157 -0
  24. package/dist/core/local-eval/report.js.map +1 -0
  25. package/dist/core/local-eval/runner.d.ts +55 -0
  26. package/dist/core/local-eval/runner.js +290 -0
  27. package/dist/core/local-eval/runner.js.map +1 -0
  28. package/dist/core/local-eval/tasks.d.ts +22 -0
  29. package/dist/core/local-eval/tasks.js +303 -0
  30. package/dist/core/local-eval/tasks.js.map +1 -0
  31. package/dist/core/local-eval/trace.d.ts +67 -0
  32. package/dist/core/local-eval/trace.js +309 -0
  33. package/dist/core/local-eval/trace.js.map +1 -0
  34. package/dist/core/local-eval/types.d.ts +262 -0
  35. package/dist/core/local-eval/types.js +23 -0
  36. package/dist/core/local-eval/types.js.map +1 -0
  37. package/dist/core/local-runtime/llama/anthropic-proxy-host.d.ts +68 -0
  38. package/dist/core/local-runtime/llama/anthropic-proxy-host.js +120 -0
  39. package/dist/core/local-runtime/llama/anthropic-proxy-host.js.map +1 -0
  40. package/dist/core/local-runtime/llama/anthropic-proxy-process.d.ts +15 -0
  41. package/dist/core/local-runtime/llama/anthropic-proxy-process.js +21 -0
  42. package/dist/core/local-runtime/llama/anthropic-proxy-process.js.map +1 -0
  43. package/dist/core/local-runtime/llama/anthropic-proxy.d.ts +2 -1
  44. package/dist/core/local-runtime/llama/anthropic-proxy.js +14 -6
  45. package/dist/core/local-runtime/llama/anthropic-proxy.js.map +1 -1
  46. package/dist/core/local-runtime/llama/anthropic-shim.d.ts +33 -0
  47. package/dist/core/local-runtime/llama/anthropic-shim.js +59 -0
  48. package/dist/core/local-runtime/llama/anthropic-shim.js.map +1 -1
  49. package/dist/core/local-runtime/llama/config.d.ts +123 -6
  50. package/dist/core/local-runtime/llama/config.js +196 -6
  51. package/dist/core/local-runtime/llama/config.js.map +1 -1
  52. package/dist/core/local-runtime/llama/index.d.ts +15 -0
  53. package/dist/core/local-runtime/llama/index.js +13 -0
  54. package/dist/core/local-runtime/llama/index.js.map +1 -1
  55. package/dist/core/local-runtime/llama/paths.d.ts +17 -0
  56. package/dist/core/local-runtime/llama/paths.js +25 -0
  57. package/dist/core/local-runtime/llama/paths.js.map +1 -1
  58. package/dist/core/local-runtime/llama/proxy-invocation.d.ts +101 -0
  59. package/dist/core/local-runtime/llama/proxy-invocation.js +134 -0
  60. package/dist/core/local-runtime/llama/proxy-invocation.js.map +1 -0
  61. package/dist/core/local-runtime/llama/proxy-launchd.d.ts +83 -0
  62. package/dist/core/local-runtime/llama/proxy-launchd.js +216 -0
  63. package/dist/core/local-runtime/llama/proxy-launchd.js.map +1 -0
  64. package/dist/core/local-runtime/llama/shapes.d.ts +2 -1
  65. package/dist/core/local-runtime/llama/shapes.js +2 -1
  66. package/dist/core/local-runtime/llama/shapes.js.map +1 -1
  67. package/dist/core/verse/adapters/claude.js +16 -0
  68. package/dist/core/verse/adapters/claude.js.map +1 -1
  69. package/dist/core/verse/adapters/codex.js +60 -2
  70. package/dist/core/verse/adapters/codex.js.map +1 -1
  71. package/dist/core/verse/adapters/grok.js +13 -0
  72. package/dist/core/verse/adapters/grok.js.map +1 -1
  73. package/dist/core/verse/control-api.d.ts +8 -9
  74. package/dist/core/verse/control-api.js +14 -114
  75. package/dist/core/verse/control-api.js.map +1 -1
  76. package/dist/core/verse/github-api.d.ts +50 -0
  77. package/dist/core/verse/github-api.js +211 -0
  78. package/dist/core/verse/github-api.js.map +1 -0
  79. package/dist/core/verse/github-proposal.d.ts +64 -0
  80. package/dist/core/verse/github-proposal.js +186 -0
  81. package/dist/core/verse/github-proposal.js.map +1 -0
  82. package/dist/core/verse/github-repo.d.ts +104 -0
  83. package/dist/core/verse/github-repo.js +476 -0
  84. package/dist/core/verse/github-repo.js.map +1 -0
  85. package/dist/core/verse/github-types.d.ts +174 -0
  86. package/dist/core/verse/github-types.js +31 -0
  87. package/dist/core/verse/github-types.js.map +1 -0
  88. package/dist/core/verse/mcp-cli-health.d.ts +149 -0
  89. package/dist/core/verse/mcp-cli-health.js +227 -0
  90. package/dist/core/verse/mcp-cli-health.js.map +1 -0
  91. package/dist/core/verse/mcp-control-api.d.ts +68 -0
  92. package/dist/core/verse/mcp-control-api.js +322 -0
  93. package/dist/core/verse/mcp-control-api.js.map +1 -0
  94. package/dist/core/verse/mcp-mutation.d.ts +187 -0
  95. package/dist/core/verse/mcp-mutation.js +471 -0
  96. package/dist/core/verse/mcp-mutation.js.map +1 -0
  97. package/dist/core/verse/mcp-scope.d.ts +114 -0
  98. package/dist/core/verse/mcp-scope.js +149 -0
  99. package/dist/core/verse/mcp-scope.js.map +1 -0
  100. package/dist/core/verse/mcp-seat-view.d.ts +197 -0
  101. package/dist/core/verse/mcp-seat-view.js +322 -0
  102. package/dist/core/verse/mcp-seat-view.js.map +1 -0
  103. package/dist/core/verse/path-guard.d.ts +115 -0
  104. package/dist/core/verse/path-guard.js +171 -0
  105. package/dist/core/verse/path-guard.js.map +1 -0
  106. package/dist/core/verse/seats.js +30 -2
  107. package/dist/core/verse/seats.js.map +1 -1
  108. package/dist/core/verse/session-engine.js +60 -1
  109. package/dist/core/verse/session-engine.js.map +1 -1
  110. package/dist/core/verse/session-store.js +20 -0
  111. package/dist/core/verse/session-store.js.map +1 -1
  112. package/dist/core/verse/types.d.ts +225 -1
  113. package/dist/core/verse/types.js +26 -0
  114. package/dist/core/verse/types.js.map +1 -1
  115. package/dist/core/verse/verse-api.d.ts +16 -1
  116. package/dist/core/verse/verse-api.js +338 -16
  117. package/dist/core/verse/verse-api.js.map +1 -1
  118. package/dist/core/verse/workspaces.d.ts +130 -0
  119. package/dist/core/verse/workspaces.js +501 -0
  120. package/dist/core/verse/workspaces.js.map +1 -0
  121. package/dist/core/web/api.js +23 -0
  122. package/dist/core/web/api.js.map +1 -1
  123. package/dist/core/web/public/next/assets/App-BbVoUCIi.js +7 -0
  124. package/dist/core/web/public/next/assets/App-BbVoUCIi.js.map +1 -0
  125. package/dist/core/web/public/next/assets/App-Cgi6j1Gk.css +1 -0
  126. package/dist/core/web/public/next/assets/ApprovalsSection-BW9iVjUa.js +2 -0
  127. package/dist/core/web/public/next/assets/ApprovalsSection-BW9iVjUa.js.map +1 -0
  128. package/dist/core/web/public/next/assets/ApprovalsSection-Su-NUTis.css +1 -0
  129. package/dist/core/web/public/next/assets/AutonomySection-CRqHUhED.js +2 -0
  130. package/dist/core/web/public/next/assets/AutonomySection-CRqHUhED.js.map +1 -0
  131. package/dist/core/web/public/next/assets/AutonomySection-Cpk_oEhc.css +1 -0
  132. package/dist/core/web/public/next/assets/ChatSection-5irrh6Jw.js +80 -0
  133. package/dist/core/web/public/next/assets/ChatSection-5irrh6Jw.js.map +1 -0
  134. package/dist/core/web/public/next/assets/ChatSection-LQiAn6Eu.css +1 -0
  135. package/dist/core/web/public/next/assets/ConfirmDialog-CXevY3Au.js +2 -0
  136. package/dist/core/web/public/next/assets/ConfirmDialog-CXevY3Au.js.map +1 -0
  137. package/dist/core/web/public/next/assets/{ConfirmDialog-cYuivhCX.css → ConfirmDialog-Dx15x0Ho.css} +1 -1
  138. package/dist/core/web/public/next/assets/Dialog-Bn0CgEGz.js +2 -0
  139. package/dist/core/web/public/next/assets/Dialog-Bn0CgEGz.js.map +1 -0
  140. package/dist/core/web/public/next/assets/Dialog-tQ8kFulD.css +1 -0
  141. package/dist/core/web/public/next/assets/DiffViewer-C8HHTnVE.css +1 -0
  142. package/dist/core/web/public/next/assets/DiffViewer-QKyisN2L.js +7 -0
  143. package/dist/core/web/public/next/assets/DiffViewer-QKyisN2L.js.map +1 -0
  144. package/dist/core/web/public/next/assets/{MutationTokenDialog-jWLLCxWn.css → MutationTokenDialog-CrfJ0PdD.css} +1 -1
  145. package/dist/core/web/public/next/assets/MutationTokenDialog-DbSHPy3w.js +2 -0
  146. package/dist/core/web/public/next/assets/MutationTokenDialog-DbSHPy3w.js.map +1 -0
  147. package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-C-PCgCzo.js +7 -0
  148. package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-C-PCgCzo.js.map +1 -0
  149. package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-CM_8pJs6.css +1 -0
  150. package/dist/core/web/public/next/assets/RouteErrorBoundary-Dw8ZjmkS.js +2 -0
  151. package/dist/core/web/public/next/assets/RouteErrorBoundary-Dw8ZjmkS.js.map +1 -0
  152. package/dist/core/web/public/next/assets/RouteErrorBoundary-ekyMXAK8.css +1 -0
  153. package/dist/core/web/public/next/assets/SettingsSection-BII7TTSD.css +1 -0
  154. package/dist/core/web/public/next/assets/SettingsSection-CWxtTNlD.js +2 -0
  155. package/dist/core/web/public/next/assets/SettingsSection-CWxtTNlD.js.map +1 -0
  156. package/dist/core/web/public/next/assets/UniverseConsoleApp-Bk5HipM0.js +2 -0
  157. package/dist/core/web/public/next/assets/UniverseConsoleApp-Bk5HipM0.js.map +1 -0
  158. package/dist/core/web/public/next/assets/UniverseConsoleApp-Dh7A-hLD.css +1 -0
  159. package/dist/core/web/public/next/assets/UniverseView-Bqa8DH57.css +1 -0
  160. package/dist/core/web/public/next/assets/UniverseView-D8k9q0ce.js +9 -0
  161. package/dist/core/web/public/next/assets/UniverseView-D8k9q0ce.js.map +1 -0
  162. package/dist/core/web/public/next/assets/UsageSection-B2E06ZH1.js +2 -0
  163. package/dist/core/web/public/next/assets/UsageSection-B2E06ZH1.js.map +1 -0
  164. package/dist/core/web/public/next/assets/UsageSection-DwgNOYvi.css +1 -0
  165. package/dist/core/web/public/next/assets/VerseConsoleApp-CRfZUV-T.js +3 -0
  166. package/dist/core/web/public/next/assets/VerseConsoleApp-CRfZUV-T.js.map +1 -0
  167. package/dist/core/web/public/next/assets/VerseConsoleApp-D2E3mU9a.css +1 -0
  168. package/dist/core/web/public/next/assets/charts-CsrtT4rk.css +1 -0
  169. package/dist/core/web/public/next/assets/charts-DSUpczxG.js +2 -0
  170. package/dist/core/web/public/next/assets/charts-DSUpczxG.js.map +1 -0
  171. package/dist/core/web/public/next/assets/fleet-model-ClBbQ0Uj.js +2 -0
  172. package/dist/core/web/public/next/assets/fleet-model-ClBbQ0Uj.js.map +1 -0
  173. package/dist/core/web/public/next/assets/format-BNYWGJat.js +2 -0
  174. package/dist/core/web/public/next/assets/format-BNYWGJat.js.map +1 -0
  175. package/dist/core/web/public/next/assets/global-C4jfYHrj.js +2 -0
  176. package/dist/core/web/public/next/assets/global-C4jfYHrj.js.map +1 -0
  177. package/dist/core/web/public/next/assets/global-D463gG1X.css +1 -0
  178. package/dist/core/web/public/next/assets/icons-BxOX8-XB.js +2 -0
  179. package/dist/core/web/public/next/assets/icons-BxOX8-XB.js.map +1 -0
  180. package/dist/core/web/public/next/assets/index-BMRIET7F.js +11 -0
  181. package/dist/core/web/public/next/assets/index-BMRIET7F.js.map +1 -0
  182. package/dist/core/web/public/next/assets/queries-AxnVa02h.js +2 -0
  183. package/dist/core/web/public/next/assets/queries-AxnVa02h.js.map +1 -0
  184. package/dist/core/web/public/next/assets/use-guarded-action-BO6c94Wp.js +2 -0
  185. package/dist/core/web/public/next/assets/use-guarded-action-BO6c94Wp.js.map +1 -0
  186. package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js +2 -0
  187. package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js.map +1 -0
  188. package/dist/core/web/public/next/assets/workspace-model-cE4LkKpE.js +2 -0
  189. package/dist/core/web/public/next/assets/workspace-model-cE4LkKpE.js.map +1 -0
  190. package/dist/core/web/public/next/index.html +1 -1
  191. package/dist/release-dependency-inventory.json +1 -1
  192. package/docs/README.md +4 -0
  193. package/node_modules/marked/README.md +8 -0
  194. package/node_modules/marked/bin/main.js +12 -11
  195. package/node_modules/marked/lib/marked.d.ts +88 -25
  196. package/node_modules/marked/lib/marked.esm.js +50 -44
  197. package/node_modules/marked/lib/marked.esm.js.map +3 -3
  198. package/node_modules/marked/lib/marked.umd.js +50 -44
  199. package/node_modules/marked/lib/marked.umd.js.map +3 -3
  200. package/node_modules/marked/man/marked.1 +1 -1
  201. package/node_modules/marked/package.json +21 -21
  202. package/package.json +13 -8
  203. package/dist/cli/activation.d.ts +0 -41
  204. package/dist/cli/activation.js +0 -485
  205. package/dist/cli/activation.js.map +0 -1
  206. package/dist/core/fleet/generated-repair-resolution.d.ts +0 -36
  207. package/dist/core/fleet/generated-repair-resolution.js +0 -245
  208. package/dist/core/fleet/generated-repair-resolution.js.map +0 -1
  209. package/dist/core/local-runtime/llama/port.d.ts +0 -17
  210. package/dist/core/local-runtime/llama/port.js +0 -47
  211. package/dist/core/local-runtime/llama/port.js.map +0 -1
  212. package/dist/core/local-runtime/llama/proxy-host.d.ts +0 -54
  213. package/dist/core/local-runtime/llama/proxy-host.js +0 -159
  214. package/dist/core/local-runtime/llama/proxy-host.js.map +0 -1
  215. package/dist/core/local-runtime/llama/proxy-process.d.ts +0 -148
  216. package/dist/core/local-runtime/llama/proxy-process.js +0 -250
  217. package/dist/core/local-runtime/llama/proxy-process.js.map +0 -1
  218. package/dist/core/local-runtime/llama/proxy-record.d.ts +0 -40
  219. package/dist/core/local-runtime/llama/proxy-record.js +0 -133
  220. package/dist/core/local-runtime/llama/proxy-record.js.map +0 -1
  221. package/dist/core/local-runtime/llama/proxy-supervisor.d.ts +0 -118
  222. package/dist/core/local-runtime/llama/proxy-supervisor.js +0 -511
  223. package/dist/core/local-runtime/llama/proxy-supervisor.js.map +0 -1
  224. package/dist/core/web/public/next/assets/App-BCKqSppK.css +0 -1
  225. package/dist/core/web/public/next/assets/App-LuILXjWG.js +0 -16
  226. package/dist/core/web/public/next/assets/App-LuILXjWG.js.map +0 -1
  227. package/dist/core/web/public/next/assets/ApprovalsSection-B_Xor8JH.js +0 -2
  228. package/dist/core/web/public/next/assets/ApprovalsSection-B_Xor8JH.js.map +0 -1
  229. package/dist/core/web/public/next/assets/ApprovalsSection-CRP59wSb.css +0 -1
  230. package/dist/core/web/public/next/assets/AutonomySection-BB8RD-tv.css +0 -1
  231. package/dist/core/web/public/next/assets/AutonomySection-BEwITtPJ.js +0 -2
  232. package/dist/core/web/public/next/assets/AutonomySection-BEwITtPJ.js.map +0 -1
  233. package/dist/core/web/public/next/assets/ChatSection-DrxqhBPK.css +0 -1
  234. package/dist/core/web/public/next/assets/ChatSection-bRAzlMth.js +0 -77
  235. package/dist/core/web/public/next/assets/ChatSection-bRAzlMth.js.map +0 -1
  236. package/dist/core/web/public/next/assets/ConfirmDialog-BqkZdPs_.js +0 -2
  237. package/dist/core/web/public/next/assets/ConfirmDialog-BqkZdPs_.js.map +0 -1
  238. package/dist/core/web/public/next/assets/Dialog-CPmedg4S.js +0 -2
  239. package/dist/core/web/public/next/assets/Dialog-CPmedg4S.js.map +0 -1
  240. package/dist/core/web/public/next/assets/Dialog-DxN7RgB5.css +0 -1
  241. package/dist/core/web/public/next/assets/DiffViewer-DmPJbeM_.js +0 -7
  242. package/dist/core/web/public/next/assets/DiffViewer-DmPJbeM_.js.map +0 -1
  243. package/dist/core/web/public/next/assets/DiffViewer-hN7X6wGT.css +0 -1
  244. package/dist/core/web/public/next/assets/Epistemic-DiyMyeaN.css +0 -1
  245. package/dist/core/web/public/next/assets/Epistemic-M3SxLHjq.js +0 -2
  246. package/dist/core/web/public/next/assets/Epistemic-M3SxLHjq.js.map +0 -1
  247. package/dist/core/web/public/next/assets/Meter-CGBsbXUX.css +0 -1
  248. package/dist/core/web/public/next/assets/Meter-D_X7c9U3.js +0 -2
  249. package/dist/core/web/public/next/assets/Meter-D_X7c9U3.js.map +0 -1
  250. package/dist/core/web/public/next/assets/MutationTokenDialog-Ba5ZHu-8.js +0 -2
  251. package/dist/core/web/public/next/assets/MutationTokenDialog-Ba5ZHu-8.js.map +0 -1
  252. package/dist/core/web/public/next/assets/RefreshIndicator-O7jUBOmX.css +0 -1
  253. package/dist/core/web/public/next/assets/RefreshIndicator-vHGpmyzb.js +0 -2
  254. package/dist/core/web/public/next/assets/RefreshIndicator-vHGpmyzb.js.map +0 -1
  255. package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-B5g6JEVk.js +0 -7
  256. package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-B5g6JEVk.js.map +0 -1
  257. package/dist/core/web/public/next/assets/ResourcePoolConsoleApp-DLl4DbGG.css +0 -1
  258. package/dist/core/web/public/next/assets/RouteErrorBoundary-BIpdnxp-.css +0 -1
  259. package/dist/core/web/public/next/assets/RouteErrorBoundary-CroxuKoi.js +0 -2
  260. package/dist/core/web/public/next/assets/RouteErrorBoundary-CroxuKoi.js.map +0 -1
  261. package/dist/core/web/public/next/assets/SettingsSection-DGJMdUh2.css +0 -1
  262. package/dist/core/web/public/next/assets/SettingsSection-p-7FCGfn.js +0 -2
  263. package/dist/core/web/public/next/assets/SettingsSection-p-7FCGfn.js.map +0 -1
  264. package/dist/core/web/public/next/assets/Skeleton-4qq4HuJO.js +0 -2
  265. package/dist/core/web/public/next/assets/Skeleton-4qq4HuJO.js.map +0 -1
  266. package/dist/core/web/public/next/assets/Skeleton-D2JaTXyv.css +0 -1
  267. package/dist/core/web/public/next/assets/StatusBadge-BbEdqEGn.js +0 -2
  268. package/dist/core/web/public/next/assets/StatusBadge-BbEdqEGn.js.map +0 -1
  269. package/dist/core/web/public/next/assets/StatusBadge-TpDqZf6K.css +0 -1
  270. package/dist/core/web/public/next/assets/TableView-R6Yeztp1.css +0 -1
  271. package/dist/core/web/public/next/assets/TableView-nyYs7Sv1.js +0 -2
  272. package/dist/core/web/public/next/assets/TableView-nyYs7Sv1.js.map +0 -1
  273. package/dist/core/web/public/next/assets/UniverseConsoleApp-CiZZxRPV.css +0 -1
  274. package/dist/core/web/public/next/assets/UniverseConsoleApp-DjTpQUrA.js +0 -2
  275. package/dist/core/web/public/next/assets/UniverseConsoleApp-DjTpQUrA.js.map +0 -1
  276. package/dist/core/web/public/next/assets/UniverseView-BtApwayT.js +0 -9
  277. package/dist/core/web/public/next/assets/UniverseView-BtApwayT.js.map +0 -1
  278. package/dist/core/web/public/next/assets/UniverseView-gBxl6yum.css +0 -1
  279. package/dist/core/web/public/next/assets/UsageSection-Db99N6ao.js +0 -2
  280. package/dist/core/web/public/next/assets/UsageSection-Db99N6ao.js.map +0 -1
  281. package/dist/core/web/public/next/assets/UsageSection-UUYDidOg.css +0 -1
  282. package/dist/core/web/public/next/assets/VerseConsoleApp-COa3J2dO.js +0 -3
  283. package/dist/core/web/public/next/assets/VerseConsoleApp-COa3J2dO.js.map +0 -1
  284. package/dist/core/web/public/next/assets/VerseConsoleApp-mOAXvWa6.css +0 -1
  285. package/dist/core/web/public/next/assets/fleet-model-DXCfVtNW.js +0 -2
  286. package/dist/core/web/public/next/assets/fleet-model-DXCfVtNW.js.map +0 -1
  287. package/dist/core/web/public/next/assets/format-fggwu_Rs.js +0 -2
  288. package/dist/core/web/public/next/assets/format-fggwu_Rs.js.map +0 -1
  289. package/dist/core/web/public/next/assets/global-BeRYd1Bu.css +0 -1
  290. package/dist/core/web/public/next/assets/global-CNVapoV1.js +0 -2
  291. package/dist/core/web/public/next/assets/global-CNVapoV1.js.map +0 -1
  292. package/dist/core/web/public/next/assets/index-BkUlX2Se.js +0 -51
  293. package/dist/core/web/public/next/assets/index-BkUlX2Se.js.map +0 -1
  294. package/dist/core/web/public/next/assets/index-YNTgDG2b.js +0 -2
  295. package/dist/core/web/public/next/assets/index-YNTgDG2b.js.map +0 -1
  296. package/dist/core/web/public/next/assets/queries-C9XS4SYq.js +0 -2
  297. package/dist/core/web/public/next/assets/queries-C9XS4SYq.js.map +0 -1
  298. package/dist/core/web/public/next/assets/use-guarded-action-Bqa2v0a-.css +0 -1
  299. package/dist/core/web/public/next/assets/use-guarded-action-Bql1nA-z.js +0 -2
  300. package/dist/core/web/public/next/assets/use-guarded-action-Bql1nA-z.js.map +0 -1
  301. package/dist/core/web/public/next/assets/verse-model-IrNQKtER.js +0 -2
  302. package/dist/core/web/public/next/assets/verse-model-IrNQKtER.js.map +0 -1
  303. package/node_modules/which/CHANGELOG.md +0 -166
  304. /package/node_modules/marked/{LICENSE.md → LICENSE} +0 -0
@@ -0,0 +1,471 @@
1
+ /**
2
+ * core/verse/mcp-mutation.ts — adding or editing an MCP server, deliberately
3
+ * made difficult.
4
+ *
5
+ * docs/VERSE-WORKSPACES.md §3: "an MCP server is arbitrary code with the
6
+ * agent's privileges"; "Adding or editing a server is a privileged,
7
+ * outward-facing change. It belongs behind the same mutation gate as the other
8
+ * control-plane writes, and it should show the full command and environment
9
+ * (redacted) before it is saved — never a one-click install of something the
10
+ * operator has not read."
11
+ *
12
+ * ── How "never one-click" is enforced, rather than just intended ────────────
13
+ *
14
+ * A write takes TWO requests, and the second cannot be forged from the first
15
+ * by a client that did not render it:
16
+ *
17
+ * 1. {@link buildVerseMcpProposal} validates the spec, resolves the target,
18
+ * and returns a PROPOSAL containing the full command and args verbatim,
19
+ * the env KEYS with every value redacted to '<set>', the warnings, and a
20
+ * `digest` over exactly what was shown plus the target file's current
21
+ * contents. Nothing is written.
22
+ * 2. {@link applyVerseMcpProposal} refuses unless it is handed that same
23
+ * digest back AND the target file is still byte-identical to what the
24
+ * digest was taken over. A stale digest is a refusal, not a merge.
25
+ *
26
+ * The digest binds the decision to the disclosure. An operator who never saw
27
+ * the command cannot produce it, and a file that changed underneath the
28
+ * proposal invalidates it.
29
+ *
30
+ * ── What this refuses to do ─────────────────────────────────────────────────
31
+ *
32
+ * - Rewrite TOML. Codex and Grok keep their MCP servers in `config.toml`.
33
+ * `src/core/integrations/editors.ts` already established the rule for
34
+ * this repo — Codex "is intentionally delegated to its official CLI so
35
+ * this module never attempts to parse and rewrite a user's TOML
36
+ * configuration" — and a half-understood TOML rewrite of an operator's
37
+ * config is a worse outcome than a refusal.
38
+ * - Touch ~/.ashlr/config.json, ~/.ashlr/enrollment.json or ~/.ashlr/KILL.
39
+ * Those are not MCP registries and are explicitly out of bounds.
40
+ * - Write anywhere the caller names freely. Targets are an enumerated set.
41
+ *
42
+ * ── What may leave this module ──────────────────────────────────────────────
43
+ *
44
+ * Env VALUES never leave, in any form, on any path: not in the proposal, not
45
+ * in the apply result, not in the audit summary, not in an error message. The
46
+ * proposal carries `redactEnv`'d specs only. The real values live in the
47
+ * request body and go straight to disk.
48
+ */
49
+ import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync, unlinkSync } from 'node:fs';
50
+ import { homedir } from 'node:os';
51
+ import { dirname, join } from 'node:path';
52
+ import { canonical, digest } from '../universe/artifacts.js';
53
+ import { redactEnv } from '../mcp-registry.js';
54
+ import { homeRelativeSourceRef, projectMcpServerView, resolveAccountStateRoots } from './mcp-seat-view.js';
55
+ /** Files that must never be written by this module, whatever a caller asks. */
56
+ export const VERSE_MCP_FORBIDDEN_FILES = [
57
+ 'config.json',
58
+ 'enrollment.json',
59
+ 'KILL',
60
+ ];
61
+ function hubTargetPath(home) {
62
+ return join(home, '.ashlr', 'settings.json');
63
+ }
64
+ /**
65
+ * Resolve a target id to a file, or explain why not.
66
+ *
67
+ * `accountsRoot` is only consulted for `account:` targets. Account state
68
+ * directories are private and never published — only `ref` crosses out.
69
+ */
70
+ export function resolveVerseMcpTarget(id, options) {
71
+ const home = options.home ?? homedir();
72
+ if (id === 'hub') {
73
+ const path = hubTargetPath(home);
74
+ return {
75
+ ok: true,
76
+ target: { id: 'hub', path, ref: homeRelativeSourceRef(path, home), label: 'Hub gateway registry' },
77
+ };
78
+ }
79
+ if (!id.startsWith('account:')) {
80
+ return { ok: false, refusal: 'mcp-target-unknown', error: `unknown target: ${id}` };
81
+ }
82
+ const accountId = id.slice('account:'.length);
83
+ if (accountId.length === 0 || accountId.length > 64) {
84
+ return { ok: false, refusal: 'mcp-target-unknown', error: 'target account id is missing or too long' };
85
+ }
86
+ const roots = resolveAccountStateRoots(options.accountsRoot);
87
+ const stateRoot = roots.get(accountId);
88
+ if (stateRoot === undefined) {
89
+ return {
90
+ ok: false,
91
+ refusal: 'mcp-target-unresolved',
92
+ error: `no private profile is resolvable for account ${accountId}`,
93
+ };
94
+ }
95
+ // Only a JSON registry can be edited. A Codex or Grok account keeps TOML,
96
+ // and this module does not rewrite an operator's TOML.
97
+ if (existsSync(join(stateRoot, 'config.toml'))) {
98
+ return {
99
+ ok: false,
100
+ refusal: 'mcp-target-not-json',
101
+ error: `account ${accountId} keeps its MCP servers in config.toml. Hub does not rewrite TOML; ` +
102
+ 'use the provider CLI\'s own mcp command for this account.',
103
+ };
104
+ }
105
+ const path = join(stateRoot, '.claude.json');
106
+ return {
107
+ ok: true,
108
+ target: {
109
+ id: id,
110
+ path,
111
+ // The state directory is private; name the file relative to the account.
112
+ ref: `${accountId}/.claude.json`,
113
+ label: `Account ${accountId} (private profile)`,
114
+ },
115
+ };
116
+ }
117
+ // ---------------------------------------------------------------------------
118
+ // Spec validation — strict, because this is arbitrary code
119
+ // ---------------------------------------------------------------------------
120
+ const NAME_RE = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$/;
121
+ const ENV_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/;
122
+ const MAX_ARGS = 64;
123
+ const MAX_ENV_KEYS = 64;
124
+ const MAX_STRING_BYTES = 4096;
125
+ const MAX_ENV_VALUE_BYTES = 8192;
126
+ /** Printable, single-line, within a byte budget. Rejects control characters. */
127
+ function printable(value, maxBytes) {
128
+ if (typeof value !== 'string' || value.length === 0)
129
+ return false;
130
+ if (Buffer.byteLength(value) > maxBytes)
131
+ return false;
132
+ return [...value].every((character) => {
133
+ const code = character.charCodeAt(0);
134
+ return code >= 32 && (code < 127 || code > 159);
135
+ });
136
+ }
137
+ /**
138
+ * Validate a caller-supplied server spec.
139
+ *
140
+ * Strict by construction: unknown keys are rejected, every string is bounded
141
+ * and printable, and nothing is coerced. Warnings are returned rather than
142
+ * silently swallowed — they are part of what the operator must read.
143
+ */
144
+ export function parseVerseMcpSpec(body) {
145
+ if (body === null || typeof body !== 'object' || Array.isArray(body)) {
146
+ return { ok: false, error: 'server must be a JSON object' };
147
+ }
148
+ const raw = body;
149
+ for (const key of Object.keys(raw)) {
150
+ if (key !== 'name' && key !== 'command' && key !== 'args' && key !== 'env') {
151
+ return { ok: false, error: `unknown key in server: ${key}` };
152
+ }
153
+ }
154
+ const name = raw['name'];
155
+ if (typeof name !== 'string' || !NAME_RE.test(name)) {
156
+ return { ok: false, error: 'name must match [A-Za-z0-9][A-Za-z0-9_.-]{0,63}' };
157
+ }
158
+ const command = raw['command'];
159
+ if (!printable(command, MAX_STRING_BYTES)) {
160
+ return { ok: false, error: 'command must be a printable single-line string' };
161
+ }
162
+ const warnings = [];
163
+ if (!command.startsWith('/')) {
164
+ warnings.push(`The command "${command}" is not an absolute path, so it is resolved through PATH at ` +
165
+ 'launch time. Whatever appears first on PATH will run with the agent\'s privileges.');
166
+ }
167
+ let args = [];
168
+ const rawArgs = raw['args'];
169
+ if (rawArgs !== undefined) {
170
+ if (!Array.isArray(rawArgs))
171
+ return { ok: false, error: 'args must be an array of strings' };
172
+ if (rawArgs.length > MAX_ARGS)
173
+ return { ok: false, error: `args may hold at most ${MAX_ARGS} entries` };
174
+ for (const arg of rawArgs) {
175
+ if (!printable(arg, MAX_STRING_BYTES)) {
176
+ return { ok: false, error: 'every arg must be a printable single-line string' };
177
+ }
178
+ }
179
+ args = [...rawArgs];
180
+ }
181
+ let env;
182
+ const rawEnv = raw['env'];
183
+ if (rawEnv !== undefined) {
184
+ if (rawEnv === null || typeof rawEnv !== 'object' || Array.isArray(rawEnv)) {
185
+ return { ok: false, error: 'env must be an object of string values' };
186
+ }
187
+ const entries = Object.entries(rawEnv);
188
+ if (entries.length > MAX_ENV_KEYS) {
189
+ return { ok: false, error: `env may hold at most ${MAX_ENV_KEYS} keys` };
190
+ }
191
+ const safe = {};
192
+ for (const [key, value] of entries) {
193
+ if (!ENV_KEY_RE.test(key))
194
+ return { ok: false, error: `invalid env key: ${key}` };
195
+ if (!printable(value, MAX_ENV_VALUE_BYTES)) {
196
+ // The offending VALUE is never echoed — only its key.
197
+ return { ok: false, error: `env value for ${key} must be a printable single-line string` };
198
+ }
199
+ safe[key] = value;
200
+ }
201
+ if (entries.length > 0) {
202
+ env = safe;
203
+ warnings.push(`${entries.length} environment variable${entries.length === 1 ? '' : 's'} ` +
204
+ `(${Object.keys(safe).join(', ')}) will be passed to this server. Their values are ` +
205
+ 'redacted everywhere they are displayed, including here.');
206
+ }
207
+ }
208
+ const spec = { name, command, args, source: 'proposal' };
209
+ if (env !== undefined)
210
+ spec.env = env;
211
+ return { ok: true, spec, warnings };
212
+ }
213
+ export const VERSE_MCP_PROPOSAL_NOTE = 'Nothing has been written. An MCP server is arbitrary code that runs with the agent\'s ' +
214
+ 'privileges: read the command, arguments and environment keys above, then confirm with the ' +
215
+ 'digest shown to apply it.';
216
+ /** Read a JSON registry's current bytes and servers. Missing file is not an error. */
217
+ function readTarget(path) {
218
+ let bytes = '';
219
+ try {
220
+ if (existsSync(path))
221
+ bytes = readFileSync(path, 'utf8');
222
+ }
223
+ catch {
224
+ bytes = '';
225
+ }
226
+ let servers = {};
227
+ if (bytes.length > 0) {
228
+ try {
229
+ const parsed = JSON.parse(bytes);
230
+ if (parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed)) {
231
+ const existing = parsed['mcpServers'];
232
+ if (existing !== null && typeof existing === 'object' && !Array.isArray(existing)) {
233
+ servers = existing;
234
+ }
235
+ }
236
+ }
237
+ catch {
238
+ servers = {};
239
+ }
240
+ }
241
+ return { bytes, servers };
242
+ }
243
+ /**
244
+ * The digest the operator confirms against.
245
+ *
246
+ * Covers the REDACTED spec (what was shown), the target, and a hash of the
247
+ * target file's current bytes. Env values are deliberately outside it: the
248
+ * digest must be reproducible from what was displayed.
249
+ */
250
+ export function verseMcpProposalDigest(input) {
251
+ return digest(canonical({
252
+ schema: 'verse-mcp-proposal/1',
253
+ server: input.server,
254
+ target: input.targetId,
255
+ base: digest(input.targetBytes),
256
+ }));
257
+ }
258
+ /**
259
+ * Validate, disclose, and hand back a digest. Writes nothing.
260
+ */
261
+ export function buildVerseMcpProposal(options) {
262
+ const home = options.home ?? homedir();
263
+ const parsed = parseVerseMcpSpec(options.server);
264
+ if (!parsed.ok) {
265
+ return { ok: false, refusal: 'mcp-spec-invalid', error: parsed.error, note: VERSE_MCP_PROPOSAL_NOTE };
266
+ }
267
+ const resolved = resolveVerseMcpTarget(options.targetId, { accountsRoot: options.accountsRoot, home });
268
+ if (!resolved.ok) {
269
+ return { ok: false, refusal: resolved.refusal, error: resolved.error, note: VERSE_MCP_PROPOSAL_NOTE };
270
+ }
271
+ const target = resolved.target;
272
+ if (VERSE_MCP_FORBIDDEN_FILES.includes(target.path.split('/').pop() ?? '')) {
273
+ return {
274
+ ok: false,
275
+ refusal: 'mcp-target-forbidden',
276
+ error: `${target.ref} is not an MCP registry and is never written by this surface`,
277
+ note: VERSE_MCP_PROPOSAL_NOTE,
278
+ };
279
+ }
280
+ const current = readTarget(target.path);
281
+ const existing = current.servers[parsed.spec.name];
282
+ const action = existing === undefined ? 'add' : 'replace';
283
+ const server = projectMcpServerView({ ...parsed.spec, source: target.path }, home);
284
+ // `source` on the displayed spec should name the TARGET, not the literal
285
+ // string 'proposal' — the operator is reading where it will land.
286
+ server.sourceRef = target.ref;
287
+ let replaces = null;
288
+ if (existing !== null && typeof existing === 'object' && !Array.isArray(existing)) {
289
+ const row = existing;
290
+ if (typeof row['command'] === 'string') {
291
+ const prior = {
292
+ name: parsed.spec.name,
293
+ command: row['command'],
294
+ args: Array.isArray(row['args']) ? row['args'].filter((a) => typeof a === 'string') : [],
295
+ source: target.path,
296
+ };
297
+ if (row['env'] !== null && typeof row['env'] === 'object' && !Array.isArray(row['env'])) {
298
+ const priorEnv = {};
299
+ for (const [k, v] of Object.entries(row['env'])) {
300
+ if (typeof v === 'string')
301
+ priorEnv[k] = v;
302
+ }
303
+ if (Object.keys(priorEnv).length > 0)
304
+ prior.env = priorEnv;
305
+ }
306
+ replaces = projectMcpServerView(redactEnv(prior), home);
307
+ replaces.sourceRef = target.ref;
308
+ }
309
+ }
310
+ const warnings = [...parsed.warnings];
311
+ if (action === 'replace') {
312
+ warnings.push(`A server named "${parsed.spec.name}" already exists in ${target.ref} and would be replaced. ` +
313
+ 'Its current command is shown above so the change is legible.');
314
+ }
315
+ if (target.id === 'hub') {
316
+ warnings.push('This registry is aggregated by the hub gateway, so the server becomes reachable to every ' +
317
+ 'agent that connects through it — not to one seat.');
318
+ }
319
+ if (target.id.startsWith('account:')) {
320
+ warnings.push('Verse launches Claude seats with --strict-mcp-config and an empty --mcp-config, so a server ' +
321
+ 'written here will NOT be loaded by this account\'s Verse turns. It applies to the provider ' +
322
+ 'CLI run outside Verse.');
323
+ }
324
+ if (!options.scope.allow) {
325
+ warnings.push('Locus is blocking writes in this scope; the apply step will refuse until the pin is healthy.');
326
+ }
327
+ else if (options.scope.scope.pinned && options.scope.scope.tenantRef !== null) {
328
+ warnings.push(`This write lands under the Locus tenant ${options.scope.scope.tenantRef}` +
329
+ `${options.scope.scope.aliasRef !== null ? ` (alias ${options.scope.scope.aliasRef})` : ''}.`);
330
+ }
331
+ else if (!options.scope.scope.pinned) {
332
+ warnings.push('Locus reports no pinned tenant, so this write is not attributable to a tenant scope.');
333
+ }
334
+ return {
335
+ ok: true,
336
+ server,
337
+ target: { id: target.id, ref: target.ref, label: target.label },
338
+ action,
339
+ replaces,
340
+ warnings,
341
+ scope: options.scope,
342
+ digest: verseMcpProposalDigest({ server, targetId: target.id, targetBytes: current.bytes }),
343
+ note: VERSE_MCP_PROPOSAL_NOTE,
344
+ };
345
+ }
346
+ export const VERSE_MCP_APPLIED_NOTE = 'Written. The server is listed above exactly as it was persisted, with every environment value ' +
347
+ 'redacted. It takes effect the next time a client that reads this registry starts.';
348
+ /**
349
+ * Apply a proposal the operator confirmed.
350
+ *
351
+ * Refuses unless the supplied digest reproduces from (a) the redacted spec it
352
+ * is about to write and (b) the target file's CURRENT bytes. That second half
353
+ * is what makes a stale confirmation fail instead of quietly clobbering a
354
+ * change made in between.
355
+ *
356
+ * The write is atomic: a sibling temp file, mode 0600, then rename.
357
+ */
358
+ export function applyVerseMcpProposal(options) {
359
+ const proposal = buildVerseMcpProposal(options);
360
+ if (!proposal.ok)
361
+ return proposal;
362
+ if (!proposal.scope.allow) {
363
+ return {
364
+ ok: false,
365
+ refusal: 'mcp-scope-refused',
366
+ error: proposal.scope.blockers.join('; ') || 'Locus refused this scope',
367
+ note: 'Nothing was written. Locus owns scope for this surface; resolve the pin and retry.',
368
+ };
369
+ }
370
+ // Recomputed above against the file's CURRENT bytes. If the operator's
371
+ // digest does not match, either they never saw this disclosure or the file
372
+ // changed since they did. Both are refusals, and they are distinguishable
373
+ // only by re-proposing, so say so plainly rather than guessing which.
374
+ if (options.digest !== proposal.digest) {
375
+ return {
376
+ ok: false,
377
+ refusal: 'mcp-digest-mismatch',
378
+ error: 'the confirmation digest does not match this proposal. Either the target changed since ' +
379
+ 'the proposal was shown, or the disclosure was not the one being confirmed.',
380
+ note: 'Nothing was written. Re-read the proposal and confirm the digest it returns.',
381
+ };
382
+ }
383
+ const home = options.home ?? homedir();
384
+ const resolved = resolveVerseMcpTarget(options.targetId, { accountsRoot: options.accountsRoot, home });
385
+ if (!resolved.ok) {
386
+ return { ok: false, refusal: resolved.refusal, error: resolved.error, note: 'Nothing was written.' };
387
+ }
388
+ const target = resolved.target;
389
+ const parsed = parseVerseMcpSpec(options.server);
390
+ /* c8 ignore next -- buildVerseMcpProposal already returned on an invalid spec. */
391
+ if (!parsed.ok) {
392
+ return { ok: false, refusal: 'mcp-spec-invalid', error: parsed.error, note: 'Nothing was written.' };
393
+ }
394
+ const current = readTarget(target.path);
395
+ let root = {};
396
+ if (current.bytes.length > 0) {
397
+ try {
398
+ const value = JSON.parse(current.bytes);
399
+ if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
400
+ root = value;
401
+ }
402
+ }
403
+ catch {
404
+ return {
405
+ ok: false,
406
+ refusal: 'mcp-target-changed',
407
+ error: `${target.ref} is not readable as JSON, so it will not be rewritten`,
408
+ note: 'Nothing was written.',
409
+ };
410
+ }
411
+ }
412
+ const entry = { command: parsed.spec.command, args: parsed.spec.args };
413
+ if (parsed.spec.env !== undefined)
414
+ entry['env'] = parsed.spec.env;
415
+ const servers = root['mcpServers'] !== null && typeof root['mcpServers'] === 'object' && !Array.isArray(root['mcpServers'])
416
+ ? { ...root['mcpServers'] }
417
+ : {};
418
+ servers[parsed.spec.name] = entry;
419
+ const next = { ...root, mcpServers: servers };
420
+ const tmp = `${target.path}.ashlr-mcp-${process.pid}.tmp`;
421
+ try {
422
+ mkdirSync(dirname(target.path), { recursive: true, mode: 0o700 });
423
+ writeFileSync(tmp, `${JSON.stringify(next, null, 2)}\n`, { encoding: 'utf8', mode: 0o600 });
424
+ renameSync(tmp, target.path);
425
+ }
426
+ catch (error) {
427
+ try {
428
+ if (existsSync(tmp))
429
+ unlinkSync(tmp);
430
+ }
431
+ catch { /* best effort */ }
432
+ return {
433
+ ok: false,
434
+ refusal: 'mcp-write-failed',
435
+ // The message is the filesystem's, which never carries an env value.
436
+ error: `could not write ${target.ref}: ${error instanceof Error ? error.message : 'unknown error'}`,
437
+ note: 'Nothing was written.',
438
+ };
439
+ }
440
+ // Re-read from disk so the caller sees what was actually persisted, not
441
+ // what we intended to persist. Same posture as the caps route.
442
+ const after = readTarget(target.path);
443
+ const persisted = after.servers[parsed.spec.name];
444
+ const spec = { name: parsed.spec.name, command: parsed.spec.command, args: parsed.spec.args, source: target.path };
445
+ if (persisted !== null && typeof persisted === 'object' && !Array.isArray(persisted)) {
446
+ const row = persisted;
447
+ if (typeof row['command'] === 'string')
448
+ spec.command = row['command'];
449
+ if (Array.isArray(row['args']))
450
+ spec.args = row['args'].filter((a) => typeof a === 'string');
451
+ if (row['env'] !== null && typeof row['env'] === 'object' && !Array.isArray(row['env'])) {
452
+ const env = {};
453
+ for (const [k, v] of Object.entries(row['env'])) {
454
+ if (typeof v === 'string')
455
+ env[k] = v;
456
+ }
457
+ if (Object.keys(env).length > 0)
458
+ spec.env = env;
459
+ }
460
+ }
461
+ const view = projectMcpServerView(redactEnv(spec), home);
462
+ view.sourceRef = target.ref;
463
+ return {
464
+ ok: true,
465
+ action: proposal.action,
466
+ target: { id: target.id, ref: target.ref },
467
+ server: view,
468
+ note: VERSE_MCP_APPLIED_NOTE,
469
+ };
470
+ }
471
+ //# sourceMappingURL=mcp-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-mutation.js","sourceRoot":"","sources":["../../../src/core/verse/mcp-mutation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,E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C,EAAE,CAAC;YACxF,MAAM,GAAG,GAA2B,EAAE,CAAC;YACvC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAA4B,CAAC,EAAE,CAAC;gBAC3E,IAAI,OAAO,CAAC,KAAK,QAAQ;oBAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACxC,CAAC;YACD,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QAClD,CAAC;IACH,CAAC;IACD,MAAM,IAAI,GAAG,oBAAoB,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IACzD,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC;IAE5B,OAAO;QACL,EAAE,EAAE,IAAI;QACR,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE;QAC1C,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,sBAAsB;KAC7B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * core/verse/mcp-scope.ts — MCP scope, as reported by Locus.
3
+ *
4
+ * docs/VERSE-WORKSPACES.md §3: "a server appropriate for a personal account
5
+ * may be wrong for a client's. Locus already models exactly this — principal,
6
+ * tenant, sealed session — so scope should be asked of Locus rather than
7
+ * reinvented in the hub, and the hub should hold opaque references rather
8
+ * than copies of anything sensitive."
9
+ *
10
+ * So this module OWNS NO SCOPE. It asks `src/core/integrations/locus.ts` and
11
+ * projects the answer onto a transport shape. Two rules follow from that:
12
+ *
13
+ * 1. Every field here is an OPAQUE REFERENCE Locus already publishes in its
14
+ * own `agent report --json` (alias, tenant, binding_id, principal). None
15
+ * of them is a credential, and none of them is derived, inferred or
16
+ * cached by the hub. When Locus says nothing, this says nothing — it
17
+ * never substitutes a hub-local notion of "which account is this".
18
+ * 2. Mutation admission is NOT decided here either. It is decided by the
19
+ * repo's existing pre-mutate gate (`assertLocusPreMutate`), whose mode
20
+ * ladder (off | warn | enforce) is already the contract every other
21
+ * spawn site in this repo obeys — see src/core/run/engines.ts:662. A new
22
+ * surface inventing a stricter or looser rule than the dispatch path is
23
+ * exactly the "reinvented in the hub" failure this file exists to avoid.
24
+ *
25
+ * Pure projection + one shell-out through locus.ts. Never throws.
26
+ */
27
+ import { type LocusEnforceConfigInput, type LocusEnforceMode, type LocusProbeResult } from '../integrations/locus.js';
28
+ /**
29
+ * Why scope is what it is. Machine-readable and verbatim — prose belongs in
30
+ * the web UI, the same split `VerseAccountRecord.reason` already uses.
31
+ */
32
+ export type VerseMcpScopeReason =
33
+ /** `locus` is not installed or not on PATH. */
34
+ 'mcp-scope-locus-unavailable'
35
+ /** Locus answered but reports no pin, so there is no tenant to scope to. */
36
+ | 'mcp-scope-unpinned'
37
+ /** Pinned, but the seal did not verify. */
38
+ | 'mcp-scope-seal-unverified'
39
+ /** Pinned, but the pin has expired. */
40
+ | 'mcp-scope-expired'
41
+ /** Pinned and sealed. */
42
+ | 'mcp-scope-pinned';
43
+ /**
44
+ * Locus's pin, projected for transport.
45
+ *
46
+ * Every `*Ref` is Locus's own opaque identifier, carried through unchanged so
47
+ * the operator can match it against `locus status` — never a hub-side copy of
48
+ * anything that authenticates.
49
+ */
50
+ export interface VerseMcpScope {
51
+ /** False when the locus binary could not be run at all. */
52
+ available: boolean;
53
+ pinned: boolean;
54
+ /** Opaque Locus references. Null whenever Locus did not publish one. */
55
+ aliasRef: string | null;
56
+ tenantRef: string | null;
57
+ principalRef: string | null;
58
+ bindingRef: string | null;
59
+ sealOk: boolean | null;
60
+ expired: boolean | null;
61
+ frozen: boolean | null;
62
+ expiresAt: string | null;
63
+ /** Locus's own `status` and `status --oneline`, verbatim. */
64
+ status: string | null;
65
+ statusOneline: string | null;
66
+ reason: VerseMcpScopeReason;
67
+ }
68
+ /** The scope a mutation would be written under, plus whether it may proceed. */
69
+ export interface VerseMcpScopeGate {
70
+ scope: VerseMcpScope;
71
+ /** The repo-wide pre-mutate mode: off | warn | enforce. */
72
+ mode: LocusEnforceMode;
73
+ /**
74
+ * False only when mode is `enforce` and Locus blocks. Mirrors
75
+ * `assertLocusPreMutate` exactly — this surface does not get its own rule.
76
+ */
77
+ allow: boolean;
78
+ /** Human-readable blockers from Locus. Never secrets. */
79
+ blockers: string[];
80
+ }
81
+ /**
82
+ * Project one `locus agent report --json` probe onto {@link VerseMcpScope}.
83
+ *
84
+ * Pure: pass a canned {@link LocusProbeResult} in tests rather than shelling
85
+ * out. An unavailable probe, a null report and a null pin are three different
86
+ * facts and each gets its own reason.
87
+ */
88
+ export declare function projectVerseMcpScope(probe: LocusProbeResult): VerseMcpScope;
89
+ /**
90
+ * Ask Locus for the current scope.
91
+ *
92
+ * `read` is the injection seam: production passes nothing and gets the real
93
+ * `locusAgentReport()` shell-out; tests pass a function returning a canned
94
+ * probe and never spawn anything. Never throws — locusAgentReport() already
95
+ * reports failure as `{available: false}` rather than raising.
96
+ */
97
+ export declare function readVerseMcpScope(read?: () => LocusProbeResult): VerseMcpScope;
98
+ /**
99
+ * The scope a write would land under, plus the repo's existing admission
100
+ * decision for it.
101
+ *
102
+ * `decide` and `read` are injection seams for tests. In production both shell
103
+ * out to Locus once each.
104
+ */
105
+ export declare function readVerseMcpScopeGate(options?: {
106
+ read?: () => LocusProbeResult;
107
+ decide?: () => {
108
+ allow: boolean;
109
+ mode: LocusEnforceMode;
110
+ blockers: string[];
111
+ };
112
+ env?: NodeJS.ProcessEnv;
113
+ config?: LocusEnforceConfigInput;
114
+ }): VerseMcpScopeGate;