@zvada/agent-server 0.3.22 → 0.3.23

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 (348) hide show
  1. package/CHANGELOG.md +261 -0
  2. package/dist/types/accounts/chatgpt.d.ts +1 -1
  3. package/dist/types/accounts/chatgpt.d.ts.map +1 -1
  4. package/dist/types/accounts/http.d.ts +2 -4
  5. package/dist/types/accounts/http.d.ts.map +1 -1
  6. package/dist/types/client/client.d.ts +37 -11
  7. package/dist/types/client/client.d.ts.map +1 -1
  8. package/dist/types/client/connection.d.ts +64 -13
  9. package/dist/types/client/connection.d.ts.map +1 -1
  10. package/dist/types/client/index.d.ts +1 -1
  11. package/dist/types/client/index.d.ts.map +1 -1
  12. package/dist/types/client/logins.d.ts +2 -1
  13. package/dist/types/client/logins.d.ts.map +1 -1
  14. package/dist/types/client/streams.d.ts +9 -3
  15. package/dist/types/client/streams.d.ts.map +1 -1
  16. package/dist/types/client/turns.d.ts +1 -1
  17. package/dist/types/client/turns.d.ts.map +1 -1
  18. package/dist/types/core/agents/acp/acp-agent.d.ts +34 -1
  19. package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
  20. package/dist/types/core/agents/acp/adapter.d.ts.map +1 -1
  21. package/dist/types/core/agents/acp/client.d.ts +12 -3
  22. package/dist/types/core/agents/acp/client.d.ts.map +1 -1
  23. package/dist/types/core/agents/acp/mappings.d.ts +8 -2
  24. package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
  25. package/dist/types/core/agents/base.d.ts +22 -8
  26. package/dist/types/core/agents/base.d.ts.map +1 -1
  27. package/dist/types/core/agents/claude-code/adapter.d.ts +7 -0
  28. package/dist/types/core/agents/claude-code/adapter.d.ts.map +1 -1
  29. package/dist/types/core/agents/claude-code/approvals.d.ts +4 -1
  30. package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -1
  31. package/dist/types/core/agents/claude-code/claude-agent.d.ts +16 -5
  32. package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
  33. package/dist/types/core/agents/claude-code/events.d.ts +9 -1
  34. package/dist/types/core/agents/claude-code/events.d.ts.map +1 -1
  35. package/dist/types/core/agents/claude-code/login.d.ts +4 -1
  36. package/dist/types/core/agents/claude-code/login.d.ts.map +1 -1
  37. package/dist/types/core/agents/claude-code/mcp.d.ts +21 -7
  38. package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -1
  39. package/dist/types/core/agents/claude-code/models.d.ts +5 -1
  40. package/dist/types/core/agents/claude-code/models.d.ts.map +1 -1
  41. package/dist/types/core/agents/claude-code/options.d.ts +10 -4
  42. package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
  43. package/dist/types/core/agents/claude-code/outcome.d.ts +3 -5
  44. package/dist/types/core/agents/claude-code/outcome.d.ts.map +1 -1
  45. package/dist/types/core/agents/claude-code/results.d.ts +16 -0
  46. package/dist/types/core/agents/claude-code/results.d.ts.map +1 -0
  47. package/dist/types/core/agents/claude-code/sdk-pair.d.ts +13 -0
  48. package/dist/types/core/agents/claude-code/sdk-pair.d.ts.map +1 -0
  49. package/dist/types/core/agents/claude-code/session.d.ts +50 -12
  50. package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
  51. package/dist/types/core/agents/claude-code/spend.d.ts +2 -1
  52. package/dist/types/core/agents/claude-code/spend.d.ts.map +1 -1
  53. package/dist/types/core/agents/claude-code/tools.d.ts +26 -3
  54. package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -1
  55. package/dist/types/core/agents/codex-app-server/adapter.d.ts +2 -2
  56. package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -1
  57. package/dist/types/core/agents/codex-app-server/client.d.ts +12 -2
  58. package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
  59. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +58 -13
  60. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -1
  61. package/dist/types/core/agents/codex-app-server/commands.d.ts +2 -2
  62. package/dist/types/core/agents/codex-app-server/commands.d.ts.map +1 -1
  63. package/dist/types/core/agents/codex-app-server/credentials.d.ts +5 -1
  64. package/dist/types/core/agents/codex-app-server/credentials.d.ts.map +1 -1
  65. package/dist/types/core/agents/codex-app-server/effort.d.ts +2 -1
  66. package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -1
  67. package/dist/types/core/agents/codex-app-server/homes.d.ts +19 -0
  68. package/dist/types/core/agents/codex-app-server/homes.d.ts.map +1 -1
  69. package/dist/types/core/agents/codex-app-server/items.d.ts +27 -2
  70. package/dist/types/core/agents/codex-app-server/items.d.ts.map +1 -1
  71. package/dist/types/core/agents/codex-app-server/login.d.ts +4 -1
  72. package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -1
  73. package/dist/types/core/agents/codex-app-server/mcp.d.ts +15 -30
  74. package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -1
  75. package/dist/types/core/agents/codex-app-server/models.d.ts +3 -10
  76. package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -1
  77. package/dist/types/core/agents/codex-app-server/options.d.ts +27 -4
  78. package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -1
  79. package/dist/types/core/agents/codex-app-server/plan-approval.d.ts +2 -1
  80. package/dist/types/core/agents/codex-app-server/plan-approval.d.ts.map +1 -1
  81. package/dist/types/core/agents/codex-app-server/protocol.d.ts +16 -3
  82. package/dist/types/core/agents/codex-app-server/protocol.d.ts.map +1 -1
  83. package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -1
  84. package/dist/types/core/agents/codex-app-server/session.d.ts +68 -40
  85. package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -1
  86. package/dist/types/core/agents/codex-app-server/subagents.d.ts +9 -4
  87. package/dist/types/core/agents/codex-app-server/subagents.d.ts.map +1 -1
  88. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts +3 -2
  89. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -1
  90. package/dist/types/core/agents/codex-app-server/turn-items.d.ts +2 -1
  91. package/dist/types/core/agents/codex-app-server/turn-items.d.ts.map +1 -1
  92. package/dist/types/core/agents/codex-app-server/turn.d.ts +31 -8
  93. package/dist/types/core/agents/codex-app-server/turn.d.ts.map +1 -1
  94. package/dist/types/core/agents/codex-app-server/user-login.d.ts +28 -0
  95. package/dist/types/core/agents/codex-app-server/user-login.d.ts.map +1 -0
  96. package/dist/types/core/agents/credentials.d.ts +3 -1
  97. package/dist/types/core/agents/credentials.d.ts.map +1 -1
  98. package/dist/types/core/agents/diffs.d.ts +9 -0
  99. package/dist/types/core/agents/diffs.d.ts.map +1 -0
  100. package/dist/types/core/agents/elicitation.d.ts +3 -2
  101. package/dist/types/core/agents/elicitation.d.ts.map +1 -1
  102. package/dist/types/core/agents/login.d.ts +6 -0
  103. package/dist/types/core/agents/login.d.ts.map +1 -1
  104. package/dist/types/core/agents/mcp-config.d.ts +0 -4
  105. package/dist/types/core/agents/mcp-config.d.ts.map +1 -1
  106. package/dist/types/core/agents/process-pool.d.ts +193 -0
  107. package/dist/types/core/agents/process-pool.d.ts.map +1 -0
  108. package/dist/types/core/agents/scripted/adapter.d.ts +68 -0
  109. package/dist/types/core/agents/scripted/adapter.d.ts.map +1 -0
  110. package/dist/types/core/agents/scripted/mcp-call.d.ts +56 -0
  111. package/dist/types/core/agents/scripted/mcp-call.d.ts.map +1 -0
  112. package/dist/types/core/agents/scripted/scripted-agent.d.ts +73 -0
  113. package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -0
  114. package/dist/types/core/agents/scripted/scripts.d.ts +29 -0
  115. package/dist/types/core/agents/scripted/scripts.d.ts.map +1 -0
  116. package/dist/types/core/agents/scripted/steps.d.ts +132 -0
  117. package/dist/types/core/agents/scripted/steps.d.ts.map +1 -0
  118. package/dist/types/core/agents/session-agent.d.ts +49 -6
  119. package/dist/types/core/agents/session-agent.d.ts.map +1 -1
  120. package/dist/types/core/diagnostics.d.ts +4 -1
  121. package/dist/types/core/diagnostics.d.ts.map +1 -1
  122. package/dist/types/core/index.d.ts +5 -0
  123. package/dist/types/core/index.d.ts.map +1 -1
  124. package/dist/types/core/presets.d.ts +32 -6
  125. package/dist/types/core/presets.d.ts.map +1 -1
  126. package/dist/types/core/processes/lifeline.d.ts +0 -20
  127. package/dist/types/core/processes/lifeline.d.ts.map +1 -1
  128. package/dist/types/core/provision/index.d.ts +2 -2
  129. package/dist/types/core/provision/index.d.ts.map +1 -1
  130. package/dist/types/core/provision/install-build.d.ts +2 -1
  131. package/dist/types/core/provision/install-build.d.ts.map +1 -1
  132. package/dist/types/core/provision/npm.d.ts +20 -8
  133. package/dist/types/core/provision/npm.d.ts.map +1 -1
  134. package/dist/types/core/provision/provisioner.d.ts +4 -1
  135. package/dist/types/core/provision/provisioner.d.ts.map +1 -1
  136. package/dist/types/core/provision/tools.d.ts +2 -1
  137. package/dist/types/core/provision/tools.d.ts.map +1 -1
  138. package/dist/types/core/runtime/agent-runtime.d.ts +16 -8
  139. package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
  140. package/dist/types/core/runtime/event-processor.d.ts +5 -1
  141. package/dist/types/core/runtime/event-processor.d.ts.map +1 -1
  142. package/dist/types/core/runtime/harness-clis.d.ts +9 -0
  143. package/dist/types/core/runtime/harness-clis.d.ts.map +1 -1
  144. package/dist/types/core/runtime/harness-logins.d.ts +33 -5
  145. package/dist/types/core/runtime/harness-logins.d.ts.map +1 -1
  146. package/dist/types/core/runtime/model-lists.d.ts +2 -0
  147. package/dist/types/core/runtime/model-lists.d.ts.map +1 -1
  148. package/dist/types/core/runtime/permission-policy.d.ts +5 -3
  149. package/dist/types/core/runtime/permission-policy.d.ts.map +1 -1
  150. package/dist/types/core/runtime/request-broker.d.ts +2 -1
  151. package/dist/types/core/runtime/request-broker.d.ts.map +1 -1
  152. package/dist/types/core/runtime/turn.d.ts +12 -1
  153. package/dist/types/core/runtime/turn.d.ts.map +1 -1
  154. package/dist/types/core/utils/deadline.d.ts +6 -0
  155. package/dist/types/core/utils/deadline.d.ts.map +1 -1
  156. package/dist/types/core/utils/errors.d.ts +7 -1
  157. package/dist/types/core/utils/errors.d.ts.map +1 -1
  158. package/dist/types/operator/operator.d.ts.map +1 -1
  159. package/dist/types/operator/render.d.ts +6 -4
  160. package/dist/types/operator/render.d.ts.map +1 -1
  161. package/dist/types/protocol/auth.d.ts +54 -24
  162. package/dist/types/protocol/auth.d.ts.map +1 -1
  163. package/dist/types/protocol/clis.d.ts +14 -7
  164. package/dist/types/protocol/clis.d.ts.map +1 -1
  165. package/dist/types/protocol/config.d.ts +2 -0
  166. package/dist/types/protocol/config.d.ts.map +1 -1
  167. package/dist/types/protocol/conversation.d.ts +40 -3
  168. package/dist/types/protocol/conversation.d.ts.map +1 -1
  169. package/dist/types/protocol/credentials.d.ts +7 -0
  170. package/dist/types/protocol/credentials.d.ts.map +1 -1
  171. package/dist/types/protocol/execution.d.ts +2 -1
  172. package/dist/types/protocol/execution.d.ts.map +1 -1
  173. package/dist/types/protocol/factories.d.ts +12 -2
  174. package/dist/types/protocol/factories.d.ts.map +1 -1
  175. package/dist/types/protocol/harness.d.ts +6 -2
  176. package/dist/types/protocol/harness.d.ts.map +1 -1
  177. package/dist/types/protocol/history.d.ts +19 -0
  178. package/dist/types/protocol/history.d.ts.map +1 -1
  179. package/dist/types/protocol/lifecycle.d.ts +47 -8
  180. package/dist/types/protocol/lifecycle.d.ts.map +1 -1
  181. package/dist/types/protocol/model-catalog.d.ts.map +1 -1
  182. package/dist/types/protocol/models.d.ts +3 -0
  183. package/dist/types/protocol/models.d.ts.map +1 -1
  184. package/dist/types/protocol/parts.d.ts +14 -0
  185. package/dist/types/protocol/parts.d.ts.map +1 -1
  186. package/dist/types/protocol/tool-state.d.ts +12 -0
  187. package/dist/types/protocol/tool-state.d.ts.map +1 -1
  188. package/dist/types/protocol/wire-api.d.ts +129 -23
  189. package/dist/types/protocol/wire-api.d.ts.map +1 -1
  190. package/dist/types/protocol/wire.d.ts +70 -10
  191. package/dist/types/protocol/wire.d.ts.map +1 -1
  192. package/dist/types/server/acp/binding.d.ts +6 -1
  193. package/dist/types/server/acp/binding.d.ts.map +1 -1
  194. package/dist/types/server/acp/translate.d.ts +33 -7
  195. package/dist/types/server/acp/translate.d.ts.map +1 -1
  196. package/dist/types/server/agent-server.d.ts +6 -0
  197. package/dist/types/server/agent-server.d.ts.map +1 -1
  198. package/dist/types/server/feedback.d.ts +2 -1
  199. package/dist/types/server/feedback.d.ts.map +1 -1
  200. package/dist/types/server/install.d.ts +11 -0
  201. package/dist/types/server/install.d.ts.map +1 -1
  202. package/dist/types/server/session-gate.d.ts +2 -1
  203. package/dist/types/server/session-gate.d.ts.map +1 -1
  204. package/dist/types/server/session-store.d.ts +1 -0
  205. package/dist/types/server/session-store.d.ts.map +1 -1
  206. package/dist/types/server/subscriptions.d.ts +2 -1
  207. package/dist/types/server/subscriptions.d.ts.map +1 -1
  208. package/dist/types/server/transports.d.ts.map +1 -1
  209. package/dist/types/sync/fit.d.ts +8 -7
  210. package/dist/types/sync/fit.d.ts.map +1 -1
  211. package/dist/types/sync/history-sqlite.d.ts.map +1 -1
  212. package/dist/types/sync/index.d.ts +1 -0
  213. package/dist/types/sync/index.d.ts.map +1 -1
  214. package/dist/types/sync/journal-sqlite.d.ts +2 -1
  215. package/dist/types/sync/journal-sqlite.d.ts.map +1 -1
  216. package/dist/types/sync/journal.d.ts +11 -3
  217. package/dist/types/sync/journal.d.ts.map +1 -1
  218. package/dist/types/sync/projection.d.ts +6 -0
  219. package/dist/types/sync/projection.d.ts.map +1 -1
  220. package/dist/types/sync/recovery.d.ts +2 -1
  221. package/dist/types/sync/recovery.d.ts.map +1 -1
  222. package/dist/types/sync/schema.d.ts +10 -0
  223. package/dist/types/sync/schema.d.ts.map +1 -1
  224. package/dist/types/sync/sql.d.ts +2 -1
  225. package/dist/types/sync/sql.d.ts.map +1 -1
  226. package/docs/consuming.md +278 -28
  227. package/docs/deploy.md +36 -8
  228. package/docs/durable-sessions.md +35 -5
  229. package/docs/harnesses.md +385 -24
  230. package/package.json +6 -1
  231. package/src/accounts/chatgpt.ts +2 -2
  232. package/src/accounts/http.ts +2 -16
  233. package/src/client/client.ts +92 -31
  234. package/src/client/connection.ts +103 -22
  235. package/src/client/index.ts +1 -0
  236. package/src/client/logins.ts +1 -1
  237. package/src/client/streams.ts +12 -4
  238. package/src/client/turns.ts +1 -1
  239. package/src/core/agents/acp/acp-agent.ts +181 -52
  240. package/src/core/agents/acp/adapter.ts +9 -1
  241. package/src/core/agents/acp/client.ts +16 -4
  242. package/src/core/agents/acp/mappings.ts +27 -0
  243. package/src/core/agents/base.ts +25 -10
  244. package/src/core/agents/claude-code/adapter.ts +47 -17
  245. package/src/core/agents/claude-code/approvals.ts +6 -5
  246. package/src/core/agents/claude-code/claude-agent.ts +60 -30
  247. package/src/core/agents/claude-code/events.ts +11 -1
  248. package/src/core/agents/claude-code/login.ts +14 -2
  249. package/src/core/agents/claude-code/mcp.ts +31 -15
  250. package/src/core/agents/claude-code/models.ts +7 -2
  251. package/src/core/agents/claude-code/options.ts +11 -3
  252. package/src/core/agents/claude-code/outcome.ts +10 -2
  253. package/src/core/agents/claude-code/results.ts +73 -0
  254. package/src/core/agents/claude-code/sdk-pair.ts +66 -0
  255. package/src/core/agents/claude-code/session.ts +166 -37
  256. package/src/core/agents/claude-code/spend.ts +1 -1
  257. package/src/core/agents/claude-code/tools.ts +108 -12
  258. package/src/core/agents/codex-app-server/adapter.ts +37 -12
  259. package/src/core/agents/codex-app-server/client.ts +37 -8
  260. package/src/core/agents/codex-app-server/codex-agent.ts +115 -50
  261. package/src/core/agents/codex-app-server/commands.ts +2 -2
  262. package/src/core/agents/codex-app-server/credentials.ts +10 -5
  263. package/src/core/agents/codex-app-server/effort.ts +1 -1
  264. package/src/core/agents/codex-app-server/homes.ts +43 -1
  265. package/src/core/agents/codex-app-server/items.ts +219 -31
  266. package/src/core/agents/codex-app-server/login.ts +14 -2
  267. package/src/core/agents/codex-app-server/mcp.ts +47 -32
  268. package/src/core/agents/codex-app-server/models.ts +9 -8
  269. package/src/core/agents/codex-app-server/options.ts +69 -10
  270. package/src/core/agents/codex-app-server/plan-approval.ts +1 -1
  271. package/src/core/agents/codex-app-server/protocol.ts +14 -4
  272. package/src/core/agents/codex-app-server/requests.ts +14 -6
  273. package/src/core/agents/codex-app-server/session.ts +151 -113
  274. package/src/core/agents/codex-app-server/subagents.ts +21 -14
  275. package/src/core/agents/codex-app-server/thread-settings.ts +18 -8
  276. package/src/core/agents/codex-app-server/turn-items.ts +1 -1
  277. package/src/core/agents/codex-app-server/turn.ts +79 -32
  278. package/src/core/agents/codex-app-server/user-login.ts +107 -0
  279. package/src/core/agents/credentials.ts +5 -2
  280. package/src/core/agents/diffs.ts +25 -0
  281. package/src/core/agents/elicitation.ts +2 -2
  282. package/src/core/agents/login.ts +6 -0
  283. package/src/core/agents/mcp-config.ts +2 -2
  284. package/src/core/agents/process-pool.ts +432 -0
  285. package/src/core/agents/scripted/adapter.ts +142 -0
  286. package/src/core/agents/scripted/mcp-call.ts +134 -0
  287. package/src/core/agents/scripted/scripted-agent.ts +418 -0
  288. package/src/core/agents/scripted/scripts.ts +171 -0
  289. package/src/core/agents/scripted/steps.ts +127 -0
  290. package/src/core/agents/session-agent.ts +105 -8
  291. package/src/core/diagnostics.ts +9 -1
  292. package/src/core/index.ts +11 -0
  293. package/src/core/presets.ts +99 -14
  294. package/src/core/processes/lifeline.ts +99 -25
  295. package/src/core/provision/index.ts +1 -2
  296. package/src/core/provision/install-build.ts +4 -1
  297. package/src/core/provision/npm.ts +309 -97
  298. package/src/core/provision/provisioner.ts +22 -8
  299. package/src/core/provision/tools.ts +44 -19
  300. package/src/core/runtime/agent-runtime.ts +48 -18
  301. package/src/core/runtime/event-processor.ts +18 -2
  302. package/src/core/runtime/harness-clis.ts +36 -1
  303. package/src/core/runtime/harness-logins.ts +82 -31
  304. package/src/core/runtime/model-lists.ts +1 -1
  305. package/src/core/runtime/permission-policy.ts +4 -3
  306. package/src/core/runtime/request-broker.ts +1 -1
  307. package/src/core/runtime/turn.ts +51 -3
  308. package/src/core/utils/deadline.ts +23 -0
  309. package/src/core/utils/errors.ts +11 -4
  310. package/src/operator/operator.ts +8 -4
  311. package/src/operator/render.ts +46 -8
  312. package/src/protocol/auth.ts +30 -23
  313. package/src/protocol/clis.ts +12 -4
  314. package/src/protocol/credentials.ts +19 -0
  315. package/src/protocol/execution.ts +5 -0
  316. package/src/protocol/factories.ts +25 -3
  317. package/src/protocol/harness.ts +11 -1
  318. package/src/protocol/history.ts +20 -0
  319. package/src/protocol/lifecycle.ts +10 -1
  320. package/src/protocol/model-catalog.ts +19 -8
  321. package/src/protocol/parts.ts +12 -1
  322. package/src/protocol/tool-state.ts +14 -1
  323. package/src/protocol/wire.ts +14 -0
  324. package/src/server/acp/binding.ts +113 -23
  325. package/src/server/acp/translate.ts +161 -8
  326. package/src/server/agent-server.ts +10 -1
  327. package/src/server/bin.ts +83 -9
  328. package/src/server/feedback.ts +1 -1
  329. package/src/server/install.ts +82 -4
  330. package/src/server/session-gate.ts +1 -1
  331. package/src/server/session-store.ts +5 -1
  332. package/src/server/subscriptions.ts +1 -1
  333. package/src/server/transports.ts +14 -0
  334. package/src/sync/fit.ts +115 -28
  335. package/src/sync/history-sqlite.ts +6 -2
  336. package/src/sync/index.ts +1 -0
  337. package/src/sync/journal-sqlite.ts +20 -2
  338. package/src/sync/journal.ts +10 -2
  339. package/src/sync/projection.ts +10 -0
  340. package/src/sync/recovery.ts +11 -4
  341. package/src/sync/schema.ts +7 -5
  342. package/src/sync/sql.ts +1 -1
  343. package/dist/types/core/agents/claude-code/session-pool.d.ts +0 -36
  344. package/dist/types/core/agents/claude-code/session-pool.d.ts.map +0 -1
  345. package/dist/types/core/agents/session-pool.d.ts +0 -41
  346. package/dist/types/core/agents/session-pool.d.ts.map +0 -1
  347. package/src/core/agents/claude-code/session-pool.ts +0 -136
  348. package/src/core/agents/session-pool.ts +0 -111
package/CHANGELOG.md CHANGED
@@ -1,5 +1,266 @@
1
1
  # Changelog
2
2
 
3
+ A bullet says what changed for someone who uses the package, in at most four
4
+ lines: what is now true, and what breaks or is new for them (the names of new
5
+ exports, fields, options and messages), with the LLP that holds the reasoning
6
+ and the measurements. Evidence lives in the LLP, not here. A release groups
7
+ its bullets under Breaking, Added, Changed and Fixed, breaking first. The
8
+ released sections below that predate this convention are kept as written.
9
+
10
+ ## 0.3.23
11
+
12
+ ### Breaking
13
+
14
+ - `createAgentRegistry` and `createAgentRuntime` take `idleTimeoutMs`,
15
+ `cancelGraceMs` and `credentials` at the top level only, for every harness;
16
+ under `claudeCode`, `codexAppServer` or `acp` they throw, naming the option.
17
+ An agent made directly still takes them (LLP 0016, decision 5).
18
+ - `inheritConfig`, `processes` and `resolveCliPath` under `claudeCode`,
19
+ `codexAppServer` or `acp`, and `processes` under `scripted`, throw too,
20
+ naming the option: the registry overrode them in silence. Set
21
+ `inheritConfig` at the top level (LLP 0016, decision 5).
22
+ - A journal of your own implements `SessionJournal.lastTurn(sessionId)`: the
23
+ admitted turn, else the latest ended one, as `LastTurn` (LLP 0003).
24
+ - A Codex permission request's `title` is no longer Codex's reason, which is
25
+ now `toolCall.reason`; `title` is `Allow tool: shell` (or `apply_patch`),
26
+ as on every harness. Show `toolCall.reason` where you showed `title` on
27
+ Codex (LLP 0002, A tool call says what it acts on).
28
+ - A server of another wire protocol version is a refusal: the client stops
29
+ redialing, and what waits fails with `ProtocolVersionMismatchError` (new, a
30
+ `ConnectionRefusedError`), `initialize()` too (was `WireRequestError`); check
31
+ `reason`: `ConnectionRefusal` gains `"protocol_mismatch"` (LLP 0001, D16).
32
+ - A read installs nothing. While a harness's CLI is not installed,
33
+ `auth/status` answers it `unknown` with no `methods` and `models/list` the
34
+ catalog (`source: "catalog"`), each with an `error`. Install at setup
35
+ (`prepareClis`) and read again on `ready` (LLP 0010, A read installs nothing).
36
+ - Below `inheritConfig: "all"`, Codex's apps and plugins are off
37
+ (`features.apps = false`, `-c features.plugins=false`): the ChatGPT
38
+ account's connectors no longer join such a turn. A product that wants them
39
+ runs at `all` (LLP 0017).
40
+ - Codex asks its questions in `default` mode too: every thread starts with
41
+ `default_mode_request_user_input`. A turn without `elicitation: true`
42
+ declines the question, where Codex told the model the tool was unavailable
43
+ (LLP 0001, D12; LLP 0017, Questions outside plan mode).
44
+ - On Codex an MCP tool's image comes as `content` on its tool part, and
45
+ `output` says `[image image/png]` where the base64 was. A picture Codex
46
+ makes is an `image_generation` tool part with `metadata.savedPath`, no bytes
47
+ (LLP 0017, Codex's own pictures and an MCP tool's picture).
48
+ - A durable server delivers what its journal kept: an image or file too large
49
+ for a record is a text marker with `_meta["agent-server/omittedBinary"]`
50
+ (`OMITTED_BINARY_META_KEY`, `OmittedBinary`, new root exports), live and on
51
+ replay alike. It was cut base64 (LLP 0003, One log, one write path).
52
+
53
+ ### Added
54
+
55
+ - `cancelConfirmMs` on `createAgentRegistry` (and each agent's options): how
56
+ long a cancel waits for the agent to confirm it stopped before it answers
57
+ `unconfirmed`, 2 s by default, on Claude, Codex and ACP (LLP 0001, D9).
58
+ - `session/get` (`getSession`) answers `lastTurn`: the latest turn's
59
+ `turnId`, and once it ended its `stopReason` and `error`, so a client learns
60
+ a restart cut it off (`server_restart`) without its history (LLP 0003,
61
+ Commit before acknowledging).
62
+ - A tool call says what it acts on: `command` (a command's line) and `url` (a
63
+ fetch's address) on tool parts and on `permission.requested`'s `toolCall`,
64
+ with `reason` (why it asks) on the request; a failed tool keeps `metadata`
65
+ (`ToolStateFailed.metadata`). Draw from them, not `rawInput` (LLP 0002).
66
+ - On Codex a command names its line apart from Codex's shell (`command`),
67
+ and carries `metadata.exitCode`, failed or not; a file change shows each
68
+ hunk as a `diff` entry, located at its start line (`docs/harnesses.md`,
69
+ What a tool call says, per harness; LLP 0002).
70
+ - On Claude a `Bash` call names its `command`, a `WebFetch` its `url`, a
71
+ request its `reason` (the CLI's `decisionReason`); an `Edit`, `Write` or
72
+ `NotebookEdit` shows `diff` entries from the CLI's structured result, and a
73
+ failed `Bash` its `metadata.exitCode` (`docs/harnesses.md`; LLP 0002).
74
+ - An ACP agent's `diff` and `terminal` content reaches its tool part's
75
+ `content`, where it was dropped, and `agent-server --acp` sends a part's
76
+ `diff` entries to its client as ACP diffs (LLP 0002, Tool output has three
77
+ audiences).
78
+ - A scripted harness, `scripted`, plays steps instead of a model; a step's
79
+ `yield` gives back what it did (`ScriptStepOutcome`). `createAgentRuntime({
80
+ scripted: { turn } })`, `ScriptStep`, `scriptedQueue`, `scriptedFile`,
81
+ `scriptedBySession`, `--script`, `--script-position` (LLP 0001, D23).
82
+ - `agent-server --acp` takes `--model <id>` and `--thinking <level>`: every
83
+ turn the ACP binding runs uses them (`AcpBindingOptions.thinkingLevel`, new),
84
+ where it ran the harness's own default. They are the operator's; an ACP
85
+ client cannot change them (LLP 0016.001, Prepared features, measured).
86
+ - A turn says what it did not apply: `AgentCapabilities.ignoredSettings`
87
+ lists the `RunConfig` fields a harness never applies, and
88
+ `execution.notApplied` on `turn.started` (and `turn.ended`, with what the
89
+ harness found as it ran) names those the turn set (LLP 0001, D22).
90
+ - A call to an MCP tool names its server and tool: `mcp: { server, tool }`
91
+ (new `McpTool`, `McpToolSchema`) on tool parts and on
92
+ `permission.requested`'s `toolCall`, on Claude and Codex; ACP leaves it out.
93
+ `toolName` is unchanged: stop parsing its spellings (LLP 0002).
94
+ - `codexAppServer.builtInTools: { local, webSearch, imageGeneration }`
95
+ (operator only) turns Codex's own tools off; `bun run harness --
96
+ --scenario=codex-tools-off` checks it for free at a Codex pin bump (LLP 0017).
97
+ - `codexAppServer.userLogin` (operator only, off by default): a Codex turn in
98
+ its session's own home runs on the user's Codex login, held in memory only;
99
+ with none it fails `auth` before Codex starts. `claimsOf` is a protocol
100
+ export (LLP 0017, The person's own login in a home of the session's own).
101
+ - `HarnessCli.category` and `HarnessCliProgress.category`: an install
102
+ failure's error category (`network`, `auth`, `rate_limit`,
103
+ `invalid_request`, `internal`), on the failed turn too. `CliProvisionError`
104
+ takes an optional `category`. Wire protocol 6 stays (LLP 0010).
105
+ - `HarnessAuth.loginUnderWay`: the login `auth/login` answered, in every status
106
+ read and `auth/updated` until its end, and `auth/updated` tells it as it
107
+ starts. Wire protocol 6 stays (LLP 0011, The wire).
108
+ - The `claudeSdkMismatch` diagnostic: the Claude SDK that loaded and the CLI
109
+ build it drives are different releases. Said once per pair, through
110
+ `onDiagnostic` (`{sdkVersion, cliVersion, cliPath}`) and on stderr; the turn
111
+ runs (LLP 0010, Implementation).
112
+ - `JOURNAL_SCHEMA_VERSION` (6), exported from `@zvada/agent-server/sync`
113
+ without loading SQLite: name a journal file from it (LLP 0003).
114
+ - `AgentServer.maxBacklogBytes` reads a server's backlog bound (LLP 0008).
115
+ - What each permission mode does on Claude and Codex is measured: the
116
+ `permission-modes` harness scenario, and the table in `docs/harnesses.md`
117
+ (LLP 0015).
118
+
119
+ ### Changed
120
+
121
+ - An ACP agent that offers modes is put in the turn's `permissionMode`
122
+ (`session/set_mode`, its own id; `default` when the turn names none); one
123
+ it lacks is `notApplied`. It ran in its own: `claude-agent-acp`'s `auto`
124
+ asked the product nothing (LLP 0001, D4).
125
+ - `agent-server --acp --harness codex-app-server` takes a client's stdio and
126
+ HTTP MCP servers, carried in the thread at `all`, and advertises
127
+ `mcpCapabilities.http`; it refused every one. SSE and `codex_apps` are
128
+ refused, named. In front of `scripted` it advertises HTTP (LLP 0001, D21).
129
+ - Codex's `cancelGraceMs` is only how long after a cancel its process is
130
+ ended; a failed turn's wait for its end is `cancelConfirmMs`. A Codex
131
+ cancel answers within `cancelConfirmMs`: one whose commands were slow to
132
+ stop is `unconfirmed` now, where it answered late (LLP 0016, decision 5).
133
+ - The operator tools show a waiting permission's `command`, `url` or files and
134
+ its `reason`, each a quoted line under its title, and a tool's line reads
135
+ the call's `command` or `url` first, so a Codex command reads without
136
+ Codex's shell; paths read relative to the session's `root` (LLP 0014).
137
+ - A fenced restart's `server_restart` message reads "Server restarted before
138
+ the turn settled. Its agent could not be confirmed stopped at restart
139
+ (<reason>).", with the tool clause an unfenced one has, where it said "check
140
+ it before continuing": `recoveryRequired` says that (LLP 0003).
141
+ - Every tool the pinned Claude CLI offers has a decided `kind`: `TaskStop` and
142
+ `Workflow` are `execute`, `Skill` is `read`, the task-list tools are
143
+ `think`; the rest stay `other`. A free live check names a tool a pin bump
144
+ adds without one (LLP 0002, A tool call says what it acts on).
145
+ - The model catalog (`CATALOG_MODELS`) is regenerated from Claude SDK 0.3.288
146
+ and Codex 0.160.0 and adds Codex's `gpt-6.1-terra`. Claude's rows depend on
147
+ its route, so a live list can still differ (LLP 0010, A read installs
148
+ nothing; `docs/harnesses.md`, Model lists).
149
+ - A model known to have no thinking control (an empty `thinking.levels`, such
150
+ as Haiku's) starts without a level, and `turn.ended.execution` has no
151
+ `appliedThinkingLevel`; `off` is still sent (LLP 0013, M17).
152
+ - `createCheckpoint` replaces its largest images and files with the same
153
+ markers until it fits `HISTORY_MAX_BYTES`, and durable input over the record
154
+ limit is refused with its size and the limit (LLP 0003).
155
+ - `agent-server install` names each version (the Claude SDK package's and
156
+ Claude Code's), and says an ACP agent has nothing to install (LLP 0010, P4).
157
+ - A CLI install's error no longer ends with a request to report friction over
158
+ Hivenet; integration errors keep it (LLP 0010).
159
+ - A Codex thread's config is sent as one nested object (LLP 0017, One nested
160
+ config).
161
+ - On Codex and ACP, `idleTimeoutMs: 0` never ends a session's process for
162
+ idleness, as on Claude; it ended it as soon as the turn left (LLP 0001, D10).
163
+ - A host resume (`invalidateMcpConnections`) no longer closes idle Codex
164
+ processes at once: each session's next turn replaces its process, as on
165
+ Claude, and now on ACP too (LLP 0001, D10).
166
+ - `terminateAll` on Codex and ACP settles once every process has exited, as on
167
+ Claude, so a runtime's shutdown waits for them (LLP 0001, D10).
168
+ - A login changed in a named store (`CLAUDE_CONFIG_DIR`, `CODEX_HOME`)
169
+ restarts only that store's sessions; one in the default store still restarts
170
+ all of the harness's. New: `CliLogin.store`, `Agent.loginChanged(store?)`
171
+ (LLP 0011, A login change starts the next turn on a new CLI).
172
+ - Claude sessions run on the process pool Codex and ACP use; `onSessionEnd`
173
+ keeps its reasons. A cancel during a Claude start ends it at once and
174
+ answers without waiting for that CLI's exit (LLP 0001, D10; LLP 0016).
175
+
176
+ ### Fixed
177
+
178
+ - Behind `agent-server --acp`, a prompt's `resource_link` (an editor's
179
+ @-mention of a file), which ACP v1 has every agent take, reaches the turn
180
+ as a Markdown link in its text; it was dropped (LLP 0016.001, Prepared
181
+ features, measured).
182
+ - The stock program's `acp` harness tells its agent its release in
183
+ `initialize` (`clientInfo.version`); it said `0.0.0`. Embedded, set
184
+ `acp.clientVersion` (LLP 0016.001, Prepared features, measured).
185
+ - Behind `agent-server --acp`, the agent's questions reach a client that
186
+ advertises form elicitation, as `elicitation/create` (one form field per
187
+ question), and MCP forms and URLs one that advertises their mode; the
188
+ agent was told no one could answer (LLP 0001, D12).
189
+ - Behind `agent-server --acp`, a permission request names its tool (`name`)
190
+ and carries its `locations`; a client read the tool's name from the
191
+ request's title ("Allow tool: Bash") and got no locations (LLP 0016.001,
192
+ Prepared features, measured).
193
+ - Input with a lone UTF-16 surrogate (text cut mid-emoji) runs on Codex: the
194
+ agent is given U+FFFD, the echo stays your input. Such a turn waited 30 s
195
+ and failed; an unanswered `turn/start` now says so, with its deadline
196
+ (LLP 0013, F12).
197
+ - A cancel while a warm Claude process changes model, permission mode or MCP
198
+ servers ends the turn `cancelled` and the process; Claude never answering
199
+ held the turn, though the cancel said `confirmed`. The next turn resumes on
200
+ a new process (LLP 0013, F13).
201
+ - A Claude turn that fails on an overloaded API (529 or 503) ends with error
202
+ category `overloaded`, read from its result's status; it was `internal`
203
+ (LLP 0002, Plan usage and retries).
204
+ - A cancel while a Codex turn is still starting answers `cancelled` once the
205
+ turn has ended; it answered `unconfirmed` at once, though the turn stopped
206
+ (LLP 0001, D9; LLP 0016.000, The cancel answer).
207
+ - A cancel while an ACP operator's `resolveLaunch` is pending ends the turn at
208
+ once; the turn waited for it, the cancel answered `unconfirmed` after 2 s,
209
+ and a later cancel still found the turn (LLP 0001, D9).
210
+ - A cancel while Claude or Codex asks the product's credential source ends the
211
+ turn `cancelled` at once, whether or not the source heeds its signal; the
212
+ turn waited for the source, and an answer after the cancel is dropped
213
+ (LLP 0016.000, The cancel answer).
214
+ - A durable restart that cuts off a scripted turn fences nothing, as on
215
+ Claude or Codex once the restart saw them stopped: it runs no process, and
216
+ `createAgentRegistry` now vouches for it (LLP 0007, What each harness does).
217
+ - `subscribeAll()` follows every session from the call, across redials, until
218
+ `unsubscribeAll()`; it rejects only when refused or closed (LLP 0008, What
219
+ requests do to subscriptions).
220
+ - A cut CLI download goes on from the bytes it has (`Range`), then fails as
221
+ `network` saying how far it got; "Integrity mismatch" is said only of a whole
222
+ file (LLP 0010, Implementation).
223
+ - `agent-server install --dir` creates missing folders at 0755 whatever the
224
+ umask (LLP 0010, P4).
225
+ - Under Node's ESM (tsx, an ESM bundle) the engine finds the Claude SDK
226
+ installed beside it (LLP 0010, P2).
227
+ - A connection that falls behind is told (`session/overflow`) or closed, never
228
+ left waiting: `listen` gives Bun 64 MiB of headroom above the bound (LLP 0008,
229
+ Backpressure and overflow).
230
+ - A turn cancelled while its CLI installs ends `cancelled` at once; the install
231
+ goes on (LLP 0010, A turn waits for its CLI until it is cancelled).
232
+ - Codex: a session whose `CODEX_HOME` was made again starts a new process
233
+ (LLP 0001, D21).
234
+ - A failed Codex turn ends at its own `turn/completed`, so the next turn is
235
+ its own (LLP 0013, F11).
236
+ - `session/close` and `session/release` of a Codex or ACP session answer once
237
+ its agent process has exited (LLP 0001, D10; LLP 0007).
238
+ - Under Bun, a CLI started just before its owner was SIGKILLed no longer
239
+ outlives it (LLP 0007, The lifeline).
240
+ - A Codex retry's recoverable `error` says which attempt it is, of how many
241
+ (`retry.attempt`, `retry.maxAttempts`), read from Codex's "Reconnecting...
242
+ 2/5"; it was `retry: {}` (LLP 0002, Plan usage and retries).
243
+ - An ACP agent that can neither resume nor load a session is no longer ended
244
+ for being idle, so its next turn no longer fails with `SessionResumeError`;
245
+ it lives until release, close or shutdown (LLP 0001, D10).
246
+ - An ACP cancel answers `confirmed: true` only when the agent's prompt ended
247
+ within 2 s, and `confirmed: false` (`turn/cancel`: `unconfirmed`) otherwise;
248
+ it was always `true`. The turn still ends at the 10 s grace (LLP 0001, D9).
249
+ - An ACP agent that replaces an evicted or replaced one starts once that one
250
+ has exited, so two never hold one conversation; `session/release` waits for
251
+ it too (LLP 0001, D10).
252
+ - `--acp`: a `session/new` or `session/resume` with an MCP server of a
253
+ transport the binding cannot attach (ACP's `acp`) is refused with
254
+ `invalidParams` naming the server, where the server was dropped in silence
255
+ (LLP 0001, D15).
256
+ - A turn a restart cut off says "what its running tool did is unknown" only
257
+ when a tool that may have run was open; otherwise its `server_restart`
258
+ message ends "Its agent was stopped at restart." (LLP 0003).
259
+
260
+ Not in any release, so not removed: `codexAppServer.userMcpServers` and
261
+ `CodexUserMcpServers`, which `userLogin` replaced before they shipped
262
+ (LLP 0017).
263
+
3
264
  ## 0.3.22
4
265
 
5
266
  - `@zvada/agent-server/operator`, new: eight tools a hosted assistant or a
@@ -1,4 +1,4 @@
1
- import type { CredentialGrant } from "../protocol/credentials.ts";
1
+ import { type CredentialGrant } from "../protocol/credentials.ts";
2
2
  import { type ProviderOptions } from "./http.ts";
3
3
  /**
4
4
  * A ChatGPT sign-in under way: show `userCode` and `verificationUrl`, then
@@ -1 +1 @@
1
- {"version":3,"file":"chatgpt.d.ts","sourceRoot":"","sources":["../../../src/accounts/chatgpt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAgB,KAAK,eAAe,EAAkC,MAAM,WAAW,CAAC;AAW/F;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,C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@@ -15,7 +15,7 @@ export interface ProviderOptions {
15
15
  timeoutMs?: number;
16
16
  }
17
17
  /** A provider's answer: JSON when it sent some, `undefined` when it did not. */
18
- export interface Answer {
18
+ interface Answer {
19
19
  ok: boolean;
20
20
  status: number;
21
21
  body: unknown;
@@ -30,9 +30,7 @@ export declare const isRecord: (value: unknown) => value is Record<string, unkno
30
30
  export declare const text: (value: unknown) => string | undefined;
31
31
  /** Random bytes as base64url: a PKCE verifier, a state. */
32
32
  export declare function randomToken(bytes?: number): string;
33
- export declare function base64Url(bytes: Uint8Array): string;
34
33
  /** A PKCE challenge (S256) for a verifier. */
35
34
  export declare function challengeOf(verifier: string): Promise<string>;
36
- /** A JWT's claims, read, not verified: only ever of a token its issuer just answered over TLS. */
37
- export declare function claimsOf(jwt: string): Record<string, unknown>;
35
+ export {};
38
36
  //# sourceMappingURL=http.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/accounts/http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,KAAK;IAGrC,QAAQ,CAAC,SAAS;gBADlB,OAAO,EAAE,MAAM,EACN,SAAS,UAAQ;CAK3B;AAED,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC/B,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,gFAAgF;AAChF,MAAM,WAAW,MAAM;IACtB,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAsB,IAAI,CACzB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED,eAAO,MAAM,QAAQ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CACJ,CAAC;AAEtE,eAAO,MAAM,IAAI,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SACmB,CAAC;AAEnE,2DAA2D;AAC3D,wBAAgB,WAAW,CAAC,KAAK,SAAK,GAAG,MAAM,CAE9C;AAQD,8CAA8C;AAC9C,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnE"}
@@ -1,10 +1,10 @@
1
1
  import { type AgentHarness, type AsyncHistoryApi, type AuthUpdated, type DecodedEventsReplayResult, type DecodedWireEventEnvelope, type DurableSession, type ElicitationOutcome, type HarnessAuth, type HarnessCli, type HarnessCliProgress, type InitializeResult, type ModelList, type ModelsListParams, type PermissionOutcome, type RunningTurn, type SessionConfirmStoppedParams, type TurnCancelResult, type TurnReceipt, type TurnStartParams, type TurnStartResult, type TurnSteerParams, type TurnSteerResult, type WireTransport } from "../protocol/index.ts";
2
- import { type AgentServerClientOptions, ConnectionClosedError, type ConnectionEvent, type ConnectionRefusal, ConnectionRefusedError, type TransportFactory } from "./connection.ts";
2
+ import { type AgentServerClientOptions, ConnectionClosedError, type ConnectionEvent, type ConnectionRefusal, ConnectionRefusedError, ProtocolVersionMismatchError, type TransportFactory } from "./connection.ts";
3
3
  import { type LoginHandle } from "./logins.ts";
4
4
  import { EventGapError, type SessionEventGap } from "./streams.ts";
5
5
  import { type SpawnServerOptions, type WebSocketLike } from "./transports.ts";
6
6
  import { type TurnHandle } from "./turns.ts";
7
- export { type AgentServerClientOptions, ConnectionClosedError, type ConnectionEvent, type ConnectionRefusal, ConnectionRefusedError, EventGapError, type SessionEventGap, type TurnHandle, };
7
+ export { type AgentServerClientOptions, ConnectionClosedError, type ConnectionEvent, type ConnectionRefusal, ConnectionRefusedError, EventGapError, ProtocolVersionMismatchError, type SessionEventGap, type TurnHandle, };
8
8
  export interface SubscribeOptions {
9
9
  /**
10
10
  * Catch up after this seq: the session's kept events after it reach
@@ -55,6 +55,8 @@ export declare class AgentServerClient {
55
55
  private readonly progress;
56
56
  private readonly authUpdates;
57
57
  private readonly streams;
58
+ /** `subscribeAll` calls whose ask no server has answered yet: across redials, the next answer settles them. */
59
+ private readonly allAsked;
58
60
  /** Portable history operations (`history/*`), independent of execution subscriptions. */
59
61
  readonly history: AsyncHistoryApi;
60
62
  private constructor();
@@ -144,7 +146,10 @@ export declare class AgentServerClient {
144
146
  /**
145
147
  * Every session's frames, live from now, to `onEvent` (observers): no
146
148
  * history, the open parts of running turns, and after a redial, the gaps a
147
- * dropped connection left healed.
149
+ * dropped connection left healed. The client follows every session from
150
+ * the ask until `unsubscribeAll`: a connection that drops before the
151
+ * answer asks the server it redials, whose answer this waits for; it fails
152
+ * when the server refuses it or the client closes.
148
153
  */
149
154
  subscribeAll(): Promise<void>;
150
155
  /** Stop following every session (`subscribeAll`); those subscribed by name stay. */
@@ -163,7 +168,9 @@ export declare class AgentServerClient {
163
168
  /**
164
169
  * The models a harness offers for the login and folder a turn with the same
165
170
  * `cwd`, `env` and `apiKey` would use. `source: "catalog"` (with `error`)
166
- * means the CLI did not answer and the list is agent-server's built-in one.
171
+ * means the CLI did not answer and the list is agent-server's built-in one,
172
+ * as it is while the harness's CLI is not installed yet: a read installs
173
+ * nothing (`prepareClis` does), and the first list after the install is live.
167
174
  */
168
175
  listModels(params: ModelsListParams): Promise<ModelList>;
169
176
  /**
@@ -204,8 +211,12 @@ export declare class AgentServerClient {
204
211
  /**
205
212
  * Each harness's login on the server (every harness when `harnesses` is
206
213
  * absent), for the store and environment a turn with `env` would use:
207
- * signed in, with what and as whom, signed out, or unknown and why; and
208
- * the logins it offers.
214
+ * signed in, with what and as whom, signed out, or unknown and why; the
215
+ * logins it offers; and the login under way to that store
216
+ * (`loginUnderWay`), whoever started it, so a second window or a handle
217
+ * whose connection dropped finds it. A read installs nothing: a harness
218
+ * whose CLI is not installed yet is `unknown` with no methods
219
+ * (`prepareClis` installs it, as `login` does).
209
220
  */
210
221
  authStatus(options?: {
211
222
  harnesses?: AgentHarness[];
@@ -215,7 +226,11 @@ export declare class AgentServerClient {
215
226
  * Start one of a harness's logins through its CLI's own flow: answered
216
227
  * once the CLI says where the user signs in (`url`, `userCode`, or from
217
228
  * another device `codeUrl`, then `complete` with the code it shows).
218
- * `done` resolves with the harness's login once it succeeded.
229
+ * `done` resolves with the harness's login once it succeeded. Every
230
+ * connection hears it start (`onAuthUpdated`, `auth.loginUnderWay`), and
231
+ * a newer login to the same store cancels it. It installs the harness's
232
+ * CLI first when it is not there yet, inside the 20 s the CLI has to
233
+ * start the login: on a slow network, `prepareClis` first.
219
234
  */
220
235
  login(harness: AgentHarness, method: string, options?: {
221
236
  apiKey?: string;
@@ -229,7 +244,12 @@ export declare class AgentServerClient {
229
244
  onEvent(handler: (envelope: DecodedWireEventEnvelope) => void): () => void;
230
245
  /** A harness's CLI being installed on the server, whatever caused it (`clis/progress`). */
231
246
  onCliProgress(handler: (progress: HarnessCliProgress) => void): () => void;
232
- /** A harness's login changed on the server, or a login ended, whoever caused it (`auth/updated`). */
247
+ /**
248
+ * A harness's login changed on the server, a login started (no `login`;
249
+ * `auth.loginUnderWay` is it), or a login ended (`login`), whoever caused
250
+ * it (`auth/updated`). Every update's `auth` carries the login then under
251
+ * way to that harness, if any.
252
+ */
233
253
  onAuthUpdated(handler: (update: AuthUpdated) => void): () => void;
234
254
  /** Observe unrecoverable delivery gaps even when using startTurn without a handle. */
235
255
  onEventGap(handler: (gap: SessionEventGap) => void): () => void;
@@ -260,11 +280,17 @@ export declare class AgentServerClient {
260
280
  * server's answer: the session is followed no more.
261
281
  */
262
282
  private resubscribe;
263
- /** Every session again; refused, the client follows every session no more. */
264
- private resubscribeAll;
283
+ /** A failure a redial heals: the connection dropped and will be redialed, which subscribes again. */
284
+ private redialing;
285
+ /** Settle the `subscribeAll` calls waiting for an answer: answered, or failed with `error`. */
286
+ private answeredAll;
265
287
  /** After a redial: every session followed, from what the client holds, pipelined. */
266
288
  private subscribeAgain;
267
- /** `session/subscribeAll`, sent now. */
289
+ /**
290
+ * `session/subscribeAll`, sent now; its answer settles the `subscribeAll`
291
+ * calls waiting. Refused, the client follows every session no more; dropped,
292
+ * the redial asks again.
293
+ */
268
294
  private requestAll;
269
295
  /** `session/subscribe` for one session, `onAnswer` given its point the moment it arrives. */
270
296
  private subscribeTo;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAEhB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,kBAAkB,EAEvB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,2BAA2B,EAGhC,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,eAAe,EAGpB,KAAK,aAAa,EAIlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACN,KAAK,wBAAwB,EAE7B,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,KAAK,WAAW,EAAc,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAe,KAAK,eAAe,EAAW,MAAM,cAAc,CAAC;AACzF,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAIlB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAe,KAAK,UAAU,EAAS,MAAM,YAAY,CAAC;AAEjE,OAAO,EACN,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,KAAK,eAAe,EACpB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,eAAe,KAAK,IAAI,GAAG,MAAM,IAAI;IAInE,2DAA2D;IACrD,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B,OAAO,CAAC,UAAU;IA4BlB;;;OAGG;IACH,OAAO,CAAC,MAAM;IAMd,iHAAiH;YACnG,OAAO;IAerB,OAAO,CAAC,QAAQ;IAehB;;;;;;OAMG;YACW,WAAW;IAiBzB,qGAAqG;IACrG,OAAO,CAAC,SAAS;IAMjB,+FAA+F;IAC/F,OAAO,CAAC,WAAW;IAOnB,qFAAqF;IACrF,OAAO,CAAC,cAAc;IAMtB;;;;OAIG;YACW,UAAU;IAYxB,6FAA6F;IAC7F,OAAO,CAAC,WAAW;CAMnB"}
@@ -6,10 +6,12 @@ export declare class ConnectionClosedError extends Error {
6
6
  readonly name: string;
7
7
  }
8
8
  /**
9
- * Why a server refused this client, which it answers 401: the token it sent
10
- * (`token_refused`), or that it sent none (`token_required`).
9
+ * Why a server refused this client: answered 401, the token it sent
10
+ * (`token_refused`) or that it sent none (`token_required`); or, answering
11
+ * `initialize`, that it speaks another wire protocol version
12
+ * (`protocol_mismatch`, a `ProtocolVersionMismatchError`).
11
13
  */
12
- export type ConnectionRefusal = "token_refused" | "token_required";
14
+ export type ConnectionRefusal = "token_refused" | "token_required" | "protocol_mismatch";
13
15
  /**
14
16
  * The server answered, and refused this client (`reason`). Asked again it
15
17
  * answers the same, so a client that redials stops: the connection is closed
@@ -17,12 +19,39 @@ export type ConnectionRefusal = "token_refused" | "token_required";
17
19
  */
18
20
  export declare class ConnectionRefusedError extends ConnectionClosedError {
19
21
  readonly reason: ConnectionRefusal;
20
- /** The server that refused it. */
22
+ /** The server that refused it; empty for a client that dialed no URL (`spawn`, `attach`, a factory). */
21
23
  readonly url: string;
22
24
  readonly name: string;
23
25
  constructor(reason: ConnectionRefusal,
24
- /** The server that refused it. */
25
- url: string);
26
+ /** The server that refused it; empty for a client that dialed no URL (`spawn`, `attach`, a factory). */
27
+ url: string, message?: string);
28
+ }
29
+ /**
30
+ * The server speaks another wire protocol version than this client: it
31
+ * answered `initialize` with `protocolVersionMismatch`, or selected a version
32
+ * this build does not speak. No redial can change that (only another build of
33
+ * the client or of the server), so it is a refusal: the client stops and what
34
+ * waits on it fails with this. `code` and `data` are the wire error's, as a
35
+ * `WireRequestError` would carry them.
36
+ */
37
+ export declare class ProtocolVersionMismatchError extends ConnectionRefusedError {
38
+ /** The version this client speaks (`WIRE_PROTOCOL_VERSION`). */
39
+ readonly protocolVersion: number;
40
+ /** The versions the server speaks, as it said; empty when it did not say. */
41
+ readonly supported: number[];
42
+ readonly name: string;
43
+ readonly reason: "protocol_mismatch";
44
+ readonly code: -32004;
45
+ constructor(
46
+ /** The version this client speaks (`WIRE_PROTOCOL_VERSION`). */
47
+ protocolVersion: number,
48
+ /** The versions the server speaks, as it said; empty when it did not say. */
49
+ supported: number[], url: string,
50
+ /** What the server said, when it refused the version itself. */
51
+ detail?: string);
52
+ get data(): {
53
+ supported: number[];
54
+ };
26
55
  }
27
56
  /**
28
57
  * What the client's connection does (`onConnection`): an outage, each redial,
@@ -57,12 +86,20 @@ export type ConnectionEvent =
57
86
  initialize: InitializeResult;
58
87
  }
59
88
  /**
60
- * A redial the server refused (`ConnectionRefusedError`): no outage, its
61
- * answer, which every redial would get. The client stops; `closed` follows.
89
+ * A server that refused the client (`ConnectionRefusedError`): no outage,
90
+ * its answer, which every redial would get. The client stops; `closed`
91
+ * follows. A refused token is told of a redial (`connect` itself rejects
92
+ * with it); another protocol version (`ProtocolVersionMismatchError`) of
93
+ * any handshake: `protocolVersion` this client's, `supported` the server's.
62
94
  */
63
95
  | {
64
96
  state: "refused";
65
- reason: ConnectionRefusal;
97
+ reason: "token_refused" | "token_required";
98
+ } | {
99
+ state: "refused";
100
+ reason: "protocol_mismatch";
101
+ protocolVersion: number;
102
+ supported: number[];
66
103
  }
67
104
  /**
68
105
  * For good: `close()`, a dropped connection that does not redial,
@@ -96,7 +133,7 @@ export interface AgentServerClientOptions {
96
133
  }
97
134
  export type TransportFactory = () => Promise<WireTransport> | WireTransport;
98
135
  /** What the connection tells the client around it. */
99
- export interface ConnectionHost {
136
+ interface ConnectionHost {
100
137
  /** A line from the current transport. */
101
138
  line(line: string, transport: WireTransport): void;
102
139
  /** A new transport opened; `redialed`: its handshake comes next, before anything else may run. */
@@ -121,6 +158,8 @@ export declare class Connection {
121
158
  private readonly options;
122
159
  readonly redials: boolean;
123
160
  private readonly host;
161
+ /** The URL it dials, for what a refusal says; empty when it dials none. */
162
+ private readonly url;
124
163
  transport: WireTransport | null;
125
164
  readonly rpc: Rpc;
126
165
  readonly events: Listeners<ConnectionEvent>;
@@ -135,10 +174,17 @@ export declare class Connection {
135
174
  private stopBackoff;
136
175
  /** The running reconnect loop, for a request that waits to be re-sent. */
137
176
  private reconnection;
138
- constructor(factory: TransportFactory, options: AgentServerClientOptions, redials: boolean, host: ConnectionHost);
177
+ constructor(factory: TransportFactory, options: AgentServerClientOptions, redials: boolean, host: ConnectionHost,
178
+ /** The URL it dials, for what a refusal says; empty when it dials none. */
179
+ url?: string);
139
180
  open(): Promise<void>;
140
- /** Handshake (memoized). */
181
+ /**
182
+ * Handshake (memoized). A server of another protocol version closes the
183
+ * client for good: it rejects with `ProtocolVersionMismatchError`.
184
+ */
141
185
  initialize(): Promise<InitializeResult>;
186
+ /** The server speaks another protocol version: the client is closed by its refusal, which this returns. */
187
+ private mismatched;
142
188
  /** A request, its answer read as `WIRE_API` reads the method's. */
143
189
  request<M extends WireRequestMethod>(method: M, params: WireParams<M>, onAnswer?: OnAnswer<WireDecodedResult<M>>): Promise<WireDecodedResult<M>>;
144
190
  /**
@@ -156,7 +202,12 @@ export declare class Connection {
156
202
  private redial;
157
203
  /** Let the current transport go without reporting it as a drop: it was never handed over. */
158
204
  private discard;
159
- /** Closed for good by the server's refusal, which what waits on the connection fails with. */
205
+ /**
206
+ * Closed for good by the server's refusal, which what waits on the
207
+ * connection fails with: the requests in flight, and the transport it came
208
+ * on (a handshake's) let go.
209
+ */
160
210
  private refused;
161
211
  }
212
+ export {};
162
213
  //# sourceMappingURL=connection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/client/connection.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,gBAAgB,EAKrB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,KAAK,QAAQ,EAAE,GAAG,EAAoB,MAAM,UAAU,CAAC;AAEhE,qEAAqE;AACrE,qBAAa,qBAAsB,SAAQ,KAAK;IAC/C,SAAkB,IAAI,EAAE,MAAM,CAA2B;CACzD;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAEnE;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,qBAAqB;IAG/D,QAAQ,CAAC,MAAM,EAAE,iBAAiB;IAClC,kCAAkC;IAClC,QAAQ,CAAC,GAAG,EAAE,MAAM;IAJrB,SAAkB,IAAI,EAAE,MAAM,CAA4B;gBAEhD,MAAM,EAAE,iBAAiB;IAClC,kCAAkC;IACzB,GAAG,EAAE,MAAM;CAMrB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe;AAC1B,6EAA6E;AAC3E;IAAE,KAAK,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAC3C,6FAA6F;GAC3F;IAAE,KAAK,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE;AAC7E;;;;;;;GAOG;GACD;IACA,KAAK,EAAE,aA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0EAA0E;IAC1E,OAAO,CAAC,YAAY,CAA8B;gBAGhC,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,wBAAwB,EACzC,OAAO,EAAE,OAAO,EACR,IAAI,EAAE,cAAc;IACrC,2EAA2E;IAC1D,GAAG,SAAK;IAkBpB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAe3B;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAkCvC,2GAA2G;IAC3G,OAAO,CAAC,UAAU;IAWlB,mEAAmE;IACnE,OAAO,CAAC,CAAC,SAAS,iBAAiB,EAClC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GACvC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAQhC;;;;;;;;OAQG;IACG,MAAM,CAAC,CAAC,SAAS,iBAAiB,EACvC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GACvC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAehC,KAAK,IAAI,IAAI;IAYb,OAAO,CAAC,OAAO;YAmBD,MAAM;IA+EpB,6FAA6F;IAC7F,OAAO,CAAC,OAAO;IAMf;;;;OAIG;IACH,OAAO,CAAC,OAAO;CAqBf"}
@@ -1,4 +1,4 @@
1
- export { AgentServerClient, type AgentServerClientOptions, type ConnectOptions, ConnectionClosedError, type ConnectionEvent, type ConnectionRefusal, ConnectionRefusedError, EventGapError, type FollowOptions, type JoinTurnOptions, type SessionEventGap, type SessionSubscription, type SubscribeOptions, type TurnHandle, } from "./client.ts";
1
+ export { AgentServerClient, type AgentServerClientOptions, type ConnectOptions, ConnectionClosedError, type ConnectionEvent, type ConnectionRefusal, ConnectionRefusedError, EventGapError, type FollowOptions, type JoinTurnOptions, ProtocolVersionMismatchError, type SessionEventGap, type SessionSubscription, type SubscribeOptions, type TurnHandle, } from "./client.ts";
2
2
  export { LoginError, type LoginHandle } from "./logins.ts";
3
3
  export { WireRequestError, refusalData } from "./rpc.ts";
4
4
  export { connectTransport, type SpawnServerOptions, socketTransport, spawnTransport, type WebSocketLike, } from "./transports.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACN,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,eAAe,EACf,cAAc,EACd,KAAK,aAAa,GAClB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,cAAc,EACnB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,sBAAsB,EACtB,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,4BAA4B,EAC5B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACN,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,eAAe,EACf,cAAc,EACd,KAAK,aAAa,GAClB,MAAM,iBAAiB,CAAC"}
@@ -21,7 +21,7 @@ export interface LoginHandle extends AuthLogin {
21
21
  cancel(): Promise<void>;
22
22
  }
23
23
  /** What a login handle asks of the client. */
24
- export interface LoginsPort {
24
+ interface LoginsPort {
25
25
  readonly updates: Listeners<AuthUpdated>;
26
26
  readonly connection: Listeners<ConnectionEvent>;
27
27
  complete(loginId: string, code: string): Promise<AuthUpdated>;
@@ -32,4 +32,5 @@ export interface LoginsPort {
32
32
  * watched for from before the request: either may come before the answer.
33
33
  */
34
34
  export declare function startLogin(port: LoginsPort, request: () => Promise<AuthLogin>): Promise<LoginHandle>;
35
+ export {};
35
36
  //# sourceMappingURL=logins.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logins.d.ts","sourceRoot":"","sources":["../../../src/client/logins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,qHAAqH;AACrH,qBAAa,UAAW,SAAQ,KAAK;IAGxB,QAAQ,CAAC,GAAG,EAAE,YAAY;IAFtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBAEJ,GAAG,EAAE,YAAY;CAOtC;AAED,6EAA6E;AAC7E,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC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