@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":"models.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,IAAI,eAAe,EAAkB,MAAM,gCAAgC,CAAC;AACnG,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,aAAa,EAElB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAG3E,OAAO,EAAE,KAAK,mBAAmB,EAAsB,MAAM,cAAc,CAAC;AAE5E;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE,CAa5F;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,GAC1C;IAAE,IAAI,CAAC,EAAE,aAAa,CAAC;IAAC,OAAO,CAAC,EAAE,aAAa,CAAA;CAAE,CAKnD;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,eAAe,CAAC,EACzF,SAAS,EAAE,eAAe,EAC1B,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,eAAe,EAAE,CAAC,CAqB5B"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,IAAI,eAAe,EAAkB,MAAM,gCAAgC,CAAC;AACnG,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,aAAa,EAElB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAG3E,OAAO,EAAE,KAAK,mBAAmB,EAAsB,MAAM,cAAc,CAAC;AAE5E;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE,CAa5F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,aAAa,GAAG,SAAS,EAChC,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,GAC1C;IAAE,IAAI,CAAC,EAAE,aAAa,CAAC;IAAC,OAAO,CAAC,EAAE,aAAa,CAAA;CAAE,CAMnD;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,eAAe,CAAC,EACzF,SAAS,EAAE,eAAe,EAC1B,MAAM,CAAC,EAAE,WAAW,GAClB,OAAO,CAAC,eAAe,EAAE,CAAC,CAqB5B"}
@@ -77,6 +77,14 @@ export interface ClaudeCodeAgentOptions {
77
77
  credentials?: CredentialSource;
78
78
  /** Idle time before an unused session's subprocess is shut down (default 5 minutes). */
79
79
  idleTimeoutMs?: number;
80
+ /**
81
+ * How long a cancel waits for Claude to acknowledge its interrupt before
82
+ * it answers `confirmed: false` (`CANCEL_CONFIRM_MS`, 2 s, by default),
83
+ * and how long a turn the runtime stopped reading has to end before its
84
+ * process is replaced. An interrupt Claude never acknowledges leaves the
85
+ * process and the turn running (LLP 0016, decision 11).
86
+ */
87
+ cancelConfirmMs?: number;
80
88
  /**
81
89
  * In-process MCP servers to attach to every session (the SDK's
82
90
  * `createSdkMcpServer` output). Called once per session spawn. Operator
@@ -131,9 +139,9 @@ export interface ClaudeCodeAgentOptions {
131
139
  inheritConfig?: InheritConfig;
132
140
  }
133
141
  /** Embed-tier extras threaded from ClaudeCodeAgentOptions into each session. */
134
- export type ClaudeSessionExtras = Pick<ClaudeCodeAgentOptions, "sdkMcpServers" | "toolPolicy" | "hooks" | "sdkOptions" | "processes">;
142
+ export type ClaudeSessionExtras = Pick<ClaudeCodeAgentOptions, "sdkMcpServers" | "toolPolicy" | "hooks" | "sdkOptions" | "processes" | "onDiagnostic">;
135
143
  /** What every session of an agent runs with: fixed when the agent is made. */
136
- export type ClaudeSessionSettings = ClaudeSessionExtras & Pick<ClaudeCodeAgentOptions, "idleTimeoutMs"> & {
144
+ export type ClaudeSessionSettings = ClaudeSessionExtras & Pick<ClaudeCodeAgentOptions, "idleTimeoutMs" | "cancelConfirmMs"> & {
137
145
  /** The agent's: where its sessions' `claude` processes start. */
138
146
  processes: NativeProcesses;
139
147
  };
@@ -153,8 +161,6 @@ export type ClaudeSessionConfig = Pick<AgentExecuteOptions, "cwd" | "additionalD
153
161
  * not keep a turn's abort signal or callbacks.
154
162
  */
155
163
  export declare function claudeSessionConfig(options: AgentExecuteOptions, cliPath: string | undefined, inheritConfig?: InheritConfig): ClaudeSessionConfig;
156
- /** How many model turns a query may take unless the turn says otherwise. */
157
- export declare const DEFAULT_MAX_TURNS = 100;
158
164
  /**
159
165
  * Everything a Claude process is started with that it cannot change while it
160
166
  * runs. A turn whose key differs from its session's needs a new process, which
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,OAAO,IAAI,SAAS,EACpB,8BAA8B,EAC9B,gBAAgB,EAChB,gBAAgB,EAEhB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,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AE,mBAAmB,GAAG,MAAM,CAyBlE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,SAAS,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAgBjG;AAED,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,CAe1F;AA2CD,wGAAwG;AACxG,wBAAgB,SAAS,CACxB,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,GAAG,eAAe,CAAC,GACxD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAEpC;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,YAAY,CAAC,EAC/C,aAAa,CAAC,EAAE,aAAa,EAC7B,SAAS,CAAC,EAAE,wBAAwB,EACpC,KAAK,CAAC,EAAE,WAAW,GACjB,SAAS,CA6EX"}
@@ -1,8 +1,6 @@
1
1
  import type { SDKRateLimitInfo, SDKResultMessage } from "@anthropic-ai/claude-agent-sdk";
2
- import { type ErrorCategory, type StopReason } from "../../../protocol/index.ts";
2
+ import { type ErrorCategory } from "../../../protocol/index.ts";
3
3
  import type { AdapterEvent, TransformResult } from "../types.ts";
4
- /** Map Anthropic stop reasons / result subtypes onto the normalized enum. */
5
- export declare function mapClaudeStopReason(stopReason: string | null | undefined, subtype: string | undefined): StopReason | undefined;
6
4
  /**
7
5
  * Claude's typed API failure codes, and HTTP statuses, as engine error
8
6
  * categories. A code or status this build does not know returns `undefined`,
@@ -12,8 +10,6 @@ export declare function mapClaudeStopReason(stopReason: string | null | undefine
12
10
  export declare function claudeErrorCategory(code: string | undefined, status?: number | null): ErrorCategory | undefined;
13
11
  /** A window used up, and no extra usage (overage) answering in its place. */
14
12
  export declare function planUsedUp(info: SDKRateLimitInfo): boolean;
15
- /** A `rate_limit_event`: one window of the claude.ai plan (`resetsAt` is in seconds). */
16
- export declare function claudeLimits(info: SDKRateLimitInfo | undefined): AdapterEvent[];
17
13
  /**
18
14
  * How a Claude turn ended, from its results: its stop reason, its failure and
19
15
  * that failure's category, and whether an interrupt stopped it. A turn runs
@@ -25,6 +21,8 @@ export declare class ClaudeTurnOutcome {
25
21
  private error?;
26
22
  /** The typed code of the last failed API request the turn reported. */
27
23
  private errorCode?;
24
+ /** The HTTP status of the API failure its result reported (`api_error_status`). */
25
+ private errorStatus?;
28
26
  /** Plan windows Claude reports used up, with no extra usage serving requests. */
29
27
  private readonly usedUpWindows;
30
28
  private interrupted;
@@ -1 +1 @@
1
- {"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/outcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAiB,MAAM,4BAA4B,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEjE,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAClC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACrC,OAAO,EAAE,MAAM,GAAG,SAAS,GACzB,UAAU,GAAG,SAAS,CAexB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GACpB,aAAa,GAAG,SAAS,CAyB3B;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAO1D;AAED,yFAAyF;AACzF,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,SAAS,GAAG,YAAY,EAAE,CAkB/E;AAED;;;;GAIG;AACH,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,UAAU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MAAM,GAAG,IAAI,GACpB,aAAa,GAAG,SAAS,CAyB3B;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAO1D;AAuBD;;;;GAIG;AACH,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,UAAU,CAAC,CAAa;IAChC,OAAO,CAAC,YAAY,CAAC,CAAS;IAC9B,OAAO,CAAC,KAAK,CAAC,CAAS;IACvB,uEAAuE;IACvE,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,mFAAmF;IACnF,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,iFAAiF;IACjF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqB;IACnD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;IAC1B,4EAA4E;IAC5E,OAAO,CAAC,aAAa,CAAS;IAE9B,qEAAqE;IACrE,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG,SAAS,GAAG,YAAY,EAAE;IAO1D,8FAA8F;IAC9F,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIjC,yEAAyE;IACzE,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIpC,oFAAoF;IACpF,SAAS,IAAI,IAAI;IAIjB,sFAAsF;IACtF,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI;IAmC9D,0BAA0B;IAC1B,MAAM,IAAI,IAAI,CACb,eAAe,EACf,YAAY,GAAG,cAAc,GAAG,OAAO,GAAG,eAAe,GAAG,WAAW,CACvE;IAwBD,uFAAuF;IACvF,OAAO,CAAC,aAAa;CAerB"}
@@ -0,0 +1,16 @@
1
+ import type { ToolLocation, ToolResultContent } from "../../../protocol/index.ts";
2
+ /** What a finished Claude tool shows beyond its text: diffs, their places, an exit code. */
3
+ export interface ClaudeResultView {
4
+ content?: ToolResultContent[];
5
+ locations?: ToolLocation[];
6
+ metadata?: Record<string, unknown>;
7
+ }
8
+ /**
9
+ * What a Claude tool's result shows, read from the CLI's structured result
10
+ * (`tool_use_result` on its `user` message) and, for a failed command, its
11
+ * text. A failure shows no diff. A command that succeeded carries no exit
12
+ * code: the CLI reports none, and counts some non-zero exits as success
13
+ * (`grep` finding nothing).
14
+ */
15
+ export declare function claudeResultView(toolName: string, structured: unknown, output: string, isError: boolean): ClaudeResultView;
16
+ //# sourceMappingURL=results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/results.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAIlF,4FAA4F;AAC5F,MAAM,WAAW,gBAAgB;IAChC,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AA0BD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,OAAO,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,GACd,gBAAgB,CAyBlB"}
@@ -0,0 +1,13 @@
1
+ import { type DiagnosticHandler } from "../../diagnostics.ts";
2
+ /**
3
+ * Say, once per OS process for each pair, that the Claude SDK that loaded and
4
+ * the CLI build it drives are different releases: a package manager let
5
+ * another SDK in (bun says nothing of an exact peer), or the CLI came from a
6
+ * pin the SDK did not follow. Call it right after `query()`: the SDK names
7
+ * itself there, in `process.env.CLAUDE_AGENT_SDK_VERSION`, from a literal in
8
+ * its own code, so a bundle names it too and no file is read for it. A
9
+ * warning, through `onDiagnostic` and the log; it never fails a turn, and an
10
+ * SDK or a CLI that cannot be named is not compared.
11
+ */
12
+ export declare function notePairedReleases(cliPath: string | undefined, onDiagnostic: DiagnosticHandler | undefined, sessionId: string): void;
13
+ //# sourceMappingURL=sdk-pair.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-pair.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/sdk-pair.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,sBAAsB,CAAC;AA8B9E;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,YAAY,EAAE,iBAAiB,GAAG,SAAS,EAC3C,SAAS,EAAE,MAAM,GACf,IAAI,CAmBN"}
@@ -1,13 +1,19 @@
1
1
  import type { McpSetServersResult, SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
2
2
  import type { McpServerConfig, PermissionMode } from "../../../protocol/index.ts";
3
+ import { type PooledClient, type PooledProcess, type ProcessEndReason, ProcessPool } from "../process-pool.ts";
3
4
  import { ClaudeMcpConnections } from "./mcp.ts";
4
- import { type ClaudeSessionConfig, type ClaudeSessionEndReason, type ClaudeSessionSettings } from "./options.ts";
5
+ import { type ClaudeCodeAgentOptions, type ClaudeSessionConfig, type ClaudeSessionEndReason, type ClaudeSessionSettings } from "./options.ts";
5
6
  import { ClaudeSpend } from "./spend.ts";
6
7
  import { ClaudeTurn, type ClaudeTurnStart } from "./turn.ts";
7
8
  type SessionState = "starting" | "idle" | "busy" | "terminated";
8
9
  type ClaudeContent = SDKUserMessage["message"]["content"];
9
- /** How long Claude has to confirm an interrupt before the turn counts as still running. */
10
- export declare const INTERRUPT_TIMEOUT_MS = 2000;
10
+ /** What a session asks of the pool that holds it. */
11
+ interface ClaudeSessionPooling {
12
+ /** A host resume came since its process began to start (`startedBeforeResume`). */
13
+ hostResumed(): boolean;
14
+ /** Claude answered a query of its own between turns: the idle wait starts again. */
15
+ betweenTurns(): void;
16
+ }
11
17
  /**
12
18
  * Wraps one long-lived Claude `query()` call. The prompt input is an AsyncQueue
13
19
  * that stays open across turns, so the same subprocess (and its context) is
@@ -15,12 +21,15 @@ export declare const INTERRUPT_TIMEOUT_MS = 2000;
15
21
  * of the session (`observe`) and hands it to the running turn (`route`); the
16
22
  * `result` answering the turn ends it.
17
23
  *
18
- * Lifecycle: starting → idle ⇄ busy → terminated.
24
+ * Lifecycle: starting → idle ⇄ busy → terminated. To the process pool it is
25
+ * both the process and its client: `closed` once its end began, from any
26
+ * state; `close` ends it whatever it is doing, a running turn with it.
19
27
  */
20
- export declare class ClaudeSession {
28
+ export declare class ClaudeSession implements PooledProcess, PooledClient {
21
29
  readonly id: string;
22
30
  private readonly settings;
23
31
  private readonly onTerminated?;
32
+ private readonly pooling?;
24
33
  private state;
25
34
  /** What the session runs with; its MCP servers are `mcp`'s. */
26
35
  private config;
@@ -48,12 +57,19 @@ export declare class ClaudeSession {
48
57
  * changes, so a turn after a used-up window starts from that report.
49
58
  */
50
59
  private readonly planWindows;
51
- private idleTimer?;
52
60
  /** The `claude` process the engine started for it; none under an operator's spawner. */
53
61
  private native?;
54
62
  /** Its end, once it began: settles when its process is stopped. */
55
63
  private ending?;
56
- constructor(id: string, config: ClaudeSessionConfig, settings: ClaudeSessionSettings, onTerminated?: ((reason: ClaudeSessionEndReason) => void) | undefined);
64
+ private readonly closeHandlers;
65
+ constructor(id: string, config: ClaudeSessionConfig, settings: ClaudeSessionSettings, onTerminated?: ((reason: ClaudeSessionEndReason) => void) | undefined, pooling?: ClaudeSessionPooling | undefined);
66
+ /** The pool's process is its own client. */
67
+ get client(): this;
68
+ get closed(): boolean;
69
+ close(reason?: ProcessEndReason): void;
70
+ onClose(handler: () => void): () => void;
71
+ /** Settles once its process is stopped and its end reported. */
72
+ gone(): Promise<void>;
57
73
  get currentState(): SessionState;
58
74
  get currentSessionId(): string | null;
59
75
  get currentConfig(): Readonly<Omit<ClaudeSessionConfig, "mcpServers">>;
@@ -72,8 +88,15 @@ export declare class ClaudeSession {
72
88
  * the host's own tools. A text-only session stays tool-free.
73
89
  */
74
90
  setMcpServers(servers: Record<string, McpServerConfig>): Promise<McpSetServersResult | undefined>;
75
- /** Host suspension: the next turn resumes the saved conversation in a new process. */
76
- invalidateMcpConnections(): void;
91
+ /**
92
+ * Switch what the live process can switch for the turn: its model, its
93
+ * permission mode, its MCP servers. All else is in its spawn key, so this
94
+ * never asks for a new process. The SDK gives these control requests no
95
+ * deadline: the turn's cancel (`signal`) ends the wait for each, and the
96
+ * process, since what it applied is not known; the session's next turn
97
+ * resumes the conversation on a new one.
98
+ */
99
+ applyLiveChange(next: ClaudeSessionConfig, signal: AbortSignal): Promise<boolean>;
77
100
  start(): Promise<void>;
78
101
  /**
79
102
  * Send a turn's prompt: the turn's events stream until its result. One turn
@@ -92,6 +115,8 @@ export declare class ClaudeSession {
92
115
  private rejectedWindowReports;
93
116
  /** A uuid-stamped user message: Claude names it when it replays or consumes it. */
94
117
  private userMessage;
118
+ /** How long Claude has to confirm an interrupt before the turn counts as still running. */
119
+ private get confirmMs();
95
120
  /**
96
121
  * Stop the in-flight turn without killing the session. Returns whether the
97
122
  * interrupt was CONFIRMED: true when there was nothing to interrupt or the
@@ -126,7 +151,7 @@ export declare class ClaudeSession {
126
151
  /**
127
152
  * End the session: close its query, and stop its process with its tool
128
153
  * sessions and MCP servers. Settles once they are gone (at most the grace);
129
- * every call shares that end.
154
+ * every call shares that end, and the first one's reason is reported.
130
155
  */
131
156
  terminate(reason?: ClaudeSessionEndReason): Promise<void>;
132
157
  private end;
@@ -141,8 +166,21 @@ export declare class ClaudeSession {
141
166
  */
142
167
  private settleUnshown;
143
168
  private endTurn;
144
- private resetIdleTimer;
145
- private clearIdleTimer;
146
169
  }
170
+ /** What a turn brings to the pool. `spawn` notes on it whether its process is new. */
171
+ export interface ClaudePoolTurn {
172
+ sessionId: string;
173
+ config: ClaudeSessionConfig;
174
+ /** The turn's process was started for it: a resume it asks for is not confirmed yet. */
175
+ spawned?: boolean;
176
+ }
177
+ /** Each logical session's Claude process, on the pool every harness runs on. */
178
+ export type ClaudeSessionPool = ProcessPool<ClaudeSession, ClaudePoolTurn>;
179
+ /**
180
+ * An agent's Claude sessions. Claude decides of a warm process only whether
181
+ * its spawn key is the turn's and what it switches live; the pool decides
182
+ * the rest (LLP 0001, D10).
183
+ */
184
+ export declare function claudeSessionPool(settings: ClaudeSessionSettings & Pick<ClaudeCodeAgentOptions, "onSessionEnd">): ClaudeSessionPool;
147
185
  export {};
148
186
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,mBAAmB,EAMnB,cAAc,EACd,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAOlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAK1B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAE7D,KAAK,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;AAChE,KAAK,aAAa,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC;AAE1D,2FAA2F;AAC3F,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAY1C;;;;;;;;GAQG;AACH,qBAAa,aAAa;IAoCxB,QAAQ,CAAC,EAAE,EAAE,MAAM;IAEnB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC;IAtC/B,OAAO,CAAC,KAAK,CAA4B;IACzC,+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AG;YA0BH,aAAa;IAkB3B,oGAAoG;IACpG,OAAO,CAAC,OAAO;IA2Bf,iFAAiF;IACjF,OAAO,CAAC,KAAK;IAgCb;;;OAGG;IACH,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,OAAO;CAKf;AAED,sFAAsF;AACtF,MAAM,WAAW,cAAc;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,gFAAgF;AAChF,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAE3E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAC,sBAAsB,EAAE,cAAc,CAAC,GAC5E,iBAAiB,CAiDnB"}
@@ -5,7 +5,7 @@ import type { TokenUsage } from "../../../protocol/index.ts";
5
5
  * in `modelUsage`: every call through its query pipeline, sub-agents and
6
6
  * compaction included, where a result's `usage` counts only the main loop.
7
7
  */
8
- export interface ClaudeUsageTotals {
8
+ interface ClaudeUsageTotals {
9
9
  input: number;
10
10
  output: number;
11
11
  cacheRead: number;
@@ -55,4 +55,5 @@ export declare class ClaudeSpend {
55
55
  */
56
56
  charge(result: SDKResultMessage): ClaudeQuerySpend;
57
57
  }
58
+ export {};
58
59
  //# sourceMappingURL=spend.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spend.d.ts","sourceRoot":"","sources":["../../../../../src/core/agents/claude-code/spend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,S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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":"","sources":["../../../../../src/core/agents/codex-app-server/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,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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,GAAG,IAAI,CAAC;IACnE;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,CAA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S,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,EAAE,MAAM,CAAC;IACvB,mFAAmF;IACnF,mBAAmB,CAAC,EAAE,MA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AE,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;AAC9E,UAAU,uBAAuB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SA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FAAoF;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. */