@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
@@ -1,148 +0,0 @@
1
- /**
2
- * Identity and invocation for the DETACHED Anthropic proxy host process.
3
- *
4
- * Two jobs, both of which are "a pid is not an identity" problems:
5
- *
6
- * 1. HOW TO START ONE. The proxy runs as a child of the hub's own CLI, so
7
- * something has to answer "what argv re-enters this program?" — and the
8
- * answer differs in all three shipping runtimes. See
9
- * {@link anthropicProxyHostInvocation}.
10
- *
11
- * 2. HOW TO RECOGNISE ONE. `proxy-supervisor.ts` must be able to adopt a proxy
12
- * it did not spawn, refuse a listener it does not own, and terminate only
13
- * what is genuinely ours after a pid has possibly been recycled. That is
14
- * the same discipline process.ts applies to llama-server, with the same
15
- * rule: EVERY condition must hold, because any one of them alone is
16
- * forgeable by an unrelated command line.
17
- *
18
- * WHY THE ENTRY POINT IS A SUBCOMMAND AND NOT A TOP-LEVEL FLAG: the hub already
19
- * has internal re-entry flags (`--_cutoff-checkpoint-supervisor`, the probe
20
- * helpers), all dispatched from `src/cli/index.ts`. This one is reached as
21
- * `local-runtime --_proxy-host` instead, so the whole dispatch lives inside the
22
- * `local-runtime` command that owns it. The flag is operand-free apart from two
23
- * integers, absent from help and completions, and — the part that matters —
24
- * CANNOT carry a bind host. The child re-derives its host from the persisted
25
- * config and re-applies `gateBindHost`, so no argv anywhere can move the
26
- * listener off loopback. See proxy-host.ts.
27
- */
28
- import type { AnthropicProxyOwnershipRecord } from './types.js';
29
- /** The `local-runtime` subcommand word that re-enters this program as a proxy. */
30
- export declare const ANTHROPIC_PROXY_HOST_FLAG = "--_proxy-host";
31
- /** The command word the internal flag lives under. */
32
- export declare const ANTHROPIC_PROXY_COMMAND = "local-runtime";
33
- /** Flag naming the port the PROXY binds. */
34
- export declare const ANTHROPIC_PROXY_PORT_FLAG = "--anthropic-port";
35
- /** Flag naming the llama-server port the proxy forwards to. */
36
- export declare const ANTHROPIC_PROXY_UPSTREAM_PORT_FLAG = "--upstream-port";
37
- /** A proxy host process discovered by scanning the process table. */
38
- export interface DiscoveredAnthropicProxy {
39
- pid: number;
40
- argv: string;
41
- /** Absolute executable path, recovered from argv[0]. */
42
- execPath: string;
43
- }
44
- /**
45
- * Argv (after argv[0]) for a proxy host serving `port` from `upstreamPort`.
46
- *
47
- * PURE, so the exact spelling is pinned by unit tests rather than discovered
48
- * from a running process — and so {@link argvMatchesProxyRecord} and this
49
- * function cannot drift apart into a supervisor that can start a proxy it can
50
- * never recognise again.
51
- */
52
- export declare function anthropicProxyHostArgs(port: number, upstreamPort: number): string[];
53
- /** The runtime facts entry-point resolution depends on, injectable for tests. */
54
- export interface HostInvocationContext {
55
- /** `process.execPath` — the real on-disk executable. */
56
- execPath: string;
57
- /** `process.argv[1]` — the entry script, absent for a packaged binary. */
58
- entry: string | undefined;
59
- /** `process.execArgv` — carries tsx's loader in dev. */
60
- execArgv: readonly string[];
61
- /** This module's own `import.meta.url`. The signal argv cannot fake. */
62
- moduleUrl: string;
63
- /**
64
- * The SPAWNER's working directory, which is what a bare loader specifier
65
- * would otherwise be resolved against. See {@link absoluteLoaderSpecifier}.
66
- */
67
- cwd: string;
68
- }
69
- /**
70
- * Build the command + argv that re-enters this program as a proxy host.
71
- *
72
- * THREE SHIPPING RUNTIMES, and the middle one is the trap:
73
- *
74
- * dev / tsx → node <tsx --require/--import> src/cli/index.ts local-runtime …
75
- * npm dist → node dist/cli/index.js local-runtime …
76
- * Bun binary → <the binary itself> local-runtime …
77
- *
78
- * "Compiled" means: re-invoking `execPath` alone re-enters this program, so the
79
- * entry script must NOT be passed as a command word. Four independent signals
80
- * decide it, because each covers a case the others miss — this is the same
81
- * reasoning as `cutoffCaptureCliInvocation` in the daemon, and it is written
82
- * out again here rather than imported because that function's name, flag
83
- * argument and failure mode all belong to cutoff capture:
84
- *
85
- * 1. `bundledIntoSingleFileBinary(moduleUrl)` — INTRINSIC. Inside a Bun
86
- * single-file binary every bundled module's URL collapses onto the virtual
87
- * root, and that is true no matter how the process was invoked. This is
88
- * the signal argv cannot fool.
89
- * 2. no `entry` at all — a packaged binary invoked with no script operand.
90
- * 3. `insideSingleFileBinaryRoot(entry)` — Bun sets argv[1] to
91
- * `/$bunfs/root/_entry.js`, a path that does not exist on disk. Spawning
92
- * it would hand the CLI a command word it parses as an unknown command and
93
- * rejects with exit 2 — a proxy that never starts and never says why. This
94
- * is also the only form a unit test can simulate, since `import.meta.url`
95
- * cannot be stubbed.
96
- * 4. `entry === execPath` — a Node SEA, where argv[1] IS the executable and
97
- * `import.meta.url` is an ordinary on-disk path.
98
- *
99
- * This repository has shipped the /$bunfs/root defect three times (both account
100
- * probes, then cutoff capture). Signals 1 and 3 are precisely what
101
- * probe-helper-invocation.ts exports to stop it happening a fourth.
102
- */
103
- export declare function anthropicProxyHostInvocation(port: number, upstreamPort: number, context: HostInvocationContext): {
104
- command: string;
105
- args: string[];
106
- };
107
- /** This process's own facts, for the non-test call site. */
108
- export declare function currentHostInvocationContext(moduleUrl: string): HostInvocationContext;
109
- /**
110
- * Does an argv line carry `--anthropic-port <n>` for exactly this port?
111
- *
112
- * Matches the `=` spelling too, so a hand-typed invocation is still recognised
113
- * as ours rather than becoming an unkillable stranger on our own port.
114
- */
115
- export declare function argvBindsAnthropicPort(argv: string, port: number): boolean;
116
- /**
117
- * Is this argv line a proxy host invocation (and not, say, a grep for one)?
118
- *
119
- * Requires BOTH the command word and the internal flag as standalone tokens.
120
- * The flag is undocumented and absent from help, parsing and completions, so an
121
- * argv carrying it is one this program wrote — but requiring the command word
122
- * as well keeps a stray mention in some other tool's arguments from being
123
- * mistaken for a process we may terminate.
124
- */
125
- export declare function isAnthropicProxyHostArgv(argv: string): boolean;
126
- /**
127
- * Does this argv line belong to the proxy host described by the record?
128
- *
129
- * Pure, so the rule is testable without a live process. Three independent facts
130
- * must all hold before the recorded pid may be signalled — the direct analogue
131
- * of {@link import('./process.js').argvMatchesRecord}:
132
- *
133
- * 1. argv[0] is the recorded executable,
134
- * 2. it is a proxy host invocation at all, and
135
- * 3. it binds the recorded proxy port.
136
- *
137
- * A recycled pid belongs to some other program, whose argv will not be our CLI
138
- * re-entering itself on our port — which is what makes recycling harmless.
139
- */
140
- export declare function argvMatchesProxyRecord(argv: string, record: AnthropicProxyOwnershipRecord): boolean;
141
- /**
142
- * Find every live proxy host bound to `port`.
143
- *
144
- * Used to ADOPT a proxy this process did not spawn — the ordinary case, since
145
- * `ashlr local-runtime start` exits and the next invocation is a different
146
- * process entirely — and to let `stop` release the port afterwards.
147
- */
148
- export declare function findAnthropicProxiesOnPort(port: number): DiscoveredAnthropicProxy[];
@@ -1,250 +0,0 @@
1
- /**
2
- * Identity and invocation for the DETACHED Anthropic proxy host process.
3
- *
4
- * Two jobs, both of which are "a pid is not an identity" problems:
5
- *
6
- * 1. HOW TO START ONE. The proxy runs as a child of the hub's own CLI, so
7
- * something has to answer "what argv re-enters this program?" — and the
8
- * answer differs in all three shipping runtimes. See
9
- * {@link anthropicProxyHostInvocation}.
10
- *
11
- * 2. HOW TO RECOGNISE ONE. `proxy-supervisor.ts` must be able to adopt a proxy
12
- * it did not spawn, refuse a listener it does not own, and terminate only
13
- * what is genuinely ours after a pid has possibly been recycled. That is
14
- * the same discipline process.ts applies to llama-server, with the same
15
- * rule: EVERY condition must hold, because any one of them alone is
16
- * forgeable by an unrelated command line.
17
- *
18
- * WHY THE ENTRY POINT IS A SUBCOMMAND AND NOT A TOP-LEVEL FLAG: the hub already
19
- * has internal re-entry flags (`--_cutoff-checkpoint-supervisor`, the probe
20
- * helpers), all dispatched from `src/cli/index.ts`. This one is reached as
21
- * `local-runtime --_proxy-host` instead, so the whole dispatch lives inside the
22
- * `local-runtime` command that owns it. The flag is operand-free apart from two
23
- * integers, absent from help and completions, and — the part that matters —
24
- * CANNOT carry a bind host. The child re-derives its host from the persisted
25
- * config and re-applies `gateBindHost`, so no argv anywhere can move the
26
- * listener off loopback. See proxy-host.ts.
27
- */
28
- import { createRequire } from 'node:module';
29
- import { isAbsolute, join, resolve } from 'node:path';
30
- import { pathToFileURL } from 'node:url';
31
- import { bundledIntoSingleFileBinary, insideSingleFileBinaryRoot, } from '../../resources/probe-helper-invocation.js';
32
- import { processTable } from './process.js';
33
- /** The `local-runtime` subcommand word that re-enters this program as a proxy. */
34
- export const ANTHROPIC_PROXY_HOST_FLAG = '--_proxy-host';
35
- /** The command word the internal flag lives under. */
36
- export const ANTHROPIC_PROXY_COMMAND = 'local-runtime';
37
- /** Flag naming the port the PROXY binds. */
38
- export const ANTHROPIC_PROXY_PORT_FLAG = '--anthropic-port';
39
- /** Flag naming the llama-server port the proxy forwards to. */
40
- export const ANTHROPIC_PROXY_UPSTREAM_PORT_FLAG = '--upstream-port';
41
- /**
42
- * Argv (after argv[0]) for a proxy host serving `port` from `upstreamPort`.
43
- *
44
- * PURE, so the exact spelling is pinned by unit tests rather than discovered
45
- * from a running process — and so {@link argvMatchesProxyRecord} and this
46
- * function cannot drift apart into a supervisor that can start a proxy it can
47
- * never recognise again.
48
- */
49
- export function anthropicProxyHostArgs(port, upstreamPort) {
50
- return [
51
- ANTHROPIC_PROXY_COMMAND,
52
- ANTHROPIC_PROXY_HOST_FLAG,
53
- ANTHROPIC_PROXY_PORT_FLAG,
54
- String(port),
55
- ANTHROPIC_PROXY_UPSTREAM_PORT_FLAG,
56
- String(upstreamPort),
57
- ];
58
- }
59
- /**
60
- * Pin a loader specifier to an absolute file URL.
61
- *
62
- * The child is spawned with `cwd: homedir()` — deliberately, because a detached
63
- * process must not hold a working directory that can be deleted out from under
64
- * it. That makes a BARE specifier a live bug: `node --import tsx/esm
65
- * src/cli/index.ts …` puts the literal string `tsx/esm` in `execArgv`, the
66
- * child resolves it from the home directory, finds no `node_modules/tsx`
67
- * there, and dies with ERR_MODULE_NOT_FOUND before it can even log why.
68
- *
69
- * (Not hypothetical: the supervisor test spawns the CLI exactly that way and
70
- * caught this. Running `tsx` through its own launcher happens to put ABSOLUTE
71
- * paths in execArgv, so the defect is invisible until someone uses the plain
72
- * `--import` spelling — a fine way to ship something that works on the
73
- * maintainer's machine and nowhere else.)
74
- *
75
- * Resolution failure returns the specifier untouched: a loader we could not
76
- * resolve is still more likely to work than one we dropped, and the child's
77
- * own error message is more useful than a silent omission.
78
- */
79
- function absoluteLoaderSpecifier(specifier, cwd) {
80
- if (specifier.startsWith('file://') || isAbsolute(specifier))
81
- return specifier;
82
- try {
83
- // The filename is a resolution anchor, not a file that has to exist.
84
- return pathToFileURL(createRequire(join(cwd, 'noop.js')).resolve(specifier)).href;
85
- }
86
- catch {
87
- return specifier;
88
- }
89
- }
90
- /**
91
- * Forward only the loader flags a child genuinely needs to run our source.
92
- *
93
- * `--import` / `--require` is how tsx registers its TypeScript loader; without
94
- * them a child spawned in dev would be handed a `.ts` entry point that plain
95
- * Node refuses to parse. Everything else in `execArgv` (inspector ports above
96
- * all) is deliberately dropped: inheriting `--inspect` would make the child
97
- * fight the parent for the debug port and die.
98
- *
99
- * Every forwarded value is made absolute first — see
100
- * {@link absoluteLoaderSpecifier}.
101
- */
102
- function childRuntimeArgs(execArgv, cwd) {
103
- const args = [];
104
- for (let index = 0; index < execArgv.length; index += 1) {
105
- const arg = execArgv[index];
106
- for (const flag of ['--import', '--require']) {
107
- if (arg.startsWith(`${flag}=`)) {
108
- args.push(`${flag}=${absoluteLoaderSpecifier(arg.slice(flag.length + 1), cwd)}`);
109
- }
110
- else if (arg === flag) {
111
- const value = execArgv[index + 1];
112
- if (value !== undefined)
113
- args.push(flag, absoluteLoaderSpecifier(value, cwd));
114
- index += 1;
115
- }
116
- }
117
- }
118
- return args;
119
- }
120
- /**
121
- * Build the command + argv that re-enters this program as a proxy host.
122
- *
123
- * THREE SHIPPING RUNTIMES, and the middle one is the trap:
124
- *
125
- * dev / tsx → node <tsx --require/--import> src/cli/index.ts local-runtime …
126
- * npm dist → node dist/cli/index.js local-runtime …
127
- * Bun binary → <the binary itself> local-runtime …
128
- *
129
- * "Compiled" means: re-invoking `execPath` alone re-enters this program, so the
130
- * entry script must NOT be passed as a command word. Four independent signals
131
- * decide it, because each covers a case the others miss — this is the same
132
- * reasoning as `cutoffCaptureCliInvocation` in the daemon, and it is written
133
- * out again here rather than imported because that function's name, flag
134
- * argument and failure mode all belong to cutoff capture:
135
- *
136
- * 1. `bundledIntoSingleFileBinary(moduleUrl)` — INTRINSIC. Inside a Bun
137
- * single-file binary every bundled module's URL collapses onto the virtual
138
- * root, and that is true no matter how the process was invoked. This is
139
- * the signal argv cannot fool.
140
- * 2. no `entry` at all — a packaged binary invoked with no script operand.
141
- * 3. `insideSingleFileBinaryRoot(entry)` — Bun sets argv[1] to
142
- * `/$bunfs/root/_entry.js`, a path that does not exist on disk. Spawning
143
- * it would hand the CLI a command word it parses as an unknown command and
144
- * rejects with exit 2 — a proxy that never starts and never says why. This
145
- * is also the only form a unit test can simulate, since `import.meta.url`
146
- * cannot be stubbed.
147
- * 4. `entry === execPath` — a Node SEA, where argv[1] IS the executable and
148
- * `import.meta.url` is an ordinary on-disk path.
149
- *
150
- * This repository has shipped the /$bunfs/root defect three times (both account
151
- * probes, then cutoff capture). Signals 1 and 3 are precisely what
152
- * probe-helper-invocation.ts exports to stop it happening a fourth.
153
- */
154
- export function anthropicProxyHostInvocation(port, upstreamPort, context) {
155
- const hostArgs = anthropicProxyHostArgs(port, upstreamPort);
156
- const { entry } = context;
157
- const compiled = bundledIntoSingleFileBinary(context.moduleUrl) ||
158
- entry === undefined ||
159
- entry.length === 0 ||
160
- insideSingleFileBinaryRoot(entry) ||
161
- resolve(entry) === resolve(context.execPath);
162
- return {
163
- command: context.execPath,
164
- args: compiled
165
- ? hostArgs
166
- : [...childRuntimeArgs(context.execArgv, context.cwd), entry, ...hostArgs],
167
- };
168
- }
169
- /** This process's own facts, for the non-test call site. */
170
- export function currentHostInvocationContext(moduleUrl) {
171
- return {
172
- execPath: process.execPath,
173
- entry: process.argv[1],
174
- execArgv: process.execArgv,
175
- moduleUrl,
176
- cwd: process.cwd(),
177
- };
178
- }
179
- /**
180
- * Does an argv line carry `--anthropic-port <n>` for exactly this port?
181
- *
182
- * Matches the `=` spelling too, so a hand-typed invocation is still recognised
183
- * as ours rather than becoming an unkillable stranger on our own port.
184
- */
185
- export function argvBindsAnthropicPort(argv, port) {
186
- const pattern = new RegExp(`(?:^|\\s)${ANTHROPIC_PROXY_PORT_FLAG}(?:=|\\s+)${port}(?:\\s|$)`);
187
- return pattern.test(argv);
188
- }
189
- /**
190
- * Is this argv line a proxy host invocation (and not, say, a grep for one)?
191
- *
192
- * Requires BOTH the command word and the internal flag as standalone tokens.
193
- * The flag is undocumented and absent from help, parsing and completions, so an
194
- * argv carrying it is one this program wrote — but requiring the command word
195
- * as well keeps a stray mention in some other tool's arguments from being
196
- * mistaken for a process we may terminate.
197
- */
198
- export function isAnthropicProxyHostArgv(argv) {
199
- const tokens = argv.trim().split(/\s+/);
200
- return tokens.includes(ANTHROPIC_PROXY_COMMAND) && tokens.includes(ANTHROPIC_PROXY_HOST_FLAG);
201
- }
202
- /**
203
- * Does this argv line belong to the proxy host described by the record?
204
- *
205
- * Pure, so the rule is testable without a live process. Three independent facts
206
- * must all hold before the recorded pid may be signalled — the direct analogue
207
- * of {@link import('./process.js').argvMatchesRecord}:
208
- *
209
- * 1. argv[0] is the recorded executable,
210
- * 2. it is a proxy host invocation at all, and
211
- * 3. it binds the recorded proxy port.
212
- *
213
- * A recycled pid belongs to some other program, whose argv will not be our CLI
214
- * re-entering itself on our port — which is what makes recycling harmless.
215
- */
216
- export function argvMatchesProxyRecord(argv, record) {
217
- const line = argv.trim();
218
- if (!line || !record.execPath)
219
- return false;
220
- if (line !== record.execPath && !line.startsWith(`${record.execPath} `))
221
- return false;
222
- if (!isAnthropicProxyHostArgv(line))
223
- return false;
224
- return argvBindsAnthropicPort(line, record.port);
225
- }
226
- /**
227
- * Find every live proxy host bound to `port`.
228
- *
229
- * Used to ADOPT a proxy this process did not spawn — the ordinary case, since
230
- * `ashlr local-runtime start` exits and the next invocation is a different
231
- * process entirely — and to let `stop` release the port afterwards.
232
- */
233
- export function findAnthropicProxiesOnPort(port) {
234
- const found = [];
235
- for (const { pid, argv } of processTable()) {
236
- if (!isAnthropicProxyHostArgv(argv))
237
- continue;
238
- if (!argvBindsAnthropicPort(argv, port))
239
- continue;
240
- const execPath = argv.split(/\s+/)[0];
241
- // An argv[0] that is not an absolute path cannot be compared against a
242
- // record, and cannot be re-derived either; treat it as unidentifiable
243
- // rather than guessing, exactly as the llama-server scan does.
244
- if (!isAbsolute(execPath))
245
- continue;
246
- found.push({ pid, argv, execPath });
247
- }
248
- return found;
249
- }
250
- //# sourceMappingURL=proxy-process.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxy-process.js","sourceRoot":"","sources":["../../../../src/core/local-runtime/llama/proxy-process.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C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I,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,IAAI,KAAK,MAAM,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACtF,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAClD,OAAO,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,MAAM,KAAK,GAA+B,EAAE,CAAC;IAC7C,KAAK,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,YAAY,EAAE,EAAE,CAAC;QAC3C,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC;YAAE,SAAS;QAC9C,IAAI,CAAC,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC;YAAE,SAAS;QAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAW,CAAC;QAChD,uEAAuE;QACvE,sEAAsE;QACtE,+DAA+D;QAC/D,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;YAAE,SAAS;QACpC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,40 +0,0 @@
1
- /**
2
- * The Anthropic proxy's ownership record — record.ts, for the second process.
3
- *
4
- * Written when the detached proxy host is spawned, read on the next start,
5
- * deleted on a clean stop. Everything record.ts says applies here verbatim: it
6
- * is the only thing that survives a crash, it is deliberately minimal, there is
7
- * no field a credential could hide in, and reading NEVER throws — a missing,
8
- * truncated, foreign or hand-edited record is simply "no record", which
9
- * degrades the supervisor to the unmanaged path rather than taking the CLI
10
- * down.
11
- *
12
- * It is a sibling of record.ts rather than an extension of it because the two
13
- * describe processes with independent lifetimes. Folding the proxy into
14
- * llama-server's record would make every field optional, and an optional field
15
- * in a shape check that gates a kill decision is exactly the wrong place for
16
- * ambiguity.
17
- */
18
- import type { AnthropicProxyOwnershipRecord } from './types.js';
19
- /**
20
- * Validate an untrusted parsed value into a proxy record.
21
- *
22
- * Exported because the shape check is the security boundary: a record that
23
- * fails here is discarded, and a discarded record can never become a kill
24
- * decision. Pure, so it is unit-testable without touching the filesystem.
25
- */
26
- export declare function parseAnthropicProxyRecord(value: unknown): AnthropicProxyOwnershipRecord | null;
27
- /** Read the proxy record, or null when there is not a valid one. Never throws. */
28
- export declare function readAnthropicProxyRecord(path?: string): AnthropicProxyOwnershipRecord | null;
29
- /**
30
- * Persist the proxy record atomically, 0600, fsynced.
31
- *
32
- * Returns false rather than throwing: failing to record ownership is a
33
- * degradation (the next start cannot reclaim automatically), not a reason to
34
- * kill a proxy that is already forwarding correctly.
35
- */
36
- export declare function writeAnthropicProxyRecord(record: AnthropicProxyOwnershipRecord, path?: string): boolean;
37
- /** Forget the recorded proxy. Idempotent; never throws. */
38
- export declare function clearAnthropicProxyRecord(path?: string): void;
39
- /** Move a record aside without destroying it, for a corrupt-state postmortem. */
40
- export declare function quarantineAnthropicProxyRecord(path?: string): string | null;
@@ -1,133 +0,0 @@
1
- /**
2
- * The Anthropic proxy's ownership record — record.ts, for the second process.
3
- *
4
- * Written when the detached proxy host is spawned, read on the next start,
5
- * deleted on a clean stop. Everything record.ts says applies here verbatim: it
6
- * is the only thing that survives a crash, it is deliberately minimal, there is
7
- * no field a credential could hide in, and reading NEVER throws — a missing,
8
- * truncated, foreign or hand-edited record is simply "no record", which
9
- * degrades the supervisor to the unmanaged path rather than taking the CLI
10
- * down.
11
- *
12
- * It is a sibling of record.ts rather than an extension of it because the two
13
- * describe processes with independent lifetimes. Folding the proxy into
14
- * llama-server's record would make every field optional, and an optional field
15
- * in a shape check that gates a kill decision is exactly the wrong place for
16
- * ambiguity.
17
- */
18
- import { mkdirSync, readFileSync, renameSync, rmSync, statSync } from 'node:fs';
19
- import { randomUUID } from 'node:crypto';
20
- import { join } from 'node:path';
21
- import { writePrivateFileAtomically } from '../../util/private-file-write.js';
22
- import { anthropicProxyRecordPath, localRuntimeDir } from './paths.js';
23
- /** A record larger than this is not one of ours; refuse to parse it. */
24
- const MAX_RECORD_BYTES = 64 * 1024;
25
- const OWNERS = ['cli', 'launchd', 'adopted'];
26
- /**
27
- * Validate an untrusted parsed value into a proxy record.
28
- *
29
- * Exported because the shape check is the security boundary: a record that
30
- * fails here is discarded, and a discarded record can never become a kill
31
- * decision. Pure, so it is unit-testable without touching the filesystem.
32
- */
33
- export function parseAnthropicProxyRecord(value) {
34
- if (typeof value !== 'object' || value === null)
35
- return null;
36
- const raw = value;
37
- if (raw['schemaVersion'] !== 1)
38
- return null;
39
- const pid = raw['pid'];
40
- const port = raw['port'];
41
- const upstreamPort = raw['upstreamPort'];
42
- if (typeof pid !== 'number' || !Number.isInteger(pid) || pid <= 1)
43
- return null;
44
- if (typeof port !== 'number' || !Number.isInteger(port) || port < 1 || port > 65_535)
45
- return null;
46
- if (typeof upstreamPort !== 'number' ||
47
- !Number.isInteger(upstreamPort) ||
48
- upstreamPort < 1 ||
49
- upstreamPort > 65_535) {
50
- return null;
51
- }
52
- const host = raw['host'];
53
- const execPath = raw['execPath'];
54
- const upstreamOrigin = raw['upstreamOrigin'];
55
- const startedAt = raw['startedAt'];
56
- if (typeof host !== 'string' || host.length === 0)
57
- return null;
58
- if (typeof execPath !== 'string' || execPath.length === 0)
59
- return null;
60
- if (typeof upstreamOrigin !== 'string' || upstreamOrigin.length === 0)
61
- return null;
62
- if (typeof startedAt !== 'string' || Number.isNaN(Date.parse(startedAt)))
63
- return null;
64
- const owner = raw['owner'];
65
- if (typeof owner !== 'string' || !OWNERS.includes(owner))
66
- return null;
67
- return {
68
- schemaVersion: 1,
69
- pid,
70
- port,
71
- host,
72
- execPath,
73
- upstreamPort,
74
- upstreamOrigin,
75
- startedAt,
76
- owner: owner,
77
- };
78
- }
79
- /** Read the proxy record, or null when there is not a valid one. Never throws. */
80
- export function readAnthropicProxyRecord(path = anthropicProxyRecordPath()) {
81
- try {
82
- const stat = statSync(path);
83
- if (!stat.isFile() || stat.size > MAX_RECORD_BYTES)
84
- return null;
85
- return parseAnthropicProxyRecord(JSON.parse(readFileSync(path, 'utf8')));
86
- }
87
- catch {
88
- return null;
89
- }
90
- }
91
- /**
92
- * Persist the proxy record atomically, 0600, fsynced.
93
- *
94
- * Returns false rather than throwing: failing to record ownership is a
95
- * degradation (the next start cannot reclaim automatically), not a reason to
96
- * kill a proxy that is already forwarding correctly.
97
- */
98
- export function writeAnthropicProxyRecord(record, path = anthropicProxyRecordPath()) {
99
- try {
100
- const dir = localRuntimeDir();
101
- mkdirSync(dir, { recursive: true, mode: 0o700 });
102
- const temporaryPath = join(dir, `.anthropic-proxy.${randomUUID()}.tmp`);
103
- writePrivateFileAtomically(temporaryPath, path, `${JSON.stringify(record, null, 2)}\n`, {
104
- anchorPath: dir,
105
- label: 'local-runtime anthropic proxy ownership record',
106
- });
107
- return true;
108
- }
109
- catch {
110
- return false;
111
- }
112
- }
113
- /** Forget the recorded proxy. Idempotent; never throws. */
114
- export function clearAnthropicProxyRecord(path = anthropicProxyRecordPath()) {
115
- try {
116
- rmSync(path, { force: true });
117
- }
118
- catch {
119
- // Nothing to forget, or the file is not ours to remove.
120
- }
121
- }
122
- /** Move a record aside without destroying it, for a corrupt-state postmortem. */
123
- export function quarantineAnthropicProxyRecord(path = anthropicProxyRecordPath()) {
124
- try {
125
- const target = `${path}.stale-${new Date().toISOString().replace(/[:.]/g, '')}`;
126
- renameSync(path, target);
127
- return target;
128
- }
129
- catch {
130
- return null;
131
- }
132
- }
133
- //# sourceMappingURL=proxy-record.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxy-record.js","sourceRoot":"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