@zvada/agent-server 0.3.22 → 0.3.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/CHANGELOG.md +261 -0
  2. package/dist/types/accounts/chatgpt.d.ts +1 -1
  3. package/dist/types/accounts/chatgpt.d.ts.map +1 -1
  4. package/dist/types/accounts/http.d.ts +2 -4
  5. package/dist/types/accounts/http.d.ts.map +1 -1
  6. package/dist/types/client/client.d.ts +37 -11
  7. package/dist/types/client/client.d.ts.map +1 -1
  8. package/dist/types/client/connection.d.ts +64 -13
  9. package/dist/types/client/connection.d.ts.map +1 -1
  10. package/dist/types/client/index.d.ts +1 -1
  11. package/dist/types/client/index.d.ts.map +1 -1
  12. package/dist/types/client/logins.d.ts +2 -1
  13. package/dist/types/client/logins.d.ts.map +1 -1
  14. package/dist/types/client/streams.d.ts +9 -3
  15. package/dist/types/client/streams.d.ts.map +1 -1
  16. package/dist/types/client/turns.d.ts +1 -1
  17. package/dist/types/client/turns.d.ts.map +1 -1
  18. package/dist/types/core/agents/acp/acp-agent.d.ts +34 -1
  19. package/dist/types/core/agents/acp/acp-agent.d.ts.map +1 -1
  20. package/dist/types/core/agents/acp/adapter.d.ts.map +1 -1
  21. package/dist/types/core/agents/acp/client.d.ts +12 -3
  22. package/dist/types/core/agents/acp/client.d.ts.map +1 -1
  23. package/dist/types/core/agents/acp/mappings.d.ts +8 -2
  24. package/dist/types/core/agents/acp/mappings.d.ts.map +1 -1
  25. package/dist/types/core/agents/base.d.ts +22 -8
  26. package/dist/types/core/agents/base.d.ts.map +1 -1
  27. package/dist/types/core/agents/claude-code/adapter.d.ts +7 -0
  28. package/dist/types/core/agents/claude-code/adapter.d.ts.map +1 -1
  29. package/dist/types/core/agents/claude-code/approvals.d.ts +4 -1
  30. package/dist/types/core/agents/claude-code/approvals.d.ts.map +1 -1
  31. package/dist/types/core/agents/claude-code/claude-agent.d.ts +16 -5
  32. package/dist/types/core/agents/claude-code/claude-agent.d.ts.map +1 -1
  33. package/dist/types/core/agents/claude-code/events.d.ts +9 -1
  34. package/dist/types/core/agents/claude-code/events.d.ts.map +1 -1
  35. package/dist/types/core/agents/claude-code/login.d.ts +4 -1
  36. package/dist/types/core/agents/claude-code/login.d.ts.map +1 -1
  37. package/dist/types/core/agents/claude-code/mcp.d.ts +21 -7
  38. package/dist/types/core/agents/claude-code/mcp.d.ts.map +1 -1
  39. package/dist/types/core/agents/claude-code/models.d.ts +5 -1
  40. package/dist/types/core/agents/claude-code/models.d.ts.map +1 -1
  41. package/dist/types/core/agents/claude-code/options.d.ts +10 -4
  42. package/dist/types/core/agents/claude-code/options.d.ts.map +1 -1
  43. package/dist/types/core/agents/claude-code/outcome.d.ts +3 -5
  44. package/dist/types/core/agents/claude-code/outcome.d.ts.map +1 -1
  45. package/dist/types/core/agents/claude-code/results.d.ts +16 -0
  46. package/dist/types/core/agents/claude-code/results.d.ts.map +1 -0
  47. package/dist/types/core/agents/claude-code/sdk-pair.d.ts +13 -0
  48. package/dist/types/core/agents/claude-code/sdk-pair.d.ts.map +1 -0
  49. package/dist/types/core/agents/claude-code/session.d.ts +50 -12
  50. package/dist/types/core/agents/claude-code/session.d.ts.map +1 -1
  51. package/dist/types/core/agents/claude-code/spend.d.ts +2 -1
  52. package/dist/types/core/agents/claude-code/spend.d.ts.map +1 -1
  53. package/dist/types/core/agents/claude-code/tools.d.ts +26 -3
  54. package/dist/types/core/agents/claude-code/tools.d.ts.map +1 -1
  55. package/dist/types/core/agents/codex-app-server/adapter.d.ts +2 -2
  56. package/dist/types/core/agents/codex-app-server/adapter.d.ts.map +1 -1
  57. package/dist/types/core/agents/codex-app-server/client.d.ts +12 -2
  58. package/dist/types/core/agents/codex-app-server/client.d.ts.map +1 -1
  59. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts +58 -13
  60. package/dist/types/core/agents/codex-app-server/codex-agent.d.ts.map +1 -1
  61. package/dist/types/core/agents/codex-app-server/commands.d.ts +2 -2
  62. package/dist/types/core/agents/codex-app-server/commands.d.ts.map +1 -1
  63. package/dist/types/core/agents/codex-app-server/credentials.d.ts +5 -1
  64. package/dist/types/core/agents/codex-app-server/credentials.d.ts.map +1 -1
  65. package/dist/types/core/agents/codex-app-server/effort.d.ts +2 -1
  66. package/dist/types/core/agents/codex-app-server/effort.d.ts.map +1 -1
  67. package/dist/types/core/agents/codex-app-server/homes.d.ts +19 -0
  68. package/dist/types/core/agents/codex-app-server/homes.d.ts.map +1 -1
  69. package/dist/types/core/agents/codex-app-server/items.d.ts +27 -2
  70. package/dist/types/core/agents/codex-app-server/items.d.ts.map +1 -1
  71. package/dist/types/core/agents/codex-app-server/login.d.ts +4 -1
  72. package/dist/types/core/agents/codex-app-server/login.d.ts.map +1 -1
  73. package/dist/types/core/agents/codex-app-server/mcp.d.ts +15 -30
  74. package/dist/types/core/agents/codex-app-server/mcp.d.ts.map +1 -1
  75. package/dist/types/core/agents/codex-app-server/models.d.ts +3 -10
  76. package/dist/types/core/agents/codex-app-server/models.d.ts.map +1 -1
  77. package/dist/types/core/agents/codex-app-server/options.d.ts +27 -4
  78. package/dist/types/core/agents/codex-app-server/options.d.ts.map +1 -1
  79. package/dist/types/core/agents/codex-app-server/plan-approval.d.ts +2 -1
  80. package/dist/types/core/agents/codex-app-server/plan-approval.d.ts.map +1 -1
  81. package/dist/types/core/agents/codex-app-server/protocol.d.ts +16 -3
  82. package/dist/types/core/agents/codex-app-server/protocol.d.ts.map +1 -1
  83. package/dist/types/core/agents/codex-app-server/requests.d.ts.map +1 -1
  84. package/dist/types/core/agents/codex-app-server/session.d.ts +68 -40
  85. package/dist/types/core/agents/codex-app-server/session.d.ts.map +1 -1
  86. package/dist/types/core/agents/codex-app-server/subagents.d.ts +9 -4
  87. package/dist/types/core/agents/codex-app-server/subagents.d.ts.map +1 -1
  88. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts +3 -2
  89. package/dist/types/core/agents/codex-app-server/thread-settings.d.ts.map +1 -1
  90. package/dist/types/core/agents/codex-app-server/turn-items.d.ts +2 -1
  91. package/dist/types/core/agents/codex-app-server/turn-items.d.ts.map +1 -1
  92. package/dist/types/core/agents/codex-app-server/turn.d.ts +31 -8
  93. package/dist/types/core/agents/codex-app-server/turn.d.ts.map +1 -1
  94. package/dist/types/core/agents/codex-app-server/user-login.d.ts +28 -0
  95. package/dist/types/core/agents/codex-app-server/user-login.d.ts.map +1 -0
  96. package/dist/types/core/agents/credentials.d.ts +3 -1
  97. package/dist/types/core/agents/credentials.d.ts.map +1 -1
  98. package/dist/types/core/agents/diffs.d.ts +9 -0
  99. package/dist/types/core/agents/diffs.d.ts.map +1 -0
  100. package/dist/types/core/agents/elicitation.d.ts +3 -2
  101. package/dist/types/core/agents/elicitation.d.ts.map +1 -1
  102. package/dist/types/core/agents/login.d.ts +6 -0
  103. package/dist/types/core/agents/login.d.ts.map +1 -1
  104. package/dist/types/core/agents/mcp-config.d.ts +0 -4
  105. package/dist/types/core/agents/mcp-config.d.ts.map +1 -1
  106. package/dist/types/core/agents/process-pool.d.ts +193 -0
  107. package/dist/types/core/agents/process-pool.d.ts.map +1 -0
  108. package/dist/types/core/agents/scripted/adapter.d.ts +68 -0
  109. package/dist/types/core/agents/scripted/adapter.d.ts.map +1 -0
  110. package/dist/types/core/agents/scripted/mcp-call.d.ts +56 -0
  111. package/dist/types/core/agents/scripted/mcp-call.d.ts.map +1 -0
  112. package/dist/types/core/agents/scripted/scripted-agent.d.ts +73 -0
  113. package/dist/types/core/agents/scripted/scripted-agent.d.ts.map +1 -0
  114. package/dist/types/core/agents/scripted/scripts.d.ts +29 -0
  115. package/dist/types/core/agents/scripted/scripts.d.ts.map +1 -0
  116. package/dist/types/core/agents/scripted/steps.d.ts +132 -0
  117. package/dist/types/core/agents/scripted/steps.d.ts.map +1 -0
  118. package/dist/types/core/agents/session-agent.d.ts +49 -6
  119. package/dist/types/core/agents/session-agent.d.ts.map +1 -1
  120. package/dist/types/core/diagnostics.d.ts +4 -1
  121. package/dist/types/core/diagnostics.d.ts.map +1 -1
  122. package/dist/types/core/index.d.ts +5 -0
  123. package/dist/types/core/index.d.ts.map +1 -1
  124. package/dist/types/core/presets.d.ts +32 -6
  125. package/dist/types/core/presets.d.ts.map +1 -1
  126. package/dist/types/core/processes/lifeline.d.ts +0 -20
  127. package/dist/types/core/processes/lifeline.d.ts.map +1 -1
  128. package/dist/types/core/provision/index.d.ts +2 -2
  129. package/dist/types/core/provision/index.d.ts.map +1 -1
  130. package/dist/types/core/provision/install-build.d.ts +2 -1
  131. package/dist/types/core/provision/install-build.d.ts.map +1 -1
  132. package/dist/types/core/provision/npm.d.ts +20 -8
  133. package/dist/types/core/provision/npm.d.ts.map +1 -1
  134. package/dist/types/core/provision/provisioner.d.ts +4 -1
  135. package/dist/types/core/provision/provisioner.d.ts.map +1 -1
  136. package/dist/types/core/provision/tools.d.ts +2 -1
  137. package/dist/types/core/provision/tools.d.ts.map +1 -1
  138. package/dist/types/core/runtime/agent-runtime.d.ts +16 -8
  139. package/dist/types/core/runtime/agent-runtime.d.ts.map +1 -1
  140. package/dist/types/core/runtime/event-processor.d.ts +5 -1
  141. package/dist/types/core/runtime/event-processor.d.ts.map +1 -1
  142. package/dist/types/core/runtime/harness-clis.d.ts +9 -0
  143. package/dist/types/core/runtime/harness-clis.d.ts.map +1 -1
  144. package/dist/types/core/runtime/harness-logins.d.ts +33 -5
  145. package/dist/types/core/runtime/harness-logins.d.ts.map +1 -1
  146. package/dist/types/core/runtime/model-lists.d.ts +2 -0
  147. package/dist/types/core/runtime/model-lists.d.ts.map +1 -1
  148. package/dist/types/core/runtime/permission-policy.d.ts +5 -3
  149. package/dist/types/core/runtime/permission-policy.d.ts.map +1 -1
  150. package/dist/types/core/runtime/request-broker.d.ts +2 -1
  151. package/dist/types/core/runtime/request-broker.d.ts.map +1 -1
  152. package/dist/types/core/runtime/turn.d.ts +12 -1
  153. package/dist/types/core/runtime/turn.d.ts.map +1 -1
  154. package/dist/types/core/utils/deadline.d.ts +6 -0
  155. package/dist/types/core/utils/deadline.d.ts.map +1 -1
  156. package/dist/types/core/utils/errors.d.ts +7 -1
  157. package/dist/types/core/utils/errors.d.ts.map +1 -1
  158. package/dist/types/operator/operator.d.ts.map +1 -1
  159. package/dist/types/operator/render.d.ts +6 -4
  160. package/dist/types/operator/render.d.ts.map +1 -1
  161. package/dist/types/protocol/auth.d.ts +54 -24
  162. package/dist/types/protocol/auth.d.ts.map +1 -1
  163. package/dist/types/protocol/clis.d.ts +14 -7
  164. package/dist/types/protocol/clis.d.ts.map +1 -1
  165. package/dist/types/protocol/config.d.ts +2 -0
  166. package/dist/types/protocol/config.d.ts.map +1 -1
  167. package/dist/types/protocol/conversation.d.ts +40 -3
  168. package/dist/types/protocol/conversation.d.ts.map +1 -1
  169. package/dist/types/protocol/credentials.d.ts +7 -0
  170. package/dist/types/protocol/credentials.d.ts.map +1 -1
  171. package/dist/types/protocol/execution.d.ts +2 -1
  172. package/dist/types/protocol/execution.d.ts.map +1 -1
  173. package/dist/types/protocol/factories.d.ts +12 -2
  174. package/dist/types/protocol/factories.d.ts.map +1 -1
  175. package/dist/types/protocol/harness.d.ts +6 -2
  176. package/dist/types/protocol/harness.d.ts.map +1 -1
  177. package/dist/types/protocol/history.d.ts +19 -0
  178. package/dist/types/protocol/history.d.ts.map +1 -1
  179. package/dist/types/protocol/lifecycle.d.ts +47 -8
  180. package/dist/types/protocol/lifecycle.d.ts.map +1 -1
  181. package/dist/types/protocol/model-catalog.d.ts.map +1 -1
  182. package/dist/types/protocol/models.d.ts +3 -0
  183. package/dist/types/protocol/models.d.ts.map +1 -1
  184. package/dist/types/protocol/parts.d.ts +14 -0
  185. package/dist/types/protocol/parts.d.ts.map +1 -1
  186. package/dist/types/protocol/tool-state.d.ts +12 -0
  187. package/dist/types/protocol/tool-state.d.ts.map +1 -1
  188. package/dist/types/protocol/wire-api.d.ts +129 -23
  189. package/dist/types/protocol/wire-api.d.ts.map +1 -1
  190. package/dist/types/protocol/wire.d.ts +70 -10
  191. package/dist/types/protocol/wire.d.ts.map +1 -1
  192. package/dist/types/server/acp/binding.d.ts +6 -1
  193. package/dist/types/server/acp/binding.d.ts.map +1 -1
  194. package/dist/types/server/acp/translate.d.ts +33 -7
  195. package/dist/types/server/acp/translate.d.ts.map +1 -1
  196. package/dist/types/server/agent-server.d.ts +6 -0
  197. package/dist/types/server/agent-server.d.ts.map +1 -1
  198. package/dist/types/server/feedback.d.ts +2 -1
  199. package/dist/types/server/feedback.d.ts.map +1 -1
  200. package/dist/types/server/install.d.ts +11 -0
  201. package/dist/types/server/install.d.ts.map +1 -1
  202. package/dist/types/server/session-gate.d.ts +2 -1
  203. package/dist/types/server/session-gate.d.ts.map +1 -1
  204. package/dist/types/server/session-store.d.ts +1 -0
  205. package/dist/types/server/session-store.d.ts.map +1 -1
  206. package/dist/types/server/subscriptions.d.ts +2 -1
  207. package/dist/types/server/subscriptions.d.ts.map +1 -1
  208. package/dist/types/server/transports.d.ts.map +1 -1
  209. package/dist/types/sync/fit.d.ts +8 -7
  210. package/dist/types/sync/fit.d.ts.map +1 -1
  211. package/dist/types/sync/history-sqlite.d.ts.map +1 -1
  212. package/dist/types/sync/index.d.ts +1 -0
  213. package/dist/types/sync/index.d.ts.map +1 -1
  214. package/dist/types/sync/journal-sqlite.d.ts +2 -1
  215. package/dist/types/sync/journal-sqlite.d.ts.map +1 -1
  216. package/dist/types/sync/journal.d.ts +11 -3
  217. package/dist/types/sync/journal.d.ts.map +1 -1
  218. package/dist/types/sync/projection.d.ts +6 -0
  219. package/dist/types/sync/projection.d.ts.map +1 -1
  220. package/dist/types/sync/recovery.d.ts +2 -1
  221. package/dist/types/sync/recovery.d.ts.map +1 -1
  222. package/dist/types/sync/schema.d.ts +10 -0
  223. package/dist/types/sync/schema.d.ts.map +1 -1
  224. package/dist/types/sync/sql.d.ts +2 -1
  225. package/dist/types/sync/sql.d.ts.map +1 -1
  226. package/docs/consuming.md +278 -28
  227. package/docs/deploy.md +36 -8
  228. package/docs/durable-sessions.md +35 -5
  229. package/docs/harnesses.md +385 -24
  230. package/package.json +6 -1
  231. package/src/accounts/chatgpt.ts +2 -2
  232. package/src/accounts/http.ts +2 -16
  233. package/src/client/client.ts +92 -31
  234. package/src/client/connection.ts +103 -22
  235. package/src/client/index.ts +1 -0
  236. package/src/client/logins.ts +1 -1
  237. package/src/client/streams.ts +12 -4
  238. package/src/client/turns.ts +1 -1
  239. package/src/core/agents/acp/acp-agent.ts +181 -52
  240. package/src/core/agents/acp/adapter.ts +9 -1
  241. package/src/core/agents/acp/client.ts +16 -4
  242. package/src/core/agents/acp/mappings.ts +27 -0
  243. package/src/core/agents/base.ts +25 -10
  244. package/src/core/agents/claude-code/adapter.ts +47 -17
  245. package/src/core/agents/claude-code/approvals.ts +6 -5
  246. package/src/core/agents/claude-code/claude-agent.ts +60 -30
  247. package/src/core/agents/claude-code/events.ts +11 -1
  248. package/src/core/agents/claude-code/login.ts +14 -2
  249. package/src/core/agents/claude-code/mcp.ts +31 -15
  250. package/src/core/agents/claude-code/models.ts +7 -2
  251. package/src/core/agents/claude-code/options.ts +11 -3
  252. package/src/core/agents/claude-code/outcome.ts +10 -2
  253. package/src/core/agents/claude-code/results.ts +73 -0
  254. package/src/core/agents/claude-code/sdk-pair.ts +66 -0
  255. package/src/core/agents/claude-code/session.ts +166 -37
  256. package/src/core/agents/claude-code/spend.ts +1 -1
  257. package/src/core/agents/claude-code/tools.ts +108 -12
  258. package/src/core/agents/codex-app-server/adapter.ts +37 -12
  259. package/src/core/agents/codex-app-server/client.ts +37 -8
  260. package/src/core/agents/codex-app-server/codex-agent.ts +115 -50
  261. package/src/core/agents/codex-app-server/commands.ts +2 -2
  262. package/src/core/agents/codex-app-server/credentials.ts +10 -5
  263. package/src/core/agents/codex-app-server/effort.ts +1 -1
  264. package/src/core/agents/codex-app-server/homes.ts +43 -1
  265. package/src/core/agents/codex-app-server/items.ts +219 -31
  266. package/src/core/agents/codex-app-server/login.ts +14 -2
  267. package/src/core/agents/codex-app-server/mcp.ts +47 -32
  268. package/src/core/agents/codex-app-server/models.ts +9 -8
  269. package/src/core/agents/codex-app-server/options.ts +69 -10
  270. package/src/core/agents/codex-app-server/plan-approval.ts +1 -1
  271. package/src/core/agents/codex-app-server/protocol.ts +14 -4
  272. package/src/core/agents/codex-app-server/requests.ts +14 -6
  273. package/src/core/agents/codex-app-server/session.ts +151 -113
  274. package/src/core/agents/codex-app-server/subagents.ts +21 -14
  275. package/src/core/agents/codex-app-server/thread-settings.ts +18 -8
  276. package/src/core/agents/codex-app-server/turn-items.ts +1 -1
  277. package/src/core/agents/codex-app-server/turn.ts +79 -32
  278. package/src/core/agents/codex-app-server/user-login.ts +107 -0
  279. package/src/core/agents/credentials.ts +5 -2
  280. package/src/core/agents/diffs.ts +25 -0
  281. package/src/core/agents/elicitation.ts +2 -2
  282. package/src/core/agents/login.ts +6 -0
  283. package/src/core/agents/mcp-config.ts +2 -2
  284. package/src/core/agents/process-pool.ts +432 -0
  285. package/src/core/agents/scripted/adapter.ts +142 -0
  286. package/src/core/agents/scripted/mcp-call.ts +134 -0
  287. package/src/core/agents/scripted/scripted-agent.ts +418 -0
  288. package/src/core/agents/scripted/scripts.ts +171 -0
  289. package/src/core/agents/scripted/steps.ts +127 -0
  290. package/src/core/agents/session-agent.ts +105 -8
  291. package/src/core/diagnostics.ts +9 -1
  292. package/src/core/index.ts +11 -0
  293. package/src/core/presets.ts +99 -14
  294. package/src/core/processes/lifeline.ts +99 -25
  295. package/src/core/provision/index.ts +1 -2
  296. package/src/core/provision/install-build.ts +4 -1
  297. package/src/core/provision/npm.ts +309 -97
  298. package/src/core/provision/provisioner.ts +22 -8
  299. package/src/core/provision/tools.ts +44 -19
  300. package/src/core/runtime/agent-runtime.ts +48 -18
  301. package/src/core/runtime/event-processor.ts +18 -2
  302. package/src/core/runtime/harness-clis.ts +36 -1
  303. package/src/core/runtime/harness-logins.ts +82 -31
  304. package/src/core/runtime/model-lists.ts +1 -1
  305. package/src/core/runtime/permission-policy.ts +4 -3
  306. package/src/core/runtime/request-broker.ts +1 -1
  307. package/src/core/runtime/turn.ts +51 -3
  308. package/src/core/utils/deadline.ts +23 -0
  309. package/src/core/utils/errors.ts +11 -4
  310. package/src/operator/operator.ts +8 -4
  311. package/src/operator/render.ts +46 -8
  312. package/src/protocol/auth.ts +30 -23
  313. package/src/protocol/clis.ts +12 -4
  314. package/src/protocol/credentials.ts +19 -0
  315. package/src/protocol/execution.ts +5 -0
  316. package/src/protocol/factories.ts +25 -3
  317. package/src/protocol/harness.ts +11 -1
  318. package/src/protocol/history.ts +20 -0
  319. package/src/protocol/lifecycle.ts +10 -1
  320. package/src/protocol/model-catalog.ts +19 -8
  321. package/src/protocol/parts.ts +12 -1
  322. package/src/protocol/tool-state.ts +14 -1
  323. package/src/protocol/wire.ts +14 -0
  324. package/src/server/acp/binding.ts +113 -23
  325. package/src/server/acp/translate.ts +161 -8
  326. package/src/server/agent-server.ts +10 -1
  327. package/src/server/bin.ts +83 -9
  328. package/src/server/feedback.ts +1 -1
  329. package/src/server/install.ts +82 -4
  330. package/src/server/session-gate.ts +1 -1
  331. package/src/server/session-store.ts +5 -1
  332. package/src/server/subscriptions.ts +1 -1
  333. package/src/server/transports.ts +14 -0
  334. package/src/sync/fit.ts +115 -28
  335. package/src/sync/history-sqlite.ts +6 -2
  336. package/src/sync/index.ts +1 -0
  337. package/src/sync/journal-sqlite.ts +20 -2
  338. package/src/sync/journal.ts +10 -2
  339. package/src/sync/projection.ts +10 -0
  340. package/src/sync/recovery.ts +11 -4
  341. package/src/sync/schema.ts +7 -5
  342. package/src/sync/sql.ts +1 -1
  343. package/dist/types/core/agents/claude-code/session-pool.d.ts +0 -36
  344. package/dist/types/core/agents/claude-code/session-pool.d.ts.map +0 -1
  345. package/dist/types/core/agents/session-pool.d.ts +0 -41
  346. package/dist/types/core/agents/session-pool.d.ts.map +0 -1
  347. package/src/core/agents/claude-code/session-pool.ts +0 -136
  348. package/src/core/agents/session-pool.ts +0 -111
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/credentials.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,6EAA6E;AAC7E,UAAU,aAAa;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,CAAA;CAAE,CAAC;AAS3F;;;;;;GAMG;AACH,wBAAsB,OAAO,CAAC,GAAG,EAAE;IAClC,WAAW,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC1C,4EAA4E;IAC5E,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAwBjC;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAK/E;AAED,oFAAoF;AACpF,wBAAsB,KAAK,CAC1B,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,GAAG,SAAS,GACzB,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAClC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqBlC"}
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/credentials.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAiB,MAAM,mBAAmB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,6EAA6E;AAC7E,UAAU,aAAa;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAClB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,CAAA;CAAE,CAAC;AAS3F;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAAC,GAAG,EAAE;IAClC,WAAW,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC1C,4EAA4E;IAC5E,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,6FAA6F;IAC7F,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAyBjC;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAK/E;AAED,oFAAoF;AACpF,wBAAsB,KAAK,CAC1B,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,GAAG,SAAS,GACzB,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;;GAIG;AACH,wBAAsB,aAAa,CAClC,OAAO,EAAE,YAAY,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqBlC"}
@@ -1,6 +1,6 @@
1
1
  import { type ThinkingLevel } from "../../../protocol/index.ts";
2
2
  /** Codex reasoning-effort string for a level (matches the `ReasoningEffort` enum). */
3
- export type CodexReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
3
+ type CodexReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
4
4
  /**
5
5
  * The effort Codex runs for `level`. `supported` is what the model accepts, in
6
6
  * this vocabulary, where `off` stands for its least effort: `offEffort`, the
@@ -9,4 +9,5 @@ export type CodexReasoningEffort = "none" | "minimal" | "low" | "medium" | "high
9
9
  * pinned CLI lists accepts `none` or `minimal`, and every one accepts `low`.
10
10
  */
11
11
  export declare function codexReasoningEffort<Off extends "none" | "minimal" = "minimal">(level: ThinkingLevel, supported?: readonly ThinkingLevel[], offEffort?: Off): Exclude<CodexReasoningEffort, "none" | "minimal"> | Off;
12
+ export {};
12
13
  //# sourceMappingURL=effort.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"effort.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/effort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,4BAA4B,CAAC;AAEpF,sFAAsF;AACtF,MAAM,MAAM,oBAAoB,GAC7B,MAAM,GACN,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,KAAK,GACL,OAAO,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EAC9E,KAAK,EAAE,aAAa,EACpB,SAAS,CAAC,EAAE,SAAS,aAAa,EAAE,EACpC,SAAS,CAAC,EAAE,GAAG,GACb,OAAO,CAAC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,CAIzD"}
1
+ {"version":3,"file":"effort.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/effort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,4BAA4B,CAAC;AAEpF,sFAAsF;AACtF,KAAK,oBAAoB,GACtB,MAAM,GACN,SAAS,GACT,KAAK,GACL,QAAQ,GACR,MAAM,GACN,OAAO,GACP,KAAK,GACL,OAAO,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EAC9E,KAAK,EAAE,aAAa,EACpB,SAAS,CAAC,EAAE,SAAS,aAAa,EAAE,EACpC,SAAS,CAAC,EAAE,GAAG,GACb,OAAO,CAAC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,CAIzD"}
@@ -19,4 +19,23 @@ export declare class CodexHomes {
19
19
  release(sessionId: string): void;
20
20
  clear(): void;
21
21
  }
22
+ /**
23
+ * Which folder a `CODEX_HOME` is now (its device and inode), `"gone"` when
24
+ * there is none; nothing when the turn names no home. A process keeps the
25
+ * files it opened in the home it started in, so a home removed or replaced
26
+ * under it is another home: the conversation it writes is in deleted files,
27
+ * and the `config.toml` it reads is not the one there. The comparison holds
28
+ * only while the session holds its home open (`holdHome`): on ext4 a removed
29
+ * folder's inode number goes to the next folder made, at once, unless a
30
+ * handle on the old one is open (measured under Node 22 and Bun 1.3.14), so
31
+ * `rm -rf home; mkdir home` would otherwise read as the same folder.
32
+ */
33
+ export declare function homeIdentity(home: string | undefined): string | undefined;
34
+ /**
35
+ * Hold the folder a `CODEX_HOME` is now open, keeping its inode number its
36
+ * own (`homeIdentity`), until the answer is called; calling it again does
37
+ * nothing. A turn that names no home, or a home that cannot be opened (no
38
+ * folder, a platform that does not open directories), holds nothing.
39
+ */
40
+ export declare function holdHome(home: string | undefined): () => void;
22
41
  //# sourceMappingURL=homes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"homes.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/homes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;GASG;AACH,qBAAa,UAAU;IAGV,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;gBAEvB,KAAK,GAAE,aAAqB;IAEzD,6EAA6E;IAC7E,KAAK,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO;IAwC5C,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIhC,KAAK,IAAI,IAAI;CAGb"}
1
+ {"version":3,"file":"homes.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/homes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;GASG;AACH,qBAAa,UAAU;IAGV,OAAO,CAAC,QAAQ,CAAC,KAAK;IAFlC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;gBAEvB,KAAK,GAAE,aAAqB;IAEzD,6EAA6E;IAC7E,KAAK,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO;IAwC5C,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIhC,KAAK,IAAI,IAAI;CAGb;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAQzE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,IAAI,CAa7D"}
@@ -1,11 +1,12 @@
1
- import type { ToolMeta } from "../../../protocol/index.ts";
2
- import type { CodexItem } from "./protocol.ts";
1
+ import type { ToolLocation, ToolMeta, ToolResultContent } from "../../../protocol/index.ts";
2
+ import type { CodexFileChange, CodexItem } from "./protocol.ts";
3
3
  /** Codex tools are already normalized names; kinds are fixed per item type. */
4
4
  export declare const CODEX_TOOL_KINDS: {
5
5
  readonly shell: "execute";
6
6
  readonly apply_patch: "edit";
7
7
  readonly web_search: "fetch";
8
8
  readonly mcp: "other";
9
+ readonly image_generation: "other";
9
10
  /** The plan Codex proposes in Plan mode, put to the user like Claude's ExitPlanMode. */
10
11
  readonly plan: "switch_mode";
11
12
  };
@@ -17,12 +18,36 @@ export declare const CODEX_TOOL_KINDS: {
17
18
  export interface CodexToolDescriptor {
18
19
  toolName(item: CodexItem): string;
19
20
  input(item: CodexItem): Record<string, unknown>;
21
+ /** Codex says this tool's input only once it is done: its completed item sets it again. */
22
+ inputAtCompletion?: true;
20
23
  meta(item: CodexItem): ToolMeta;
21
24
  result(item: CodexItem): {
22
25
  output: string;
23
26
  isError: boolean;
27
+ content?: ToolResultContent[];
28
+ metadata?: Record<string, unknown>;
24
29
  };
25
30
  }
31
+ /**
32
+ * The line a Codex command runs: Codex wraps it in a shell
33
+ * (`/bin/zsh -lc '<line>'`, quoted as Codex quotes it), and the line is that
34
+ * shell's one argument, unquoted. Codex's `commandActions` are not it: they
35
+ * keep only the pieces Codex recognizes (`cd sub && cat c.txt` is one read of
36
+ * `cat c.txt`) and normalize their quoting. A command of any other shape is
37
+ * as Codex reports it; one that is not a string, nothing.
38
+ */
39
+ export declare function codexCommandLine(command: unknown): string | undefined;
40
+ /**
41
+ * What a file change shows: a `diff` entry per hunk of an update, at the
42
+ * file it leaves (a move's destination); an add's content as `newText`; a
43
+ * delete's as `oldText`, its `newText` empty. Its locations are each hunk's
44
+ * start in the new file, a move's source too, and an add's or a delete's
45
+ * path alone.
46
+ */
47
+ export declare function codexChangeView(changes: CodexFileChange[] | undefined): {
48
+ content: ToolResultContent[];
49
+ locations: ToolLocation[];
50
+ };
26
51
  /**
27
52
  * The descriptor of an item type that is a tool. Its own keys only: an item
28
53
  * typed `constructor` is no tool, whatever the object's prototype holds.
@@ -1 +1 @@
1
- {"version":3,"file":"items.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/items.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0B,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,KAAK,EAAmB,SAAS,EAAE,MAAM,eAAe,CAAC;AAEhE,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB;;;;;IAK5B,wFAAwF;;CAE5C,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAClC,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAChC,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAC9D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AAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAErF"}
@@ -1,7 +1,7 @@
1
1
  import type { AuthMethod } from "../../../protocol/index.ts";
2
2
  import { type CliLogin, type LoginOptions, type LoginStatus, type NativeLogin } from "../login.ts";
3
3
  import type { CodexConnection } from "./client.ts";
4
- export interface CodexCliLoginOptions {
4
+ interface CodexCliLoginOptions {
5
5
  /**
6
6
  * A new app-server, not yet initialized, for a turn's `env`: its
7
7
  * `CODEX_HOME` is the store a login lands in.
@@ -21,10 +21,13 @@ interface CodexAccountRead {
21
21
  }
22
22
  /** A login as Codex's app-server says it (`account/read`). */
23
23
  export declare function codexLoginStatus(read: CodexAccountRead): LoginStatus;
24
+ /** The login store a turn or a login with this `env` uses: its `CODEX_HOME`, empty when unset. */
25
+ export declare function codexLoginStore(env: Record<string, string> | undefined): string;
24
26
  /** Codex's login, through its app-server: `account/read`, `account/login/start`, `account/logout`. */
25
27
  export declare class CodexCliLogin implements CliLogin {
26
28
  private readonly options;
27
29
  constructor(options: CodexCliLoginOptions);
30
+ store(env: Record<string, string> | undefined): string;
28
31
  /** Initialize a new app-server, run `use` on it, and end it. */
29
32
  private with;
30
33
  methods(options: LoginOptions): Promise<AuthMethod[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/login.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,EAGhB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAqBnD,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,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AC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;CAGlD"}
@@ -3,35 +3,11 @@ import type { AgentExecuteOptions } from "../base.ts";
3
3
  import { type CodexConnection } from "./client.ts";
4
4
  import type { CodexHomes } from "./homes.ts";
5
5
  import type { CodexNotification } from "./protocol.ts";
6
- /** Codex supports stdio and Streamable HTTP, not the legacy SSE transport. */
7
- export declare function codexMcpServers(servers: Record<string, McpServerConfig>): Record<string, unknown>;
8
- /** Only call against an explicitly isolated, engine-managed CODEX_HOME. */
9
- export declare function writeCodexMcpServers(client: Pick<CodexConnection, "request">, servers: Record<string, unknown>): Promise<void>;
10
- /** User-layer write acknowledgements do not account for repository overrides. */
11
- export declare function assertCodexMcpConfig(client: Pick<CodexConnection, "request">, cwd: string, servers: Record<string, unknown>): Promise<void>;
12
- /**
13
- * Refuse a turn's server that Codex's own configuration would change. A
14
- * server in a thread's config is the top layer of Codex's, merged table by
15
- * table over one of the same name in the user's or the repository's: the
16
- * turn's values win, and whatever else the other sets stays (its headers
17
- * and environment sent to the turn's server, its tool filter, `enabled =
18
- * false`). One that sets nothing more is the turn's server whole, and
19
- * goes on. Asked before the thread opens, so no connection is made first.
20
- */
21
- export declare function assertCodexThreadMcp(client: Pick<CodexConnection, "request">, cwd: string, servers: Record<string, unknown>): Promise<void>;
22
6
  /**
23
7
  * Codex's startup error for a server, readable: its Rust type paths out, a
24
8
  * chain it repeats said once, and no prefix naming the server again.
25
9
  */
26
10
  export declare function codexMcpCause(name: string, error: string): string;
27
- /**
28
- * Wait for the thread's MCP servers to start, and settle the ones that did
29
- * not: a required server's failure fails the turn (`McpUnavailableError`);
30
- * the others are returned, each with why, for the turn to say and go on
31
- * without. `servers` is the turn's wire configuration, by name, and `causes`
32
- * why each server last failed, as Codex said.
33
- */
34
- export declare function settleCodexMcp(client: CodexConnection, threadId: string, servers: Readonly<Record<string, McpServerConfig>>, causes: ReadonlyMap<string, string>): Promise<Record<string, string>>;
35
11
  /**
36
12
  * A turn's MCP servers: as the wire gave them, and as Codex takes them, by
37
13
  * where they go. A turn that names a home has them written there
@@ -47,8 +23,11 @@ export interface CodexTurnMcp {
47
23
  }
48
24
  /** The turn's servers, snapshotted before anything asynchronous can let the caller change them. */
49
25
  export declare function codexTurnMcp(options: AgentExecuteOptions, homes: CodexHomes): CodexTurnMcp;
50
- /** Which servers a thread's own config holds: a turn with another set runs on a thread opened again. */
51
- export declare function threadMcpFingerprint(mcp: CodexTurnMcp): string;
26
+ /**
27
+ * Which `mcp_servers` table a thread was opened with (`threadServers`): a
28
+ * turn that needs another runs on the thread opened again in a new process.
29
+ */
30
+ export declare function threadServersFingerprint(table: Record<string, unknown> | undefined): string;
52
31
  /**
53
32
  * A session's MCP servers on Codex, for one process: the configuration last
54
33
  * written to its home, why each server last failed to start, and the ones
@@ -74,12 +53,18 @@ export declare class CodexMcpState {
74
53
  /** Note what Codex says of a server's startup on the session's own thread, not a subagent's. */
75
54
  observe({ method, params }: CodexNotification, threadId: string): void;
76
55
  /**
77
- * Before the thread opens, and before each turn. Servers for the home the
56
+ * Before the thread opens, and before each turn: servers for the home the
78
57
  * turn names are written there, checked as Codex took them, and reloaded
79
- * when they changed; servers the thread carries are checked against
80
- * Codex's own configuration.
58
+ * when they changed.
59
+ */
60
+ configure({ servers }: CodexTurnMcp): Promise<void>;
61
+ /**
62
+ * The `mcp_servers` table the thread carries, for a turn that names no
63
+ * home: the turn's servers, checked against Codex's own configuration.
64
+ * Read before the thread opens, so no connection is made first, and
65
+ * before each turn.
81
66
  */
82
- configure({ servers, thread }: CodexTurnMcp): Promise<void>;
67
+ threadServers({ servers, thread, }: CodexTurnMcp): Promise<Record<string, unknown> | undefined>;
83
68
  /**
84
69
  * Get the thread's servers ready for a turn: configured, started, and the
85
70
  * ones it goes on without said through `onWarning`. A required server that
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/mcp.ts"],"names":[],"mappings":"AAAA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nection } from "./client.ts";
3
3
  /** One `model/list` entry, as far as agent-server reads it. */
4
- export type CodexModel = Record<string, unknown>;
4
+ type CodexModel = Record<string, unknown>;
5
5
  /** A model's thinking levels, and the native effort that `off` means for it. */
6
6
  export interface CodexModelThinking {
7
7
  levels: readonly ThinkingLevel[];
@@ -11,14 +11,6 @@ export interface CodexModelThinking {
11
11
  }
12
12
  /** The level a native Codex effort is: `none` and `minimal` are `off`. */
13
13
  export declare function codexThinkingLevel(effort: unknown): ThinkingLevel | undefined;
14
- /** Every page of `model/list`, hidden models included. Throws when the CLI cannot answer. */
15
- export declare function readCodexModels(client: Pick<CodexConnection, "request">): Promise<CodexModel[]>;
16
- /**
17
- * What each model accepts, by its `model` and `id`. Codex's `none` or
18
- * `minimal` is `off`, remembered so `off` sends the value the model
19
- * advertised (`none` when it offers both).
20
- */
21
- export declare function codexModelThinking(models: readonly CodexModel[]): Map<string, CodexModelThinking>;
22
14
  /**
23
15
  * The thinking levels each model the logged-in account can run accepts, from
24
16
  * `model/list`. `undefined` when the CLI cannot answer; callers fall back to
@@ -44,7 +36,7 @@ export declare function readCodexThreadDefaults(client: Pick<CodexConnection, "r
44
36
  */
45
37
  export declare function codexModelDescriptors(models: readonly CodexModel[], harness: Extract<AgentHarness, "codex-app-server">, configuredModel?: string): ModelDescriptor[];
46
38
  /** What one `codex app-server` says about its models. */
47
- export interface CodexModelListing {
39
+ interface CodexModelListing {
48
40
  models: CodexModel[];
49
41
  /**
50
42
  * The model a new thread in the listing's folder runs when the turn names
@@ -64,4 +56,5 @@ export declare function listCodexModels(client: CodexConnection, cwd: string, {
64
56
  signal?: AbortSignal;
65
57
  login?: (client: CodexConnection) => Promise<void>;
66
58
  }): Promise<CodexModelListing>;
59
+ export {};
67
60
  //# sourceMappingURL=models.d.ts.map
@@ -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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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,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;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AM,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,CAAC;IACvB,+FAA+F;IAC/F,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,sBAAsB,EAA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;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,GAAG,IAAI,CAAA;KAAE,CAAC;IAC7D,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,+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AgB,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,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
+ {"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;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. */
@@ -15,61 +14,67 @@ 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
+ * 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.
73
78
  */
74
79
  acquire(options: AgentExecuteOptions, turn: CodexTurnScope, mcp: CodexTurnMcp): Promise<CodexSession>;
75
80
  /** The turn is done with the session: an open process waits for the next one, at most `idleMs`. */
@@ -85,21 +90,44 @@ export declare class CodexSessions {
85
90
  stopUnsettled(sessionId: string): Promise<boolean> | undefined;
86
91
  /**
87
92
  * 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).
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`).
91
96
  */
92
97
  invalidate(): void;
93
98
  /**
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
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
96
102
  * already setting up or running finishes on its own.
97
103
  */
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;
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
+ */
103
130
  private spawn;
104
131
  }
132
+ export {};
105
133
  //# sourceMappingURL=session.d.ts.map