@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,4 +1,27 @@
1
- import type { ToolLocation, ToolMeta } from "../../../protocol/index.ts";
2
- export declare function toolLocationsFromInput(input: Record<string, unknown>): ToolLocation[] | undefined;
3
- export declare function claudeToolMeta(toolName: string, input?: Record<string, unknown>): ToolMeta;
1
+ import type { McpTool, ToolKind, ToolMeta } from "../../../protocol/index.ts";
2
+ /**
3
+ * Maps Claude Code's tool names onto the normalized ToolKind taxonomy and
4
+ * extracts touched file locations from tool inputs. Pure best-effort: unknown
5
+ * tools are `other` and produce no locations.
6
+ */
7
+ /**
8
+ * Each Claude tool's kind, decided on what the tool does. A map, not an
9
+ * object: a tool named `constructor` is no object member's kind. The free
10
+ * live check (`claude-tool-kinds.live.test.ts`) fails on a tool the pinned
11
+ * CLI offers that is not here, so a pin bump decides it.
12
+ */
13
+ export declare const CLAUDE_TOOL_KINDS: ReadonlyMap<string, ToolKind>;
14
+ /**
15
+ * The server and tool of a Claude MCP tool name, `mcp__<server>__<tool>`. A
16
+ * server's name may hold `__` itself, so the longest name the session
17
+ * attached that fits wins; with none, the name splits at its first `__`.
18
+ * Undefined for a name that is no MCP tool.
19
+ */
20
+ export declare function claudeMcpTool(toolName: string, servers?: Iterable<string>): McpTool | undefined;
21
+ /**
22
+ * A Claude tool's kind and touched files, a `Bash` call's command and a
23
+ * `WebFetch` call's address; for an MCP tool, its server and tool among
24
+ * `servers`.
25
+ */
26
+ export declare function claudeToolMeta(toolName: string, input?: Record<string, unknown>, servers?: Iterable<string>): ToolMeta;
4
27
  //# sourceMappingURL=tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,YAAY,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAiCnF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,YAAY,EAAE,GAAG,SAAS,CAMjG;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,QAAQ,CAK1F"}
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAgB,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE5F;;;;GAIG;AAGH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,CAiD1D,CAAC;AA2BH;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,QAAQ,CAAC,MAAM,CAAM,GAC5B,OAAO,GAAG,SAAS,CAarB;AASD;;;;GAIG;AACH,wBAAgB,cAAc,CAC7B,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,GACxB,QAAQ,CAWV"}
@@ -4,8 +4,8 @@ import type { AdapterEvent, EventTransformer, TransformResult } from "../types.t
4
4
  * Parses `codex app-server` v2 notifications into AdapterEvents. This harness
5
5
  * streams token-level deltas (item/agentMessage/delta, item/reasoning/*Delta),
6
6
  * so no diffing is needed. Items carry camelCase fields. Tool-like items
7
- * (commandExecution/fileChange/mcpToolCall/webSearch) become tool parts that
8
- * complete on item/completed.
7
+ * (commandExecution/fileChange/mcpToolCall/webSearch/imageGeneration) become
8
+ * tool parts that complete on item/completed.
9
9
  */
10
10
  export declare class CodexAppServerTransformer implements EventTransformer<unknown> {
11
11
  private readonly ctx;
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","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gBAEhB,GAAG,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE;IAItC,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,YAAY,EAAE;IAMrC,MAAM,IAAI,eAAe;IAYzB,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,YAAY;IA+FpB,OAAO,CAAC,QAAQ;IA+BhB,OAAO,CAAC,YAAY;IA4CpB,kFAAkF;IAClF,OAAO,CAAC,IAAI;IAYZ,OAAO,CAAC,WAAW;IA8BnB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,QAAQ;IAqBhB,OAAO,CAAC,SAAS;IAuBjB,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,YAAY;CAapB;AAED,wBAAgB,+BAA+B,CAAC,GAAG,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,gBAAgB,CAE5F;AAwCD,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAgC3E"}
@@ -25,7 +25,11 @@ export interface CodexConnection {
25
25
  onClose(handler: (error?: Error) => void): () => void;
26
26
  /** End the app-server now. Nothing confirms that what it ran stopped. */
27
27
  close(): void;
28
- /** End the app-server by its own shutdown: whether that confirmed its threads and tools stopped. */
28
+ /**
29
+ * End the app-server by its own shutdown: whether that confirmed its
30
+ * threads and tools stopped. It is stopped after `timeoutMs`
31
+ * (`SHUTDOWN_TIMEOUT_MS` by default) and given as long again to exit.
32
+ */
29
33
  closeAndWait(timeoutMs?: number): Promise<boolean>;
30
34
  /**
31
35
  * Settles once an app-server that was ended has exited, or could not be
@@ -35,7 +39,7 @@ export interface CodexConnection {
35
39
  gone?(): Promise<void>;
36
40
  }
37
41
  /** How far `pages` reads a list. */
38
- export interface PageLimits {
42
+ interface PageLimits {
39
43
  /** Each page's deadline. */
40
44
  timeoutMs?: number;
41
45
  /** Past this many pages the list did not end. */
@@ -65,6 +69,12 @@ export interface CodexAppServerClientOptions {
65
69
  * it would replace that home's own login.
66
70
  */
67
71
  ephemeralCredentials?: boolean;
72
+ /**
73
+ * Start with Codex's plugins off (`-c features.plugins=false`): set on the
74
+ * command line because a fresh `CODEX_HOME` clones the plugin catalogue
75
+ * as the process starts, before any thread's config is read.
76
+ */
77
+ pluginsOff?: boolean;
68
78
  startupTimeoutMs?: number;
69
79
  /** Default deadline for every JSON-RPC request. */
70
80
  requestTimeoutMs?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAevD,KAAK,mBAAmB,GAAG,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;AAE1D,iFAAiF;AACjF,MAAM,MAAM,oBAAoB,GAAG,CAClC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC3B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC/B,2DAA2D;IAC3D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,KAAK,GAAG,SAAS,CAAC;IACtC,4DAA4D;IAC5D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/E,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,IAAI,CAAC;IACzD,8EAA8E;IAC9E,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,GA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AAM,IAAI,OAAO,CAEpB;IAED,IAAI,SAAS,IAAI,KAAK,GAAG,SAAS,CAEjC;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAYjC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAqB9E,KAAK,IAAI,IAAI;IAeb,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAOrB,qGAAqG;IACrG,YAAY,CAAC,SAAS,SAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IA6C/D,uFAAuF;IACvF,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,KAAK;IAoDb,OAAO,CAAC,QAAQ;IAiBhB,OAAO,CAAC,aAAa;IA4CrB,OAAO,CAAC,MAAM;IAad,OAAO,CAAC,KAAK;CAGb"}
@@ -1,25 +1,31 @@
1
1
  import type { AgentInput, ModelDescriptor } from "../../../protocol/index.ts";
2
2
  import { type NativeProcesses } from "../../processes/native-processes.ts";
3
- import type { AgentExecuteOptions, CancelResult, ListModelsOptions, RawAgentEvent } from "../base.ts";
3
+ import type { AgentExecuteOptions, ListModelsOptions, RawAgentEvent } from "../base.ts";
4
4
  import type { CredentialSource } from "../credentials.ts";
5
5
  import type { InheritConfig } from "../inherit-config.ts";
6
6
  import { SessionAgent } from "../session-agent.ts";
7
7
  import { type CodexAppServerClientOptions, type CodexConnection } from "./client.ts";
8
8
  import { CodexCliLogin } from "./login.ts";
9
+ import { type CodexBuiltInTools } from "./options.ts";
9
10
  export interface CodexAppServerAgentOptions {
10
11
  /** Make the connection to `codex app-server` (a test's fake); a `CodexAppServerClient` by default. */
11
12
  createClient?: (options: CodexAppServerClientOptions) => CodexConnection;
13
+ /** Idle time before a session's app-server is ended (5 minutes by default); 0 never ends one for idleness. */
12
14
  idleTimeoutMs?: number;
13
15
  /** Fail a turn if the app-server goes silent this long after a retryable error. */
14
16
  retryStallTimeoutMs?: number;
15
17
  /**
16
- * How long Codex has to confirm a stop (2 s by default): to acknowledge a
17
- * cancel's `turn/interrupt` before the turn's process is ended, and to let
18
- * the interrupted turn drain; to stop the commands the turn started, and
19
- * for its own shutdown when they will not stop; to put a thread's settings
20
- * back after a failed turn (`thread/settings/update`); and for each request
21
- * of a managed turn's cleanup and its shutdown, five times it for the whole
22
- * cleanup.
18
+ * How long a cancel waits for Codex to confirm its turn stopped before it
19
+ * answers `confirmed: false` (`CANCEL_CONFIRM_MS`, 2 s, by default), and
20
+ * how long a failed turn waits for Codex to say it ended before its process
21
+ * is ended.
22
+ */
23
+ cancelConfirmMs?: number;
24
+ /**
25
+ * How long after a cancel Codex's process is ended when its turn has not
26
+ * stopped (2 s by default): its `turn/interrupt` unanswered, or the
27
+ * commands the turn started not confirmed stopped, which Codex's own
28
+ * shutdown then stops.
23
29
  */
24
30
  cancelGraceMs?: number;
25
31
  /**
@@ -54,6 +60,30 @@ export interface CodexAppServerAgentOptions {
54
60
  * the repository's skills and `~/.agents/skills` at every level.
55
61
  */
56
62
  inheritConfig?: InheritConfig;
63
+ /**
64
+ * Codex's own tools the model gets, each on unless set `false` (LLP 0017):
65
+ * `local` its shell, `apply_patch`, `view_image` and `write_stdin`, so
66
+ * that nothing it runs reads or writes the disk; `webSearch`; and
67
+ * `imageGeneration`, whose pictures come as an `image_generation` tool
68
+ * part, saying where Codex saved each, when it is on. `local: false` holds
69
+ * for the sub-agents Codex spawns too. A product whose agent works only
70
+ * through its own MCP tools turns all three off. Code mode's `exec`, its
71
+ * sub-agent tools and questions stay: `disableTools` is still refused.
72
+ * Operator-level only.
73
+ */
74
+ builtInTools?: CodexBuiltInTools;
75
+ /**
76
+ * A turn that names a `CODEX_HOME` of its session's own (every turn below
77
+ * `inheritConfig: "all"` does) runs on the user's own Codex login: the one
78
+ * of the engine's own Codex home (`$CODEX_HOME`, else `~/.codex`), read
79
+ * from Codex before each turn and held in the session's process's memory,
80
+ * never written to the session's home (LLP 0017). A product's
81
+ * `credentials` and the turn's `apiKey` come first; with no login there
82
+ * the turn fails (`auth`) before its process starts. A product reads
83
+ * that login's status and signs it in with no `env` (`auth/*`). Off by
84
+ * default. Operator-level only.
85
+ */
86
+ userLogin?: boolean;
57
87
  }
58
88
  /**
59
89
  * Codex harness backed by a long-lived `codex app-server` subprocess speaking
@@ -76,18 +106,29 @@ export declare class CodexAppServerAgent extends SessionAgent {
76
106
  rejectionMessages: boolean;
77
107
  turnScopedSubagents?: boolean | undefined;
78
108
  steering?: boolean | undefined;
109
+ ignoredSettings?: string[] | undefined;
79
110
  };
80
111
  /** Its CLIs start here: the runtime's, or this OS process's own when it was made without one. */
81
112
  readonly processes: NativeProcesses;
82
113
  private readonly timing;
83
114
  private readonly sessions;
84
- /** A cancel's acknowledgement belongs to one invocation, even after it drains. */
85
- private readonly turns;
86
115
  readonly login: CodexCliLogin;
116
+ /**
117
+ * The user's own login (`userLogin`), read from an app-server with the
118
+ * engine's own environment: never a session's `CODEX_HOME`.
119
+ */
120
+ private readonly readUserLogin;
87
121
  constructor(agentOptions?: CodexAppServerAgentOptions);
88
122
  /** On a product's credentials, each session may list as a different account. */
89
123
  get modelsPerSession(): boolean;
90
124
  protected executeTurn(input: AgentInput, options: AgentExecuteOptions, controller: AbortController): AsyncIterableIterator<RawAgentEvent>;
125
+ /**
126
+ * The user's own login, for a turn (or a model list) whose `env` names a
127
+ * home, when the operator set `userLogin`: read again for each, so a login
128
+ * the user changed is the next turn's. None otherwise: a turn that names
129
+ * no home runs on its home's own login.
130
+ */
131
+ private userLoginFor;
91
132
  /** How the turn stops: by Codex's interrupt, or, managed, with its native cleanup. */
92
133
  private stopFor;
93
134
  protected checkSteerInput(input: AgentInput): void;
@@ -98,13 +139,17 @@ export declare class CodexAppServerAgent extends SessionAgent {
98
139
  * with the account the product's `credentials` hold for that session.
99
140
  */
100
141
  listModels(options: ListModelsOptions): Promise<ModelDescriptor[]>;
101
- cancel(sessionId: string): Promise<CancelResult>;
142
+ /** With no turn running, a managed session's process not yet confirmed stopped. */
143
+ protected stopWithoutTurn(sessionId: string): Promise<boolean> | undefined;
102
144
  /** Unchanged MCP config reloads retain dead remote connections after VM resume. */
103
145
  invalidateMcpConnections(): void;
104
- loginChanged(): void;
146
+ loginChanged(store?: string): void;
105
147
  release(sessionId: string): Promise<void>;
106
148
  terminateAll(): Promise<void>;
107
- /** The CLI to run: the provisioner's, else `$CODEX_CLI_PATH`; PATH's `codex` when neither. */
149
+ /**
150
+ * The CLI to run: the provisioner's, else `$CODEX_CLI_PATH`; PATH's `codex`
151
+ * when neither. A turn waits for it until the turn is cancelled.
152
+ */
108
153
  private cliPath;
109
154
  /**
110
155
  * A connection to a new `codex app-server` for a folder, its `env` and a
@@ -1 +1 @@
1
- {"version":3,"file":"codex-agent.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/codex-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,UAAU,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,qCAAqC,CAAC;AAElG,OAAO,KAAK,EACX,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAqB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,OAAO,EAEN,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAgC3C,MAAM,WAAW,0BAA0B;IAC1C,sGAAsG;IACtG,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,2BAA2B,KAAK,eAAe,CAAC;IACzE,aAAa,CAAC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,eAAe,EAAE,CAAC;IA0BxE,mFAAmF;cAChE,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS;IAInF,mFAAmF;IACnF,wBAAwB,IAAI,IAAI;IAIhC,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAInB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUzC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5C;;;OAGG;YACW,OAAO;IAOrB;;;OAGG;YACW,OAAO;CA4BrB"}
@@ -17,7 +17,7 @@ export declare function listBackgroundTerminals(client: Pick<CodexConnection, "r
17
17
  export declare class TurnCommands {
18
18
  private readonly client;
19
19
  private readonly threadId;
20
- /** How long a stop has to confirm the commands stopped (`cancelGraceMs`). */
20
+ /** How long the commands have to stop before Codex's own shutdown stops them (`cancelGraceMs`). */
21
21
  private readonly timeoutMs;
22
22
  private readonly commands;
23
23
  /** Completions that came after Codex's turn ended, which its events no longer take. */
@@ -26,7 +26,7 @@ export declare class TurnCommands {
26
26
  private interrupting;
27
27
  private stopping?;
28
28
  constructor(client: CodexConnection, threadId: string,
29
- /** How long a stop has to confirm the commands stopped (`cancelGraceMs`). */
29
+ /** How long the commands have to stop before Codex's own shutdown stops them (`cancelGraceMs`). */
30
30
  timeoutMs: number);
31
31
  /** Note an item Codex started: a command the turn owns, unless it is another's. */
32
32
  started(item: CodexItem | undefined): void;
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/codex-app-server/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAS,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAa,MAAM,eAAe,CAAC;AAElF,8EAA8E;AAC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SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO;IAM/C,oFAAoF;IACpF,KAAK,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAOjC,0FAA0F;IAC1F,QAAQ,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAIpC;;;;OAIG;IACF,SAAS,IAAI,SAAS,CAAC,aAAa,CAAC;IAQtC,sEAAsE;IACtE,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,gGAAgG;IAChG,WAAW,IAAI,IAAI;IAInB;;;;;OAKG;IACH,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAczB;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAKzC,+CAA+C;IAC/C,OAAO,IAAI,MAAM,EAAE;CAGnB"}
@@ -25,7 +25,9 @@ export type CodexAuth = {
25
25
  * holds (`credentials`), an API key or a ChatGPT access token kept in the
26
26
  * app-server's memory, which asks the product again (with the token it
27
27
  * refused) when it needs a fresher one; without one, the turn's own `apiKey`;
28
- * without that, the CLI's own login.
28
+ * without that, the user's own login (`userLogin`, given for a turn that
29
+ * names a home of its session's own when the operator set it); without
30
+ * that, the CLI's own login.
29
31
  */
30
32
  export declare function authFor(ask: {
31
33
  credentials: CredentialSource | undefined;
@@ -33,6 +35,8 @@ export declare function authFor(ask: {
33
35
  sessionId: string | undefined;
34
36
  turnId?: string;
35
37
  apiKey: string | undefined;
38
+ /** The user's own login, read from Codex (`user-login.ts`); it throws when there is none. */
39
+ userLogin?: (signal?: AbortSignal) => Promise<CodexAuth>;
36
40
  signal?: AbortSignal;
37
41
  }): Promise<CodexAuth | undefined>;
38
42
  /** Who a process is logged in as: an account or key change needs a new process. */
@@ -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,mBAA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G,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"}
@@ -1,5 +1,11 @@
1
1
  import type { AgentExecuteOptions } from "../base.ts";
2
2
  import type { InheritConfig } from "../inherit-config.ts";
3
+ /**
4
+ * The Codex home a process with this `env` runs in, absolute: the one the
5
+ * `env` names, else the engine's own (`$CODEX_HOME`, else `~/.codex`), the
6
+ * user's shared home.
7
+ */
8
+ export declare function codexHome(env?: Record<string, string>): string;
3
9
  /**
4
10
  * Which logical session owns each `CODEX_HOME` its turns name. A turn that
5
11
  * names one claims it for its session, which keeps it until it is released,
@@ -19,4 +25,23 @@ export declare class CodexHomes {
19
25
  release(sessionId: string): void;
20
26
  clear(): void;
21
27
  }
28
+ /**
29
+ * Which folder a `CODEX_HOME` is now (its device and inode), `"gone"` when
30
+ * there is none; nothing when the turn names no home. A process keeps the
31
+ * files it opened in the home it started in, so a home removed or replaced
32
+ * under it is another home: the conversation it writes is in deleted files,
33
+ * and the `config.toml` it reads is not the one there. The comparison holds
34
+ * only while the session holds its home open (`holdHome`): on ext4 a removed
35
+ * folder's inode number goes to the next folder made, at once, unless a
36
+ * handle on the old one is open (measured under Node 22 and Bun 1.3.14), so
37
+ * `rm -rf home; mkdir home` would otherwise read as the same folder.
38
+ */
39
+ export declare function homeIdentity(home: string | undefined): string | undefined;
40
+ /**
41
+ * Hold the folder a `CODEX_HOME` is now open, keeping its inode number its
42
+ * own (`homeIdentity`), until the answer is called; calling it again does
43
+ * nothing. A turn that names no home, or a home that cannot be opened (no
44
+ * folder, a platform that does not open directories), holds nothing.
45
+ */
46
+ export declare function holdHome(home: string | undefined): () => void;
22
47
  //# 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;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAE9D;AAED;;;;;;;;;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,CA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gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAIrE;AA0BD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,SAAS,GAAG;IACxE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,SAAS,EAAE,YAAY,EAAE,CAAC;CAC1B,CA2BA;AAqGD;;;GAGG;AACH,wBAAgB,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,25 @@ 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;
26
+ /**
27
+ * What the login file of the store a turn with this `env` runs on looks
28
+ * like (`<CODEX_HOME>/auth.json`, the turn's, else the process's, else
29
+ * `~/.codex`'s; Codex's default `file` store): its device, inode, size and
30
+ * modified and changed times at full precision, or `absent`. Codex writes
31
+ * the file in place on any login change, a token renewal and a rewrite of
32
+ * the same key, and removes it at a sign-out, so a running app-server, which
33
+ * keeps the login it started with, is stale once this differs. A link is
34
+ * followed to its target (a product may link the person's own `auth.json`
35
+ * into a session's home). The file is never opened.
36
+ */
37
+ export declare function codexLoginMark(env: Record<string, string> | undefined): string;
24
38
  /** Codex's login, through its app-server: `account/read`, `account/login/start`, `account/logout`. */
25
39
  export declare class CodexCliLogin implements CliLogin {
26
40
  private readonly options;
27
41
  constructor(options: CodexCliLoginOptions);
42
+ store(env: Record<string, string> | undefined): string;
28
43
  /** Initialize a new app-server, run `use` on it, and end it. */
29
44
  private with;
30
45
  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,OAAO,CAAC,eAAe,CAAC,CAAC;IAC3E,+CAA+C;IAC/C,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED,mCAAmC;AACnC,UAAU,gBAAgB;IACzB,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IACpF,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,WAAW,CA4BpE;AAED,sGAAsG;AACtG,qBAAa,aAAc,YAAW,QAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,oBAAoB;IAE1D,gEAAgE;YAClD,IAAI;IAgBZ,OAAO,CAAC,OAA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AgB,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM,CAE/E;AAGD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM,CAa9E;AAED,sGAAsG;AACtG,qBAAa,aAAc,YAAW,QAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,oBAAoB;IAE1D,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM;IAItD,gEAAgE;YAClD,IAAI;IAgBZ,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAWrD,MAAM,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IASnD,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAuDpF,MAAM,CAAC,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,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAQtD,OAAO,EAAE,KAAK,eAAe,EAAS,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmBjG;AAED,2EAA2E;AAC3E,wBAAsB,oBAAoB,CACzC,M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Ae,EACvB,GAAG,EAAE,MAAM;IAG7B,gGAAgG;IAChG,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAUtE;;;;OAIG;IACG,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAazD;;;;;OAKG;IACG,aAAa,CAAC,EACnB,OAAO,EACP,MAAM,GACN,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IAU9D;;;;OAIG;IACG,OAAO,CACZ,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,GAC5D,OAAO,CAAC,IAAI,CAAC;IAuBhB;;;OAGG;YACW,gBAAgB;IAU9B;;;;;OAKG;YACW,kBAAkB;CAOhC"}
@@ -1,7 +1,7 @@
1
1
  import type { AgentHarness, ModelDescriptor, ThinkingLevel } from "../../../protocol/index.ts";
2
2
  import { type CodexConnection } 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