@moltzap/client 2026.529.0 → 2026.717.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 (363) hide show
  1. package/dist/agent-client.d.ts +2 -65
  2. package/dist/agent-client.d.ts.map +1 -1
  3. package/dist/agent-client.js +1 -286
  4. package/dist/agent-client.js.map +1 -1
  5. package/dist/app-client.d.ts +3 -0
  6. package/dist/app-client.d.ts.map +1 -0
  7. package/dist/app-client.js +2 -0
  8. package/dist/app-client.js.map +1 -0
  9. package/dist/auth.d.ts +6 -15
  10. package/dist/auth.d.ts.map +1 -1
  11. package/dist/auth.js +12 -16
  12. package/dist/auth.js.map +1 -1
  13. package/dist/channel-base/format-cross-conv.d.ts +10 -15
  14. package/dist/channel-base/format-cross-conv.d.ts.map +1 -1
  15. package/dist/channel-base/format-cross-conv.js +10 -15
  16. package/dist/channel-base/format-cross-conv.js.map +1 -1
  17. package/dist/channel-base/format-group-block.d.ts +8 -10
  18. package/dist/channel-base/format-group-block.d.ts.map +1 -1
  19. package/dist/channel-base/format-group-block.js +8 -10
  20. package/dist/channel-base/format-group-block.js.map +1 -1
  21. package/dist/channel-base/index.d.ts +3 -62
  22. package/dist/channel-base/index.d.ts.map +1 -1
  23. package/dist/channel-base/index.js +2 -65
  24. package/dist/channel-base/index.js.map +1 -1
  25. package/dist/channel-base/lease-guard.d.ts +0 -2
  26. package/dist/channel-base/lease-guard.d.ts.map +1 -1
  27. package/dist/channel-base/lease-guard.js +0 -2
  28. package/dist/channel-base/lease-guard.js.map +1 -1
  29. package/dist/channel-base/lease-store.d.ts +2 -3
  30. package/dist/channel-base/lease-store.d.ts.map +1 -1
  31. package/dist/channel-base/lease-store.js +2 -3
  32. package/dist/channel-base/lease-store.js.map +1 -1
  33. package/dist/channel-base/lease.d.ts +25 -31
  34. package/dist/channel-base/lease.d.ts.map +1 -1
  35. package/dist/channel-base/lease.js +29 -45
  36. package/dist/channel-base/lease.js.map +1 -1
  37. package/dist/channel-core-enrichment.d.ts +1 -1
  38. package/dist/channel-core-enrichment.d.ts.map +1 -1
  39. package/dist/channel-core-test-support.d.ts +17 -11
  40. package/dist/channel-core-test-support.d.ts.map +1 -1
  41. package/dist/channel-core-test-support.js +5 -6
  42. package/dist/channel-core-test-support.js.map +1 -1
  43. package/dist/channel-core.d.ts +24 -29
  44. package/dist/channel-core.d.ts.map +1 -1
  45. package/dist/channel-core.js +18 -42
  46. package/dist/channel-core.js.map +1 -1
  47. package/dist/cli/commands/agents.d.ts +3 -6
  48. package/dist/cli/commands/agents.d.ts.map +1 -1
  49. package/dist/cli/commands/agents.js +14 -50
  50. package/dist/cli/commands/agents.js.map +1 -1
  51. package/dist/cli/commands/contacts.d.ts +5 -6
  52. package/dist/cli/commands/contacts.d.ts.map +1 -1
  53. package/dist/cli/commands/contacts.js +15 -43
  54. package/dist/cli/commands/contacts.js.map +1 -1
  55. package/dist/cli/commands/conversations.d.ts +8 -18
  56. package/dist/cli/commands/conversations.d.ts.map +1 -1
  57. package/dist/cli/commands/conversations.js +14 -65
  58. package/dist/cli/commands/conversations.js.map +1 -1
  59. package/dist/cli/commands/messages.d.ts +13 -35
  60. package/dist/cli/commands/messages.d.ts.map +1 -1
  61. package/dist/cli/commands/messages.js +21 -46
  62. package/dist/cli/commands/messages.js.map +1 -1
  63. package/dist/cli/commands/register.d.ts +10 -12
  64. package/dist/cli/commands/register.d.ts.map +1 -1
  65. package/dist/cli/commands/register.js +47 -133
  66. package/dist/cli/commands/register.js.map +1 -1
  67. package/dist/cli/commands/send.d.ts +23 -36
  68. package/dist/cli/commands/send.d.ts.map +1 -1
  69. package/dist/cli/commands/send.js +25 -72
  70. package/dist/cli/commands/send.js.map +1 -1
  71. package/dist/cli/commands/start.d.ts +10 -124
  72. package/dist/cli/commands/start.d.ts.map +1 -1
  73. package/dist/cli/commands/start.js +28 -510
  74. package/dist/cli/commands/start.js.map +1 -1
  75. package/dist/cli/commands/status.d.ts +1 -1
  76. package/dist/cli/commands/status.d.ts.map +1 -1
  77. package/dist/cli/commands/status.js +8 -9
  78. package/dist/cli/commands/status.js.map +1 -1
  79. package/dist/cli/commands/test-transport.d.ts +12 -5
  80. package/dist/cli/commands/test-transport.d.ts.map +1 -1
  81. package/dist/cli/commands/test-transport.js +15 -15
  82. package/dist/cli/commands/test-transport.js.map +1 -1
  83. package/dist/cli/index.js +13 -40
  84. package/dist/cli/index.js.map +1 -1
  85. package/dist/cli/output.d.ts +4 -0
  86. package/dist/cli/output.d.ts.map +1 -0
  87. package/dist/cli/output.js +9 -0
  88. package/dist/cli/output.js.map +1 -0
  89. package/dist/cli/socket-client.d.ts +7 -14
  90. package/dist/cli/socket-client.d.ts.map +1 -1
  91. package/dist/cli/socket-client.js +15 -38
  92. package/dist/cli/socket-client.js.map +1 -1
  93. package/dist/cli/transport.d.ts +53 -116
  94. package/dist/cli/transport.d.ts.map +1 -1
  95. package/dist/cli/transport.js +45 -295
  96. package/dist/cli/transport.js.map +1 -1
  97. package/dist/config.d.ts +24 -0
  98. package/dist/config.d.ts.map +1 -0
  99. package/dist/config.js +35 -0
  100. package/dist/config.js.map +1 -0
  101. package/dist/config.test-utils.d.ts +13 -0
  102. package/dist/config.test-utils.d.ts.map +1 -0
  103. package/dist/config.test-utils.js +46 -0
  104. package/dist/config.test-utils.js.map +1 -0
  105. package/dist/index.d.ts +3 -8
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +2 -12
  108. package/dist/index.js.map +1 -1
  109. package/dist/local-daemon-rpc.d.ts +259 -8
  110. package/dist/local-daemon-rpc.d.ts.map +1 -1
  111. package/dist/local-daemon-rpc.js +189 -12
  112. package/dist/local-daemon-rpc.js.map +1 -1
  113. package/dist/{runtime/local-history.d.ts → local-history.d.ts} +16 -21
  114. package/dist/local-history.d.ts.map +1 -0
  115. package/dist/{runtime/local-history.js → local-history.js} +16 -21
  116. package/dist/local-history.js.map +1 -0
  117. package/dist/local-paths.d.ts +0 -2
  118. package/dist/local-paths.d.ts.map +1 -1
  119. package/dist/local-paths.js +0 -4
  120. package/dist/local-paths.js.map +1 -1
  121. package/dist/local-socket-server.d.ts +22 -0
  122. package/dist/local-socket-server.d.ts.map +1 -0
  123. package/dist/{runtime/local-socket-server.js → local-socket-server.js} +4 -9
  124. package/dist/local-socket-server.js.map +1 -0
  125. package/dist/message-rendering.d.ts +3 -0
  126. package/dist/message-rendering.d.ts.map +1 -0
  127. package/dist/message-rendering.js +7 -0
  128. package/dist/message-rendering.js.map +1 -0
  129. package/dist/notification/__tests__/{snapshot-semantics.types-check.d.ts → subscribe-signatures.types-check.d.ts} +1 -1
  130. package/dist/notification/__tests__/subscribe-signatures.types-check.d.ts.map +1 -0
  131. package/dist/notification/__tests__/subscribe-signatures.types-check.js +55 -0
  132. package/dist/notification/__tests__/subscribe-signatures.types-check.js.map +1 -0
  133. package/dist/notification/errors.d.ts +18 -6
  134. package/dist/notification/errors.d.ts.map +1 -1
  135. package/dist/notification/errors.js +13 -15
  136. package/dist/notification/errors.js.map +1 -1
  137. package/dist/notification/index.d.ts +5 -0
  138. package/dist/notification/index.d.ts.map +1 -0
  139. package/dist/notification/index.js +5 -0
  140. package/dist/notification/index.js.map +1 -0
  141. package/dist/notification/stream.d.ts +33 -49
  142. package/dist/notification/stream.d.ts.map +1 -1
  143. package/dist/notification/stream.js +33 -76
  144. package/dist/notification/stream.js.map +1 -1
  145. package/dist/pagination.d.ts +20 -10
  146. package/dist/pagination.d.ts.map +1 -1
  147. package/dist/pagination.js +8 -9
  148. package/dist/pagination.js.map +1 -1
  149. package/dist/profile.d.ts +92 -0
  150. package/dist/profile.d.ts.map +1 -0
  151. package/dist/profile.js +149 -0
  152. package/dist/profile.js.map +1 -0
  153. package/dist/refs.d.ts.map +1 -0
  154. package/dist/refs.js.map +1 -0
  155. package/dist/service-archive-purge.d.ts +2 -1
  156. package/dist/service-archive-purge.d.ts.map +1 -1
  157. package/dist/service-archive-purge.js.map +1 -1
  158. package/dist/{runtime/service-helpers.d.ts → service-helpers.d.ts} +5 -11
  159. package/dist/service-helpers.d.ts.map +1 -0
  160. package/dist/{runtime/service-helpers.js → service-helpers.js} +2 -9
  161. package/dist/service-helpers.js.map +1 -0
  162. package/dist/service-local-daemon.d.ts +22 -0
  163. package/dist/service-local-daemon.d.ts.map +1 -0
  164. package/dist/service-local-daemon.js +185 -0
  165. package/dist/service-local-daemon.js.map +1 -0
  166. package/dist/service.d.ts +65 -57
  167. package/dist/service.d.ts.map +1 -1
  168. package/dist/service.js +205 -156
  169. package/dist/service.js.map +1 -1
  170. package/dist/test-utils/channel-service-fixture.d.ts +3 -2
  171. package/dist/test-utils/channel-service-fixture.d.ts.map +1 -1
  172. package/dist/test-utils/channel-service-fixture.js.map +1 -1
  173. package/dist/test-utils/fake-service.d.ts +26 -18
  174. package/dist/test-utils/fake-service.d.ts.map +1 -1
  175. package/dist/test-utils/fake-service.js +28 -42
  176. package/dist/test-utils/fake-service.js.map +1 -1
  177. package/dist/test-utils/ids.d.ts +3 -1
  178. package/dist/test-utils/ids.d.ts.map +1 -1
  179. package/dist/test-utils/ids.js.map +1 -1
  180. package/dist/test-utils/index.d.ts +9 -2
  181. package/dist/test-utils/index.d.ts.map +1 -1
  182. package/dist/test-utils/index.js +8 -1
  183. package/dist/test-utils/index.js.map +1 -1
  184. package/dist/test-utils/standalone-provisioning.d.ts +17 -0
  185. package/dist/test-utils/standalone-provisioning.d.ts.map +1 -0
  186. package/dist/test-utils/standalone-provisioning.js +14 -0
  187. package/dist/test-utils/standalone-provisioning.js.map +1 -0
  188. package/dist/tsconfig.tsbuildinfo +1 -0
  189. package/package.json +39 -17
  190. package/dist/auth.test.d.ts +0 -2
  191. package/dist/auth.test.d.ts.map +0 -1
  192. package/dist/auth.test.js +0 -121
  193. package/dist/auth.test.js.map +0 -1
  194. package/dist/channel-core-context.test.d.ts +0 -2
  195. package/dist/channel-core-context.test.d.ts.map +0 -1
  196. package/dist/channel-core-context.test.js +0 -342
  197. package/dist/channel-core-context.test.js.map +0 -1
  198. package/dist/channel-core-dispatch.test.d.ts +0 -2
  199. package/dist/channel-core-dispatch.test.d.ts.map +0 -1
  200. package/dist/channel-core-dispatch.test.js +0 -557
  201. package/dist/channel-core-dispatch.test.js.map +0 -1
  202. package/dist/channel-core.test.d.ts +0 -2
  203. package/dist/channel-core.test.d.ts.map +0 -1
  204. package/dist/channel-core.test.js +0 -232
  205. package/dist/channel-core.test.js.map +0 -1
  206. package/dist/cli/__tests__/cli-multi-agent.int.test.d.ts +0 -2
  207. package/dist/cli/__tests__/cli-multi-agent.int.test.d.ts.map +0 -1
  208. package/dist/cli/__tests__/cli-multi-agent.int.test.js +0 -132
  209. package/dist/cli/__tests__/cli-multi-agent.int.test.js.map +0 -1
  210. package/dist/cli/commands/invite.d.ts +0 -7
  211. package/dist/cli/commands/invite.d.ts.map +0 -1
  212. package/dist/cli/commands/invite.js +0 -11
  213. package/dist/cli/commands/invite.js.map +0 -1
  214. package/dist/cli/commands/messages.test.d.ts +0 -2
  215. package/dist/cli/commands/messages.test.d.ts.map +0 -1
  216. package/dist/cli/commands/messages.test.js +0 -99
  217. package/dist/cli/commands/messages.test.js.map +0 -1
  218. package/dist/cli/commands/ping.d.ts +0 -7
  219. package/dist/cli/commands/ping.d.ts.map +0 -1
  220. package/dist/cli/commands/ping.js +0 -37
  221. package/dist/cli/commands/ping.js.map +0 -1
  222. package/dist/cli/commands/register.test.d.ts +0 -2
  223. package/dist/cli/commands/register.test.d.ts.map +0 -1
  224. package/dist/cli/commands/register.test.js +0 -91
  225. package/dist/cli/commands/register.test.js.map +0 -1
  226. package/dist/cli/commands/send.test.d.ts +0 -2
  227. package/dist/cli/commands/send.test.d.ts.map +0 -1
  228. package/dist/cli/commands/send.test.js +0 -59
  229. package/dist/cli/commands/send.test.js.map +0 -1
  230. package/dist/cli/commands/start.test.d.ts +0 -2
  231. package/dist/cli/commands/start.test.d.ts.map +0 -1
  232. package/dist/cli/commands/start.test.js +0 -624
  233. package/dist/cli/commands/start.test.js.map +0 -1
  234. package/dist/cli/commands/whoami.d.ts +0 -8
  235. package/dist/cli/commands/whoami.d.ts.map +0 -1
  236. package/dist/cli/commands/whoami.js +0 -28
  237. package/dist/cli/commands/whoami.js.map +0 -1
  238. package/dist/cli/config.d.ts +0 -66
  239. package/dist/cli/config.d.ts.map +0 -1
  240. package/dist/cli/config.js +0 -148
  241. package/dist/cli/config.js.map +0 -1
  242. package/dist/cli/config.test.d.ts +0 -2
  243. package/dist/cli/config.test.d.ts.map +0 -1
  244. package/dist/cli/config.test.js +0 -89
  245. package/dist/cli/config.test.js.map +0 -1
  246. package/dist/cli/http-client.d.ts +0 -17
  247. package/dist/cli/http-client.d.ts.map +0 -1
  248. package/dist/cli/http-client.js +0 -38
  249. package/dist/cli/http-client.js.map +0 -1
  250. package/dist/cli/profile.d.ts +0 -126
  251. package/dist/cli/profile.d.ts.map +0 -1
  252. package/dist/cli/profile.js +0 -231
  253. package/dist/cli/profile.js.map +0 -1
  254. package/dist/cli/profile.test.d.ts +0 -2
  255. package/dist/cli/profile.test.d.ts.map +0 -1
  256. package/dist/cli/profile.test.js +0 -369
  257. package/dist/cli/profile.test.js.map +0 -1
  258. package/dist/cli/transport.test.d.ts +0 -2
  259. package/dist/cli/transport.test.d.ts.map +0 -1
  260. package/dist/cli/transport.test.js +0 -312
  261. package/dist/cli/transport.test.js.map +0 -1
  262. package/dist/notification/__tests__/filter-equivalence.test.d.ts +0 -2
  263. package/dist/notification/__tests__/filter-equivalence.test.d.ts.map +0 -1
  264. package/dist/notification/__tests__/filter-equivalence.test.js +0 -123
  265. package/dist/notification/__tests__/filter-equivalence.test.js.map +0 -1
  266. package/dist/notification/__tests__/snapshot-semantics.test.d.ts +0 -2
  267. package/dist/notification/__tests__/snapshot-semantics.test.d.ts.map +0 -1
  268. package/dist/notification/__tests__/snapshot-semantics.test.js +0 -261
  269. package/dist/notification/__tests__/snapshot-semantics.test.js.map +0 -1
  270. package/dist/notification/__tests__/snapshot-semantics.types-check.d.ts.map +0 -1
  271. package/dist/notification/__tests__/snapshot-semantics.types-check.js +0 -62
  272. package/dist/notification/__tests__/snapshot-semantics.types-check.js.map +0 -1
  273. package/dist/pagination.test.d.ts +0 -2
  274. package/dist/pagination.test.d.ts.map +0 -1
  275. package/dist/pagination.test.js +0 -72
  276. package/dist/pagination.test.js.map +0 -1
  277. package/dist/runtime/close-info.d.ts +0 -84
  278. package/dist/runtime/close-info.d.ts.map +0 -1
  279. package/dist/runtime/close-info.js +0 -102
  280. package/dist/runtime/close-info.js.map +0 -1
  281. package/dist/runtime/close-info.test.d.ts +0 -2
  282. package/dist/runtime/close-info.test.d.ts.map +0 -1
  283. package/dist/runtime/close-info.test.js +0 -109
  284. package/dist/runtime/close-info.test.js.map +0 -1
  285. package/dist/runtime/errors.d.ts +0 -11
  286. package/dist/runtime/errors.d.ts.map +0 -1
  287. package/dist/runtime/errors.js +0 -41
  288. package/dist/runtime/errors.js.map +0 -1
  289. package/dist/runtime/errors.test.d.ts +0 -2
  290. package/dist/runtime/errors.test.d.ts.map +0 -1
  291. package/dist/runtime/errors.test.js +0 -79
  292. package/dist/runtime/errors.test.js.map +0 -1
  293. package/dist/runtime/frame.d.ts +0 -8
  294. package/dist/runtime/frame.d.ts.map +0 -1
  295. package/dist/runtime/frame.js +0 -12
  296. package/dist/runtime/frame.js.map +0 -1
  297. package/dist/runtime/frame.test.d.ts +0 -2
  298. package/dist/runtime/frame.test.d.ts.map +0 -1
  299. package/dist/runtime/frame.test.js +0 -59
  300. package/dist/runtime/frame.test.js.map +0 -1
  301. package/dist/runtime/index.d.ts +0 -10
  302. package/dist/runtime/index.d.ts.map +0 -1
  303. package/dist/runtime/index.js +0 -9
  304. package/dist/runtime/index.js.map +0 -1
  305. package/dist/runtime/local-history.d.ts.map +0 -1
  306. package/dist/runtime/local-history.js.map +0 -1
  307. package/dist/runtime/local-service-commands.d.ts +0 -26
  308. package/dist/runtime/local-service-commands.d.ts.map +0 -1
  309. package/dist/runtime/local-service-commands.js +0 -29
  310. package/dist/runtime/local-service-commands.js.map +0 -1
  311. package/dist/runtime/local-socket-server.d.ts +0 -20
  312. package/dist/runtime/local-socket-server.d.ts.map +0 -1
  313. package/dist/runtime/local-socket-server.js.map +0 -1
  314. package/dist/runtime/refs.d.ts.map +0 -1
  315. package/dist/runtime/refs.js.map +0 -1
  316. package/dist/runtime/runtime.test.d.ts +0 -2
  317. package/dist/runtime/runtime.test.d.ts.map +0 -1
  318. package/dist/runtime/runtime.test.js +0 -37
  319. package/dist/runtime/runtime.test.js.map +0 -1
  320. package/dist/runtime/service-helpers.d.ts.map +0 -1
  321. package/dist/runtime/service-helpers.js.map +0 -1
  322. package/dist/runtime/service-teardown.d.ts +0 -5
  323. package/dist/runtime/service-teardown.d.ts.map +0 -1
  324. package/dist/runtime/service-teardown.js +0 -36
  325. package/dist/runtime/service-teardown.js.map +0 -1
  326. package/dist/runtime/service-teardown.test.d.ts +0 -2
  327. package/dist/runtime/service-teardown.test.d.ts.map +0 -1
  328. package/dist/runtime/service-teardown.test.js +0 -80
  329. package/dist/runtime/service-teardown.test.js.map +0 -1
  330. package/dist/runtime/subscribers.d.ts +0 -152
  331. package/dist/runtime/subscribers.d.ts.map +0 -1
  332. package/dist/runtime/subscribers.js +0 -222
  333. package/dist/runtime/subscribers.js.map +0 -1
  334. package/dist/service-socket-path.test.d.ts +0 -2
  335. package/dist/service-socket-path.test.d.ts.map +0 -1
  336. package/dist/service-socket-path.test.js +0 -87
  337. package/dist/service-socket-path.test.js.map +0 -1
  338. package/dist/service.test.d.ts +0 -2
  339. package/dist/service.test.d.ts.map +0 -1
  340. package/dist/service.test.js +0 -796
  341. package/dist/service.test.js.map +0 -1
  342. package/dist/test/index.d.ts +0 -47
  343. package/dist/test/index.d.ts.map +0 -1
  344. package/dist/test/index.js +0 -39
  345. package/dist/test/index.js.map +0 -1
  346. package/dist/test-utils/conformance-adapter.d.ts +0 -40
  347. package/dist/test-utils/conformance-adapter.d.ts.map +0 -1
  348. package/dist/test-utils/conformance-adapter.js +0 -250
  349. package/dist/test-utils/conformance-adapter.js.map +0 -1
  350. package/dist/tm-client-test-support.d.ts +0 -184
  351. package/dist/tm-client-test-support.d.ts.map +0 -1
  352. package/dist/tm-client-test-support.js +0 -466
  353. package/dist/tm-client-test-support.js.map +0 -1
  354. package/dist/tm-client.d.ts +0 -269
  355. package/dist/tm-client.d.ts.map +0 -1
  356. package/dist/tm-client.js +0 -518
  357. package/dist/tm-client.js.map +0 -1
  358. package/dist/tm-client.test.d.ts +0 -2
  359. package/dist/tm-client.test.d.ts.map +0 -1
  360. package/dist/tm-client.test.js +0 -490
  361. package/dist/tm-client.test.js.map +0 -1
  362. /package/dist/{runtime/refs.d.ts → refs.d.ts} +0 -0
  363. /package/dist/{runtime/refs.js → refs.js} +0 -0
@@ -1,11 +1,9 @@
1
1
  /**
2
- * CLI transport layer — the single seam between the command handlers and
3
- * the wire. Decides between the singleton daemon (Unix socket) and a
4
- * direct WebSocket per invocation.
2
+ * CLI transport layer — the single boundary between the command handlers and
3
+ * the local daemon socket.
5
4
  *
6
- * This file is the `--as <apiKey>` branch point (spec sbd#177 rev 3 §5.1,
7
- * Invariant §4.2). Command handlers pull `Transport` from Effect context;
8
- * they do NOT open sockets or construct clients themselves. The kind of
5
+ * Command handlers pull `Transport` from Effect context; they do NOT open
6
+ * sockets or construct clients themselves. The kind of
9
7
  * transport in effect is decided once at CLI boot by {@link makeTransportLayer}
10
8
  * and is immutable for the lifetime of the process.
11
9
  *
@@ -13,100 +11,44 @@
13
11
  * that provides a recording `Transport`; unit tests provide `Transport`
14
12
  * directly via `Effect.provideService`.
15
13
  */
16
- import * as NodeSocket from "@effect/platform-node/NodeSocket";
17
- import { Config, Context, Data, Effect, Layer, Option, Redacted, Scope, } from "effect";
14
+ import { Context, Data, Effect, Layer } from "effect";
18
15
  import { MoltZapService } from "../service.js";
19
- import { NotConnectedError, RpcServerError, RpcTimeoutError, isRegisteredErrorInstance, } from "@moltzap/protocol";
20
- import { MoltZapAgentClient } from "../agent-client.js";
21
- import { request as daemonRequest } from "./socket-client.js";
22
- import { loadLayeredConfig, parseProfileName, resolveProfileAuth, } from "./profile.js";
16
+ import { getMoltZapAgentServiceSocketPath } from "../local-paths.js";
17
+ import { requestDaemonCommand, SocketRequestError } from "./socket-client.js";
18
+ import { LocalDaemonRpcs } from "../local-daemon-rpc.js";
19
+ import { resolveProfileRecord, } from "../profile.js";
23
20
  /**
24
21
  * The daemon socket path did not exist or refused connection. Only raised
25
- * by the daemon branch; the direct branch never raises this.
22
+ * by the daemon path.
26
23
  */
27
- export class ServiceUnreachableError extends Data.TaggedError("ServiceUnreachableError") {
24
+ class ServiceUnreachableError extends Data.TaggedError("ServiceUnreachableError") {
28
25
  }
29
26
  /** RPC exceeded the per-call deadline without a response frame. */
30
- export class TransportTimeoutError extends Data.TaggedError("TransportTimeoutError") {
27
+ class TransportTimeoutError extends Data.TaggedError("TransportTimeoutError") {
31
28
  }
32
29
  /**
33
- * Server returned a structured error response frame. `code` matches the
34
- * JSON-RPC-style error code emitted by `packages/server`.
30
+ * Server returned a typed wire `error` for a request. `tag` is the failing
31
+ * method's tagged-error discriminant (e.g. `"TaskRejected"`, `"Forbidden"`) —
32
+ * the `_tag` the engine decoded the error against, not a numeric code.
35
33
  */
36
34
  export class TransportRpcError extends Data.TaggedError("TransportRpcError") {
37
35
  }
38
36
  /** Response frame failed to parse or did not match the expected RPC result shape. */
39
- export class TransportDecodeError extends Data.TaggedError("TransportDecodeError") {
37
+ class TransportDecodeError extends Data.TaggedError("TransportDecodeError") {
40
38
  }
41
- /**
42
- * Transport inputs were self-inconsistent (e.g., `--as` set with no
43
- * `serverUrl` resolvable). Surfaces at Layer construction, not at RPC time.
44
- */
45
- export class TransportConfigError extends Data.TaggedError("TransportConfigError") {
46
- }
47
- // ─── Transport surface ─────────────────────────────────────────────────────
48
- /**
49
- * Kind of transport currently in use. Observable for logs and tests.
50
- * Commands never branch on kind.
51
- */
52
- export const DIRECT_TRANSPORT_KIND = "direct";
53
39
  export const Transport = Context.GenericTag("moltzap/cli/Transport");
54
- const DEFAULT_SERVER_URL = "wss://api.moltzap.xyz";
55
40
  const DAEMON_TIMEOUT_MS = 10_000;
56
- const JSON_RPC_SERVER_ERROR_CODE = -32000;
57
- const PROBE_DAEMON_TIMEOUT_MS = 250;
58
- const EnvServerUrl = Config.option(Config.string("MOLTZAP_SERVER_URL"));
59
- const EnvApiKey = Config.option(Config.redacted("MOLTZAP_API_KEY"));
60
- const loadEnvServerUrl = EnvServerUrl.pipe(Effect.map(Option.getOrUndefined), Effect.orElseSucceed(() => undefined));
61
- const loadEnvServerUrlWithDefault = loadEnvServerUrl.pipe(Effect.map((serverUrl) => serverUrl ?? DEFAULT_SERVER_URL));
62
- const loadEnvApiKey = EnvApiKey.pipe(Effect.map((value) => Option.match(value, {
63
- onNone: () => undefined,
64
- onSome: Redacted.value,
65
- })), Effect.orElseSucceed(() => undefined));
66
- const selectDirectTransportKey = (decision, options) => {
67
- const keyByReason = {
68
- "as-flag": options.impersonateKey,
69
- "env-fallback": options.envFallbackKey,
70
- profile: options.profileKey,
71
- };
72
- return keyByReason[decision.reason];
73
- };
74
- /**
75
- * Decision function — Effect-returning because the env-fallback branch
76
- * may invoke the `probeDaemon` thunk. The as-flag branch short-circuits
77
- * BEFORE any probe: `impersonateKey` present ⇒ returns
78
- * `UseDirect{as-flag}` without calling `probeDaemon`, without reading
79
- * env, without any side effect (Invariant §4.2).
80
- */
81
- export const decideTransport = (options) => Effect.gen(function* () {
82
- if (options.impersonateKey !== undefined) {
83
- return { _tag: "UseDirect", reason: "as-flag" };
84
- }
85
- if (options.profileKey !== undefined) {
86
- return { _tag: "UseDirect", reason: "profile" };
87
- }
88
- // Env-fallback branch: MOLTZAP_API_KEY is set AND daemon is unreachable.
89
- const hasEnvKey = options.envFallbackKey !== undefined;
90
- if (hasEnvKey && options.probeDaemon !== undefined) {
91
- const reachable = yield* options.probeDaemon();
92
- if (!reachable) {
93
- return { _tag: "UseDirect", reason: "env-fallback" };
94
- }
95
- }
96
- // Default: daemon branch.
97
- const socketPath = options.socketPath ?? MoltZapService.SOCKET_PATH;
98
- return { _tag: "UseDaemon", socketPath };
99
- }).pipe(Effect.withSpan("decideTransport"));
100
- // Map daemon-branch Error to TransportError tags. The daemon socket client
101
- // surfaces a generic Error; we re-tag at the boundary so command handlers
102
- // can discriminate.
103
- const tagDaemonError = (method, err) => {
41
+ // Map local socket faults to CLI transport tags. Errors decoded from the daemon
42
+ // RPC error channel are already typed tagged errors and pass through unchanged.
43
+ const tagDaemonError = (method, err, socketPath) => {
44
+ if (!(err instanceof SocketRequestError))
45
+ return err;
104
46
  const msg = err.message;
105
47
  if (msg.includes("not running") ||
106
48
  msg.includes("ENOENT") ||
107
49
  msg.includes("ECONNREFUSED")) {
108
50
  return new ServiceUnreachableError({
109
- socketPath: MoltZapService.SOCKET_PATH,
51
+ socketPath,
110
52
  cause: err,
111
53
  });
112
54
  }
@@ -116,249 +58,57 @@ const tagDaemonError = (method, err) => {
116
58
  if (msg.startsWith("Malformed")) {
117
59
  return new TransportDecodeError({ method, cause: err });
118
60
  }
119
- // Remote error surfaces as a bare message from the service.
120
61
  return new TransportRpcError({
121
62
  method,
122
- code: JSON_RPC_SERVER_ERROR_CODE,
63
+ tag: err._tag,
123
64
  message: msg,
124
65
  });
125
66
  };
126
67
  const makeDaemonTransport = (socketPath) => ({
127
- kind: "daemon",
128
- rpc: (definition, params) => daemonRequest(definition, params, socketPath).pipe(Effect.mapError((err) => tagDaemonError(definition.name, err))),
129
- });
130
- // Map ws-client errors (NotConnectedError | RpcTimeoutError | RpcServerError |
131
- // any registered domain wire error) to TransportError tags.
132
- // Registered domain wire errors (e.g. `TaskRejectedError`, -32024) decode to a
133
- // tagged-error instance whose numeric `code` lives on the constructor, not the
134
- // instance. Map them to `TransportRpcError` so the CLI surfaces the real
135
- // code/reason rather than misreporting a decode failure. Returns null when
136
- // `err` is not a registered wire error (caller falls through to decode).
137
- function mapRegisteredWireError(method, err) {
138
- if (typeof err !== "object" ||
139
- err === null ||
140
- !isRegisteredErrorInstance(err)) {
141
- return null;
142
- }
143
- const cls = err.constructor;
144
- const payload = err;
145
- const message = payload.message !== undefined && payload.message.length > 0
146
- ? payload.message
147
- : cls.message;
148
- return new TransportRpcError({
149
- method,
150
- code: cls.code,
151
- message,
152
- data: payload.data,
153
- });
154
- }
155
- /**
156
- * Exported for decoder-fixture tests only (sbd#198).
157
- * @internal
158
- */
159
- export const tagWsError = (method, err) => {
160
- if (err instanceof NotConnectedError) {
161
- return new ServiceUnreachableError({
162
- socketPath: "(direct-ws)",
163
- cause: err,
164
- });
165
- }
166
- if (err instanceof RpcTimeoutError) {
167
- return new TransportTimeoutError({
168
- method,
169
- timeoutMs: err.timeoutMs,
170
- });
171
- }
172
- if (err instanceof RpcServerError) {
173
- return new TransportRpcError({
174
- method,
175
- code: err.code,
176
- message: err.message,
177
- data: err.data,
178
- });
179
- }
180
- const registered = mapRegisteredWireError(method, err);
181
- if (registered !== null) {
182
- return registered;
183
- }
184
- return new TransportDecodeError({ method, cause: err });
185
- };
186
- function mapDirectRpcError(method) {
187
- return (err) => tagWsError(method, err);
188
- }
189
- function sendDirectRpc(connectOnce, definition, params) {
190
- return connectOnce.pipe(Effect.flatMap((client) => client
191
- .sendRpc(definition, params)
192
- .pipe(Effect.mapError(mapDirectRpcError(definition.name)))));
193
- }
194
- /**
195
- * Build a direct-WebSocket transport. Requires `Scope` so `Layer.scoped`
196
- * can install a finalizer via `Effect.addFinalizer`. The finalizer fires on
197
- * fiber interruption (SIGINT/SIGTERM) — closing the ws-client and its internal
198
- * ManagedRuntime — and also runs on normal completion so the event loop drains
199
- * naturally without a forced `process.exit`. This replaces the fragile
200
- * `process.once("beforeExit", ...)` hook that never fired because the reader
201
- * fiber kept the event loop non-empty (sbd#198 Bug-2 / moltzap#228).
202
- *
203
- * `MoltZapAgentClient` is constructed lazily inside `Effect.cached` so commands
204
- * that never reach the wire (e.g. help-text display, input validation failure)
205
- * do not pay for a ManagedRuntime spin-up.
206
- *
207
- * `sendRpc` is composed entirely in Effect-land — no `Effect.runPromise`
208
- * bridge — so typed errors (`NotConnectedError`, `RpcTimeoutError`,
209
- * `RpcServerError`) flow through `tagWsError` with their `_tag` intact.
210
- */
211
- const makeDirectTransport = (serverUrl, agentKey) => Effect.gen(function* () {
212
- if (!serverUrl) {
213
- return yield* Effect.fail(new TransportConfigError({
214
- reason: "direct transport requires a serverUrl",
215
- }));
216
- }
217
- if (!agentKey) {
218
- return yield* Effect.fail(new TransportConfigError({
219
- reason: "direct transport requires an agentKey",
220
- }));
221
- }
222
- // Lazily-created client: null until the first rpc() call fires connectOnce.
223
- // The finalizer checks the current value at scope-close time so help/
224
- // validation paths that never open a socket incur no cleanup cost.
225
- let client = null;
226
- yield* Effect.addFinalizer(() => client !== null ? client.close() : Effect.void);
227
- // Memoize the connect handshake: only one round-trip per invocation,
228
- // cached for the lifetime of this scope.
229
- const connectOnce = yield* Effect.cached(Effect.gen(function* () {
230
- const c = new MoltZapAgentClient({ serverUrl, agentKey });
231
- client = c;
232
- yield* c
233
- .connect()
234
- .pipe(Effect.mapError((e) => tagWsError("connect", e)));
235
- return c;
236
- }));
237
- return {
238
- kind: DIRECT_TRANSPORT_KIND,
239
- rpc: (definition, params) => sendDirectRpc(connectOnce, definition, params),
240
- };
68
+ command: (tag, payload) => requestDaemonCommand(tag, payload, socketPath).pipe(Effect.mapError((err) => tagDaemonError(tag, err, socketPath))),
241
69
  });
70
+ /** Build the Layer that provides {@link Transport} for the current invocation. */
71
+ export const makeTransportLayer = (options) => Layer.succeed(Transport, makeDaemonTransport(options.socketPath));
242
72
  /**
243
- * Build the Layer that provides {@link Transport} for the current invocation.
244
- *
245
- * Branch points (in priority order):
246
- * 1. `options.impersonateKey` → direct WS, Invariant §4.2 isolation guaranteed.
247
- * 2. `process.env.MOLTZAP_API_KEY` present AND daemon unreachable → direct WS.
248
- * 3. `options.profileKey` set → direct WS with that key.
249
- * 4. otherwise → daemon transport over `options.socketPath`.
250
- *
251
- * The direct branch must NOT open the daemon socket, mutate
252
- * `~/.moltzap/config.json`, or share any Effect fiber with the daemon.
253
- * Integration test §7 of the design doc verifies this with a two-agent
254
- * concurrent roster.
73
+ * Convenience for command handlers: pull the Transport tag and call a daemon
74
+ * command.
75
+ * Every subcommand routes through this helper; command handlers do not
76
+ * import `socket-client` directly.
255
77
  */
256
- export const makeTransportLayer = (options) => Layer.scoped(Transport, Effect.gen(function* () {
257
- const decision = yield* decideTransport(options);
258
- switch (decision._tag) {
259
- case "UseDaemon":
260
- return makeDaemonTransport(decision.socketPath);
261
- case "UseDirect": {
262
- const key = selectDirectTransportKey(decision, options);
263
- if (key === undefined) {
264
- return yield* Effect.fail(new TransportConfigError({
265
- reason: `direct transport (${decision.reason}) requires an apiKey`,
266
- }));
267
- }
268
- return yield* makeDirectTransport(options.serverUrl, key);
269
- }
270
- case "UseTest":
271
- return yield* Effect.fail(new TransportConfigError({
272
- reason: "UseTest is a test-only branch; provide Transport via Effect.provideService",
273
- }));
274
- default:
275
- return absurd(decision);
276
- }
277
- }).pipe(Effect.withSpan("makeTransportLayer")));
278
- /**
279
- * Convenience for command handlers: pull the Transport tag and call rpc.
280
- * Every new subcommand routes through this helper; raw `socket-client.request`
281
- * imports in new commands are a lint-level violation (see design doc §3).
282
- */
283
- export const rpc = (definition, params) => Effect.flatMap(Transport, (t) => t.rpc(definition, params));
78
+ export const command = (tag, payload) => Effect.flatMap(Transport, (t) => t.command(tag, payload));
284
79
  /**
285
80
  * Uniform error-to-exit adapter for subcommand handlers. Catches every error
286
81
  * channel, prints `Failed: <msg>` to stderr, and exits non-zero. Uses the
287
82
  * tagged-error `message` field if present, otherwise the `_tag`, otherwise
288
- * a generic fallback. Shared across every v2 subcommand wrapper so the
289
- * exit-code contract (Invariant §4.6) has a single implementation.
83
+ * a generic fallback. Shared across every subcommand wrapper so the
84
+ * exit-code contract has a single implementation.
290
85
  *
291
- * On success, this returns normally and relies on the `Layer.scoped`
292
- * finalizer in `makeDirectTransport` to close the ws-client and drain
293
- * the event loop (sbd#198 / moltzap#228 Bug-2 fix). No forced
294
- * `process.exit(0)` — that would truncate piped stdout on large payloads.
86
+ * No forced `process.exit(0)` — that would truncate piped stdout on large
87
+ * payloads.
295
88
  */
296
- export const runHandler = (effect) => effect.pipe(Effect.catchAll((err) => Effect.sync(() => {
89
+ export const runHandler = (effect) => effect.pipe(Effect.catchAll((err) => {
297
90
  const msg = err.message !== undefined && err.message !== ""
298
91
  ? err.message
299
92
  : (err._tag ?? "unknown error");
300
- console.error(`Failed: ${msg}`);
301
- process.exit(1);
302
- })));
93
+ return Effect.logError(`Failed: ${msg}`).pipe(Effect.zipRight(Effect.sync(() => process.exit(1))));
94
+ }));
303
95
  /**
304
96
  * Lazy resolver invoked by the CLI entrypoint BEFORE constructing the
305
- * transport layer. Closes the composition-boundary leak (architect design
306
- * doc rev 4 finding 1): with `impersonateKey` set, this function does NOT
307
- * call `cli/config.ts:loadConfig`, does NOT read `MOLTZAP_API_KEY` env,
308
- * does NOT open `~/.moltzap/config.json`. The only resolution performed on
309
- * the as-flag branch is `MOLTZAP_SERVER_URL` (or the hard-coded default).
310
- *
311
- * This function is the true CLI-boundary gate on Invariant §4.2 — without
312
- * it, eager config-read side effects leak even when `decideTransport` is
313
- * later short-circuited. Unit tests assert on `fs.open` and `env` read
314
- * spies that zero calls happen on the `impersonateKey` branch.
97
+ * transport layer. With `profileName` set, this resolves the named profile
98
+ * into the profile agent's daemon socket; otherwise it uses the default
99
+ * daemon socket.
315
100
  */
316
101
  export const resolveTransportInputs = (parsed) => Effect.gen(function* () {
317
- // ─── Branch A: impersonate (--as) ──────────────────────────────────────
318
- // Invariant §4.2: no loadConfig, no MOLTZAP_API_KEY read, no config.json open.
319
- if (parsed.impersonateKey !== undefined) {
320
- const serverUrl = yield* loadEnvServerUrlWithDefault;
321
- return {
322
- impersonateKey: parsed.impersonateKey,
323
- serverUrl,
324
- };
325
- }
326
- // ─── Branch B: profile ─────────────────────────────────────────────────
102
+ // ─── Branch A: profile ─────────────────────────────────────────────────
327
103
  if (parsed.profileName !== undefined) {
328
- const name = yield* parseProfileName(parsed.profileName);
329
- const layered = yield* loadLayeredConfig;
330
- const record = yield* resolveProfileAuth(name);
331
- const serverUrl = yield* loadEnvServerUrl;
104
+ const record = yield* resolveProfileRecord(parsed.profileName);
332
105
  return {
333
- profileKey: record.apiKey,
334
- serverUrl: serverUrl ?? record.serverUrl ?? layered.serverUrl,
335
- socketPath: MoltZapService.SOCKET_PATH,
336
- probeDaemon: probeDaemonDefault,
106
+ socketPath: getMoltZapAgentServiceSocketPath(record.agentId),
337
107
  };
338
108
  }
339
- // ─── Branch C: legacy daemon / env fallback ────────────────────────────
340
- const serverUrl = yield* loadEnvServerUrlWithDefault;
341
- const envFallbackKey = yield* loadEnvApiKey;
109
+ // ─── Branch B: daemon ──────────────────────────────────────────────────
342
110
  return {
343
- ...(envFallbackKey !== undefined ? { envFallbackKey } : {}),
344
- serverUrl,
345
111
  socketPath: MoltZapService.SOCKET_PATH,
346
- probeDaemon: probeDaemonDefault,
347
112
  };
348
113
  }).pipe(Effect.withSpan("resolveTransportInputs"));
349
- /**
350
- * Default daemon reachability probe: attempt a real connect to the daemon
351
- * socket and resolve on `connect`. A bare `fs.existsSync` would mis-report
352
- * a stale socket file as "reachable" and route env-fallback callers into
353
- * a broken daemon branch; a real connect is the only honest reachability
354
- * check. 250ms cap keeps boot latency invisible on the common fast-local
355
- * path and still fails fast when the socket refuses or hangs.
356
- */
357
- const probeDaemonDefault = () => Effect.scoped(NodeSocket.makeNet({
358
- path: MoltZapService.SOCKET_PATH,
359
- openTimeout: `${PROBE_DAEMON_TIMEOUT_MS} millis`,
360
- }).pipe(Effect.as(true), Effect.catchAll(() => Effect.succeed(false))));
361
- function absurd(x) {
362
- throw new Error(`unreachable: ${String(x)}`);
363
- }
364
114
  //# sourceMappingURL=transport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transport.js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CAAC;IACpC,OAAO,MAAM,CAAC,QAAQ,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC,IAAI,CAC3C,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CACpD,CAAC;AACJ,CAAC,CAAC,CACH,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,MAEtC,EAAiD,EAAE,CAClD,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,0EAA0E;IAC1E,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/D,OAAO;YACL,UAAU,EAAE,gCAAgC,CAAC,MAAM,CAAC,OAAO,CAAC;SAC7D,CAAC;IACJ,CAAC;IACD,0EAA0E;IAC1E,OAAO;QACL,UAAU,EAAE,cAAc,CAAC,WAAW;KACvC,CAAC;AACJ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Effect } from "effect";
2
+ import type { AgentId } from "@moltzap/protocol/identity";
3
+ import type { AgentKey } from "@moltzap/protocol/identity";
4
+ import { ProfileInvalidNameError, ProfileNotFoundError } from "./profile.js";
5
+ export interface MoltzapServiceConfig {
6
+ readonly serverUrl: string;
7
+ readonly agentKey: AgentKey;
8
+ readonly agentId: AgentId;
9
+ }
10
+ export type ServiceConfigError = ConfigReadError | ProfileInvalidNameError | ProfileNotFoundError;
11
+ declare const ConfigReadError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
12
+ readonly _tag: "ConfigReadError";
13
+ } & Readonly<A>;
14
+ declare class ConfigReadError extends ConfigReadError_base<{
15
+ readonly cause: unknown;
16
+ readonly message: string;
17
+ readonly path: string;
18
+ }> {
19
+ }
20
+ export declare const getServerUrl: Effect.Effect<string, never>;
21
+ export declare const getHttpUrl: Effect.Effect<string, never>;
22
+ export declare const loadServiceConfig: (profileName: string) => Effect.Effect<MoltzapServiceConfig, ServiceConfigError>;
23
+ export {};
24
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,MAAM,EAAU,MAAM,QAAQ,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAIL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAID,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,uBAAuB,GACvB,oBAAoB,CAAC;;;;AAEzB,cAAM,eAAgB,SAAQ,qBAAoC;IAChE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB,CAAC;CAAG;AAwBL,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAMrD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAEnD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,aAAa,MAAM,KAClB,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,kBAAkB,CAgBV,CAAC"}
package/dist/config.js ADDED
@@ -0,0 +1,35 @@
1
+ import { Config, ConfigProvider, Data, Effect, Option } from "effect";
2
+ import { loadLayeredConfig, parseProfileName, ProfileConfigReadError, ProfileInvalidNameError, ProfileNotFoundError, } from "./profile.js";
3
+ const DEFAULT_SERVER_URL = "wss://api.moltzap.xyz";
4
+ class ConfigReadError extends Data.TaggedError("ConfigReadError") {
5
+ }
6
+ function describeCause(cause) {
7
+ return cause instanceof Error ? cause.message : String(cause);
8
+ }
9
+ function configReadError(configPath, cause, detail) {
10
+ return new ConfigReadError({
11
+ cause,
12
+ message: `Failed to ${detail} ${configPath}: ${describeCause(cause)}`,
13
+ path: configPath,
14
+ });
15
+ }
16
+ function configReadErrorFromProfile(error) {
17
+ return configReadError(error.path, error.cause, "read");
18
+ }
19
+ export const getServerUrl = Config.option(Config.string("MOLTZAP_SERVER_URL")).pipe(Effect.withConfigProvider(ConfigProvider.fromEnv()), Effect.map((value) => Option.getOrElse(value, () => DEFAULT_SERVER_URL)), Effect.orElseSucceed(() => DEFAULT_SERVER_URL));
20
+ export const getHttpUrl = getServerUrl.pipe(Effect.map((url) => url.replace(/^wss:/, "https:").replace(/^ws:/, "http:")));
21
+ export const loadServiceConfig = (profileName) => Effect.gen(function* () {
22
+ const name = yield* parseProfileName(profileName);
23
+ const layered = yield* loadLayeredConfig.pipe(Effect.mapError(configReadErrorFromProfile));
24
+ const profile = layered.profiles.get(name);
25
+ if (profile === undefined) {
26
+ return yield* Effect.fail(new ProfileNotFoundError({ name }));
27
+ }
28
+ const serverUrl = yield* getServerUrl;
29
+ return {
30
+ serverUrl,
31
+ agentKey: profile.apiKey,
32
+ agentId: profile.agentId,
33
+ };
34
+ }).pipe(Effect.withSpan("loadServiceConfig"));
35
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file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AAG,EAAE,CAAC,kBAAkB,CAAC,CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAiC,YAAY,CAAC,IAAI,CACvE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAC7E,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,WAAmB,EACsC,EAAE,CAC3D,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAC3C,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAC5C,CAAC;IACF,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,oBAAoB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;IACD,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,YAAY,CAAC;IACtC,OAAO;QACL,SAAS;QACT,QAAQ,EAAE,OAAO,CAAC,MAAM;QACxB,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;AACJ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Effect } from "effect";
2
+ import type { AgentId } from "@moltzap/protocol/identity";
3
+ import type { AgentKey } from "@moltzap/protocol/identity";
4
+ interface TestServiceConfig {
5
+ readonly agentId: AgentId;
6
+ readonly agentKey: AgentKey;
7
+ readonly serverUrl: string;
8
+ readonly profileName?: string;
9
+ readonly agentName?: string;
10
+ }
11
+ export declare function withTestServiceConfig<A, E, R>(config: TestServiceConfig, effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>;
12
+ export {};
13
+ //# sourceMappingURL=config.test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.test-utils.d.ts","sourceRoot":"","sources":["../src/config.test-utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAY,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,UAAU,iBAAiB;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAMD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC3C,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAC7B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAuCxB"}
@@ -0,0 +1,46 @@
1
+ /* eslint-disable agent-code-guard/acquire-release-requires-scope, agent-code-guard/no-process-env-at-runtime, agent-code-guard/prefer-effect-platform -- Test-only helper scopes process.env and temp config files around one Effect. */
2
+ import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import { Effect, Redacted } from "effect";
6
+ const ENV_SERVER_URL = "MOLTZAP_SERVER_URL";
7
+ const ENV_CONFIG_HOME = "MOLTZAP_CONFIG_HOME";
8
+ const CONFIG_FILE_NAME = "config.json";
9
+ export function withTestServiceConfig(config, effect) {
10
+ return Effect.acquireUseRelease(Effect.sync(() => {
11
+ const previousServerUrl = process.env[ENV_SERVER_URL];
12
+ const previousConfigHome = process.env[ENV_CONFIG_HOME];
13
+ const configHome = config.profileName
14
+ ? mkdtempSync(join(tmpdir(), "moltzap-test-config-"))
15
+ : undefined;
16
+ process.env[ENV_SERVER_URL] = config.serverUrl;
17
+ if (configHome !== undefined && config.profileName !== undefined) {
18
+ process.env[ENV_CONFIG_HOME] = configHome;
19
+ writeFileSync(join(configHome, CONFIG_FILE_NAME), JSON.stringify({
20
+ profiles: {
21
+ [config.profileName]: {
22
+ agentId: config.agentId,
23
+ apiKey: Redacted.value(config.agentKey),
24
+ agentName: config.agentName ?? config.profileName,
25
+ },
26
+ },
27
+ }, null, 2));
28
+ }
29
+ return () => {
30
+ restoreEnv(ENV_SERVER_URL, previousServerUrl);
31
+ restoreEnv(ENV_CONFIG_HOME, previousConfigHome);
32
+ if (configHome !== undefined) {
33
+ rmSync(configHome, { recursive: true, force: true });
34
+ }
35
+ };
36
+ }), () => effect, (restore) => Effect.sync(restore));
37
+ }
38
+ function restoreEnv(key, value) {
39
+ if (value === undefined) {
40
+ delete process.env[key];
41
+ }
42
+ else {
43
+ process.env[key] = value;
44
+ }
45
+ }
46
+ //# sourceMappingURL=config.test-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.test-utils.js","sourceRoot":"","sources":["../src/config.test-utils.ts"],"names":[],"mappings":"AAAA,yOAAyO;AACzO,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,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,CAAC;YAC9C,UAAU,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC;YAChD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;gBAC7B,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,CAAC,EACF,GAAG,EAAE,CAAC,MAAM,EACZ,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAClC,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,GAAW,EAAE,KAAyB;IACxD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IAC3B,CAAC;AACH,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,13 +1,8 @@
1
1
  /**
2
2
  * @file Public barrel for the MoltZap client package.
3
3
  */
4
- export { MoltZapService, formatCrossConversationBlock, sanitizeForSystemReminder, type ConversationMeta, type ContextOptions, type CrossConvMessage, type CrossConversationEntry, type ServiceOptions, type ServiceRpcError, } from "./service.js";
5
- export { AgentNotFoundError, MalformedFrameError } from "./runtime/errors.js";
6
- export { MoltZapChannelCore, type ChannelCoreOptions, type ChannelService, type ContextBlocks, type DispatchAdmissionDecision, type DispatchAdmissionRequest, type DispatchReleaseFrame, type EnrichedConversationMeta, type EnrichedInboundMessage, type EnrichedSender, type InboundHandler, type PendingDispatchMessage, } from "./channel-core.js";
4
+ export { MoltZapService, type ConversationMeta, type ContextOptions, type ServiceRpcError, } from "./service.js";
7
5
  export { MoltZapAgentClient, type AgentClientOptions } from "./agent-client.js";
8
- export { MoltZapTMClient, type TMClientOptions, type TMHandlers, type TaskCallbackContext, type RpcCallOptions, } from "./tm-client.js";
9
- export type { CloseInfo } from "./runtime/close-info.js";
10
- export { TimeoutError as NotificationTimeoutError, StreamClosedError as NotificationStreamClosedError, type NotificationConsumerError, } from "./notification/errors.js";
11
- export { registerAgent, type RegisterAgentOptions, type RegisterResponse, } from "./auth.js";
12
- export { drainPaginatedList, NonAdvancingCursorError, type SendRpcFn, } from "./pagination.js";
6
+ export { MoltZapAppClient, type AppClientOptions, type AppCallbackContext, type RpcCallOptions, } from "./app-client.js";
7
+ export type { AppCallbackHandlers } from "@moltzap/protocol/socket";
13
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,yBAAyB,EACzB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,kBAAkB,EAClB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIzD,OAAO,EACL,YAAY,IAAI,wBAAwB,EACxC,iBAAiB,IAAI,6BAA6B,EAClD,KAAK,yBAAyB,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -1,17 +1,7 @@
1
1
  /**
2
2
  * @file Public barrel for the MoltZap client package.
3
3
  */
4
- export { MoltZapService, formatCrossConversationBlock, sanitizeForSystemReminder, } from "./service.js";
5
- export { AgentNotFoundError, MalformedFrameError } from "./runtime/errors.js";
6
- export { MoltZapChannelCore, } from "./channel-core.js";
4
+ export { MoltZapService, } from "./service.js";
7
5
  export { MoltZapAgentClient } from "./agent-client.js";
8
- export { MoltZapTMClient, } from "./tm-client.js";
9
- // Spec B (#596) — tagged errors for the typed-Stream subscribe surface.
10
- // `NotificationConsumerError` is a type union (see notification/errors.ts
11
- // header for rationale, codex review r1 finding #8).
12
- export { TimeoutError as NotificationTimeoutError, StreamClosedError as NotificationStreamClosedError, } from "./notification/errors.js";
13
- export { registerAgent, } from "./auth.js";
14
- // Generic drainer for the cursor-paginated list RPCs (shared across
15
- // channels/CLIs that need the complete result set, not just one page).
16
- export { drainPaginatedList, NonAdvancingCursorError, } from "./pagination.js";
6
+ export { MoltZapAppClient, } from "./app-client.js";
17
7
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,yBAAyB,GAO1B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,kBAAkB,GAYnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAA2B,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,eAAe,GAKhB,MAAM,gBAAgB,CAAC;AAExB,wEAAwE;AACxE,0EAA0E;AAC1E,qDAAqD;AACrD,OAAO,EACL,YAAY,IAAI,wBAAwB,EACxC,iBAAiB,IAAI,6BAA6B,GAEnD,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,GAGd,MAAM,WAAW,CAAC;AACnB,oEAAoE;AACpE,uEAAuE;AACvE,OAAO,EACL,kBAAkB,EAClB,uBAAuB,GAExB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,cAAc,GAIf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAA2B,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,gBAAgB,GAIjB,MAAM,iBAAiB,CAAC"}