@zvada/agent-server 0.3.17 → 0.3.19

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 (578) hide show
  1. package/AGENTS.md +11 -26
  2. package/CHANGELOG.md +1060 -0
  3. package/README.md +50 -26
  4. package/dist/types/accounts/chatgpt.d.ts +34 -0
  5. package/dist/types/accounts/chatgpt.d.ts.map +1 -0
  6. package/dist/types/accounts/check.d.ts +24 -0
  7. package/dist/types/accounts/check.d.ts.map +1 -0
  8. package/dist/types/accounts/claude.d.ts +21 -0
  9. package/dist/types/accounts/claude.d.ts.map +1 -0
  10. package/dist/types/accounts/endpoint.d.ts +50 -0
  11. package/dist/types/accounts/endpoint.d.ts.map +1 -0
  12. package/dist/types/accounts/http.d.ts +38 -0
  13. package/dist/types/accounts/http.d.ts.map +1 -0
  14. package/dist/types/accounts/index.d.ts +6 -0
  15. package/dist/types/accounts/index.d.ts.map +1 -0
  16. package/dist/types/client/client.d.ts +272 -0
  17. package/dist/types/client/client.d.ts.map +1 -0
  18. package/dist/types/client/connection.d.ts +160 -0
  19. package/dist/types/client/connection.d.ts.map +1 -0
  20. package/dist/types/client/history.d.ts +8 -0
  21. package/dist/types/client/history.d.ts.map +1 -0
  22. package/dist/types/client/index.d.ts +5 -0
  23. package/dist/types/client/index.d.ts.map +1 -0
  24. package/dist/types/client/listeners.d.ts +8 -0
  25. package/dist/types/client/listeners.d.ts.map +1 -0
  26. package/dist/types/client/logins.d.ts +35 -0
  27. package/dist/types/client/logins.d.ts.map +1 -0
  28. package/dist/types/client/rpc.d.ts +46 -0
  29. package/dist/types/client/rpc.d.ts.map +1 -0
  30. package/dist/types/client/streams.d.ts +150 -0
  31. package/dist/types/client/streams.d.ts.map +1 -0
  32. package/dist/types/client/transports.d.ts +35 -0
  33. package/dist/types/client/transports.d.ts.map +1 -0
  34. package/dist/types/client/turns.d.ts +81 -0
  35. package/dist/types/client/turns.d.ts.map +1 -0
  36. package/dist/types/core/agents/acp/acp-agent.d.ts +68 -0
  37. package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -0
  38. package/dist/types/core/agents/acp/adapter.d.ts +39 -0
  39. package/dist/types/core/agents/acp/adapter.d.ts.map +1 -0
  40. package/dist/types/core/agents/acp/client.d.ts +90 -0
  41. package/dist/types/core/agents/acp/client.d.ts.map +1 -0
  42. package/dist/types/core/agents/acp/known-agents.d.ts +35 -0
  43. package/dist/types/core/agents/acp/known-agents.d.ts.map +1 -0
  44. package/dist/types/core/agents/acp/mappings.d.ts +46 -0
  45. package/dist/types/core/agents/acp/mappings.d.ts.map +1 -0
  46. package/dist/types/core/agents/acp/requests.d.ts +26 -0
  47. package/dist/types/core/agents/acp/requests.d.ts.map +1 -0
  48. package/dist/types/core/agents/attachments.d.ts +11 -0
  49. package/dist/types/core/agents/attachments.d.ts.map +1 -0
  50. package/dist/types/core/agents/base.d.ts +227 -0
  51. package/dist/types/core/agents/base.d.ts.map +1 -0
  52. package/dist/types/core/agents/claude-code/adapter.d.ts +58 -0
  53. package/dist/types/core/agents/claude-code/adapter.d.ts.map +1 -0
  54. package/dist/types/core/agents/claude-code/approvals.d.ts +26 -0
  55. package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -0
  56. package/dist/types/core/agents/claude-code/claude-agent.d.ts +70 -0
  57. package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -0
  58. package/dist/types/core/agents/claude-code/credentials.d.ts +54 -0
  59. package/dist/types/core/agents/claude-code/credentials.d.ts.map +1 -0
  60. package/dist/types/core/agents/claude-code/events.d.ts +42 -0
  61. package/dist/types/core/agents/claude-code/events.d.ts.map +1 -0
  62. package/dist/types/core/agents/claude-code/login.d.ts +61 -0
  63. package/dist/types/core/agents/claude-code/login.d.ts.map +1 -0
  64. package/dist/types/core/agents/claude-code/mcp.d.ts +52 -0
  65. package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -0
  66. package/dist/types/core/agents/claude-code/models.d.ts +30 -0
  67. package/dist/types/core/agents/claude-code/models.d.ts.map +1 -0
  68. package/dist/types/core/agents/claude-code/options.d.ts +183 -0
  69. package/dist/types/core/agents/claude-code/options.d.ts.map +1 -0
  70. package/dist/types/core/agents/claude-code/outcome.d.ts +50 -0
  71. package/dist/types/core/agents/claude-code/outcome.d.ts.map +1 -0
  72. package/dist/types/core/agents/claude-code/session-pool.d.ts +36 -0
  73. package/dist/types/core/agents/claude-code/session-pool.d.ts.map +1 -0
  74. package/dist/types/core/agents/claude-code/session.d.ts +148 -0
  75. package/dist/types/core/agents/claude-code/session.d.ts.map +1 -0
  76. package/dist/types/core/agents/claude-code/spawn.d.ts +29 -0
  77. package/dist/types/core/agents/claude-code/spawn.d.ts.map +1 -0
  78. package/dist/types/core/agents/claude-code/spend.d.ts +58 -0
  79. package/dist/types/core/agents/claude-code/spend.d.ts.map +1 -0
  80. package/dist/types/core/agents/claude-code/tools.d.ts +4 -0
  81. package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -0
  82. package/dist/types/core/agents/claude-code/turn-usage.d.ts +52 -0
  83. package/dist/types/core/agents/claude-code/turn-usage.d.ts.map +1 -0
  84. package/dist/types/core/agents/claude-code/turn.d.ts +121 -0
  85. package/dist/types/core/agents/claude-code/turn.d.ts.map +1 -0
  86. package/dist/types/core/agents/codex-app-server/adapter.d.ts +59 -0
  87. package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -0
  88. package/dist/types/core/agents/codex-app-server/client.d.ts +116 -0
  89. package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -0
  90. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +113 -0
  91. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -0
  92. package/dist/types/core/agents/codex-app-server/commands.d.ts +66 -0
  93. package/dist/types/core/agents/codex-app-server/commands.d.ts.map +1 -0
  94. package/dist/types/core/agents/codex-app-server/credentials.d.ts +49 -0
  95. package/dist/types/core/agents/codex-app-server/credentials.d.ts.map +1 -0
  96. package/dist/types/core/agents/codex-app-server/effort.d.ts +12 -0
  97. package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -0
  98. package/dist/types/core/agents/codex-app-server/events.d.ts +45 -0
  99. package/dist/types/core/agents/codex-app-server/events.d.ts.map +1 -0
  100. package/dist/types/core/agents/codex-app-server/homes.d.ts +20 -0
  101. package/dist/types/core/agents/codex-app-server/homes.d.ts.map +1 -0
  102. package/dist/types/core/agents/codex-app-server/input.d.ts +26 -0
  103. package/dist/types/core/agents/codex-app-server/input.d.ts.map +1 -0
  104. package/dist/types/core/agents/codex-app-server/items.d.ts +31 -0
  105. package/dist/types/core/agents/codex-app-server/items.d.ts.map +1 -0
  106. package/dist/types/core/agents/codex-app-server/login.d.ts +38 -0
  107. package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -0
  108. package/dist/types/core/agents/codex-app-server/mcp.d.ts +62 -0
  109. package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -0
  110. package/dist/types/core/agents/codex-app-server/models.d.ts +67 -0
  111. package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -0
  112. package/dist/types/core/agents/codex-app-server/options.d.ts +40 -0
  113. package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -0
  114. package/dist/types/core/agents/codex-app-server/plan-approval.d.ts +19 -0
  115. package/dist/types/core/agents/codex-app-server/plan-approval.d.ts.map +1 -0
  116. package/dist/types/core/agents/codex-app-server/protocol.d.ts +99 -0
  117. package/dist/types/core/agents/codex-app-server/protocol.d.ts.map +1 -0
  118. package/dist/types/core/agents/codex-app-server/requests.d.ts +42 -0
  119. package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -0
  120. package/dist/types/core/agents/codex-app-server/session.d.ts +96 -0
  121. package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -0
  122. package/dist/types/core/agents/codex-app-server/subagents.d.ts +53 -0
  123. package/dist/types/core/agents/codex-app-server/subagents.d.ts.map +1 -0
  124. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts +87 -0
  125. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -0
  126. package/dist/types/core/agents/codex-app-server/turn-items.d.ts +33 -0
  127. package/dist/types/core/agents/codex-app-server/turn-items.d.ts.map +1 -0
  128. package/dist/types/core/agents/codex-app-server/turn.d.ts +163 -0
  129. package/dist/types/core/agents/codex-app-server/turn.d.ts.map +1 -0
  130. package/dist/types/core/agents/config-fingerprint.d.ts +5 -0
  131. package/dist/types/core/agents/config-fingerprint.d.ts.map +1 -0
  132. package/dist/types/core/agents/credentials.d.ts +28 -0
  133. package/dist/types/core/agents/credentials.d.ts.map +1 -0
  134. package/dist/types/core/agents/elicitation.d.ts +37 -0
  135. package/dist/types/core/agents/elicitation.d.ts.map +1 -0
  136. package/dist/types/core/agents/inherit-config.d.ts +18 -0
  137. package/dist/types/core/agents/inherit-config.d.ts.map +1 -0
  138. package/dist/types/core/agents/login.d.ts +67 -0
  139. package/dist/types/core/agents/login.d.ts.map +1 -0
  140. package/dist/types/core/agents/mcp-config.d.ts +57 -0
  141. package/dist/types/core/agents/mcp-config.d.ts.map +1 -0
  142. package/dist/types/core/agents/plan.d.ts +16 -0
  143. package/dist/types/core/agents/plan.d.ts.map +1 -0
  144. package/dist/types/core/agents/registry.d.ts +30 -0
  145. package/dist/types/core/agents/registry.d.ts.map +1 -0
  146. package/dist/types/core/agents/session-agent.d.ts +48 -0
  147. package/dist/types/core/agents/session-agent.d.ts.map +1 -0
  148. package/dist/types/core/agents/session-pool.d.ts +41 -0
  149. package/dist/types/core/agents/session-pool.d.ts.map +1 -0
  150. package/dist/types/core/agents/stderr-tail.d.ts +28 -0
  151. package/dist/types/core/agents/stderr-tail.d.ts.map +1 -0
  152. package/dist/types/core/agents/thinking-levels.d.ts +4 -0
  153. package/dist/types/core/agents/thinking-levels.d.ts.map +1 -0
  154. package/dist/types/core/agents/types.d.ts +124 -0
  155. package/dist/types/core/agents/types.d.ts.map +1 -0
  156. package/dist/types/core/diagnostics.d.ts +36 -0
  157. package/dist/types/core/diagnostics.d.ts.map +1 -0
  158. package/dist/types/core/index.d.ts +29 -0
  159. package/dist/types/core/index.d.ts.map +1 -0
  160. package/dist/types/core/presets.d.ts +80 -0
  161. package/dist/types/core/presets.d.ts.map +1 -0
  162. package/dist/types/core/processes/identity.d.ts +31 -0
  163. package/dist/types/core/processes/identity.d.ts.map +1 -0
  164. package/dist/types/core/processes/lifeline.d.ts +47 -0
  165. package/dist/types/core/processes/lifeline.d.ts.map +1 -0
  166. package/dist/types/core/processes/native-processes.d.ts +130 -0
  167. package/dist/types/core/processes/native-processes.d.ts.map +1 -0
  168. package/dist/types/core/processes/process-table.d.ts +43 -0
  169. package/dist/types/core/processes/process-table.d.ts.map +1 -0
  170. package/dist/types/core/provision/cache-trust.d.ts +13 -0
  171. package/dist/types/core/provision/cache-trust.d.ts.map +1 -0
  172. package/dist/types/core/provision/cache-usage.d.ts +14 -0
  173. package/dist/types/core/provision/cache-usage.d.ts.map +1 -0
  174. package/dist/types/core/provision/checksums.d.ts +46 -0
  175. package/dist/types/core/provision/checksums.d.ts.map +1 -0
  176. package/dist/types/core/provision/extract.d.ts +7 -0
  177. package/dist/types/core/provision/extract.d.ts.map +1 -0
  178. package/dist/types/core/provision/index.d.ts +5 -0
  179. package/dist/types/core/provision/index.d.ts.map +1 -0
  180. package/dist/types/core/provision/install-build.d.ts +36 -0
  181. package/dist/types/core/provision/install-build.d.ts.map +1 -0
  182. package/dist/types/core/provision/npm.d.ts +40 -0
  183. package/dist/types/core/provision/npm.d.ts.map +1 -0
  184. package/dist/types/core/provision/pins.d.ts +24 -0
  185. package/dist/types/core/provision/pins.d.ts.map +1 -0
  186. package/dist/types/core/provision/platform.d.ts +28 -0
  187. package/dist/types/core/provision/platform.d.ts.map +1 -0
  188. package/dist/types/core/provision/provisioner.d.ts +189 -0
  189. package/dist/types/core/provision/provisioner.d.ts.map +1 -0
  190. package/dist/types/core/provision/releases.d.ts +8 -0
  191. package/dist/types/core/provision/releases.d.ts.map +1 -0
  192. package/dist/types/core/provision/tools.d.ts +81 -0
  193. package/dist/types/core/provision/tools.d.ts.map +1 -0
  194. package/dist/types/core/proxy/anthropic-proxy.d.ts +52 -0
  195. package/dist/types/core/proxy/anthropic-proxy.d.ts.map +1 -0
  196. package/dist/types/core/proxy/api-key-store.d.ts +37 -0
  197. package/dist/types/core/proxy/api-key-store.d.ts.map +1 -0
  198. package/dist/types/core/proxy/index.d.ts +3 -0
  199. package/dist/types/core/proxy/index.d.ts.map +1 -0
  200. package/dist/types/core/proxy/loopback.d.ts +14 -0
  201. package/dist/types/core/proxy/loopback.d.ts.map +1 -0
  202. package/dist/types/core/runtime/agent-runtime.d.ts +181 -0
  203. package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -0
  204. package/dist/types/core/runtime/event-processor.d.ts +87 -0
  205. package/dist/types/core/runtime/event-processor.d.ts.map +1 -0
  206. package/dist/types/core/runtime/event-sink.d.ts +44 -0
  207. package/dist/types/core/runtime/event-sink.d.ts.map +1 -0
  208. package/dist/types/core/runtime/harness-clis.d.ts +10 -0
  209. package/dist/types/core/runtime/harness-clis.d.ts.map +1 -0
  210. package/dist/types/core/runtime/harness-logins.d.ts +68 -0
  211. package/dist/types/core/runtime/harness-logins.d.ts.map +1 -0
  212. package/dist/types/core/runtime/login-reads.d.ts +28 -0
  213. package/dist/types/core/runtime/login-reads.d.ts.map +1 -0
  214. package/dist/types/core/runtime/model-lists.d.ts +37 -0
  215. package/dist/types/core/runtime/model-lists.d.ts.map +1 -0
  216. package/dist/types/core/runtime/permission-policy.d.ts +61 -0
  217. package/dist/types/core/runtime/permission-policy.d.ts.map +1 -0
  218. package/dist/types/core/runtime/request-broker.d.ts +49 -0
  219. package/dist/types/core/runtime/request-broker.d.ts.map +1 -0
  220. package/dist/types/core/runtime/steering.d.ts +38 -0
  221. package/dist/types/core/runtime/steering.d.ts.map +1 -0
  222. package/dist/types/core/runtime/turn-outcome.d.ts +21 -0
  223. package/dist/types/core/runtime/turn-outcome.d.ts.map +1 -0
  224. package/dist/types/core/runtime/turn.d.ts +121 -0
  225. package/dist/types/core/runtime/turn.d.ts.map +1 -0
  226. package/dist/types/core/utils/bounded.d.ts +6 -0
  227. package/dist/types/core/utils/bounded.d.ts.map +1 -0
  228. package/dist/types/core/utils/deadline.d.ts +14 -0
  229. package/dist/types/core/utils/deadline.d.ts.map +1 -0
  230. package/dist/types/core/utils/errors.d.ts +104 -0
  231. package/dist/types/core/utils/errors.d.ts.map +1 -0
  232. package/dist/types/core/utils/is-record.d.ts +3 -0
  233. package/dist/types/core/utils/is-record.d.ts.map +1 -0
  234. package/dist/types/core/utils/loopback.d.ts +6 -0
  235. package/dist/types/core/utils/loopback.d.ts.map +1 -0
  236. package/dist/types/index.d.ts +2 -0
  237. package/dist/types/index.d.ts.map +1 -0
  238. package/dist/types/protocol/account.d.ts +26 -0
  239. package/dist/types/protocol/account.d.ts.map +1 -0
  240. package/dist/types/protocol/async-queue.d.ts +21 -0
  241. package/dist/types/protocol/async-queue.d.ts.map +1 -0
  242. package/dist/types/protocol/auth.d.ts +228 -0
  243. package/dist/types/protocol/auth.d.ts.map +1 -0
  244. package/dist/types/protocol/canonical.d.ts +9 -0
  245. package/dist/types/protocol/canonical.d.ts.map +1 -0
  246. package/dist/types/protocol/clis.d.ts +74 -0
  247. package/dist/types/protocol/clis.d.ts.map +1 -0
  248. package/dist/types/protocol/config.d.ts +200 -0
  249. package/dist/types/protocol/config.d.ts.map +1 -0
  250. package/dist/types/protocol/conversation.d.ts +942 -0
  251. package/dist/types/protocol/conversation.d.ts.map +1 -0
  252. package/dist/types/protocol/credentials.d.ts +145 -0
  253. package/dist/types/protocol/credentials.d.ts.map +1 -0
  254. package/dist/types/protocol/errors.d.ts +36 -0
  255. package/dist/types/protocol/errors.d.ts.map +1 -0
  256. package/dist/types/protocol/execution.d.ts +28 -0
  257. package/dist/types/protocol/execution.d.ts.map +1 -0
  258. package/dist/types/protocol/factories.d.ts +94 -0
  259. package/dist/types/protocol/factories.d.ts.map +1 -0
  260. package/dist/types/protocol/guards.d.ts +55 -0
  261. package/dist/types/protocol/guards.d.ts.map +1 -0
  262. package/dist/types/protocol/harness.d.ts +70 -0
  263. package/dist/types/protocol/harness.d.ts.map +1 -0
  264. package/dist/types/protocol/history.d.ts +318 -0
  265. package/dist/types/protocol/history.d.ts.map +1 -0
  266. package/dist/types/protocol/ids.d.ts +9 -0
  267. package/dist/types/protocol/ids.d.ts.map +1 -0
  268. package/dist/types/protocol/index.d.ts +35 -0
  269. package/dist/types/protocol/index.d.ts.map +1 -0
  270. package/dist/types/protocol/lifecycle.d.ts +1190 -0
  271. package/dist/types/protocol/lifecycle.d.ts.map +1 -0
  272. package/dist/types/protocol/meta-keys.d.ts +17 -0
  273. package/dist/types/protocol/meta-keys.d.ts.map +1 -0
  274. package/dist/types/protocol/meta.d.ts +13 -0
  275. package/dist/types/protocol/meta.d.ts.map +1 -0
  276. package/dist/types/protocol/model-catalog.d.ts +11 -0
  277. package/dist/types/protocol/model-catalog.d.ts.map +1 -0
  278. package/dist/types/protocol/models.d.ts +107 -0
  279. package/dist/types/protocol/models.d.ts.map +1 -0
  280. package/dist/types/protocol/part-input.d.ts +101 -0
  281. package/dist/types/protocol/part-input.d.ts.map +1 -0
  282. package/dist/types/protocol/parts.d.ts +357 -0
  283. package/dist/types/protocol/parts.d.ts.map +1 -0
  284. package/dist/types/protocol/reduce.d.ts +26 -0
  285. package/dist/types/protocol/reduce.d.ts.map +1 -0
  286. package/dist/types/protocol/selectors.d.ts +64 -0
  287. package/dist/types/protocol/selectors.d.ts.map +1 -0
  288. package/dist/types/protocol/seq-cursor.d.ts +66 -0
  289. package/dist/types/protocol/seq-cursor.d.ts.map +1 -0
  290. package/dist/types/protocol/stop-reasons.d.ts +33 -0
  291. package/dist/types/protocol/stop-reasons.d.ts.map +1 -0
  292. package/dist/types/protocol/thinking.d.ts +28 -0
  293. package/dist/types/protocol/thinking.d.ts.map +1 -0
  294. package/dist/types/protocol/time.d.ts +21 -0
  295. package/dist/types/protocol/time.d.ts.map +1 -0
  296. package/dist/types/protocol/tokens.d.ts +29 -0
  297. package/dist/types/protocol/tokens.d.ts.map +1 -0
  298. package/dist/types/protocol/tool-closure.d.ts +25 -0
  299. package/dist/types/protocol/tool-closure.d.ts.map +1 -0
  300. package/dist/types/protocol/tool-state.d.ts +209 -0
  301. package/dist/types/protocol/tool-state.d.ts.map +1 -0
  302. package/dist/types/protocol/verify.d.ts +52 -0
  303. package/dist/types/protocol/verify.d.ts.map +1 -0
  304. package/dist/types/protocol/vocabulary.d.ts +19 -0
  305. package/dist/types/protocol/vocabulary.d.ts.map +1 -0
  306. package/dist/types/protocol/wire-api.d.ts +1983 -0
  307. package/dist/types/protocol/wire-api.d.ts.map +1 -0
  308. package/dist/types/protocol/wire.d.ts +1758 -0
  309. package/dist/types/protocol/wire.d.ts.map +1 -0
  310. package/dist/types/server/acp/binding.d.ts +33 -0
  311. package/dist/types/server/acp/binding.d.ts.map +1 -0
  312. package/dist/types/server/acp/session-records.d.ts +17 -0
  313. package/dist/types/server/acp/session-records.d.ts.map +1 -0
  314. package/dist/types/server/acp/translate.d.ts +48 -0
  315. package/dist/types/server/acp/translate.d.ts.map +1 -0
  316. package/dist/types/server/agent-server.d.ts +121 -0
  317. package/dist/types/server/agent-server.d.ts.map +1 -0
  318. package/dist/types/server/feedback.d.ts +37 -0
  319. package/dist/types/server/feedback.d.ts.map +1 -0
  320. package/dist/types/server/history.d.ts +15 -0
  321. package/dist/types/server/history.d.ts.map +1 -0
  322. package/dist/types/server/index.d.ts +7 -0
  323. package/dist/types/server/index.d.ts.map +1 -0
  324. package/dist/types/server/install.d.ts +42 -0
  325. package/dist/types/server/install.d.ts.map +1 -0
  326. package/dist/types/server/open-parts.d.ts +27 -0
  327. package/dist/types/server/open-parts.d.ts.map +1 -0
  328. package/dist/types/server/routes.d.ts +61 -0
  329. package/dist/types/server/routes.d.ts.map +1 -0
  330. package/dist/types/server/secrets.d.ts +11 -0
  331. package/dist/types/server/secrets.d.ts.map +1 -0
  332. package/dist/types/server/session-gate.d.ts +32 -0
  333. package/dist/types/server/session-gate.d.ts.map +1 -0
  334. package/dist/types/server/session-log.d.ts +39 -0
  335. package/dist/types/server/session-log.d.ts.map +1 -0
  336. package/dist/types/server/session-store.d.ts +119 -0
  337. package/dist/types/server/session-store.d.ts.map +1 -0
  338. package/dist/types/server/subscriptions.d.ts +74 -0
  339. package/dist/types/server/subscriptions.d.ts.map +1 -0
  340. package/dist/types/server/transports.d.ts +74 -0
  341. package/dist/types/server/transports.d.ts.map +1 -0
  342. package/dist/types/server/wire-error.d.ts +9 -0
  343. package/dist/types/server/wire-error.d.ts.map +1 -0
  344. package/dist/types/sync/event-log.d.ts +45 -0
  345. package/dist/types/sync/event-log.d.ts.map +1 -0
  346. package/dist/types/sync/fit.d.ts +40 -0
  347. package/dist/types/sync/fit.d.ts.map +1 -0
  348. package/dist/types/sync/history-reader.d.ts +8 -0
  349. package/dist/types/sync/history-reader.d.ts.map +1 -0
  350. package/dist/types/sync/history-sqlite.d.ts +37 -0
  351. package/dist/types/sync/history-sqlite.d.ts.map +1 -0
  352. package/dist/types/sync/history.d.ts +70 -0
  353. package/dist/types/sync/history.d.ts.map +1 -0
  354. package/dist/types/sync/index.d.ts +4 -0
  355. package/dist/types/sync/index.d.ts.map +1 -0
  356. package/dist/types/sync/journal-sqlite.d.ts +51 -0
  357. package/dist/types/sync/journal-sqlite.d.ts.map +1 -0
  358. package/dist/types/sync/journal.d.ts +107 -0
  359. package/dist/types/sync/journal.d.ts.map +1 -0
  360. package/dist/types/sync/live-tails.d.ts +30 -0
  361. package/dist/types/sync/live-tails.d.ts.map +1 -0
  362. package/dist/types/sync/node-sqlite.d.ts +7 -0
  363. package/dist/types/sync/node-sqlite.d.ts.map +1 -0
  364. package/dist/types/sync/projection.d.ts +10 -0
  365. package/dist/types/sync/projection.d.ts.map +1 -0
  366. package/dist/types/sync/recovery.d.ts +25 -0
  367. package/dist/types/sync/recovery.d.ts.map +1 -0
  368. package/dist/types/sync/retry.d.ts +25 -0
  369. package/dist/types/sync/retry.d.ts.map +1 -0
  370. package/dist/types/sync/schema.d.ts +4 -0
  371. package/dist/types/sync/schema.d.ts.map +1 -0
  372. package/dist/types/sync/sql.d.ts +38 -0
  373. package/dist/types/sync/sql.d.ts.map +1 -0
  374. package/dist/types/sync/sqlite-file.d.ts +9 -0
  375. package/dist/types/sync/sqlite-file.d.ts.map +1 -0
  376. package/dist/types/sync/sqlite.d.ts +6 -0
  377. package/dist/types/sync/sqlite.d.ts.map +1 -0
  378. package/dist/types/sync/worker.d.ts +63 -0
  379. package/dist/types/sync/worker.d.ts.map +1 -0
  380. package/docs/consuming.md +460 -54
  381. package/docs/deploy.md +218 -47
  382. package/docs/durable-sessions.md +195 -0
  383. package/docs/feedback.md +116 -0
  384. package/docs/harnesses.md +219 -87
  385. package/docs/sync-history.md +197 -0
  386. package/docs/sync-integration.md +119 -0
  387. package/package.json +53 -23
  388. package/src/accounts/chatgpt.ts +194 -0
  389. package/src/accounts/check.ts +112 -0
  390. package/src/accounts/claude.ts +111 -0
  391. package/src/accounts/endpoint.ts +151 -0
  392. package/src/accounts/http.ts +97 -0
  393. package/src/accounts/index.ts +19 -0
  394. package/src/client/client.ts +641 -602
  395. package/src/client/connection.ts +371 -0
  396. package/src/client/history.ts +65 -0
  397. package/src/client/index.ts +11 -2
  398. package/src/client/listeners.ts +20 -0
  399. package/src/client/logins.ts +105 -0
  400. package/src/client/rpc.ts +144 -0
  401. package/src/client/streams.ts +488 -0
  402. package/src/client/transports.ts +62 -8
  403. package/src/client/turns.ts +171 -0
  404. package/src/core/agents/acp/acp-agent.ts +94 -118
  405. package/src/core/agents/acp/adapter.ts +20 -9
  406. package/src/core/agents/acp/client.ts +125 -47
  407. package/src/core/agents/acp/known-agents.ts +36 -4
  408. package/src/core/agents/acp/mappings.ts +64 -18
  409. package/src/core/agents/acp/requests.ts +125 -0
  410. package/src/core/agents/attachments.ts +18 -0
  411. package/src/core/agents/base.ts +120 -42
  412. package/src/core/agents/claude-code/adapter.ts +177 -238
  413. package/src/core/agents/claude-code/approvals.ts +270 -0
  414. package/src/core/agents/claude-code/claude-agent.ts +175 -158
  415. package/src/core/agents/claude-code/credentials.ts +171 -0
  416. package/src/core/agents/claude-code/events.ts +55 -0
  417. package/src/core/agents/claude-code/login.ts +269 -0
  418. package/src/core/agents/claude-code/mcp.ts +206 -0
  419. package/src/core/agents/claude-code/models.ts +15 -9
  420. package/src/core/agents/claude-code/options.ts +326 -39
  421. package/src/core/agents/claude-code/outcome.ts +209 -0
  422. package/src/core/agents/claude-code/session-pool.ts +136 -0
  423. package/src/core/agents/claude-code/session.ts +513 -0
  424. package/src/core/agents/claude-code/spawn.ts +144 -0
  425. package/src/core/agents/claude-code/spend.ts +160 -0
  426. package/src/core/agents/claude-code/tools.ts +47 -0
  427. package/src/core/agents/claude-code/turn-usage.ts +135 -0
  428. package/src/core/agents/claude-code/turn.ts +232 -0
  429. package/src/core/agents/codex-app-server/adapter.ts +314 -117
  430. package/src/core/agents/codex-app-server/client.ts +186 -84
  431. package/src/core/agents/codex-app-server/codex-agent.ts +343 -0
  432. package/src/core/agents/codex-app-server/commands.ts +228 -0
  433. package/src/core/agents/codex-app-server/credentials.ts +126 -0
  434. package/src/core/agents/codex-app-server/effort.ts +29 -0
  435. package/src/core/agents/codex-app-server/events.ts +47 -0
  436. package/src/core/agents/codex-app-server/homes.ts +64 -0
  437. package/src/core/agents/codex-app-server/input.ts +60 -0
  438. package/src/core/agents/codex-app-server/items.ts +149 -0
  439. package/src/core/agents/codex-app-server/login.ts +180 -0
  440. package/src/core/agents/codex-app-server/mcp.ts +182 -37
  441. package/src/core/agents/codex-app-server/models.ts +99 -46
  442. package/src/core/agents/codex-app-server/options.ts +146 -0
  443. package/src/core/agents/codex-app-server/plan-approval.ts +135 -0
  444. package/src/core/agents/codex-app-server/protocol.ts +117 -0
  445. package/src/core/agents/codex-app-server/requests.ts +332 -0
  446. package/src/core/agents/codex-app-server/session.ts +285 -0
  447. package/src/core/agents/codex-app-server/subagents.ts +108 -42
  448. package/src/core/agents/codex-app-server/thread-settings.ts +279 -0
  449. package/src/core/agents/codex-app-server/turn-items.ts +88 -0
  450. package/src/core/agents/codex-app-server/turn.ts +463 -0
  451. package/src/core/agents/config-fingerprint.ts +7 -14
  452. package/src/core/agents/credentials.ts +98 -0
  453. package/src/core/agents/elicitation.ts +75 -0
  454. package/src/core/agents/inherit-config.ts +21 -0
  455. package/src/core/agents/login.ts +116 -0
  456. package/src/core/agents/mcp-config.ts +112 -8
  457. package/src/core/agents/plan.ts +25 -0
  458. package/src/core/agents/registry.ts +21 -4
  459. package/src/core/agents/session-agent.ts +96 -4
  460. package/src/core/agents/{session-store.ts → session-pool.ts} +11 -5
  461. package/src/core/agents/stderr-tail.ts +75 -0
  462. package/src/core/agents/types.ts +40 -5
  463. package/src/core/index.ts +60 -48
  464. package/src/core/presets.ts +100 -39
  465. package/src/core/processes/identity.ts +113 -0
  466. package/src/core/processes/lifeline.ts +170 -0
  467. package/src/core/processes/native-processes.ts +379 -0
  468. package/src/core/processes/process-table.ts +174 -0
  469. package/src/core/provision/cache-trust.ts +121 -0
  470. package/src/core/provision/cache-usage.ts +69 -0
  471. package/src/core/provision/checksums.ts +64 -0
  472. package/src/core/provision/extract.ts +11 -2
  473. package/src/core/provision/index.ts +4 -1
  474. package/src/core/provision/install-build.ts +136 -0
  475. package/src/core/provision/npm.ts +112 -17
  476. package/src/core/provision/pins.ts +11 -34
  477. package/src/core/provision/platform.ts +12 -1
  478. package/src/core/provision/provisioner.ts +329 -397
  479. package/src/core/provision/releases.ts +86 -0
  480. package/src/core/provision/tools.ts +329 -0
  481. package/src/core/proxy/anthropic-proxy.ts +55 -25
  482. package/src/core/proxy/api-key-store.ts +2 -12
  483. package/src/core/proxy/loopback.ts +106 -0
  484. package/src/core/runtime/agent-runtime.ts +340 -481
  485. package/src/core/runtime/event-processor.ts +207 -75
  486. package/src/core/runtime/event-sink.ts +45 -2
  487. package/src/core/runtime/harness-clis.ts +61 -0
  488. package/src/core/runtime/harness-logins.ts +328 -0
  489. package/src/core/runtime/login-reads.ts +78 -0
  490. package/src/core/runtime/model-lists.ts +57 -57
  491. package/src/core/runtime/permission-policy.ts +113 -0
  492. package/src/core/runtime/request-broker.ts +204 -0
  493. package/src/core/runtime/steering.ts +112 -0
  494. package/src/core/runtime/turn-outcome.ts +30 -0
  495. package/src/core/runtime/turn.ts +360 -0
  496. package/src/core/utils/bounded.ts +12 -0
  497. package/src/core/utils/deadline.ts +38 -0
  498. package/src/core/utils/errors.ts +113 -21
  499. package/src/core/utils/is-record.ts +4 -0
  500. package/src/core/utils/loopback.ts +10 -0
  501. package/src/protocol/account.ts +104 -0
  502. package/src/protocol/auth.ts +199 -0
  503. package/src/protocol/canonical.ts +16 -0
  504. package/src/protocol/clis.ts +69 -0
  505. package/src/protocol/config.ts +60 -6
  506. package/src/protocol/conversation.ts +272 -0
  507. package/src/protocol/credentials.ts +145 -0
  508. package/src/protocol/errors.ts +78 -20
  509. package/src/protocol/execution.ts +5 -2
  510. package/src/protocol/factories.ts +55 -7
  511. package/src/protocol/guards.ts +55 -2
  512. package/src/protocol/harness.ts +56 -6
  513. package/src/protocol/history.ts +275 -0
  514. package/src/protocol/ids.ts +4 -17
  515. package/src/protocol/index.ts +10 -0
  516. package/src/protocol/lifecycle.ts +250 -79
  517. package/src/protocol/meta-keys.ts +17 -0
  518. package/src/protocol/meta.ts +3 -3
  519. package/src/protocol/models.ts +2 -43
  520. package/src/protocol/part-input.ts +2 -1
  521. package/src/protocol/parts.ts +12 -3
  522. package/src/protocol/reduce.ts +302 -413
  523. package/src/protocol/selectors.ts +1 -20
  524. package/src/protocol/seq-cursor.ts +14 -0
  525. package/src/protocol/stop-reasons.ts +1 -1
  526. package/src/protocol/thinking.ts +1 -30
  527. package/src/protocol/time.ts +2 -2
  528. package/src/protocol/tool-closure.ts +93 -0
  529. package/src/protocol/tool-state.ts +19 -4
  530. package/src/protocol/verify.ts +222 -92
  531. package/src/protocol/vocabulary.ts +21 -5
  532. package/src/protocol/wire-api.ts +232 -0
  533. package/src/protocol/wire.ts +425 -57
  534. package/src/server/acp/binding.ts +63 -103
  535. package/src/server/acp/session-records.ts +53 -0
  536. package/src/server/acp/translate.ts +129 -20
  537. package/src/server/agent-server.ts +275 -366
  538. package/src/server/bin.ts +295 -72
  539. package/src/server/feedback.ts +204 -14
  540. package/src/server/history.ts +160 -0
  541. package/src/server/index.ts +4 -8
  542. package/src/server/install.ts +107 -8
  543. package/src/server/open-parts.ts +95 -0
  544. package/src/server/routes.ts +391 -0
  545. package/src/server/secrets.ts +24 -0
  546. package/src/server/session-gate.ts +69 -0
  547. package/src/server/session-log.ts +14 -2
  548. package/src/server/session-store.ts +289 -0
  549. package/src/server/subscriptions.ts +232 -0
  550. package/src/server/transports.ts +125 -25
  551. package/src/server/wire-error.ts +38 -0
  552. package/src/sync/event-log.ts +160 -0
  553. package/src/sync/fit.ts +140 -0
  554. package/src/sync/history-reader.ts +57 -0
  555. package/src/sync/history-sqlite.ts +339 -0
  556. package/src/sync/history.ts +220 -0
  557. package/src/sync/index.ts +18 -0
  558. package/src/sync/journal-sqlite.ts +439 -0
  559. package/src/sync/journal.ts +132 -0
  560. package/src/sync/live-tails.ts +107 -0
  561. package/src/sync/node-sqlite.ts +20 -0
  562. package/src/sync/projection.ts +35 -0
  563. package/src/sync/recovery.ts +141 -0
  564. package/src/sync/retry.ts +49 -0
  565. package/src/sync/schema.ts +77 -0
  566. package/src/sync/sql.ts +106 -0
  567. package/src/sync/sqlite-file.ts +38 -0
  568. package/src/sync/sqlite.ts +21 -0
  569. package/src/sync/worker.ts +259 -0
  570. package/docs/rfds/0001-deterministic-echo-ids.md +0 -44
  571. package/docs/rfds/0002-native-subagents.md +0 -197
  572. package/src/core/agents/claude-code/generator-session.ts +0 -572
  573. package/src/core/agents/claude-code/session-manager.ts +0 -166
  574. package/src/core/agents/codex-app-server/codex-app-server-agent.ts +0 -962
  575. package/src/core/agents/codex-items.ts +0 -149
  576. package/src/core/agents/codex-sdk/adapter.ts +0 -237
  577. package/src/core/agents/codex-sdk/codex-sdk-agent.ts +0 -330
  578. package/src/core/agents/tool-meta.ts +0 -68
package/CHANGELOG.md CHANGED
@@ -1,5 +1,1065 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.19
4
+
5
+ Breaking since 0.3.18:
6
+
7
+ - Each harness's login is the engine's to read and to run, through its CLI
8
+ (LLP 0011; LLP 0001, D19). New on the wire: `auth/status`, `auth/login`
9
+ (answered as soon as the CLI says where to sign in, within 20 s),
10
+ `auth/complete`, `auth/cancel`, `auth/logout`, the `auth/updated`
11
+ notification to every connection (a login's end always comes with the
12
+ harness's login after it, as `auth/complete` answers it) and the
13
+ `unknownLogin` error; in the runtime `authStatus()` / `login()` /
14
+ `completeLogin()` / `cancelLogin()` / `logout()` / `onAuthUpdated()`; in
15
+ the client `authStatus()` / `login()` (a `LoginHandle` whose `done`
16
+ settles with the login's end, a `LoginError` when it did not succeed,
17
+ `disconnected` when the connection dropped first) / `logout()` /
18
+ `onAuthUpdated()`. Status is what the CLI says for the store and
19
+ environment a turn with the same `env` uses (`claude auth status --json`,
20
+ Codex's `account/read`), including an environment credential that wins
21
+ over the login. Logins are the CLI's own: Claude's subscription or Console
22
+ over the SDK's control channel (a `url` on this machine, or a `codeUrl`
23
+ and `auth/complete` from another device), Codex's ChatGPT browser or
24
+ device-code login and API key. A login change starts each session's next
25
+ turn on a new CLI, which resumes its conversation. One account shape
26
+ serves every login: `AccountInfo` (`provider`, `email`, `organization`,
27
+ `plan`), the kind of `credential` (`subscription`, `api_key`, `cloud`),
28
+ its `source` (`login`, `environment`, `settings`, `product`), a `label`
29
+ the engine makes (`accountLabel`: "Claude Max", "ChatGPT Pro", "OpenAI API
30
+ key") and `expiresAt`. Each method says what its login makes
31
+ (`AuthMethod.credential`), and `signedInBy(auth, method)` whether the CLI
32
+ is signed in that way already, so a product picks up a login the user
33
+ made and opens nothing. Harnesses take part by `Agent.login`
34
+ (`CliLogin`: `methods`, `status`, `start`, `logout`) and
35
+ `Agent.loginChanged`. The CLI has `/auth`, `/login` (which picks up a
36
+ login already made) and `/logout`. **A Codex turn whose key the API
37
+ refused now ends `auth`, not `network`** (Codex reports it as a failed
38
+ connection with HTTP 401).
39
+ - A login the product holds reaches each turn through the engine (LLP 0012;
40
+ LLP 0001, D20). New `@zvada/agent-server/accounts`, which needs only
41
+ `fetch` and Web Crypto (a Worker runs it): `startChatGptLogin` /
42
+ `pollChatGptLogin` / `refreshChatGptGrant` (ChatGPT's device sign-in and
43
+ renewal), `startClaudeLogin` / `completeClaudeLogin` (a one-year Claude
44
+ token, its code pasted back), `checkCredential` / `pastedGrant`,
45
+ `createCredentialHandler` (a product's credential endpoint, through which
46
+ an `AccountError` reaches the turn in the product's own words),
47
+ `credentialsFrom` (its `resolve` over the product's `GrantStore`: one
48
+ renewal at a time, written back; a refused credential nothing renews asks
49
+ for the person) and `AccountError`. New protocol types: `HarnessCredential`
50
+ and what each harness runs on (`ClaudeCredential`, `CodexCredential`,
51
+ `credentialRunsOn`), `CredentialGrant` (an `AccountInfo` with its
52
+ credential) and `grantAuth` (what to show of it, as a `HarnessAuth`),
53
+ `CredentialRequest`, `CredentialAnswer`, `tokenDigest` and
54
+ `pastedSignInCode`. `createAgentRuntime({ credentials })` takes a
55
+ `CredentialSource`, `(request, signal) =>`, for both harnesses, asked before
56
+ each turn with its id and again with a refused token's digest; a
57
+ credential the harness cannot run fails the turn. Claude Code runs through
58
+ the engine's own loopback proxy (a placeholder in the CLI's environment,
59
+ the credential held while a turn runs, a 401 renewed and retried), Codex
60
+ on `chatgptAuthTokens` in memory. `credentialsFromUrl` and the bin's
61
+ `--credentials-url` (its token in `$AGENT_SERVER_CREDENTIALS_TOKEN`) ask a
62
+ product's endpoint. The Anthropic proxy takes `renew`, which answers the
63
+ fresher entry. **Codex's `codexAppServer.resolveAuth` is gone:** hand
64
+ either harness its login with `credentials`; `CodexAppServerAuth`,
65
+ `CodexChatGptAuth` and `CodexChatGptAuthTokens` are no longer exported. A
66
+ source that answers none runs the turn as without it (its own `apiKey`,
67
+ else the CLI's own login).
68
+ - The engine installs the agent CLIs it runs from builds this release pins,
69
+ ahead of a turn and visibly (LLP 0010; LLP 0001, D18). **Trust no longer
70
+ rests on the registry:** `releases.ts` (generated by
71
+ `bun run releases:refresh`, which verifies Anthropic's signed release
72
+ manifest) holds every platform's npm integrity for the pinned versions and
73
+ Claude's binary sha256, so a mirror (`$AGENT_SERVER_NPM_REGISTRY`) that
74
+ serves another build is refused before it downloads, and a Claude binary
75
+ that is not the one Anthropic signed is never installed; a version the
76
+ table does not pin (an operator's `pins`) is checked against the installed
77
+ Claude SDK's manifest or the registry alone, and says so once. **A bundled
78
+ Claude SDK's version is the host's to say:** inside a consumer's ESM bundle
79
+ the provisioner searched for the SDK from the working folder, and ran the
80
+ CLI of whatever SDK the user's project held; it now runs agent-server's pin
81
+ and says once that a product that bundles the SDK sets
82
+ `provision.pins.claude` to its version. **`auto` no longer runs a `codex`
83
+ from `PATH`** (it may be another app's private copy, of another version):
84
+ an installed `@openai/codex` package still runs, a `PATH` build only in
85
+ `system` mode. **`ResolvedCli.source` may be `bundled`**, and
86
+ `InstallOptions.createProvisioner` takes the platform and must return
87
+ `prune`; `runInstall` results name their `platform`. New:
88
+ `CliProvisioner.status()` / `observe()` / `prune()`,
89
+ `runtime.listClis()` / `prepareClis()` / `onCliProgress()` and the wire's
90
+ `clis/list`, `clis/prepare` (answered at once, as an install outlasts a
91
+ request's timeout) and the `clis/progress` notification to every connection
92
+ (at most four a second), with `client.listClis()` / `prepareClis()` (which
93
+ waits for the installs, across a redial) / `onCliProgress()`, so a product
94
+ installs at setup and shows the download instead of a first turn that
95
+ waits silently; a download's errors, in a turn's error as in `clis/*`,
96
+ carry URLs without credentials or query. `ProvisionOptions.bundleDirs` (and
97
+ `$AGENT_SERVER_BUNDLE_DIR`) for CLIs an app or image ships, staged by
98
+ `agent-server install --platform <a,b> --dir <path>` from any machine into
99
+ a new or empty folder, the builds opened to every user; a prune after each
100
+ download removes builds whose recorded use is 14 days old, and
101
+ `install --prune` also those no use was recorded for (0.3.18 records none);
102
+ a staged build is opened before its rename, so a 002 umask no longer gets
103
+ it refused as writable by others; a request without a response
104
+ (headers or body) within 30 s, a download that receives nothing for 30 s,
105
+ or a `tar` still running after 5 min fails instead of hanging the turn; a
106
+ cached build removed under a running process is installed again.
107
+ `AgentRegistry` takes the provisioner as an optional second argument, and
108
+ managed Claude processes run with `DISABLE_AUTOUPDATER=1`. The CLI says a
109
+ download's start, quarters and end for its own server or one it connects
110
+ to, and `/info` shows the session harness's CLI.
111
+ - A listener answers native clients only, and needs a token beyond loopback
112
+ (LLP 0001, D16). `listen` accepted every upgrade, and a browser lets any
113
+ page open a WebSocket to localhost, so any website a user visited while
114
+ `agent-server --listen 4747` ran could start a turn with
115
+ `bypass_permissions` there. **A browser client of `listen` must now be
116
+ allowlisted:** an upgrade with an `Origin` header, `null` included, is
117
+ refused 403 unless `ListenOptions.allowedOrigins` (the bin's repeatable
118
+ `--allow-origin`) holds it exactly, as `scheme://host[:port]`; a native
119
+ client sends none. **A listener beyond loopback needs a token:**
120
+ `ListenOptions.token` (`--token-file <path>` or `$AGENT_SERVER_TOKEN`)
121
+ requires `Authorization: Bearer <token>` of every upgrade, compared in
122
+ constant time, else 401, and `listen` refuses a host other than
123
+ 127.0.0.0/8, `::1` or `localhost` without one, as `docs/deploy.md`'s Docker
124
+ example on `0.0.0.0` was (it throws an `Error` whose `code` says which
125
+ option it refuses: `tokenRequired`, `emptyToken` or `invalidOrigin`). The bin refuses `--token` (`ps` shows argv) and
126
+ warns when others can read the token file. `AgentServerClient.connect(url,
127
+ {token})` (`ConnectOptions`) sends it with every dial, redials included,
128
+ and the CLI's `--connect` takes it from `$AGENT_SERVER_TOKEN`.
129
+ `dial(server, url, {headers})` and `connectTransport(url, headers)` send
130
+ headers with the upgrade, so a credential stays out of the URL, and the
131
+ bin's `--dial` sends `$AGENT_SERVER_DIAL_TOKEN`, when set, as
132
+ `Authorization: Bearer` on every dial (never from argv): the credential it
133
+ presents to the platform it dials. **A refused client is told so, and not
134
+ redialed:** neither Bun's nor Node's WebSocket says why a handshake failed,
135
+ so a dial that fails asks once with a plain request carrying the same
136
+ headers, which `listen` answers 401 before its 426. Only a 401 is a
137
+ refusal: `listen` answers 403 only for an `Origin`, which a native client
138
+ never sends, so a 403 comes from something in front of the server, and the
139
+ client redials on. `connect` rejects with `ConnectionRefusedError`
140
+ (exported from `./client`, a `ConnectionClosedError`; `reason`
141
+ `token_refused` when it sent a token, `token_required` when not), and a
142
+ reconnecting client whose redial is refused stops, reports `refused` then
143
+ `closed` through `onConnection`, and fails what waits with it. The CLI says
144
+ which token to set (`$AGENT_SERVER_TOKEN`) and exits 2 instead of
145
+ redialing. stdio is unchanged, and so is dial-out without a dial token.
146
+
147
+ - What a turn loads by itself is the operator's choice (LLP 0001, D17):
148
+ `inheritConfig: "all" | "project" | "none"` on `CreateRegistryOptions` (so
149
+ `createAgentRuntime`), `--inherit-config` on the bin and the CLI, and
150
+ `InheritConfig`, `INHERIT_CONFIGS` and `isInheritConfig` in `./core`. It
151
+ decides the settings, MCP servers, hooks and memory a turn picks up from the
152
+ host user and the repository, never what the agent may do. `all`, the
153
+ default, is what turns loaded before, with Claude's `settingSources` now
154
+ named explicitly (`["user", "project", "local"]`). `project` runs Claude on
155
+ the repository's settings only (`["project"]`), `none` on none (`[]` with
156
+ `strictMcpConfig`; the turn's MCP servers still attach), and below `all` the
157
+ user's auto-memory and the account's claude.ai connectors stay off whatever
158
+ the host's or the turn's environment says. Below `all` every Codex turn must
159
+ name a `CODEX_HOME` of its session's own (absolute, not the shared one, one
160
+ session to a home), else it fails `invalid_request` before Codex starts;
161
+ `none` also keeps the repository's `AGENTS.md` out (`project_doc_max_bytes =
162
+ 0` on `thread/start` and `thread/resume`). `claudeCode.sdkOptions` may still
163
+ name `settingSources` itself. Claude's model listing loads what a turn at
164
+ the operator's level would. The bin refuses `--acp --harness
165
+ codex-app-server` below `all`, since an ACP client names no Codex home; the
166
+ CLI refuses `--inherit-config` with `--connect` (the server decides) and says
167
+ up front that Codex below `all` needs `--codex-home`. ACP agents are
168
+ unchanged: their launch command decides.
169
+
170
+ - A `disableTools` Claude turn (the CLI's `--no-tools`) no longer loads the
171
+ auto-memory Claude keeps for the repository: it runs at `inheritConfig:
172
+ "none"` whatever the option, which sets `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1`.
173
+ Its `settingSources: []` kept every settings source out, but not the memory.
174
+
175
+ - Wire protocol 6 (LLP 0008, decision 10): a turn's subscription ends with
176
+ the turn. `turn/start` subscribes its caller to the turn until its
177
+ `turn.ended`, unless the connection watches the session;
178
+ `session/subscribe {sessionId}` watches a session until
179
+ `session/unsubscribe` (which ends the watch only), its end or the
180
+ connection's close, and `session/subscribe {sessionId, turnId}` follows a
181
+ running turn, uncounted, to its end. `onEvent` delivers a session's events
182
+ while it is watched or one of this client's turns runs in it: code that
183
+ heard a session after its own turn ended calls `subscribe` (the CLI
184
+ watches the session it is in). The client lets a session go when its turn
185
+ ends unless it watches it, and after a redial subscribes its running turns
186
+ first, then its watches; a refusal fails the session's turns
187
+ (`EventGapError`, gap reason `subscription_refused` or `session_missing`)
188
+ where a client that had run turns in more sessions than
189
+ `maxSubscriptions`, then redialed, waited on its running turn forever. A
190
+ turn the re-subscription's answer says runs no more ended by its
191
+ `headSeq`: the client replays up to there and lets the session go unless
192
+ it watches it, where a turn whose `turn.ended` the window had evicted kept
193
+ its session followed, subscribed again on every redial, its `onEvent`
194
+ hearing other clients' turns there.
195
+ `steerTurn` follows the turn it steers instead of watching the session.
196
+ `session/subscribe` takes no `afterSeq`, which the server never read: a
197
+ client catches up with `events/replay` (`subscribe(sessionId, {afterSeq})`
198
+ does). Every session is a pair of methods of its own,
199
+ `session/subscribeAll` (answering `{sessions}`) and
200
+ `session/unsubscribeAll`, in place of protocol 5's `{all: true}` params,
201
+ whose answers each side narrowed by hand. A peer of protocol 5 is refused
202
+ at `initialize`.
203
+ - The wire's requests are one table, `WIRE_API` (root and `/protocol`): each
204
+ method's params schema, result schema and the decoder a client reads its
205
+ answer with (tolerant for `events/replay` and `models/list`), with the
206
+ types `WireRequestMethod`, `WireParams`, `WireParsedParams`, `WireResult`
207
+ and `WireDecodedResult`, and `isWireRequestMethod`. The server parses a
208
+ request's params with it once (`history/list` still authorizes first), and
209
+ every client request is typed by its method. `WIRE_REFUSAL_DATA` says what
210
+ each refusal carries in `data` (`resumeRequired` its `nativeSessionId`,
211
+ `recoveryRequired` its `headSeq` and `reason`, `turnConflict`,
212
+ `turnActive`, `subscriptionLimit`, …); `refusalData(error, name)` in
213
+ `/client` (and `readRefusalData` in `/protocol`) reads it, undefined for
214
+ another refusal or malformed data.
215
+ - A turn the server admitted and the runtime refused before it started (it
216
+ was shutting down, or the harness could not be set up) ends after a
217
+ `turn.started` the server synthesizes, so its stream holds the contract
218
+ (`turn-ended-pairs`), and the `turn.ended` the server synthesizes for a run
219
+ that threw carries its readable message (`errorInfo`), as every other
220
+ failure does.
221
+ - `runTurn(params, {signal})` stops following its turn when the signal
222
+ aborts, as `joinTurn`'s signal does: the handle's `events` and `result`
223
+ fail with an `AbortError`, the turn runs on (`cancelTurn` stops it), and
224
+ `onEvent` still hears it to its end. `replayAll(sessionId, fromSeq,
225
+ throughSeq?)` reads every page `events/replay` answers (`replay` is one
226
+ page), failing `EventGapError` when some were evicted.
227
+ - `channelPair()` (root and `/protocol`) is the in-process wire: two
228
+ transports wired to each other, one for an `AgentServer` to attach and one
229
+ for `AgentServerClient.attach`, with `kill()` to drop the connection.
230
+ - A client receives the sessions it subscribes to, not every session on the
231
+ server (wire protocol 5, LLP 0008): an idle CLI downloaded 342 KB of another
232
+ session's history during a one-word turn, and now receives nothing but its
233
+ `initialize` answer. `session/subscribe {sessionId}` answers the
234
+ subscription point (`headSeq`, `firstAvailableSeq`, the turn it runs) and
235
+ streams every frame after it; `{all: true}` is every session, live from
236
+ then, for observers; `session/unsubscribe` stops. `turn/start` subscribes
237
+ its caller from the head at admission (`subscribe: false` declines), and
238
+ its ack carries `headSeq`, plus `startedSeq` for a retried start of a
239
+ running turn and `terminal` for one that ended, volatile ones included. A
240
+ closed session's subscriptions end with its `session.ended`, and a
241
+ connection's with the connection. A peer of protocol 4 is refused at
242
+ `initialize`.
243
+ - Joining a running turn receives its open parts at once: after a
244
+ subscription's answer, each streaming part comes as one `message.part`
245
+ frame with its content so far (`live: true`, at the head seq), so a client
246
+ that joins mid-answer no longer waits for a snapshot. Measured on a real
247
+ Claude turn, a client joining mid-answer downloaded 11.4 KB of catch-up
248
+ (the turn's kept events to the join, 6.7 KB, and its open part, 4.5 KB),
249
+ where it downloaded 34 KB with the SDK's `watch` and 68 KB with the CLI's
250
+ reopen; a reopened CLI downloads the transcript once (55 KB for a turn
251
+ where it downloaded 679 KB).
252
+ - Client: `subscribe`, `unsubscribe`, `subscribeAll`, `unsubscribeAll` and
253
+ `joinTurn(sessionId, {fromSeq, signal})` (a handle per join, each event
254
+ once; `TurnHandle.catchUp` counts the replayed ones). `watch` is removed:
255
+ use `subscribe(sessionId, {afterSeq})`. `onEvent` delivers the sessions the
256
+ client follows (`AgentServer.onEvent` still sees every one). `runTurn`'s
257
+ handle starts at its own `turn.started` and downloads none of the
258
+ session's history. The client subscribes again after a redial and on
259
+ `session/overflow`, and `steerTurn` subscribes to a session it does not
260
+ follow before it steers. `client.ts` is split by concern (`rpc`,
261
+ `connection`, `streams`, `turns`, `listeners`); `request.ts` became `rpc.ts`.
262
+ - A connection that falls `maxBacklogBytes` (16 MiB) behind stops receiving
263
+ the session it fell behind on: the server sends `session/overflow
264
+ {sessionId, lastSeq}` (or `{all: true}`) and drops the subscription, and the
265
+ client subscribes again from what it holds. Responses are never dropped.
266
+ `WireTransport.bufferedAmount?()` reports the backlog (Bun's server socket,
267
+ a dialing socket, stdio's `writableLength`). A connection may ask to watch
268
+ at most `maxSubscriptions` sessions (256; `{all: true}` counts once), past
269
+ which `session/subscribe` is refused `subscriptionLimit` (-32014,
270
+ `data.limit`). The sessions its own turns subscribe it to never count, so a
271
+ connection that runs the turns of every session (a product backend) is
272
+ never refused one.
273
+ - `isLiveEnvelope(envelope)` (zod-free, in `/protocol/guards`) tells every
274
+ live frame, a delta or an open part; `isLiveOnlyEvent(event)` no longer
275
+ does. `verifyStreamContract` takes `live` beside `seqs`, and `seq-live`
276
+ covers every live frame. `extendPart(part, delta)` applies a delta as the
277
+ engine, the server and the reducer all do; the reducer now extends a pending
278
+ tool's `partialInput` with its input deltas, and keeps `toolInputJson` to a
279
+ pending snapshot's streamed input.
280
+ - Journal schema 6: a schema-5 file is refused, never migrated. A streaming
281
+ part's tail is a row per delta in `live_tails`, deleted with the part's next
282
+ kept snapshot or its turn's end, and recovery joins a part's rows in order:
283
+ with no checkpoints the tail is the whole part, and rewriting it per delta
284
+ grew with the square of its length (250 MB written for a 100 KB tool input,
285
+ where an appended row costs a flat 14 µs).
286
+
287
+ - A native agent no longer outlives its server (LLP 0007). Every CLI a
288
+ harness starts leads a session and process group of its own, is held by the
289
+ OS process's lifeline (a `/bin/sh` that stops what it holds when the server
290
+ dies in any way, SIGKILL included) and is stopped with the tool sessions
291
+ under it: SIGTERM, then SIGKILL after 3 s. Before, a SIGKILLed server's
292
+ Claude CLI ran 30.5 s more and finished its tool, and a SIGKILLed Codex
293
+ app-server's command ran on 27.1 s; live, they were now gone 2.7 s and
294
+ 0.15 s after the kill. Claude runs through the SDK's
295
+ `spawnClaudeCodeProcess`, with the CLI's stderr put back into the SDK's exit
296
+ error (the SDK no longer adds its own `--debug-file`; pass `debugFile`); an
297
+ operator `spawnClaudeCodeProcess` in `sdkOptions` still wins, and its
298
+ session's process is then the host's. `createAgentRuntime({nativeProcesses:
299
+ {lifeline?, graceMs?, onRecord?}})` configures it; `runtime.shutdown()` now
300
+ also stops what the runtime spawned before it settles, so a `shutdown`
301
+ request is answered once they are gone. New: `NativeProcesses`,
302
+ `runtime.onNativeProcess`, `runtime.stopOrphans(records)`,
303
+ `runtime.recordedHarnesses()`, `AgentRegistry.processes` and the optional
304
+ `Agent.processes`.
305
+ - An agent's stderr no longer carries its secrets into an exit error, which
306
+ reaches `turn.ended.error.message`, the journal and the logs: Claude's,
307
+ Codex's and ACP's tails are redacted (`redactSecrets`: Anthropic and OpenAI
308
+ keys, JWTs, `Bearer`/`Basic` credentials, AWS access keys, URL credentials,
309
+ and what is assigned to a key, token, secret or password become
310
+ `[REDACTED]`), before they are cut to size.
311
+ - Journal schema 5: a schema-4 file is refused, never migrated. It keeps the
312
+ native processes its owners started (`native_processes`) and why a fence
313
+ could not be lifted (`sessions.recovery_reason`). The port gains
314
+ `recordNative`, `forgetNative` and `nativeProcesses`, which every
315
+ `SessionJournal` must now implement (a custom journal adds them, as the
316
+ SQLite journals have), and `claim(options?)` takes the restart sweep's
317
+ result.
318
+ - `await AgentServer.open(runtime, options)` replaces `new AgentServer` for a
319
+ journal server: before it claims the journal it verifies each recorded
320
+ process (boot, start time, executable) and stops those still running, so a
321
+ session a restart cut off is fenced only when its agent could not be
322
+ confirmed stopped. The constructor still works and fences every such
323
+ session. `recoveryRequired`'s data and `DurableSession` carry the reason
324
+ (`recoveryReason`: `not_owned`, `not_verified`, `not_stopped`), and the
325
+ interrupted turn's `server_restart` message says whether its agent was
326
+ stopped. The bin and the CLI's `--journal` mode use `open`; the bin also
327
+ shuts down on SIGHUP. A CLI session whose agent was stopped runs its next
328
+ turn without `/recover`.
329
+
330
+ - `AgentRuntime.run` checks its request with `RunRequestSchema` and rejects
331
+ one the schema refuses with the new `InvalidRequestError` (code
332
+ `invalidParams`, category `invalid_request`), before admitting it and
333
+ without remembering it. An out-of-range `requestTimeoutMs` was clamped to a
334
+ timer's limit, or ignored when not positive, and an empty `resumeSessionId`
335
+ was refused only once a built-in harness executed the turn; both are now
336
+ refused. The wire refused all of them already.
337
+ - A turn ends `cancelled` because a cancel was asked for (`runtime.cancel`,
338
+ `closeSession`, the run's signal, shutdown), not because of what an error
339
+ says: an error a harness throws once asked to stop ends the turn
340
+ `cancelled`, whatever its words, and an abort a harness throws unasked
341
+ (an `AbortError`, "Request interrupted") fails the turn, as category
342
+ `abort`. A harness that stops a turn itself says so in its adapter's
343
+ `cancelled`, as the built-in ones do.
344
+ - `AgentExecuteOptions` is the turn's `RunConfig` without what the engine
345
+ handles itself (`harness`, `elicitation`, `requestTimeoutMs`, `includeRaw`),
346
+ plus its callbacks: a field the request leaves out is now absent from the
347
+ options, not present as `undefined`.
348
+ - New: `errorInfo(error, typedCategory?)` in the protocol, the one mapping
349
+ from a failure to the `ErrorInfo` the stream carries.
350
+
351
+ - Wire protocol 4, one vocabulary: every wire value is snake_case, and every
352
+ name says the same thing on the wire and in process. A 3 peer is refused at
353
+ `initialize` (`protocolVersionMismatch`), never half served. To migrate:
354
+ - the reducer's `ConversationChange.kind` values are snake_case
355
+ (`part-upserted` → `part_upserted`, `turn-updated` → `turn_updated`,
356
+ `usage-updated` → `usage_updated`, and so on for all thirteen);
357
+ - `AgentCapabilities.modelSwitch` is `in_session` / `restart_session`
358
+ (was `in-session` / `restart-session`), and is an open vocabulary: treat a
359
+ mode you do not know as `unsupported`. The compiler no longer catches the
360
+ old spelling in a harness you wrote: search for `in-session`;
361
+ - the `_meta` keys the engine writes are `agent-server/<name>`: a user
362
+ message's echoed text elements are `_meta["agent-server/elements"]` (was
363
+ `_meta.elements`), and the ACP binding's turn failure is
364
+ `_meta["agent-server/error"]` (was `zvada.dev/error`); `META_KEYS` names
365
+ them all, and replaces `PARTIAL_INPUT_META_KEY`. Journals and histories
366
+ written before keep the old key (and `session.ended {reason: "released"}`):
367
+ read both while you hold them;
368
+ - `history/pull` is `history/read` (the `HistoryApi.read` it serves), and
369
+ `HistoryPull`/`HistoryPullSchema` are `HistoryRead`/`HistoryReadSchema`;
370
+ - a refusal names the wire error it answers with: `HistoryError.code` is
371
+ `unknownHistory`, `historyConflict`, `notAuthorized` or `invalidParams`
372
+ (was `.reason`: `missing`, `conflict`, `unauthorized`, `invalid`), and a
373
+ `JournalError` that was `staleHead` is `historyConflict`, one that was
374
+ `invalidRecord` or `recordTooLarge` is `invalidParams`. Both extend the
375
+ new `WireRefusal`; `HISTORY_ERROR_CODES` is gone (`isHistoryRefusal` and
376
+ `wireErrorName` replace it);
377
+ - `turn/get` for a turn its known session never admitted answers
378
+ `unknownTurn` (new, -32013), and `unknownSession` only when the server
379
+ does not hold the session: a caller that read `unknownSession` as "not
380
+ admitted" reads `unknownTurn`;
381
+ - the engine's error codes are camelCase (`turnConflict`, `turnActive`,
382
+ `agentExited`, `unsupportedAttachment`, `resumeFailed`, `mcpUnavailable`,
383
+ `cliNotFound`, `cliProvisionFailed`), and `HarnessNotFoundError` is
384
+ `HarnessNotAvailableError` (`harnessNotAvailable`, the wire's name for the
385
+ same refusal). An engine error whose code the wire names answers as that
386
+ refusal. The typed errors that always mean one thing carry their
387
+ `category`, and `classifyError` reads it before the message: a turn
388
+ conflict and an unknown harness are now `invalid_request` (were
389
+ `internal`); a missing or unprovisionable CLI is still classified by its
390
+ message;
391
+ - `session.ended.reason` is `closed`, the one reason the stream carries
392
+ (was `released`); Claude's `onSessionEnd` keeps its own reasons;
393
+ - `STANDARD_PERMISSION_OPTIONS`, `isAllowKind` and `isRejectKind` are
394
+ exported from the protocol (zod-free, in `/protocol/guards`). Only
395
+ `allow_once` and `allow_always` approve: the reducer counted an unknown
396
+ `allow_*` kind as an approval. A tool whose approval got an answer this
397
+ build cannot read is closed with its outcome unknown, never as "never ran";
398
+ - `openVocabulary(known)` takes the values the vocabulary knows (was
399
+ `openVocabulary<T>()`); `knownValues(schema)` returns them;
400
+ - removed: `isRecoverable` (unused), the `ModelsQuery` alias (use
401
+ `ModelsListParams`), and the `EventProcessor` export (internal).
402
+ - A tool the engine closed `failed` says how in `closure`: `never_ran`,
403
+ `outcome_unknown` or `interrupted` (`TOOL_CLOSURES`, an open vocabulary;
404
+ read one you do not know as an outcome unknown), absent when the harness
405
+ reported the failure. Match on it rather than on the `error` sentence, which
406
+ stays for the model and the user. `/sync`'s `INTERRUPTED_TOOL_ERROR` is
407
+ `TOOL_INTERRUPTED`, exported from the protocol beside `TOOL_OUTCOME_UNKNOWN`
408
+ and `TOOL_NEVER_RAN`, words unchanged; `closeToolLeftOpen` is the one
409
+ function the reducer and crash recovery close tools with. A Codex command
410
+ whose stop could not be confirmed fails with `TOOL_OUTCOME_UNKNOWN` from its
411
+ harness, so without a `closure`.
412
+ - A turn a server restart cut off ends `error` with the new category
413
+ `server_restart` (was `internal`): a client tells a restart from a failure
414
+ without matching its message.
415
+ - A `SessionJournal` implements `keepTail` and `releaseNative`, which were
416
+ optional; a server without a journal is the only one that answers
417
+ `session/release` with `methodNotFound`.
418
+ - The `/sync` helpers refuse a peer's answer they cannot trust with a
419
+ `HistoryError`, where they threw a plain `Error`: `historyConflict` for a
420
+ page that does not match the requested prefix or revision, or an import
421
+ receipt for another version; `invalidParams` for a head of another
422
+ history, an ancestry cycle (or more than 64 ancestors), or a checkpoint
423
+ outside the requested history or over the byte limit. A retry policy that
424
+ never retries a `HistoryError` stops on them. `createCheckpoint` names an
425
+ invalid `maxRecords` as `openHistory` does.
426
+ - `reduceConversationWithChanges` reports one `part_upserted` for a tool's
427
+ open snapshot redelivered after its turn ended (it reported two): the
428
+ snapshot lands closed, as the turn's end closed it.
429
+ - `ContractViolation.rule` is a `ContractRule`, one of `CONTRACT_RULES` (the
430
+ ids LLP 0002 lists). `UnknownPartSchema` and `UnknownEventSchema` are
431
+ exported, beside their types.
432
+ - The ACP server binding's permission request names a `task` tool `other`, as
433
+ its tool updates do, and leaves out an option of a kind ACP cannot carry.
434
+ - The `codex-sdk` harness is gone; `codex-app-server` runs Codex. It streams
435
+ tokens, brokers approvals, attaches MCP servers, switches models without a
436
+ restart, and since this release maps a turn's `apiKey` and
437
+ `additionalDirectories` too, so codex-sdk offered nothing it lacked.
438
+ `@openai/codex-sdk` is no longer a peer dependency, and `codex-sdk` no longer
439
+ appears in `AgentHarness`, the catalog or `toolForHarness`. To migrate,
440
+ register `CodexAppServerAgent` and send `harness: "codex-app-server"`; a
441
+ thread `codex exec` created resumes there by the same thread id. Host
442
+ resolution now finds an installed `@openai/codex` package directly (a
443
+ lockfile can pin the CLI), then `codex` on PATH.
444
+ Approvals differ: codex-sdk never asked, while codex-app-server in `default`
445
+ mode asks through `permission.requested` for anything outside its read-only
446
+ sandbox, and waits for an answer. A host that never answers approvals runs
447
+ Codex in a mode that never asks: `bypass_permissions`, or `dont_ask`,
448
+ which since this release only reads.
449
+ - `dont_ask` on Codex runs read-only and writes nothing; it wrote inside its
450
+ workspace-write sandbox without asking. A host that used it so that Codex
451
+ edits unattended runs `bypass_permissions` instead, or `accept_edits` and
452
+ answers approvals.
453
+ - A Codex turn with `disableTools` fails as `invalid_request` instead of
454
+ running with every tool; send it with tools on.
455
+ - Removed exports, with what replaces them:
456
+ - root and `/protocol`: `MODEL_CATALOG`, `ModelInfo`, `modelsForHarness` and
457
+ `DEFAULT_MODELS` (use `CATALOG_MODELS`, `modelThinkingLevels` and
458
+ `runtime.models()`), `codexReasoningEffort`/`CodexReasoningEffort`,
459
+ `DEFAULT_THINKING_LEVEL`, `generateId` (use `generateUUIDv7`),
460
+ `timestampFromUUIDv7`, `toolResultText`, `Meta`, `EpochMs`, `WireMethod`,
461
+ `ShutdownParamsSchema`, `ModelsListResultSchema`;
462
+ - `/core`: `AgentExecutionError`, `CodexAppServerClient`, `AcpClient`,
463
+ `parseAcpLaunch`, the transformer classes (use the `create*Transformer`
464
+ factories), `emitDiagnostic`, `endedExecution`, `catalogModelList`,
465
+ `detectPlatform`;
466
+ - `/server`: `SessionLog`, `DEFAULT_BUFFER_SIZE`, `toolsFor`;
467
+ - `/sync`: `fitEvent`, `recordable`, `MAX_EVENT_BYTES`, `PAGE_SLACK_BYTES`,
468
+ `unrecordedEvent`, `interruptionFacts`.
469
+ - Tightened signatures: `BaseAgent.endTurn` requires its controller,
470
+ `ApiKeyStore.set` takes options and no string, an invalid wire message
471
+ carries `parseError`, and `client.history.checkpoint` throws instead of
472
+ returning `null` on a server without checkpoints.
473
+ - `AgentExecuteOptions.onElicitation` (`./core`) is `onElicitationRequest`,
474
+ named like `onPermissionRequest`: a custom harness that asks the user its
475
+ agent's questions reads it under the new name.
476
+ - Claude's raw passthrough (`includeRaw`, no stability promise under LLP
477
+ 0001 D6) carries the SDK's messages unmodified: a `result` no longer has
478
+ `turn_cost_usd`, `turn_usage` or `steers_pending` spliced in. What the
479
+ session adds is its own events, named as Codex's are:
480
+ `agentServer/querySettled` (`costUsd`, `usage`, `steersPending`) just before
481
+ the result it describes, `agentServer/steerRead` (was `steer_inserted`) and
482
+ `agentServer/turnInterrupted` (was `turn_interrupted`). The normalized
483
+ stream is unchanged.
484
+ - A Claude turn the runtime stops reading before its end (its transformer or
485
+ its sink failed) is stopped first: interrupted, and its process replaced
486
+ when Claude does not confirm within the interrupt timeout (2 s). Its
487
+ `turn.ended` comes after that, and a `turn/cancel` meanwhile still reaches
488
+ it; the next turn found the CLI still working and switched its model, mode
489
+ and MCP servers onto that turn.
490
+ - With no Claude turn running (a query Claude began itself), a tool call is
491
+ denied and Claude stopped, an MCP server's request for input is dismissed
492
+ (`cancel`), and a hook's `currentTurnId()` is undefined. They reached the
493
+ last turn's closed brokers, and a hook saw that turn's id.
494
+ - A Claude tool named like an object member (`constructor`) is kind `other`.
495
+ - `ClaudeCodeAgentOptions`, `ClaudeToolPolicy`, `ClaudeHooksFactory`,
496
+ `ClaudeSessionEndReason` and `ClaudeSessionExtras` (now a `Pick` of
497
+ `ClaudeCodeAgentOptions`) are exported from `./core` as before; only their
498
+ source module moved.
499
+ - History that 0.3.18's `/sync` kept, which holds token deltas, is refused like
500
+ a schema-2 journal: open it with the version that wrote it, or start anew.
501
+ - Claude runs each turn in the permission mode the turn asks for, switching
502
+ the live process to it. 0.3.18 restarted only when the requested mode
503
+ changed, so a mode Claude switched to by itself (an approved plan, Claude
504
+ entering plan mode) lasted while a client kept sending one mode; such a
505
+ client now brings Claude back to its mode on the next turn. Follow
506
+ `session.mode` (`state.permissionMode`) to stay with the agent, as the CLI
507
+ and the ACP server binding do.
508
+ - A brokered permission request offers an "always" option only when its
509
+ harness can scope one, and on Claude and Codex no "always reject": render the
510
+ request's `options` rather than assume the four standard ones. A client's
511
+ standard `allow_always` or `reject_always` for a request that does not offer
512
+ it means a plain allow or reject.
513
+ - An assistant `message.started` names the model that wrote it: Claude's API
514
+ model (it named the requested alias, `haiku`, while a plan turn ran
515
+ `claude-sonnet-5-5` and `claude-haiku-4-5-…`), a Claude sub-agent's own, and
516
+ on Codex the model the thread runs on, or was rerouted to (it named none
517
+ without a requested model). The requested model remains the fallback for a
518
+ harness that names none. A Claude message that arrives whole, without
519
+ streaming, opens its own wire message, and a Codex reroute mid-turn starts
520
+ a new one under the rerouted model. `AdapterEvent` (exported from `./core`)
521
+ gains a `model` kind, which an embedder's exhaustive switch over it must
522
+ handle.
523
+ - `RunConfig.requestTimeoutMs` lets a permission request or question wait at
524
+ most that long: unanswered, it is resolved as cancelled, as a cancel would
525
+ resolve it (`permission.resolved` / `elicitation.resolved` on the stream, and
526
+ a cancelled permission ends a Claude turn). A host no longer needs a timer of
527
+ its own; absent, a request waits until the turn ends, as before. It is at
528
+ most 2^31-1 ms (about 24.8 days), a timer's limit.
529
+ - A Codex turn whose approval is answered cancel ends `cancelled`: Codex stops
530
+ such a turn and reports it `interrupted`, which the engine reported as
531
+ `end_turn`. What the turn started is stopped then, as after the engine's own
532
+ cancel, so a `cancelled` tool did not go on running. A Codex plan whose
533
+ question is cancelled unanswered ends its turn `cancelled`, as on Claude; it
534
+ read as the user keeping planning. A command the plan turn left running
535
+ keeps running then, as it was left on purpose, and reads as outcome unknown
536
+ rather than `cancelled`; so does one when the engine's cancel comes while the
537
+ plan's question is open. A Codex turn reported `failed` without an
538
+ error now fails.
539
+ - The Codex harness is one module per concern (`codex-agent.ts`, `session.ts`,
540
+ `turn.ts`, `thread-settings.ts`, `requests.ts`, `commands.ts`, …).
541
+ `CodexAppServerAgentOptions.createClient` returns a `CodexConnection`, the
542
+ members the harness uses (exported from `./core`); a `CodexAppServerClient`
543
+ is one, so a factory that returns it is unchanged. Behaviour changes that
544
+ came with it:
545
+ - a managed turn's cleanup reads every page of a worker's background
546
+ terminals: one listed past the first page read as stopped, and the turn as
547
+ settled;
548
+ - a command whose stop a cancel could not confirm carries
549
+ `closure: "outcome_unknown"` on its failed state, as the reducer's own
550
+ closures do;
551
+ - a list Codex does not end (a cursor it gave before, or more pages than the
552
+ list's bound) means Codex cannot say: `model/list` past ten pages fails the
553
+ live list, where it kept the first ten;
554
+ - a turn cancelled before its `turn/start` leaves the thread's model and
555
+ effort as they were; the engine took them as the cancelled turn's;
556
+ - the client says `clientInfo.version` `0.0.0`, not a made-up `0.1.0`.
557
+ - Claude runs with background tasks and scheduled prompts off, and Codex
558
+ threads with goals off (LLP 0001, D14). Both let the agent work after its
559
+ turn ended: Claude answers a background task that finished with a query of
560
+ its own, and Codex starts turns by itself while a goal is active. No turn on
561
+ the stream showed that work, and a Claude turn sent meanwhile ended on the
562
+ wrong result (asked "Reply with exactly SECOND", it showed "Background task
563
+ completed" and lost its answer). Claude's Bash and subagents now run in the
564
+ foreground. An operator's or a turn's `env` can set
565
+ `CLAUDE_CODE_DISABLE_BACKGROUND_TASKS` or `CLAUDE_CODE_DISABLE_CRON` back to
566
+ `0` (background tasks stay off under `subagentMode: "turn"`), and so accepts
567
+ that what Claude does after a turn is not shown.
568
+ - An MCP server can be one a turn goes on without: `required: false` on its
569
+ `McpServerConfig` (LLP 0001, D15). One that cannot connect is said as a
570
+ recoverable `error` of the new category `mcp_unavailable`, with no `retry`,
571
+ and the turn goes on without its tools; a later turn connects it again once
572
+ 30 s have passed, and at once when its configuration changes or a turn
573
+ requires it. A required server (the default, as
574
+ before) that cannot connect still fails the turn before the model runs, now
575
+ as `mcp_unavailable` (it was `network` on Claude and `internal` on Codex)
576
+ with a message naming each server, its cause and the way out; Codex's cause
577
+ comes from its startup notification, where the message said only "server is
578
+ failed". A Codex server still starting after 30 seconds is named as one
579
+ that did not start, not "MCP startup timed out". Harnesses say such a
580
+ warning through `AgentExecuteOptions.onWarning`; `McpUnavailableError` is
581
+ exported from `./core`.
582
+
583
+ - A tool whose approval was asked for and never given (a crash at the
584
+ prompt, a rejection the harness never closed) fails as never run, not with
585
+ its outcome unknown. Crash recovery and the reducer close tools with one
586
+ rule now (`closeToolLeftOpen`); recovery said "outcome unknown" for a command
587
+ that never started.
588
+ - `canonicalHistoryJson` is `canonicalJson`, now the one canonical JSON: the
589
+ runtime's turn admission, the journal's fingerprint and the history hash
590
+ chain all use it (its output is unchanged, so stored versions still match).
591
+ - The server refuses every bad request one way (`WireError`); responses are
592
+ unchanged.
593
+ - A session-level error keeps its `retry` through a saved conversation:
594
+ `state.errors` entries had no `retry` in their schema, so
595
+ `ConversationStateSchema.parse` of a checkpoint dropped it. Turn and session
596
+ errors share `ErrorEntrySchema` now.
597
+ - `ClaudeCodeAgentOptions.idleTimeoutMs` sets how long an unused Claude
598
+ process lives (5 minutes by default), as the Codex and ACP options do.
599
+
600
+ - "Always allow" covers what the harness says it does, not every later call to
601
+ the tool: one "always" for `npm test` approved every Bash command after it,
602
+ with nothing on the stream (reported by AGNT). Claude and Codex keep
603
+ "always" themselves and the engine keeps no rule for them: Claude the rule
604
+ it suggests (`Bash(npm test *)`), for the session and never in settings
605
+ files; Codex its approval for the session (`acceptForSession`), the exact
606
+ command or a change's files. The always option names it, and there is no
607
+ "always reject" for them. A request the harness cannot scope offers none: a
608
+ Claude call with no suggestion, `suppressAlwaysAllowRule` or a matched ask
609
+ rule; a Codex network approval, or one asking extra permissions or a write
610
+ root. `onPermissionRequest`
611
+ takes `always: { rule } | null`; only a harness with no memory of its own
612
+ (ACP) leaves the engine its per-tool standing rule. A client's
613
+ `allow_always` for a request that offers none is a plain allow.
614
+ - A question the user skips is left out of Claude's answers instead of
615
+ answered with an empty string (a `null` too), and Claude and Codex tell the
616
+ agent the same thing when nobody can answer.
617
+ - A Claude turn ends on the result that answers it, one naming a message the
618
+ turn sent; a query Claude began itself (a finished background task) shows in
619
+ the turn it ran during and no longer ends it, nor does one between turns end
620
+ the session. A cancel drops the turn's messages Claude has not taken yet
621
+ (`command_lifecycle` names what it took), so a prompt waiting behind such a
622
+ query never runs. A permission request a client answers `cancelled` ends a
623
+ Claude turn `cancelled`, not `internal` ("error_during_execution"); one
624
+ Claude withdrew itself, a hook answering first, does not. The final context
625
+ gauge takes its size from the model in use, its `[1m]` variant included: one
626
+ Sonnet call made later Haiku turns read "/1000k".
627
+
628
+ - Findings of a live test of the Codex harness through the CLI:
629
+ - A cancelled Codex turn stops the command it was running. Codex 0.160 ends
630
+ a turn on `turn/interrupt` but keeps the command alive as a background
631
+ terminal, so a cancelled `sleep 6; touch after-cancel.txt` still created
632
+ the file, and Ctrl-C in the CLI left `sleep 17.3` running. The engine now
633
+ terminates the terminals the turn started
634
+ (`thread/backgroundTerminals/terminate`) and checks that they are gone
635
+ before the turn ends; when Codex cannot stop one, it ends the app-server,
636
+ whose shutdown stops them all (the next turn resumes the thread). A
637
+ command whose stop could not be confirmed fails with its outcome unknown
638
+ instead of reading as cancelled, and the cancel answers `unconfirmed`.
639
+ Only the terminals the turn started are terminated, never one it only
640
+ polled or wrote to, so terminals an earlier turn left running keep
641
+ running, unless the app-server has to be ended, which stops them all. A
642
+ cancel that comes after Codex's turn ended stops nothing, and a killed
643
+ command's late completion never reaches the next turn.
644
+ - A Codex command or patch the user declined fails, saying it was not
645
+ approved (`CODEX_COMMAND_DECLINED`, `CODEX_CHANGE_DECLINED`). Codex 0.160
646
+ completes it as `declined`, which the adapter read as completed: the CLI
647
+ printed `→ reject` and then `✔`. A completed patch's output names each
648
+ change as `update notes.md`; 0.160's change kind is an object, which
649
+ printed as `[object Object]`.
650
+ - Codex approvals show what they approve. A file change's `rawInput` was
651
+ `{}`; it now carries the change's `changes` (path, kind and diff of each
652
+ file, from the item Codex starts before it asks) and `locations`. An MCP
653
+ tool's consent carries the tool's arguments as its `rawInput`, as Claude's
654
+ do, where they were nested under `arguments`: read `rawInput` itself. The
655
+ CLI previews a patch's files with their added and removed lines, and an
656
+ approval prompt shows the whole command instead of its first 50
657
+ characters.
658
+ - A Codex turn that names no model or thinking level runs the thread's
659
+ defaults again. Codex keeps a turn's model and effort on the thread, and
660
+ the engine sent nothing for "default", so after `/model not-a-model-xyz`
661
+ every turn failed until a model was named, and `/thinking` after
662
+ `/thinking off` still ran `low`. The engine now sends the default back:
663
+ the model and effort the thread started with (`config.toml`, else Codex's
664
+ own), and with no effort configured the model's own default effort. A turn
665
+ that fails on a model it switched to puts the thread back on the model it
666
+ had (`thread/settings/update`), so a model the login cannot run no longer
667
+ sticks to the conversation, also for a later process that resumes it.
668
+ The session remembers its thread's defaults across processes (a
669
+ permission change starts a new one) until it is closed. Once an effort
670
+ was sent, even one fitted to a model a turn switched to, each later turn
671
+ that names no level works the default out for its own model, so going
672
+ back to the default model restores its effort too.
673
+ - A Codex turn with `disableTools` fails as `invalid_request` before Codex
674
+ starts (`CODEX_TOOLS_STAY`). Codex ignored it and ran `ls` under
675
+ `--no-tools`; the protocol said a read-only sandbox did the same, but that
676
+ sandbox still runs commands. With every feature that offers a tool turned
677
+ off, Codex 0.160 still gives the model its code-mode `exec`, `apply_patch`
678
+ inside it, its sub-agent tools and `request_user_input`, so no
679
+ configuration keeps it from acting. Send such a turn with tools on, in
680
+ `plan` or `default`. The harness scenarios, the live tests and the
681
+ durable drill's streaming scenario no longer ask Codex for it.
682
+ - `dont_ask` on Codex writes nothing. It ran in the workspace-write sandbox
683
+ with approvals off, so it wrote `d1.txt` without asking, where Claude
684
+ denies what was not approved and the protocol says unapproved tools are
685
+ denied. It now runs read-only: reads run, and Codex refuses every write,
686
+ which would need an approval. `accept_edits` keeps Codex's workspace-write
687
+ sandbox as its boundary (the folder, extra directories, `/tmp` and
688
+ `$TMPDIR`), where commands that write run unasked as well as edits;
689
+ harnesses.md now says so.
690
+ - Codex connects to a turn's MCP servers once per process instead of on
691
+ every turn. The engine's readiness check before each prompt asked Codex
692
+ for the status of every server, which makes Codex connect to each again
693
+ (`initialize`, `tools/list`), twice on a session's first turn. It now asks
694
+ for each requested server by name on the turn's thread, which Codex
695
+ answers from the thread's own connection: a scenario of nine turns sent
696
+ the server 3 initializations instead of 12.
697
+
698
+ - A client says what its connection does. `client.onConnection(handler)`
699
+ reports `disconnected`, `reconnecting` before each redial (`attempt`,
700
+ `delayMs`, and the `error` the one before failed with), `reconnected`
701
+ (`attempts`, `downMs`, the new `initialize`, and `serverChanged` when the
702
+ server behind the address no longer holds the logs the client followed:
703
+ another journal, none, or a volatile restart), and `closed`. A client that
704
+ gave up redialing closed in silence; its `closed` now says why ("reconnect
705
+ failed: …", also on the turns it fails). `maxReconnectAttempts: Infinity`
706
+ redials until `close()`, and `close()` ends a redial's backoff at once
707
+ instead of keeping the process alive through it. The repository CLI's chat
708
+ redials until the user quits (`run` gives up after about 3.5 minutes, as
709
+ before), shows the outage while it lasts, and after a `serverChanged`
710
+ continues the session's native conversation on the next turn instead of
711
+ starting a new one without a word.
712
+
713
+ - `session/release` (`client.releaseSession`) lets an idle durable session's
714
+ agent go (its process, a Codex home it holds) and keeps the session open:
715
+ its next turn names its native conversation (`resumeRequired` until it
716
+ does), as after a restart. `session/close` ends a session for good; this
717
+ frees what it runs on. Volatile servers answer `methodNotFound`; a
718
+ `SessionJournal` implements the port's new `releaseNative(sessionId)`. Nothing is broadcast: another client of the
719
+ session meets `resumeRequired` on its next turn, as after a restart. The
720
+ repository CLI
721
+ releases the session `/new` leaves and the one it leaves on exit; six `/new`
722
+ kept six Claude processes, 1.4 GB, until their idle timeout.
723
+
724
+ - The server bin says in one line what keeps it from starting, without a
725
+ stack: an unknown option by name, a missing value, a `--listen` port outside
726
+ 0-65535, a port in use, a journal another server holds, a file that is not a
727
+ journal. `--listen [::1]:4747` binds IPv6 (`listen()` puts the host in
728
+ brackets in its URL), every option takes its value after `=` too
729
+ (`--journal=<path>`), `--help` lists `--stdio`, and `--buffer` with
730
+ `--journal` says it has no effect.
731
+
732
+ - A drill that injects a bad day into live turns, and what it found.
733
+ `control-agent-server drill signals-cli` pushes plan-limit warnings and
734
+ rejections, overload retries, a revoked key, a cut stream, a full context and
735
+ a crashed agent into real Claude and Codex turns through the CLI (a proxy in
736
+ front of the Anthropic API; a shim around Codex's app-server), checks the
737
+ stream and the chat view, and that the session recovers. It found three
738
+ misclassifications, now fixed: Claude's used-up plan failed as `rate_limit`
739
+ (now `usage_limit`, as Codex's), a prompt too long as `invalid_request` (now
740
+ `context_limit`), and a dead Codex app-server as `internal` (now
741
+ `process_exit`, an `AgentExitedError` as ACP's).
742
+ - A used-up window counts while no extra usage (overage) answers in its
743
+ place, until Claude reports it allowed again or its reset passes, and in
744
+ later turns of the same session too: Claude tells a rejection once.
745
+ - A Codex app-server that dies while resuming a thread now fails the turn as
746
+ `process_exit`, not `resume_failed`: a host that stops resuming on
747
+ `resume_failed` may retry it. Its stderr no longer decides the category
748
+ (a word such as "aborted" in a crash made it pass for a cancel). Requests
749
+ after the exit, a broken pipe before it, MCP startup and an open plan
750
+ question all fail with the exit and its last stderr words.
751
+ - The classifier reads a status code only as a whole number: a too-long
752
+ prompt's "240129 tokens" is no longer `auth`, nor "214290" `rate_limit`.
753
+ Claude Code's "You've hit your … limit" text classifies as `usage_limit`.
754
+
755
+ - Five reports from consumers, through Hivenet:
756
+ - `session.usage.used` stays the context in use. A Claude turn's last gauge
757
+ took it from the result's usage, which sums every model call of the turn
758
+ (a Rafina turn read 67,356, then 325,982).
759
+ - `session.created` comes when it says something new: a session's first
760
+ native id, a new one, or a resume that did not continue (`resumed:
761
+ false`). It came on every turn, so a consumer counting sessions saw one
762
+ per turn.
763
+ - `shutdown` answers once the turns it cancelled have broadcast their
764
+ `turn.ended`, so `client.shutdownServer()` hands a running turn its
765
+ cancelled end instead of a `ConnectionClosedError`.
766
+ - A turn sent again with the same ids converges when only what a client's
767
+ restart can change differs: MCP endpoints, `env`, `apiKey`, `includeRaw`
768
+ (`turnIdentity`, shared by the journal and the runtime). A fresh
769
+ per-session MCP URL made it `turnConflict`.
770
+ - Claude Code's own failure text (a sign-in or billing error, sent as a
771
+ synthetic assistant message) no longer appears as the agent's reply, and
772
+ its `<synthetic>` model is not reported as one the turn ran.
773
+
774
+ - A tool cut off by an error says its outcome is unknown. A turn that ended
775
+ with a tool still running closed it as `cancelled`, whatever ended the turn;
776
+ after an error, max tokens or a dead process the tool may have done its
777
+ work, so the reducer now closes it `failed` with `TOOL_OUTCOME_UNKNOWN`
778
+ ("Its outcome is unknown and its effects were not undone", the words crash
779
+ recovery already used), and a call whose input never finished streaming
780
+ with `TOOL_NEVER_RAN`, as journal recovery now does too; `verifyStreamContract`
781
+ accepts both closures. Only a cancelled turn cancels its tools. The CLI
782
+ shows "outcome unknown · the turn ended first". A Claude process killed by
783
+ a signal now fails as `process_exit`, not `internal`.
784
+
785
+ - Codex plans in its own Plan mode. `permissionMode: "plan"` gave Codex only
786
+ a read-only sandbox; it now sends Codex's Plan collaboration mode (and
787
+ Default whenever a thread's mode is another, since Codex keeps it across
788
+ turns and resumes). Codex explores, may ask questions, and ends its turn
789
+ with a plan, which the engine puts to the user as it does Claude's (a
790
+ `switch_mode` tool part, "Implement this plan?") and Codex's TUI does.
791
+ Approving runs Codex's next turn within the same turn ("Implement the
792
+ plan." in Default mode, the thread switched to the workspace-write profile
793
+ when edits are auto-accepted); keeping planning with a message revises the
794
+ plan by it. Plan turns now ask like `default` (MCP tool consent, commands
795
+ beyond the sandbox) and decline the edits they ask for; a steer sent while
796
+ the user decides goes to the implementing turn. Codex sessions now always
797
+ opt into the app-server's experimental API, which collaboration modes need.
798
+
799
+ - A plan is put to the user, and the answer picks how the agent goes on.
800
+ Claude's ExitPlanMode asked "Allow tool: ExitPlanMode" with "Always allow"
801
+ among its options, and its tool part showed `{}`: Claude Code fills in the
802
+ plan after the model calls the tool empty. The approval now asks
803
+ "Implement this plan?" with Claude Code's own choices, whose ids are the
804
+ modes to go on in (`PLAN_OPTIONS`: `accept_edits`, `default`, `plan`), the
805
+ plan on the request and on the tool part. A permission answer can carry
806
+ `message`: keeping planning with one tells Claude what to change. A harness
807
+ can offer its own options (`onPermissionRequest(call, {options})`), which no
808
+ standing rule answers or keeps, and the decision says which was picked
809
+ (`optionId`); a client that answers with a standard id (`allow`, `reject`)
810
+ means a plain allow or reject, so an approved plan goes on in `default`, as
811
+ approving ExitPlanMode did. Auto-accepting edits is the plan's `allow_always`,
812
+ so an approver that takes the one-time approval asks for each edit. A
813
+ rejection's `message` reaches Claude for any tool, in Claude Code's words.
814
+ Each turn says the mode it asked for (`execution.permissionMode`); when the
815
+ agent switches mid-turn the stream says `session.mode`, both open
816
+ vocabularies, the reducer keeps `state.permissionMode`, and the CLI follows
817
+ it for the conversation. Claude now switches between plan, default, accept
818
+ edits and don't ask without a new process. An ACP agent's switch-mode
819
+ request (claude-agent-acp's plan approval) reaches the user with the agent's
820
+ own options in any mode that asks, where plan mode rejected it, and the turn
821
+ then runs in the mode approved. The ACP server binding offers session modes
822
+ (`session/set_mode`, `current_mode_update`), never above the operator's.
823
+ The CLI prints the plan and a numbered menu (or y/n), and
824
+ `control-agent-server drill plan-cli` verifies plans live. LLP 0001, D4.
825
+
826
+ - Steer a running turn. `turn/steer {sessionId, turnId, steerId?, input}`
827
+ (`client.steerTurn`, `handle.steer`, `runtime.steer`) adds input while the
828
+ agent works, instead of refusing it as `turnActive` or queueing it for the
829
+ next turn. The agent reads it at its next step, after the tool it runs, or
830
+ as one more query when it was already answering, and the stream shows it
831
+ there as a user message whose ids derive from the steer id
832
+ (`steerMessageId`). A turn that ends first lists it in
833
+ `turn.ended.undeliveredSteers`; a cancelled steer never runs later.
834
+ Answers: `steered`, `no_active_turn` (send a new turn), `unsupported`
835
+ (`AgentCapabilities.steering`); a steer `turn.ended` lists is always
836
+ answered `steered`. A turn takes steers from the moment it is admitted; a
837
+ retried `steerId` converges, and one reused with other input or in another
838
+ turn of the session is `turnConflict`. Claude and Codex steer, ACP does not.
839
+ Claude turns that ran a steer as an extra query report usage and cost summed
840
+ over both. The CLI steers with a line typed while a turn runs (also one it
841
+ reopened), and `/steer <text>` from anywhere. A custom harness steers by
842
+ implementing `Agent.steer` and having its adapter emit `steer-inserted` where
843
+ the agent read the steer. The verifier gains `user-messages-top-level`,
844
+ `undelivered-steers-not-echoed` and `message-ids-unique`. LLP 0001, D13.
845
+ The CLI's `/cancel` stops a turn where there is no terminal for Ctrl-C, and
846
+ `control-agent-server drill steering-cli` verifies steering live.
847
+
848
+ - An ACP agent that exits says why. The turn failed with the SDK's bare "ACP
849
+ connection closed"; it now fails as `process_exit` with the agent's exit
850
+ code and the last two lines of its stderr, where an agent explains a missing
851
+ login or a bad flag (an `AgentExitedError`, classified by its code, never by
852
+ that text). A child the agent left holding its pipes no longer keeps the
853
+ turn open, and an agent that ignores SIGTERM is killed after three seconds.
854
+ `pi` runs a pinned `pi-acp@0.0.34` instead of whatever npm published last.
855
+
856
+ - A Claude turn's `tokens` count every model call it made. They came from the
857
+ result's `usage`, which counts the main loop only, so a turn that ran a
858
+ sub-agent reported its cost but not its tokens (1,549 cache writes where
859
+ 14,041 happened). They now come from the growth of Claude's running
860
+ `modelUsage` totals, thinking reported as `reasoning`; a resumed process's
861
+ first turn, whose totals include earlier turns, still uses `usage`.
862
+
863
+ - Codex compactions reach the stream: a `contextCompaction` item becomes
864
+ `session.compaction` (trigger `auto`), as Claude's compaction boundary does,
865
+ instead of being dropped.
866
+
867
+ - Plan usage and retries are visible. `session.limits` reports the account's
868
+ usage windows (percent used, reset time, plan type) from Claude's
869
+ `rate_limit_event` and Codex's `account/rateLimits/updated`, both of which
870
+ every turn already sent and the engine dropped; the reducer keeps
871
+ `state.limits`, windows merged by id. A harness retrying a failed request
872
+ (Claude `api_retry`, Codex `error` with `willRetry`) now emits a recoverable
873
+ `error` with `retry: {attempt, maxAttempts, delayMs}` instead of a silent
874
+ wait. A turn's failure takes its category from the harness's typed code
875
+ (Claude's assistant `error`, Codex's `codexErrorInfo`) before message
876
+ matching (a code this build does not know leaves it to the text), and
877
+ `overloaded` joins the error categories (recoverable). A status that belongs
878
+ to one window rides on it, and the overall status is the worst window's
879
+ unless the report gives its own. The CLI
880
+ shows the plan line once a window nears its limit, and retries with their
881
+ attempt and wait.
882
+ - The agent's questions reach the user. `elicitation.requested` /
883
+ `elicitation.resolved` and `elicitation/respond` (`respondElicitation` on the
884
+ runtime and the client) broker what an agent asks besides an approval,
885
+ shaped after ACP's `elicitation/create`: `question` mode for Claude's
886
+ `AskUserQuestion` and Codex's `request_user_input`, `form` and `url` for MCP
887
+ servers' requests through Claude, Codex and ACP agents (the ACP harness now
888
+ declares the `elicitation` client capability). A turn opts in with
889
+ `config.elicitation: true`; otherwise the harness declines on the user's
890
+ behalf and the agent carries on. Claude's `AskUserQuestion` used to arrive as
891
+ a tool approval whose "allow" told Claude "the user did not answer", and MCP
892
+ servers' requests were declined on every harness. The reducer keeps
893
+ `state.elicitations` (`pendingElicitations`), the stream contract adds
894
+ `elicitation-resolves-once`, journal recovery cancels a pending one, and the
895
+ CLI asks and answers in chat, also in a turn it reopens. The harness gets a
896
+ secret answer, but `elicitation.resolved` carries `["[secret]"]` in its place,
897
+ so no journal, replay, history or checkpoint stores it.
898
+ - Codex MCP tools that change something now run outside bypass mode. Codex
899
+ asks consent for an MCP tool call not marked read-only as an MCP elicitation;
900
+ agent-server answered it with an error, so in `default` mode every such call
901
+ was rejected without the user being asked and in `accept_edits` it failed.
902
+ The consent now goes to the engine's permission broker as an approval of
903
+ that tool call (`<server>.<tool>`, linked to its tool part), and
904
+ `accept_edits` runs Codex with `on-request` approvals: Codex still approves
905
+ edits inside its workspace by itself, and asks through the broker before
906
+ writing beyond it.
907
+ - Attachments reach the agent or fail the turn, as `invalid_request`, instead
908
+ of vanishing. Codex takes images as data or local paths (it refuses remote
909
+ image URLs), text files inline, and local files as mentions; Claude sends a
910
+ text file as a text document (base64 documents are PDFs only); an ACP agent
911
+ gets image data only with its image capability and files as embedded
912
+ resources only with `embeddedContext`, else text inline. Codex used to send
913
+ every URL as an image and drop files given as data; ACP dropped both.
914
+ `UnsupportedAttachmentError` is exported from `./core`.
915
+ - The `error` event that ends a turn is never `recoverable`, which the schema
916
+ defines as "the turn continues"; a rate-limit or network failure used to be
917
+ flagged recoverable, and the CLI printed "retrying" for a turn that had ended.
918
+ - The ACP harness never selects an agent's `allow_always` option for an allow,
919
+ which left a standing rule in the agent nobody chose; with no `allow_once`
920
+ offered the request is cancelled. The engine keeps the user's own "always"
921
+ answers.
922
+ - The CLI attaches files and images: `--attach=<path>` (repeatable) for the
923
+ first message and `/attach <path>` in chat, sent inline so every harness can
924
+ read them.
925
+ - codex-app-server honors a turn's `apiKey` and `additionalDirectories`, the
926
+ two fields only codex-sdk used to map. The key logs that session's process
927
+ in, for turns and for `models/list`, and any supplied credential stays in
928
+ memory (`cli_auth_credentials_store = "ephemeral"`) instead of replacing the
929
+ `CODEX_HOME` login. A host's `resolveAuth`, when configured, decides instead,
930
+ and its `undefined` still means the native login. Extra directories become
931
+ writable roots of the workspace-write sandbox; changing them starts a new
932
+ process.
933
+ - A Claude turn reports its own cost after a resume. Claude's running total
934
+ restores what earlier processes of the conversation spent, so a resumed
935
+ process's first turn reported the conversation's whole spend, as did each
936
+ turn after a thinking, permission-mode or rewind change restarted the
937
+ process. That first turn now reports no cost, and a restart keeps the
938
+ running baseline, so the turn after it is exact.
939
+ The cost comes from the session's own tap (`turn_cost_usd`): a custom agent
940
+ that yields raw SDK `result` messages to `createClaudeCodeTransformer` gets
941
+ no turn cost, since the SDK's `total_cost_usd` counts the whole conversation.
942
+ - Peer dependency floors rise to the versions this package is built and tested
943
+ against: `@anthropic-ai/claude-agent-sdk` >=0.3.277 (earlier versions reset
944
+ `total_cost_usd` on resume, which the cost baseline above relies on),
945
+ `@agentclientprotocol/sdk` >=1.3.0, and zod ^4.6.6. The old floors never
946
+ type-checked.
947
+ - Hivenet feedback for agent-server itself, never the task at hand: both CLI
948
+ entry points accept `--message`, failed-task eval fields, `--answer` and
949
+ `--dry-run`, validate reports before sending, and show known-issue context
950
+ alongside maintainer guidance and questions. `docs/feedback.md` is the guide;
951
+ the CLI's in-process MCP server tells a Claude session it may report harness
952
+ friction the same way.
953
+ - Types ship as declarations: each export's `types` is `dist/types`, which
954
+ `npm pack` and `npm publish` emit from the sources the runtime still loads.
955
+ A consumer's `tsc` no longer compiles this package's sources, so under Node
956
+ it needs neither Bun's types, nor the SDKs of harnesses it does not run, nor
957
+ `allowImportingTsExtensions`, and its own options (`noUnusedLocals`, …) apply
958
+ only to its own files.
959
+ - Token deltas are live only (wire protocol 3): `message.part.delta` takes no
960
+ `seq` of its own, carrying that of the session's last kept event, and no
961
+ replay buffer or journal newly keeps it. A journal used to commit every
962
+ delta as a hash-chained record, about 1.4 KB each, so a long answer added
963
+ megabytes and filled history pages. A turn that ends with text or tool input
964
+ its harness streamed but never snapshotted (a cancel mid-sentence, or mid
965
+ tool call) gets that snapshot before `turn.ended`, so kept history shows all
966
+ the stream did.
967
+ - A journal never stores a token delta, and history refuses delta records
968
+ like raw harness output; it keeps what each streaming part streamed outside
969
+ every history, for recovery (below). A journal written by an earlier
970
+ version (schema 2, which kept every delta) is refused at open; start a new
971
+ journal file.
972
+ - Streaming parts are kept at their opening, the state changes their harness
973
+ reports and their end; what streams in between is live (deltas, and the
974
+ open parts a subscription sends) and survives a crash in the journal's tail
975
+ rows. A 13,891-character answer kept 2 records (14.6 KB), where the
976
+ one-second partial snapshots of an earlier build of this release kept 31
977
+ for a 10,850-character one (185.8 KB): they were 86% of a session's journal
978
+ bytes, replayed on every reopen. A history follower sees a part when it
979
+ opens and when it ends. A server process that dies (a crash, a SIGKILL)
980
+ keeps what was shown: the journal keeps each streaming part's tail
981
+ (written before the delta is delivered, outside the history), and recovery
982
+ closes the part with it; only power loss can lose it. Live-follow
983
+ verification requires a finished assistant part before the source ends,
984
+ not just a turn-start event or the user echo.
985
+ - A delta is delivered only after a snapshot of its part on the current
986
+ connection, which joining or reconnecting receives at once: the open parts
987
+ that follow its subscription. Replay cannot expose missing tokens, and
988
+ appending across that hole otherwise corrupts text already printed by a
989
+ CLI even though the final saved snapshot is correct.
990
+ - `SeqCursor.advanceLive` and `isLiveOnlyEvent` place a forwarded delta: it
991
+ delivers where the cursor stands at its `seq`, is dropped once the cursor
992
+ moved past it, and waits behind kept events still missing.
993
+ - Both sides refuse the other protocol version, so a 0.3.18 client and this
994
+ server fail at `initialize` instead of reading deltas as gaps or duplicates.
995
+ - `AgentCapabilities` says what the CLI used to know by harness name:
996
+ `files`, the kinds of file a harness reads as data (`FILE_KINDS`:
997
+ `text`, `pdf`, `binary`, told apart by the new `fileKind(mimeType)`;
998
+ Claude `text, pdf`, Codex `text`, ACP all three, as its agent decides),
999
+ and `rejectionMessages`, whether a refused tool call's `message` reaches
1000
+ the agent (Claude only). Both are required: every built-in harness states
1001
+ them, and a custom agent's `capabilities` must too (a server older than
1002
+ protocol 6 is refused at `initialize`, so no client meets one without
1003
+ them). The CLI checks
1004
+ attachments and hands refusal words on from what `initialize` reports,
1005
+ so a `--connect` CLI no longer assumes the server's harnesses.
1006
+
1007
+ ## 0.3.18
1008
+
1009
+ - A turn on a full model id that the model list names only through an alias,
1010
+ such as `claude-opus-5-5` (listed as `opus`), gets that row's thinking
1011
+ levels: its level is fitted and `turn.ended.execution.appliedThinkingLevel`
1012
+ reports it. Such a turn reported no applied level, although its level ran.
1013
+ - A message's or compaction's id now carries exactly its event's `timestamp`:
1014
+ `message.started` and `session.compaction` take one clock reading for both,
1015
+ so a consumer that dates a row by its UUIDv7 id agrees with one that reads
1016
+ the event. They could differ by a millisecond. `generateUUIDv7()` in
1017
+ `/protocol` takes an optional `timestamp` for this.
1018
+ - Durable sessions: `new AgentServer(runtime, { journal })` with a SQLite journal
1019
+ (`/sync/sqlite` for Bun, `/sync/node-sqlite` for Node 22.16+) commits each
1020
+ turn's admission before its ack and each event before it is broadcast, so
1021
+ sessions, replay and turn receipts survive a restart. A turn a restart cut
1022
+ off is recorded interrupted and its session refuses turns until
1023
+ `session/confirmStopped`; `turn/get` and `session/get` read receipts and
1024
+ state. See `docs/durable-sessions.md`.
1025
+ - Portable history: `history/*` on the wire, `client.history`, and
1026
+ `transferHistory`, `openHistory`, `followHistory` and `startHistorySync` in
1027
+ `/sync` copy hash-chained session history between stores and let viewers
1028
+ read it without executing it. See `docs/sync-history.md`.
1029
+ - Both are experimental: the `/sync` exports, the journal's wire methods and
1030
+ the journal's file format may change in minor releases. A server without a
1031
+ journal is unaffected.
1032
+ - A client that redials (`connect`, `fromTransportFactory`) now treats a
1033
+ request left unanswered for `requestTimeoutMs` (30s) as a dead connection:
1034
+ it fails with `ConnectionClosedError`, drops the socket and redials, and
1035
+ its turns heal by replay. A client that cannot redial (`attach`, `spawn`)
1036
+ still fails only that request, with `internalError`.
1037
+ - `client.watch(sessionId, afterSeq?)` follows a session this client did not
1038
+ start, such as a turn another client left running: its logged events now,
1039
+ later ones live, and after a redial the ones a dropped connection missed.
1040
+ - A `turn/start` whose acknowledgement a dropped connection lost left the turn
1041
+ running unseen: `runTurn` reported the connection error. It now re-sends the
1042
+ start after redialing the same server (or the same journal), at most three
1043
+ times, which joins the running turn; a restarted server without a journal is
1044
+ not re-sent to.
1045
+ - `AgentRuntime.shutdown()` missed a turn still being set up when it began:
1046
+ the turn then ran unaborted until the drain timeout. Every run now stops when
1047
+ shutdown starts.
1048
+ - A sink whose writes are a durability boundary throws the new
1049
+ `EventSinkError` to stop its turn: the harness is cancelled and a retry of the
1050
+ turn converges on the failure. Other sink errors stay diagnostics, as before.
1051
+ `serialSink` orders an async sink's writes, and `teeSink`, which skipped the
1052
+ remaining sinks once one threw, now gives every sink every event.
1053
+ - Turns whose ids differ only in where a colon falls (`"a:b"`/`"c"` and
1054
+ `"a"`/`"b:c"`) were treated as the same turn: the second converged onto the
1055
+ first instead of running.
1056
+ - A second `AgentServer.shutdown()` call returned before the first finished
1057
+ draining, so a host awaiting it could exit with turns still settling. Every
1058
+ caller now waits for the same drain.
1059
+ - A `turn/start` whose requester disconnected while its acknowledgement was
1060
+ written left the session busy forever: the turn was admitted but never ran.
1061
+ It now runs and releases the session.
1062
+
3
1063
  ## 0.3.17
4
1064
 
5
1065
  - Codex token usage counts each turn. Both Codex harnesses reported Codex's