lorenz 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (630) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +13 -0
  3. package/README.md +774 -0
  4. package/RELEASE-MANIFEST.json +211 -0
  5. package/apps/cli/bin/lorenz.js +25 -0
  6. package/apps/cli/dist/bin/cli.d.ts +3 -0
  7. package/apps/cli/dist/bin/cli.d.ts.map +1 -0
  8. package/apps/cli/dist/bin/cli.js +4 -0
  9. package/apps/cli/dist/bin/cli.js.map +1 -0
  10. package/apps/cli/dist/daemon.d.ts +76 -0
  11. package/apps/cli/dist/daemon.d.ts.map +1 -0
  12. package/apps/cli/dist/daemon.js +189 -0
  13. package/apps/cli/dist/daemon.js.map +1 -0
  14. package/apps/cli/dist/doctor.d.ts +40 -0
  15. package/apps/cli/dist/doctor.d.ts.map +1 -0
  16. package/apps/cli/dist/doctor.js +590 -0
  17. package/apps/cli/dist/doctor.js.map +1 -0
  18. package/apps/cli/dist/index.d.ts +32 -0
  19. package/apps/cli/dist/index.d.ts.map +1 -0
  20. package/apps/cli/dist/index.js +26 -0
  21. package/apps/cli/dist/index.js.map +1 -0
  22. package/apps/cli/dist/main.d.ts +40 -0
  23. package/apps/cli/dist/main.d.ts.map +1 -0
  24. package/apps/cli/dist/main.js +259 -0
  25. package/apps/cli/dist/main.js.map +1 -0
  26. package/apps/cli/dist/runs.d.ts +31 -0
  27. package/apps/cli/dist/runs.d.ts.map +1 -0
  28. package/apps/cli/dist/runs.js +281 -0
  29. package/apps/cli/dist/runs.js.map +1 -0
  30. package/apps/cli/dist/workerDriverLoader.d.ts +64 -0
  31. package/apps/cli/dist/workerDriverLoader.d.ts.map +1 -0
  32. package/apps/cli/dist/workerDriverLoader.js +211 -0
  33. package/apps/cli/dist/workerDriverLoader.js.map +1 -0
  34. package/apps/cli/package.json +57 -0
  35. package/apps/symphony-dashboard/dist/assets/index-B3owF3jd.css +1 -0
  36. package/apps/symphony-dashboard/dist/assets/index-DQ6XlL0d.js +227 -0
  37. package/apps/symphony-dashboard/dist/index.html +18 -0
  38. package/bin/lorenz +16 -0
  39. package/extensions/docker-worker/dist/index.d.ts +92 -0
  40. package/extensions/docker-worker/dist/index.d.ts.map +1 -0
  41. package/extensions/docker-worker/dist/index.js +283 -0
  42. package/extensions/docker-worker/dist/index.js.map +1 -0
  43. package/extensions/docker-worker/package.json +14 -0
  44. package/extensions/jira-tracker/dist/client.d.ts +50 -0
  45. package/extensions/jira-tracker/dist/client.d.ts.map +1 -0
  46. package/extensions/jira-tracker/dist/client.js +619 -0
  47. package/extensions/jira-tracker/dist/client.js.map +1 -0
  48. package/extensions/jira-tracker/dist/index.d.ts +5 -0
  49. package/extensions/jira-tracker/dist/index.d.ts.map +1 -0
  50. package/extensions/jira-tracker/dist/index.js +5 -0
  51. package/extensions/jira-tracker/dist/index.js.map +1 -0
  52. package/extensions/jira-tracker/dist/options.d.ts +38 -0
  53. package/extensions/jira-tracker/dist/options.d.ts.map +1 -0
  54. package/extensions/jira-tracker/dist/options.js +61 -0
  55. package/extensions/jira-tracker/dist/options.js.map +1 -0
  56. package/extensions/jira-tracker/dist/provider.d.ts +6 -0
  57. package/extensions/jira-tracker/dist/provider.d.ts.map +1 -0
  58. package/extensions/jira-tracker/dist/provider.js +178 -0
  59. package/extensions/jira-tracker/dist/provider.js.map +1 -0
  60. package/extensions/jira-tracker/dist/register.d.ts +10 -0
  61. package/extensions/jira-tracker/dist/register.d.ts.map +1 -0
  62. package/extensions/jira-tracker/dist/register.js +15 -0
  63. package/extensions/jira-tracker/dist/register.js.map +1 -0
  64. package/extensions/jira-tracker/package.json +16 -0
  65. package/extensions/linear-tracker/dist/client.d.ts +82 -0
  66. package/extensions/linear-tracker/dist/client.d.ts.map +1 -0
  67. package/extensions/linear-tracker/dist/client.js +622 -0
  68. package/extensions/linear-tracker/dist/client.js.map +1 -0
  69. package/extensions/linear-tracker/dist/index.d.ts +8 -0
  70. package/extensions/linear-tracker/dist/index.d.ts.map +1 -0
  71. package/extensions/linear-tracker/dist/index.js +7 -0
  72. package/extensions/linear-tracker/dist/index.js.map +1 -0
  73. package/extensions/linear-tracker/dist/options.d.ts +32 -0
  74. package/extensions/linear-tracker/dist/options.d.ts.map +1 -0
  75. package/extensions/linear-tracker/dist/options.js +59 -0
  76. package/extensions/linear-tracker/dist/options.js.map +1 -0
  77. package/extensions/linear-tracker/dist/provider.d.ts +4 -0
  78. package/extensions/linear-tracker/dist/provider.d.ts.map +1 -0
  79. package/extensions/linear-tracker/dist/provider.js +58 -0
  80. package/extensions/linear-tracker/dist/provider.js.map +1 -0
  81. package/extensions/linear-tracker/dist/register.d.ts +11 -0
  82. package/extensions/linear-tracker/dist/register.d.ts.map +1 -0
  83. package/extensions/linear-tracker/dist/register.js +19 -0
  84. package/extensions/linear-tracker/dist/register.js.map +1 -0
  85. package/extensions/linear-tracker/dist/toolOps.d.ts +8 -0
  86. package/extensions/linear-tracker/dist/toolOps.d.ts.map +1 -0
  87. package/extensions/linear-tracker/dist/toolOps.js +160 -0
  88. package/extensions/linear-tracker/dist/toolOps.js.map +1 -0
  89. package/extensions/linear-tracker/dist/tools.d.ts +7 -0
  90. package/extensions/linear-tracker/dist/tools.d.ts.map +1 -0
  91. package/extensions/linear-tracker/dist/tools.js +210 -0
  92. package/extensions/linear-tracker/dist/tools.js.map +1 -0
  93. package/extensions/linear-tracker/package.json +18 -0
  94. package/extensions/local-tracker/dist/boardStore.d.ts +116 -0
  95. package/extensions/local-tracker/dist/boardStore.d.ts.map +1 -0
  96. package/extensions/local-tracker/dist/boardStore.js +475 -0
  97. package/extensions/local-tracker/dist/boardStore.js.map +1 -0
  98. package/extensions/local-tracker/dist/client.d.ts +14 -0
  99. package/extensions/local-tracker/dist/client.d.ts.map +1 -0
  100. package/extensions/local-tracker/dist/client.js +27 -0
  101. package/extensions/local-tracker/dist/client.js.map +1 -0
  102. package/extensions/local-tracker/dist/index.d.ts +7 -0
  103. package/extensions/local-tracker/dist/index.d.ts.map +1 -0
  104. package/extensions/local-tracker/dist/index.js +7 -0
  105. package/extensions/local-tracker/dist/index.js.map +1 -0
  106. package/extensions/local-tracker/dist/options.d.ts +31 -0
  107. package/extensions/local-tracker/dist/options.d.ts.map +1 -0
  108. package/extensions/local-tracker/dist/options.js +69 -0
  109. package/extensions/local-tracker/dist/options.js.map +1 -0
  110. package/extensions/local-tracker/dist/provider.d.ts +9 -0
  111. package/extensions/local-tracker/dist/provider.d.ts.map +1 -0
  112. package/extensions/local-tracker/dist/provider.js +35 -0
  113. package/extensions/local-tracker/dist/provider.js.map +1 -0
  114. package/extensions/local-tracker/dist/register.d.ts +11 -0
  115. package/extensions/local-tracker/dist/register.d.ts.map +1 -0
  116. package/extensions/local-tracker/dist/register.js +19 -0
  117. package/extensions/local-tracker/dist/register.js.map +1 -0
  118. package/extensions/local-tracker/dist/resolveBoardDir.d.ts +24 -0
  119. package/extensions/local-tracker/dist/resolveBoardDir.d.ts.map +1 -0
  120. package/extensions/local-tracker/dist/resolveBoardDir.js +39 -0
  121. package/extensions/local-tracker/dist/resolveBoardDir.js.map +1 -0
  122. package/extensions/local-tracker/dist/toolOps.d.ts +9 -0
  123. package/extensions/local-tracker/dist/toolOps.d.ts.map +1 -0
  124. package/extensions/local-tracker/dist/toolOps.js +86 -0
  125. package/extensions/local-tracker/dist/toolOps.js.map +1 -0
  126. package/extensions/local-tracker/dist/tools.d.ts +7 -0
  127. package/extensions/local-tracker/dist/tools.d.ts.map +1 -0
  128. package/extensions/local-tracker/dist/tools.js +170 -0
  129. package/extensions/local-tracker/dist/tools.js.map +1 -0
  130. package/extensions/local-tracker/package.json +18 -0
  131. package/extensions/memory-tracker/dist/index.d.ts +24 -0
  132. package/extensions/memory-tracker/dist/index.d.ts.map +1 -0
  133. package/extensions/memory-tracker/dist/index.js +110 -0
  134. package/extensions/memory-tracker/dist/index.js.map +1 -0
  135. package/extensions/memory-tracker/package.json +16 -0
  136. package/extensions/slack-tracker/dist/client.d.ts +88 -0
  137. package/extensions/slack-tracker/dist/client.d.ts.map +1 -0
  138. package/extensions/slack-tracker/dist/client.js +246 -0
  139. package/extensions/slack-tracker/dist/client.js.map +1 -0
  140. package/extensions/slack-tracker/dist/inMemoryTransport.d.ts +42 -0
  141. package/extensions/slack-tracker/dist/inMemoryTransport.d.ts.map +1 -0
  142. package/extensions/slack-tracker/dist/inMemoryTransport.js +104 -0
  143. package/extensions/slack-tracker/dist/inMemoryTransport.js.map +1 -0
  144. package/extensions/slack-tracker/dist/index.d.ts +15 -0
  145. package/extensions/slack-tracker/dist/index.d.ts.map +1 -0
  146. package/extensions/slack-tracker/dist/index.js +11 -0
  147. package/extensions/slack-tracker/dist/index.js.map +1 -0
  148. package/extensions/slack-tracker/dist/mapping.d.ts +27 -0
  149. package/extensions/slack-tracker/dist/mapping.d.ts.map +1 -0
  150. package/extensions/slack-tracker/dist/mapping.js +109 -0
  151. package/extensions/slack-tracker/dist/mapping.js.map +1 -0
  152. package/extensions/slack-tracker/dist/operations.d.ts +41 -0
  153. package/extensions/slack-tracker/dist/operations.d.ts.map +1 -0
  154. package/extensions/slack-tracker/dist/operations.js +97 -0
  155. package/extensions/slack-tracker/dist/operations.js.map +1 -0
  156. package/extensions/slack-tracker/dist/options.d.ts +30 -0
  157. package/extensions/slack-tracker/dist/options.d.ts.map +1 -0
  158. package/extensions/slack-tracker/dist/options.js +49 -0
  159. package/extensions/slack-tracker/dist/options.js.map +1 -0
  160. package/extensions/slack-tracker/dist/provider.d.ts +9 -0
  161. package/extensions/slack-tracker/dist/provider.d.ts.map +1 -0
  162. package/extensions/slack-tracker/dist/provider.js +74 -0
  163. package/extensions/slack-tracker/dist/provider.js.map +1 -0
  164. package/extensions/slack-tracker/dist/register.d.ts +11 -0
  165. package/extensions/slack-tracker/dist/register.d.ts.map +1 -0
  166. package/extensions/slack-tracker/dist/register.js +19 -0
  167. package/extensions/slack-tracker/dist/register.js.map +1 -0
  168. package/extensions/slack-tracker/dist/threadState.d.ts +52 -0
  169. package/extensions/slack-tracker/dist/threadState.d.ts.map +1 -0
  170. package/extensions/slack-tracker/dist/threadState.js +192 -0
  171. package/extensions/slack-tracker/dist/threadState.js.map +1 -0
  172. package/extensions/slack-tracker/dist/toolOps.d.ts +13 -0
  173. package/extensions/slack-tracker/dist/toolOps.d.ts.map +1 -0
  174. package/extensions/slack-tracker/dist/toolOps.js +76 -0
  175. package/extensions/slack-tracker/dist/toolOps.js.map +1 -0
  176. package/extensions/slack-tracker/dist/tools.d.ts +8 -0
  177. package/extensions/slack-tracker/dist/tools.d.ts.map +1 -0
  178. package/extensions/slack-tracker/dist/tools.js +266 -0
  179. package/extensions/slack-tracker/dist/tools.js.map +1 -0
  180. package/extensions/slack-tracker/dist/transport.d.ts +63 -0
  181. package/extensions/slack-tracker/dist/transport.d.ts.map +1 -0
  182. package/extensions/slack-tracker/dist/transport.js +2 -0
  183. package/extensions/slack-tracker/dist/transport.js.map +1 -0
  184. package/extensions/slack-tracker/dist/webTransport.d.ts +44 -0
  185. package/extensions/slack-tracker/dist/webTransport.d.ts.map +1 -0
  186. package/extensions/slack-tracker/dist/webTransport.js +402 -0
  187. package/extensions/slack-tracker/dist/webTransport.js.map +1 -0
  188. package/extensions/slack-tracker/package.json +17 -0
  189. package/package.json +89 -0
  190. package/packages/acp/dist/childProcess.d.ts +4 -0
  191. package/packages/acp/dist/childProcess.d.ts.map +1 -0
  192. package/packages/acp/dist/childProcess.js +33 -0
  193. package/packages/acp/dist/childProcess.js.map +1 -0
  194. package/packages/acp/dist/index.d.ts +70 -0
  195. package/packages/acp/dist/index.d.ts.map +1 -0
  196. package/packages/acp/dist/index.js +701 -0
  197. package/packages/acp/dist/index.js.map +1 -0
  198. package/packages/acp/dist/options.d.ts +24 -0
  199. package/packages/acp/dist/options.d.ts.map +1 -0
  200. package/packages/acp/dist/options.js +92 -0
  201. package/packages/acp/dist/options.js.map +1 -0
  202. package/packages/acp/dist/toml.d.ts +2 -0
  203. package/packages/acp/dist/toml.d.ts.map +1 -0
  204. package/packages/acp/dist/toml.js +51 -0
  205. package/packages/acp/dist/toml.js.map +1 -0
  206. package/packages/acp/package.json +24 -0
  207. package/packages/agent-runner/dist/index.d.ts +58 -0
  208. package/packages/agent-runner/dist/index.d.ts.map +1 -0
  209. package/packages/agent-runner/dist/index.js +288 -0
  210. package/packages/agent-runner/dist/index.js.map +1 -0
  211. package/packages/agent-runner/package.json +19 -0
  212. package/packages/agent-sdk/dist/index.d.ts +2 -0
  213. package/packages/agent-sdk/dist/index.d.ts.map +1 -0
  214. package/packages/agent-sdk/dist/index.js +2 -0
  215. package/packages/agent-sdk/dist/index.js.map +1 -0
  216. package/packages/agent-sdk/dist/provider.d.ts +66 -0
  217. package/packages/agent-sdk/dist/provider.d.ts.map +1 -0
  218. package/packages/agent-sdk/dist/provider.js +38 -0
  219. package/packages/agent-sdk/dist/provider.js.map +1 -0
  220. package/packages/agent-sdk/package.json +14 -0
  221. package/packages/cli-kit/dist/index.d.ts +20 -0
  222. package/packages/cli-kit/dist/index.d.ts.map +1 -0
  223. package/packages/cli-kit/dist/index.js +72 -0
  224. package/packages/cli-kit/dist/index.js.map +1 -0
  225. package/packages/cli-kit/package.json +14 -0
  226. package/packages/config/dist/aliases.d.ts +10 -0
  227. package/packages/config/dist/aliases.d.ts.map +1 -0
  228. package/packages/config/dist/aliases.js +153 -0
  229. package/packages/config/dist/aliases.js.map +1 -0
  230. package/packages/config/dist/defaults.d.ts +12 -0
  231. package/packages/config/dist/defaults.d.ts.map +1 -0
  232. package/packages/config/dist/defaults.js +78 -0
  233. package/packages/config/dist/defaults.js.map +1 -0
  234. package/packages/config/dist/errors.d.ts +3 -0
  235. package/packages/config/dist/errors.d.ts.map +1 -0
  236. package/packages/config/dist/errors.js +56 -0
  237. package/packages/config/dist/errors.js.map +1 -0
  238. package/packages/config/dist/index.d.ts +5 -0
  239. package/packages/config/dist/index.d.ts.map +1 -0
  240. package/packages/config/dist/index.js +4 -0
  241. package/packages/config/dist/index.js.map +1 -0
  242. package/packages/config/dist/leaf-utils.d.ts +3 -0
  243. package/packages/config/dist/leaf-utils.d.ts.map +1 -0
  244. package/packages/config/dist/leaf-utils.js +9 -0
  245. package/packages/config/dist/leaf-utils.js.map +1 -0
  246. package/packages/config/dist/parse.d.ts +11 -0
  247. package/packages/config/dist/parse.d.ts.map +1 -0
  248. package/packages/config/dist/parse.js +821 -0
  249. package/packages/config/dist/parse.js.map +1 -0
  250. package/packages/config/dist/schemas.d.ts +214 -0
  251. package/packages/config/dist/schemas.d.ts.map +1 -0
  252. package/packages/config/dist/schemas.js +248 -0
  253. package/packages/config/dist/schemas.js.map +1 -0
  254. package/packages/config/package.json +19 -0
  255. package/packages/dispatch/dist/index.d.ts +22 -0
  256. package/packages/dispatch/dist/index.d.ts.map +1 -0
  257. package/packages/dispatch/dist/index.js +117 -0
  258. package/packages/dispatch/dist/index.js.map +1 -0
  259. package/packages/dispatch/package.json +16 -0
  260. package/packages/dispatch-coordinator/dist/coordinator.d.ts +158 -0
  261. package/packages/dispatch-coordinator/dist/coordinator.d.ts.map +1 -0
  262. package/packages/dispatch-coordinator/dist/coordinator.js +529 -0
  263. package/packages/dispatch-coordinator/dist/coordinator.js.map +1 -0
  264. package/packages/dispatch-coordinator/dist/gate.d.ts +24 -0
  265. package/packages/dispatch-coordinator/dist/gate.d.ts.map +1 -0
  266. package/packages/dispatch-coordinator/dist/gate.js +47 -0
  267. package/packages/dispatch-coordinator/dist/gate.js.map +1 -0
  268. package/packages/dispatch-coordinator/dist/index.d.ts +6 -0
  269. package/packages/dispatch-coordinator/dist/index.d.ts.map +1 -0
  270. package/packages/dispatch-coordinator/dist/index.js +16 -0
  271. package/packages/dispatch-coordinator/dist/index.js.map +1 -0
  272. package/packages/dispatch-coordinator/dist/mcpEndpointManager.d.ts +28 -0
  273. package/packages/dispatch-coordinator/dist/mcpEndpointManager.d.ts.map +1 -0
  274. package/packages/dispatch-coordinator/dist/mcpEndpointManager.js +54 -0
  275. package/packages/dispatch-coordinator/dist/mcpEndpointManager.js.map +1 -0
  276. package/packages/dispatch-coordinator/dist/nullEndpointManager.d.ts +18 -0
  277. package/packages/dispatch-coordinator/dist/nullEndpointManager.d.ts.map +1 -0
  278. package/packages/dispatch-coordinator/dist/nullEndpointManager.js +40 -0
  279. package/packages/dispatch-coordinator/dist/nullEndpointManager.js.map +1 -0
  280. package/packages/dispatch-coordinator/dist/types.d.ts +119 -0
  281. package/packages/dispatch-coordinator/dist/types.d.ts.map +1 -0
  282. package/packages/dispatch-coordinator/dist/types.js +17 -0
  283. package/packages/dispatch-coordinator/dist/types.js.map +1 -0
  284. package/packages/dispatch-coordinator/package.json +16 -0
  285. package/packages/domain/dist/index.d.ts +775 -0
  286. package/packages/domain/dist/index.d.ts.map +1 -0
  287. package/packages/domain/dist/index.js +124 -0
  288. package/packages/domain/dist/index.js.map +1 -0
  289. package/packages/domain/package.json +14 -0
  290. package/packages/humanize/dist/index.d.ts +4 -0
  291. package/packages/humanize/dist/index.d.ts.map +1 -0
  292. package/packages/humanize/dist/index.js +347 -0
  293. package/packages/humanize/dist/index.js.map +1 -0
  294. package/packages/humanize/package.json +11 -0
  295. package/packages/issue/dist/index.d.ts +7 -0
  296. package/packages/issue/dist/index.d.ts.map +1 -0
  297. package/packages/issue/dist/index.js +147 -0
  298. package/packages/issue/dist/index.js.map +1 -0
  299. package/packages/issue/package.json +14 -0
  300. package/packages/log-file/dist/index.d.ts +10 -0
  301. package/packages/log-file/dist/index.d.ts.map +1 -0
  302. package/packages/log-file/dist/index.js +200 -0
  303. package/packages/log-file/dist/index.js.map +1 -0
  304. package/packages/log-file/package.json +15 -0
  305. package/packages/mcp/dist/agentEndpoint.d.ts +31 -0
  306. package/packages/mcp/dist/agentEndpoint.d.ts.map +1 -0
  307. package/packages/mcp/dist/agentEndpoint.js +270 -0
  308. package/packages/mcp/dist/agentEndpoint.js.map +1 -0
  309. package/packages/mcp/dist/auth.d.ts +7 -0
  310. package/packages/mcp/dist/auth.d.ts.map +1 -0
  311. package/packages/mcp/dist/auth.js +48 -0
  312. package/packages/mcp/dist/auth.js.map +1 -0
  313. package/packages/mcp/dist/filter.d.ts +70 -0
  314. package/packages/mcp/dist/filter.d.ts.map +1 -0
  315. package/packages/mcp/dist/filter.js +231 -0
  316. package/packages/mcp/dist/filter.js.map +1 -0
  317. package/packages/mcp/dist/index.d.ts +7 -0
  318. package/packages/mcp/dist/index.d.ts.map +1 -0
  319. package/packages/mcp/dist/index.js +5 -0
  320. package/packages/mcp/dist/index.js.map +1 -0
  321. package/packages/mcp/dist/server.d.ts +31 -0
  322. package/packages/mcp/dist/server.d.ts.map +1 -0
  323. package/packages/mcp/dist/server.js +176 -0
  324. package/packages/mcp/dist/server.js.map +1 -0
  325. package/packages/mcp/dist/tools/linear.d.ts +5 -0
  326. package/packages/mcp/dist/tools/linear.d.ts.map +1 -0
  327. package/packages/mcp/dist/tools/linear.js +192 -0
  328. package/packages/mcp/dist/tools/linear.js.map +1 -0
  329. package/packages/mcp/dist/tools/local.d.ts +5 -0
  330. package/packages/mcp/dist/tools/local.d.ts.map +1 -0
  331. package/packages/mcp/dist/tools/local.js +161 -0
  332. package/packages/mcp/dist/tools/local.js.map +1 -0
  333. package/packages/mcp/dist/tools/result.d.ts +5 -0
  334. package/packages/mcp/dist/tools/result.d.ts.map +1 -0
  335. package/packages/mcp/dist/tools/result.js +15 -0
  336. package/packages/mcp/dist/tools/result.js.map +1 -0
  337. package/packages/mcp/dist/tools.d.ts +14 -0
  338. package/packages/mcp/dist/tools.d.ts.map +1 -0
  339. package/packages/mcp/dist/tools.js +58 -0
  340. package/packages/mcp/dist/tools.js.map +1 -0
  341. package/packages/mcp/package.json +20 -0
  342. package/packages/orchestrator/dist/index.d.ts +171 -0
  343. package/packages/orchestrator/dist/index.d.ts.map +1 -0
  344. package/packages/orchestrator/dist/index.js +524 -0
  345. package/packages/orchestrator/dist/index.js.map +1 -0
  346. package/packages/orchestrator/package.json +18 -0
  347. package/packages/policies/dist/index.d.ts +11 -0
  348. package/packages/policies/dist/index.d.ts.map +1 -0
  349. package/packages/policies/dist/index.js +6 -0
  350. package/packages/policies/dist/index.js.map +1 -0
  351. package/packages/policies/dist/reconciliation.d.ts +5 -0
  352. package/packages/policies/dist/reconciliation.d.ts.map +1 -0
  353. package/packages/policies/dist/reconciliation.js +17 -0
  354. package/packages/policies/dist/reconciliation.js.map +1 -0
  355. package/packages/policies/dist/resume.d.ts +14 -0
  356. package/packages/policies/dist/resume.d.ts.map +1 -0
  357. package/packages/policies/dist/resume.js +7 -0
  358. package/packages/policies/dist/resume.js.map +1 -0
  359. package/packages/policies/dist/retry.d.ts +4 -0
  360. package/packages/policies/dist/retry.d.ts.map +1 -0
  361. package/packages/policies/dist/retry.js +7 -0
  362. package/packages/policies/dist/retry.js.map +1 -0
  363. package/packages/policies/dist/stopReason.d.ts +4 -0
  364. package/packages/policies/dist/stopReason.d.ts.map +1 -0
  365. package/packages/policies/dist/stopReason.js +11 -0
  366. package/packages/policies/dist/stopReason.js.map +1 -0
  367. package/packages/policies/dist/usage.d.ts +14 -0
  368. package/packages/policies/dist/usage.d.ts.map +1 -0
  369. package/packages/policies/dist/usage.js +38 -0
  370. package/packages/policies/dist/usage.js.map +1 -0
  371. package/packages/policies/dist/workerHost.d.ts +8 -0
  372. package/packages/policies/dist/workerHost.d.ts.map +1 -0
  373. package/packages/policies/dist/workerHost.js +20 -0
  374. package/packages/policies/dist/workerHost.js.map +1 -0
  375. package/packages/policies/package.json +21 -0
  376. package/packages/presenter/dist/index.d.ts +81 -0
  377. package/packages/presenter/dist/index.d.ts.map +1 -0
  378. package/packages/presenter/dist/index.js +421 -0
  379. package/packages/presenter/dist/index.js.map +1 -0
  380. package/packages/presenter/package.json +16 -0
  381. package/packages/projections/dist/index.d.ts +10 -0
  382. package/packages/projections/dist/index.d.ts.map +1 -0
  383. package/packages/projections/dist/index.js +30 -0
  384. package/packages/projections/dist/index.js.map +1 -0
  385. package/packages/projections/package.json +15 -0
  386. package/packages/prompt/dist/index.d.ts +9 -0
  387. package/packages/prompt/dist/index.d.ts.map +1 -0
  388. package/packages/prompt/dist/index.js +71 -0
  389. package/packages/prompt/dist/index.js.map +1 -0
  390. package/packages/prompt/package.json +16 -0
  391. package/packages/retry-scheduler/dist/index.d.ts +12 -0
  392. package/packages/retry-scheduler/dist/index.d.ts.map +1 -0
  393. package/packages/retry-scheduler/dist/index.js +39 -0
  394. package/packages/retry-scheduler/dist/index.js.map +1 -0
  395. package/packages/retry-scheduler/package.json +15 -0
  396. package/packages/runtime/dist/index.d.ts +157 -0
  397. package/packages/runtime/dist/index.d.ts.map +1 -0
  398. package/packages/runtime/dist/index.js +1074 -0
  399. package/packages/runtime/dist/index.js.map +1 -0
  400. package/packages/runtime/package.json +26 -0
  401. package/packages/runtime-events/dist/index.d.ts +110 -0
  402. package/packages/runtime-events/dist/index.d.ts.map +1 -0
  403. package/packages/runtime-events/dist/index.js +25 -0
  404. package/packages/runtime-events/dist/index.js.map +1 -0
  405. package/packages/runtime-events/package.json +14 -0
  406. package/packages/server/dist/index.d.ts +25 -0
  407. package/packages/server/dist/index.d.ts.map +1 -0
  408. package/packages/server/dist/index.js +213 -0
  409. package/packages/server/dist/index.js.map +1 -0
  410. package/packages/server/dist/issue-store.d.ts +26 -0
  411. package/packages/server/dist/issue-store.d.ts.map +1 -0
  412. package/packages/server/dist/issue-store.js +88 -0
  413. package/packages/server/dist/issue-store.js.map +1 -0
  414. package/packages/server/dist/path-params.d.ts +6 -0
  415. package/packages/server/dist/path-params.d.ts.map +1 -0
  416. package/packages/server/dist/path-params.js +15 -0
  417. package/packages/server/dist/path-params.js.map +1 -0
  418. package/packages/server/dist/source.d.ts +12 -0
  419. package/packages/server/dist/source.d.ts.map +1 -0
  420. package/packages/server/dist/source.js +2 -0
  421. package/packages/server/dist/source.js.map +1 -0
  422. package/packages/server/dist/trace-routes.d.ts +21 -0
  423. package/packages/server/dist/trace-routes.d.ts.map +1 -0
  424. package/packages/server/dist/trace-routes.js +66 -0
  425. package/packages/server/dist/trace-routes.js.map +1 -0
  426. package/packages/server/dist/ws.d.ts +18 -0
  427. package/packages/server/dist/ws.d.ts.map +1 -0
  428. package/packages/server/dist/ws.js +168 -0
  429. package/packages/server/dist/ws.js.map +1 -0
  430. package/packages/server/package.json +22 -0
  431. package/packages/ssh/dist/index.d.ts +33 -0
  432. package/packages/ssh/dist/index.d.ts.map +1 -0
  433. package/packages/ssh/dist/index.js +281 -0
  434. package/packages/ssh/dist/index.js.map +1 -0
  435. package/packages/ssh/package.json +15 -0
  436. package/packages/static-worker/dist/index.d.ts +73 -0
  437. package/packages/static-worker/dist/index.d.ts.map +1 -0
  438. package/packages/static-worker/dist/index.js +150 -0
  439. package/packages/static-worker/dist/index.js.map +1 -0
  440. package/packages/static-worker/package.json +14 -0
  441. package/packages/tool-sdk/dist/filter.d.ts +70 -0
  442. package/packages/tool-sdk/dist/filter.d.ts.map +1 -0
  443. package/packages/tool-sdk/dist/filter.js +231 -0
  444. package/packages/tool-sdk/dist/filter.js.map +1 -0
  445. package/packages/tool-sdk/dist/index.d.ts +6 -0
  446. package/packages/tool-sdk/dist/index.d.ts.map +1 -0
  447. package/packages/tool-sdk/dist/index.js +4 -0
  448. package/packages/tool-sdk/dist/index.js.map +1 -0
  449. package/packages/tool-sdk/dist/provider.d.ts +51 -0
  450. package/packages/tool-sdk/dist/provider.d.ts.map +1 -0
  451. package/packages/tool-sdk/dist/provider.js +2 -0
  452. package/packages/tool-sdk/dist/provider.js.map +1 -0
  453. package/packages/tool-sdk/dist/registry.d.ts +35 -0
  454. package/packages/tool-sdk/dist/registry.d.ts.map +1 -0
  455. package/packages/tool-sdk/dist/registry.js +85 -0
  456. package/packages/tool-sdk/dist/registry.js.map +1 -0
  457. package/packages/tool-sdk/dist/result.d.ts +5 -0
  458. package/packages/tool-sdk/dist/result.d.ts.map +1 -0
  459. package/packages/tool-sdk/dist/result.js +15 -0
  460. package/packages/tool-sdk/dist/result.js.map +1 -0
  461. package/packages/tool-sdk/package.json +14 -0
  462. package/packages/traceviz-emitter/dist/index.d.ts +19 -0
  463. package/packages/traceviz-emitter/dist/index.d.ts.map +1 -0
  464. package/packages/traceviz-emitter/dist/index.js +97 -0
  465. package/packages/traceviz-emitter/dist/index.js.map +1 -0
  466. package/packages/traceviz-emitter/package.json +17 -0
  467. package/packages/traceviz-server/dist/index.d.ts +14 -0
  468. package/packages/traceviz-server/dist/index.d.ts.map +1 -0
  469. package/packages/traceviz-server/dist/index.js +10 -0
  470. package/packages/traceviz-server/dist/index.js.map +1 -0
  471. package/packages/traceviz-server/dist/models/api.d.ts +51 -0
  472. package/packages/traceviz-server/dist/models/api.d.ts.map +1 -0
  473. package/packages/traceviz-server/dist/models/api.js +5 -0
  474. package/packages/traceviz-server/dist/models/api.js.map +1 -0
  475. package/packages/traceviz-server/dist/models/display-events.d.ts +58 -0
  476. package/packages/traceviz-server/dist/models/display-events.d.ts.map +1 -0
  477. package/packages/traceviz-server/dist/models/display-events.js +6 -0
  478. package/packages/traceviz-server/dist/models/display-events.js.map +1 -0
  479. package/packages/traceviz-server/dist/parser.d.ts +14 -0
  480. package/packages/traceviz-server/dist/parser.d.ts.map +1 -0
  481. package/packages/traceviz-server/dist/parser.js +363 -0
  482. package/packages/traceviz-server/dist/parser.js.map +1 -0
  483. package/packages/traceviz-server/dist/stats.d.ts +7 -0
  484. package/packages/traceviz-server/dist/stats.d.ts.map +1 -0
  485. package/packages/traceviz-server/dist/stats.js +81 -0
  486. package/packages/traceviz-server/dist/stats.js.map +1 -0
  487. package/packages/traceviz-server/dist/watcher.d.ts +54 -0
  488. package/packages/traceviz-server/dist/watcher.d.ts.map +1 -0
  489. package/packages/traceviz-server/dist/watcher.js +368 -0
  490. package/packages/traceviz-server/dist/watcher.js.map +1 -0
  491. package/packages/traceviz-server/package.json +16 -0
  492. package/packages/tracker-sdk/dist/index.d.ts +5 -0
  493. package/packages/tracker-sdk/dist/index.d.ts.map +1 -0
  494. package/packages/tracker-sdk/dist/index.js +4 -0
  495. package/packages/tracker-sdk/dist/index.js.map +1 -0
  496. package/packages/tracker-sdk/dist/options.d.ts +20 -0
  497. package/packages/tracker-sdk/dist/options.d.ts.map +1 -0
  498. package/packages/tracker-sdk/dist/options.js +46 -0
  499. package/packages/tracker-sdk/dist/options.js.map +1 -0
  500. package/packages/tracker-sdk/dist/provider.d.ts +104 -0
  501. package/packages/tracker-sdk/dist/provider.d.ts.map +1 -0
  502. package/packages/tracker-sdk/dist/provider.js +2 -0
  503. package/packages/tracker-sdk/dist/provider.js.map +1 -0
  504. package/packages/tracker-sdk/dist/registry.d.ts +26 -0
  505. package/packages/tracker-sdk/dist/registry.d.ts.map +1 -0
  506. package/packages/tracker-sdk/dist/registry.js +52 -0
  507. package/packages/tracker-sdk/dist/registry.js.map +1 -0
  508. package/packages/tracker-sdk/dist/toolPack.d.ts +10 -0
  509. package/packages/tracker-sdk/dist/toolPack.d.ts.map +1 -0
  510. package/packages/tracker-sdk/dist/toolPack.js +185 -0
  511. package/packages/tracker-sdk/dist/toolPack.js.map +1 -0
  512. package/packages/tracker-sdk/package.json +15 -0
  513. package/packages/tui/dist/index.d.ts +35 -0
  514. package/packages/tui/dist/index.d.ts.map +1 -0
  515. package/packages/tui/dist/index.js +354 -0
  516. package/packages/tui/dist/index.js.map +1 -0
  517. package/packages/tui/package.json +18 -0
  518. package/packages/worker-host-pool/dist/index.d.ts +33 -0
  519. package/packages/worker-host-pool/dist/index.d.ts.map +1 -0
  520. package/packages/worker-host-pool/dist/index.js +311 -0
  521. package/packages/worker-host-pool/dist/index.js.map +1 -0
  522. package/packages/worker-host-pool/package.json +14 -0
  523. package/packages/worker-pool/dist/index.d.ts +6 -0
  524. package/packages/worker-pool/dist/index.d.ts.map +1 -0
  525. package/packages/worker-pool/dist/index.js +15 -0
  526. package/packages/worker-pool/dist/index.js.map +1 -0
  527. package/packages/worker-pool/dist/lease.d.ts +36 -0
  528. package/packages/worker-pool/dist/lease.d.ts.map +1 -0
  529. package/packages/worker-pool/dist/lease.js +53 -0
  530. package/packages/worker-pool/dist/lease.js.map +1 -0
  531. package/packages/worker-pool/dist/ledger.d.ts +51 -0
  532. package/packages/worker-pool/dist/ledger.d.ts.map +1 -0
  533. package/packages/worker-pool/dist/ledger.js +165 -0
  534. package/packages/worker-pool/dist/ledger.js.map +1 -0
  535. package/packages/worker-pool/dist/mutex.d.ts +10 -0
  536. package/packages/worker-pool/dist/mutex.d.ts.map +1 -0
  537. package/packages/worker-pool/dist/mutex.js +22 -0
  538. package/packages/worker-pool/dist/mutex.js.map +1 -0
  539. package/packages/worker-pool/dist/pool.d.ts +33 -0
  540. package/packages/worker-pool/dist/pool.d.ts.map +1 -0
  541. package/packages/worker-pool/dist/pool.js +1727 -0
  542. package/packages/worker-pool/dist/pool.js.map +1 -0
  543. package/packages/worker-pool/dist/reaper.d.ts +94 -0
  544. package/packages/worker-pool/dist/reaper.d.ts.map +1 -0
  545. package/packages/worker-pool/dist/reaper.js +295 -0
  546. package/packages/worker-pool/dist/reaper.js.map +1 -0
  547. package/packages/worker-pool/dist/types.d.ts +249 -0
  548. package/packages/worker-pool/dist/types.d.ts.map +1 -0
  549. package/packages/worker-pool/dist/types.js +2 -0
  550. package/packages/worker-pool/dist/types.js.map +1 -0
  551. package/packages/worker-pool/package.json +16 -0
  552. package/packages/worker-sdk/dist/conformance.d.ts +64 -0
  553. package/packages/worker-sdk/dist/conformance.d.ts.map +1 -0
  554. package/packages/worker-sdk/dist/conformance.js +109 -0
  555. package/packages/worker-sdk/dist/conformance.js.map +1 -0
  556. package/packages/worker-sdk/dist/fake.d.ts +76 -0
  557. package/packages/worker-sdk/dist/fake.d.ts.map +1 -0
  558. package/packages/worker-sdk/dist/fake.js +142 -0
  559. package/packages/worker-sdk/dist/fake.js.map +1 -0
  560. package/packages/worker-sdk/dist/index.d.ts +5 -0
  561. package/packages/worker-sdk/dist/index.d.ts.map +1 -0
  562. package/packages/worker-sdk/dist/index.js +10 -0
  563. package/packages/worker-sdk/dist/index.js.map +1 -0
  564. package/packages/worker-sdk/dist/module.d.ts +46 -0
  565. package/packages/worker-sdk/dist/module.d.ts.map +1 -0
  566. package/packages/worker-sdk/dist/module.js +59 -0
  567. package/packages/worker-sdk/dist/module.js.map +1 -0
  568. package/packages/worker-sdk/dist/registry.d.ts +24 -0
  569. package/packages/worker-sdk/dist/registry.d.ts.map +1 -0
  570. package/packages/worker-sdk/dist/registry.js +49 -0
  571. package/packages/worker-sdk/dist/registry.js.map +1 -0
  572. package/packages/worker-sdk/dist/types.d.ts +138 -0
  573. package/packages/worker-sdk/dist/types.d.ts.map +1 -0
  574. package/packages/worker-sdk/dist/types.js +21 -0
  575. package/packages/worker-sdk/dist/types.js.map +1 -0
  576. package/packages/worker-sdk/package.json +15 -0
  577. package/packages/workflow/dist/index.d.ts +33 -0
  578. package/packages/workflow/dist/index.d.ts.map +1 -0
  579. package/packages/workflow/dist/index.js +125 -0
  580. package/packages/workflow/dist/index.js.map +1 -0
  581. package/packages/workflow/package.json +19 -0
  582. package/packages/workspace/dist/index.d.ts +70 -0
  583. package/packages/workspace/dist/index.d.ts.map +1 -0
  584. package/packages/workspace/dist/index.js +1016 -0
  585. package/packages/workspace/dist/index.js.map +1 -0
  586. package/packages/workspace/package.json +17 -0
  587. package/runtime-deps/anthropic-claude-agent-sdk/LICENSE.md +1 -0
  588. package/runtime-deps/anthropic-claude-agent-sdk/README.md +65 -0
  589. package/runtime-deps/anthropic-claude-agent-sdk/agentSdkTypes.d.ts +1 -0
  590. package/runtime-deps/anthropic-claude-agent-sdk/assistant.d.ts +135 -0
  591. package/runtime-deps/anthropic-claude-agent-sdk/assistant.mjs +190 -0
  592. package/runtime-deps/anthropic-claude-agent-sdk/bridge.d.ts +231 -0
  593. package/runtime-deps/anthropic-claude-agent-sdk/bridge.mjs +168 -0
  594. package/runtime-deps/anthropic-claude-agent-sdk/browser-sdk.d.ts +53 -0
  595. package/runtime-deps/anthropic-claude-agent-sdk/browser-sdk.js +93 -0
  596. package/runtime-deps/anthropic-claude-agent-sdk/extractFromBunfs.d.ts +1 -0
  597. package/runtime-deps/anthropic-claude-agent-sdk/extractFromBunfs.js +156 -0
  598. package/runtime-deps/anthropic-claude-agent-sdk/manifest.json +47 -0
  599. package/runtime-deps/anthropic-claude-agent-sdk/manifest.zst.json +55 -0
  600. package/runtime-deps/anthropic-claude-agent-sdk/node_modules/.bin/anthropic-ai-sdk +21 -0
  601. package/runtime-deps/anthropic-claude-agent-sdk/package.json +81 -0
  602. package/runtime-deps/anthropic-claude-agent-sdk/sdk-tools.d.ts +3170 -0
  603. package/runtime-deps/anthropic-claude-agent-sdk/sdk.d.ts +6000 -0
  604. package/runtime-deps/anthropic-claude-agent-sdk/sdk.mjs +119 -0
  605. package/runtime-deps/openai-codex/README.md +60 -0
  606. package/runtime-deps/openai-codex/bin/codex.js +229 -0
  607. package/runtime-deps/openai-codex/bin/rg +79 -0
  608. package/runtime-deps/openai-codex/package.json +22 -0
  609. package/vendor/claude-agent-acp/dist/acp-agent.d.ts +239 -0
  610. package/vendor/claude-agent-acp/dist/acp-agent.d.ts.map +1 -0
  611. package/vendor/claude-agent-acp/dist/acp-agent.js +2693 -0
  612. package/vendor/claude-agent-acp/dist/bundle.js +41230 -0
  613. package/vendor/claude-agent-acp/dist/index.d.ts +3 -0
  614. package/vendor/claude-agent-acp/dist/index.d.ts.map +1 -0
  615. package/vendor/claude-agent-acp/dist/index.js +67 -0
  616. package/vendor/claude-agent-acp/dist/lib.d.ts +6 -0
  617. package/vendor/claude-agent-acp/dist/lib.d.ts.map +1 -0
  618. package/vendor/claude-agent-acp/dist/lib.js +5 -0
  619. package/vendor/claude-agent-acp/dist/settings.d.ts +68 -0
  620. package/vendor/claude-agent-acp/dist/settings.d.ts.map +1 -0
  621. package/vendor/claude-agent-acp/dist/settings.js +182 -0
  622. package/vendor/claude-agent-acp/dist/tools.d.ts +103 -0
  623. package/vendor/claude-agent-acp/dist/tools.d.ts.map +1 -0
  624. package/vendor/claude-agent-acp/dist/tools.js +713 -0
  625. package/vendor/claude-agent-acp/dist/utils.d.ts +16 -0
  626. package/vendor/claude-agent-acp/dist/utils.d.ts.map +1 -0
  627. package/vendor/claude-agent-acp/dist/utils.js +83 -0
  628. package/vendor/claude-agent-acp/package.json +23 -0
  629. package/vendor/codex-acp/dist/index.js +21280 -0
  630. package/vendor/codex-acp/package.json +17 -0
@@ -0,0 +1,529 @@
1
+ // The DispatchCoordinator: STEP 1 is a 1:1 passthrough over the proven
2
+ // @lorenz/worker-pool WorkerPool.
3
+ //
4
+ // With the default settings (slotsPerMachine=1) and the NULL McpEndpointManager
5
+ // (perRunEndpoint=false, mcpEndpoint=null), every operation here is byte-identical
6
+ // at the runtime boundary to calling the underlying WorkerPool directly:
7
+ // - acquireRunSlot calls pool.acquire and, on `leased`, mints a RunSlot whose
8
+ // release/fail/heartbeat delegate straight to the wrapped WorkerLease (so the
9
+ // pool's exactly-once leaseId/generation/DESTROYED guards and poison/healthy
10
+ // classification are unchanged); a `no_capacity` result is returned with the
11
+ // SAME typed reason; a THROWN pool fault PROPAGATES verbatim so the runtime's
12
+ // catch emits worker_pool_acquire_error.
13
+ // - the coordinator itself is the orchestrator's capacity authority: governs()/
14
+ // canAcquire() re-read live pool state each call, and the coordinator is a
15
+ // reload-surviving singleton, so an orchestrator that captured it in its ctor
16
+ // is never stranded by a reconcile.
17
+ // - reconcile/drain/hydrate delegate verbatim; snapshot is the pool snapshot
18
+ // extended with a `slots` view derived from the live registry.
19
+ //
20
+ // The coordinator owns the authoritative per-slot registry (minted-but-unsettled
21
+ // slots) used for collision detection, recycle-driven fail-fast, the tunnel
22
+ // ceiling, and the snapshot.slots view.
23
+ /**
24
+ * Thrown by {@link DispatchCoordinator.acquireRunSlot} when the per-run MCP
25
+ * endpoint fails to OPEN after the WorkerLease was already bound. The just-bound
26
+ * lease has been settled HEALTHY before this is thrown (the worker itself is fine -
27
+ * only the endpoint failed - so it must NOT be poisoned), and NO half-open ssh
28
+ * child / RunSlot is left behind. The runtime catches this exactly like any other
29
+ * thrown acquire fault and emits `worker_pool_acquire_error` (never a partial run).
30
+ * `cause` carries the underlying manager error; `workerHost`/`runKey` identify the
31
+ * run the endpoint was being opened for.
32
+ */
33
+ export class EndpointOpenError extends Error {
34
+ cause;
35
+ workerHost;
36
+ runKey;
37
+ constructor(args) {
38
+ super(`mcp_endpoint_open_failed: ${args.workerHost}#${args.runKey}: ${errorMessage(args.cause)}`);
39
+ this.name = "EndpointOpenError";
40
+ this.cause = args.cause;
41
+ this.workerHost = args.workerHost;
42
+ this.runKey = args.runKey;
43
+ }
44
+ }
45
+ /** Extracts a stable message from an unknown thrown value for the structured error. */
46
+ function errorMessage(error) {
47
+ return error instanceof Error ? error.message : String(error);
48
+ }
49
+ /**
50
+ * The ISSUE-SCOPED per-run key (`${issueId}#${slotIndex}`) feeding the per-run
51
+ * endpoint/tunnel key (`${workerHost}#${runKey}`). It MUST include the issueId so
52
+ * DIFFERENT issues co-residing on ONE workerHost (slotsPerMachine>1; every
53
+ * non-ensemble issue uses slotIndex 0) never collide on the tunnel/port. The
54
+ * ceiling/collision guards remain keyed on (issueId, slotIndex), and the workspace
55
+ * stays issue-isolated by its own identifier path, so only this endpoint key
56
+ * changes. Both `acquireRunSlot` (open) and `createRunSlot` (slot.runKey) derive the
57
+ * key here so the bound slot's `runKey` is byte-identical to the key the endpoint
58
+ * was opened with.
59
+ */
60
+ function runKeyFor(issueId, slotIndex) {
61
+ return `${issueId}#${slotIndex}`;
62
+ }
63
+ /**
64
+ * A `workerHost` is LOCAL (no per-run tunnel is minted; acp keeps its own
65
+ * endpoint) when it is empty. A pool lease's `workerHost` is otherwise always a
66
+ * real ssh address. Mirrors {@link createPerRunEndpointManager}'s host routing so
67
+ * the tunnel-exhaustion ceiling counts ONLY real remote tunnels: a local slot
68
+ * consumes no `ssh -N` child, so it must never be gated by (nor count against) the
69
+ * ceiling.
70
+ */
71
+ function isLocalWorkerHost(workerHost) {
72
+ return workerHost.length === 0;
73
+ }
74
+ /**
75
+ * Thrown by {@link DispatchCoordinator.acquireRunSlot} when a freshly-bound lease
76
+ * would place a SECOND live RunSlot with the SAME `(issueId, slotIndex)` on the
77
+ * SAME machine. `(issueId, slotIndex)` is the key that feeds both the per-run
78
+ * `runKey` (`${slotIndex}`) AND the workspace slot suffix, so two co-resident slots
79
+ * sharing it would collide on BOTH the per-run endpoint/tunnel key and the
80
+ * workspace dir. Rather than silently disambiguate (openQuestion #1), the
81
+ * coordinator ASSERTS-AND-REJECTS: the just-bound lease is settled HEALTHY (the worker
82
+ * itself is fine) and NO slot is registered, so this invariant violation surfaces
83
+ * loudly. The runtime maps the throw to `worker_pool_acquire_error` exactly like any
84
+ * other acquire fault, leaving the first slot untouched.
85
+ */
86
+ export class RunSlotCollisionError extends Error {
87
+ issueId;
88
+ slotIndex;
89
+ machineLeaseId;
90
+ constructor(args) {
91
+ super(`run_slot_collision: (issueId=${args.issueId}, slotIndex=${args.slotIndex}) already live on machine ${args.machineLeaseId}`);
92
+ this.name = "RunSlotCollisionError";
93
+ this.issueId = args.issueId;
94
+ this.slotIndex = args.slotIndex;
95
+ this.machineLeaseId = args.machineLeaseId;
96
+ }
97
+ }
98
+ /**
99
+ * Mints a {@link RunSlot} wrapping a settled-once {@link WorkerLease}. STEP 1 always
100
+ * passes `mcpEndpoint = null` (the null manager mints nothing) so release/fail are
101
+ * byte-identical to the underlying lease settle. The slot holds a single
102
+ * `settled` flag so release/fail are exactly-once on THIS handle (a second call is
103
+ * a no-op and never reaches the lease); the lease itself stays the authoritative
104
+ * leaseId/generation/DESTROYED guard for the recycle path.
105
+ */
106
+ function createRunSlot(args) {
107
+ const { lease, issueId, slotIndex, endpoint, mcpEndpointManager, onSettled, logEvent } = args;
108
+ // runKey is the ISSUE-SCOPED per-run key (`${issueId}#${slotIndex}`). It feeds the
109
+ // per-run endpoint/tunnel key (`${workerHost}#${runKey}`), so it MUST include the
110
+ // issueId: with slotsPerMachine>1, DIFFERENT issues can co-reside on ONE workerHost
111
+ // and a bare `${slotIndex}` (0 for every non-ensemble issue) would collide across
112
+ // issues -> shared tunnel/port, broken per-run isolation. The workspace dir stays
113
+ // issue-isolated by its own identifier path; only this endpoint key needs the issue.
114
+ const runKey = runKeyFor(issueId, slotIndex);
115
+ // slotId is the registry key: unique per (issue, slot, lease generation).
116
+ const slotId = `${issueId}#${slotIndex}#${lease.leaseId}`;
117
+ let settled = false;
118
+ // The single settle path: close THIS slot's endpoint exactly once (a no-op for
119
+ // the null endpoint), delegate to the wrapped lease, then deregister. A second
120
+ // call short-circuits before touching the lease, so settle is exactly-once on
121
+ // this handle while the lease's own guard remains authoritative for the pool.
122
+ //
123
+ // Endpoint cleanup is BEST-EFFORT: we attempt manager.release FIRST (preserving
124
+ // the close-endpoint-BEFORE-settle ordering so no hung tunnel points at a worker
125
+ // about to be returned/recycled), but if it REJECTS - a local mcp server stop /
126
+ // tunnel close that throws - we must NEVER leave the worker lease unsettled or the
127
+ // slot registered. The lease settle + deregister (which also releases any tunnel
128
+ // reservation via onSettled) therefore run in a `finally`, so capacity + tunnel
129
+ // accounting is released regardless. The endpoint error is logged, never thrown
130
+ // to the caller (the runtime would otherwise see a rejected run finalizer instead
131
+ // of a clean settle). The settled-once guard is preserved.
132
+ const settle = async (run) => {
133
+ if (settled)
134
+ return;
135
+ settled = true;
136
+ try {
137
+ await mcpEndpointManager.release(endpoint);
138
+ }
139
+ catch (releaseError) {
140
+ logEvent({
141
+ event: "worker_pool_endpoint_release_failed",
142
+ slotId,
143
+ issueId,
144
+ slotIndex,
145
+ workerHost: lease.workerHost,
146
+ error: errorMessage(releaseError),
147
+ });
148
+ }
149
+ finally {
150
+ await run();
151
+ onSettled(slotId);
152
+ }
153
+ };
154
+ return {
155
+ slotId,
156
+ machineLeaseId: lease.workerId,
157
+ issueId,
158
+ slotIndex,
159
+ leaseId: lease.leaseId,
160
+ workerHost: lease.workerHost,
161
+ runKey,
162
+ mcpEndpoint: endpoint,
163
+ acquiredAtMs: lease.acquiredAtMs,
164
+ heartbeat() {
165
+ lease.heartbeat();
166
+ },
167
+ async release(outcome) {
168
+ await settle(async () => lease.release(outcome));
169
+ },
170
+ async fail(reason) {
171
+ await settle(async () => lease.fail(reason));
172
+ },
173
+ };
174
+ }
175
+ /**
176
+ * Constructs the STEP 1 passthrough {@link DispatchCoordinator}. `settings` is
177
+ * retained for the later reconcile/co-residence paths; in STEP 1 it is not read
178
+ * past construction (the pool owns the live settings). The injected
179
+ * `mcpEndpointManager` is the null passthrough in STEP 1, so every minted slot
180
+ * carries `mcpEndpoint = null` and the coordinator advertises
181
+ * `perRunEndpoint = false`.
182
+ */
183
+ export function createDispatchCoordinator(deps) {
184
+ const { pool, mcpEndpointManager } = deps;
185
+ // Best-effort cleanup-fault sink: when the runtime injects no logEvent (the
186
+ // legacy passthrough callers), endpoint-close faults in the settle path are
187
+ // silently swallowed (the lease still settles regardless).
188
+ const logEvent = deps.logEvent ?? (() => { });
189
+ // The authoritative live-slot registry keyed by slotId. A slot is added on a
190
+ // successful lease-bind and removed on settle; the snapshot.slots view is derived
191
+ // from it, and the recycle callback below scans it by machine.
192
+ const slots = new Map();
193
+ // In-flight `slot.fail` promises started by the recycle callback below, which must
194
+ // stay synchronous (it runs inside the pool's per-worker mutex) and so cannot await
195
+ // them. `drain` awaits this set AFTER the pool drain so per-run endpoint /
196
+ // local-MCP-server / reverse-tunnel cleanup for every recycled slot finishes
197
+ // BEFORE drain returns and the daemon stops the local server - otherwise shutdown
198
+ // races live slot teardown and strands those resources.
199
+ const pendingRecycleFails = new Set();
200
+ // SYNCHRONOUS tunnel reservations held while an acquire is between the ceiling
201
+ // check and a successful registration. The ceiling check passes and increments
202
+ // this in the SAME JS tick (before any `await mcpEndpointManager.open`), so two
203
+ // concurrent acquires can never both slip past a maxConcurrentTunnels ceiling:
204
+ // the second sees the first's pending reservation. Each reservation is released
205
+ // exactly once - on open FAILURE, on a post-open guard rejection, or on slot
206
+ // settlement (via the slot's onSettled) - mirroring the worker pool's single-flight
207
+ // reservedProvisions counter. A negative count is impossible because every
208
+ // increment is paired with exactly one release.
209
+ let reservedTunnels = 0;
210
+ // The live settings the coordinator reads for the tunnel-exhaustion ceiling.
211
+ // `reconcile` updates this in place so a config reload that raises/lowers the
212
+ // ceiling takes effect WITHOUT reconstructing the singleton (the live-slot
213
+ // registry is preserved across the reload). The pool owns its own live settings;
214
+ // this reference is only read for the coordinator-owned tunnel budget.
215
+ let currentSettings = deps.settings;
216
+ // Counts LIVE per-run tunnels: registered slots whose `mcpEndpoint` is non-null
217
+ // (a local / null-endpoint slot consumes no tunnel budget) PLUS the pending
218
+ // reservations held by in-flight acquires that have passed the ceiling check but
219
+ // not yet registered. Including the reservations is what closes the
220
+ // concurrent-acquire race: registration happens only AFTER `await
221
+ // mcpEndpointManager.open`, so without the reservation a second acquire would
222
+ // count zero live tunnels while the first is still mid-open and over-open the
223
+ // ceiling. The registered refcount stays exact via the open-on-bind /
224
+ // close-on-settle lifecycle; the reservation covers the open-in-flight gap.
225
+ const liveTunnelCount = () => {
226
+ let count = reservedTunnels;
227
+ for (const slot of slots.values()) {
228
+ if (slot.mcpEndpoint !== null)
229
+ count += 1;
230
+ }
231
+ return count;
232
+ };
233
+ // Recycle-vs-endpoint ordering invariant: the pool fires this INSIDE the per-worker
234
+ // mutex immediately BEFORE it destroys a machine. We fail every still-open
235
+ // RunSlot bound to that worker CLEANLY - `slot.fail` closes the endpoint (killing
236
+ // the local ssh -N child so no hung tunnel is left pointing at the now-dead
237
+ // host), THEN settles the lease, THEN deregisters - so a poisoned/recycled
238
+ // machine never strands an endpoint and sibling runs see a clean per-run failure.
239
+ // The callback must stay synchronous (it runs inside the mutex), so the matching
240
+ // slots are snapshotted now and their settle is fire-and-forget; `slot.fail` is
241
+ // idempotent so a normal release racing in afterwards is a no-op (exactly-once
242
+ // across BOTH the recycle and the normal path). A settle error is swallowed so a
243
+ // misbehaving endpoint close can never block the pool's teardown.
244
+ //
245
+ // Registration is DEFENSIVE: the runtime keeps accepting a bare `WorkerPool`
246
+ // (wrapped in a null-endpoint passthrough coordinator) for one release to avoid
247
+ // mass test churn, and an older/partial pool injected that way may predate
248
+ // `onMachineRecycling`. The hook is best-effort - a pool without it simply has no
249
+ // recycle-driven fail-fast (the lease settle path still tears the worker down) - so
250
+ // we register only when the pool provides it, never throwing on the passthrough.
251
+ if (typeof pool.onMachineRecycling === "function") {
252
+ pool.onMachineRecycling((workerId) => {
253
+ const affected = [];
254
+ for (const slot of slots.values()) {
255
+ if (slot.machineLeaseId === workerId)
256
+ affected.push(slot);
257
+ }
258
+ for (const slot of affected) {
259
+ // Track the fire-and-forget fail so `drain` can await it (the callback itself
260
+ // must not block the pool's in-mutex teardown). Self-removes on settle.
261
+ const failed = slot.fail("machine_recycled").catch(() => {
262
+ // The slot's lease/endpoint guard is authoritative; swallow so a recycle
263
+ // teardown is never blocked by a slot's settle failure.
264
+ });
265
+ pendingRecycleFails.add(failed);
266
+ void failed.finally(() => pendingRecycleFails.delete(failed));
267
+ }
268
+ });
269
+ }
270
+ const capabilities = { perRunEndpoint: mcpEndpointManager.perRunEndpoint };
271
+ return {
272
+ capabilities,
273
+ async acquireRunSlot(req) {
274
+ // A throw here (ledger / filesystem / provider fault) PROPAGATES verbatim:
275
+ // the runtime's catch maps it to worker_pool_acquire_error. We do NOT wrap it.
276
+ // `AcquireRunSlotRequest` is structurally the pool's `AcquireRequest`, so the
277
+ // request is forwarded 1:1 (no field copy that would re-introduce undefined
278
+ // under exactOptionalPropertyTypes).
279
+ const acquired = await pool.acquire(req);
280
+ if (acquired.status !== "leased") {
281
+ // Preserve the SAME typed no_capacity reason the pool returned; the
282
+ // runtime maps every reason onto the single worker_host_capacity event.
283
+ return { status: "no_capacity", reason: acquired.reason };
284
+ }
285
+ // (issueId, slotIndex) uniqueness invariant (STEP 3 / T3b): `(issueId,
286
+ // slotIndex)` feeds BOTH the per-run `runKey` (`${slotIndex}`) and the
287
+ // workspace slot suffix, so the coordinator must NEVER place two live slots
288
+ // sharing it on ONE machine - they would collide on the endpoint/tunnel key
289
+ // AND the workspace dir. We check the registry RIGHT AFTER bind and BEFORE
290
+ // opening the endpoint (so a colliding endpoint is never minted): if a live
291
+ // slot already holds this (issueId, slotIndex) on this worker, settle the
292
+ // just-bound lease HEALTHY (the worker is fine) and assert-and-reject rather than
293
+ // silently disambiguate (openQuestion #1). The runtime maps the throw to
294
+ // worker_pool_acquire_error, leaving the first slot untouched.
295
+ const machineLeaseId = acquired.lease.workerId;
296
+ for (const existing of slots.values()) {
297
+ if (existing.issueId === req.issueId &&
298
+ existing.slotIndex === req.slotIndex &&
299
+ existing.machineLeaseId === machineLeaseId) {
300
+ try {
301
+ await acquired.lease.release("healthy");
302
+ }
303
+ catch {
304
+ // Swallow: the collision is the surfaced fault; the worker is healthy.
305
+ }
306
+ throw new RunSlotCollisionError({
307
+ issueId: req.issueId,
308
+ slotIndex: req.slotIndex,
309
+ machineLeaseId,
310
+ });
311
+ }
312
+ }
313
+ // STEP 3 (T3c #1): tunnel-exhaustion ceiling. When `maxConcurrentTunnels` is
314
+ // set, opening another per-run endpoint that would exceed it surfaces as a
315
+ // TYPED `no_capacity` ('tunnel_exhausted'), NEVER an unhandled throw inside
316
+ // acquireRunSlot. We check this AFTER lease-bind + the collision guard but
317
+ // BEFORE the open so a budget-exhausted slot never mints (then has to tear
318
+ // down) a tunnel. The ceiling counts ONLY live remote tunnels and applies
319
+ // ONLY when this open would actually mint one - a local (empty) host
320
+ // (and the null passthrough, which mints nothing) consumes no `ssh -N` child,
321
+ // so it is neither gated by nor counted against the budget. The just-bound
322
+ // WorkerLease is settled HEALTHY (the worker is fine; only the tunnel budget is
323
+ // exhausted) and NO slot is registered, so a sibling run recovers via the
324
+ // single `worker_host_capacity` dispatch signal instead of seeing a fault.
325
+ //
326
+ // The ceiling check + the reservation are a SINGLE synchronous step (no
327
+ // `await` between `liveTunnelCount()` and `reservedTunnels += 1`): two
328
+ // concurrent acquires therefore cannot both pass it, because the second's
329
+ // count includes the first's pending reservation. The reservation is held
330
+ // across the (awaited) open so the gap between check and registration cannot
331
+ // be over-subscribed; it is released on open FAILURE and otherwise handed off
332
+ // to the slot's settlement (so the budget is freed exactly once when the run
333
+ // finishes). Mirrors the worker pool's reservedProvisions single-flight.
334
+ const runKey = runKeyFor(req.issueId, req.slotIndex);
335
+ const tunnelCeiling = currentSettings.maxConcurrentTunnels;
336
+ // Whether THIS run actually consumes a per-run MCP endpoint. The Codex/appserver
337
+ // executor runs its dynamic tools IN-PROCESS and ignores the endpoint, so a
338
+ // run that needs none must SKIP the open AND the tunnel reservation/ceiling
339
+ // entirely (it would otherwise be SKIPPED by an open failure / port-forward
340
+ // restriction / maxConcurrentTunnels for an endpoint it never uses). Only
341
+ // ACP/Claude reads `/mcp` over the reverse tunnel. Defaults to `true`
342
+ // (the existing ACP behaviour) when a legacy caller omits the field.
343
+ const needsMcpEndpoint = req.needsMcpEndpoint ?? true;
344
+ const wouldOpenTunnel = needsMcpEndpoint &&
345
+ mcpEndpointManager.perRunEndpoint &&
346
+ !isLocalWorkerHost(acquired.lease.workerHost);
347
+ let tunnelReserved = false;
348
+ if (wouldOpenTunnel && tunnelCeiling !== undefined) {
349
+ if (liveTunnelCount() >= tunnelCeiling) {
350
+ // Settle the just-bound lease HEALTHY (best-effort; a settle hiccup must
351
+ // not mask the capacity signal) and return the typed no_capacity reason.
352
+ try {
353
+ await acquired.lease.release("healthy");
354
+ }
355
+ catch {
356
+ // Swallow: the worker is healthy; the capacity signal is what we surface.
357
+ }
358
+ return { status: "no_capacity", reason: "tunnel_exhausted" };
359
+ }
360
+ // Take the reservation in the SAME JS tick the ceiling check passed.
361
+ reservedTunnels += 1;
362
+ tunnelReserved = true;
363
+ }
364
+ // Releases this acquire's pending tunnel reservation exactly once (a no-op if
365
+ // none was taken or it was already released/handed off).
366
+ const releaseReservation = () => {
367
+ if (tunnelReserved) {
368
+ tunnelReserved = false;
369
+ reservedTunnels -= 1;
370
+ }
371
+ };
372
+ // STEP 2: open the WHOLE per-run endpoint AFTER the lease-bind (the null
373
+ // manager still mints nothing, keeping the single-slot/local path
374
+ // byte-identical). The runKey is the issue-scoped `${issueId}#${slotIndex}`.
375
+ // SKIP the open entirely for a run that consumes no endpoint (Codex/appserver):
376
+ // the slot binds with a null endpoint (no reservation was taken, since
377
+ // wouldOpenTunnel is false when needsMcpEndpoint is false) so it can never be
378
+ // SKIPPED by an open failure / port-forward restriction for an endpoint it
379
+ // would never use. Falls through to the SHARED register-the-slot path below.
380
+ let endpoint = null;
381
+ if (needsMcpEndpoint) {
382
+ try {
383
+ endpoint = await mcpEndpointManager.open({
384
+ // Thread the FULL workflow Settings the REQUEST carries (NOT the
385
+ // coordinator's WorkerPoolSettings). The concrete per-run manager reads
386
+ // `settings.server.port` via acquireAgentMcpEndpointForRun to build the
387
+ // remote endpoint; a WorkerPoolSettings has no server.port, so forwarding it
388
+ // would fail every acquire and never dispatch. The null manager ignores it.
389
+ // The production runtime ALWAYS supplies the full Settings here; the
390
+ // `?? currentSettings` bridge only covers a legacy passthrough caller that
391
+ // pre-dates the request field (which already injects a full Settings as its
392
+ // coordinator `settings`), so the no-server.port WorkerPoolSettings never
393
+ // reaches the concrete manager.
394
+ settings: req.settings ?? currentSettings,
395
+ workerHost: acquired.lease.workerHost,
396
+ runKey,
397
+ });
398
+ }
399
+ catch (openError) {
400
+ // The endpoint failed to OPEN after the lease was already bound. The worker
401
+ // itself is fine (only the endpoint failed), so settle the just-bound lease
402
+ // HEALTHY - never poison it - and leave NO half-open child / RunSlot. The
403
+ // pending tunnel reservation is released here (the open never minted a
404
+ // tunnel) so a failed open never strands budget. A failure to settle here
405
+ // must not mask the original open error, so the settle is best-effort.
406
+ // Rethrow a structured acquire error the runtime maps to
407
+ // worker_pool_acquire_error.
408
+ releaseReservation();
409
+ try {
410
+ await acquired.lease.release("healthy");
411
+ }
412
+ catch {
413
+ // Swallow: the original endpoint-open failure is the surfaced cause.
414
+ }
415
+ throw new EndpointOpenError({
416
+ cause: openError,
417
+ workerHost: acquired.lease.workerHost,
418
+ runKey,
419
+ });
420
+ }
421
+ }
422
+ const slot = createRunSlot({
423
+ lease: acquired.lease,
424
+ issueId: req.issueId,
425
+ slotIndex: req.slotIndex,
426
+ endpoint,
427
+ mcpEndpointManager,
428
+ logEvent,
429
+ onSettled: (slotId) => {
430
+ slots.delete(slotId);
431
+ },
432
+ });
433
+ slots.set(slot.slotId, slot);
434
+ // Hand the budget from the pending reservation to the now-registered slot in
435
+ // the SAME synchronous tick as the `slots.set` (no `await` between them, so a
436
+ // concurrent acquire can never observe a moment where neither the reservation
437
+ // nor the registered slot is counted). A registered slot whose `mcpEndpoint`
438
+ // is non-null is itself counted by `liveTunnelCount`, so keeping the
439
+ // reservation too would DOUBLE-count this tunnel; release it here.
440
+ releaseReservation();
441
+ return { status: "bound", slot };
442
+ },
443
+ // The coordinator IS the orchestrator's capacity authority: both methods
444
+ // re-read live pool state on every call (never a cached snapshot), so a
445
+ // reconcile that disables the pool is observed immediately.
446
+ governs() {
447
+ return pool.isEnabled();
448
+ },
449
+ canAcquire() {
450
+ return pool.canAcquire();
451
+ },
452
+ onCapacityAvailable(cb) {
453
+ // Forward to the pool's additive hook when present. Registration is
454
+ // DEFENSIVE like onMachineRecycling above: an older/partial pool injected
455
+ // via the bare-workerPool passthrough may predate the hook, in which case the
456
+ // runtime simply keeps its interval-only polling.
457
+ pool.onCapacityAvailable?.(cb);
458
+ },
459
+ async reconcile(next) {
460
+ // Load any out-of-tree driver module FIRST (only when the next settings are
461
+ // enabled, mirroring the pool's disable path which skips swapDriver
462
+ // entirely): the injected loader dynamic-imports + registers the module so
463
+ // the pool's registry resolution below stays synchronous. A load failure
464
+ // rejects here, BEFORE the pool is touched - the same transactional
465
+ // last-good behavior as a pool rollback. A module registered for a
466
+ // reconcile that later throws is harmless: the registry is a catalog, and
467
+ // an unused entry is inert.
468
+ if (next.enabled)
469
+ await deps.driverLoader?.(next.driver);
470
+ // Reconcile the pool NEXT: pool.reconcile -> swapDriver -> registry resolve
471
+ // can THROW (e.g. worker_pool_driver_unavailable) when a reload changes the
472
+ // driver to an unavailable kind, and the pool rolls itself back to last-good
473
+ // on that throw. Only AFTER it succeeds do we commit the coordinator-owned
474
+ // settings (the tunnel-exhaustion ceiling) so a rejected reload cannot strand
475
+ // currentSettings on a config the pool refused - keeping the reload
476
+ // transactional end-to-end. The live-slot registry is preserved across the
477
+ // reload (so per-issue accounting and the tunnel refcount cannot desync), and
478
+ // the singleton is NOT reconstructed.
479
+ pool.reconcile(next);
480
+ currentSettings = next;
481
+ },
482
+ async drain(opts) {
483
+ await pool.drain(opts);
484
+ // The pool's force-destroy fired the recycle callback for every worker, starting
485
+ // each bound slot's fail() (fire-and-forget there). Await those so per-run
486
+ // endpoint / local-server / tunnel cleanup is fully settled before drain
487
+ // returns and the daemon stops the local MCP server and exits.
488
+ if (pendingRecycleFails.size > 0) {
489
+ await Promise.allSettled([...pendingRecycleFails]);
490
+ }
491
+ },
492
+ async hydrate() {
493
+ await pool.hydrate();
494
+ },
495
+ snapshot() {
496
+ const base = pool.snapshot();
497
+ const slotEntries = [];
498
+ for (const slot of slots.values()) {
499
+ slotEntries.push({
500
+ slotId: slot.slotId,
501
+ machineLeaseId: slot.machineLeaseId,
502
+ issueId: slot.issueId,
503
+ slotIndex: slot.slotIndex,
504
+ workerHost: slot.workerHost,
505
+ remotePort: remotePortFromEndpoint(slot.mcpEndpoint),
506
+ });
507
+ }
508
+ return { ...base, slots: slotEntries };
509
+ },
510
+ };
511
+ }
512
+ /**
513
+ * The remote port a slot's per-run MCP endpoint is bound to, derived from the
514
+ * lease URL (`http://127.0.0.1:<remotePort>/...` on the worker side). `null`
515
+ * when no endpoint is bound (null endpoint manager, local worker host, or a
516
+ * URL without an explicit port).
517
+ */
518
+ function remotePortFromEndpoint(endpoint) {
519
+ if (!endpoint)
520
+ return null;
521
+ try {
522
+ const port = Number(new URL(endpoint.url).port);
523
+ return Number.isInteger(port) && port > 0 ? port : null;
524
+ }
525
+ catch {
526
+ return null;
527
+ }
528
+ }
529
+ //# sourceMappingURL=coordinator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator.js","sourceRoot":"","sources":["../src/coordinator.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,kCAAkC;AAClC,EAAE;AACF,gFAAgF;AAChF,mFAAmF;AACnF,yEAAyE;AACzE,gFAAgF;AAChF,kFAAkF;AAClF,iFAAiF;AACjF,iFAAiF;AACjF,kFAAkF;AAClF,6CAA6C;AAC7C,kFAAkF;AAClF,+EAA+E;AAC/E,kFAAkF;AAClF,wCAAwC;AACxC,+EAA+E;AAC/E,mEAAmE;AACnE,EAAE;AACF,iFAAiF;AACjF,4EAA4E;AAC5E,wCAAwC;AAkCxC;;;;;;;;;GASG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACxB,KAAK,CAAU;IACxB,UAAU,CAAS;IACnB,MAAM,CAAS;IAExB,YAAY,IAA4D;QACtE,KAAK,CACH,6BAA6B,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,KAAK,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAC3F,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAC5B,CAAC;CACF;AAED,uFAAuF;AACvF,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,SAAS,CAAC,OAAe,EAAE,SAAiB;IACnD,OAAO,GAAG,OAAO,IAAI,SAAS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,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { WorkerPoolSettings } from "@lorenz/domain";
2
+ /** The subset of a coordinator's capabilities the gate consumes. */
3
+ export interface SlotsPerMachineGateCapabilities {
4
+ readonly perRunEndpoint: boolean;
5
+ }
6
+ /**
7
+ * Returns an operator-facing error message when `workerPool` would be unsafe to run,
8
+ * or `null` when it passes. Co-residence packs multiple run slots onto one machine,
9
+ * so `slotsPerMachine > 1` requires BOTH:
10
+ *
11
+ * 1. a coordinator that advertises `capabilities.perRunEndpoint === true` (each
12
+ * RunSlot owns its own MCP endpoint - token + local-server + tunnel - so two
13
+ * co-resident runs never share or tear out each other's endpoint), and
14
+ * 2. an explicit `worker.worker_pool.co_residence` operator opt-in, because a single
15
+ * poisoned worker fails every co-resident run on recycle: widening that blast
16
+ * radius is a deliberate tradeoff, not just a capability.
17
+ *
18
+ * `slotsPerMachine === 1` (the default), an absent pool, a DISABLED pool (a dormant
19
+ * `max_in_flight > 1` is unused while the pool is off - runs go static/local), or
20
+ * absent capabilities all return `null` - the gate never triggers, so the
21
+ * single-tenant path stays byte-identical.
22
+ */
23
+ export declare function checkSlotsPerMachineGate(workerPool: WorkerPoolSettings | undefined, capabilities: SlotsPerMachineGateCapabilities | undefined): string | null;
24
+ //# sourceMappingURL=gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,oEAAoE;AACpE,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,kBAAkB,GAAG,SAAS,EAC1C,YAAY,EAAE,+BAA+B,GAAG,SAAS,GACxD,MAAM,GAAG,IAAI,CAkBf"}
@@ -0,0 +1,47 @@
1
+ // Pure predicate behind the `worker.worker_pool.slots_per_machine > 1` co-residence
2
+ // safety gate. Extracted here (a leaf, dependency-light module) so the SAME check
3
+ // drives BOTH enforcement points without duplication or drift:
4
+ //
5
+ // 1. the daemon STARTUP gate (`assertSlotsPerMachineGate` in the CLI), which
6
+ // throws the returned message, and
7
+ // 2. the runtime RELOAD guard (`reloadWorkflowIfConfigured`), which keeps the
8
+ // last-good settings and emits `workflow_reload_failed` with the message
9
+ // instead of reconciling the live pool onto unsafe co-resident settings.
10
+ //
11
+ // Keeping it pure (settings + capability flag in, message-or-null out) means the
12
+ // reload path can run the exact gate the daemon ran at startup, closing the hole
13
+ // where a live daemon could reload `max_in_flight > 1` past a gate that only ran
14
+ // once at boot.
15
+ /**
16
+ * Returns an operator-facing error message when `workerPool` would be unsafe to run,
17
+ * or `null` when it passes. Co-residence packs multiple run slots onto one machine,
18
+ * so `slotsPerMachine > 1` requires BOTH:
19
+ *
20
+ * 1. a coordinator that advertises `capabilities.perRunEndpoint === true` (each
21
+ * RunSlot owns its own MCP endpoint - token + local-server + tunnel - so two
22
+ * co-resident runs never share or tear out each other's endpoint), and
23
+ * 2. an explicit `worker.worker_pool.co_residence` operator opt-in, because a single
24
+ * poisoned worker fails every co-resident run on recycle: widening that blast
25
+ * radius is a deliberate tradeoff, not just a capability.
26
+ *
27
+ * `slotsPerMachine === 1` (the default), an absent pool, a DISABLED pool (a dormant
28
+ * `max_in_flight > 1` is unused while the pool is off - runs go static/local), or
29
+ * absent capabilities all return `null` - the gate never triggers, so the
30
+ * single-tenant path stays byte-identical.
31
+ */
32
+ export function checkSlotsPerMachineGate(workerPool, capabilities) {
33
+ if (!workerPool || workerPool.enabled === false || workerPool.slotsPerMachine <= 1)
34
+ return null;
35
+ if (capabilities?.perRunEndpoint !== true) {
36
+ return ("worker.worker_pool.max_in_flight > 1 requires a dispatch coordinator with per-run MCP " +
37
+ "endpoints (capabilities.perRunEndpoint), which the current build does not provide");
38
+ }
39
+ if (workerPool.coResidence !== true) {
40
+ return ("worker.worker_pool.max_in_flight > 1 requires the explicit worker.worker_pool.co_residence " +
41
+ "opt-in: co-residence shares one machine across runs, so a poisoned worker fails every " +
42
+ "co-resident run on recycle. Set worker.worker_pool.co_residence: true to accept this " +
43
+ "blast radius");
44
+ }
45
+ return null;
46
+ }
47
+ //# sourceMappingURL=gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gate.js","sourceRoot":"","sources":["../src/gate.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,kFAAkF;AAClF,+DAA+D;AAC/D,EAAE;AACF,+EAA+E;AAC/E,wCAAwC;AACxC,gFAAgF;AAChF,8EAA8E;AAC9E,8EAA8E;AAC9E,EAAE;AACF,iFAAiF;AACjF,iFAAiF;AACjF,iFAAiF;AACjF,gBAAgB;AAShB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,wBAAwB,CACtC,UAA0C,EAC1C,YAAyD;IAEzD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,IAAI,UAAU,CAAC,eAAe,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAEhG,IAAI,YAAY,EAAE,cAAc,KAAK,IAAI,EAAE,CAAC;QAC1C,OAAO,CACL,wFAAwF;YACxF,mFAAmF,CACpF,CAAC;IACJ,CAAC;IACD,IAAI,UAAU,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;QACpC,OAAO,CACL,6FAA6F;YAC7F,wFAAwF;YACxF,uFAAuF;YACvF,cAAc,CACf,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { createDispatchCoordinator, EndpointOpenError, RunSlotCollisionError, type DispatchCoordinator, type CreateDispatchCoordinatorDeps, type AcquireRunSlotResult, type NoCapacityReason, type CapacityProbe, type DispatchCoordinatorSnapshot, type RunSlotSnapshotEntry, } from "./coordinator.js";
2
+ export { type RunSlot, type AcquireRunSlotRequest, type McpEndpointManager } from "./types.js";
3
+ export { nullEndpointManager, createNullEndpointManager } from "./nullEndpointManager.js";
4
+ export { createPerRunEndpointManager, type CreatePerRunEndpointManagerDeps, type AcquireAgentMcpEndpointForRun, } from "./mcpEndpointManager.js";
5
+ export { checkSlotsPerMachineGate, type SlotsPerMachineGateCapabilities } from "./gate.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,GAC1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE/F,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1F,OAAO,EACL,2BAA2B,EAC3B,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,GACnC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,wBAAwB,EAAE,KAAK,+BAA+B,EAAE,MAAM,WAAW,CAAC"}