@zvada/agent-server 0.3.22 → 0.3.24

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 (558) hide show
  1. package/CHANGELOG.md +295 -0
  2. package/README.md +14 -5
  3. package/dist/accounts/chatgpt.js +144 -0
  4. package/dist/accounts/check.js +71 -0
  5. package/dist/accounts/claude.js +80 -0
  6. package/dist/accounts/endpoint.js +104 -0
  7. package/dist/accounts/http.js +58 -0
  8. package/dist/accounts/index.js +9 -0
  9. package/dist/client/client.js +686 -0
  10. package/dist/client/connection.js +338 -0
  11. package/dist/client/history.js +49 -0
  12. package/dist/client/index.js +6 -0
  13. package/dist/client/listeners.js +19 -0
  14. package/dist/client/logins.js +92 -0
  15. package/dist/client/rpc.js +105 -0
  16. package/dist/client/streams.js +432 -0
  17. package/dist/client/transports.js +118 -0
  18. package/dist/client/turns.js +122 -0
  19. package/dist/core/agents/acp/acp-agent.js +425 -0
  20. package/dist/core/agents/acp/adapter.js +231 -0
  21. package/dist/core/agents/acp/client.js +222 -0
  22. package/dist/core/agents/acp/known-agents.js +57 -0
  23. package/dist/core/agents/acp/mappings.js +164 -0
  24. package/dist/core/agents/acp/requests.js +79 -0
  25. package/dist/core/agents/attachments.js +14 -0
  26. package/dist/core/agents/base.js +64 -0
  27. package/dist/core/agents/claude-code/adapter.js +474 -0
  28. package/dist/core/agents/claude-code/approvals.js +245 -0
  29. package/dist/core/agents/claude-code/claude-agent.js +319 -0
  30. package/dist/core/agents/claude-code/credentials.js +142 -0
  31. package/dist/core/agents/claude-code/events.js +11 -0
  32. package/dist/core/agents/claude-code/login.js +217 -0
  33. package/dist/core/agents/claude-code/mcp.js +181 -0
  34. package/dist/core/agents/claude-code/models.js +74 -0
  35. package/dist/core/agents/claude-code/options.js +240 -0
  36. package/dist/core/agents/claude-code/outcome.js +204 -0
  37. package/dist/core/agents/claude-code/results.js +58 -0
  38. package/dist/core/agents/claude-code/sdk-pair.js +59 -0
  39. package/dist/core/agents/claude-code/session.js +593 -0
  40. package/dist/core/agents/claude-code/spawn.js +125 -0
  41. package/dist/core/agents/claude-code/spend.js +118 -0
  42. package/dist/core/agents/claude-code/tools.js +131 -0
  43. package/dist/core/agents/claude-code/turn-usage.js +121 -0
  44. package/dist/core/agents/claude-code/turn.js +199 -0
  45. package/dist/core/agents/codex-app-server/adapter.js +463 -0
  46. package/dist/core/agents/codex-app-server/client.js +338 -0
  47. package/dist/core/agents/codex-app-server/codex-agent.js +294 -0
  48. package/dist/core/agents/codex-app-server/commands.js +184 -0
  49. package/dist/core/agents/codex-app-server/credentials.js +92 -0
  50. package/dist/core/agents/codex-app-server/effort.js +13 -0
  51. package/dist/core/agents/codex-app-server/events.js +18 -0
  52. package/dist/core/agents/codex-app-server/homes.js +118 -0
  53. package/dist/core/agents/codex-app-server/input.js +52 -0
  54. package/dist/core/agents/codex-app-server/items.js +307 -0
  55. package/dist/core/agents/codex-app-server/login.js +183 -0
  56. package/dist/core/agents/codex-app-server/mcp.js +323 -0
  57. package/dist/core/agents/codex-app-server/models.js +160 -0
  58. package/dist/core/agents/codex-app-server/options.js +155 -0
  59. package/dist/core/agents/codex-app-server/plan-approval.js +124 -0
  60. package/dist/core/agents/codex-app-server/protocol.js +38 -0
  61. package/dist/core/agents/codex-app-server/requests.js +250 -0
  62. package/dist/core/agents/codex-app-server/session.js +278 -0
  63. package/dist/core/agents/codex-app-server/subagents.js +260 -0
  64. package/dist/core/agents/codex-app-server/thread-settings.js +214 -0
  65. package/dist/core/agents/codex-app-server/turn-items.js +69 -0
  66. package/dist/core/agents/codex-app-server/turn.js +448 -0
  67. package/dist/core/agents/codex-app-server/user-login.js +78 -0
  68. package/dist/core/agents/config-fingerprint.js +10 -0
  69. package/dist/core/agents/credentials.js +71 -0
  70. package/dist/core/agents/diffs.js +27 -0
  71. package/dist/core/agents/elicitation.js +42 -0
  72. package/dist/core/agents/inherit-config.js +5 -0
  73. package/dist/core/agents/login.js +56 -0
  74. package/dist/core/agents/mcp-config.js +109 -0
  75. package/dist/core/agents/plan.js +6 -0
  76. package/dist/core/agents/process-pool.js +307 -0
  77. package/dist/core/agents/registry.js +49 -0
  78. package/dist/core/agents/scripted/adapter.js +86 -0
  79. package/dist/core/agents/scripted/mcp-call.js +74 -0
  80. package/dist/core/agents/scripted/scripted-agent.js +330 -0
  81. package/dist/core/agents/scripted/scripts.js +154 -0
  82. package/dist/core/agents/scripted/steps.js +87 -0
  83. package/dist/core/agents/session-agent.js +209 -0
  84. package/dist/core/agents/stderr-tail.js +71 -0
  85. package/dist/core/agents/thinking-levels.js +9 -0
  86. package/dist/core/agents/types.js +1 -0
  87. package/dist/core/diagnostics.js +23 -0
  88. package/dist/core/index.js +31 -0
  89. package/dist/core/presets.js +114 -0
  90. package/dist/core/processes/identity.js +91 -0
  91. package/dist/core/processes/lifeline.js +210 -0
  92. package/dist/core/processes/native-processes.js +299 -0
  93. package/dist/core/processes/process-table.js +163 -0
  94. package/dist/core/provision/cache-trust.js +121 -0
  95. package/dist/core/provision/cache-usage.js +61 -0
  96. package/dist/core/provision/checksums.js +22 -0
  97. package/dist/core/provision/extract.js +28 -0
  98. package/dist/core/provision/index.js +4 -0
  99. package/dist/core/provision/install-build.js +99 -0
  100. package/dist/core/provision/npm.js +316 -0
  101. package/dist/core/provision/pins.js +35 -0
  102. package/dist/core/provision/platform.js +65 -0
  103. package/dist/core/provision/provisioner.js +372 -0
  104. package/dist/core/provision/releases.js +68 -0
  105. package/dist/core/provision/tools.js +279 -0
  106. package/dist/core/proxy/anthropic-proxy.js +163 -0
  107. package/dist/core/proxy/api-key-store.js +30 -0
  108. package/dist/core/proxy/index.js +3 -0
  109. package/dist/core/proxy/loopback.js +86 -0
  110. package/dist/core/runtime/agent-runtime.js +434 -0
  111. package/dist/core/runtime/event-processor.js +379 -0
  112. package/dist/core/runtime/event-sink.js +65 -0
  113. package/dist/core/runtime/harness-clis.js +83 -0
  114. package/dist/core/runtime/harness-logins.js +313 -0
  115. package/dist/core/runtime/login-reads.js +71 -0
  116. package/dist/core/runtime/model-lists.js +160 -0
  117. package/dist/core/runtime/permission-policy.js +84 -0
  118. package/dist/core/runtime/request-broker.js +139 -0
  119. package/dist/core/runtime/steering.js +79 -0
  120. package/dist/core/runtime/turn-outcome.js +16 -0
  121. package/dist/core/runtime/turn.js +329 -0
  122. package/dist/core/utils/bounded.js +13 -0
  123. package/dist/core/utils/deadline.js +57 -0
  124. package/dist/core/utils/errors.js +176 -0
  125. package/dist/core/utils/is-record.js +4 -0
  126. package/dist/core/utils/loopback.js +11 -0
  127. package/dist/index.js +4 -0
  128. package/dist/operator/index.js +10 -0
  129. package/dist/operator/mcp.js +139 -0
  130. package/dist/operator/operator.js +499 -0
  131. package/dist/operator/render.js +408 -0
  132. package/dist/operator/view.js +35 -0
  133. package/dist/protocol/account.js +96 -0
  134. package/dist/protocol/async-queue.js +65 -0
  135. package/dist/protocol/auth.js +169 -0
  136. package/dist/protocol/canonical.js +18 -0
  137. package/dist/protocol/clis.js +63 -0
  138. package/dist/protocol/config.js +137 -0
  139. package/dist/protocol/conversation.js +231 -0
  140. package/dist/protocol/credentials.js +141 -0
  141. package/dist/protocol/errors.js +181 -0
  142. package/dist/protocol/execution.js +28 -0
  143. package/dist/protocol/factories.js +231 -0
  144. package/dist/protocol/guards.js +71 -0
  145. package/dist/protocol/harness.js +93 -0
  146. package/dist/protocol/history.js +201 -0
  147. package/dist/protocol/ids.js +37 -0
  148. package/dist/protocol/index.js +36 -0
  149. package/dist/protocol/lifecycle.js +562 -0
  150. package/dist/protocol/meta-keys.js +17 -0
  151. package/dist/protocol/meta.js +13 -0
  152. package/dist/protocol/model-catalog.js +223 -0
  153. package/dist/protocol/models.js +84 -0
  154. package/dist/protocol/part-input.js +94 -0
  155. package/dist/protocol/parts.js +166 -0
  156. package/dist/protocol/plan.js +31 -0
  157. package/dist/protocol/reduce.js +484 -0
  158. package/dist/protocol/selectors.js +136 -0
  159. package/dist/protocol/seq-cursor.js +37 -0
  160. package/dist/protocol/stop-reasons.js +41 -0
  161. package/dist/protocol/thinking.js +31 -0
  162. package/dist/protocol/time.js +21 -0
  163. package/dist/protocol/tokens.js +57 -0
  164. package/dist/protocol/tool-closure.js +70 -0
  165. package/dist/protocol/tool-state.js +153 -0
  166. package/dist/protocol/verify.js +467 -0
  167. package/dist/protocol/vocabulary.js +27 -0
  168. package/dist/protocol/wire-api.js +94 -0
  169. package/dist/protocol/wire.js +669 -0
  170. package/dist/server/acp/binding.js +251 -0
  171. package/dist/server/acp/session-records.js +53 -0
  172. package/dist/server/acp/translate.js +401 -0
  173. package/dist/server/agent-server.js +338 -0
  174. package/dist/server/bin.js +492 -0
  175. package/dist/server/feedback.js +216 -0
  176. package/dist/server/history.js +123 -0
  177. package/dist/server/index.js +8 -0
  178. package/dist/server/install.js +171 -0
  179. package/dist/server/open-parts.js +87 -0
  180. package/dist/server/routes.js +291 -0
  181. package/dist/server/secrets.js +19 -0
  182. package/dist/server/session-gate.js +54 -0
  183. package/dist/server/session-log.js +66 -0
  184. package/dist/server/session-store.js +243 -0
  185. package/dist/server/subscriptions.js +189 -0
  186. package/dist/server/transports.js +214 -0
  187. package/dist/server/wire-error.js +26 -0
  188. package/dist/sync/event-log.js +89 -0
  189. package/dist/sync/fit.js +202 -0
  190. package/dist/sync/history-reader.js +33 -0
  191. package/dist/sync/history-sqlite.js +281 -0
  192. package/dist/sync/history.js +163 -0
  193. package/dist/sync/index.js +5 -0
  194. package/dist/sync/journal-sqlite.js +316 -0
  195. package/dist/sync/journal.js +10 -0
  196. package/dist/sync/live-tails.js +85 -0
  197. package/dist/sync/node-sqlite.js +27 -0
  198. package/dist/sync/projection.js +32 -0
  199. package/dist/sync/recovery.js +117 -0
  200. package/dist/sync/retry.js +45 -0
  201. package/dist/sync/schema.js +73 -0
  202. package/dist/sync/sql.js +94 -0
  203. package/dist/sync/sqlite-file.js +31 -0
  204. package/dist/sync/sqlite.js +18 -0
  205. package/dist/sync/worker.js +212 -0
  206. package/dist/types/accounts/chatgpt.d.ts +1 -1
  207. package/dist/types/accounts/chatgpt.d.ts.map +1 -1
  208. package/dist/types/accounts/http.d.ts +2 -4
  209. package/dist/types/accounts/http.d.ts.map +1 -1
  210. package/dist/types/client/client.d.ts +37 -11
  211. package/dist/types/client/client.d.ts.map +1 -1
  212. package/dist/types/client/connection.d.ts +64 -13
  213. package/dist/types/client/connection.d.ts.map +1 -1
  214. package/dist/types/client/index.d.ts +1 -1
  215. package/dist/types/client/index.d.ts.map +1 -1
  216. package/dist/types/client/logins.d.ts +2 -1
  217. package/dist/types/client/logins.d.ts.map +1 -1
  218. package/dist/types/client/streams.d.ts +9 -3
  219. package/dist/types/client/streams.d.ts.map +1 -1
  220. package/dist/types/client/turns.d.ts +1 -1
  221. package/dist/types/client/turns.d.ts.map +1 -1
  222. package/dist/types/core/agents/acp/acp-agent.d.ts +34 -1
  223. package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
  224. package/dist/types/core/agents/acp/adapter.d.ts.map +1 -1
  225. package/dist/types/core/agents/acp/client.d.ts +12 -3
  226. package/dist/types/core/agents/acp/client.d.ts.map +1 -1
  227. package/dist/types/core/agents/acp/mappings.d.ts +8 -2
  228. package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
  229. package/dist/types/core/agents/base.d.ts +22 -8
  230. package/dist/types/core/agents/base.d.ts.map +1 -1
  231. package/dist/types/core/agents/claude-code/adapter.d.ts +7 -0
  232. package/dist/types/core/agents/claude-code/adapter.d.ts.map +1 -1
  233. package/dist/types/core/agents/claude-code/approvals.d.ts +4 -1
  234. package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -1
  235. package/dist/types/core/agents/claude-code/claude-agent.d.ts +19 -5
  236. package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
  237. package/dist/types/core/agents/claude-code/events.d.ts +9 -1
  238. package/dist/types/core/agents/claude-code/events.d.ts.map +1 -1
  239. package/dist/types/core/agents/claude-code/login.d.ts +4 -1
  240. package/dist/types/core/agents/claude-code/login.d.ts.map +1 -1
  241. package/dist/types/core/agents/claude-code/mcp.d.ts +21 -7
  242. package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -1
  243. package/dist/types/core/agents/claude-code/models.d.ts +5 -1
  244. package/dist/types/core/agents/claude-code/models.d.ts.map +1 -1
  245. package/dist/types/core/agents/claude-code/options.d.ts +29 -10
  246. package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
  247. package/dist/types/core/agents/claude-code/outcome.d.ts +3 -5
  248. package/dist/types/core/agents/claude-code/outcome.d.ts.map +1 -1
  249. package/dist/types/core/agents/claude-code/results.d.ts +16 -0
  250. package/dist/types/core/agents/claude-code/results.d.ts.map +1 -0
  251. package/dist/types/core/agents/claude-code/sdk-pair.d.ts +13 -0
  252. package/dist/types/core/agents/claude-code/sdk-pair.d.ts.map +1 -0
  253. package/dist/types/core/agents/claude-code/session.d.ts +58 -12
  254. package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
  255. package/dist/types/core/agents/claude-code/spend.d.ts +2 -1
  256. package/dist/types/core/agents/claude-code/spend.d.ts.map +1 -1
  257. package/dist/types/core/agents/claude-code/tools.d.ts +26 -3
  258. package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -1
  259. package/dist/types/core/agents/codex-app-server/adapter.d.ts +2 -2
  260. package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -1
  261. package/dist/types/core/agents/codex-app-server/client.d.ts +12 -2
  262. package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
  263. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +58 -13
  264. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -1
  265. package/dist/types/core/agents/codex-app-server/commands.d.ts +2 -2
  266. package/dist/types/core/agents/codex-app-server/commands.d.ts.map +1 -1
  267. package/dist/types/core/agents/codex-app-server/credentials.d.ts +5 -1
  268. package/dist/types/core/agents/codex-app-server/credentials.d.ts.map +1 -1
  269. package/dist/types/core/agents/codex-app-server/effort.d.ts +2 -1
  270. package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -1
  271. package/dist/types/core/agents/codex-app-server/homes.d.ts +25 -0
  272. package/dist/types/core/agents/codex-app-server/homes.d.ts.map +1 -1
  273. package/dist/types/core/agents/codex-app-server/items.d.ts +27 -2
  274. package/dist/types/core/agents/codex-app-server/items.d.ts.map +1 -1
  275. package/dist/types/core/agents/codex-app-server/login.d.ts +16 -1
  276. package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -1
  277. package/dist/types/core/agents/codex-app-server/mcp.d.ts +15 -30
  278. package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -1
  279. package/dist/types/core/agents/codex-app-server/models.d.ts +3 -10
  280. package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -1
  281. package/dist/types/core/agents/codex-app-server/options.d.ts +27 -4
  282. package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -1
  283. package/dist/types/core/agents/codex-app-server/plan-approval.d.ts +2 -1
  284. package/dist/types/core/agents/codex-app-server/plan-approval.d.ts.map +1 -1
  285. package/dist/types/core/agents/codex-app-server/protocol.d.ts +16 -3
  286. package/dist/types/core/agents/codex-app-server/protocol.d.ts.map +1 -1
  287. package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -1
  288. package/dist/types/core/agents/codex-app-server/session.d.ts +71 -40
  289. package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -1
  290. package/dist/types/core/agents/codex-app-server/subagents.d.ts +9 -4
  291. package/dist/types/core/agents/codex-app-server/subagents.d.ts.map +1 -1
  292. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts +3 -2
  293. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -1
  294. package/dist/types/core/agents/codex-app-server/turn-items.d.ts +2 -1
  295. package/dist/types/core/agents/codex-app-server/turn-items.d.ts.map +1 -1
  296. package/dist/types/core/agents/codex-app-server/turn.d.ts +31 -8
  297. package/dist/types/core/agents/codex-app-server/turn.d.ts.map +1 -1
  298. package/dist/types/core/agents/codex-app-server/user-login.d.ts +28 -0
  299. package/dist/types/core/agents/codex-app-server/user-login.d.ts.map +1 -0
  300. package/dist/types/core/agents/credentials.d.ts +3 -1
  301. package/dist/types/core/agents/credentials.d.ts.map +1 -1
  302. package/dist/types/core/agents/diffs.d.ts +9 -0
  303. package/dist/types/core/agents/diffs.d.ts.map +1 -0
  304. package/dist/types/core/agents/elicitation.d.ts +3 -2
  305. package/dist/types/core/agents/elicitation.d.ts.map +1 -1
  306. package/dist/types/core/agents/login.d.ts +6 -0
  307. package/dist/types/core/agents/login.d.ts.map +1 -1
  308. package/dist/types/core/agents/mcp-config.d.ts +0 -4
  309. package/dist/types/core/agents/mcp-config.d.ts.map +1 -1
  310. package/dist/types/core/agents/process-pool.d.ts +201 -0
  311. package/dist/types/core/agents/process-pool.d.ts.map +1 -0
  312. package/dist/types/core/agents/scripted/adapter.d.ts +68 -0
  313. package/dist/types/core/agents/scripted/adapter.d.ts.map +1 -0
  314. package/dist/types/core/agents/scripted/mcp-call.d.ts +56 -0
  315. package/dist/types/core/agents/scripted/mcp-call.d.ts.map +1 -0
  316. package/dist/types/core/agents/scripted/scripted-agent.d.ts +73 -0
  317. package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -0
  318. package/dist/types/core/agents/scripted/scripts.d.ts +29 -0
  319. package/dist/types/core/agents/scripted/scripts.d.ts.map +1 -0
  320. package/dist/types/core/agents/scripted/steps.d.ts +132 -0
  321. package/dist/types/core/agents/scripted/steps.d.ts.map +1 -0
  322. package/dist/types/core/agents/session-agent.d.ts +49 -6
  323. package/dist/types/core/agents/session-agent.d.ts.map +1 -1
  324. package/dist/types/core/diagnostics.d.ts +4 -1
  325. package/dist/types/core/diagnostics.d.ts.map +1 -1
  326. package/dist/types/core/index.d.ts +5 -0
  327. package/dist/types/core/index.d.ts.map +1 -1
  328. package/dist/types/core/presets.d.ts +32 -6
  329. package/dist/types/core/presets.d.ts.map +1 -1
  330. package/dist/types/core/processes/lifeline.d.ts +0 -20
  331. package/dist/types/core/processes/lifeline.d.ts.map +1 -1
  332. package/dist/types/core/provision/index.d.ts +2 -2
  333. package/dist/types/core/provision/index.d.ts.map +1 -1
  334. package/dist/types/core/provision/install-build.d.ts +2 -1
  335. package/dist/types/core/provision/install-build.d.ts.map +1 -1
  336. package/dist/types/core/provision/npm.d.ts +20 -8
  337. package/dist/types/core/provision/npm.d.ts.map +1 -1
  338. package/dist/types/core/provision/provisioner.d.ts +4 -1
  339. package/dist/types/core/provision/provisioner.d.ts.map +1 -1
  340. package/dist/types/core/provision/tools.d.ts +2 -1
  341. package/dist/types/core/provision/tools.d.ts.map +1 -1
  342. package/dist/types/core/runtime/agent-runtime.d.ts +16 -8
  343. package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
  344. package/dist/types/core/runtime/event-processor.d.ts +5 -1
  345. package/dist/types/core/runtime/event-processor.d.ts.map +1 -1
  346. package/dist/types/core/runtime/harness-clis.d.ts +9 -0
  347. package/dist/types/core/runtime/harness-clis.d.ts.map +1 -1
  348. package/dist/types/core/runtime/harness-logins.d.ts +33 -5
  349. package/dist/types/core/runtime/harness-logins.d.ts.map +1 -1
  350. package/dist/types/core/runtime/model-lists.d.ts +2 -0
  351. package/dist/types/core/runtime/model-lists.d.ts.map +1 -1
  352. package/dist/types/core/runtime/permission-policy.d.ts +5 -3
  353. package/dist/types/core/runtime/permission-policy.d.ts.map +1 -1
  354. package/dist/types/core/runtime/request-broker.d.ts +2 -1
  355. package/dist/types/core/runtime/request-broker.d.ts.map +1 -1
  356. package/dist/types/core/runtime/turn.d.ts +12 -1
  357. package/dist/types/core/runtime/turn.d.ts.map +1 -1
  358. package/dist/types/core/utils/deadline.d.ts +6 -0
  359. package/dist/types/core/utils/deadline.d.ts.map +1 -1
  360. package/dist/types/core/utils/errors.d.ts +7 -1
  361. package/dist/types/core/utils/errors.d.ts.map +1 -1
  362. package/dist/types/operator/operator.d.ts.map +1 -1
  363. package/dist/types/operator/render.d.ts +6 -4
  364. package/dist/types/operator/render.d.ts.map +1 -1
  365. package/dist/types/protocol/auth.d.ts +54 -24
  366. package/dist/types/protocol/auth.d.ts.map +1 -1
  367. package/dist/types/protocol/clis.d.ts +14 -7
  368. package/dist/types/protocol/clis.d.ts.map +1 -1
  369. package/dist/types/protocol/config.d.ts +2 -0
  370. package/dist/types/protocol/config.d.ts.map +1 -1
  371. package/dist/types/protocol/conversation.d.ts +40 -3
  372. package/dist/types/protocol/conversation.d.ts.map +1 -1
  373. package/dist/types/protocol/credentials.d.ts +7 -0
  374. package/dist/types/protocol/credentials.d.ts.map +1 -1
  375. package/dist/types/protocol/execution.d.ts +2 -1
  376. package/dist/types/protocol/execution.d.ts.map +1 -1
  377. package/dist/types/protocol/factories.d.ts +12 -2
  378. package/dist/types/protocol/factories.d.ts.map +1 -1
  379. package/dist/types/protocol/harness.d.ts +6 -2
  380. package/dist/types/protocol/harness.d.ts.map +1 -1
  381. package/dist/types/protocol/history.d.ts +19 -0
  382. package/dist/types/protocol/history.d.ts.map +1 -1
  383. package/dist/types/protocol/lifecycle.d.ts +47 -8
  384. package/dist/types/protocol/lifecycle.d.ts.map +1 -1
  385. package/dist/types/protocol/model-catalog.d.ts.map +1 -1
  386. package/dist/types/protocol/models.d.ts +3 -0
  387. package/dist/types/protocol/models.d.ts.map +1 -1
  388. package/dist/types/protocol/parts.d.ts +14 -0
  389. package/dist/types/protocol/parts.d.ts.map +1 -1
  390. package/dist/types/protocol/tool-state.d.ts +12 -0
  391. package/dist/types/protocol/tool-state.d.ts.map +1 -1
  392. package/dist/types/protocol/wire-api.d.ts +129 -23
  393. package/dist/types/protocol/wire-api.d.ts.map +1 -1
  394. package/dist/types/protocol/wire.d.ts +70 -10
  395. package/dist/types/protocol/wire.d.ts.map +1 -1
  396. package/dist/types/server/acp/binding.d.ts +6 -1
  397. package/dist/types/server/acp/binding.d.ts.map +1 -1
  398. package/dist/types/server/acp/translate.d.ts +33 -7
  399. package/dist/types/server/acp/translate.d.ts.map +1 -1
  400. package/dist/types/server/agent-server.d.ts +6 -0
  401. package/dist/types/server/agent-server.d.ts.map +1 -1
  402. package/dist/types/server/bin.d.ts +3 -0
  403. package/dist/types/server/bin.d.ts.map +1 -0
  404. package/dist/types/server/feedback.d.ts +2 -1
  405. package/dist/types/server/feedback.d.ts.map +1 -1
  406. package/dist/types/server/install.d.ts +11 -0
  407. package/dist/types/server/install.d.ts.map +1 -1
  408. package/dist/types/server/session-gate.d.ts +2 -1
  409. package/dist/types/server/session-gate.d.ts.map +1 -1
  410. package/dist/types/server/session-store.d.ts +1 -0
  411. package/dist/types/server/session-store.d.ts.map +1 -1
  412. package/dist/types/server/subscriptions.d.ts +2 -1
  413. package/dist/types/server/subscriptions.d.ts.map +1 -1
  414. package/dist/types/server/transports.d.ts +2 -1
  415. package/dist/types/server/transports.d.ts.map +1 -1
  416. package/dist/types/sync/fit.d.ts +8 -7
  417. package/dist/types/sync/fit.d.ts.map +1 -1
  418. package/dist/types/sync/history-sqlite.d.ts.map +1 -1
  419. package/dist/types/sync/index.d.ts +1 -0
  420. package/dist/types/sync/index.d.ts.map +1 -1
  421. package/dist/types/sync/journal-sqlite.d.ts +2 -1
  422. package/dist/types/sync/journal-sqlite.d.ts.map +1 -1
  423. package/dist/types/sync/journal.d.ts +11 -3
  424. package/dist/types/sync/journal.d.ts.map +1 -1
  425. package/dist/types/sync/node-sqlite.d.ts +4 -1
  426. package/dist/types/sync/node-sqlite.d.ts.map +1 -1
  427. package/dist/types/sync/projection.d.ts +6 -0
  428. package/dist/types/sync/projection.d.ts.map +1 -1
  429. package/dist/types/sync/recovery.d.ts +2 -1
  430. package/dist/types/sync/recovery.d.ts.map +1 -1
  431. package/dist/types/sync/schema.d.ts +10 -0
  432. package/dist/types/sync/schema.d.ts.map +1 -1
  433. package/dist/types/sync/sql.d.ts +2 -1
  434. package/dist/types/sync/sql.d.ts.map +1 -1
  435. package/docs/consuming.md +304 -28
  436. package/docs/deploy.md +64 -8
  437. package/docs/durable-sessions.md +35 -5
  438. package/docs/harnesses.md +398 -25
  439. package/package.json +48 -18
  440. package/src/accounts/chatgpt.ts +2 -2
  441. package/src/accounts/http.ts +2 -16
  442. package/src/client/client.ts +92 -31
  443. package/src/client/connection.ts +103 -22
  444. package/src/client/index.ts +1 -0
  445. package/src/client/logins.ts +1 -1
  446. package/src/client/streams.ts +12 -4
  447. package/src/client/turns.ts +1 -1
  448. package/src/core/agents/acp/acp-agent.ts +181 -52
  449. package/src/core/agents/acp/adapter.ts +9 -1
  450. package/src/core/agents/acp/client.ts +16 -4
  451. package/src/core/agents/acp/mappings.ts +27 -0
  452. package/src/core/agents/base.ts +25 -10
  453. package/src/core/agents/claude-code/adapter.ts +47 -17
  454. package/src/core/agents/claude-code/approvals.ts +11 -6
  455. package/src/core/agents/claude-code/claude-agent.ts +89 -32
  456. package/src/core/agents/claude-code/events.ts +11 -1
  457. package/src/core/agents/claude-code/login.ts +14 -2
  458. package/src/core/agents/claude-code/mcp.ts +31 -15
  459. package/src/core/agents/claude-code/models.ts +7 -2
  460. package/src/core/agents/claude-code/options.ts +30 -9
  461. package/src/core/agents/claude-code/outcome.ts +10 -2
  462. package/src/core/agents/claude-code/results.ts +73 -0
  463. package/src/core/agents/claude-code/sdk-pair.ts +66 -0
  464. package/src/core/agents/claude-code/session.ts +179 -37
  465. package/src/core/agents/claude-code/spend.ts +1 -1
  466. package/src/core/agents/claude-code/tools.ts +108 -12
  467. package/src/core/agents/codex-app-server/adapter.ts +37 -12
  468. package/src/core/agents/codex-app-server/client.ts +37 -8
  469. package/src/core/agents/codex-app-server/codex-agent.ts +115 -50
  470. package/src/core/agents/codex-app-server/commands.ts +2 -2
  471. package/src/core/agents/codex-app-server/credentials.ts +10 -5
  472. package/src/core/agents/codex-app-server/effort.ts +1 -1
  473. package/src/core/agents/codex-app-server/homes.ts +54 -3
  474. package/src/core/agents/codex-app-server/items.ts +219 -31
  475. package/src/core/agents/codex-app-server/login.ts +44 -2
  476. package/src/core/agents/codex-app-server/mcp.ts +47 -32
  477. package/src/core/agents/codex-app-server/models.ts +9 -8
  478. package/src/core/agents/codex-app-server/options.ts +69 -10
  479. package/src/core/agents/codex-app-server/plan-approval.ts +1 -1
  480. package/src/core/agents/codex-app-server/protocol.ts +14 -4
  481. package/src/core/agents/codex-app-server/requests.ts +17 -8
  482. package/src/core/agents/codex-app-server/session.ts +160 -113
  483. package/src/core/agents/codex-app-server/subagents.ts +21 -14
  484. package/src/core/agents/codex-app-server/thread-settings.ts +18 -8
  485. package/src/core/agents/codex-app-server/turn-items.ts +1 -1
  486. package/src/core/agents/codex-app-server/turn.ts +79 -32
  487. package/src/core/agents/codex-app-server/user-login.ts +107 -0
  488. package/src/core/agents/credentials.ts +5 -2
  489. package/src/core/agents/diffs.ts +25 -0
  490. package/src/core/agents/elicitation.ts +2 -2
  491. package/src/core/agents/login.ts +6 -0
  492. package/src/core/agents/mcp-config.ts +2 -2
  493. package/src/core/agents/process-pool.ts +458 -0
  494. package/src/core/agents/scripted/adapter.ts +142 -0
  495. package/src/core/agents/scripted/mcp-call.ts +134 -0
  496. package/src/core/agents/scripted/scripted-agent.ts +418 -0
  497. package/src/core/agents/scripted/scripts.ts +171 -0
  498. package/src/core/agents/scripted/steps.ts +127 -0
  499. package/src/core/agents/session-agent.ts +105 -8
  500. package/src/core/diagnostics.ts +9 -1
  501. package/src/core/index.ts +11 -0
  502. package/src/core/presets.ts +100 -14
  503. package/src/core/processes/lifeline.ts +99 -25
  504. package/src/core/provision/index.ts +1 -2
  505. package/src/core/provision/install-build.ts +4 -1
  506. package/src/core/provision/npm.ts +309 -97
  507. package/src/core/provision/provisioner.ts +22 -8
  508. package/src/core/provision/tools.ts +44 -19
  509. package/src/core/runtime/agent-runtime.ts +48 -18
  510. package/src/core/runtime/event-processor.ts +18 -2
  511. package/src/core/runtime/harness-clis.ts +36 -1
  512. package/src/core/runtime/harness-logins.ts +82 -31
  513. package/src/core/runtime/model-lists.ts +1 -1
  514. package/src/core/runtime/permission-policy.ts +4 -3
  515. package/src/core/runtime/request-broker.ts +1 -1
  516. package/src/core/runtime/turn.ts +51 -3
  517. package/src/core/utils/deadline.ts +23 -0
  518. package/src/core/utils/errors.ts +11 -4
  519. package/src/operator/operator.ts +8 -4
  520. package/src/operator/render.ts +46 -8
  521. package/src/protocol/auth.ts +30 -23
  522. package/src/protocol/clis.ts +12 -4
  523. package/src/protocol/credentials.ts +19 -0
  524. package/src/protocol/execution.ts +5 -0
  525. package/src/protocol/factories.ts +25 -3
  526. package/src/protocol/harness.ts +11 -1
  527. package/src/protocol/history.ts +20 -0
  528. package/src/protocol/lifecycle.ts +10 -1
  529. package/src/protocol/model-catalog.ts +19 -8
  530. package/src/protocol/parts.ts +12 -1
  531. package/src/protocol/tool-state.ts +14 -1
  532. package/src/protocol/wire.ts +14 -0
  533. package/src/server/acp/binding.ts +113 -23
  534. package/src/server/acp/translate.ts +161 -8
  535. package/src/server/agent-server.ts +10 -1
  536. package/src/server/bin.ts +108 -19
  537. package/src/server/feedback.ts +1 -1
  538. package/src/server/install.ts +82 -4
  539. package/src/server/session-gate.ts +1 -1
  540. package/src/server/session-store.ts +5 -1
  541. package/src/server/subscriptions.ts +1 -1
  542. package/src/server/transports.ts +20 -1
  543. package/src/sync/fit.ts +115 -28
  544. package/src/sync/history-sqlite.ts +6 -2
  545. package/src/sync/index.ts +1 -0
  546. package/src/sync/journal-sqlite.ts +20 -2
  547. package/src/sync/journal.ts +10 -2
  548. package/src/sync/node-sqlite.ts +19 -3
  549. package/src/sync/projection.ts +10 -0
  550. package/src/sync/recovery.ts +11 -4
  551. package/src/sync/schema.ts +7 -5
  552. package/src/sync/sql.ts +1 -1
  553. package/dist/types/core/agents/claude-code/session-pool.d.ts +0 -36
  554. package/dist/types/core/agents/claude-code/session-pool.d.ts.map +0 -1
  555. package/dist/types/core/agents/session-pool.d.ts +0 -41
  556. package/dist/types/core/agents/session-pool.d.ts.map +0 -1
  557. package/src/core/agents/claude-code/session-pool.ts +0 -136
  558. 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,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GACtC,OAAO,CAAC,UAAU,EAAE,CAAC,CAUvB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAsBjG;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC3C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GACtC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,SAAS,CAAC,CAQ9D;AAED,qEAAqE;AACrE,MAAM,WAAW,mBAAmB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAsBD;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC5C,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EACxC,GAAG,EAAE,MAAM,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,MAAM,WAAW,iBAAiB;IACjC,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"}
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,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,gFA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ACH,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,15 +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">;
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
+ }
38
61
  /**
39
62
  * The params `thread/start` and `thread/resume` take for a turn with these
40
63
  * options. `mcpServers`: the servers the thread carries in its own config,
41
64
  * for a turn that names no home.
42
65
  */
43
- export declare function threadParams(options: AgentExecuteOptions, inheritConfig?: InheritConfig, mcpServers?: Record<string, unknown>): Record<string, unknown>;
66
+ export declare function threadParams(options: AgentExecuteOptions, policy?: CodexThreadPolicy, mcpServers?: Record<string, unknown>): CodexThreadParams;
44
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"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,gOAC6L,CAAC;AAE/N,wBAAgB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,MAAM,CAcnE;AAkBD,0FAA0F;AAC1F,MAAM,WAAW,oBAAoB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAA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,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":"protocol.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/protocol.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE;AAED,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,G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S,CAAC,CAAC,EAAE,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAGrE;AAED,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,CAAC,EAAE,iBAAiB,GAAG,aAAa,GAAG,SAAS,CAczE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAErD;AAED,yFAAyF;AACzF,wBAAgB,QAAQ,CAAC,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAEtD"}
@@ -1 +1 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAQtF,OAAO,EAAE,KAAK,SAAS,EAAiB,MAAM,kBAAkB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,mDAAmD;IACnD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,sEAAsE;IACtE,oBAAoB,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;AAmMD;;;;;;;;;GASG;AACH,w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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. */
@@ -15,61 +14,70 @@ export interface CodexSession extends CodexProcessIdentity {
15
14
  authFingerprint?: string;
16
15
  mcp: CodexMcpState;
17
16
  /**
18
- * The MCP servers its thread was opened with, in the thread's own config
19
- * (`threadMcpFingerprint`): a turn with another set runs in another process.
17
+ * The `mcp_servers` table its thread was opened with
18
+ * (`threadServersFingerprint`): a turn that needs another runs in another
19
+ * process.
20
20
  */
21
- threadMcp: string;
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?: [];
22
27
  /** The logical session's thread settings, which outlive this process. */
23
28
  thread: CodexThread;
24
29
  /** The turn that has the session: Codex's requests answer for it alone. */
25
30
  turn?: CodexTurnScope;
26
31
  /**
27
- * Host suspension left its MCP connections stale: the turn running on it
28
- * 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`).
29
35
  */
30
- stale?: boolean;
31
- /** The login it started with (`CodexSessions.loginChanged`): an older one's next turn replaces it. */
32
- 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;
33
39
  /** What each model accepts, from this process's `model/list`; read once. */
34
40
  modelThinking?: Promise<ReadonlyMap<string, CodexModelThinking> | undefined>;
35
- idleTimer?: ReturnType<typeof setTimeout>;
36
41
  }
37
42
  /** Starts a connection to a new `codex app-server` for a turn's folder, `env` and login. */
38
- export type CodexConnector = (options: AgentExecuteOptions, auth: CodexAuth | undefined, signal: AbortSignal) => Promise<CodexConnection>;
43
+ type CodexConnector = (options: AgentExecuteOptions, auth: CodexAuth | undefined, signal: AbortSignal) => Promise<CodexConnection>;
39
44
  /**
40
- * The Codex harness's sessions: each logical session's process, while it
41
- * lives, and what outlives it (its thread settings, its home), plus the
42
- * 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.
43
50
  */
44
51
  export declare class CodexSessions {
45
52
  private readonly connect;
46
- private readonly idleMs;
47
- /** The operator's: what a thread loads by itself, and whether every turn needs a home. */
48
- 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;
49
55
  private readonly pool;
50
56
  private readonly threads;
51
57
  private readonly homes;
52
58
  /** Managed sessions whose process was not confirmed stopped: no successor runs until it is. */
53
59
  private readonly unsettled;
54
- /** Counts the login changes: a process keeps the login it read at its start. */
55
- private login;
56
- /** Each session's process that was ended and has not exited yet: when it has. */
57
- private readonly leaving;
58
60
  constructor(connect: CodexConnector, idleMs: number,
59
- /** The operator's: what a thread loads by itself, and whether every turn needs a home. */
60
- 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);
61
63
  get(sessionId: string): CodexSession | undefined;
62
64
  /** The turn's MCP servers, in the `CODEX_HOME` the session claims when the turn names one. */
63
65
  mcpFor(options: AgentExecuteOptions): CodexTurnMcp;
64
66
  /**
65
- * The session's process for the turn, which takes it: the running one when
66
- * the turn can run there as the same account, else a new one, on the same
67
- * 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
68
70
  * login alone cannot switch its identity: an account or key change
69
71
  * restarts the process and resumes the thread. Same-account token renewal
70
- * keeps it warm. So does an unchanged set of the servers the thread
71
- * carries; a thread's config is fixed once it is open, so another set
72
- * resumes the thread in a new process.
72
+ * of a login the engine hands it keeps it warm. One on its store's own
73
+ * login is replaced once the store's `auth.json` changed, whatever the
74
+ * change: the engine reads no login to tell a renewal from another
75
+ * account. An unchanged `mcp_servers` table keeps it warm, the servers
76
+ * the thread carries. A thread's config is fixed once it is open, so
77
+ * another table resumes the thread in a new process, which checks them
78
+ * against Codex's configuration again before the thread opens: the user
79
+ * may change it while the old process exits. A home removed or made again
80
+ * under the process starts a new one too.
73
81
  */
74
82
  acquire(options: AgentExecuteOptions, turn: CodexTurnScope, mcp: CodexTurnMcp): Promise<CodexSession>;
75
83
  /** The turn is done with the session: an open process waits for the next one, at most `idleMs`. */
@@ -85,21 +93,44 @@ export declare class CodexSessions {
85
93
  stopUnsettled(sessionId: string): Promise<boolean> | undefined;
86
94
  /**
87
95
  * Unchanged MCP config reloads retain dead remote connections after VM
88
- * resume: every process goes, but a turn that is running finishes first,
89
- * and its session is replaced before the next (the strict thread/resume
90
- * path).
96
+ * resume: each session's next turn replaces its process and resumes its
97
+ * thread (the strict thread/resume path). Nothing is ended now; a turn
98
+ * still setting up sends no `turn/start` on its process (`CodexTurn`).
91
99
  */
92
100
  invalidate(): void;
93
101
  /**
94
- * The login changed: an app-server keeps the one it read at its start, so
95
- * each session's next turn starts a new one, resuming its thread. A turn
102
+ * The login changed in `store` (every store when none is named): an
103
+ * app-server keeps the one it read at its start, so each of that store's
104
+ * sessions starts its next turn on a new one, resuming its thread. A turn
96
105
  * already setting up or running finishes on its own.
97
106
  */
98
- loginChanged(): void;
99
- /** Forget the session: its process, its thread settings and its home. */
100
- release(sessionId: string): void;
101
- terminateAll(): void;
102
- private reuse;
107
+ loginChanged(store?: string): void;
108
+ /**
109
+ * Forget the session: its process, its thread settings and its home.
110
+ * Settles once every app-server of the session has exited, one an idle
111
+ * eviction or a replacement ended earlier included (the pool's
112
+ * `release`): a product removes the session's home on this answer, and an
113
+ * exiting app-server still writes there.
114
+ */
115
+ release(sessionId: string): Promise<void>;
116
+ /** End every app-server, and settle once each has exited. */
117
+ terminateAll(): Promise<void>;
118
+ /**
119
+ * What changes on the warm process without a restart, for the turn: its
120
+ * account logged in again (a renewed token), and the `mcp_servers` table
121
+ * its thread needs checked against Codex's own configuration. Another
122
+ * table cannot be changed on an open thread, so the thread resumes in a
123
+ * new process. A cancel meanwhile ends the process, as Codex's answer is
124
+ * not waited for; a refused login ends it too, and a refused table read
125
+ * leaves it for the session's next turn.
126
+ */
127
+ private applyLiveChange;
128
+ /**
129
+ * Start an app-server for the turn and open the session's thread on it.
130
+ * The pool starts it once every app-server of the session before it has
131
+ * exited.
132
+ */
103
133
  private spawn;
104
134
  }
135
+ export {};
105
136
  //# 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,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,KAAK,SAAS,EAA0B,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAE,KAAK,YAAY,EAAsC,MAAM,UAAU,CAAC;AAChG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACN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AAO,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,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,KAAK,YAAY,EAA2B,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,KAAK,iBAAiB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AO,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,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAKjD;;;;;;GAMG;AACH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,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;IACH,aAAa,CACZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,MAAM,GACV,YAAY,GAAG,SAAS;IAe3B,oGAAoG;IACpG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS;IAI5D,sDAAsD;IACtD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,EAAE;CAG5C"}
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,UAAU,YAAY;IACrB,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;IACH,aAAa,CACZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,MAAM,GACV,YAAY,GAAG,SAAS;IAe3B,oGAAoG;IACpG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS;IAI5D,sDAAsD;IACtD,SAAS,CAAC,MAAM,EAAE,MAAM,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,14 +129,19 @@ 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;
130
140
  private accepted;
131
141
  constructor(session: CodexSession, scope: CodexTurnScope, options: AgentExecuteOptions, commands: TurnCommands, stop: TurnStop, steering: TurnSteering, timing: CodexTurnTiming);
132
142
  get signal(): AbortSignal;
133
- /** The cancel's acknowledgement, once one came: whether Codex's turn stopped. */
134
- get acknowledgement(): Promise<boolean> | undefined;
143
+ /** Stop Codex's turn for the cancel, once: whether it stopped. */
144
+ cancel(): Promise<boolean>;
135
145
  /**
136
146
  * Codex took a turn of this one (it accepted `turn/start`): from then on
137
147
  * it writes the thread, which before had nothing to resume.
@@ -158,12 +168,25 @@ export declare class CodexTurn {
158
168
  private start;
159
169
  private observe;
160
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;
161
181
  private ended;
162
182
  /**
163
183
  * A retryable error promises more notifications. If none arrive, the
164
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.
165
187
  */
166
188
  private watchStall;
167
189
  private clearStall;
168
190
  }
191
+ export {};
169
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,4BAAmC;IACjD,0CAA0C;IAC1C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,6CAA6C;IAC7C,IAAI,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,wFAAwF;IACxF,QAAQ,UAAS;IACjB,OAAO,CAAC,MAAM,CAAc;IAC5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e;IAzBjC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAoB;IAClC,iFAAiF;IACjF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C;;;;OAIG;IACH,OAAO,CAAC,UAAU,CAAC,CAAgC;IACnD,OAAO,CAAC,YAAY,CAAC,CAAmB;IACxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoB;IAChD,OAAO,CAAC,QAAQ,CAAS;gBAGf,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,cAAc,EACrB,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,eAAe;IAoBjC,IAAI,MAAM,IAAI,WAAW,CAExB;IAED,kEAAkE;IAClE,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAM1B;;;OAGG;IACH,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,uFAAuF;IACvF,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED,kFAAkF;IAC3E,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,cAAc,CAAC,aAAa,CAAC;IA0B7D;;;;OAIG;IACI,YAAY,IAAI,cAAc,CAAC,aAAa,CAAC;IAMpD,OAAO,IAAI,IAAI;IAKf,2CAA2C;YAC5B,MAAM;IAOrB;;;;OAIG;IACH,OAAO,CAAC,KAAK;IA0Cb,OAAO,CAAC,OAAO;IAgDf,OAAO,CAAC,KAAK;IAQb;;;;;;;;OAQG;IAEH,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,KAAK;IAWb;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,UAAU;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"}