@zvada/agent-server 0.3.21 → 0.3.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (367) hide show
  1. package/CHANGELOG.md +332 -0
  2. package/README.md +2 -1
  3. package/dist/types/accounts/chatgpt.d.ts +1 -1
  4. package/dist/types/accounts/chatgpt.d.ts.map +1 -1
  5. package/dist/types/accounts/http.d.ts +2 -4
  6. package/dist/types/accounts/http.d.ts.map +1 -1
  7. package/dist/types/client/client.d.ts +37 -11
  8. package/dist/types/client/client.d.ts.map +1 -1
  9. package/dist/types/client/connection.d.ts +66 -13
  10. package/dist/types/client/connection.d.ts.map +1 -1
  11. package/dist/types/client/index.d.ts +1 -1
  12. package/dist/types/client/index.d.ts.map +1 -1
  13. package/dist/types/client/logins.d.ts +4 -3
  14. package/dist/types/client/logins.d.ts.map +1 -1
  15. package/dist/types/client/streams.d.ts +9 -3
  16. package/dist/types/client/streams.d.ts.map +1 -1
  17. package/dist/types/client/turns.d.ts +1 -1
  18. package/dist/types/client/turns.d.ts.map +1 -1
  19. package/dist/types/core/agents/acp/acp-agent.d.ts +34 -1
  20. package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
  21. package/dist/types/core/agents/acp/adapter.d.ts.map +1 -1
  22. package/dist/types/core/agents/acp/client.d.ts +12 -3
  23. package/dist/types/core/agents/acp/client.d.ts.map +1 -1
  24. package/dist/types/core/agents/acp/mappings.d.ts +8 -2
  25. package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
  26. package/dist/types/core/agents/base.d.ts +22 -8
  27. package/dist/types/core/agents/base.d.ts.map +1 -1
  28. package/dist/types/core/agents/claude-code/adapter.d.ts +7 -0
  29. package/dist/types/core/agents/claude-code/adapter.d.ts.map +1 -1
  30. package/dist/types/core/agents/claude-code/approvals.d.ts +4 -1
  31. package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -1
  32. package/dist/types/core/agents/claude-code/claude-agent.d.ts +16 -5
  33. package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
  34. package/dist/types/core/agents/claude-code/events.d.ts +9 -1
  35. package/dist/types/core/agents/claude-code/events.d.ts.map +1 -1
  36. package/dist/types/core/agents/claude-code/login.d.ts +4 -1
  37. package/dist/types/core/agents/claude-code/login.d.ts.map +1 -1
  38. package/dist/types/core/agents/claude-code/mcp.d.ts +21 -7
  39. package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -1
  40. package/dist/types/core/agents/claude-code/models.d.ts +5 -1
  41. package/dist/types/core/agents/claude-code/models.d.ts.map +1 -1
  42. package/dist/types/core/agents/claude-code/options.d.ts +10 -4
  43. package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
  44. package/dist/types/core/agents/claude-code/outcome.d.ts +3 -5
  45. package/dist/types/core/agents/claude-code/outcome.d.ts.map +1 -1
  46. package/dist/types/core/agents/claude-code/results.d.ts +16 -0
  47. package/dist/types/core/agents/claude-code/results.d.ts.map +1 -0
  48. package/dist/types/core/agents/claude-code/sdk-pair.d.ts +13 -0
  49. package/dist/types/core/agents/claude-code/sdk-pair.d.ts.map +1 -0
  50. package/dist/types/core/agents/claude-code/session.d.ts +50 -12
  51. package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
  52. package/dist/types/core/agents/claude-code/spend.d.ts +2 -1
  53. package/dist/types/core/agents/claude-code/spend.d.ts.map +1 -1
  54. package/dist/types/core/agents/claude-code/tools.d.ts +26 -3
  55. package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -1
  56. package/dist/types/core/agents/codex-app-server/adapter.d.ts +2 -2
  57. package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -1
  58. package/dist/types/core/agents/codex-app-server/client.d.ts +21 -2
  59. package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
  60. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +61 -14
  61. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -1
  62. package/dist/types/core/agents/codex-app-server/commands.d.ts +2 -2
  63. package/dist/types/core/agents/codex-app-server/commands.d.ts.map +1 -1
  64. package/dist/types/core/agents/codex-app-server/credentials.d.ts +5 -1
  65. package/dist/types/core/agents/codex-app-server/credentials.d.ts.map +1 -1
  66. package/dist/types/core/agents/codex-app-server/effort.d.ts +2 -1
  67. package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -1
  68. package/dist/types/core/agents/codex-app-server/homes.d.ts +26 -5
  69. package/dist/types/core/agents/codex-app-server/homes.d.ts.map +1 -1
  70. package/dist/types/core/agents/codex-app-server/items.d.ts +27 -2
  71. package/dist/types/core/agents/codex-app-server/items.d.ts.map +1 -1
  72. package/dist/types/core/agents/codex-app-server/login.d.ts +4 -1
  73. package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -1
  74. package/dist/types/core/agents/codex-app-server/mcp.d.ts +45 -20
  75. package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -1
  76. package/dist/types/core/agents/codex-app-server/models.d.ts +3 -10
  77. package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -1
  78. package/dist/types/core/agents/codex-app-server/options.d.ts +32 -5
  79. package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -1
  80. package/dist/types/core/agents/codex-app-server/plan-approval.d.ts +2 -1
  81. package/dist/types/core/agents/codex-app-server/plan-approval.d.ts.map +1 -1
  82. package/dist/types/core/agents/codex-app-server/protocol.d.ts +16 -3
  83. package/dist/types/core/agents/codex-app-server/protocol.d.ts.map +1 -1
  84. package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -1
  85. package/dist/types/core/agents/codex-app-server/session.d.ts +70 -33
  86. package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -1
  87. package/dist/types/core/agents/codex-app-server/subagents.d.ts +9 -4
  88. package/dist/types/core/agents/codex-app-server/subagents.d.ts.map +1 -1
  89. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts +3 -2
  90. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -1
  91. package/dist/types/core/agents/codex-app-server/turn-items.d.ts +2 -1
  92. package/dist/types/core/agents/codex-app-server/turn-items.d.ts.map +1 -1
  93. package/dist/types/core/agents/codex-app-server/turn.d.ts +37 -8
  94. package/dist/types/core/agents/codex-app-server/turn.d.ts.map +1 -1
  95. package/dist/types/core/agents/codex-app-server/user-login.d.ts +28 -0
  96. package/dist/types/core/agents/codex-app-server/user-login.d.ts.map +1 -0
  97. package/dist/types/core/agents/credentials.d.ts +3 -1
  98. package/dist/types/core/agents/credentials.d.ts.map +1 -1
  99. package/dist/types/core/agents/diffs.d.ts +9 -0
  100. package/dist/types/core/agents/diffs.d.ts.map +1 -0
  101. package/dist/types/core/agents/elicitation.d.ts +3 -2
  102. package/dist/types/core/agents/elicitation.d.ts.map +1 -1
  103. package/dist/types/core/agents/login.d.ts +6 -0
  104. package/dist/types/core/agents/login.d.ts.map +1 -1
  105. package/dist/types/core/agents/mcp-config.d.ts +0 -4
  106. package/dist/types/core/agents/mcp-config.d.ts.map +1 -1
  107. package/dist/types/core/agents/plan.d.ts +2 -13
  108. package/dist/types/core/agents/plan.d.ts.map +1 -1
  109. package/dist/types/core/agents/process-pool.d.ts +193 -0
  110. package/dist/types/core/agents/process-pool.d.ts.map +1 -0
  111. package/dist/types/core/agents/scripted/adapter.d.ts +68 -0
  112. package/dist/types/core/agents/scripted/adapter.d.ts.map +1 -0
  113. package/dist/types/core/agents/scripted/mcp-call.d.ts +56 -0
  114. package/dist/types/core/agents/scripted/mcp-call.d.ts.map +1 -0
  115. package/dist/types/core/agents/scripted/scripted-agent.d.ts +73 -0
  116. package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -0
  117. package/dist/types/core/agents/scripted/scripts.d.ts +29 -0
  118. package/dist/types/core/agents/scripted/scripts.d.ts.map +1 -0
  119. package/dist/types/core/agents/scripted/steps.d.ts +132 -0
  120. package/dist/types/core/agents/scripted/steps.d.ts.map +1 -0
  121. package/dist/types/core/agents/session-agent.d.ts +49 -6
  122. package/dist/types/core/agents/session-agent.d.ts.map +1 -1
  123. package/dist/types/core/diagnostics.d.ts +4 -1
  124. package/dist/types/core/diagnostics.d.ts.map +1 -1
  125. package/dist/types/core/index.d.ts +6 -1
  126. package/dist/types/core/index.d.ts.map +1 -1
  127. package/dist/types/core/presets.d.ts +32 -6
  128. package/dist/types/core/presets.d.ts.map +1 -1
  129. package/dist/types/core/processes/lifeline.d.ts +0 -20
  130. package/dist/types/core/processes/lifeline.d.ts.map +1 -1
  131. package/dist/types/core/provision/index.d.ts +2 -2
  132. package/dist/types/core/provision/index.d.ts.map +1 -1
  133. package/dist/types/core/provision/install-build.d.ts +2 -1
  134. package/dist/types/core/provision/install-build.d.ts.map +1 -1
  135. package/dist/types/core/provision/npm.d.ts +20 -8
  136. package/dist/types/core/provision/npm.d.ts.map +1 -1
  137. package/dist/types/core/provision/provisioner.d.ts +4 -1
  138. package/dist/types/core/provision/provisioner.d.ts.map +1 -1
  139. package/dist/types/core/provision/tools.d.ts +2 -1
  140. package/dist/types/core/provision/tools.d.ts.map +1 -1
  141. package/dist/types/core/runtime/agent-runtime.d.ts +18 -9
  142. package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
  143. package/dist/types/core/runtime/event-processor.d.ts +5 -1
  144. package/dist/types/core/runtime/event-processor.d.ts.map +1 -1
  145. package/dist/types/core/runtime/harness-clis.d.ts +9 -0
  146. package/dist/types/core/runtime/harness-clis.d.ts.map +1 -1
  147. package/dist/types/core/runtime/harness-logins.d.ts +33 -5
  148. package/dist/types/core/runtime/harness-logins.d.ts.map +1 -1
  149. package/dist/types/core/runtime/model-lists.d.ts +2 -0
  150. package/dist/types/core/runtime/model-lists.d.ts.map +1 -1
  151. package/dist/types/core/runtime/permission-policy.d.ts +5 -3
  152. package/dist/types/core/runtime/permission-policy.d.ts.map +1 -1
  153. package/dist/types/core/runtime/request-broker.d.ts +2 -1
  154. package/dist/types/core/runtime/request-broker.d.ts.map +1 -1
  155. package/dist/types/core/runtime/turn.d.ts +14 -1
  156. package/dist/types/core/runtime/turn.d.ts.map +1 -1
  157. package/dist/types/core/utils/deadline.d.ts +6 -0
  158. package/dist/types/core/utils/deadline.d.ts.map +1 -1
  159. package/dist/types/core/utils/errors.d.ts +15 -1
  160. package/dist/types/core/utils/errors.d.ts.map +1 -1
  161. package/dist/types/operator/index.d.ts +11 -0
  162. package/dist/types/operator/index.d.ts.map +1 -0
  163. package/dist/types/operator/mcp.d.ts +33 -0
  164. package/dist/types/operator/mcp.d.ts.map +1 -0
  165. package/dist/types/operator/operator.d.ts +206 -0
  166. package/dist/types/operator/operator.d.ts.map +1 -0
  167. package/dist/types/operator/render.d.ts +89 -0
  168. package/dist/types/operator/render.d.ts.map +1 -0
  169. package/dist/types/operator/view.d.ts +44 -0
  170. package/dist/types/operator/view.d.ts.map +1 -0
  171. package/dist/types/protocol/auth.d.ts +54 -24
  172. package/dist/types/protocol/auth.d.ts.map +1 -1
  173. package/dist/types/protocol/clis.d.ts +14 -7
  174. package/dist/types/protocol/clis.d.ts.map +1 -1
  175. package/dist/types/protocol/config.d.ts +2 -0
  176. package/dist/types/protocol/config.d.ts.map +1 -1
  177. package/dist/types/protocol/conversation.d.ts +40 -3
  178. package/dist/types/protocol/conversation.d.ts.map +1 -1
  179. package/dist/types/protocol/credentials.d.ts +7 -0
  180. package/dist/types/protocol/credentials.d.ts.map +1 -1
  181. package/dist/types/protocol/execution.d.ts +2 -1
  182. package/dist/types/protocol/execution.d.ts.map +1 -1
  183. package/dist/types/protocol/factories.d.ts +12 -2
  184. package/dist/types/protocol/factories.d.ts.map +1 -1
  185. package/dist/types/protocol/harness.d.ts +6 -2
  186. package/dist/types/protocol/harness.d.ts.map +1 -1
  187. package/dist/types/protocol/history.d.ts +19 -0
  188. package/dist/types/protocol/history.d.ts.map +1 -1
  189. package/dist/types/protocol/lifecycle.d.ts +47 -8
  190. package/dist/types/protocol/lifecycle.d.ts.map +1 -1
  191. package/dist/types/protocol/model-catalog.d.ts.map +1 -1
  192. package/dist/types/protocol/models.d.ts +3 -0
  193. package/dist/types/protocol/models.d.ts.map +1 -1
  194. package/dist/types/protocol/parts.d.ts +14 -0
  195. package/dist/types/protocol/parts.d.ts.map +1 -1
  196. package/dist/types/protocol/plan.d.ts +20 -0
  197. package/dist/types/protocol/plan.d.ts.map +1 -0
  198. package/dist/types/protocol/tool-state.d.ts +12 -0
  199. package/dist/types/protocol/tool-state.d.ts.map +1 -1
  200. package/dist/types/protocol/wire-api.d.ts +129 -23
  201. package/dist/types/protocol/wire-api.d.ts.map +1 -1
  202. package/dist/types/protocol/wire.d.ts +70 -10
  203. package/dist/types/protocol/wire.d.ts.map +1 -1
  204. package/dist/types/server/acp/binding.d.ts +6 -1
  205. package/dist/types/server/acp/binding.d.ts.map +1 -1
  206. package/dist/types/server/acp/translate.d.ts +33 -7
  207. package/dist/types/server/acp/translate.d.ts.map +1 -1
  208. package/dist/types/server/agent-server.d.ts +6 -0
  209. package/dist/types/server/agent-server.d.ts.map +1 -1
  210. package/dist/types/server/feedback.d.ts +2 -1
  211. package/dist/types/server/feedback.d.ts.map +1 -1
  212. package/dist/types/server/install.d.ts +11 -0
  213. package/dist/types/server/install.d.ts.map +1 -1
  214. package/dist/types/server/session-gate.d.ts +2 -1
  215. package/dist/types/server/session-gate.d.ts.map +1 -1
  216. package/dist/types/server/session-store.d.ts +1 -0
  217. package/dist/types/server/session-store.d.ts.map +1 -1
  218. package/dist/types/server/subscriptions.d.ts +2 -1
  219. package/dist/types/server/subscriptions.d.ts.map +1 -1
  220. package/dist/types/server/transports.d.ts.map +1 -1
  221. package/dist/types/sync/fit.d.ts +8 -7
  222. package/dist/types/sync/fit.d.ts.map +1 -1
  223. package/dist/types/sync/history-sqlite.d.ts.map +1 -1
  224. package/dist/types/sync/index.d.ts +1 -0
  225. package/dist/types/sync/index.d.ts.map +1 -1
  226. package/dist/types/sync/journal-sqlite.d.ts +2 -1
  227. package/dist/types/sync/journal-sqlite.d.ts.map +1 -1
  228. package/dist/types/sync/journal.d.ts +11 -3
  229. package/dist/types/sync/journal.d.ts.map +1 -1
  230. package/dist/types/sync/projection.d.ts +6 -0
  231. package/dist/types/sync/projection.d.ts.map +1 -1
  232. package/dist/types/sync/recovery.d.ts +2 -1
  233. package/dist/types/sync/recovery.d.ts.map +1 -1
  234. package/dist/types/sync/schema.d.ts +10 -0
  235. package/dist/types/sync/schema.d.ts.map +1 -1
  236. package/dist/types/sync/sql.d.ts +2 -1
  237. package/dist/types/sync/sql.d.ts.map +1 -1
  238. package/dist/types/sync/worker.d.ts.map +1 -1
  239. package/docs/consuming.md +464 -40
  240. package/docs/deploy.md +36 -8
  241. package/docs/durable-sessions.md +35 -5
  242. package/docs/harnesses.md +396 -30
  243. package/package.json +11 -1
  244. package/src/accounts/chatgpt.ts +2 -2
  245. package/src/accounts/http.ts +2 -16
  246. package/src/client/client.ts +92 -31
  247. package/src/client/connection.ts +113 -22
  248. package/src/client/index.ts +1 -0
  249. package/src/client/logins.ts +24 -15
  250. package/src/client/streams.ts +12 -4
  251. package/src/client/turns.ts +1 -1
  252. package/src/core/agents/acp/acp-agent.ts +181 -52
  253. package/src/core/agents/acp/adapter.ts +9 -1
  254. package/src/core/agents/acp/client.ts +16 -4
  255. package/src/core/agents/acp/mappings.ts +27 -0
  256. package/src/core/agents/base.ts +25 -10
  257. package/src/core/agents/claude-code/adapter.ts +47 -17
  258. package/src/core/agents/claude-code/approvals.ts +6 -5
  259. package/src/core/agents/claude-code/claude-agent.ts +60 -30
  260. package/src/core/agents/claude-code/events.ts +11 -1
  261. package/src/core/agents/claude-code/login.ts +14 -2
  262. package/src/core/agents/claude-code/mcp.ts +31 -15
  263. package/src/core/agents/claude-code/models.ts +7 -2
  264. package/src/core/agents/claude-code/options.ts +11 -3
  265. package/src/core/agents/claude-code/outcome.ts +10 -2
  266. package/src/core/agents/claude-code/results.ts +73 -0
  267. package/src/core/agents/claude-code/sdk-pair.ts +66 -0
  268. package/src/core/agents/claude-code/session.ts +166 -37
  269. package/src/core/agents/claude-code/spend.ts +1 -1
  270. package/src/core/agents/claude-code/tools.ts +108 -12
  271. package/src/core/agents/codex-app-server/adapter.ts +37 -12
  272. package/src/core/agents/codex-app-server/client.ts +69 -10
  273. package/src/core/agents/codex-app-server/codex-agent.ts +141 -55
  274. package/src/core/agents/codex-app-server/commands.ts +2 -2
  275. package/src/core/agents/codex-app-server/credentials.ts +10 -5
  276. package/src/core/agents/codex-app-server/effort.ts +1 -1
  277. package/src/core/agents/codex-app-server/homes.ts +59 -10
  278. package/src/core/agents/codex-app-server/items.ts +219 -31
  279. package/src/core/agents/codex-app-server/login.ts +14 -2
  280. package/src/core/agents/codex-app-server/mcp.ts +142 -26
  281. package/src/core/agents/codex-app-server/models.ts +9 -8
  282. package/src/core/agents/codex-app-server/options.ts +79 -11
  283. package/src/core/agents/codex-app-server/plan-approval.ts +1 -1
  284. package/src/core/agents/codex-app-server/protocol.ts +14 -4
  285. package/src/core/agents/codex-app-server/requests.ts +14 -6
  286. package/src/core/agents/codex-app-server/session.ts +156 -81
  287. package/src/core/agents/codex-app-server/subagents.ts +21 -14
  288. package/src/core/agents/codex-app-server/thread-settings.ts +18 -8
  289. package/src/core/agents/codex-app-server/turn-items.ts +1 -1
  290. package/src/core/agents/codex-app-server/turn.ts +96 -35
  291. package/src/core/agents/codex-app-server/user-login.ts +107 -0
  292. package/src/core/agents/credentials.ts +5 -2
  293. package/src/core/agents/diffs.ts +25 -0
  294. package/src/core/agents/elicitation.ts +2 -2
  295. package/src/core/agents/login.ts +6 -0
  296. package/src/core/agents/mcp-config.ts +2 -2
  297. package/src/core/agents/plan.ts +3 -19
  298. package/src/core/agents/process-pool.ts +432 -0
  299. package/src/core/agents/scripted/adapter.ts +142 -0
  300. package/src/core/agents/scripted/mcp-call.ts +134 -0
  301. package/src/core/agents/scripted/scripted-agent.ts +418 -0
  302. package/src/core/agents/scripted/scripts.ts +171 -0
  303. package/src/core/agents/scripted/steps.ts +127 -0
  304. package/src/core/agents/session-agent.ts +105 -8
  305. package/src/core/diagnostics.ts +9 -1
  306. package/src/core/index.ts +12 -0
  307. package/src/core/presets.ts +99 -14
  308. package/src/core/processes/lifeline.ts +99 -25
  309. package/src/core/provision/index.ts +1 -2
  310. package/src/core/provision/install-build.ts +4 -1
  311. package/src/core/provision/npm.ts +309 -97
  312. package/src/core/provision/provisioner.ts +22 -8
  313. package/src/core/provision/tools.ts +44 -19
  314. package/src/core/runtime/agent-runtime.ts +70 -34
  315. package/src/core/runtime/event-processor.ts +18 -2
  316. package/src/core/runtime/harness-clis.ts +36 -1
  317. package/src/core/runtime/harness-logins.ts +82 -31
  318. package/src/core/runtime/model-lists.ts +1 -1
  319. package/src/core/runtime/permission-policy.ts +4 -3
  320. package/src/core/runtime/request-broker.ts +1 -1
  321. package/src/core/runtime/turn.ts +53 -3
  322. package/src/core/utils/deadline.ts +23 -0
  323. package/src/core/utils/errors.ts +24 -4
  324. package/src/operator/index.ts +40 -0
  325. package/src/operator/mcp.ts +171 -0
  326. package/src/operator/operator.ts +782 -0
  327. package/src/operator/render.ts +473 -0
  328. package/src/operator/view.ts +82 -0
  329. package/src/protocol/auth.ts +30 -23
  330. package/src/protocol/clis.ts +12 -4
  331. package/src/protocol/credentials.ts +19 -0
  332. package/src/protocol/execution.ts +5 -0
  333. package/src/protocol/factories.ts +25 -3
  334. package/src/protocol/harness.ts +11 -1
  335. package/src/protocol/history.ts +20 -0
  336. package/src/protocol/lifecycle.ts +10 -1
  337. package/src/protocol/model-catalog.ts +19 -8
  338. package/src/protocol/parts.ts +12 -1
  339. package/src/protocol/plan.ts +35 -0
  340. package/src/protocol/tool-state.ts +14 -1
  341. package/src/protocol/wire.ts +14 -0
  342. package/src/server/acp/binding.ts +113 -22
  343. package/src/server/acp/translate.ts +161 -8
  344. package/src/server/agent-server.ts +10 -1
  345. package/src/server/bin.ts +83 -9
  346. package/src/server/feedback.ts +1 -1
  347. package/src/server/install.ts +82 -4
  348. package/src/server/session-gate.ts +1 -1
  349. package/src/server/session-store.ts +5 -1
  350. package/src/server/subscriptions.ts +1 -1
  351. package/src/server/transports.ts +14 -0
  352. package/src/sync/fit.ts +115 -28
  353. package/src/sync/history-sqlite.ts +6 -2
  354. package/src/sync/index.ts +1 -0
  355. package/src/sync/journal-sqlite.ts +20 -2
  356. package/src/sync/journal.ts +10 -2
  357. package/src/sync/projection.ts +10 -0
  358. package/src/sync/recovery.ts +11 -4
  359. package/src/sync/schema.ts +7 -5
  360. package/src/sync/sql.ts +1 -1
  361. package/src/sync/worker.ts +4 -0
  362. package/dist/types/core/agents/claude-code/session-pool.d.ts +0 -36
  363. package/dist/types/core/agents/claude-code/session-pool.d.ts.map +0 -1
  364. package/dist/types/core/agents/session-pool.d.ts +0 -41
  365. package/dist/types/core/agents/session-pool.d.ts.map +0 -1
  366. package/src/core/agents/claude-code/session-pool.ts +0 -136
  367. package/src/core/agents/session-pool.ts +0 -111
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI/F,OAAO,EAAE,KAAK,eAAe,EAAS,MAAM,aAAa,CAAC;AAO1D,+DAA+D;AAC/D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,gFAAgF;AAChF,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,SAAS,aAAa,EAAE,CAAC;IACjC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAK7E;AAUD,6FAA6F;AAC7F,wBAAsB,eAAe,CACpC,MAAM,EAA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,GACT,OAAO,CAAC,mBAAmB,CAAC,CAQ9B;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,kBAAkB,CAAC,EAClD,eAAe,CAAC,EAAE,MAAM,GACtB,eAAe,EAAE,CA0BnB;AAED,yDAAyD;AACzD,UAAU,iBAAiB;IAC1B,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,4EAA4E;AAC5E,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EACxC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,iBAAiB,CAAC,CAO5B;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACpC,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,MAAM,EACX,EACC,MAAM,EACN,KAAK,GACL,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAAO,GAClF,OAAO,CAAC,iBAAiB,CAAC,CAY5B"}
@@ -7,7 +7,8 @@ import type { CodexAuth } from "./credentials.ts";
7
7
  * Why a turn without tools (`disableTools`) fails on Codex. With every
8
8
  * feature that offers one turned off, Codex 0.160 still gives a code-mode
9
9
  * model its `exec` and `wait`, `apply_patch` inside `exec`, its sub-agent
10
- * tools and `request_user_input` (`.context/rehearsal/m3-tools.ts`), so the
10
+ * tools and `request_user_input` (LLP 0017, Codex's own tools, which found
11
+ * the same with every `builtInTools` group off), so the
11
12
  * model would still act: the turn is refused instead of running tools the
12
13
  * caller turned off.
13
14
  */
@@ -30,11 +31,37 @@ export declare function processIdentity(options: AgentExecuteOptions): CodexProc
30
31
  export declare function codexSessionCompatible(existing: CodexProcessIdentity & {
31
32
  threadId: string;
32
33
  }, options: AgentExecuteOptions): boolean;
33
- /** How the harness starts `codex app-server` for a folder, its `env` and a login. */
34
+ /**
35
+ * How the harness starts `codex app-server` for a folder, its `env` and a
36
+ * login, at the operator's `inheritConfig`.
37
+ */
34
38
  export declare function clientOptionsFor(codexPath: string, { cwd, env }: {
35
39
  cwd: string;
36
40
  env?: Record<string, string>;
37
- }, auth: CodexAuth | undefined, experimentalApi: boolean): Omit<CodexAppServerClientOptions, "processes">;
38
- /** The params `thread/start` and `thread/resume` take for a turn with these options. */
39
- export declare function threadParams(options: AgentExecuteOptions, inheritConfig?: InheritConfig): Record<string, unknown>;
41
+ }, auth: CodexAuth | undefined, experimentalApi: boolean, inheritConfig?: InheritConfig): Omit<CodexAppServerClientOptions, "processes">;
42
+ /**
43
+ * Codex's own tools, by group, that the operator leaves on (the default for
44
+ * each, Codex's own behaviour) or turns off for every thread (LLP 0017).
45
+ */
46
+ export interface CodexBuiltInTools {
47
+ /** The local environment: the shell, unified exec, `apply_patch`, `view_image`, `write_stdin`. */
48
+ local?: boolean;
49
+ webSearch?: boolean;
50
+ imageGeneration?: boolean;
51
+ }
52
+ /** What the operator decides for every thread the harness opens. Never from the wire. */
53
+ export interface CodexThreadPolicy {
54
+ inheritConfig?: InheritConfig;
55
+ builtInTools?: CodexBuiltInTools;
56
+ }
57
+ /** `thread/start` and `thread/resume` params, as far as the engine reads them. */
58
+ export interface CodexThreadParams extends Record<string, unknown> {
59
+ config: Record<string, unknown>;
60
+ }
61
+ /**
62
+ * The params `thread/start` and `thread/resume` take for a turn with these
63
+ * options. `mcpServers`: the servers the thread carries in its own config,
64
+ * for a turn that names no home.
65
+ */
66
+ export declare function threadParams(options: AgentExecuteOptions, policy?: CodexThreadPolicy, mcpServers?: Record<string, unknown>): CodexThreadParams;
40
67
  //# sourceMappingURL=options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/options.ts"],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T;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,MAAM,EACjB,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,EAC3D,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,eAAe,EAAE,OAAO,EACxB,aAAa,GAAE,aAAqB,GAClC,IAAI,CAAC,2BAA2B,EAAE,WAAW,CAAC,CAchD;AAMD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC,kGAAkG;IAClG,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,yFAAyF;AACzF,MAAM,WAAW,iBAAiB;IACjC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE,iBAAiB,CAAC;CACjC;AAED,kFAAkF;AAClF,MAAM,WAAW,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACjE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,mBAAmB,EAC5B,MAAM,GAAE,iBAAsB,EAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,iBAAiB,CA0DnB"}
@@ -2,7 +2,7 @@ import { type CodexRawEvent } from "./events.ts";
2
2
  import { type ThreadSettings } from "./thread-settings.ts";
3
3
  import type { CodexTurn, NativeTurn } from "./turn.ts";
4
4
  /** Codex's turn that carries out the user's answer to its plan. */
5
- export interface NextTurn {
5
+ interface NextTurn {
6
6
  params: Record<string, unknown>;
7
7
  settings: ThreadSettings;
8
8
  /** The thread's sandbox once it runs. */
@@ -16,4 +16,5 @@ export interface NextTurn {
16
16
  * one), or has nobody to ask, presents the plan as written.
17
17
  */
18
18
  export declare function askPlan(turn: CodexTurn, native: NativeTurn): AsyncGenerator<CodexRawEvent, NextTurn | undefined>;
19
+ export {};
19
20
  //# sourceMappingURL=plan-approval.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plan-approval.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/plan-approval.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5F,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAWvD,mEAAmE;AACnE,MAAM,WAAW,QAAQ;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,cAAc,CAAC;IACzB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;CAChB;AAQD;;;;;;GAMG;AACH,wBAAuB,OAAO,CAC7B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,UAAU,GAChB,cAAc,CAAC,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC,CA0FrD"}
1
+ {"version":3,"file":"plan-approval.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/plan-approval.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5F,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAWvD,mEAAmE;AACnE,UAAU,QAAQ;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,EAAE,cAAc,CAAC;IACzB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;CAChB;AAQD;;;;;;GAMG;AACH,wBAAuB,OAAO,CAC7B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,UAAU,GAChB,cAAc,CAAC,aAAa,EAAE,QAAQ,GAAG,SAAS,CAAC,CA0FrD"}
@@ -51,6 +51,15 @@ export interface CodexItem {
51
51
  } | string;
52
52
  /** A `webSearch`. */
53
53
  query?: string;
54
+ /**
55
+ * An `imageGeneration`: the prompt Codex wrote, once done; where Codex
56
+ * saved the picture; why it failed. (Its base64 `result` is not read.)
57
+ */
58
+ revisedPrompt?: string | null;
59
+ savedPath?: string;
60
+ failure?: {
61
+ type?: string;
62
+ } | null;
54
63
  /** A `collabAgentToolCall`: a sub-agent spawned, messaged or waited on. */
55
64
  receiverThreadIds?: string[];
56
65
  prompt?: string | null;
@@ -67,7 +76,7 @@ export interface CodexItem {
67
76
  clientId?: string | null;
68
77
  }
69
78
  /** A turn as `turn/started` and `turn/completed` name it (`Turn`). */
70
- export interface CodexTurnInfo {
79
+ interface CodexTurnInfo {
71
80
  id?: string;
72
81
  /** `completed`, `interrupted` (stopped: a cancel, or an approval answered cancel), `failed`. */
73
82
  status?: string;
@@ -92,8 +101,12 @@ export interface CodexThreadOpened {
92
101
  export declare function codexItem(n: CodexNotification): CodexItem | undefined;
93
102
  /** The turn a notification names (`turn/started`, `turn/completed`). */
94
103
  export declare function codexTurn(n: CodexNotification): CodexTurnInfo | undefined;
95
- /** Whether a notification ends Codex's turn: its completion, or an error Codex will not retry. */
96
- export declare function endsNativeTurn(n: CodexNotification): boolean;
104
+ /**
105
+ * An `error` Codex will not retry: its turn failed, and it ends that turn with
106
+ * `turn/completed` next. Seen on 0.160, some time later.
107
+ */
108
+ export declare function failing(n: CodexNotification): boolean;
97
109
  /** An `error` Codex retries what failed after: the turn goes on, and more is to come. */
98
110
  export declare function retrying(n: CodexNotification): boolean;
111
+ export {};
99
112
  //# sourceMappingURL=protocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protoc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AAoB,CAAC,EAAE,yBAAyB,CAAC;IACjD,MAAM,EAAE,WAAW,CAAC;IACpB,wDAAwD;IACxD,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,8EAA8E;IAC9E,IAAI,EAAE,cAAc,CAAC;CACrB;AAkDD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAoB9D;AA2MD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAC1B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAazB"}
@@ -1,10 +1,9 @@
1
1
  import type { AgentExecuteOptions } from "../base.ts";
2
- import type { InheritConfig } from "../inherit-config.ts";
3
2
  import type { CodexConnection } from "./client.ts";
4
3
  import { type CodexAuth } from "./credentials.ts";
5
4
  import { CodexMcpState, type CodexTurnMcp } from "./mcp.ts";
6
5
  import type { CodexModelThinking } from "./models.ts";
7
- import { type CodexProcessIdentity } from "./options.ts";
6
+ import { type CodexProcessIdentity, type CodexThreadPolicy } from "./options.ts";
8
7
  import { type CodexTurnScope } from "./requests.ts";
9
8
  import { CodexThread } from "./thread-settings.ts";
10
9
  /** One `codex app-server` process, running a logical session's thread. */
@@ -14,53 +13,68 @@ export interface CodexSession extends CodexProcessIdentity {
14
13
  /** Native model connections retain the identity used at their first handshake. */
15
14
  authFingerprint?: string;
16
15
  mcp: CodexMcpState;
16
+ /**
17
+ * The `mcp_servers` table its thread was opened with
18
+ * (`threadServersFingerprint`): a turn that needs another runs in another
19
+ * process.
20
+ */
21
+ threadServers: string;
22
+ /**
23
+ * The environments each `turn/start` names, when the operator turned
24
+ * Codex's local tools off (`CodexTurn` sends them; it knows no policy).
25
+ */
26
+ environments?: [];
17
27
  /** The logical session's thread settings, which outlive this process. */
18
28
  thread: CodexThread;
19
29
  /** The turn that has the session: Codex's requests answer for it alone. */
20
30
  turn?: CodexTurnScope;
21
31
  /**
22
- * Host suspension left its MCP connections stale: the turn running on it
23
- * finishes, and the next turn replaces the process.
32
+ * Whether a host resume came since it started, which left its MCP
33
+ * connections dead: no `turn/start` is sent on it, and the next turn
34
+ * replaces it (the pool's `startedBeforeResume`).
24
35
  */
25
- stale?: boolean;
26
- /** The login it started with (`CodexSessions.loginChanged`): an older one's next turn replaces it. */
27
- login: number;
36
+ startedBeforeResume(): boolean;
37
+ /** The folder its `CODEX_HOME` was when it started (`homeIdentity`): another one's turn replaces it. */
38
+ home?: string;
28
39
  /** What each model accepts, from this process's `model/list`; read once. */
29
40
  modelThinking?: Promise<ReadonlyMap<string, CodexModelThinking> | undefined>;
30
- idleTimer?: ReturnType<typeof setTimeout>;
31
41
  }
32
42
  /** Starts a connection to a new `codex app-server` for a turn's folder, `env` and login. */
33
- export type CodexConnector = (options: AgentExecuteOptions, auth: CodexAuth | undefined, signal: AbortSignal) => Promise<CodexConnection>;
43
+ type CodexConnector = (options: AgentExecuteOptions, auth: CodexAuth | undefined, signal: AbortSignal) => Promise<CodexConnection>;
34
44
  /**
35
- * The Codex harness's sessions: each logical session's process, while it
36
- * lives, and what outlives it (its thread settings, its home), plus the
37
- * managed sessions whose native cleanup was not confirmed.
45
+ * The Codex harness's sessions: what is Codex's own of each logical
46
+ * session's process (its thread, its home, its account, its MCP table), on
47
+ * the process pool, which decides when one is reused, replaced or ended;
48
+ * what outlives a process (its thread settings, its home); and the managed
49
+ * sessions whose native cleanup was not confirmed.
38
50
  */
39
51
  export declare class CodexSessions {
40
52
  private readonly connect;
41
- private readonly idleMs;
42
- /** The operator's: what a thread loads by itself, and whether every turn needs a home. */
43
- private readonly inheritConfig;
53
+ /** The operator's: what a thread loads by itself, whether every turn needs a home, and Codex's own tools. */
54
+ private readonly policy;
44
55
  private readonly pool;
45
56
  private readonly threads;
46
57
  private readonly homes;
47
58
  /** Managed sessions whose process was not confirmed stopped: no successor runs until it is. */
48
59
  private readonly unsettled;
49
- /** Counts the login changes: a process keeps the login it read at its start. */
50
- private login;
51
60
  constructor(connect: CodexConnector, idleMs: number,
52
- /** The operator's: what a thread loads by itself, and whether every turn needs a home. */
53
- inheritConfig?: InheritConfig);
61
+ /** The operator's: what a thread loads by itself, whether every turn needs a home, and Codex's own tools. */
62
+ policy?: CodexThreadPolicy);
54
63
  get(sessionId: string): CodexSession | undefined;
55
64
  /** The turn's MCP servers, in the `CODEX_HOME` the session claims when the turn names one. */
56
65
  mcpFor(options: AgentExecuteOptions): CodexTurnMcp;
57
66
  /**
58
- * The session's process for the turn, which takes it: the running one when
59
- * the turn can run there as the same account, else a new one, on the same
60
- * thread. Codex caches an authenticated model WebSocket across turns, so
67
+ * The session's process for the turn, which takes it (the pool's rule):
68
+ * the running one when the turn can run there as the same account, else a
69
+ * new one, on the same thread. Codex caches an authenticated model WebSocket across turns, so
61
70
  * login alone cannot switch its identity: an account or key change
62
71
  * restarts the process and resumes the thread. Same-account token renewal
63
- * keeps it warm.
72
+ * keeps it warm. So does an unchanged `mcp_servers` table, the servers
73
+ * the thread carries. A thread's config is fixed once it is open, so
74
+ * another table resumes the thread in a new process, which checks them
75
+ * against Codex's configuration again before the thread opens: the user
76
+ * may change it while the old process exits. A home removed or made again
77
+ * under the process starts a new one too.
64
78
  */
65
79
  acquire(options: AgentExecuteOptions, turn: CodexTurnScope, mcp: CodexTurnMcp): Promise<CodexSession>;
66
80
  /** The turn is done with the session: an open process waits for the next one, at most `idleMs`. */
@@ -76,21 +90,44 @@ export declare class CodexSessions {
76
90
  stopUnsettled(sessionId: string): Promise<boolean> | undefined;
77
91
  /**
78
92
  * Unchanged MCP config reloads retain dead remote connections after VM
79
- * resume: every process goes, but a turn that is running finishes first,
80
- * and its session is replaced before the next (the strict thread/resume
81
- * path).
93
+ * resume: each session's next turn replaces its process and resumes its
94
+ * thread (the strict thread/resume path). Nothing is ended now; a turn
95
+ * still setting up sends no `turn/start` on its process (`CodexTurn`).
82
96
  */
83
97
  invalidate(): void;
84
98
  /**
85
- * The login changed: an app-server keeps the one it read at its start, so
86
- * each session's next turn starts a new one, resuming its thread. A turn
99
+ * The login changed in `store` (every store when none is named): an
100
+ * app-server keeps the one it read at its start, so each of that store's
101
+ * sessions starts its next turn on a new one, resuming its thread. A turn
87
102
  * already setting up or running finishes on its own.
88
103
  */
89
- loginChanged(): void;
90
- /** Forget the session: its process, its thread settings and its home. */
91
- release(sessionId: string): void;
92
- terminateAll(): void;
93
- private reuse;
104
+ loginChanged(store?: string): void;
105
+ /**
106
+ * Forget the session: its process, its thread settings and its home.
107
+ * Settles once every app-server of the session has exited, one an idle
108
+ * eviction or a replacement ended earlier included (the pool's
109
+ * `release`): a product removes the session's home on this answer, and an
110
+ * exiting app-server still writes there.
111
+ */
112
+ release(sessionId: string): Promise<void>;
113
+ /** End every app-server, and settle once each has exited. */
114
+ terminateAll(): Promise<void>;
115
+ /**
116
+ * What changes on the warm process without a restart, for the turn: its
117
+ * account logged in again (a renewed token), and the `mcp_servers` table
118
+ * its thread needs checked against Codex's own configuration. Another
119
+ * table cannot be changed on an open thread, so the thread resumes in a
120
+ * new process. A cancel meanwhile ends the process, as Codex's answer is
121
+ * not waited for; a refused login ends it too, and a refused table read
122
+ * leaves it for the session's next turn.
123
+ */
124
+ private applyLiveChange;
125
+ /**
126
+ * Start an app-server for the turn and open the session's thread on it.
127
+ * The pool starts it once every app-server of the session before it has
128
+ * exited.
129
+ */
94
130
  private spawn;
95
131
  }
132
+ export {};
96
133
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAA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OAMG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOzC,6DAA6D;IAC7D,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAO7B;;;;;;;;OAQG;YACW,eAAe;IA+B7B;;;;OAIG;YACW,KAAK;CA6DnB"}
@@ -6,12 +6,11 @@ import type { NativeTurn, TurnStop } from "./turn.ts";
6
6
  export declare class CodexTurnSubagents {
7
7
  private readonly client;
8
8
  private readonly root;
9
- private readonly timeoutMs;
10
9
  private readonly parents;
11
10
  private readonly candidates;
12
11
  private readonly active;
13
12
  private activeAtParentEnd;
14
- constructor(client: CodexConnection, root: string, timeoutMs: number);
13
+ constructor(client: CodexConnection, root: string);
15
14
  observe(notification: CodexNotification): void;
16
15
  private read;
17
16
  owns(id: string): Promise<boolean>;
@@ -33,14 +32,20 @@ export declare class ManagedStop implements TurnStop {
33
32
  private readonly threadId;
34
33
  private readonly commands;
35
34
  private readonly signal;
36
- /** Every cleanup request's deadline; five of them, the whole cleanup's. */
35
+ /**
36
+ * How long Codex has to answer the `turn/interrupt` that stops its turn
37
+ * before its process is ended (`cancelGraceMs`).
38
+ */
37
39
  private readonly graceMs;
38
40
  /** Keep the session from another turn until its process is confirmed stopped. */
39
41
  private readonly quarantine;
40
42
  readonly continues = false;
41
43
  private finishing?;
42
44
  constructor(subagents: CodexTurnSubagents, client: CodexConnection, threadId: string, commands: TurnCommands, signal: AbortSignal,
43
- /** Every cleanup request's deadline; five of them, the whole cleanup's. */
45
+ /**
46
+ * How long Codex has to answer the `turn/interrupt` that stops its turn
47
+ * before its process is ended (`cancelGraceMs`).
48
+ */
44
49
  graceMs: number,
45
50
  /** Keep the session from another turn until its process is confirmed stopped. */
46
51
  quarantine: () => void);
@@ -1 +1 @@
1
- {"version":3,"file":"subagents.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/subagents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAS,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E,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;YAc1B,WAAW;IAmBzB,uFAAuF;IACjF,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;CA0DhC;AAED;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,QAAQ;IAK1C,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,iFAAiF;IACjF,OAAO,CAAC,QAAQ,CAAC,UAAU;IAf5B,QAAQ,CAAC,SAAS,SAAS;IAC3B,OAAO,CAAC,SAAS,CAAC,CAAmB;gBAGnB,SAAS,EAAE,kBAAkB,EAC7B,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,WAAW;IACpC;;;OAGG;IACc,OAAO,EAAE,MAAM;IAChC,iFAAiF;IAChE,UAAU,EAAE,MAAM,IAAI;IAGxC,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAK3D,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvC,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKnC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAM9B,OAAO,CAAC,MAAM;CAyCd"}
@@ -28,7 +28,7 @@ export interface ThreadSettings {
28
28
  readonly effortSet: boolean;
29
29
  }
30
30
  /** What a turn sends Codex to run as its options ask, and what it leaves the thread on. */
31
- export interface TurnSettings {
31
+ interface TurnSettings {
32
32
  /** The `turn/start` params that carry them. */
33
33
  params: Record<string, unknown>;
34
34
  /** The thinking level and reported model the turn runs, as far as the engine knows. */
@@ -71,7 +71,7 @@ export declare class CodexThread {
71
71
  * cannot, the thread keeps what Codex has, and a later turn that names no
72
72
  * model sends the default.
73
73
  */
74
- restore(session: CodexSession, previous: ThreadSettings, sent: Record<string, unknown>, timeoutMs: number): Promise<void>;
74
+ restore(session: CodexSession, previous: ThreadSettings, sent: Record<string, unknown>): Promise<void>;
75
75
  /**
76
76
  * What a turn that names no model or level runs. Read once; empty when
77
77
  * Codex cannot say, and read again by a later turn.
@@ -84,4 +84,5 @@ export declare class CodexThread {
84
84
  */
85
85
  private defaultEffort;
86
86
  }
87
+ export {};
87
88
  //# sourceMappingURL=thread-settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"thread-settings.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/thread-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AASxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,gGAAgG;IAChG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,6DAA6D;IAC7D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B;AAED,2FAA2F;AAC3F,MAAM,WAAW,YAAY;IAC5B,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,uFAAuF;IACvF,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,IAAI,EAAE,cAAc,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,cAAc,GAClB;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,CAiB3D;AA8BD,0EAA0E;AAC1E,qBAAa,WAAW;IACvB,QAAQ,EAAE,cAAc,CAAyC;IACjE,kFAAkF;IAClF,OAAO,CAAC,QAAQ,CAAC,CAA+B;IAEhD;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI;IAuBpE;;;;;OAKG;IACG,OAAO,CACZ,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,YAAY,EACrB,IAAI,EAAE,cAAc,GAClB,OAAO,CAAC,YAAY,CAAC;IAqDxB;;;;;;OAMG;IACG,OAAO,CACZ,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IA2BhB;;;OAGG;IACH,OAAO,CAAC,WAAW;IAcnB;;;;OAIG;YACW,aAAa;CAU3B"}
1
+ {"version":3,"file":"thread-settings.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/thread-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AASxE,OAAO,KAAK,EAAE,iB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ClB,OAAO,CAAC,YAAY,CAAC;IA6DxB;;;;;;OAMG;IACG,OAAO,CACZ,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC3B,OAAO,CAAC,IAAI,CAAC;IA2BhB;;;OAGG;IACH,OAAO,CAAC,WAAW;IAcnB;;;;OAIG;YACW,aAAa;CAU3B"}
@@ -1,6 +1,6 @@
1
1
  import { type CodexFileChange, type CodexNotification } from "./protocol.ts";
2
2
  /** An MCP tool call Codex started and may ask consent for. */
3
- export interface CodexMcpCall {
3
+ interface CodexMcpCall {
4
4
  id: string;
5
5
  threadId?: string;
6
6
  server: string;
@@ -30,4 +30,5 @@ export declare class TurnItems {
30
30
  /** The edits of a file change Codex asks to apply. */
31
31
  changesOf(itemId: string): CodexFileChange[];
32
32
  }
33
+ export {};
33
34
  //# sourceMappingURL=turn-items.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"turn-items.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/turn-items.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAa,MAAM,eAAe,CAAC;AAExF,8DAA8D;AAC9D,MAAM,WAAW,YAAY;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,qBAAa,SAAS;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAC/C,4DAA4D;IAC5D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAwC;IAEpE,OAAO,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI;IA8BnC;;;;OAIG;IAC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GAAG,eAAe,EAAE;CAG5C"}
@@ -9,9 +9,9 @@ import type { CodexTurnScope } from "./requests.ts";
9
9
  import type { CodexSession } from "./session.ts";
10
10
  /**
11
11
  * How one of Codex's turns ended: its `turn/completed` status, or `error`
12
- * when an error Codex would not retry ended it for the stream.
12
+ * when an error Codex would not retry had no `turn/completed` after it.
13
13
  */
14
- export type NativeOutcome = "completed" | "interrupted" | "failed" | "error";
14
+ type NativeOutcome = "completed" | "interrupted" | "failed" | "error";
15
15
  /** One of Codex's turns, `turn/start` to its end, within an engine turn. */
16
16
  export declare class NativeTurn {
17
17
  /** Codex's id for it, once `turn/started` names it. */
@@ -25,6 +25,8 @@ export declare class NativeTurn {
25
25
  itemId: string;
26
26
  text: string;
27
27
  };
28
+ /** The error Codex would not retry, held for the stream until Codex's turn ends. */
29
+ failure?: CodexNotification;
28
30
  /** Its events took their last: at its end, or once a managed turn's cleanup is done. */
29
31
  finished: boolean;
30
32
  private settle;
@@ -52,8 +54,9 @@ export interface TurnStop {
52
54
  /** Codex's turn ended with `n`: its events end, now or once the stop cleaned up. */
53
55
  nativeEnded(native: NativeTurn, n: CodexNotification): void;
54
56
  /**
55
- * Stop for a cancel: Codex's turn, once it began. Resolves whether the stop
56
- * is confirmed (`CancelResult.confirmed`).
57
+ * Stop for a cancel: Codex's turn, once it began, else the process it
58
+ * would run on. Resolves whether the stop is confirmed
59
+ * (`CancelResult.confirmed`).
57
60
  */
58
61
  cancel(native?: NativeTurn): Promise<boolean>;
59
62
  /** The commands whose outcome a turn that ended cancelled leaves unknown. */
@@ -82,7 +85,7 @@ export declare class InterruptStop implements TurnStop {
82
85
  private force;
83
86
  }
84
87
  /** Lets Codex's turn take steers: the agent's `openSteering` and `holdSteering`. */
85
- export interface TurnSteering {
88
+ interface TurnSteering {
86
89
  /** Codex's turn takes input now: the steers that wait go to it, then each as it comes. */
87
90
  open(deliver: DeliverSteer): void;
88
91
  /** Codex's turn takes no more: steers wait for its next. */
@@ -97,7 +100,9 @@ export interface TurnSteering {
97
100
  export declare function codexSteerRefused(error: unknown): boolean;
98
101
  /** How long an engine turn on Codex waits for it. */
99
102
  export interface CodexTurnTiming {
100
- /** `cancelGraceMs`: an interrupt, a stop, a thread settings update. */
103
+ /** `cancelConfirmMs`: how long Codex has to say its turn ended, a cancelled or a failed one. */
104
+ confirmMs: number;
105
+ /** `cancelGraceMs`: how long a cancelled turn has to stop before Codex's process is ended. */
101
106
  graceMs: number;
102
107
  /** How long a retryable error may go unanswered before the turn is failed. */
103
108
  retryStallMs: number;
@@ -124,13 +129,24 @@ export declare class CodexTurn {
124
129
  private native;
125
130
  /** Codex's turns in this one: a plan's, then the one carrying out its answer. */
126
131
  private readonly turnIds;
132
+ /**
133
+ * The one deadline the turn waits on: while Codex retries, how long it may
134
+ * go silent (`watchStall`); once its turn is failing, how long its
135
+ * turn/completed may take (`failed`). A cancel and the turn's end clear it.
136
+ */
127
137
  private stallTimer?;
128
138
  private acknowledged?;
129
139
  private readonly unsubscribe;
140
+ private accepted;
130
141
  constructor(session: CodexSession, scope: CodexTurnScope, options: AgentExecuteOptions, commands: TurnCommands, stop: TurnStop, steering: TurnSteering, timing: CodexTurnTiming);
131
142
  get signal(): AbortSignal;
132
- /** The cancel's acknowledgement, once one came: whether Codex's turn stopped. */
133
- get acknowledgement(): Promise<boolean> | undefined;
143
+ /** Stop Codex's turn for the cancel, once: whether it stopped. */
144
+ cancel(): Promise<boolean>;
145
+ /**
146
+ * Codex took a turn of this one (it accepted `turn/start`): from then on
147
+ * it writes the thread, which before had nothing to resume.
148
+ */
149
+ get taken(): boolean;
134
150
  /** Whether the turn puts Codex's plan to the user: a plan turn with someone to ask. */
135
151
  get asksAboutPlans(): boolean;
136
152
  /** Run the turn: Codex's first turn, then each one an answer to its plan runs. */
@@ -152,12 +168,25 @@ export declare class CodexTurn {
152
168
  private start;
153
169
  private observe;
154
170
  private began;
171
+ /**
172
+ * Codex's turn failed. It ends at its own turn/completed, which Codex sends
173
+ * after: ended here, Codex's turn would still be running, and the session's
174
+ * next turn/start would steer it and end on its turn/completed. Without one
175
+ * within `confirmMs`, it ends with the error, and its process with it. The
176
+ * wait runs from the first failure: a later one changes nothing, or a run
177
+ * of them would keep the turn open. After a cancel, its interrupt's grace
178
+ * governs.
179
+ */
180
+ private failed;
155
181
  private ended;
156
182
  /**
157
183
  * A retryable error promises more notifications. If none arrive, the
158
184
  * subprocess is wedged-but-alive and the turn would hang forever: bound it.
185
+ * A failing turn's deadline is not this one's to move: what Codex sends
186
+ * after its error leaves it as it is.
159
187
  */
160
188
  private watchStall;
161
189
  private clearStall;
162
190
  }
191
+ export {};
163
192
  //# sourceMappingURL=turn.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"turn.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/turn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,mBAAmB,EAA8B,MAAM,YAAY,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,KAAK,SAAS,EAAe,MAAM,YAAY,CAAC;AAEzD,OAAO,EACN,KAAK,iBAAiB,EAKtB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7E,4EAA4E;AAC5E,qBAAa,UAAU;IACtB,uDAAuD;IACvD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,QAAQ,CAAC,KAAK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AU;CAIlB"}
@@ -0,0 +1,28 @@
1
+ import type { CodexConnection } from "./client.ts";
2
+ import type { CodexAuth } from "./credentials.ts";
3
+ /** What Codex's `getAuthStatus` answers: the login of the home its app-server runs in. */
4
+ export interface CodexAuthStatus {
5
+ /** `chatgpt`, `apikey` (lowercase), another kind, or none when signed out. */
6
+ authMethod?: string | null;
7
+ /** The login's access token, or its key; asked for only to hand it to a session's process. */
8
+ authToken?: string | null;
9
+ requiresOpenaiAuth?: boolean;
10
+ }
11
+ /** Read the user's own login, renewed by Codex in its own home first when `refreshToken`. */
12
+ export type ReadUserLogin = (refreshToken: boolean, signal?: AbortSignal) => Promise<CodexAuthStatus>;
13
+ /**
14
+ * One read of the user's own login: a new app-server on the engine's own
15
+ * Codex home (`connect` gives it the engine's environment, never a session's
16
+ * `CODEX_HOME`), asked once and ended at once. Nothing is kept between reads.
17
+ */
18
+ export declare function userLoginReader(connect: () => Promise<CodexConnection>): ReadUserLogin;
19
+ /**
20
+ * The user's own Codex login as a session's process logs in with it: a
21
+ * ChatGPT login as its tokens, held in that process's memory, or an API key.
22
+ * When Codex refuses the token it holds, a fresher one: the login read again,
23
+ * and when that is still the refused token, renewed by Codex in the user's
24
+ * own home under its own lock. No login, or one that cannot be handed over,
25
+ * fails the turn before any process of the session starts.
26
+ */
27
+ export declare function userAuth(read: ReadUserLogin, signal?: AbortSignal): Promise<CodexAuth>;
28
+ //# sourceMappingURL=user-login.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-login.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/user-login.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,0FAA0F;AAC1F,MAAM,WAAW,eAAe;IAC/B,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,8FAA8F;IAC9F,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,6FAA6F;AAC7F,MAAM,MAAM,aAAa,GAAG,CAC3B,YAAY,EAAE,OAAO,EACrB,MAAM,CAAC,EAAE,WAAW,KAChB,OAAO,CAAC,eAAe,CAAC,CAAC;AAE9B;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,GAAG,aAAa,CAetF;AA+BD;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAyB5F"}
@@ -9,7 +9,9 @@ import { type CredentialRequest, type HarnessCredential, type HarnessCredentials
9
9
  export type CredentialSource = (request: CredentialRequest, signal?: AbortSignal) => Promise<HarnessCredential | undefined>;
10
10
  /**
11
11
  * The product's credential for a harness, as the kind it runs on: one it
12
- * cannot run fails the turn here, before anything starts.
12
+ * cannot run fails the turn here, before anything starts. A turn cancelled
13
+ * meanwhile stops waiting at once, whether or not the source heeds `signal`,
14
+ * and an answer that comes after is dropped.
13
15
  */
14
16
  export declare function credentialFor<H extends keyof HarnessCredentials>(source: CredentialSource, request: CredentialRequest & {
15
17
  harness: H;