@moltzap/client 2026.812.0 → 2026.902.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 (392) hide show
  1. package/LICENSE +202 -21
  2. package/NOTICE +19 -0
  3. package/README.md +50 -0
  4. package/bin/moltzapd +9 -0
  5. package/dist/client-runtime.d.ts +10 -0
  6. package/dist/client-runtime.d.ts.map +1 -0
  7. package/dist/client-runtime.js +218 -0
  8. package/dist/client-runtime.js.map +1 -0
  9. package/dist/contract.d.ts +338 -0
  10. package/dist/contract.d.ts.map +1 -0
  11. package/dist/contract.js +213 -0
  12. package/dist/contract.js.map +1 -0
  13. package/dist/contract.types-check.d.ts +99 -0
  14. package/dist/contract.types-check.d.ts.map +1 -0
  15. package/dist/contract.types-check.js +7 -0
  16. package/dist/contract.types-check.js.map +1 -0
  17. package/dist/daemon/configuration.d.ts +46 -0
  18. package/dist/daemon/configuration.d.ts.map +1 -0
  19. package/dist/daemon/configuration.js +69 -0
  20. package/dist/daemon/configuration.js.map +1 -0
  21. package/dist/daemon/management.d.ts +23 -0
  22. package/dist/daemon/management.d.ts.map +1 -0
  23. package/dist/daemon/management.js +489 -0
  24. package/dist/daemon/management.js.map +1 -0
  25. package/dist/daemon/registration.d.ts +72 -0
  26. package/dist/daemon/registration.d.ts.map +1 -0
  27. package/dist/daemon/registration.js +109 -0
  28. package/dist/daemon/registration.js.map +1 -0
  29. package/dist/daemon/runtime/activation.d.ts +95 -0
  30. package/dist/daemon/runtime/activation.d.ts.map +1 -0
  31. package/dist/daemon/runtime/activation.js +99 -0
  32. package/dist/daemon/runtime/activation.js.map +1 -0
  33. package/dist/daemon/runtime/controller.d.ts +34 -0
  34. package/dist/daemon/runtime/controller.d.ts.map +1 -0
  35. package/dist/daemon/runtime/controller.js +106 -0
  36. package/dist/daemon/runtime/controller.js.map +1 -0
  37. package/dist/daemon/runtime/history-export.d.ts +23 -0
  38. package/dist/daemon/runtime/history-export.d.ts.map +1 -0
  39. package/dist/daemon/runtime/history-export.js +47 -0
  40. package/dist/daemon/runtime/history-export.js.map +1 -0
  41. package/dist/daemon/runtime/index.d.ts +24 -0
  42. package/dist/daemon/runtime/index.d.ts.map +1 -0
  43. package/dist/daemon/runtime/index.js +65 -0
  44. package/dist/daemon/runtime/index.js.map +1 -0
  45. package/dist/daemon/runtime/protocol.d.ts +63 -0
  46. package/dist/daemon/runtime/protocol.d.ts.map +1 -0
  47. package/dist/daemon/runtime/protocol.js +133 -0
  48. package/dist/daemon/runtime/protocol.js.map +1 -0
  49. package/dist/endpoint/addressing/index.d.ts +39 -0
  50. package/dist/endpoint/addressing/index.d.ts.map +1 -0
  51. package/dist/endpoint/addressing/index.js +114 -0
  52. package/dist/endpoint/addressing/index.js.map +1 -0
  53. package/dist/endpoint/engine-dissemination.d.ts +11 -0
  54. package/dist/endpoint/engine-dissemination.d.ts.map +1 -0
  55. package/dist/endpoint/engine-dissemination.js +71 -0
  56. package/dist/endpoint/engine-dissemination.js.map +1 -0
  57. package/dist/endpoint/engine-durability.d.ts +69 -0
  58. package/dist/endpoint/engine-durability.d.ts.map +1 -0
  59. package/dist/endpoint/engine-durability.js +210 -0
  60. package/dist/endpoint/engine-durability.js.map +1 -0
  61. package/dist/endpoint/engine-send.d.ts +50 -0
  62. package/dist/endpoint/engine-send.d.ts.map +1 -0
  63. package/dist/endpoint/engine-send.js +422 -0
  64. package/dist/endpoint/engine-send.js.map +1 -0
  65. package/dist/endpoint/engine-types.d.ts +132 -0
  66. package/dist/endpoint/engine-types.d.ts.map +1 -0
  67. package/dist/endpoint/engine-types.js +13 -0
  68. package/dist/endpoint/engine-types.js.map +1 -0
  69. package/dist/endpoint/engine.d.ts +14 -0
  70. package/dist/endpoint/engine.d.ts.map +1 -0
  71. package/dist/endpoint/engine.js +280 -0
  72. package/dist/endpoint/engine.js.map +1 -0
  73. package/dist/endpoint/protocol/evidence.d.ts +37 -0
  74. package/dist/endpoint/protocol/evidence.d.ts.map +1 -0
  75. package/dist/endpoint/protocol/evidence.js +80 -0
  76. package/dist/endpoint/protocol/evidence.js.map +1 -0
  77. package/dist/endpoint/protocol/index.d.ts +26 -0
  78. package/dist/endpoint/protocol/index.d.ts.map +1 -0
  79. package/dist/endpoint/protocol/index.js +543 -0
  80. package/dist/endpoint/protocol/index.js.map +1 -0
  81. package/dist/endpoint/recovery/barrier.d.ts +23 -0
  82. package/dist/endpoint/recovery/barrier.d.ts.map +1 -0
  83. package/dist/endpoint/recovery/barrier.js +47 -0
  84. package/dist/endpoint/recovery/barrier.js.map +1 -0
  85. package/dist/endpoint/recovery/index.d.ts +29 -0
  86. package/dist/endpoint/recovery/index.d.ts.map +1 -0
  87. package/dist/endpoint/recovery/index.js +489 -0
  88. package/dist/endpoint/recovery/index.js.map +1 -0
  89. package/dist/endpoint/recovery/reanchor/empty.d.ts +22 -0
  90. package/dist/endpoint/recovery/reanchor/empty.d.ts.map +1 -0
  91. package/dist/endpoint/recovery/reanchor/empty.js +163 -0
  92. package/dist/endpoint/recovery/reanchor/empty.js.map +1 -0
  93. package/dist/endpoint/recovery/reanchor/index.d.ts +30 -0
  94. package/dist/endpoint/recovery/reanchor/index.d.ts.map +1 -0
  95. package/dist/endpoint/recovery/reanchor/index.js +479 -0
  96. package/dist/endpoint/recovery/reanchor/index.js.map +1 -0
  97. package/dist/endpoint/recovery/state.d.ts +130 -0
  98. package/dist/endpoint/recovery/state.d.ts.map +1 -0
  99. package/dist/endpoint/recovery/state.js +296 -0
  100. package/dist/endpoint/recovery/state.js.map +1 -0
  101. package/dist/endpoint/recovery/store-evidence.d.ts +17 -0
  102. package/dist/endpoint/recovery/store-evidence.d.ts.map +1 -0
  103. package/dist/endpoint/recovery/store-evidence.js +79 -0
  104. package/dist/endpoint/recovery/store-evidence.js.map +1 -0
  105. package/dist/endpoint/recovery/store.d.ts +56 -0
  106. package/dist/endpoint/recovery/store.d.ts.map +1 -0
  107. package/dist/endpoint/recovery/store.js +499 -0
  108. package/dist/endpoint/recovery/store.js.map +1 -0
  109. package/dist/endpoint/representation-canonical.d.ts +17 -0
  110. package/dist/endpoint/representation-canonical.d.ts.map +1 -0
  111. package/dist/endpoint/representation-canonical.js +48 -0
  112. package/dist/endpoint/representation-canonical.js.map +1 -0
  113. package/dist/endpoint/representation-codec.d.ts +51 -0
  114. package/dist/endpoint/representation-codec.d.ts.map +1 -0
  115. package/dist/endpoint/representation-codec.js +159 -0
  116. package/dist/endpoint/representation-codec.js.map +1 -0
  117. package/dist/endpoint/representation-schemas.d.ts +1831 -0
  118. package/dist/endpoint/representation-schemas.d.ts.map +1 -0
  119. package/dist/endpoint/representation-schemas.js +195 -0
  120. package/dist/endpoint/representation-schemas.js.map +1 -0
  121. package/dist/endpoint/representation-verification.d.ts +79 -0
  122. package/dist/endpoint/representation-verification.d.ts.map +1 -0
  123. package/dist/endpoint/representation-verification.js +420 -0
  124. package/dist/endpoint/representation-verification.js.map +1 -0
  125. package/dist/endpoint/representation.d.ts +6 -0
  126. package/dist/endpoint/representation.d.ts.map +1 -0
  127. package/dist/endpoint/representation.js +8 -0
  128. package/dist/endpoint/representation.js.map +1 -0
  129. package/dist/endpoint/router-worker/index.d.ts +16 -0
  130. package/dist/endpoint/router-worker/index.d.ts.map +1 -0
  131. package/dist/endpoint/router-worker/index.js +547 -0
  132. package/dist/endpoint/router-worker/index.js.map +1 -0
  133. package/dist/endpoint/router-worker/types.d.ts +183 -0
  134. package/dist/endpoint/router-worker/types.d.ts.map +1 -0
  135. package/dist/endpoint/router-worker/types.js +31 -0
  136. package/dist/endpoint/router-worker/types.js.map +1 -0
  137. package/dist/endpoint/store/anchors.d.ts +83 -0
  138. package/dist/endpoint/store/anchors.d.ts.map +1 -0
  139. package/dist/endpoint/store/anchors.js +471 -0
  140. package/dist/endpoint/store/anchors.js.map +1 -0
  141. package/dist/endpoint/store/database/index.d.ts +6 -0
  142. package/dist/endpoint/store/database/index.d.ts.map +1 -0
  143. package/dist/endpoint/store/database/index.js +6 -0
  144. package/dist/endpoint/store/database/index.js.map +1 -0
  145. package/dist/endpoint/store/database/schema.d.ts +44 -0
  146. package/dist/endpoint/store/database/schema.d.ts.map +1 -0
  147. package/dist/endpoint/store/database/schema.js +345 -0
  148. package/dist/endpoint/store/database/schema.js.map +1 -0
  149. package/dist/endpoint/store/database/values.d.ts +119 -0
  150. package/dist/endpoint/store/database/values.d.ts.map +1 -0
  151. package/dist/endpoint/store/database/values.js +194 -0
  152. package/dist/endpoint/store/database/values.js.map +1 -0
  153. package/dist/endpoint/store/deliveries.d.ts +38 -0
  154. package/dist/endpoint/store/deliveries.d.ts.map +1 -0
  155. package/dist/endpoint/store/deliveries.js +124 -0
  156. package/dist/endpoint/store/deliveries.js.map +1 -0
  157. package/dist/endpoint/store/dissemination.d.ts +27 -0
  158. package/dist/endpoint/store/dissemination.d.ts.map +1 -0
  159. package/dist/endpoint/store/dissemination.js +139 -0
  160. package/dist/endpoint/store/dissemination.js.map +1 -0
  161. package/dist/endpoint/store/index.d.ts +15 -0
  162. package/dist/endpoint/store/index.d.ts.map +1 -0
  163. package/dist/endpoint/store/index.js +76 -0
  164. package/dist/endpoint/store/index.js.map +1 -0
  165. package/dist/endpoint/store/management.d.ts +42 -0
  166. package/dist/endpoint/store/management.d.ts.map +1 -0
  167. package/dist/endpoint/store/management.js +259 -0
  168. package/dist/endpoint/store/management.js.map +1 -0
  169. package/dist/endpoint/store/outbound.d.ts +62 -0
  170. package/dist/endpoint/store/outbound.d.ts.map +1 -0
  171. package/dist/endpoint/store/outbound.js +278 -0
  172. package/dist/endpoint/store/outbound.js.map +1 -0
  173. package/dist/endpoint/store/records.d.ts +56 -0
  174. package/dist/endpoint/store/records.d.ts.map +1 -0
  175. package/dist/endpoint/store/records.js +352 -0
  176. package/dist/endpoint/store/records.js.map +1 -0
  177. package/dist/endpoint/store/rows/index.d.ts +138 -0
  178. package/dist/endpoint/store/rows/index.d.ts.map +1 -0
  179. package/dist/endpoint/store/rows/index.js +307 -0
  180. package/dist/endpoint/store/rows/index.js.map +1 -0
  181. package/dist/endpoint/store/types.d.ts +223 -0
  182. package/dist/endpoint/store/types.d.ts.map +1 -0
  183. package/dist/endpoint/store/types.js +15 -0
  184. package/dist/endpoint/store/types.js.map +1 -0
  185. package/dist/endpoint/store.d.ts +10 -0
  186. package/dist/endpoint/store.d.ts.map +1 -0
  187. package/dist/endpoint/store.js +6 -0
  188. package/dist/endpoint/store.js.map +1 -0
  189. package/dist/harness-mcp-contract.d.ts +101 -0
  190. package/dist/harness-mcp-contract.d.ts.map +1 -0
  191. package/dist/harness-mcp-contract.js +61 -0
  192. package/dist/harness-mcp-contract.js.map +1 -0
  193. package/dist/{harness-mcp-server.d.ts → harness-mcp-http.d.ts} +9 -8
  194. package/dist/harness-mcp-http.d.ts.map +1 -0
  195. package/dist/{harness-mcp-server.js → harness-mcp-http.js} +38 -60
  196. package/dist/harness-mcp-http.js.map +1 -0
  197. package/dist/harness-mcp-subscription.d.ts +12 -7
  198. package/dist/harness-mcp-subscription.d.ts.map +1 -1
  199. package/dist/harness-mcp-subscription.js +113 -100
  200. package/dist/harness-mcp-subscription.js.map +1 -1
  201. package/dist/harness-mcp-wire.d.ts +24 -49
  202. package/dist/harness-mcp-wire.d.ts.map +1 -1
  203. package/dist/harness-mcp-wire.js +381 -124
  204. package/dist/harness-mcp-wire.js.map +1 -1
  205. package/dist/index.d.ts +4 -10
  206. package/dist/index.d.ts.map +1 -1
  207. package/dist/index.js +6 -10
  208. package/dist/index.js.map +1 -1
  209. package/dist/management-runtime.d.ts +217 -0
  210. package/dist/management-runtime.d.ts.map +1 -0
  211. package/dist/management-runtime.js +127 -0
  212. package/dist/management-runtime.js.map +1 -0
  213. package/dist/server.d.ts +16 -0
  214. package/dist/server.d.ts.map +1 -0
  215. package/dist/server.js +46 -0
  216. package/dist/server.js.map +1 -0
  217. package/dist/server.types-check.d.ts +23 -0
  218. package/dist/server.types-check.d.ts.map +1 -0
  219. package/dist/server.types-check.js +7 -0
  220. package/dist/server.types-check.js.map +1 -0
  221. package/package.json +24 -52
  222. package/dist/agent-client.d.ts +0 -5
  223. package/dist/agent-client.d.ts.map +0 -1
  224. package/dist/agent-client.js +0 -3
  225. package/dist/agent-client.js.map +0 -1
  226. package/dist/auth.d.ts +0 -37
  227. package/dist/auth.d.ts.map +0 -1
  228. package/dist/auth.js +0 -79
  229. package/dist/auth.js.map +0 -1
  230. package/dist/bounded-map.d.ts +0 -32
  231. package/dist/bounded-map.d.ts.map +0 -1
  232. package/dist/bounded-map.js +0 -79
  233. package/dist/bounded-map.js.map +0 -1
  234. package/dist/channel-base/format-cross-conv.d.ts +0 -43
  235. package/dist/channel-base/format-cross-conv.d.ts.map +0 -1
  236. package/dist/channel-base/format-cross-conv.js +0 -65
  237. package/dist/channel-base/format-cross-conv.js.map +0 -1
  238. package/dist/channel-base/format-group-block.d.ts +0 -48
  239. package/dist/channel-base/format-group-block.d.ts.map +0 -1
  240. package/dist/channel-base/format-group-block.js +0 -62
  241. package/dist/channel-base/format-group-block.js.map +0 -1
  242. package/dist/channel-base/index.d.ts +0 -12
  243. package/dist/channel-base/index.d.ts.map +0 -1
  244. package/dist/channel-base/index.js +0 -16
  245. package/dist/channel-base/index.js.map +0 -1
  246. package/dist/channel-core-enrichment.d.ts +0 -38
  247. package/dist/channel-core-enrichment.d.ts.map +0 -1
  248. package/dist/channel-core-enrichment.js +0 -217
  249. package/dist/channel-core-enrichment.js.map +0 -1
  250. package/dist/channel-core-test-support.d.ts +0 -75
  251. package/dist/channel-core-test-support.d.ts.map +0 -1
  252. package/dist/channel-core-test-support.js +0 -74
  253. package/dist/channel-core-test-support.js.map +0 -1
  254. package/dist/channel-core.d.ts +0 -306
  255. package/dist/channel-core.d.ts.map +0 -1
  256. package/dist/channel-core.js +0 -365
  257. package/dist/channel-core.js.map +0 -1
  258. package/dist/config.d.ts +0 -33
  259. package/dist/config.d.ts.map +0 -1
  260. package/dist/config.js +0 -51
  261. package/dist/config.js.map +0 -1
  262. package/dist/config.test-utils.d.ts +0 -24
  263. package/dist/config.test-utils.d.ts.map +0 -1
  264. package/dist/config.test-utils.js +0 -57
  265. package/dist/config.test-utils.js.map +0 -1
  266. package/dist/harness/client-runtime.d.ts +0 -31
  267. package/dist/harness/client-runtime.d.ts.map +0 -1
  268. package/dist/harness/client-runtime.js +0 -121
  269. package/dist/harness/client-runtime.js.map +0 -1
  270. package/dist/harness/index.d.ts +0 -5
  271. package/dist/harness/index.d.ts.map +0 -1
  272. package/dist/harness/index.js +0 -5
  273. package/dist/harness/index.js.map +0 -1
  274. package/dist/harness/runtime.d.ts +0 -301
  275. package/dist/harness/runtime.d.ts.map +0 -1
  276. package/dist/harness/runtime.js +0 -165
  277. package/dist/harness/runtime.js.map +0 -1
  278. package/dist/harness-client.d.ts +0 -47
  279. package/dist/harness-client.d.ts.map +0 -1
  280. package/dist/harness-client.js +0 -76
  281. package/dist/harness-client.js.map +0 -1
  282. package/dist/harness-context-projection.d.ts +0 -35
  283. package/dist/harness-context-projection.d.ts.map +0 -1
  284. package/dist/harness-context-projection.js +0 -123
  285. package/dist/harness-context-projection.js.map +0 -1
  286. package/dist/harness-mcp-server.d.ts.map +0 -1
  287. package/dist/harness-mcp-server.js.map +0 -1
  288. package/dist/local-paths.d.ts +0 -11
  289. package/dist/local-paths.d.ts.map +0 -1
  290. package/dist/local-paths.js +0 -21
  291. package/dist/local-paths.js.map +0 -1
  292. package/dist/message-rendering.d.ts +0 -4
  293. package/dist/message-rendering.d.ts.map +0 -1
  294. package/dist/message-rendering.js +0 -8
  295. package/dist/message-rendering.js.map +0 -1
  296. package/dist/moltzapd-catalog.d.ts +0 -35
  297. package/dist/moltzapd-catalog.d.ts.map +0 -1
  298. package/dist/moltzapd-catalog.js +0 -117
  299. package/dist/moltzapd-catalog.js.map +0 -1
  300. package/dist/moltzapd-child-ipc.d.ts +0 -26
  301. package/dist/moltzapd-child-ipc.d.ts.map +0 -1
  302. package/dist/moltzapd-child-ipc.js +0 -31
  303. package/dist/moltzapd-child-ipc.js.map +0 -1
  304. package/dist/moltzapd-child.d.ts +0 -55
  305. package/dist/moltzapd-child.d.ts.map +0 -1
  306. package/dist/moltzapd-child.js +0 -225
  307. package/dist/moltzapd-child.js.map +0 -1
  308. package/dist/moltzapd-main.d.ts +0 -3
  309. package/dist/moltzapd-main.d.ts.map +0 -1
  310. package/dist/moltzapd-main.js +0 -18
  311. package/dist/moltzapd-main.js.map +0 -1
  312. package/dist/moltzapd-registration.d.ts +0 -40
  313. package/dist/moltzapd-registration.d.ts.map +0 -1
  314. package/dist/moltzapd-registration.js +0 -59
  315. package/dist/moltzapd-registration.js.map +0 -1
  316. package/dist/moltzapd.d.ts +0 -85
  317. package/dist/moltzapd.d.ts.map +0 -1
  318. package/dist/moltzapd.js +0 -150
  319. package/dist/moltzapd.js.map +0 -1
  320. package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts +0 -53
  321. package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts.map +0 -1
  322. package/dist/notification/__tests__/subscribe-signatures.types-check.js +0 -29
  323. package/dist/notification/__tests__/subscribe-signatures.types-check.js.map +0 -1
  324. package/dist/notification/errors.d.ts +0 -41
  325. package/dist/notification/errors.d.ts.map +0 -1
  326. package/dist/notification/errors.js +0 -24
  327. package/dist/notification/errors.js.map +0 -1
  328. package/dist/notification/index.d.ts +0 -6
  329. package/dist/notification/index.d.ts.map +0 -1
  330. package/dist/notification/index.js +0 -6
  331. package/dist/notification/index.js.map +0 -1
  332. package/dist/notification/stream.d.ts +0 -75
  333. package/dist/notification/stream.d.ts.map +0 -1
  334. package/dist/notification/stream.js +0 -30
  335. package/dist/notification/stream.js.map +0 -1
  336. package/dist/notification/trace.d.ts +0 -10
  337. package/dist/notification/trace.d.ts.map +0 -1
  338. package/dist/notification/trace.js +0 -34
  339. package/dist/notification/trace.js.map +0 -1
  340. package/dist/pagination.d.ts +0 -52
  341. package/dist/pagination.d.ts.map +0 -1
  342. package/dist/pagination.js +0 -51
  343. package/dist/pagination.js.map +0 -1
  344. package/dist/presentation/index.d.ts +0 -3
  345. package/dist/presentation/index.d.ts.map +0 -1
  346. package/dist/presentation/index.js +0 -3
  347. package/dist/presentation/index.js.map +0 -1
  348. package/dist/presentation/state.d.ts +0 -77
  349. package/dist/presentation/state.d.ts.map +0 -1
  350. package/dist/presentation/state.js +0 -211
  351. package/dist/presentation/state.js.map +0 -1
  352. package/dist/profile.d.ts +0 -106
  353. package/dist/profile.d.ts.map +0 -1
  354. package/dist/profile.js +0 -171
  355. package/dist/profile.js.map +0 -1
  356. package/dist/service-event-trace.d.ts +0 -15
  357. package/dist/service-event-trace.d.ts.map +0 -1
  358. package/dist/service-event-trace.js +0 -35
  359. package/dist/service-event-trace.js.map +0 -1
  360. package/dist/service.d.ts +0 -228
  361. package/dist/service.d.ts.map +0 -1
  362. package/dist/service.js +0 -485
  363. package/dist/service.js.map +0 -1
  364. package/dist/test-utils/channel-service-fixture.d.ts +0 -53
  365. package/dist/test-utils/channel-service-fixture.d.ts.map +0 -1
  366. package/dist/test-utils/channel-service-fixture.js +0 -178
  367. package/dist/test-utils/channel-service-fixture.js.map +0 -1
  368. package/dist/test-utils/fake-service.d.ts +0 -82
  369. package/dist/test-utils/fake-service.d.ts.map +0 -1
  370. package/dist/test-utils/fake-service.js +0 -108
  371. package/dist/test-utils/fake-service.js.map +0 -1
  372. package/dist/test-utils/harness.d.ts +0 -27
  373. package/dist/test-utils/harness.d.ts.map +0 -1
  374. package/dist/test-utils/harness.js +0 -33
  375. package/dist/test-utils/harness.js.map +0 -1
  376. package/dist/test-utils/ids.d.ts +0 -21
  377. package/dist/test-utils/ids.d.ts.map +0 -1
  378. package/dist/test-utils/ids.js +0 -68
  379. package/dist/test-utils/ids.js.map +0 -1
  380. package/dist/test-utils/index.d.ts +0 -56
  381. package/dist/test-utils/index.d.ts.map +0 -1
  382. package/dist/test-utils/index.js +0 -67
  383. package/dist/test-utils/index.js.map +0 -1
  384. package/dist/test-utils/process/reserve-port.d.ts +0 -20
  385. package/dist/test-utils/process/reserve-port.d.ts.map +0 -1
  386. package/dist/test-utils/process/reserve-port.js +0 -41
  387. package/dist/test-utils/process/reserve-port.js.map +0 -1
  388. package/dist/test-utils/standalone-provisioning.d.ts +0 -22
  389. package/dist/test-utils/standalone-provisioning.d.ts.map +0 -1
  390. package/dist/test-utils/standalone-provisioning.js +0 -17
  391. package/dist/test-utils/standalone-provisioning.js.map +0 -1
  392. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,225 +0,0 @@
1
- import { Client, StreamableHTTPClientTransport, } from "@modelcontextprotocol/client";
2
- import { spawn } from "node:child_process";
3
- import { join } from "node:path";
4
- import { fileURLToPath } from "node:url";
5
- import { NodeContext } from "@effect/platform-node";
6
- import * as KeyValueStore from "@effect/platform/KeyValueStore";
7
- import { Data, Deferred, Duration, Effect, Exit, Layer, } from "effect";
8
- import packageJson from "../package.json" with { type: "json" };
9
- import { acquireHarnessClient, } from "./harness-client.js";
10
- import { decodeHarnessStatusResult, HARNESS_STATUS_TOOL, } from "./harness/index.js";
11
- import { getMoltZapConfigDir } from "./local-paths.js";
12
- import { isMoltzapdReadyMessage } from "./moltzapd-child-ipc.js";
13
- import { isRegisteredProfile, parseProfileName, resolveProfileRecord, } from "./profile.js";
14
- const LOOPBACK_HOST = "127.0.0.1";
15
- const MCP_PATH = "/mcp";
16
- const MODERN_PROTOCOL_VERSION = "2026-07-28";
17
- const POLL_INTERVAL = Duration.millis(25);
18
- const STARTUP_TIMEOUT = Duration.seconds(15);
19
- const STARTUP_TIMEOUT_MILLIS = Duration.toMillis(STARTUP_TIMEOUT);
20
- const SHUTDOWN_TIMEOUT = Duration.seconds(5);
21
- const OUTPUT_TAIL_LIMIT = 64 * 1024;
22
- const OUTPUT_TRUNCATED_NOTICE = "[earlier moltzapd output truncated]\n";
23
- const packageRoot = fileURLToPath(new URL("../", import.meta.url));
24
- const daemonEntry = join(packageRoot, packageJson.bin.moltzapd);
25
- class MoltzapdChildError extends Data.TaggedError("MoltzapdChildError") {
26
- }
27
- const moltzapdChildError = (message, cause) => new MoltzapdChildError({ message, cause });
28
- const toError = (cause) => {
29
- if (cause instanceof MoltzapdChildError) {
30
- return cause;
31
- }
32
- const message = cause instanceof Error ? cause.message : String(cause);
33
- return moltzapdChildError(message, cause);
34
- };
35
- const makeOutputTail = () => {
36
- let output = "";
37
- let truncated = false;
38
- const append = (chunk) => {
39
- output += chunk;
40
- if (output.length > OUTPUT_TAIL_LIMIT) {
41
- output = output.slice(-OUTPUT_TAIL_LIMIT);
42
- truncated = true;
43
- }
44
- };
45
- const read = () => truncated ? `${OUTPUT_TRUNCATED_NOTICE}${output}` : output;
46
- return {
47
- append,
48
- read,
49
- };
50
- };
51
- const startDaemon = (profileName) => {
52
- const output = makeOutputTail();
53
- const readiness = Effect.runSync(Deferred.make());
54
- const child = spawn(process.execPath, [daemonEntry, "--profile", profileName], {
55
- cwd: packageRoot,
56
- // eslint-disable-next-line agent-code-guard/no-process-env-at-runtime -- The isolated child inherits the caller-scoped test profile and server URL.
57
- env: { ...process.env },
58
- stdio: ["ignore", "pipe", "pipe", "ipc"],
59
- });
60
- const onMessage = (message) => {
61
- if (isMoltzapdReadyMessage(message)) {
62
- child.off("message", onMessage);
63
- Effect.runSync(Deferred.succeed(readiness, undefined));
64
- }
65
- };
66
- child.on("message", onMessage);
67
- child.once("exit", () => {
68
- child.off("message", onMessage);
69
- });
70
- child.stdout?.setEncoding("utf8");
71
- child.stderr?.setEncoding("utf8");
72
- child.stdout?.on("data", output.append);
73
- child.stderr?.on("data", output.append);
74
- return { child, logs: output.read, readiness };
75
- };
76
- const waitForExit = (running) => {
77
- if (running.child.exitCode !== null || running.child.signalCode !== null) {
78
- return Effect.succeed(undefined);
79
- }
80
- return Effect.async((resume) => {
81
- const onExit = () => {
82
- resume(Effect.succeed(undefined));
83
- };
84
- running.child.once("exit", onExit);
85
- return Effect.sync(() => {
86
- running.child.off("exit", onExit);
87
- });
88
- });
89
- };
90
- const stopDaemon = (running) => Effect.gen(function* () {
91
- if (running.child.exitCode !== null || running.child.signalCode !== null) {
92
- return;
93
- }
94
- running.child.kill("SIGTERM");
95
- const stopped = yield* Effect.raceFirst(waitForExit(running).pipe(Effect.as(true)), Effect.sleep(SHUTDOWN_TIMEOUT).pipe(Effect.as(false)));
96
- if (stopped) {
97
- return;
98
- }
99
- running.child.kill("SIGKILL");
100
- yield* waitForExit(running);
101
- });
102
- const exitDescription = (running) => {
103
- if (running.child.signalCode !== null) {
104
- return ` after signal ${running.child.signalCode}`;
105
- }
106
- if (running.child.exitCode !== null) {
107
- return ` with code ${String(running.child.exitCode)}`;
108
- }
109
- return "";
110
- };
111
- const exitedBeforeReadiness = (running) => moltzapdChildError(`moltzapd exited${exitDescription(running)} before readiness\n${running.logs()}`);
112
- const failWhenDaemonExits = (running) => waitForExit(running).pipe(Effect.flatMap(() => Effect.fail(exitedBeforeReadiness(running))));
113
- const observeDaemonDuringReadiness = (running, readiness) => Effect.raceFirst(readiness, failWhenDaemonExits(running));
114
- const ensureDaemonIsRunning = (running) => running.child.exitCode === null && running.child.signalCode === null
115
- ? Effect.void
116
- : Effect.fail(exitedBeforeReadiness(running));
117
- const waitForReadySignal = (running) => Deferred.await(running.readiness);
118
- const acquireDaemon = (profileName) => Effect.acquireRelease(Effect.sync(() => startDaemon(profileName)), (running) => stopDaemon(running));
119
- const closeMcpClient = (client) => Effect.tryPromise({ try: () => client.close(), catch: toError }).pipe(Effect.ignore);
120
- const connectMcpOnce = (url) => Effect.gen(function* () {
121
- const client = new Client({ name: "moltzapd-child", version: "1.0.0" }, { versionNegotiation: { mode: { pin: MODERN_PROTOCOL_VERSION } } });
122
- // A client that fails to connect still holds a transport, so the failure
123
- // path closes it before surfacing the cause.
124
- yield* Effect.tryPromise({
125
- try: (signal) => client.connect(new StreamableHTTPClientTransport(url), {
126
- signal,
127
- timeout: STARTUP_TIMEOUT_MILLIS,
128
- maxTotalTimeout: STARTUP_TIMEOUT_MILLIS,
129
- }),
130
- catch: toError,
131
- }).pipe(Effect.onExit((exit) => Exit.isSuccess(exit) ? Effect.void : closeMcpClient(client)));
132
- return client;
133
- });
134
- const waitForMcpClient = (url, running) => {
135
- const poll = Effect.suspend(() => {
136
- if (running.child.exitCode !== null || running.child.signalCode !== null) {
137
- return Effect.fail(exitedBeforeReadiness(running));
138
- }
139
- return connectMcpOnce(url).pipe(Effect.catchAll(() => Effect.sleep(POLL_INTERVAL).pipe(Effect.zipRight(poll))));
140
- });
141
- return poll;
142
- };
143
- const callStatus = (client) => Effect.tryPromise({
144
- try: (signal) => client.callTool({ name: HARNESS_STATUS_TOOL, arguments: {} }, {
145
- signal,
146
- timeout: STARTUP_TIMEOUT_MILLIS,
147
- maxTotalTimeout: STARTUP_TIMEOUT_MILLIS,
148
- }),
149
- catch: toError,
150
- });
151
- const identityMismatch = (profileName, expectedAgentId, actualIdentity) => moltzapdChildError(`moltzapd profile identity mismatch: ${profileName} expects ${expectedAgentId}, but the MCP endpoint reports ${actualIdentity}`);
152
- const verifyConnectedStatus = (client, running, profileName, expectedAgentId) => callStatus(client).pipe(Effect.flatMap((result) => decodeHarnessStatusResult(result.structuredContent).pipe(Effect.mapError(toError))), Effect.flatMap((status) => {
153
- if (status.agentId === undefined) {
154
- return Effect.fail(identityMismatch(profileName, expectedAgentId, "no AgentId"));
155
- }
156
- if (status.agentId !== expectedAgentId) {
157
- return Effect.fail(identityMismatch(profileName, expectedAgentId, status.agentId));
158
- }
159
- return status.connected
160
- ? Effect.void
161
- : Effect.fail(moltzapdChildError(`moltzapd signaled readiness without connecting\n${running.logs()}`));
162
- }));
163
- /**
164
- * Bounds and interrupts the complete child-readiness sequence.
165
- * @param readiness IPC, endpoint connection, status, and liveness checks.
166
- * @param logs Bounded child output included in the timeout diagnostic.
167
- * @param within Startup budget; production uses one fixed local deadline.
168
- * @returns The readiness result before the shared deadline.
169
- * @internal
170
- */
171
- export const withMoltzapdStartupDeadline = (readiness, logs, within = STARTUP_TIMEOUT) => readiness.pipe(Effect.timeoutFail({
172
- duration: within,
173
- onTimeout: () => moltzapdChildError(`moltzapd did not become ready before its startup deadline\n${logs()}`),
174
- }));
175
- // IPC binds readiness to this exact ChildProcess. The status check then binds
176
- // the endpoint reached through the profile's port to its persisted AgentId.
177
- const verifySpawnedDaemon = ({ expectedAgentId, profileName, running, url, }) => {
178
- const verifyEndpoint = Effect.scoped(Effect.acquireRelease(waitForMcpClient(url, running), closeMcpClient).pipe(Effect.flatMap((client) => verifyConnectedStatus(client, running, profileName, expectedAgentId))));
179
- const readiness = observeDaemonDuringReadiness(running, waitForReadySignal(running).pipe(Effect.zipRight(verifyEndpoint))).pipe(Effect.zipRight(ensureDaemonIsRunning(running)));
180
- return withMoltzapdStartupDeadline(readiness, running.logs);
181
- };
182
- /**
183
- * Starts the package's real `moltzapd` binary against an existing slot.
184
- * The slot carries the loopback port, so the child receives only its profile
185
- * name and the returned URL is derived from the same persisted value.
186
- *
187
- * @param options Existing profile name for the child process.
188
- * @returns A scoped packaged daemon after its MCP status reports connected.
189
- */
190
- export const acquireMoltzapdChild = (options) => Effect.gen(function* () {
191
- const name = yield* parseProfileName(options.profileName).pipe(Effect.mapError(toError));
192
- const record = yield* resolveProfileRecord(name).pipe(Effect.mapError(toError));
193
- if (!isRegisteredProfile(record)) {
194
- return yield* Effect.fail(moltzapdChildError(`moltzapd profile ${options.profileName} is not registered`));
195
- }
196
- const running = yield* acquireDaemon(options.profileName);
197
- const url = new URL(MCP_PATH, `http://${LOOPBACK_HOST}:${String(record.mcpPort)}`);
198
- yield* verifySpawnedDaemon({
199
- expectedAgentId: record.agentId,
200
- profileName: options.profileName,
201
- running,
202
- url,
203
- });
204
- return { mcpUrl: url.href, logs: running.logs };
205
- }).pipe(Effect.withSpan("acquireMoltzapdChild"));
206
- /**
207
- * Acquire the adapter-facing client for one named profile slot.
208
- *
209
- * This is the whole production composition: the slot's own daemon child, the
210
- * loopback endpoint derived from the slot, and a file-backed checkpoint store.
211
- * A caller supplies only the profile name — no URL, no port, no store.
212
- *
213
- * The checkpoint directory is keyed by profile name rather than AgentId,
214
- * because the store must be provided before `acquireHarnessClient` reads the
215
- * identity from the daemon's status tool. One slot is exactly one AgentId, so
216
- * the profile name is a stable agent scope.
217
- *
218
- * @param profileName Existing slot owning the daemon and its checkpoints.
219
- * @returns The scoped adapter-facing service value.
220
- */
221
- export const harnessClientForProfile = (profileName) => Effect.gen(function* () {
222
- const child = yield* acquireMoltzapdChild({ profileName });
223
- return yield* acquireHarnessClient({ url: child.mcpUrl }).pipe(Effect.provide(KeyValueStore.layerFileSystem(join(getMoltZapConfigDir(), "checkpoints", profileName)).pipe(Layer.provide(NodeContext.layer))), Effect.catchTag("SystemError", (cause) => Effect.die(cause)), Effect.catchTag("BadArgument", (cause) => Effect.die(cause)));
224
- }).pipe(Effect.withSpan("harnessClientForProfile"));
225
- //# sourceMappingURL=moltzapd-child.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"moltzapd-child.js","sourceRoot":"","sources":["../src/moltzapd-child.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,aAAa,MAAM,gCAAgC,CAAC;AAChE,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,KAAK,GAEN,MAAM,QAAQ,CAAC;AAEhB,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EACL,oBAAoB,GAErB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,oBAAoB,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AQ,CAAC,yBAAyB,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=moltzapd-main.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"moltzapd-main.d.ts","sourceRoot":"","sources":["../src/moltzapd-main.ts"],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- /** @file Process entry point for one profile-scoped MoltZap daemon. */
3
- import { Command, Options } from "@effect/cli";
4
- import { NodeContext, NodeRuntime } from "@effect/platform-node";
5
- import { Effect } from "effect";
6
- import packageJson from "../package.json" with { type: "json" };
7
- import { signalMoltzapdReady } from "./moltzapd-child-ipc.js";
8
- import { runMoltzapd } from "./moltzapd.js";
9
- import { profileName } from "./profile.js";
10
- const profileOption = Options.text("profile").pipe(Options.withSchema(profileName), Options.withDescription("Existing named profile owned by this daemon."));
11
- const moltzapd = Command.make("moltzapd", { profile: profileOption }, ({ profile }) => runMoltzapd({ profileName: profile }, signalMoltzapdReady)).pipe(Command.withDescription("Run one named MoltZap profile behind its loopback MCP boundary."));
12
- const main = Command.run(moltzapd, {
13
- name: "moltzapd",
14
- version: packageJson.version,
15
- });
16
- // eslint-disable-next-line agent-code-guard/prefer-effect-platform -- @effect/cli receives the Node argument vector at the process boundary.
17
- main(process.argv).pipe(Effect.provide(NodeContext.layer), NodeRuntime.runMain);
18
- //# sourceMappingURL=moltzapd-main.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"moltzapd-main.js","sourceRoot":"","sources":["../src/moltzapd-main.ts"],"names":[],"mappings":";AACA,uEAAuE;AACvE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAChD,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,EAC/B,OAAO,CAAC,eAAe,CAAC,8CAA8C,CAAC,CACxE,CAAC;AAEF,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAC3B,UAAU,EACV,EAAE,OAAO,EAAE,aAAa,EAAE,EAC1B,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,mBAAmB,CAAC,CAC5E,CAAC,IAAI,CACJ,OAAO,CAAC,eAAe,CACrB,iEAAiE,CAClE,CACF,CAAC;AAEF,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,WAAW,CAAC,OAAO;CAC7B,CAAC,CAAC;AAEH,6IAA6I;AAC7I,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC"}
@@ -1,40 +0,0 @@
1
- /**
2
- * Registry commit for a profile slot that has no identity yet.
3
- *
4
- * Registration is non-idempotent: the server generates the key and
5
- * `agents.name` is unique, so a lost response requires a new agent name rather
6
- * than a retry.
7
- */
8
- import { Effect } from "effect";
9
- import { type RegisterAgentError } from "./auth.js";
10
- import { type ServiceConfigError } from "./config.js";
11
- import type { HarnessRegisterInput, HarnessRegisterResult } from "./harness/index.js";
12
- import type { DaemonPhaseState } from "./moltzapd-catalog.js";
13
- import { type ProfileName, type ProfileRecord } from "./profile.js";
14
- import type { ServiceRpcError } from "./service.js";
15
- /** The Registry call, the server address lookup, and the slot write. */
16
- export type CommitError = RegisterAgentError | ServiceConfigError | Error;
17
- /** A commit plus the activation it triggers. */
18
- export type RegistrationError = CommitError | ServiceRpcError;
19
- interface RegisterHandlerInput {
20
- readonly name: ProfileName;
21
- readonly record: ProfileRecord;
22
- readonly phase: DaemonPhaseState;
23
- readonly activation: Effect.Semaphore;
24
- readonly activate: () => Effect.Effect<void, ServiceConfigError | ServiceRpcError>;
25
- readonly onCatalogChanged: () => void;
26
- }
27
- /**
28
- * Builds the `register` tool handler for a slot catalog.
29
- * @param input Slot identity, phase holder, and the activation to run on commit.
30
- * @param input.name Profile name owning the slot.
31
- * @param input.record Slot record the commit writes back into.
32
- * @param input.phase Current catalog state.
33
- * @param input.activation Serializes commit with the activation it triggers.
34
- * @param input.activate Transition to the active catalog.
35
- * @param input.onCatalogChanged Announces the new catalog to open subscribers.
36
- * @returns The registration handler.
37
- */
38
- export declare const makeRegisterHandler: ({ name, record, phase, activation, activate, onCatalogChanged, }: RegisterHandlerInput) => (payload: HarnessRegisterInput) => Effect.Effect<HarnessRegisterResult, RegistrationError>;
39
- export {};
40
- //# sourceMappingURL=moltzapd-registration.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"moltzapd-registration.d.ts","sourceRoot":"","sources":["../src/moltzapd-registration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,KAAK,CAAC;AAE1E,gDAAgD;AAChD,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,eAAe,CAAC;AAyC9D,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,CACpC,IAAI,EACJ,kBAAkB,GAAG,eAAe,CACrC,CAAC;IACF,QAAQ,CAAC,gBAAgB,EAAE,MAAM,IAAI,CAAC;CACvC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,qEAQ3B,oBAAoB,eAEZ,oBAAoB,KAC5B,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,iBAAiB,CAgBtD,CAAC"}
@@ -1,59 +0,0 @@
1
- /**
2
- * Registry commit for a profile slot that has no identity yet.
3
- *
4
- * Registration is non-idempotent: the server generates the key and
5
- * `agents.name` is unique, so a lost response requires a new agent name rather
6
- * than a retry.
7
- */
8
- import { Effect } from "effect";
9
- import { registerAgent } from "./auth.js";
10
- import { getHttpUrl, getServerUrl } from "./config.js";
11
- import { writeProfile, } from "./profile.js";
12
- const commitRegistration = ({ name, record, payload, }) => Effect.gen(function* () {
13
- const httpUrl = yield* getHttpUrl;
14
- const serverUrl = yield* getServerUrl;
15
- const result = yield* registerAgent(httpUrl, record.agentName, {
16
- ...(payload.inviteCode === undefined
17
- ? {}
18
- : { inviteCode: payload.inviteCode }),
19
- ...(payload.description === undefined
20
- ? {}
21
- : { description: payload.description }),
22
- });
23
- // The slot keeps its name and port; commit only adds the identity pair.
24
- yield* writeProfile(name, {
25
- ...record,
26
- agentId: result.agentId,
27
- apiKey: result.apiKey,
28
- });
29
- // The key stays on disk. Callers get the identity and where to reach it.
30
- return {
31
- agentId: result.agentId,
32
- agentName: record.agentName,
33
- serverUrl,
34
- };
35
- }).pipe(Effect.withSpan("moltzapd.register"));
36
- /**
37
- * Builds the `register` tool handler for a slot catalog.
38
- * @param input Slot identity, phase holder, and the activation to run on commit.
39
- * @param input.name Profile name owning the slot.
40
- * @param input.record Slot record the commit writes back into.
41
- * @param input.phase Current catalog state.
42
- * @param input.activation Serializes commit with the activation it triggers.
43
- * @param input.activate Transition to the active catalog.
44
- * @param input.onCatalogChanged Announces the new catalog to open subscribers.
45
- * @returns The registration handler.
46
- */
47
- export const makeRegisterHandler = ({ name, record, phase, activation, activate, onCatalogChanged, }) => (payload) => activation.withPermits(1)(Effect.gen(function* () {
48
- if (phase.read().kind === "active") {
49
- // eslint-disable-next-line agent-code-guard/effect-error-erasure -- Local MCP validation stays on the established broad Error boundary without adding a portable protocol error.
50
- return yield* Effect.fail(new Error("This profile slot already has an agent identity"));
51
- }
52
- const result = yield* commitRegistration({ name, record, payload });
53
- yield* activate();
54
- // Clients holding an open subscription learn the catalog changed; any
55
- // later tools/list re-reads the phase regardless.
56
- onCatalogChanged();
57
- return result;
58
- }).pipe(Effect.withSpan("makeRegisterHandler")));
59
- //# sourceMappingURL=moltzapd-registration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"moltzapd-registration.js","sourceRoot":"","sources":["../src/moltzapd-registration.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAA2B,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAA2B,MAAM,aAAa,CAAC;AAMhF,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C3D,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CACvB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACnC,iLAAiL;QACjL,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CACvB,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAC7D,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,kBAAkB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IACpE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;IAClB,sEAAsE;IACtE,kDAAkD;IAClD,gBAAgB,EAAE,CAAC;IACnB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAChD,CAAC"}
@@ -1,85 +0,0 @@
1
- import { Effect, Scope } from "effect";
2
- import { acquireHarnessMcpHttpServer } from "./harness-mcp-server.js";
3
- import { type ServiceRpcError } from "./service.js";
4
- import type { ServiceConfigError } from "./config.js";
5
- interface MoltzapdOptions {
6
- readonly profileName: string;
7
- }
8
- type MoltzapdServer = Effect.Effect.Success<ReturnType<typeof acquireHarnessMcpHttpServer>>;
9
- /** Everything composing and running the daemon can fail with. */
10
- type DaemonError = Error | ServiceConfigError | ServiceRpcError;
11
- interface DaemonResourceScopes {
12
- readonly activationScope: Scope.CloseableScope;
13
- readonly daemonScope: Scope.CloseableScope;
14
- }
15
- /**
16
- * Creates the daemon's nested resource owners. The activation scope is
17
- * registered before the listener, so sequential LIFO shutdown closes the MCP
18
- * listener before disconnecting the active channel core.
19
- * @param parentScope Scope that owns the complete daemon lifetime.
20
- * @returns Separate owners for the listener and activation resources.
21
- * @internal
22
- */
23
- export declare const makeDaemonResourceScopes: (parentScope: Scope.Scope) => Effect.Effect<DaemonResourceScopes>;
24
- /**
25
- * Runs one activation attempt in a child of the daemon scope.
26
- *
27
- * A successful attempt remains owned by the daemon. A failed or interrupted
28
- * attempt closes completely before its error reaches the caller, so a later
29
- * attempt cannot overlap a partial service, core, or network connection.
30
- *
31
- * @param daemonScope Scope owning a successful activation.
32
- * @param attempt Scoped resources acquired by one activation attempt.
33
- * @returns The attempt result after failed resources have been released.
34
- * @internal
35
- */
36
- export declare const runScopedActivationAttempt: <A, E>(daemonScope: Scope.Scope, attempt: Effect.Effect<A, E, Scope.Scope>) => Effect.Effect<A, E>;
37
- /**
38
- * Owns one profile slot's loopback MCP listener for the lifetime of the
39
- * caller's scope, plus the service, channel core, and network connection once
40
- * that slot carries a Registry identity.
41
- *
42
- * ```mermaid
43
- * sequenceDiagram
44
- * participant process as moltzapd
45
- * participant mcp as MCP listener
46
- * participant service as MoltZapService
47
- * participant core as MoltZapChannelCore
48
- *
49
- * process->>mcp: listen(slot port) with the slot catalog
50
- * alt slot has no identity
51
- * mcp->>process: tools/call register
52
- * process->>process: commit identity into the slot
53
- * end
54
- * process->>service: make(profileName)
55
- * process->>core: construct(service)
56
- * process->>core: install raw turn publisher
57
- * process->>core: connect()
58
- * process->>mcp: serve the active catalog
59
- * Note over core,mcp: Scope release closes MCP before disconnecting the core
60
- * ```
61
- *
62
- * The slot itself carries the listener port, so no caller supplies one, and the
63
- * listener binds before the identity exists — an unregistered slot is reachable
64
- * at the same fixed `/mcp` URL as a registered one.
65
- *
66
- * @param options Existing profile name owning this daemon.
67
- * @returns The scoped loopback HTTP listener.
68
- * @internal
69
- */
70
- export declare const acquireMoltzapd: (options: MoltzapdOptions) => Effect.Effect<MoltzapdServer, DaemonError, Scope.Scope>;
71
- /**
72
- * Runs one agent daemon until the process runtime interrupts it.
73
- *
74
- * The process scope owns both the loopback MCP listener and the sole network
75
- * connection. Interrupting the returned Effect closes the listener before
76
- * disconnecting the agent transport.
77
- *
78
- * @param options Existing named profile owning this daemon.
79
- * @param readySignal Effect that tells a supervising process this daemon owns
80
- * its listener and, for a registered profile, its network connection.
81
- * @returns A non-terminating daemon Effect whose scope closes on interruption.
82
- */
83
- export declare const runMoltzapd: (options: MoltzapdOptions, readySignal: Effect.Effect<unknown, Error>) => Effect.Effect<never, DaemonError>;
84
- export {};
85
- //# sourceMappingURL=moltzapd.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"moltzapd.d.ts","sourceRoot":"","sources":["../src/moltzapd.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAA2B,KAAK,EAAE,MAAM,QAAQ,CAAC;AAIhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AActE,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,UAAU,eAAe;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAOD,KAAK,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CACzC,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAC/C,CAAC;AAEF,iEAAiE;AACjE,KAAK,WAAW,GAAG,KAAK,GAAG,kBAAkB,GAAG,eAAe,CAAC;AA+BhE,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,cAAc,CAAC;IAC/C,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC,cAAc,CAAC;CAC5C;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,gBACtB,KAAK,CAAC,KAAK,KACvB,MAAM,CAAC,MAAM,CAAC,oBAAoB,CAWiB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,0BAA0B,GAAI,CAAC,EAAE,CAAC,eAChC,KAAK,CAAC,KAAK,WACf,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,KACxC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAakC,CAAC;AA+DxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,eAAe,YACjB,eAAe,KACvB,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,WAAW,EAAE,KAAK,CAAC,KAAK,CAaZ,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,YACb,eAAe,eACX,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,KACzC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,CAMK,CAAC"}
package/dist/moltzapd.js DELETED
@@ -1,150 +0,0 @@
1
- import { Effect, ExecutionStrategy, Exit, Scope } from "effect";
2
- import packageJson from "../package.json" with { type: "json" };
3
- import { MoltZapChannelCore } from "./channel-core.js";
4
- import { acquireHarnessMcpHttpServer } from "./harness-mcp-server.js";
5
- import { makeHarnessMcpHttpHandler } from "./harness-mcp-wire.js";
6
- import { makeActiveTools, makeDaemonPhaseState, slotStatusHandler, } from "./moltzapd-catalog.js";
7
- import { makeRegisterHandler } from "./moltzapd-registration.js";
8
- import { isRegisteredProfile, parseProfileName, resolveProfileRecord, } from "./profile.js";
9
- import { MoltZapService } from "./service.js";
10
- const MCP_IMPLEMENTATION = {
11
- name: "moltzapd",
12
- version: packageJson.version,
13
- };
14
- const acquireCore = (service) => Effect.acquireRelease(Effect.sync(() => new MoltZapChannelCore({ service })), (core) => core.disconnect());
15
- const installTurnPublisher = (core, publish) => {
16
- core.onRawInbound((messages) => Effect.sync(() => {
17
- const first = messages[0];
18
- if (first === undefined) {
19
- return;
20
- }
21
- publish({ messages: [first, ...messages.slice(1)] });
22
- }));
23
- };
24
- /**
25
- * Creates the daemon's nested resource owners. The activation scope is
26
- * registered before the listener, so sequential LIFO shutdown closes the MCP
27
- * listener before disconnecting the active channel core.
28
- * @param parentScope Scope that owns the complete daemon lifetime.
29
- * @returns Separate owners for the listener and activation resources.
30
- * @internal
31
- */
32
- export const makeDaemonResourceScopes = (parentScope) => Effect.gen(function* () {
33
- const daemonScope = yield* Scope.fork(parentScope, ExecutionStrategy.sequential);
34
- const activationScope = yield* Scope.fork(daemonScope, ExecutionStrategy.sequential);
35
- return { activationScope, daemonScope };
36
- }).pipe(Effect.withSpan("makeDaemonResourceScopes"));
37
- /**
38
- * Runs one activation attempt in a child of the daemon scope.
39
- *
40
- * A successful attempt remains owned by the daemon. A failed or interrupted
41
- * attempt closes completely before its error reaches the caller, so a later
42
- * attempt cannot overlap a partial service, core, or network connection.
43
- *
44
- * @param daemonScope Scope owning a successful activation.
45
- * @param attempt Scoped resources acquired by one activation attempt.
46
- * @returns The attempt result after failed resources have been released.
47
- * @internal
48
- */
49
- export const runScopedActivationAttempt = (daemonScope, attempt) => Effect.uninterruptibleMask((restore) => Effect.gen(function* () {
50
- const attemptScope = yield* Scope.fork(daemonScope, ExecutionStrategy.sequential);
51
- return yield* restore(attempt.pipe(Scope.extend(attemptScope))).pipe(Effect.onExit((exit) => Exit.isSuccess(exit) ? Effect.void : Scope.close(attemptScope, exit)));
52
- })).pipe(Effect.withSpan("runScopedActivationAttempt"));
53
- // Builds the transition from a committed slot to a serving agent. Each attempt
54
- // has its own child scope so a failed startup cannot leak partial resources
55
- // into the daemon lifetime.
56
- const makeActivator = ({ profileName, phase, activationScope }) => (publish) => runScopedActivationAttempt(activationScope, Effect.gen(function* () {
57
- const service = yield* MoltZapService.make(profileName);
58
- const core = yield* acquireCore(service);
59
- installTurnPublisher(core, publish);
60
- yield* core.connect();
61
- phase.setActive(makeActiveTools(service, core));
62
- }));
63
- // Binds the slot's listener, then activates if the slot already carries an
64
- // identity. The listener comes first either way: registration has to be
65
- // reachable on a daemon that cannot yet build a service.
66
- const serveProfileSlot = (profileName, activationScope) => Effect.gen(function* () {
67
- const name = yield* parseProfileName(profileName);
68
- const record = yield* resolveProfileRecord(name);
69
- const phase = makeDaemonPhaseState();
70
- // Registration and initial activation share one transition lock so a live
71
- // listener cannot begin another registration during startup.
72
- const activation = yield* Effect.makeSemaphore(1);
73
- const activate = makeActivator({ profileName, phase, activationScope });
74
- const handler = makeHarnessMcpHttpHandler({
75
- implementation: MCP_IMPLEMENTATION,
76
- phase: phase.read,
77
- slotStatus: slotStatusHandler,
78
- register: makeRegisterHandler({
79
- name,
80
- record,
81
- phase,
82
- activation,
83
- activate: () => activate(handler.publish),
84
- onCatalogChanged: () => {
85
- handler.notify.toolsChanged();
86
- },
87
- }),
88
- });
89
- const server = yield* acquireHarnessMcpHttpServer({
90
- port: record.mcpPort,
91
- handler,
92
- });
93
- if (isRegisteredProfile(record)) {
94
- yield* activation.withPermits(1)(activate(handler.publish));
95
- }
96
- return server;
97
- });
98
- /**
99
- * Owns one profile slot's loopback MCP listener for the lifetime of the
100
- * caller's scope, plus the service, channel core, and network connection once
101
- * that slot carries a Registry identity.
102
- *
103
- * ```mermaid
104
- * sequenceDiagram
105
- * participant process as moltzapd
106
- * participant mcp as MCP listener
107
- * participant service as MoltZapService
108
- * participant core as MoltZapChannelCore
109
- *
110
- * process->>mcp: listen(slot port) with the slot catalog
111
- * alt slot has no identity
112
- * mcp->>process: tools/call register
113
- * process->>process: commit identity into the slot
114
- * end
115
- * process->>service: make(profileName)
116
- * process->>core: construct(service)
117
- * process->>core: install raw turn publisher
118
- * process->>core: connect()
119
- * process->>mcp: serve the active catalog
120
- * Note over core,mcp: Scope release closes MCP before disconnecting the core
121
- * ```
122
- *
123
- * The slot itself carries the listener port, so no caller supplies one, and the
124
- * listener binds before the identity exists — an unregistered slot is reachable
125
- * at the same fixed `/mcp` URL as a registered one.
126
- *
127
- * @param options Existing profile name owning this daemon.
128
- * @returns The scoped loopback HTTP listener.
129
- * @internal
130
- */
131
- export const acquireMoltzapd = (options) => Effect.gen(function* () {
132
- const parentScope = yield* Effect.scope;
133
- const { activationScope, daemonScope } = yield* makeDaemonResourceScopes(parentScope);
134
- const acquire = serveProfileSlot(options.profileName, activationScope).pipe(Scope.extend(daemonScope));
135
- return yield* acquire.pipe(Effect.onExit((exit) => Exit.isSuccess(exit) ? Effect.void : Scope.close(daemonScope, exit)));
136
- }).pipe(Effect.withSpan("acquireMoltzapd"));
137
- /**
138
- * Runs one agent daemon until the process runtime interrupts it.
139
- *
140
- * The process scope owns both the loopback MCP listener and the sole network
141
- * connection. Interrupting the returned Effect closes the listener before
142
- * disconnecting the agent transport.
143
- *
144
- * @param options Existing named profile owning this daemon.
145
- * @param readySignal Effect that tells a supervising process this daemon owns
146
- * its listener and, for a registered profile, its network connection.
147
- * @returns A non-terminating daemon Effect whose scope closes on interruption.
148
- */
149
- export const runMoltzapd = (options, readySignal) => Effect.scoped(acquireMoltzapd(options).pipe(Effect.zipRight(readySignal), Effect.zipRight(Effect.never))).pipe(Effect.withSpan("runMoltzapd"));
150
- //# sourceMappingURL=moltzapd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"moltzapd.js","sourceRoot":"","sources":["../src/moltzapd.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChE,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,GAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAwB,MAAM,cAAc,CAAC;AAOpE,MAAM,kBAAkB,G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