openai 7.14.0 → 7.16.0

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 (456) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +6 -0
  3. package/bedrock.d.mts.map +1 -1
  4. package/bedrock.d.ts.map +1 -1
  5. package/bedrock.js +9 -6
  6. package/bedrock.js.map +1 -1
  7. package/bedrock.mjs +9 -6
  8. package/bedrock.mjs.map +1 -1
  9. package/client.d.mts +16 -4
  10. package/client.d.mts.map +1 -1
  11. package/client.d.ts +16 -4
  12. package/client.d.ts.map +1 -1
  13. package/client.js +37 -20
  14. package/client.js.map +1 -1
  15. package/client.mjs +37 -20
  16. package/client.mjs.map +1 -1
  17. package/core/pagination.d.mts +19 -1
  18. package/core/pagination.d.mts.map +1 -1
  19. package/core/pagination.d.ts +19 -1
  20. package/core/pagination.d.ts.map +1 -1
  21. package/core/pagination.js +32 -1
  22. package/core/pagination.js.map +1 -1
  23. package/core/pagination.mjs +30 -0
  24. package/core/pagination.mjs.map +1 -1
  25. package/internal/realtime-credentials.d.mts +1 -1
  26. package/internal/realtime-credentials.d.ts +1 -1
  27. package/internal/realtime-credentials.js +1 -1
  28. package/internal/realtime-credentials.mjs +1 -1
  29. package/internal/utils/abort.d.mts +11 -0
  30. package/internal/utils/abort.d.mts.map +1 -0
  31. package/internal/utils/abort.d.ts +11 -0
  32. package/internal/utils/abort.d.ts.map +1 -0
  33. package/internal/utils/abort.js +87 -0
  34. package/internal/utils/abort.js.map +1 -0
  35. package/internal/utils/abort.mjs +83 -0
  36. package/internal/utils/abort.mjs.map +1 -0
  37. package/internal/ws.d.mts +13 -0
  38. package/internal/ws.d.mts.map +1 -1
  39. package/internal/ws.d.ts +13 -0
  40. package/internal/ws.d.ts.map +1 -1
  41. package/internal/ws.js +10 -0
  42. package/internal/ws.js.map +1 -1
  43. package/internal/ws.mjs +9 -0
  44. package/internal/ws.mjs.map +1 -1
  45. package/lib/agents/agent-session-stream.d.mts +41 -0
  46. package/lib/agents/agent-session-stream.d.mts.map +1 -0
  47. package/lib/agents/agent-session-stream.d.ts +41 -0
  48. package/lib/agents/agent-session-stream.d.ts.map +1 -0
  49. package/lib/agents/agent-session-stream.js +271 -0
  50. package/lib/agents/agent-session-stream.js.map +1 -0
  51. package/lib/agents/agent-session-stream.mjs +267 -0
  52. package/lib/agents/agent-session-stream.mjs.map +1 -0
  53. package/lib/agents/output-text.d.mts +4 -0
  54. package/lib/agents/output-text.d.mts.map +1 -0
  55. package/lib/agents/output-text.d.ts +4 -0
  56. package/lib/agents/output-text.d.ts.map +1 -0
  57. package/lib/agents/output-text.js +8 -0
  58. package/lib/agents/output-text.js.map +1 -0
  59. package/lib/agents/output-text.mjs +5 -0
  60. package/lib/agents/output-text.mjs.map +1 -0
  61. package/lib/agents/turn-state.d.mts +14 -0
  62. package/lib/agents/turn-state.d.mts.map +1 -0
  63. package/lib/agents/turn-state.d.ts +14 -0
  64. package/lib/agents/turn-state.d.ts.map +1 -0
  65. package/lib/agents/turn-state.js +62 -0
  66. package/lib/agents/turn-state.js.map +1 -0
  67. package/lib/agents/turn-state.mjs +58 -0
  68. package/lib/agents/turn-state.mjs.map +1 -0
  69. package/lib/live/transcript-grouping.d.mts +2 -2
  70. package/lib/live/transcript-grouping.d.mts.map +1 -1
  71. package/lib/live/transcript-grouping.d.ts +2 -2
  72. package/lib/live/transcript-grouping.d.ts.map +1 -1
  73. package/lib/live/transcript-grouping.js +44 -22
  74. package/lib/live/transcript-grouping.js.map +1 -1
  75. package/lib/live/transcript-grouping.mjs +44 -22
  76. package/lib/live/transcript-grouping.mjs.map +1 -1
  77. package/package.json +1 -1
  78. package/resources/beta/agents/agents.d.mts +3678 -0
  79. package/resources/beta/agents/agents.d.mts.map +1 -0
  80. package/resources/beta/agents/agents.d.ts +3678 -0
  81. package/resources/beta/agents/agents.d.ts.map +1 -0
  82. package/resources/beta/agents/agents.js +118 -0
  83. package/resources/beta/agents/agents.js.map +1 -0
  84. package/resources/beta/agents/agents.mjs +113 -0
  85. package/resources/beta/agents/agents.mjs.map +1 -0
  86. package/resources/beta/agents/environments/environments.d.mts +65 -0
  87. package/resources/beta/agents/environments/environments.d.mts.map +1 -0
  88. package/resources/beta/agents/environments/environments.d.ts +65 -0
  89. package/resources/beta/agents/environments/environments.d.ts.map +1 -0
  90. package/resources/beta/agents/environments/environments.js +43 -0
  91. package/resources/beta/agents/environments/environments.js.map +1 -0
  92. package/resources/beta/agents/environments/environments.mjs +38 -0
  93. package/resources/beta/agents/environments/environments.mjs.map +1 -0
  94. package/resources/beta/agents/environments/files.d.mts +111 -0
  95. package/resources/beta/agents/environments/files.d.mts.map +1 -0
  96. package/resources/beta/agents/environments/files.d.ts +111 -0
  97. package/resources/beta/agents/environments/files.d.ts.map +1 -0
  98. package/resources/beta/agents/environments/files.js +61 -0
  99. package/resources/beta/agents/environments/files.js.map +1 -0
  100. package/resources/beta/agents/environments/files.mjs +57 -0
  101. package/resources/beta/agents/environments/files.mjs.map +1 -0
  102. package/resources/beta/agents/environments/index.d.mts +4 -0
  103. package/resources/beta/agents/environments/index.d.mts.map +1 -0
  104. package/resources/beta/agents/environments/index.d.ts +4 -0
  105. package/resources/beta/agents/environments/index.d.ts.map +1 -0
  106. package/resources/beta/agents/environments/index.js +11 -0
  107. package/resources/beta/agents/environments/index.js.map +1 -0
  108. package/resources/beta/agents/environments/index.mjs +5 -0
  109. package/resources/beta/agents/environments/index.mjs.map +1 -0
  110. package/resources/beta/agents/environments/templates.d.mts +415 -0
  111. package/resources/beta/agents/environments/templates.d.mts.map +1 -0
  112. package/resources/beta/agents/environments/templates.d.ts +415 -0
  113. package/resources/beta/agents/environments/templates.d.ts.map +1 -0
  114. package/resources/beta/agents/environments/templates.js +112 -0
  115. package/resources/beta/agents/environments/templates.js.map +1 -0
  116. package/resources/beta/agents/environments/templates.mjs +108 -0
  117. package/resources/beta/agents/environments/templates.mjs.map +1 -0
  118. package/resources/beta/agents/environments.d.mts +2 -0
  119. package/resources/beta/agents/environments.d.mts.map +1 -0
  120. package/resources/beta/agents/environments.d.ts +2 -0
  121. package/resources/beta/agents/environments.d.ts.map +1 -0
  122. package/resources/beta/agents/environments.js +6 -0
  123. package/resources/beta/agents/environments.js.map +1 -0
  124. package/resources/beta/agents/environments.mjs +3 -0
  125. package/resources/beta/agents/environments.mjs.map +1 -0
  126. package/resources/beta/agents/index.d.mts +5 -0
  127. package/resources/beta/agents/index.d.mts.map +1 -0
  128. package/resources/beta/agents/index.d.ts +5 -0
  129. package/resources/beta/agents/index.d.ts.map +1 -0
  130. package/resources/beta/agents/index.js +13 -0
  131. package/resources/beta/agents/index.js.map +1 -0
  132. package/resources/beta/agents/index.mjs +6 -0
  133. package/resources/beta/agents/index.mjs.map +1 -0
  134. package/resources/beta/agents/sessions/artifacts.d.mts +158 -0
  135. package/resources/beta/agents/sessions/artifacts.d.mts.map +1 -0
  136. package/resources/beta/agents/sessions/artifacts.d.ts +158 -0
  137. package/resources/beta/agents/sessions/artifacts.d.ts.map +1 -0
  138. package/resources/beta/agents/sessions/artifacts.js +106 -0
  139. package/resources/beta/agents/sessions/artifacts.js.map +1 -0
  140. package/resources/beta/agents/sessions/artifacts.mjs +102 -0
  141. package/resources/beta/agents/sessions/artifacts.mjs.map +1 -0
  142. package/resources/beta/agents/sessions/events.d.mts +61 -0
  143. package/resources/beta/agents/sessions/events.d.mts.map +1 -0
  144. package/resources/beta/agents/sessions/events.d.ts +61 -0
  145. package/resources/beta/agents/sessions/events.d.ts.map +1 -0
  146. package/resources/beta/agents/sessions/events.js +72 -0
  147. package/resources/beta/agents/sessions/events.js.map +1 -0
  148. package/resources/beta/agents/sessions/events.mjs +68 -0
  149. package/resources/beta/agents/sessions/events.mjs.map +1 -0
  150. package/resources/beta/agents/sessions/index.d.mts +7 -0
  151. package/resources/beta/agents/sessions/index.d.mts.map +1 -0
  152. package/resources/beta/agents/sessions/index.d.ts +7 -0
  153. package/resources/beta/agents/sessions/index.d.ts.map +1 -0
  154. package/resources/beta/agents/sessions/index.js +17 -0
  155. package/resources/beta/agents/sessions/index.js.map +1 -0
  156. package/resources/beta/agents/sessions/index.mjs +8 -0
  157. package/resources/beta/agents/sessions/index.mjs.map +1 -0
  158. package/resources/beta/agents/sessions/items.d.mts +37 -0
  159. package/resources/beta/agents/sessions/items.d.mts.map +1 -0
  160. package/resources/beta/agents/sessions/items.d.ts +37 -0
  161. package/resources/beta/agents/sessions/items.d.ts.map +1 -0
  162. package/resources/beta/agents/sessions/items.js +35 -0
  163. package/resources/beta/agents/sessions/items.js.map +1 -0
  164. package/resources/beta/agents/sessions/items.mjs +31 -0
  165. package/resources/beta/agents/sessions/items.mjs.map +1 -0
  166. package/resources/beta/agents/sessions/sessions.d.mts +220 -0
  167. package/resources/beta/agents/sessions/sessions.d.mts.map +1 -0
  168. package/resources/beta/agents/sessions/sessions.d.ts +220 -0
  169. package/resources/beta/agents/sessions/sessions.d.ts.map +1 -0
  170. package/resources/beta/agents/sessions/sessions.js +124 -0
  171. package/resources/beta/agents/sessions/sessions.js.map +1 -0
  172. package/resources/beta/agents/sessions/sessions.mjs +119 -0
  173. package/resources/beta/agents/sessions/sessions.mjs.map +1 -0
  174. package/resources/beta/agents/sessions/subagents/index.d.mts +4 -0
  175. package/resources/beta/agents/sessions/subagents/index.d.mts.map +1 -0
  176. package/resources/beta/agents/sessions/subagents/index.d.ts +4 -0
  177. package/resources/beta/agents/sessions/subagents/index.d.ts.map +1 -0
  178. package/resources/beta/agents/sessions/subagents/index.js +11 -0
  179. package/resources/beta/agents/sessions/subagents/index.js.map +1 -0
  180. package/resources/beta/agents/sessions/subagents/index.mjs +5 -0
  181. package/resources/beta/agents/sessions/subagents/index.mjs.map +1 -0
  182. package/resources/beta/agents/sessions/subagents/items.d.mts +41 -0
  183. package/resources/beta/agents/sessions/subagents/items.d.mts.map +1 -0
  184. package/resources/beta/agents/sessions/subagents/items.d.ts +41 -0
  185. package/resources/beta/agents/sessions/subagents/items.d.ts.map +1 -0
  186. package/resources/beta/agents/sessions/subagents/items.js +36 -0
  187. package/resources/beta/agents/sessions/subagents/items.js.map +1 -0
  188. package/resources/beta/agents/sessions/subagents/items.mjs +32 -0
  189. package/resources/beta/agents/sessions/subagents/items.mjs.map +1 -0
  190. package/resources/beta/agents/sessions/subagents/subagents.d.mts +65 -0
  191. package/resources/beta/agents/sessions/subagents/subagents.d.mts.map +1 -0
  192. package/resources/beta/agents/sessions/subagents/subagents.d.ts +65 -0
  193. package/resources/beta/agents/sessions/subagents/subagents.d.ts.map +1 -0
  194. package/resources/beta/agents/sessions/subagents/subagents.js +67 -0
  195. package/resources/beta/agents/sessions/subagents/subagents.js.map +1 -0
  196. package/resources/beta/agents/sessions/subagents/subagents.mjs +62 -0
  197. package/resources/beta/agents/sessions/subagents/subagents.mjs.map +1 -0
  198. package/resources/beta/agents/sessions/subagents/turns/index.d.mts +3 -0
  199. package/resources/beta/agents/sessions/subagents/turns/index.d.mts.map +1 -0
  200. package/resources/beta/agents/sessions/subagents/turns/index.d.ts +3 -0
  201. package/resources/beta/agents/sessions/subagents/turns/index.d.ts.map +1 -0
  202. package/resources/beta/agents/sessions/subagents/turns/index.js +9 -0
  203. package/resources/beta/agents/sessions/subagents/turns/index.js.map +1 -0
  204. package/resources/beta/agents/sessions/subagents/turns/index.mjs +4 -0
  205. package/resources/beta/agents/sessions/subagents/turns/index.mjs.map +1 -0
  206. package/resources/beta/agents/sessions/subagents/turns/items.d.mts +45 -0
  207. package/resources/beta/agents/sessions/subagents/turns/items.d.mts.map +1 -0
  208. package/resources/beta/agents/sessions/subagents/turns/items.d.ts +45 -0
  209. package/resources/beta/agents/sessions/subagents/turns/items.d.ts.map +1 -0
  210. package/resources/beta/agents/sessions/subagents/turns/items.js +36 -0
  211. package/resources/beta/agents/sessions/subagents/turns/items.js.map +1 -0
  212. package/resources/beta/agents/sessions/subagents/turns/items.mjs +32 -0
  213. package/resources/beta/agents/sessions/subagents/turns/items.mjs.map +1 -0
  214. package/resources/beta/agents/sessions/subagents/turns/turns.d.mts +73 -0
  215. package/resources/beta/agents/sessions/subagents/turns/turns.d.mts.map +1 -0
  216. package/resources/beta/agents/sessions/subagents/turns/turns.d.ts +73 -0
  217. package/resources/beta/agents/sessions/subagents/turns/turns.d.ts.map +1 -0
  218. package/resources/beta/agents/sessions/subagents/turns/turns.js +68 -0
  219. package/resources/beta/agents/sessions/subagents/turns/turns.js.map +1 -0
  220. package/resources/beta/agents/sessions/subagents/turns/turns.mjs +63 -0
  221. package/resources/beta/agents/sessions/subagents/turns/turns.mjs.map +1 -0
  222. package/resources/beta/agents/sessions/subagents/turns.d.mts +2 -0
  223. package/resources/beta/agents/sessions/subagents/turns.d.mts.map +1 -0
  224. package/resources/beta/agents/sessions/subagents/turns.d.ts +2 -0
  225. package/resources/beta/agents/sessions/subagents/turns.d.ts.map +1 -0
  226. package/resources/beta/agents/sessions/subagents/turns.js +6 -0
  227. package/resources/beta/agents/sessions/subagents/turns.js.map +1 -0
  228. package/resources/beta/agents/sessions/subagents/turns.mjs +3 -0
  229. package/resources/beta/agents/sessions/subagents/turns.mjs.map +1 -0
  230. package/resources/beta/agents/sessions/subagents.d.mts +2 -0
  231. package/resources/beta/agents/sessions/subagents.d.mts.map +1 -0
  232. package/resources/beta/agents/sessions/subagents.d.ts +2 -0
  233. package/resources/beta/agents/sessions/subagents.d.ts.map +1 -0
  234. package/resources/beta/agents/sessions/subagents.js +6 -0
  235. package/resources/beta/agents/sessions/subagents.js.map +1 -0
  236. package/resources/beta/agents/sessions/subagents.mjs +3 -0
  237. package/resources/beta/agents/sessions/subagents.mjs.map +1 -0
  238. package/resources/beta/agents/sessions/turns.d.mts +116 -0
  239. package/resources/beta/agents/sessions/turns.d.mts.map +1 -0
  240. package/resources/beta/agents/sessions/turns.d.ts +116 -0
  241. package/resources/beta/agents/sessions/turns.d.ts.map +1 -0
  242. package/resources/beta/agents/sessions/turns.js +57 -0
  243. package/resources/beta/agents/sessions/turns.js.map +1 -0
  244. package/resources/beta/agents/sessions/turns.mjs +53 -0
  245. package/resources/beta/agents/sessions/turns.mjs.map +1 -0
  246. package/resources/beta/agents/sessions.d.mts +2 -0
  247. package/resources/beta/agents/sessions.d.mts.map +1 -0
  248. package/resources/beta/agents/sessions.d.ts +2 -0
  249. package/resources/beta/agents/sessions.d.ts.map +1 -0
  250. package/resources/beta/agents/sessions.js +6 -0
  251. package/resources/beta/agents/sessions.js.map +1 -0
  252. package/resources/beta/agents/sessions.mjs +3 -0
  253. package/resources/beta/agents/sessions.mjs.map +1 -0
  254. package/resources/beta/agents/vaults/credentials.d.mts +526 -0
  255. package/resources/beta/agents/vaults/credentials.d.mts.map +1 -0
  256. package/resources/beta/agents/vaults/credentials.d.ts +526 -0
  257. package/resources/beta/agents/vaults/credentials.d.ts.map +1 -0
  258. package/resources/beta/agents/vaults/credentials.js +132 -0
  259. package/resources/beta/agents/vaults/credentials.js.map +1 -0
  260. package/resources/beta/agents/vaults/credentials.mjs +128 -0
  261. package/resources/beta/agents/vaults/credentials.mjs.map +1 -0
  262. package/resources/beta/agents/vaults/index.d.mts +3 -0
  263. package/resources/beta/agents/vaults/index.d.mts.map +1 -0
  264. package/resources/beta/agents/vaults/index.d.ts +3 -0
  265. package/resources/beta/agents/vaults/index.d.ts.map +1 -0
  266. package/resources/beta/agents/vaults/index.js +9 -0
  267. package/resources/beta/agents/vaults/index.js.map +1 -0
  268. package/resources/beta/agents/vaults/index.mjs +4 -0
  269. package/resources/beta/agents/vaults/index.mjs.map +1 -0
  270. package/resources/beta/agents/vaults/vaults.d.mts +145 -0
  271. package/resources/beta/agents/vaults/vaults.d.mts.map +1 -0
  272. package/resources/beta/agents/vaults/vaults.d.ts +145 -0
  273. package/resources/beta/agents/vaults/vaults.d.ts.map +1 -0
  274. package/resources/beta/agents/vaults/vaults.js +93 -0
  275. package/resources/beta/agents/vaults/vaults.js.map +1 -0
  276. package/resources/beta/agents/vaults/vaults.mjs +88 -0
  277. package/resources/beta/agents/vaults/vaults.mjs.map +1 -0
  278. package/resources/beta/agents/vaults.d.mts +2 -0
  279. package/resources/beta/agents/vaults.d.mts.map +1 -0
  280. package/resources/beta/agents/vaults.d.ts +2 -0
  281. package/resources/beta/agents/vaults.d.ts.map +1 -0
  282. package/resources/beta/agents/vaults.js +6 -0
  283. package/resources/beta/agents/vaults.js.map +1 -0
  284. package/resources/beta/agents/vaults.mjs +3 -0
  285. package/resources/beta/agents/vaults.mjs.map +1 -0
  286. package/resources/beta/agents.d.mts +2 -0
  287. package/resources/beta/agents.d.mts.map +1 -0
  288. package/resources/beta/agents.d.ts +2 -0
  289. package/resources/beta/agents.d.ts.map +1 -0
  290. package/resources/beta/agents.js +6 -0
  291. package/resources/beta/agents.js.map +1 -0
  292. package/resources/beta/agents.mjs +3 -0
  293. package/resources/beta/agents.mjs.map +1 -0
  294. package/resources/beta/beta.d.mts +4 -1
  295. package/resources/beta/beta.d.mts.map +1 -1
  296. package/resources/beta/beta.d.ts +4 -1
  297. package/resources/beta/beta.d.ts.map +1 -1
  298. package/resources/beta/beta.js +4 -0
  299. package/resources/beta/beta.js.map +1 -1
  300. package/resources/beta/beta.mjs +4 -0
  301. package/resources/beta/beta.mjs.map +1 -1
  302. package/resources/beta/index.d.mts +1 -0
  303. package/resources/beta/index.d.mts.map +1 -1
  304. package/resources/beta/index.d.ts +1 -0
  305. package/resources/beta/index.d.ts.map +1 -1
  306. package/resources/beta/index.js +11 -9
  307. package/resources/beta/index.js.map +1 -1
  308. package/resources/beta/index.mjs +1 -0
  309. package/resources/beta/index.mjs.map +1 -1
  310. package/resources/beta/responses/internal-base.d.mts.map +1 -1
  311. package/resources/beta/responses/internal-base.d.ts.map +1 -1
  312. package/resources/beta/responses/internal-base.js +6 -0
  313. package/resources/beta/responses/internal-base.js.map +1 -1
  314. package/resources/beta/responses/internal-base.mjs +6 -0
  315. package/resources/beta/responses/internal-base.mjs.map +1 -1
  316. package/resources/beta/responses/ws-base.d.mts +13 -8
  317. package/resources/beta/responses/ws-base.d.mts.map +1 -1
  318. package/resources/beta/responses/ws-base.d.ts +13 -8
  319. package/resources/beta/responses/ws-base.d.ts.map +1 -1
  320. package/resources/beta/responses/ws-base.js +85 -14
  321. package/resources/beta/responses/ws-base.js.map +1 -1
  322. package/resources/beta/responses/ws-base.mjs +87 -16
  323. package/resources/beta/responses/ws-base.mjs.map +1 -1
  324. package/resources/beta/responses/ws.d.mts +1 -0
  325. package/resources/beta/responses/ws.d.mts.map +1 -1
  326. package/resources/beta/responses/ws.d.ts +1 -0
  327. package/resources/beta/responses/ws.d.ts.map +1 -1
  328. package/resources/beta/responses/ws.js.map +1 -1
  329. package/resources/beta/responses/ws.mjs.map +1 -1
  330. package/resources/live/forks/ws-base.d.mts +13 -8
  331. package/resources/live/forks/ws-base.d.mts.map +1 -1
  332. package/resources/live/forks/ws-base.d.ts +13 -8
  333. package/resources/live/forks/ws-base.d.ts.map +1 -1
  334. package/resources/live/forks/ws-base.js +85 -14
  335. package/resources/live/forks/ws-base.js.map +1 -1
  336. package/resources/live/forks/ws-base.mjs +87 -16
  337. package/resources/live/forks/ws-base.mjs.map +1 -1
  338. package/resources/live/forks/ws.d.mts +1 -0
  339. package/resources/live/forks/ws.d.mts.map +1 -1
  340. package/resources/live/forks/ws.d.ts +1 -0
  341. package/resources/live/forks/ws.d.ts.map +1 -1
  342. package/resources/live/forks/ws.js.map +1 -1
  343. package/resources/live/forks/ws.mjs.map +1 -1
  344. package/resources/live/sessions.d.mts +10 -4
  345. package/resources/live/sessions.d.mts.map +1 -1
  346. package/resources/live/sessions.d.ts +10 -4
  347. package/resources/live/sessions.d.ts.map +1 -1
  348. package/resources/live/sessions.js +10 -4
  349. package/resources/live/sessions.js.map +1 -1
  350. package/resources/live/sessions.mjs +10 -4
  351. package/resources/live/sessions.mjs.map +1 -1
  352. package/resources/live/sideband/ws-base.d.mts +13 -8
  353. package/resources/live/sideband/ws-base.d.mts.map +1 -1
  354. package/resources/live/sideband/ws-base.d.ts +13 -8
  355. package/resources/live/sideband/ws-base.d.ts.map +1 -1
  356. package/resources/live/sideband/ws-base.js +85 -14
  357. package/resources/live/sideband/ws-base.js.map +1 -1
  358. package/resources/live/sideband/ws-base.mjs +87 -16
  359. package/resources/live/sideband/ws-base.mjs.map +1 -1
  360. package/resources/live/sideband/ws.d.mts +1 -0
  361. package/resources/live/sideband/ws.d.mts.map +1 -1
  362. package/resources/live/sideband/ws.d.ts +1 -0
  363. package/resources/live/sideband/ws.d.ts.map +1 -1
  364. package/resources/live/sideband/ws.js.map +1 -1
  365. package/resources/live/sideband/ws.mjs.map +1 -1
  366. package/resources/live/ws-base.d.mts +13 -8
  367. package/resources/live/ws-base.d.mts.map +1 -1
  368. package/resources/live/ws-base.d.ts +13 -8
  369. package/resources/live/ws-base.d.ts.map +1 -1
  370. package/resources/live/ws-base.js +85 -14
  371. package/resources/live/ws-base.js.map +1 -1
  372. package/resources/live/ws-base.mjs +87 -16
  373. package/resources/live/ws-base.mjs.map +1 -1
  374. package/resources/live/ws.d.mts +1 -0
  375. package/resources/live/ws.d.mts.map +1 -1
  376. package/resources/live/ws.d.ts +1 -0
  377. package/resources/live/ws.d.ts.map +1 -1
  378. package/resources/live/ws.js.map +1 -1
  379. package/resources/live/ws.mjs.map +1 -1
  380. package/resources/responses/internal-base.d.mts.map +1 -1
  381. package/resources/responses/internal-base.d.ts.map +1 -1
  382. package/resources/responses/internal-base.js +6 -0
  383. package/resources/responses/internal-base.js.map +1 -1
  384. package/resources/responses/internal-base.mjs +6 -0
  385. package/resources/responses/internal-base.mjs.map +1 -1
  386. package/resources/responses/ws-base.d.mts +13 -8
  387. package/resources/responses/ws-base.d.mts.map +1 -1
  388. package/resources/responses/ws-base.d.ts +13 -8
  389. package/resources/responses/ws-base.d.ts.map +1 -1
  390. package/resources/responses/ws-base.js +85 -14
  391. package/resources/responses/ws-base.js.map +1 -1
  392. package/resources/responses/ws-base.mjs +87 -16
  393. package/resources/responses/ws-base.mjs.map +1 -1
  394. package/resources/responses/ws.d.mts +1 -0
  395. package/resources/responses/ws.d.mts.map +1 -1
  396. package/resources/responses/ws.d.ts +1 -0
  397. package/resources/responses/ws.d.ts.map +1 -1
  398. package/resources/responses/ws.js.map +1 -1
  399. package/resources/responses/ws.mjs.map +1 -1
  400. package/src/bedrock.ts +18 -7
  401. package/src/client.ts +48 -19
  402. package/src/core/pagination.ts +63 -1
  403. package/src/internal/realtime-credentials.ts +1 -1
  404. package/src/internal/utils/abort.ts +111 -0
  405. package/src/internal/ws.ts +22 -0
  406. package/src/lib/agents/agent-session-stream.ts +326 -0
  407. package/src/lib/agents/output-text.ts +6 -0
  408. package/src/lib/agents/turn-state.ts +61 -0
  409. package/src/lib/live/transcript-grouping.ts +59 -27
  410. package/src/resources/beta/agents/agents.ts +4621 -0
  411. package/src/resources/beta/agents/environments/environments.ts +111 -0
  412. package/src/resources/beta/agents/environments/files.ts +164 -0
  413. package/src/resources/beta/agents/environments/index.ts +19 -0
  414. package/src/resources/beta/agents/environments/templates.ts +537 -0
  415. package/src/resources/beta/agents/environments.ts +3 -0
  416. package/src/resources/beta/agents/index.ts +127 -0
  417. package/src/resources/beta/agents/sessions/artifacts.ts +239 -0
  418. package/src/resources/beta/agents/sessions/events.ts +91 -0
  419. package/src/resources/beta/agents/sessions/index.ts +24 -0
  420. package/src/resources/beta/agents/sessions/items.ts +59 -0
  421. package/src/resources/beta/agents/sessions/sessions.ts +350 -0
  422. package/src/resources/beta/agents/sessions/subagents/index.ts +5 -0
  423. package/src/resources/beta/agents/sessions/subagents/items.ts +65 -0
  424. package/src/resources/beta/agents/sessions/subagents/subagents.ts +113 -0
  425. package/src/resources/beta/agents/sessions/subagents/turns/index.ts +4 -0
  426. package/src/resources/beta/agents/sessions/subagents/turns/items.ts +70 -0
  427. package/src/resources/beta/agents/sessions/subagents/turns/turns.ts +111 -0
  428. package/src/resources/beta/agents/sessions/subagents/turns.ts +3 -0
  429. package/src/resources/beta/agents/sessions/subagents.ts +3 -0
  430. package/src/resources/beta/agents/sessions/turns.ts +159 -0
  431. package/src/resources/beta/agents/sessions.ts +3 -0
  432. package/src/resources/beta/agents/vaults/credentials.ts +687 -0
  433. package/src/resources/beta/agents/vaults/index.ts +29 -0
  434. package/src/resources/beta/agents/vaults/vaults.ts +237 -0
  435. package/src/resources/beta/agents/vaults.ts +3 -0
  436. package/src/resources/beta/agents.ts +3 -0
  437. package/src/resources/beta/beta.ts +207 -0
  438. package/src/resources/beta/index.ts +106 -0
  439. package/src/resources/beta/responses/internal-base.ts +5 -0
  440. package/src/resources/beta/responses/ws-base.ts +110 -21
  441. package/src/resources/beta/responses/ws.ts +2 -0
  442. package/src/resources/live/forks/ws-base.ts +110 -21
  443. package/src/resources/live/forks/ws.ts +2 -0
  444. package/src/resources/live/sessions.ts +10 -4
  445. package/src/resources/live/sideband/ws-base.ts +110 -21
  446. package/src/resources/live/sideband/ws.ts +2 -0
  447. package/src/resources/live/ws-base.ts +110 -21
  448. package/src/resources/live/ws.ts +2 -0
  449. package/src/resources/responses/internal-base.ts +5 -0
  450. package/src/resources/responses/ws-base.ts +110 -21
  451. package/src/resources/responses/ws.ts +2 -0
  452. package/src/version.ts +1 -1
  453. package/version.d.mts +1 -1
  454. package/version.d.ts +1 -1
  455. package/version.js +1 -1
  456. package/version.mjs +1 -1
@@ -0,0 +1,3678 @@
1
+ import { APIResource } from "../../../core/resource.mjs";
2
+ import * as AgentsAPI from "./agents.mjs";
3
+ import * as TurnsAPI from "./sessions/turns.mjs";
4
+ import * as EnvironmentsAPI from "./environments/environments.mjs";
5
+ import { EnvironmentInfo, Environments } from "./environments/environments.mjs";
6
+ import * as SessionsAPI from "./sessions/sessions.mjs";
7
+ import { SessionCreateParams, SessionCreateParamsNonStreaming, SessionCreateParamsStreaming, SessionListParams, SessionUpdateParams, Sessions } from "./sessions/sessions.mjs";
8
+ import * as VaultsAPI from "./vaults/vaults.mjs";
9
+ import { Vault, VaultCreateParams, VaultDeleted, VaultListParams, VaultStatus, VaultStatusFilter, Vaults, VaultsPage } from "./vaults/vaults.mjs";
10
+ import { APIPromise } from "../../../core/api-promise.mjs";
11
+ import { CursorPage, type CursorPageParams, PagePromise } from "../../../core/pagination.mjs";
12
+ import { RequestOptions } from "../../../internal/request-options.mjs";
13
+ export declare class Agents extends APIResource {
14
+ environments: EnvironmentsAPI.Environments;
15
+ vaults: VaultsAPI.Vaults;
16
+ sessions: SessionsAPI.Sessions;
17
+ /**
18
+ * Creates a reusable agent without storing credentials. See
19
+ * [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const agent = await client.beta.agents.create({
24
+ * model: 'model',
25
+ * });
26
+ * ```
27
+ */
28
+ create(body: AgentCreateParams, options?: RequestOptions): APIPromise<Agent>;
29
+ /**
30
+ * Retrieves a reusable agent by ID. See
31
+ * [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const agent = await client.beta.agents.retrieve('agent_id');
36
+ * ```
37
+ */
38
+ retrieve(agentID: string, options?: RequestOptions): APIPromise<Agent>;
39
+ /**
40
+ * Updates a reusable agent. See
41
+ * [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const agent = await client.beta.agents.update('agent_id');
46
+ * ```
47
+ */
48
+ update(agentID: string, body?: AgentUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Agent>;
49
+ /**
50
+ * Lists reusable agents in the current project. See
51
+ * [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * // Automatically fetches more pages as needed.
56
+ * for await (const agent of client.beta.agents.list()) {
57
+ * // ...
58
+ * }
59
+ * ```
60
+ */
61
+ list(query?: AgentListParams | null | undefined, options?: RequestOptions): PagePromise<AgentsPage, Agent>;
62
+ /**
63
+ * Deletes a reusable agent. See
64
+ * [agent configuration](https://developers.openai.com/api/docs/guides/agents-api/configuration).
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * const agentDeleted = await client.beta.agents.delete(
69
+ * 'agent_id',
70
+ * );
71
+ * ```
72
+ */
73
+ delete(agentID: string, options?: RequestOptions): APIPromise<AgentDeleted>;
74
+ }
75
+ export type AgentsPage = CursorPage<Agent>;
76
+ export type AgentSessionsPage = CursorPage<AgentSession>;
77
+ export type SubagentsPage = CursorPage<Subagent>;
78
+ export type AgentSessionItemsPage = CursorPage<AgentSessionItem>;
79
+ /**
80
+ * A reusable agent scoped to the caller's project.
81
+ */
82
+ export interface Agent {
83
+ /**
84
+ * The ID of the reusable agent.
85
+ */
86
+ id: string;
87
+ /**
88
+ * The Unix timestamp, in seconds, when the agent was created.
89
+ */
90
+ created_at: number;
91
+ /**
92
+ * Custom instructions appended to the agent's default base instructions.
93
+ */
94
+ instructions: string | null;
95
+ /**
96
+ * Custom string key-value pairs attached to the agent.
97
+ */
98
+ metadata: {
99
+ [key: string]: string;
100
+ };
101
+ /**
102
+ * The requested model name used for inference.
103
+ */
104
+ model: string;
105
+ /**
106
+ * The resolved configuration for creating and coordinating subagents.
107
+ */
108
+ multi_agent: MultiAgentConfig;
109
+ /**
110
+ * A human-readable name for the agent, or null if it is unnamed.
111
+ */
112
+ name: string | null;
113
+ /**
114
+ * The object type. Always `agent`.
115
+ */
116
+ object: 'agent';
117
+ /**
118
+ * The resolved reasoning configuration, including the model default for an omitted
119
+ * effort.
120
+ */
121
+ reasoning: AgentReasoning;
122
+ /**
123
+ * The resolved service-tier policy used for model requests.
124
+ */
125
+ service_tier: 'auto' | 'default' | 'flex' | 'priority' | 'fast';
126
+ /**
127
+ * The resolved configuration for text generated by the agent.
128
+ */
129
+ text: AgentText;
130
+ /**
131
+ * Tools available to the agent.
132
+ */
133
+ tools: Array<PersistedAgentTool>;
134
+ /**
135
+ * The Unix timestamp, in seconds, when the agent was last updated.
136
+ */
137
+ updated_at: number;
138
+ }
139
+ /**
140
+ * A request to close a subagent.
141
+ */
142
+ export interface AgentCloseSubagentCallItem {
143
+ /**
144
+ * The ID of the tool call item.
145
+ */
146
+ id: string;
147
+ /**
148
+ * The ID of the agent to close.
149
+ */
150
+ recipient_agent_id: string;
151
+ /**
152
+ * The ID of the agent requesting the close.
153
+ */
154
+ sender_agent_id: string;
155
+ /**
156
+ * The status of the tool call.
157
+ */
158
+ status: AgentFunctionCallStatus;
159
+ /**
160
+ * The ID of the turn that contains this item.
161
+ */
162
+ turn_id: string;
163
+ /**
164
+ * The item type. Always `close_subagent_call`.
165
+ */
166
+ type: 'close_subagent_call';
167
+ }
168
+ /**
169
+ * A command execution produced by the agent.
170
+ */
171
+ export interface AgentCommandExecutionItem {
172
+ /**
173
+ * The ID of the command execution item.
174
+ */
175
+ id: string;
176
+ /**
177
+ * The command that was executed.
178
+ */
179
+ command: string;
180
+ /**
181
+ * The working directory used to execute the command.
182
+ */
183
+ cwd: string | null;
184
+ /**
185
+ * The command duration in milliseconds.
186
+ */
187
+ duration_ms: number | null;
188
+ /**
189
+ * The process exit code, if the command completed.
190
+ */
191
+ exit_code: number | null;
192
+ /**
193
+ * The command output, if available.
194
+ */
195
+ output: string | null;
196
+ /**
197
+ * The status of the command execution.
198
+ */
199
+ status: AgentFunctionCallStatus;
200
+ /**
201
+ * The ID of the turn that contains this item.
202
+ */
203
+ turn_id: string;
204
+ /**
205
+ * The item type. Always `command_execution`.
206
+ */
207
+ type: 'command_execution';
208
+ }
209
+ /**
210
+ * A plaintext or encrypted content part exchanged between agents.
211
+ */
212
+ export type AgentContent = OutputText | AgentContent.EncryptedContentResource;
213
+ export declare namespace AgentContent {
214
+ /**
215
+ * Encrypted content exchanged between agents.
216
+ */
217
+ interface EncryptedContentResource {
218
+ /**
219
+ * The encrypted content payload.
220
+ */
221
+ encrypted_content: string;
222
+ /**
223
+ * The content type. Always `encrypted_content`.
224
+ */
225
+ type: 'encrypted_content';
226
+ }
227
+ }
228
+ /**
229
+ * A request to spawn a subagent.
230
+ */
231
+ export interface AgentCreateSubagentCallItem {
232
+ /**
233
+ * The ID of the tool call item.
234
+ */
235
+ id: string;
236
+ /**
237
+ * The ID of the agent that requested the subagent.
238
+ */
239
+ agent_id: string;
240
+ /**
241
+ * The task given to the spawned agent.
242
+ */
243
+ content: Array<AgentContent>;
244
+ /**
245
+ * The model requested for the spawned agent.
246
+ */
247
+ model: string | null;
248
+ /**
249
+ * The reasoning effort requested for the spawned agent.
250
+ */
251
+ reasoning_effort: string | null;
252
+ /**
253
+ * The status of the tool call.
254
+ */
255
+ status: AgentFunctionCallStatus;
256
+ /**
257
+ * The ID of the turn that contains this item.
258
+ */
259
+ turn_id: string;
260
+ /**
261
+ * The item type. Always `create_subagent_call`.
262
+ */
263
+ type: 'create_subagent_call';
264
+ }
265
+ /**
266
+ * A deleted reusable agent.
267
+ */
268
+ export interface AgentDeleted {
269
+ /**
270
+ * The ID of the deleted agent.
271
+ */
272
+ id: string;
273
+ /**
274
+ * Whether the agent was deleted. Always `true`.
275
+ */
276
+ deleted: boolean;
277
+ /**
278
+ * The object type. Always `agent.deleted`.
279
+ */
280
+ object: 'agent.deleted';
281
+ }
282
+ /**
283
+ * A function call produced by the agent.
284
+ */
285
+ export interface AgentFunctionCallItem {
286
+ /**
287
+ * The ID of the function call item.
288
+ */
289
+ id: string;
290
+ /**
291
+ * The arguments to pass to the function.
292
+ */
293
+ arguments: unknown;
294
+ /**
295
+ * The ID used to submit the function result.
296
+ */
297
+ call_id: string;
298
+ /**
299
+ * The name of the function to call.
300
+ */
301
+ name: string;
302
+ /**
303
+ * The status of the function call.
304
+ */
305
+ status: AgentFunctionCallStatus;
306
+ /**
307
+ * The ID of the turn that contains this item.
308
+ */
309
+ turn_id: string;
310
+ /**
311
+ * The item type. Always `function_call`.
312
+ */
313
+ type: 'function_call';
314
+ }
315
+ /**
316
+ * The text or model-input content supplied as a function result.
317
+ */
318
+ export type AgentFunctionCallOutput = string | Array<InputContent>;
319
+ /**
320
+ * A function result represented as text or supported model-input content.
321
+ */
322
+ export type AgentFunctionCallOutputParam = string | Array<InputContentParam>;
323
+ /**
324
+ * The status of a tool call.
325
+ *
326
+ * - `in_progress` - The call is in progress.
327
+ * - `completed` - The call completed successfully.
328
+ * - `failed` - The call failed.
329
+ * - `incomplete` - The call stopped before completing.
330
+ */
331
+ export type AgentFunctionCallStatus = 'in_progress' | 'completed' | 'failed' | 'incomplete';
332
+ /**
333
+ * A request to interrupt a subagent's current turn. The subagent remains
334
+ * available.
335
+ */
336
+ export interface AgentInterruptSubagentCallItem {
337
+ /**
338
+ * The ID of the tool call item.
339
+ */
340
+ id: string;
341
+ /**
342
+ * The ID of the agent to interrupt.
343
+ */
344
+ recipient_agent_id: string;
345
+ /**
346
+ * The ID of the agent requesting the interrupt.
347
+ */
348
+ sender_agent_id: string;
349
+ /**
350
+ * The status of the tool call.
351
+ */
352
+ status: AgentFunctionCallStatus;
353
+ /**
354
+ * The ID of the turn that contains this item.
355
+ */
356
+ turn_id: string;
357
+ /**
358
+ * The item type. Always `interrupt_subagent_call`.
359
+ */
360
+ type: 'interrupt_subagent_call';
361
+ }
362
+ /**
363
+ * A call to a tool on an MCP server.
364
+ */
365
+ export interface AgentMcpCallItem {
366
+ /**
367
+ * The ID of the MCP call item.
368
+ */
369
+ id: string;
370
+ /**
371
+ * The arguments passed to the MCP tool.
372
+ */
373
+ arguments: unknown;
374
+ /**
375
+ * The error returned by the MCP tool, if any.
376
+ */
377
+ error: unknown;
378
+ /**
379
+ * The name of the MCP tool.
380
+ */
381
+ name: string;
382
+ /**
383
+ * The output returned by the MCP tool, if any.
384
+ */
385
+ output: unknown;
386
+ /**
387
+ * The label of the MCP server.
388
+ */
389
+ server_label: string;
390
+ /**
391
+ * The status of the MCP tool call.
392
+ */
393
+ status: AgentFunctionCallStatus;
394
+ /**
395
+ * The ID of the turn that contains this item.
396
+ */
397
+ turn_id: string;
398
+ /**
399
+ * The item type. Always `mcp_call`.
400
+ */
401
+ type: 'mcp_call';
402
+ }
403
+ /**
404
+ * Emitted when command execution produces an output delta.
405
+ */
406
+ export interface AgentOutputCommandExecutionOutputDeltaEvent {
407
+ /**
408
+ * The output text that was appended.
409
+ */
410
+ delta: string;
411
+ /**
412
+ * The unique ID of the event.
413
+ */
414
+ event_id: string;
415
+ /**
416
+ * The ID of the command execution item.
417
+ */
418
+ item_id: string;
419
+ /**
420
+ * The index of the item in the turn output.
421
+ */
422
+ output_index: number;
423
+ /**
424
+ * The ID of the session associated with the event.
425
+ */
426
+ session_id: string;
427
+ /**
428
+ * The ID of the turn associated with the event, when applicable.
429
+ */
430
+ turn_id: string | null;
431
+ /**
432
+ * The type of the object. Always `agent.output.command_execution_output.delta`.
433
+ */
434
+ type: 'agent.output.command_execution_output.delta';
435
+ }
436
+ /**
437
+ * An output item produced by an agent.
438
+ */
439
+ export type AgentOutputItem = AgentSessionAssistantMessage | AgentReasoningItem | AgentFunctionCallItem | AgentMcpCallItem | AgentWebSearchCallItem | AgentCommandExecutionItem | AgentCreateSubagentCallItem | AgentSendSubagentInputCallItem | AgentResumeSubagentCallItem | AgentWaitForSubagentsCallItem | AgentInterruptSubagentCallItem | AgentCloseSubagentCallItem;
440
+ /**
441
+ * The status of an agent output item.
442
+ *
443
+ * - `in_progress` - The item is in progress.
444
+ * - `completed` - The item is complete.
445
+ * - `incomplete` - The item stopped before completing.
446
+ */
447
+ export type AgentOutputItemStatus = 'in_progress' | 'completed' | 'incomplete';
448
+ /**
449
+ * The reasoning configuration used by an agent.
450
+ */
451
+ export interface AgentReasoning {
452
+ /**
453
+ * The amount of reasoning effort used by an agent.
454
+ */
455
+ effort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
456
+ /**
457
+ * The reasoning summary format requested from an agent.
458
+ *
459
+ * - `concise` - Returns a concise reasoning summary when supported.
460
+ * - `detailed` - Returns a detailed reasoning summary when supported.
461
+ * - `auto` - Automatically selects the most detailed summary supported by the
462
+ * model.
463
+ */
464
+ summary: 'concise' | 'detailed' | 'auto' | null;
465
+ }
466
+ /**
467
+ * A reasoning item produced by the agent.
468
+ */
469
+ export interface AgentReasoningItem {
470
+ /**
471
+ * The ID of the reasoning item.
472
+ */
473
+ id: string;
474
+ /**
475
+ * The status of an agent output item.
476
+ */
477
+ status: AgentOutputItemStatus | null;
478
+ /**
479
+ * The reasoning summaries produced by the agent.
480
+ */
481
+ summary: Array<SummaryText>;
482
+ /**
483
+ * The ID of the turn that contains this item.
484
+ */
485
+ turn_id: string;
486
+ /**
487
+ * The item type. Always `reasoning`.
488
+ */
489
+ type: 'reasoning';
490
+ }
491
+ /**
492
+ * Reasoning configuration for the agent.
493
+ */
494
+ export interface AgentReasoningParam {
495
+ /**
496
+ * The amount of reasoning effort the model should use.
497
+ */
498
+ effort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null;
499
+ /**
500
+ * The reasoning summary format requested from the model.
501
+ *
502
+ * - `concise` - Returns a concise reasoning summary when supported.
503
+ * - `detailed` - Returns a detailed reasoning summary when supported.
504
+ * - `auto` - Automatically selects the most detailed summary supported by the
505
+ * model.
506
+ */
507
+ summary?: 'concise' | 'detailed' | 'auto' | null;
508
+ }
509
+ /**
510
+ * A request to resume a subagent.
511
+ */
512
+ export interface AgentResumeSubagentCallItem {
513
+ /**
514
+ * The ID of the tool call item.
515
+ */
516
+ id: string;
517
+ /**
518
+ * The ID of the agent to resume.
519
+ */
520
+ recipient_agent_id: string;
521
+ /**
522
+ * The ID of the agent requesting the resume.
523
+ */
524
+ sender_agent_id: string;
525
+ /**
526
+ * The status of the tool call.
527
+ */
528
+ status: AgentFunctionCallStatus;
529
+ /**
530
+ * The ID of the turn that contains this item.
531
+ */
532
+ turn_id: string;
533
+ /**
534
+ * The item type. Always `resume_subagent_call`.
535
+ */
536
+ type: 'resume_subagent_call';
537
+ }
538
+ /**
539
+ * A request to send input to another agent.
540
+ */
541
+ export interface AgentSendSubagentInputCallItem {
542
+ /**
543
+ * The ID of the tool call item.
544
+ */
545
+ id: string;
546
+ /**
547
+ * The input sent to the receiving agent.
548
+ */
549
+ content: Array<AgentContent>;
550
+ /**
551
+ * The ID of the agent receiving the input.
552
+ */
553
+ recipient_agent_id: string;
554
+ /**
555
+ * The ID of the agent sending the input.
556
+ */
557
+ sender_agent_id: string;
558
+ /**
559
+ * The status of the tool call.
560
+ */
561
+ status: AgentFunctionCallStatus;
562
+ /**
563
+ * The ID of the turn that contains this item.
564
+ */
565
+ turn_id: string;
566
+ /**
567
+ * The item type. Always `send_subagent_input_call`.
568
+ */
569
+ type: 'send_subagent_input_call';
570
+ }
571
+ /**
572
+ * A Managed Agents session.
573
+ */
574
+ export interface AgentSession {
575
+ /**
576
+ * The ID of the session.
577
+ */
578
+ id: string;
579
+ /**
580
+ * The agent running in the session.
581
+ */
582
+ agent: AgentSession.Agent;
583
+ /**
584
+ * The Unix timestamp, in seconds, when the session was created.
585
+ */
586
+ created_at: number;
587
+ /**
588
+ * The execution environment for the session.
589
+ */
590
+ environment: Environment;
591
+ /**
592
+ * The error that caused the session to fail, if any.
593
+ */
594
+ error: string | null;
595
+ /**
596
+ * The Unix timestamp, in seconds, when the session was last active.
597
+ */
598
+ last_active_at: number;
599
+ /**
600
+ * Custom string key-value pairs attached to the session.
601
+ */
602
+ metadata: {
603
+ [key: string]: string;
604
+ };
605
+ /**
606
+ * The object type. Always `agent.session`.
607
+ */
608
+ object: 'agent.session';
609
+ /**
610
+ * Actions that must be completed before the session can continue.
611
+ */
612
+ required_actions: Array<AgentSession.SessionRequiredActionResourceFunctionCall | AgentSession.SessionRequiredActionResourceEnvironmentConnection>;
613
+ /**
614
+ * The current status of the session.
615
+ *
616
+ * - `idle` - The session has no turn in progress and is ready for input. A hosted
617
+ * environment may still be provisioning.
618
+ * - `in_progress` - The session is processing a turn.
619
+ * - `requires_action` - The session is waiting for one or more required actions.
620
+ * - `failed` - The session failed.
621
+ */
622
+ status: 'idle' | 'in_progress' | 'requires_action' | 'failed';
623
+ /**
624
+ * Recorded token usage for a session or turn. Usage is best effort and may change.
625
+ */
626
+ usage: TokenUsage | null;
627
+ /**
628
+ * The IDs of vaults made available to the session.
629
+ */
630
+ vault_ids: Array<string>;
631
+ }
632
+ export declare namespace AgentSession {
633
+ /**
634
+ * The agent running in the session.
635
+ */
636
+ interface Agent {
637
+ /**
638
+ * The ID of the agent.
639
+ */
640
+ id: string;
641
+ /**
642
+ * Custom instructions appended to the agent's default base instructions.
643
+ */
644
+ instructions: string | null;
645
+ /**
646
+ * The model used by the agent.
647
+ */
648
+ model: string;
649
+ /**
650
+ * Configuration for creating and coordinating subagents.
651
+ */
652
+ multi_agent: AgentsAPI.MultiAgentConfig;
653
+ /**
654
+ * The reusable agent's name when the session was created, or null if no name was
655
+ * saved. Later changes to the agent's name do not affect this value.
656
+ */
657
+ name: string | null;
658
+ /**
659
+ * The agent's reasoning configuration.
660
+ */
661
+ reasoning: AgentsAPI.AgentReasoning;
662
+ /**
663
+ * The effective service-tier policy for model requests. Defaults to `auto`.
664
+ */
665
+ service_tier: 'auto' | 'default' | 'flex' | 'priority' | 'fast';
666
+ /**
667
+ * Configuration for text generated by the agent.
668
+ */
669
+ text: AgentsAPI.AgentText;
670
+ /**
671
+ * Tools available to the agent.
672
+ */
673
+ tools: Array<AgentsAPI.AgentTool>;
674
+ }
675
+ /**
676
+ * Run a function tool and submit its result.
677
+ */
678
+ interface SessionRequiredActionResourceFunctionCall {
679
+ /**
680
+ * The arguments supplied by the model.
681
+ */
682
+ arguments: unknown;
683
+ /**
684
+ * The ID to include when submitting the function result.
685
+ */
686
+ call_id: string;
687
+ /**
688
+ * The function name.
689
+ */
690
+ name: string;
691
+ /**
692
+ * The ID of the turn that requested the function call.
693
+ */
694
+ turn_id: string;
695
+ /**
696
+ * The type of the object. Always `function_call`.
697
+ */
698
+ type: 'function_call';
699
+ }
700
+ /**
701
+ * Reconnect a session environment.
702
+ */
703
+ interface SessionRequiredActionResourceEnvironmentConnection {
704
+ /**
705
+ * The ID of the environment to reconnect.
706
+ */
707
+ environment_id: string;
708
+ /**
709
+ * The type of the object. Always `environment_connection`.
710
+ */
711
+ type: 'environment_connection';
712
+ }
713
+ }
714
+ /**
715
+ * An assistant message produced by the agent.
716
+ */
717
+ export interface AgentSessionAssistantMessage {
718
+ /**
719
+ * The ID of the message.
720
+ */
721
+ id: string;
722
+ /**
723
+ * The content of the message.
724
+ */
725
+ content: Array<OutputText>;
726
+ /**
727
+ * The phase of an assistant message.
728
+ *
729
+ * - `commentary` - Commentary produced while the agent works.
730
+ * - `final_answer` - The agent's final answer.
731
+ */
732
+ phase: 'commentary' | 'final_answer' | null;
733
+ /**
734
+ * The role of the message author. Always `assistant`.
735
+ */
736
+ role: 'assistant';
737
+ /**
738
+ * The status of the message.
739
+ */
740
+ status: AgentOutputItemStatus;
741
+ /**
742
+ * The ID of the turn that contains this item.
743
+ */
744
+ turn_id: string;
745
+ /**
746
+ * The item type. Always `message`.
747
+ */
748
+ type: 'message';
749
+ }
750
+ /**
751
+ * Emitted when a session is created.
752
+ */
753
+ export interface AgentSessionCreatedEvent {
754
+ /**
755
+ * The unique ID of the event.
756
+ */
757
+ event_id: string;
758
+ /**
759
+ * The session that was created.
760
+ */
761
+ session: AgentSession;
762
+ /**
763
+ * The type of the object. Always `agent.session.created`.
764
+ */
765
+ type: 'agent.session.created';
766
+ }
767
+ /**
768
+ * A Managed Agents session removed from the public API. Physical cleanup may
769
+ * continue asynchronously.
770
+ */
771
+ export interface AgentSessionDeleted {
772
+ /**
773
+ * The ID of the deleted session.
774
+ */
775
+ id: string;
776
+ /**
777
+ * Whether the session has been removed from the public API. Always `true`.
778
+ * Physical cleanup may still be in progress.
779
+ */
780
+ deleted: boolean;
781
+ /**
782
+ * The object type. Always `agent.session.deleted`.
783
+ */
784
+ object: 'agent.session.deleted';
785
+ }
786
+ /**
787
+ * Emitted when a session environment connects.
788
+ */
789
+ export interface AgentSessionEnvironmentConnectedEvent {
790
+ /**
791
+ * The current environment state.
792
+ */
793
+ environment: AgentSessionEnvironmentState;
794
+ /**
795
+ * The unique ID of the event.
796
+ */
797
+ event_id: string;
798
+ /**
799
+ * The ID of the session associated with the event.
800
+ */
801
+ session_id: string;
802
+ /**
803
+ * The ID of the turn associated with the event, when applicable.
804
+ */
805
+ turn_id: string | null;
806
+ /**
807
+ * The type of the object. Always `agent.session.environment.connected`.
808
+ */
809
+ type: 'agent.session.environment.connected';
810
+ }
811
+ /**
812
+ * Emitted when a session environment disconnects.
813
+ */
814
+ export interface AgentSessionEnvironmentDisconnectedEvent {
815
+ /**
816
+ * The current environment state.
817
+ */
818
+ environment: AgentSessionEnvironmentState;
819
+ /**
820
+ * The unique ID of the event.
821
+ */
822
+ event_id: string;
823
+ /**
824
+ * The ID of the session associated with the event.
825
+ */
826
+ session_id: string;
827
+ /**
828
+ * The ID of the turn associated with the event, when applicable.
829
+ */
830
+ turn_id: string | null;
831
+ /**
832
+ * The type of the object. Always `agent.session.environment.disconnected`.
833
+ */
834
+ type: 'agent.session.environment.disconnected';
835
+ }
836
+ /**
837
+ * Emitted when a session environment fails.
838
+ */
839
+ export interface AgentSessionEnvironmentFailedEvent {
840
+ /**
841
+ * The current environment state.
842
+ */
843
+ environment: AgentSessionEnvironmentState;
844
+ /**
845
+ * The unique ID of the event.
846
+ */
847
+ event_id: string;
848
+ /**
849
+ * The ID of the session associated with the event.
850
+ */
851
+ session_id: string;
852
+ /**
853
+ * The ID of the turn associated with the event, when applicable.
854
+ */
855
+ turn_id: string | null;
856
+ /**
857
+ * The type of the object. Always `agent.session.environment.failed`.
858
+ */
859
+ type: 'agent.session.environment.failed';
860
+ }
861
+ /**
862
+ * Emitted while a session environment is being prepared.
863
+ */
864
+ export interface AgentSessionEnvironmentPendingEvent {
865
+ /**
866
+ * The current environment state.
867
+ */
868
+ environment: AgentSessionEnvironmentState;
869
+ /**
870
+ * The unique ID of the event.
871
+ */
872
+ event_id: string;
873
+ /**
874
+ * The ID of the session associated with the event.
875
+ */
876
+ session_id: string;
877
+ /**
878
+ * The ID of the turn associated with the event, when applicable.
879
+ */
880
+ turn_id: string | null;
881
+ /**
882
+ * The type of the object. Always `agent.session.environment.pending`.
883
+ */
884
+ type: 'agent.session.environment.pending';
885
+ }
886
+ /**
887
+ * Emitted when a hosted session environment is ready to connect.
888
+ */
889
+ export interface AgentSessionEnvironmentReadyEvent {
890
+ /**
891
+ * The current environment state.
892
+ */
893
+ environment: AgentSessionEnvironmentState;
894
+ /**
895
+ * The unique ID of the event.
896
+ */
897
+ event_id: string;
898
+ /**
899
+ * The ID of the session associated with the event.
900
+ */
901
+ session_id: string;
902
+ /**
903
+ * The ID of the turn associated with the event, when applicable.
904
+ */
905
+ turn_id: string | null;
906
+ /**
907
+ * The type of the object. Always `agent.session.environment.ready`.
908
+ */
909
+ type: 'agent.session.environment.ready';
910
+ }
911
+ /**
912
+ * The current state of a session environment.
913
+ */
914
+ export interface AgentSessionEnvironmentState {
915
+ /**
916
+ * The public ID of the environment.
917
+ */
918
+ id: string;
919
+ /**
920
+ * An error reported while preparing a session environment.
921
+ */
922
+ error: AgentSessionEnvironmentState.Error | null;
923
+ /**
924
+ * The environment's connection status.
925
+ *
926
+ * - `pending` - The environment is being prepared.
927
+ * - `ready` - The environment is ready to connect.
928
+ * - `connected` - The environment is connected.
929
+ * - `disconnected` - The environment is disconnected.
930
+ * - `failed` - The environment failed to connect.
931
+ */
932
+ status: 'pending' | 'ready' | 'connected' | 'disconnected' | 'failed';
933
+ /**
934
+ * The environment type.
935
+ */
936
+ type: string;
937
+ }
938
+ export declare namespace AgentSessionEnvironmentState {
939
+ /**
940
+ * An error reported while preparing a session environment.
941
+ */
942
+ interface Error {
943
+ /**
944
+ * A machine-readable error code.
945
+ */
946
+ code: string;
947
+ /**
948
+ * A human-readable error message.
949
+ */
950
+ message: string;
951
+ /**
952
+ * The error type.
953
+ */
954
+ type: string;
955
+ }
956
+ }
957
+ /**
958
+ * Emitted when a turn or session fails.
959
+ */
960
+ export interface AgentSessionErrorEvent {
961
+ /**
962
+ * The error that occurred.
963
+ */
964
+ error: SessionError;
965
+ /**
966
+ * The unique ID of the event.
967
+ */
968
+ event_id: string;
969
+ /**
970
+ * The ID of the session associated with the event.
971
+ */
972
+ session_id: string;
973
+ /**
974
+ * The type of the object. Always `error`.
975
+ */
976
+ type: 'error';
977
+ }
978
+ /**
979
+ * An event emitted by a Managed Agents session.
980
+ */
981
+ export type AgentSessionEvent = AgentSessionErrorEvent | AgentSessionEnvironmentReadyEvent | AgentOutputCommandExecutionOutputDeltaEvent | AgentSessionCreatedEvent | AgentSessionTurnCreatedEvent | AgentSessionTurnInProgressEvent | AgentSessionTurnCompletedEvent | AgentSessionTurnFailedEvent | AgentSessionTurnCancelledEvent | AgentSessionTurnItemAddedEvent | AgentSessionIdleEvent | AgentSessionInProgressEvent | AgentSessionRequiresActionEvent | AgentSessionFailedEvent | AgentSessionEnvironmentPendingEvent | AgentSessionEnvironmentConnectedEvent | AgentSessionEnvironmentDisconnectedEvent | AgentSessionEnvironmentFailedEvent | AgentSessionSubagentCreatedEvent | AgentSessionSubagentActiveEvent | AgentSessionSubagentClosedEvent | AgentSessionTurnItemDoneEvent | AgentSessionTurnContentPartAddedEvent | AgentSessionTurnContentPartDoneEvent | AgentSessionTurnOutputTextDeltaEvent | AgentSessionTurnOutputTextDoneEvent | AgentSessionTurnReasoningSummaryPartAddedEvent | AgentSessionTurnReasoningSummaryPartDoneEvent | AgentSessionTurnReasoningSummaryTextDeltaEvent | AgentSessionTurnReasoningSummaryTextDoneEvent;
982
+ /**
983
+ * Emitted when a session fails.
984
+ */
985
+ export interface AgentSessionFailedEvent {
986
+ /**
987
+ * The unique ID of the event.
988
+ */
989
+ event_id: string;
990
+ /**
991
+ * The failed session.
992
+ */
993
+ session: AgentSession;
994
+ /**
995
+ * The type of the object. Always `agent.session.failed`.
996
+ */
997
+ type: 'agent.session.failed';
998
+ }
999
+ /**
1000
+ * Emitted when a session becomes idle.
1001
+ */
1002
+ export interface AgentSessionIdleEvent {
1003
+ /**
1004
+ * The unique ID of the event.
1005
+ */
1006
+ event_id: string;
1007
+ /**
1008
+ * The session that became idle.
1009
+ */
1010
+ session: AgentSession;
1011
+ /**
1012
+ * The type of the object. Always `agent.session.idle`.
1013
+ */
1014
+ type: 'agent.session.idle';
1015
+ }
1016
+ /**
1017
+ * Emitted when a session starts processing a turn.
1018
+ */
1019
+ export interface AgentSessionInProgressEvent {
1020
+ /**
1021
+ * The unique ID of the event.
1022
+ */
1023
+ event_id: string;
1024
+ /**
1025
+ * The session that started processing.
1026
+ */
1027
+ session: AgentSession;
1028
+ /**
1029
+ * The type of the object. Always `agent.session.in_progress`.
1030
+ */
1031
+ type: 'agent.session.in_progress';
1032
+ }
1033
+ /**
1034
+ * A user message submitted to a session.
1035
+ */
1036
+ export interface AgentSessionInputMessageParam {
1037
+ /**
1038
+ * The content of the message.
1039
+ */
1040
+ content: Array<InputContentParam>;
1041
+ /**
1042
+ * The role of the message author. Always `user`.
1043
+ */
1044
+ role: 'user';
1045
+ /**
1046
+ * The type of the input item. Always `message`.
1047
+ */
1048
+ type?: 'message';
1049
+ }
1050
+ /**
1051
+ * Input submitted to an existing session.
1052
+ */
1053
+ export type AgentSessionInputParam = AgentSessionInputParam.SessionInputParamAgentSessionInputMessage | AgentSessionInputParam.SessionInputParamAgentSessionInputCancel | AgentSessionInputParam.SessionInputParamAgentSessionInputToolResult;
1054
+ export declare namespace AgentSessionInputParam {
1055
+ /**
1056
+ * Adds one or more user messages and starts a turn.
1057
+ */
1058
+ interface SessionInputParamAgentSessionInputMessage {
1059
+ /**
1060
+ * The user messages to add to the session.
1061
+ */
1062
+ input: Array<AgentsAPI.AgentSessionInputMessageParam>;
1063
+ /**
1064
+ * The type of the object. Always `agent.session.input.message`.
1065
+ */
1066
+ type: 'agent.session.input.message';
1067
+ }
1068
+ /**
1069
+ * Cancels the session's active turn.
1070
+ */
1071
+ interface SessionInputParamAgentSessionInputCancel {
1072
+ /**
1073
+ * The type of the object. Always `agent.session.input.cancel`.
1074
+ */
1075
+ type: 'agent.session.input.cancel';
1076
+ }
1077
+ /**
1078
+ * Submits the result of a function call.
1079
+ */
1080
+ interface SessionInputParamAgentSessionInputToolResult {
1081
+ /**
1082
+ * The ID of the function call.
1083
+ */
1084
+ call_id: string;
1085
+ /**
1086
+ * Whether the function call succeeded.
1087
+ */
1088
+ success: boolean;
1089
+ /**
1090
+ * The ID of the turn that requested the function call.
1091
+ */
1092
+ turn_id: string;
1093
+ /**
1094
+ * The type of the object. Always `agent.session.input.tool_result`.
1095
+ */
1096
+ type: 'agent.session.input.tool_result';
1097
+ /**
1098
+ * The error message when the call failed.
1099
+ */
1100
+ error?: string | null;
1101
+ /**
1102
+ * A function result represented as text or supported model-input content.
1103
+ */
1104
+ output?: AgentsAPI.AgentFunctionCallOutputParam | null;
1105
+ }
1106
+ }
1107
+ /**
1108
+ * An item associated with a session turn.
1109
+ */
1110
+ export type AgentSessionItem = AgentSessionMessage | AgentReasoningItem | AgentFunctionCallItem | AgentSessionItem.FunctionCallOutputItemResource | AgentSessionItem.AgentMessageItemResource | AgentMcpCallItem | AgentWebSearchCallItem | AgentCommandExecutionItem | AgentCreateSubagentCallItem | AgentSendSubagentInputCallItem | AgentResumeSubagentCallItem | AgentWaitForSubagentsCallItem | AgentInterruptSubagentCallItem | AgentCloseSubagentCallItem;
1111
+ export declare namespace AgentSessionItem {
1112
+ /**
1113
+ * The result supplied for a function call.
1114
+ */
1115
+ interface FunctionCallOutputItemResource {
1116
+ /**
1117
+ * The ID of the function call output item.
1118
+ */
1119
+ id: string;
1120
+ /**
1121
+ * The ID of the function call that produced this output.
1122
+ */
1123
+ call_id: string;
1124
+ /**
1125
+ * The error message, if the call failed.
1126
+ */
1127
+ error: string | null;
1128
+ /**
1129
+ * The text or model-input content supplied as a function result.
1130
+ */
1131
+ output: AgentsAPI.AgentFunctionCallOutput | null;
1132
+ /**
1133
+ * The status of the function call.
1134
+ */
1135
+ status: AgentsAPI.AgentFunctionCallStatus;
1136
+ /**
1137
+ * The ID of the turn that contains this item.
1138
+ */
1139
+ turn_id: string;
1140
+ /**
1141
+ * The item type. Always `function_call_output`.
1142
+ */
1143
+ type: 'function_call_output';
1144
+ }
1145
+ /**
1146
+ * A message exchanged between agent threads.
1147
+ */
1148
+ interface AgentMessageItemResource {
1149
+ /**
1150
+ * The ID of the message.
1151
+ */
1152
+ id: string;
1153
+ /**
1154
+ * The content exchanged between the agents.
1155
+ */
1156
+ content: Array<AgentsAPI.AgentContent>;
1157
+ /**
1158
+ * The ID or name of the receiving agent.
1159
+ */
1160
+ recipient_agent_id: string;
1161
+ /**
1162
+ * The ID or name of the sending agent.
1163
+ */
1164
+ sender_agent_id: string;
1165
+ /**
1166
+ * The ID of the turn that contains this item.
1167
+ */
1168
+ turn_id: string;
1169
+ /**
1170
+ * The item type. Always `agent_message`.
1171
+ */
1172
+ type: 'agent_message';
1173
+ }
1174
+ }
1175
+ /**
1176
+ * A user or assistant message recorded in a session.
1177
+ */
1178
+ export interface AgentSessionMessage {
1179
+ /**
1180
+ * The ID of this item, or null for legacy user messages whose ID was not recorded.
1181
+ */
1182
+ id: string | null;
1183
+ /**
1184
+ * The content of the message. User messages contain input text or images;
1185
+ * assistant messages contain output text.
1186
+ */
1187
+ content: Array<AgentSessionMessageContent>;
1188
+ /**
1189
+ * The phase of an assistant message.
1190
+ *
1191
+ * - `commentary` - Commentary produced while the agent works.
1192
+ * - `final_answer` - The agent's final answer.
1193
+ */
1194
+ phase: 'commentary' | 'final_answer' | null;
1195
+ /**
1196
+ * The role of the message author.
1197
+ */
1198
+ role: 'user' | 'assistant';
1199
+ /**
1200
+ * The status of the message. User messages are always `completed`.
1201
+ */
1202
+ status: AgentOutputItemStatus;
1203
+ /**
1204
+ * The ID of the turn that contains this item.
1205
+ */
1206
+ turn_id: string;
1207
+ /**
1208
+ * The item type. Always `message`.
1209
+ */
1210
+ type: 'message';
1211
+ }
1212
+ /**
1213
+ * A content part in a session message.
1214
+ */
1215
+ export type AgentSessionMessageContent = AgentSessionMessageContent.MessageContentResourceInputText | AgentSessionMessageContent.MessageContentResourceInputImage | AgentSessionMessageContent.MessageContentResourceOutputText;
1216
+ export declare namespace AgentSessionMessageContent {
1217
+ /**
1218
+ * Text supplied by the user.
1219
+ */
1220
+ interface MessageContentResourceInputText {
1221
+ /**
1222
+ * The text supplied by the user.
1223
+ */
1224
+ text: string;
1225
+ /**
1226
+ * The type of the object. Always `input_text`.
1227
+ */
1228
+ type: 'input_text';
1229
+ }
1230
+ /**
1231
+ * An image supplied by the user.
1232
+ */
1233
+ interface MessageContentResourceInputImage {
1234
+ /**
1235
+ * The URL of the image supplied by the user, which may be a base64-encoded data
1236
+ * URL.
1237
+ */
1238
+ image_url: string;
1239
+ /**
1240
+ * The type of the object. Always `input_image`.
1241
+ */
1242
+ type: 'input_image';
1243
+ }
1244
+ /**
1245
+ * Text produced by the assistant.
1246
+ */
1247
+ interface MessageContentResourceOutputText {
1248
+ /**
1249
+ * The text produced by the assistant.
1250
+ */
1251
+ text: string;
1252
+ /**
1253
+ * The type of the object. Always `output_text`.
1254
+ */
1255
+ type: 'output_text';
1256
+ }
1257
+ }
1258
+ /**
1259
+ * Emitted when a session is waiting for one or more required actions.
1260
+ */
1261
+ export interface AgentSessionRequiresActionEvent {
1262
+ /**
1263
+ * The unique ID of the event.
1264
+ */
1265
+ event_id: string;
1266
+ /**
1267
+ * The session and its current required actions.
1268
+ */
1269
+ session: AgentSession;
1270
+ /**
1271
+ * The type of the object. Always `agent.session.requires_action`.
1272
+ */
1273
+ type: 'agent.session.requires_action';
1274
+ }
1275
+ /**
1276
+ * Emitted when a closed subagent successfully resumes.
1277
+ */
1278
+ export interface AgentSessionSubagentActiveEvent {
1279
+ /**
1280
+ * The unique ID of the event.
1281
+ */
1282
+ event_id: string;
1283
+ /**
1284
+ * The subagent that resumed.
1285
+ */
1286
+ subagent: Subagent;
1287
+ /**
1288
+ * The type of the object. Always `agent.session.subagent.active`.
1289
+ */
1290
+ type: 'agent.session.subagent.active';
1291
+ }
1292
+ /**
1293
+ * Emitted when a subagent is closed.
1294
+ */
1295
+ export interface AgentSessionSubagentClosedEvent {
1296
+ /**
1297
+ * The unique ID of the event.
1298
+ */
1299
+ event_id: string;
1300
+ /**
1301
+ * The subagent that was closed.
1302
+ */
1303
+ subagent: Subagent;
1304
+ /**
1305
+ * The type of the object. Always `agent.session.subagent.closed`.
1306
+ */
1307
+ type: 'agent.session.subagent.closed';
1308
+ }
1309
+ /**
1310
+ * Emitted when a subagent is created.
1311
+ */
1312
+ export interface AgentSessionSubagentCreatedEvent {
1313
+ /**
1314
+ * The unique ID of the event.
1315
+ */
1316
+ event_id: string;
1317
+ /**
1318
+ * The subagent that was created.
1319
+ */
1320
+ subagent: Subagent;
1321
+ /**
1322
+ * The type of the object. Always `agent.session.subagent.created`.
1323
+ */
1324
+ type: 'agent.session.subagent.created';
1325
+ }
1326
+ /**
1327
+ * Emitted when a turn is cancelled.
1328
+ */
1329
+ export interface AgentSessionTurnCancelledEvent {
1330
+ /**
1331
+ * The unique ID of the event.
1332
+ */
1333
+ event_id: string;
1334
+ /**
1335
+ * The ID of the session associated with the event.
1336
+ */
1337
+ session_id: string;
1338
+ /**
1339
+ * The cancelled turn.
1340
+ */
1341
+ turn: TurnsAPI.Turn;
1342
+ /**
1343
+ * The ID of the turn associated with the event.
1344
+ */
1345
+ turn_id: string;
1346
+ /**
1347
+ * The type of the object. Always `agent.session.turn.cancelled`.
1348
+ */
1349
+ type: 'agent.session.turn.cancelled';
1350
+ /**
1351
+ * Recorded token usage for a session or turn. Usage is best effort and may change.
1352
+ */
1353
+ usage: TokenUsage | null;
1354
+ }
1355
+ /**
1356
+ * Emitted when a turn completes.
1357
+ */
1358
+ export interface AgentSessionTurnCompletedEvent {
1359
+ /**
1360
+ * The unique ID of the event.
1361
+ */
1362
+ event_id: string;
1363
+ /**
1364
+ * The ID of the session associated with the event.
1365
+ */
1366
+ session_id: string;
1367
+ /**
1368
+ * The completed turn.
1369
+ */
1370
+ turn: TurnsAPI.Turn;
1371
+ /**
1372
+ * The ID of the turn associated with the event.
1373
+ */
1374
+ turn_id: string;
1375
+ /**
1376
+ * The type of the object. Always `agent.session.turn.completed`.
1377
+ */
1378
+ type: 'agent.session.turn.completed';
1379
+ /**
1380
+ * Recorded token usage for a session or turn. Usage is best effort and may change.
1381
+ */
1382
+ usage: TokenUsage | null;
1383
+ }
1384
+ /**
1385
+ * Emitted when an output text content part is added.
1386
+ */
1387
+ export interface AgentSessionTurnContentPartAddedEvent {
1388
+ /**
1389
+ * The index of the content part in the message.
1390
+ */
1391
+ content_index: number;
1392
+ /**
1393
+ * The unique ID of the event.
1394
+ */
1395
+ event_id: string;
1396
+ /**
1397
+ * The ID of the message item.
1398
+ */
1399
+ item_id: string;
1400
+ /**
1401
+ * The index of the item in the turn output.
1402
+ */
1403
+ output_index: number;
1404
+ /**
1405
+ * The initial content part.
1406
+ */
1407
+ part: OutputText;
1408
+ /**
1409
+ * The ID of the session associated with the event.
1410
+ */
1411
+ session_id: string;
1412
+ /**
1413
+ * The ID of the turn associated with the event, when applicable.
1414
+ */
1415
+ turn_id: string | null;
1416
+ /**
1417
+ * The type of the object. Always `agent.session.turn.content_part.added`.
1418
+ */
1419
+ type: 'agent.session.turn.content_part.added';
1420
+ }
1421
+ /**
1422
+ * Emitted when an output content part is complete.
1423
+ */
1424
+ export interface AgentSessionTurnContentPartDoneEvent {
1425
+ /**
1426
+ * The index of the content part in the message.
1427
+ */
1428
+ content_index: number;
1429
+ /**
1430
+ * The unique ID of the event.
1431
+ */
1432
+ event_id: string;
1433
+ /**
1434
+ * The ID of the message item.
1435
+ */
1436
+ item_id: string;
1437
+ /**
1438
+ * The index of the item in the turn output.
1439
+ */
1440
+ output_index: number;
1441
+ /**
1442
+ * The completed content part.
1443
+ */
1444
+ part: OutputText;
1445
+ /**
1446
+ * The ID of the session associated with the event.
1447
+ */
1448
+ session_id: string;
1449
+ /**
1450
+ * The ID of the turn associated with the event, when applicable.
1451
+ */
1452
+ turn_id: string | null;
1453
+ /**
1454
+ * The type of the object. Always `agent.session.turn.content_part.done`.
1455
+ */
1456
+ type: 'agent.session.turn.content_part.done';
1457
+ }
1458
+ /**
1459
+ * Emitted when a turn is created.
1460
+ */
1461
+ export interface AgentSessionTurnCreatedEvent {
1462
+ /**
1463
+ * The unique ID of the event.
1464
+ */
1465
+ event_id: string;
1466
+ /**
1467
+ * The ID of the session associated with the event.
1468
+ */
1469
+ session_id: string;
1470
+ /**
1471
+ * The turn at the time it was created.
1472
+ */
1473
+ turn: TurnsAPI.Turn;
1474
+ /**
1475
+ * The ID of the turn associated with the event.
1476
+ */
1477
+ turn_id: string;
1478
+ /**
1479
+ * The type of the object. Always `agent.session.turn.created`.
1480
+ */
1481
+ type: 'agent.session.turn.created';
1482
+ }
1483
+ /**
1484
+ * Emitted when a turn fails.
1485
+ */
1486
+ export interface AgentSessionTurnFailedEvent {
1487
+ /**
1488
+ * The unique ID of the event.
1489
+ */
1490
+ event_id: string;
1491
+ /**
1492
+ * The ID of the session associated with the event.
1493
+ */
1494
+ session_id: string;
1495
+ /**
1496
+ * The failed turn.
1497
+ */
1498
+ turn: TurnsAPI.Turn;
1499
+ /**
1500
+ * The ID of the turn associated with the event.
1501
+ */
1502
+ turn_id: string;
1503
+ /**
1504
+ * The type of the object. Always `agent.session.turn.failed`.
1505
+ */
1506
+ type: 'agent.session.turn.failed';
1507
+ /**
1508
+ * Recorded token usage for a session or turn. Usage is best effort and may change.
1509
+ */
1510
+ usage: TokenUsage | null;
1511
+ }
1512
+ /**
1513
+ * Emitted when a turn starts running.
1514
+ */
1515
+ export interface AgentSessionTurnInProgressEvent {
1516
+ /**
1517
+ * The unique ID of the event.
1518
+ */
1519
+ event_id: string;
1520
+ /**
1521
+ * The ID of the session associated with the event.
1522
+ */
1523
+ session_id: string;
1524
+ /**
1525
+ * The turn at the time it started running.
1526
+ */
1527
+ turn: TurnsAPI.Turn;
1528
+ /**
1529
+ * The ID of the turn associated with the event.
1530
+ */
1531
+ turn_id: string;
1532
+ /**
1533
+ * The type of the object. Always `agent.session.turn.in_progress`.
1534
+ */
1535
+ type: 'agent.session.turn.in_progress';
1536
+ }
1537
+ /**
1538
+ * Emitted when an item is added to a turn.
1539
+ */
1540
+ export interface AgentSessionTurnItemAddedEvent {
1541
+ /**
1542
+ * The unique ID of the event.
1543
+ */
1544
+ event_id: string;
1545
+ /**
1546
+ * The item that was added.
1547
+ */
1548
+ item: AgentSessionItem;
1549
+ /**
1550
+ * The index of the item in the turn output, when the item is agent output.
1551
+ */
1552
+ output_index: number | null;
1553
+ /**
1554
+ * The ID of the session associated with the event.
1555
+ */
1556
+ session_id: string;
1557
+ /**
1558
+ * The ID of the turn associated with the event, when applicable.
1559
+ */
1560
+ turn_id: string | null;
1561
+ /**
1562
+ * The type of the object. Always `agent.session.turn.item.added`.
1563
+ */
1564
+ type: 'agent.session.turn.item.added';
1565
+ }
1566
+ /**
1567
+ * Emitted when an output item is complete.
1568
+ */
1569
+ export interface AgentSessionTurnItemDoneEvent {
1570
+ /**
1571
+ * The unique ID of the event.
1572
+ */
1573
+ event_id: string;
1574
+ /**
1575
+ * The completed output item.
1576
+ */
1577
+ item: AgentOutputItem;
1578
+ /**
1579
+ * The index of the output item in the turn output.
1580
+ */
1581
+ output_index: number;
1582
+ /**
1583
+ * The ID of the session associated with the event.
1584
+ */
1585
+ session_id: string;
1586
+ /**
1587
+ * The ID of the turn associated with the event, when applicable.
1588
+ */
1589
+ turn_id: string | null;
1590
+ /**
1591
+ * The type of the object. Always `agent.session.turn.item.done`.
1592
+ */
1593
+ type: 'agent.session.turn.item.done';
1594
+ }
1595
+ /**
1596
+ * Emitted when text is appended to an output text content part.
1597
+ */
1598
+ export interface AgentSessionTurnOutputTextDeltaEvent {
1599
+ /**
1600
+ * The index of the content part in the message.
1601
+ */
1602
+ content_index: number;
1603
+ /**
1604
+ * The text that was appended.
1605
+ */
1606
+ delta: string;
1607
+ /**
1608
+ * The unique ID of the event.
1609
+ */
1610
+ event_id: string;
1611
+ /**
1612
+ * The ID of the message item.
1613
+ */
1614
+ item_id: string;
1615
+ /**
1616
+ * The index of the item in the turn output.
1617
+ */
1618
+ output_index: number;
1619
+ /**
1620
+ * The ID of the session associated with the event.
1621
+ */
1622
+ session_id: string;
1623
+ /**
1624
+ * The ID of the turn associated with the event, when applicable.
1625
+ */
1626
+ turn_id: string | null;
1627
+ /**
1628
+ * The type of the object. Always `agent.session.turn.output_text.delta`.
1629
+ */
1630
+ type: 'agent.session.turn.output_text.delta';
1631
+ }
1632
+ /**
1633
+ * Emitted when an output text content part is complete.
1634
+ */
1635
+ export interface AgentSessionTurnOutputTextDoneEvent {
1636
+ /**
1637
+ * The index of the content part in the message.
1638
+ */
1639
+ content_index: number;
1640
+ /**
1641
+ * The unique ID of the event.
1642
+ */
1643
+ event_id: string;
1644
+ /**
1645
+ * The ID of the message item.
1646
+ */
1647
+ item_id: string;
1648
+ /**
1649
+ * The index of the item in the turn output.
1650
+ */
1651
+ output_index: number;
1652
+ /**
1653
+ * The ID of the session associated with the event.
1654
+ */
1655
+ session_id: string;
1656
+ /**
1657
+ * The complete output text.
1658
+ */
1659
+ text: string;
1660
+ /**
1661
+ * The ID of the turn associated with the event, when applicable.
1662
+ */
1663
+ turn_id: string | null;
1664
+ /**
1665
+ * The type of the object. Always `agent.session.turn.output_text.done`.
1666
+ */
1667
+ type: 'agent.session.turn.output_text.done';
1668
+ }
1669
+ /**
1670
+ * Emitted when a reasoning summary content part is added.
1671
+ */
1672
+ export interface AgentSessionTurnReasoningSummaryPartAddedEvent {
1673
+ /**
1674
+ * The unique ID of the event.
1675
+ */
1676
+ event_id: string;
1677
+ /**
1678
+ * The ID of the reasoning item.
1679
+ */
1680
+ item_id: string;
1681
+ /**
1682
+ * The index of the item in the turn output.
1683
+ */
1684
+ output_index: number;
1685
+ /**
1686
+ * The initial summary part.
1687
+ */
1688
+ part: SummaryText;
1689
+ /**
1690
+ * The ID of the session associated with the event.
1691
+ */
1692
+ session_id: string;
1693
+ /**
1694
+ * The index of the summary content part.
1695
+ */
1696
+ summary_index: number;
1697
+ /**
1698
+ * The ID of the turn associated with the event, when applicable.
1699
+ */
1700
+ turn_id: string | null;
1701
+ /**
1702
+ * The type of the object. Always
1703
+ * `agent.session.turn.reasoning_summary_part.added`.
1704
+ */
1705
+ type: 'agent.session.turn.reasoning_summary_part.added';
1706
+ }
1707
+ /**
1708
+ * Emitted when a reasoning summary part is complete.
1709
+ */
1710
+ export interface AgentSessionTurnReasoningSummaryPartDoneEvent {
1711
+ /**
1712
+ * The unique ID of the event.
1713
+ */
1714
+ event_id: string;
1715
+ /**
1716
+ * The ID of the reasoning item.
1717
+ */
1718
+ item_id: string;
1719
+ /**
1720
+ * The index of the item in the turn output.
1721
+ */
1722
+ output_index: number;
1723
+ /**
1724
+ * The completed summary part.
1725
+ */
1726
+ part: SummaryText;
1727
+ /**
1728
+ * The ID of the session associated with the event.
1729
+ */
1730
+ session_id: string;
1731
+ /**
1732
+ * Present as `incomplete` when summary generation was interrupted.
1733
+ */
1734
+ status: 'incomplete' | null;
1735
+ /**
1736
+ * The index of the summary part.
1737
+ */
1738
+ summary_index: number;
1739
+ /**
1740
+ * The ID of the turn associated with the event, when applicable.
1741
+ */
1742
+ turn_id: string | null;
1743
+ /**
1744
+ * The type of the object. Always `agent.session.turn.reasoning_summary_part.done`.
1745
+ */
1746
+ type: 'agent.session.turn.reasoning_summary_part.done';
1747
+ }
1748
+ /**
1749
+ * Emitted when text is appended to a reasoning summary.
1750
+ */
1751
+ export interface AgentSessionTurnReasoningSummaryTextDeltaEvent {
1752
+ /**
1753
+ * The summary text that was appended.
1754
+ */
1755
+ delta: string;
1756
+ /**
1757
+ * The unique ID of the event.
1758
+ */
1759
+ event_id: string;
1760
+ /**
1761
+ * The ID of the reasoning item.
1762
+ */
1763
+ item_id: string;
1764
+ /**
1765
+ * The index of the item in the turn output.
1766
+ */
1767
+ output_index: number;
1768
+ /**
1769
+ * The ID of the session associated with the event.
1770
+ */
1771
+ session_id: string;
1772
+ /**
1773
+ * The index of the summary content part.
1774
+ */
1775
+ summary_index: number;
1776
+ /**
1777
+ * The ID of the turn associated with the event, when applicable.
1778
+ */
1779
+ turn_id: string | null;
1780
+ /**
1781
+ * The type of the object. Always
1782
+ * `agent.session.turn.reasoning_summary_text.delta`.
1783
+ */
1784
+ type: 'agent.session.turn.reasoning_summary_text.delta';
1785
+ }
1786
+ /**
1787
+ * Emitted when a reasoning summary content part is complete.
1788
+ */
1789
+ export interface AgentSessionTurnReasoningSummaryTextDoneEvent {
1790
+ /**
1791
+ * The unique ID of the event.
1792
+ */
1793
+ event_id: string;
1794
+ /**
1795
+ * The ID of the reasoning item.
1796
+ */
1797
+ item_id: string;
1798
+ /**
1799
+ * The index of the item in the turn output.
1800
+ */
1801
+ output_index: number;
1802
+ /**
1803
+ * The ID of the session associated with the event.
1804
+ */
1805
+ session_id: string;
1806
+ /**
1807
+ * The index of the summary content part.
1808
+ */
1809
+ summary_index: number;
1810
+ /**
1811
+ * The complete reasoning summary text.
1812
+ */
1813
+ text: string;
1814
+ /**
1815
+ * The ID of the turn associated with the event, when applicable.
1816
+ */
1817
+ turn_id: string | null;
1818
+ /**
1819
+ * The type of the object. Always `agent.session.turn.reasoning_summary_text.done`.
1820
+ */
1821
+ type: 'agent.session.turn.reasoning_summary_text.done';
1822
+ }
1823
+ /**
1824
+ * The text configuration used by an agent.
1825
+ */
1826
+ export interface AgentText {
1827
+ /**
1828
+ * The effective output format. Defaults to ordinary text.
1829
+ */
1830
+ format: TextFormat;
1831
+ /**
1832
+ * The amount of text produced by the agent. Defaults to `medium`.
1833
+ */
1834
+ verbosity: 'low' | 'medium' | 'high';
1835
+ }
1836
+ /**
1837
+ * Configuration for text generated by the agent.
1838
+ */
1839
+ export interface AgentTextParam {
1840
+ /**
1841
+ * The output format for generated text.
1842
+ */
1843
+ format?: TextFormatParam | null;
1844
+ /**
1845
+ * The amount of text the model should produce.
1846
+ *
1847
+ * - `low` - Produces less text.
1848
+ * - `medium` - Uses the default amount of text.
1849
+ * - `high` - Produces more text.
1850
+ */
1851
+ verbosity?: 'low' | 'medium' | 'high' | null;
1852
+ }
1853
+ /**
1854
+ * A tool available to the agent.
1855
+ */
1856
+ export type AgentTool = AgentTool.AgentToolResourceFunction | AgentTool.AgentToolResourceProgrammaticToolCalling | AgentTool.AgentToolResourceMcp | AgentTool.AgentToolResourceWebSearch;
1857
+ export declare namespace AgentTool {
1858
+ /**
1859
+ * A function defined by the application.
1860
+ */
1861
+ interface AgentToolResourceFunction {
1862
+ /**
1863
+ * Whether the function is deferred and discovered through tool search.
1864
+ */
1865
+ defer_loading: boolean;
1866
+ /**
1867
+ * A description of what the function does.
1868
+ */
1869
+ description: string;
1870
+ /**
1871
+ * The name of the function.
1872
+ */
1873
+ name: string;
1874
+ /**
1875
+ * A JSON Schema object describing the function's arguments.
1876
+ */
1877
+ parameters: {
1878
+ [key: string]: unknown;
1879
+ };
1880
+ /**
1881
+ * The type of the object. Always `function`.
1882
+ */
1883
+ type: 'function';
1884
+ }
1885
+ /**
1886
+ * Enables calling tools from model-generated code.
1887
+ */
1888
+ interface AgentToolResourceProgrammaticToolCalling {
1889
+ /**
1890
+ * Whether tools can be called from model-generated code.
1891
+ */
1892
+ enabled: boolean;
1893
+ /**
1894
+ * The type of the object. Always `programmatic_tool_calling`.
1895
+ */
1896
+ type: 'programmatic_tool_calling';
1897
+ }
1898
+ /**
1899
+ * Tools provided by a remote MCP server.
1900
+ */
1901
+ interface AgentToolResourceMcp {
1902
+ /**
1903
+ * The MCP tools the agent may call.
1904
+ */
1905
+ allowed_tools: Array<string> | null;
1906
+ /**
1907
+ * Where outbound MCP HTTP connections originate.
1908
+ */
1909
+ connection_origin: 'service' | 'environment';
1910
+ /**
1911
+ * The attached vault credential selected for this MCP server, if any. Optional
1912
+ * when exactly one attached credential matches the server URL.
1913
+ */
1914
+ credential_id: string | null;
1915
+ /**
1916
+ * Metadata included with requests to this MCP server.
1917
+ */
1918
+ request_metadata: {
1919
+ [key: string]: unknown;
1920
+ };
1921
+ /**
1922
+ * Whether this MCP server must initialize before the first turn.
1923
+ */
1924
+ required: boolean;
1925
+ /**
1926
+ * A label used to identify the MCP server in tool calls.
1927
+ */
1928
+ server_label: string;
1929
+ /**
1930
+ * The transport used to connect to the MCP server.
1931
+ */
1932
+ transport: AgentsAPI.McpTransport;
1933
+ /**
1934
+ * The type of the object. Always `mcp`.
1935
+ */
1936
+ type: 'mcp';
1937
+ }
1938
+ /**
1939
+ * Web search.
1940
+ */
1941
+ interface AgentToolResourceWebSearch {
1942
+ /**
1943
+ * Allowed search domains, or `null` when the search is unrestricted.
1944
+ */
1945
+ allowed_domains: Array<string> | null;
1946
+ /**
1947
+ * The amount of search context made available to the model. Defaults to `medium`.
1948
+ */
1949
+ context_size: 'low' | 'medium' | 'high';
1950
+ /**
1951
+ * Approximate user location used to localize web search results.
1952
+ */
1953
+ location: AgentToolResourceWebSearch.Location | null;
1954
+ /**
1955
+ * The source used for web search results.
1956
+ */
1957
+ mode: 'disabled' | 'cached' | 'live';
1958
+ /**
1959
+ * The type of the object. Always `web_search`.
1960
+ */
1961
+ type: 'web_search';
1962
+ }
1963
+ namespace AgentToolResourceWebSearch {
1964
+ /**
1965
+ * Approximate user location used to localize web search results.
1966
+ */
1967
+ interface Location {
1968
+ /**
1969
+ * The city name.
1970
+ */
1971
+ city: string | null;
1972
+ /**
1973
+ * The two-letter ISO country code, such as `US`.
1974
+ */
1975
+ country: string | null;
1976
+ /**
1977
+ * The region or state name.
1978
+ */
1979
+ region: string | null;
1980
+ /**
1981
+ * The IANA timezone, such as `America/Los_Angeles`.
1982
+ */
1983
+ timezone: string | null;
1984
+ }
1985
+ }
1986
+ }
1987
+ /**
1988
+ * A tool available to the agent.
1989
+ */
1990
+ export type AgentToolParam = AgentToolParam.AgentToolConfigParamFunction | AgentToolParam.AgentToolConfigParamToolSearch | AgentToolParam.AgentToolConfigParamProgrammaticToolCalling | AgentToolParam.AgentToolConfigParamMcp | AgentToolParam.AgentToolConfigParamWebSearch;
1991
+ export declare namespace AgentToolParam {
1992
+ /**
1993
+ * A function defined by the application.
1994
+ */
1995
+ interface AgentToolConfigParamFunction {
1996
+ /**
1997
+ * A description of what the function does.
1998
+ */
1999
+ description: string;
2000
+ /**
2001
+ * The name of the function.
2002
+ */
2003
+ name: string;
2004
+ /**
2005
+ * A JSON Schema object describing the function's arguments.
2006
+ */
2007
+ parameters: {
2008
+ [key: string]: unknown;
2009
+ };
2010
+ /**
2011
+ * The type of the object. Always `function`.
2012
+ */
2013
+ type: 'function';
2014
+ /**
2015
+ * Whether this function is deferred and discovered through tool search. Defaults
2016
+ * to `false`.
2017
+ */
2018
+ defer_loading?: boolean;
2019
+ }
2020
+ /**
2021
+ * Discovers deferred function tools and loads them into the model context.
2022
+ */
2023
+ interface AgentToolConfigParamToolSearch {
2024
+ /**
2025
+ * The type of the object. Always `tool_search`.
2026
+ */
2027
+ type: 'tool_search';
2028
+ }
2029
+ /**
2030
+ * Enables calling tools from model-generated code.
2031
+ */
2032
+ interface AgentToolConfigParamProgrammaticToolCalling {
2033
+ /**
2034
+ * The type of the object. Always `programmatic_tool_calling`.
2035
+ */
2036
+ type: 'programmatic_tool_calling';
2037
+ /**
2038
+ * Whether tools can be called from model-generated code. Defaults to `true`.
2039
+ */
2040
+ enabled?: boolean;
2041
+ }
2042
+ /**
2043
+ * Tools provided by a remote MCP server.
2044
+ */
2045
+ interface AgentToolConfigParamMcp {
2046
+ /**
2047
+ * A label used to identify the MCP server in tool calls.
2048
+ */
2049
+ server_label: string;
2050
+ /**
2051
+ * The transport used to connect to the MCP server.
2052
+ */
2053
+ transport: AgentsAPI.McpTransportParam;
2054
+ /**
2055
+ * The type of the object. Always `mcp`.
2056
+ */
2057
+ type: 'mcp';
2058
+ /**
2059
+ * The MCP tools the agent may call. All server tools are allowed when omitted.
2060
+ */
2061
+ allowed_tools?: Array<string> | null;
2062
+ /**
2063
+ * Where outbound MCP HTTP connections originate.
2064
+ *
2065
+ * - `service` - Uses the Managed Agents service network.
2066
+ * - `environment` - Uses the session's execution environment.
2067
+ */
2068
+ connection_origin?: 'service' | 'environment' | null;
2069
+ /**
2070
+ * The attached vault credential used to authenticate this MCP server. Optional
2071
+ * when exactly one attached credential matches the server URL.
2072
+ */
2073
+ credential_id?: string | null;
2074
+ /**
2075
+ * Metadata included with requests to this MCP server.
2076
+ */
2077
+ request_metadata?: {
2078
+ [key: string]: unknown;
2079
+ } | null;
2080
+ /**
2081
+ * Whether this MCP server must initialize before the first turn. Defaults to
2082
+ * `false`.
2083
+ */
2084
+ required?: boolean;
2085
+ }
2086
+ /**
2087
+ * Web search.
2088
+ */
2089
+ interface AgentToolConfigParamWebSearch {
2090
+ /**
2091
+ * The type of the object. Always `web_search`.
2092
+ */
2093
+ type: 'web_search';
2094
+ /**
2095
+ * Domains the search may include.
2096
+ */
2097
+ allowed_domains?: Array<string> | null;
2098
+ /**
2099
+ * The amount of web search context made available to the model.
2100
+ */
2101
+ context_size?: 'low' | 'medium' | 'high' | null;
2102
+ /**
2103
+ * Approximate user location used to localize web search results.
2104
+ */
2105
+ location?: AgentToolConfigParamWebSearch.Location | null;
2106
+ /**
2107
+ * The source used for web search results.
2108
+ *
2109
+ * - `disabled` - Disables web search.
2110
+ * - `cached` - Uses cached search results.
2111
+ * - `live` - Searches the live web.
2112
+ */
2113
+ mode?: 'disabled' | 'cached' | 'live' | null;
2114
+ }
2115
+ namespace AgentToolConfigParamWebSearch {
2116
+ /**
2117
+ * Approximate user location used to localize web search results.
2118
+ */
2119
+ interface Location {
2120
+ /**
2121
+ * The city name.
2122
+ */
2123
+ city?: string | null;
2124
+ /**
2125
+ * The two-letter ISO country code, such as `US`.
2126
+ */
2127
+ country?: string | null;
2128
+ /**
2129
+ * The region or state name.
2130
+ */
2131
+ region?: string | null;
2132
+ /**
2133
+ * The IANA timezone, such as `America/Los_Angeles`.
2134
+ */
2135
+ timezone?: string | null;
2136
+ }
2137
+ }
2138
+ }
2139
+ /**
2140
+ * A request to wait for one or more subagents.
2141
+ */
2142
+ export interface AgentWaitForSubagentsCallItem {
2143
+ /**
2144
+ * The ID of the tool call item.
2145
+ */
2146
+ id: string;
2147
+ /**
2148
+ * The IDs of the agents to wait for.
2149
+ */
2150
+ recipient_agent_ids: Array<string>;
2151
+ /**
2152
+ * The ID of the agent waiting for results.
2153
+ */
2154
+ sender_agent_id: string;
2155
+ /**
2156
+ * The status of the tool call.
2157
+ */
2158
+ status: AgentFunctionCallStatus;
2159
+ /**
2160
+ * The ID of the turn that contains this item.
2161
+ */
2162
+ turn_id: string;
2163
+ /**
2164
+ * The item type. Always `wait_for_subagents_call`.
2165
+ */
2166
+ type: 'wait_for_subagents_call';
2167
+ }
2168
+ /**
2169
+ * A web search call produced by the agent.
2170
+ */
2171
+ export interface AgentWebSearchCallItem {
2172
+ /**
2173
+ * The ID of the web search call.
2174
+ */
2175
+ id: string;
2176
+ /**
2177
+ * An action performed by the web search tool.
2178
+ */
2179
+ action: WebSearchAction | null;
2180
+ /**
2181
+ * The status of the web search call.
2182
+ */
2183
+ status: AgentOutputItemStatus;
2184
+ /**
2185
+ * The ID of the turn that contains this item.
2186
+ */
2187
+ turn_id: string;
2188
+ /**
2189
+ * The item type. Always `web_search_call`.
2190
+ */
2191
+ type: 'web_search_call';
2192
+ }
2193
+ /**
2194
+ * The execution environment for a session.
2195
+ */
2196
+ export type Environment = Environment.EnvironmentResourceNone | Environment.EnvironmentResourceOpenAIHosted | Environment.EnvironmentResourceSelfHosted;
2197
+ export declare namespace Environment {
2198
+ /**
2199
+ * The session talks to CCA without selecting or provisioning an execution
2200
+ * environment.
2201
+ */
2202
+ interface EnvironmentResourceNone {
2203
+ /**
2204
+ * The type of the object. Always `none`.
2205
+ */
2206
+ type: 'none';
2207
+ }
2208
+ /**
2209
+ * An environment hosted by OpenAI.
2210
+ */
2211
+ interface EnvironmentResourceOpenAIHosted {
2212
+ /**
2213
+ * The public ID of the environment.
2214
+ */
2215
+ id: string;
2216
+ /**
2217
+ * Directories that contain capabilities exposed to the agent.
2218
+ */
2219
+ capability_directories: Array<string>;
2220
+ /**
2221
+ * Files available in the environment, excluding their contents.
2222
+ */
2223
+ files: Array<AgentsAPI.HostedEnvironmentFile>;
2224
+ /**
2225
+ * The effective network access policy for the environment.
2226
+ */
2227
+ network: EnvironmentResourceOpenAIHosted.Network;
2228
+ /**
2229
+ * Packages installed in the environment.
2230
+ */
2231
+ packages: EnvironmentResourceOpenAIHosted.Packages;
2232
+ /**
2233
+ * Plugins installed in the environment, excluding their archive contents.
2234
+ */
2235
+ plugins: Array<AgentsAPI.HostedPlugin>;
2236
+ /**
2237
+ * Skills installed in the environment, excluding their archive contents.
2238
+ */
2239
+ skills: Array<AgentsAPI.HostedSkill>;
2240
+ /**
2241
+ * The type of the object. Always `openai_hosted`.
2242
+ */
2243
+ type: 'openai_hosted';
2244
+ }
2245
+ namespace EnvironmentResourceOpenAIHosted {
2246
+ /**
2247
+ * The effective network access policy for the environment.
2248
+ */
2249
+ interface Network {
2250
+ /**
2251
+ * The environment's network access mode.
2252
+ *
2253
+ * - `enabled` - Allows unrestricted network access.
2254
+ * - `disabled` - Disables network access.
2255
+ * - `restricted` - Allows access only to configured domains.
2256
+ */
2257
+ access: 'enabled' | 'disabled' | 'restricted';
2258
+ /**
2259
+ * Domains the environment may access when network access is restricted.
2260
+ */
2261
+ allowed_domains: Array<string>;
2262
+ }
2263
+ /**
2264
+ * Packages installed in the environment.
2265
+ */
2266
+ interface Packages {
2267
+ /**
2268
+ * npm packages installed globally in the environment.
2269
+ */
2270
+ npm: Array<string>;
2271
+ /**
2272
+ * Python packages installed in the environment.
2273
+ */
2274
+ python: Array<string>;
2275
+ /**
2276
+ * System packages installed in the environment.
2277
+ */
2278
+ system: Array<string>;
2279
+ }
2280
+ }
2281
+ /**
2282
+ * An environment hosted by the application.
2283
+ */
2284
+ interface EnvironmentResourceSelfHosted {
2285
+ /**
2286
+ * The public ID of the environment.
2287
+ */
2288
+ id: string;
2289
+ /**
2290
+ * Directories that contain capabilities exposed to the agent.
2291
+ */
2292
+ capability_directories: Array<string>;
2293
+ /**
2294
+ * Pass this URL unchanged to `codex exec-server --remote` when connecting this
2295
+ * environment.
2296
+ */
2297
+ remote_url: string;
2298
+ /**
2299
+ * The type of the object. Always `self_hosted`.
2300
+ */
2301
+ type: 'self_hosted';
2302
+ /**
2303
+ * The absolute project directory inside the environment. Defaults to `/workspace`.
2304
+ */
2305
+ workspace_directory: string;
2306
+ }
2307
+ }
2308
+ /**
2309
+ * The execution environment and optional reusable template for a session.
2310
+ */
2311
+ export type EnvironmentParam = EnvironmentParam.EnvironmentParamNone | EnvironmentParam.EnvironmentParamOpenAIHosted | EnvironmentParam.EnvironmentParamSelfHosted;
2312
+ export declare namespace EnvironmentParam {
2313
+ /**
2314
+ * Runs the agent without an execution environment.
2315
+ */
2316
+ interface EnvironmentParamNone {
2317
+ /**
2318
+ * The type of the object. Always `none`.
2319
+ */
2320
+ type: 'none';
2321
+ }
2322
+ /**
2323
+ * An OpenAI-hosted environment, optionally based on a reusable template.
2324
+ */
2325
+ interface EnvironmentParamOpenAIHosted {
2326
+ /**
2327
+ * The type of the object. Always `openai_hosted`.
2328
+ */
2329
+ type: 'openai_hosted';
2330
+ /**
2331
+ * Directories that contain capabilities exposed to the agent. Defaults to an empty
2332
+ * list.
2333
+ */
2334
+ capability_directories?: Array<string> | null;
2335
+ /**
2336
+ * Environment variables made available to the agent.
2337
+ */
2338
+ env?: {
2339
+ [key: string]: string;
2340
+ } | null;
2341
+ /**
2342
+ * A reusable hosted template applied before inline session configuration. Omitted
2343
+ * fields inherit the template; network overrides cannot broaden its policy.
2344
+ */
2345
+ environment_template_id?: string;
2346
+ /**
2347
+ * Files available before the agent starts. Defaults to an empty list.
2348
+ */
2349
+ files?: Array<AgentsAPI.HostedEnvironmentFileParam> | null;
2350
+ /**
2351
+ * Network access for an OpenAI-hosted environment.
2352
+ */
2353
+ network?: EnvironmentParamOpenAIHosted.Network | null;
2354
+ /**
2355
+ * Packages to install in an OpenAI-hosted environment.
2356
+ */
2357
+ packages?: EnvironmentParamOpenAIHosted.Packages | null;
2358
+ /**
2359
+ * Plugins provided as inline ZIP archives. Defaults to an empty list.
2360
+ */
2361
+ plugins?: Array<AgentsAPI.HostedPluginParam> | null;
2362
+ /**
2363
+ * Ordered, confidential setup commands. Command bodies are never returned.
2364
+ */
2365
+ setup_commands?: Array<AgentsAPI.SetupCommandParam> | null;
2366
+ /**
2367
+ * Skills referenced by ID or provided as inline ZIP archives. Defaults to an empty
2368
+ * list.
2369
+ */
2370
+ skills?: Array<AgentsAPI.HostedSkillParam> | null;
2371
+ }
2372
+ namespace EnvironmentParamOpenAIHosted {
2373
+ /**
2374
+ * Network access for an OpenAI-hosted environment.
2375
+ */
2376
+ interface Network {
2377
+ /**
2378
+ * The environment's network access mode.
2379
+ *
2380
+ * - `enabled` - Allows unrestricted network access, matching an omitted network
2381
+ * policy.
2382
+ * - `disabled` - Disables network access.
2383
+ * - `restricted` - Allows access only to configured domains.
2384
+ */
2385
+ access: 'enabled' | 'disabled' | 'restricted';
2386
+ /**
2387
+ * Domains the environment may access when network access is restricted.
2388
+ */
2389
+ allowed_domains?: Array<string> | null;
2390
+ }
2391
+ /**
2392
+ * Packages to install in an OpenAI-hosted environment.
2393
+ */
2394
+ interface Packages {
2395
+ /**
2396
+ * npm packages to install globally. Defaults to an empty list.
2397
+ */
2398
+ npm?: Array<string> | null;
2399
+ /**
2400
+ * Python packages to install. Defaults to an empty list.
2401
+ */
2402
+ python?: Array<string> | null;
2403
+ /**
2404
+ * System packages to install. Defaults to an empty list.
2405
+ */
2406
+ system?: Array<string> | null;
2407
+ }
2408
+ }
2409
+ /**
2410
+ * An application-hosted environment configured inline.
2411
+ */
2412
+ interface EnvironmentParamSelfHosted {
2413
+ /**
2414
+ * The type of the object. Always `self_hosted`.
2415
+ */
2416
+ type: 'self_hosted';
2417
+ /**
2418
+ * Absolute project directory inside the self-hosted environment.
2419
+ */
2420
+ workspace_directory: string;
2421
+ /**
2422
+ * Directories that contain capabilities exposed to the agent. Defaults to an empty
2423
+ * list.
2424
+ */
2425
+ capability_directories?: Array<string> | null;
2426
+ }
2427
+ }
2428
+ /**
2429
+ * Metadata for a file materialized in an OpenAI-hosted execution environment.
2430
+ */
2431
+ export type HostedEnvironmentFile = HostedEnvironmentFileID | HostedEnvironmentFile.HostedEnvironmentFileResourceInline;
2432
+ export declare namespace HostedEnvironmentFile {
2433
+ /**
2434
+ * A file supplied inline when the session was created.
2435
+ */
2436
+ interface HostedEnvironmentFileResourceInline {
2437
+ /**
2438
+ * The session-scoped ID of the file in the execution environment.
2439
+ */
2440
+ id: string;
2441
+ /**
2442
+ * The file's absolute path inside the environment.
2443
+ */
2444
+ path: string;
2445
+ /**
2446
+ * The decoded file size in bytes.
2447
+ */
2448
+ size_bytes: number;
2449
+ /**
2450
+ * The type of the object. Always `inline`.
2451
+ */
2452
+ type: 'inline';
2453
+ }
2454
+ }
2455
+ /**
2456
+ * A file copied from the OpenAI Files API.
2457
+ */
2458
+ export interface HostedEnvironmentFileID {
2459
+ /**
2460
+ * The session-scoped ID of the file in the execution environment.
2461
+ */
2462
+ id: string;
2463
+ /**
2464
+ * The ID of the uploaded file.
2465
+ */
2466
+ file_id: string;
2467
+ /**
2468
+ * The file's absolute path inside the environment.
2469
+ */
2470
+ path: string;
2471
+ /**
2472
+ * The decoded file size in bytes.
2473
+ */
2474
+ size_bytes: number;
2475
+ /**
2476
+ * The type of the object. Always `file_id`.
2477
+ */
2478
+ type: 'file_id';
2479
+ }
2480
+ /**
2481
+ * A file materialized in an OpenAI-hosted execution environment.
2482
+ */
2483
+ export type HostedEnvironmentFileParam = HostedEnvironmentFileParam.HostedEnvironmentFileParamFileID | HostedEnvironmentFileParam.HostedEnvironmentFileParamInline;
2484
+ export declare namespace HostedEnvironmentFileParam {
2485
+ /**
2486
+ * A file previously uploaded through the OpenAI Files API.
2487
+ */
2488
+ interface HostedEnvironmentFileParamFileID {
2489
+ /**
2490
+ * The ID of the uploaded file.
2491
+ */
2492
+ file_id: string;
2493
+ /**
2494
+ * The absolute destination path inside `/workspace`.
2495
+ */
2496
+ path: string;
2497
+ /**
2498
+ * The type of the object. Always `file_id`.
2499
+ */
2500
+ type: 'file_id';
2501
+ }
2502
+ /**
2503
+ * A file supplied directly as standard-base64 data.
2504
+ */
2505
+ interface HostedEnvironmentFileParamInline {
2506
+ /**
2507
+ * The standard-base64-encoded file contents.
2508
+ */
2509
+ data: string;
2510
+ /**
2511
+ * The absolute destination path inside `/workspace`.
2512
+ */
2513
+ path: string;
2514
+ /**
2515
+ * The type of the object. Always `inline`.
2516
+ */
2517
+ type: 'inline';
2518
+ }
2519
+ }
2520
+ /**
2521
+ * A plugin installed from an inline ZIP archive.
2522
+ */
2523
+ export interface HostedPlugin {
2524
+ /**
2525
+ * The installed plugin description.
2526
+ */
2527
+ description: string;
2528
+ /**
2529
+ * The installed plugin name.
2530
+ */
2531
+ name: string;
2532
+ /**
2533
+ * The type of the object. Always `inline`.
2534
+ */
2535
+ type: 'inline';
2536
+ }
2537
+ /**
2538
+ * Supplies a plugin ZIP directly in the session request.
2539
+ */
2540
+ export interface HostedPluginParam {
2541
+ /**
2542
+ * The plugin description declared in `.codex-plugin/plugin.json`.
2543
+ */
2544
+ description: string;
2545
+ /**
2546
+ * The plugin name declared in `.codex-plugin/plugin.json`.
2547
+ */
2548
+ name: string;
2549
+ /**
2550
+ * Provides ZIP bytes encoded with standard base64.
2551
+ */
2552
+ source: InlineCapabilitySourceParam;
2553
+ /**
2554
+ * The type of the object. Always `inline`.
2555
+ */
2556
+ type: 'inline';
2557
+ }
2558
+ /**
2559
+ * A skill installed in an OpenAI-hosted environment.
2560
+ */
2561
+ export type HostedSkill = HostedSkillReference | HostedSkill.HostedSkillResourceInline;
2562
+ export declare namespace HostedSkill {
2563
+ /**
2564
+ * A skill installed from an inline ZIP archive.
2565
+ */
2566
+ interface HostedSkillResourceInline {
2567
+ /**
2568
+ * The installed skill description.
2569
+ */
2570
+ description: string;
2571
+ /**
2572
+ * The installed skill name.
2573
+ */
2574
+ name: string;
2575
+ /**
2576
+ * The type of the object. Always `inline`.
2577
+ */
2578
+ type: 'inline';
2579
+ }
2580
+ }
2581
+ /**
2582
+ * A skill installed in an OpenAI-hosted environment.
2583
+ */
2584
+ export type HostedSkillParam = HostedSkillParam.HostedSkillParamSkillReference | HostedSkillParam.HostedSkillParamInline;
2585
+ export declare namespace HostedSkillParam {
2586
+ /**
2587
+ * References a skill uploaded through the Skills API.
2588
+ */
2589
+ interface HostedSkillParamSkillReference {
2590
+ /**
2591
+ * The ID of the skill created through `/v1/skills`.
2592
+ */
2593
+ skill_id: string;
2594
+ /**
2595
+ * The type of the object. Always `skill_reference`.
2596
+ */
2597
+ type: 'skill_reference';
2598
+ /**
2599
+ * The skill version, a positive integer or `latest`; omission selects the default.
2600
+ */
2601
+ version?: string | null;
2602
+ }
2603
+ /**
2604
+ * Supplies a skill ZIP directly in the session request.
2605
+ */
2606
+ interface HostedSkillParamInline {
2607
+ /**
2608
+ * The skill description declared in `SKILL.md`.
2609
+ */
2610
+ description: string;
2611
+ /**
2612
+ * The skill name declared in `SKILL.md`.
2613
+ */
2614
+ name: string;
2615
+ /**
2616
+ * Provides ZIP bytes encoded with standard base64.
2617
+ */
2618
+ source: AgentsAPI.InlineCapabilitySourceParam;
2619
+ /**
2620
+ * The type of the object. Always `inline`.
2621
+ */
2622
+ type: 'inline';
2623
+ }
2624
+ }
2625
+ /**
2626
+ * A skill installed from the Skills API.
2627
+ */
2628
+ export interface HostedSkillReference {
2629
+ /**
2630
+ * The installed skill description.
2631
+ */
2632
+ description: string;
2633
+ /**
2634
+ * The installed skill name.
2635
+ */
2636
+ name: string;
2637
+ /**
2638
+ * The referenced skill ID.
2639
+ */
2640
+ skill_id: string;
2641
+ /**
2642
+ * The type of the object. Always `skill_reference`.
2643
+ */
2644
+ type: 'skill_reference';
2645
+ /**
2646
+ * The concrete skill version installed for this session.
2647
+ */
2648
+ version: string;
2649
+ }
2650
+ /**
2651
+ * Provides ZIP bytes encoded with standard base64.
2652
+ */
2653
+ export interface InlineCapabilitySourceParam {
2654
+ /**
2655
+ * Standard-base64 encoded ZIP archive bytes.
2656
+ */
2657
+ data: string;
2658
+ /**
2659
+ * The archive media type, always `application/zip`.
2660
+ */
2661
+ media_type: 'application/zip';
2662
+ /**
2663
+ * The type of the object. Always `base64`.
2664
+ */
2665
+ type: 'base64';
2666
+ }
2667
+ /**
2668
+ * User-provided content recorded in a session item.
2669
+ */
2670
+ export type InputContent = InputContent.InputContentResourceInputText | InputContent.InputContentResourceInputImage;
2671
+ export declare namespace InputContent {
2672
+ /**
2673
+ * Text input recorded in a session item.
2674
+ */
2675
+ interface InputContentResourceInputText {
2676
+ /**
2677
+ * The text supplied to the agent.
2678
+ */
2679
+ text: string;
2680
+ /**
2681
+ * The type of the object. Always `input_text`.
2682
+ */
2683
+ type: 'input_text';
2684
+ }
2685
+ /**
2686
+ * Image input recorded in a session item.
2687
+ */
2688
+ interface InputContentResourceInputImage {
2689
+ /**
2690
+ * The URL of the image supplied to the agent, which may be a base64-encoded data
2691
+ * URL.
2692
+ */
2693
+ image_url: string;
2694
+ /**
2695
+ * The type of the object. Always `input_image`.
2696
+ */
2697
+ type: 'input_image';
2698
+ }
2699
+ }
2700
+ /**
2701
+ * Content included in an input message.
2702
+ */
2703
+ export type InputContentParam = InputContentParam.InputContentParamInputText | InputContentParam.InputContentParamInputImage;
2704
+ export declare namespace InputContentParam {
2705
+ /**
2706
+ * Text input to the model.
2707
+ */
2708
+ interface InputContentParamInputText {
2709
+ /**
2710
+ * The text sent to the model.
2711
+ */
2712
+ text: string;
2713
+ /**
2714
+ * The type of the object. Always `input_text`.
2715
+ */
2716
+ type: 'input_text';
2717
+ }
2718
+ /**
2719
+ * Image input to the model.
2720
+ */
2721
+ interface InputContentParamInputImage {
2722
+ /**
2723
+ * The URL of the image sent to the model.
2724
+ */
2725
+ image_url: string;
2726
+ /**
2727
+ * The type of the object. Always `input_image`.
2728
+ */
2729
+ type: 'input_image';
2730
+ }
2731
+ }
2732
+ /**
2733
+ * The transport used to connect to an MCP server.
2734
+ */
2735
+ export type McpTransport = McpTransport.McpTransportResourceHTTP | McpTransport.McpTransportResourceStdio;
2736
+ export declare namespace McpTransport {
2737
+ /**
2738
+ * Connects to an MCP server over HTTP.
2739
+ */
2740
+ interface McpTransportResourceHTTP {
2741
+ /**
2742
+ * The URL of the MCP server.
2743
+ */
2744
+ server_url: string;
2745
+ /**
2746
+ * The type of the object. Always `http`.
2747
+ */
2748
+ type: 'http';
2749
+ }
2750
+ /**
2751
+ * Starts an MCP server as a local process.
2752
+ */
2753
+ interface McpTransportResourceStdio {
2754
+ /**
2755
+ * Arguments passed to the MCP server command.
2756
+ */
2757
+ args: Array<string>;
2758
+ /**
2759
+ * The command used to start the MCP server.
2760
+ */
2761
+ command: string;
2762
+ /**
2763
+ * The working directory used to start the MCP server.
2764
+ */
2765
+ cwd: string;
2766
+ /**
2767
+ * Environment variable names inherited from the execution environment.
2768
+ */
2769
+ env_vars: Array<string>;
2770
+ /**
2771
+ * The type of the object. Always `stdio`.
2772
+ */
2773
+ type: 'stdio';
2774
+ }
2775
+ }
2776
+ /**
2777
+ * The transport used to connect to an MCP server.
2778
+ */
2779
+ export type McpTransportParam = McpTransportParam.McpTransportConfigParamHTTP | McpTransportParam.McpTransportConfigParamStdio;
2780
+ export declare namespace McpTransportParam {
2781
+ /**
2782
+ * Connects to an MCP server over HTTP.
2783
+ */
2784
+ interface McpTransportConfigParamHTTP {
2785
+ /**
2786
+ * The URL of the MCP server.
2787
+ */
2788
+ server_url: string;
2789
+ /**
2790
+ * The type of the object. Always `http`.
2791
+ */
2792
+ type: 'http';
2793
+ /**
2794
+ * The authorization value sent to the MCP server, if any.
2795
+ */
2796
+ authorization?: string | null;
2797
+ /**
2798
+ * Additional HTTP headers sent to the MCP server.
2799
+ */
2800
+ headers?: {
2801
+ [key: string]: string;
2802
+ } | null;
2803
+ }
2804
+ /**
2805
+ * Starts an MCP server as a local process.
2806
+ */
2807
+ interface McpTransportConfigParamStdio {
2808
+ /**
2809
+ * The command used to start the MCP server.
2810
+ */
2811
+ command: string;
2812
+ /**
2813
+ * The working directory used to start the MCP server.
2814
+ */
2815
+ cwd: string;
2816
+ /**
2817
+ * The type of the object. Always `stdio`.
2818
+ */
2819
+ type: 'stdio';
2820
+ /**
2821
+ * Arguments passed to the MCP server command.
2822
+ */
2823
+ args?: Array<string> | null;
2824
+ /**
2825
+ * Environment variables set for the MCP server process.
2826
+ */
2827
+ env?: {
2828
+ [key: string]: string;
2829
+ } | null;
2830
+ /**
2831
+ * Environment variable names to inherit from the selected execution environment.
2832
+ */
2833
+ env_vars?: Array<string> | null;
2834
+ }
2835
+ }
2836
+ /**
2837
+ * The resolved configuration for creating and coordinating subagents.
2838
+ */
2839
+ export interface MultiAgentConfig {
2840
+ /**
2841
+ * Whether subagent tools are enabled. Defaults to false.
2842
+ */
2843
+ enabled: boolean;
2844
+ /**
2845
+ * Maximum number of subagents that may run concurrently, or null when disabled.
2846
+ * Defaults to 6 when enabled.
2847
+ */
2848
+ max_concurrent_subagents: number | null;
2849
+ }
2850
+ /**
2851
+ * Explicit configuration for creating and coordinating subagents.
2852
+ */
2853
+ export interface MultiAgentConfigParam {
2854
+ /**
2855
+ * Whether subagent tools are enabled.
2856
+ */
2857
+ enabled: boolean;
2858
+ /**
2859
+ * Maximum number of subagents that may run concurrently. Defaults to 6.
2860
+ */
2861
+ max_concurrent_subagents?: number;
2862
+ }
2863
+ /**
2864
+ * A text content part produced by the agent.
2865
+ */
2866
+ export interface OutputText {
2867
+ /**
2868
+ * The text produced by the agent.
2869
+ */
2870
+ text: string;
2871
+ /**
2872
+ * The content type. Always `output_text`.
2873
+ */
2874
+ type: 'output_text';
2875
+ }
2876
+ /**
2877
+ * A credential-free tool available to a reusable agent.
2878
+ */
2879
+ export type PersistedAgentTool = PersistedAgentTool.PersistedAgentToolResourceFunction | PersistedAgentTool.PersistedAgentToolResourceToolSearch | PersistedAgentTool.PersistedAgentToolResourceProgrammaticToolCalling | PersistedAgentTool.PersistedAgentToolResourceMcp | PersistedAgentTool.PersistedAgentToolResourceWebSearch;
2880
+ export declare namespace PersistedAgentTool {
2881
+ /**
2882
+ * A function defined by the application.
2883
+ */
2884
+ interface PersistedAgentToolResourceFunction {
2885
+ /**
2886
+ * Whether the function is deferred and discovered through tool search.
2887
+ */
2888
+ defer_loading: boolean;
2889
+ /**
2890
+ * A description of what the function does.
2891
+ */
2892
+ description: string;
2893
+ /**
2894
+ * The name of the function.
2895
+ */
2896
+ name: string;
2897
+ /**
2898
+ * A JSON Schema object describing the function's arguments.
2899
+ */
2900
+ parameters: {
2901
+ [key: string]: unknown;
2902
+ };
2903
+ /**
2904
+ * The type of the object. Always `function`.
2905
+ */
2906
+ type: 'function';
2907
+ }
2908
+ /**
2909
+ * Discovers deferred function tools and loads them into the model context.
2910
+ */
2911
+ interface PersistedAgentToolResourceToolSearch {
2912
+ /**
2913
+ * The type of the object. Always `tool_search`.
2914
+ */
2915
+ type: 'tool_search';
2916
+ }
2917
+ /**
2918
+ * Enables calling tools from model-generated code.
2919
+ */
2920
+ interface PersistedAgentToolResourceProgrammaticToolCalling {
2921
+ /**
2922
+ * Whether tools can be called from model-generated code.
2923
+ */
2924
+ enabled: boolean;
2925
+ /**
2926
+ * The type of the object. Always `programmatic_tool_calling`.
2927
+ */
2928
+ type: 'programmatic_tool_calling';
2929
+ }
2930
+ /**
2931
+ * Tools provided by a remote MCP server without stored credentials.
2932
+ */
2933
+ interface PersistedAgentToolResourceMcp {
2934
+ /**
2935
+ * The MCP tools the agent may call, or null when all server tools are allowed.
2936
+ */
2937
+ allowed_tools: Array<string> | null;
2938
+ /**
2939
+ * Where outbound MCP HTTP connections originate.
2940
+ */
2941
+ connection_origin: 'service' | 'environment';
2942
+ /**
2943
+ * The vault credential selected for this MCP server, if any.
2944
+ */
2945
+ credential_id: string | null;
2946
+ /**
2947
+ * Metadata included with requests to this MCP server.
2948
+ */
2949
+ request_metadata: {
2950
+ [key: string]: unknown;
2951
+ };
2952
+ /**
2953
+ * Whether this MCP server must initialize before the first turn.
2954
+ */
2955
+ required: boolean;
2956
+ /**
2957
+ * A label used to identify the MCP server in tool calls.
2958
+ */
2959
+ server_label: string;
2960
+ /**
2961
+ * The credential-free transport used to connect to the MCP server.
2962
+ */
2963
+ transport: AgentsAPI.PersistedMcpTransport;
2964
+ /**
2965
+ * The type of the object. Always `mcp`.
2966
+ */
2967
+ type: 'mcp';
2968
+ }
2969
+ /**
2970
+ * Web search.
2971
+ */
2972
+ interface PersistedAgentToolResourceWebSearch {
2973
+ /**
2974
+ * Allowed search domains, or `null` when the search is unrestricted.
2975
+ */
2976
+ allowed_domains: Array<string> | null;
2977
+ /**
2978
+ * The amount of search context made available to the model. Defaults to `medium`.
2979
+ */
2980
+ context_size: 'low' | 'medium' | 'high';
2981
+ /**
2982
+ * Approximate user location used to localize web search results.
2983
+ */
2984
+ location: PersistedAgentToolResourceWebSearch.Location | null;
2985
+ /**
2986
+ * The source used for web search results.
2987
+ */
2988
+ mode: 'disabled' | 'cached' | 'live';
2989
+ /**
2990
+ * The type of the object. Always `web_search`.
2991
+ */
2992
+ type: 'web_search';
2993
+ }
2994
+ namespace PersistedAgentToolResourceWebSearch {
2995
+ /**
2996
+ * Approximate user location used to localize web search results.
2997
+ */
2998
+ interface Location {
2999
+ /**
3000
+ * The city name.
3001
+ */
3002
+ city: string | null;
3003
+ /**
3004
+ * The two-letter ISO country code, such as `US`.
3005
+ */
3006
+ country: string | null;
3007
+ /**
3008
+ * The region or state name.
3009
+ */
3010
+ region: string | null;
3011
+ /**
3012
+ * The IANA timezone, such as `America/Los_Angeles`.
3013
+ */
3014
+ timezone: string | null;
3015
+ }
3016
+ }
3017
+ }
3018
+ /**
3019
+ * A tool that can be stored on a reusable agent without session credentials.
3020
+ */
3021
+ export type PersistedAgentToolParam = PersistedAgentToolParam.PersistedAgentToolConfigParamFunction | PersistedAgentToolParam.PersistedAgentToolConfigParamToolSearch | PersistedAgentToolParam.PersistedAgentToolConfigParamProgrammaticToolCalling | PersistedAgentToolParam.PersistedAgentToolConfigParamMcp | PersistedAgentToolParam.PersistedAgentToolConfigParamWebSearch;
3022
+ export declare namespace PersistedAgentToolParam {
3023
+ /**
3024
+ * A function defined by the application.
3025
+ */
3026
+ interface PersistedAgentToolConfigParamFunction {
3027
+ /**
3028
+ * A description of what the function does.
3029
+ */
3030
+ description: string;
3031
+ /**
3032
+ * The name of the function.
3033
+ */
3034
+ name: string;
3035
+ /**
3036
+ * A JSON Schema object describing the function's arguments.
3037
+ */
3038
+ parameters: {
3039
+ [key: string]: unknown;
3040
+ };
3041
+ /**
3042
+ * The type of the object. Always `function`.
3043
+ */
3044
+ type: 'function';
3045
+ /**
3046
+ * Whether this function is deferred and discovered through tool search. Defaults
3047
+ * to `false`.
3048
+ */
3049
+ defer_loading?: boolean;
3050
+ }
3051
+ /**
3052
+ * Discovers deferred function tools and loads them into the model context.
3053
+ */
3054
+ interface PersistedAgentToolConfigParamToolSearch {
3055
+ /**
3056
+ * The type of the object. Always `tool_search`.
3057
+ */
3058
+ type: 'tool_search';
3059
+ }
3060
+ /**
3061
+ * Enables calling tools from model-generated code.
3062
+ */
3063
+ interface PersistedAgentToolConfigParamProgrammaticToolCalling {
3064
+ /**
3065
+ * The type of the object. Always `programmatic_tool_calling`.
3066
+ */
3067
+ type: 'programmatic_tool_calling';
3068
+ /**
3069
+ * Whether tools can be called from model-generated code. Defaults to `true`.
3070
+ */
3071
+ enabled?: boolean;
3072
+ }
3073
+ /**
3074
+ * Tools provided by a remote MCP server without stored credentials.
3075
+ */
3076
+ interface PersistedAgentToolConfigParamMcp {
3077
+ /**
3078
+ * A label used to identify the MCP server in tool calls.
3079
+ */
3080
+ server_label: string;
3081
+ /**
3082
+ * The credential-free transport used to connect to the MCP server.
3083
+ */
3084
+ transport: AgentsAPI.PersistedMcpTransportParam;
3085
+ /**
3086
+ * The type of the object. Always `mcp`.
3087
+ */
3088
+ type: 'mcp';
3089
+ /**
3090
+ * The MCP tools the agent may call. All server tools are allowed when omitted.
3091
+ */
3092
+ allowed_tools?: Array<string> | null;
3093
+ /**
3094
+ * Where outbound MCP HTTP connections originate.
3095
+ *
3096
+ * - `service` - Uses the Managed Agents service network.
3097
+ * - `environment` - Uses the session's execution environment.
3098
+ */
3099
+ connection_origin?: 'service' | 'environment' | null;
3100
+ /**
3101
+ * The vault credential selected for this MCP server. Optional when exactly one
3102
+ * attached credential matches the server URL.
3103
+ */
3104
+ credential_id?: string | null;
3105
+ /**
3106
+ * Metadata included with requests to this MCP server.
3107
+ */
3108
+ request_metadata?: {
3109
+ [key: string]: unknown;
3110
+ } | null;
3111
+ /**
3112
+ * Whether this MCP server must initialize before the first turn. Defaults to
3113
+ * `false`.
3114
+ */
3115
+ required?: boolean;
3116
+ }
3117
+ /**
3118
+ * Web search.
3119
+ */
3120
+ interface PersistedAgentToolConfigParamWebSearch {
3121
+ /**
3122
+ * The type of the object. Always `web_search`.
3123
+ */
3124
+ type: 'web_search';
3125
+ /**
3126
+ * Domains the search may include.
3127
+ */
3128
+ allowed_domains?: Array<string> | null;
3129
+ /**
3130
+ * The amount of web search context made available to the model.
3131
+ */
3132
+ context_size?: 'low' | 'medium' | 'high' | null;
3133
+ /**
3134
+ * Approximate user location used to localize web search results.
3135
+ */
3136
+ location?: PersistedAgentToolConfigParamWebSearch.Location | null;
3137
+ /**
3138
+ * The source used for web search results.
3139
+ *
3140
+ * - `disabled` - Disables web search.
3141
+ * - `cached` - Uses cached search results.
3142
+ * - `live` - Searches the live web.
3143
+ */
3144
+ mode?: 'disabled' | 'cached' | 'live' | null;
3145
+ }
3146
+ namespace PersistedAgentToolConfigParamWebSearch {
3147
+ /**
3148
+ * Approximate user location used to localize web search results.
3149
+ */
3150
+ interface Location {
3151
+ /**
3152
+ * The city name.
3153
+ */
3154
+ city?: string | null;
3155
+ /**
3156
+ * The two-letter ISO country code, such as `US`.
3157
+ */
3158
+ country?: string | null;
3159
+ /**
3160
+ * The region or state name.
3161
+ */
3162
+ region?: string | null;
3163
+ /**
3164
+ * The IANA timezone, such as `America/Los_Angeles`.
3165
+ */
3166
+ timezone?: string | null;
3167
+ }
3168
+ }
3169
+ }
3170
+ /**
3171
+ * A credential-free transport used to connect to an MCP server.
3172
+ */
3173
+ export type PersistedMcpTransport = PersistedMcpTransport.PersistedMcpTransportResourceHTTP | PersistedMcpTransport.PersistedMcpTransportResourceStdio;
3174
+ export declare namespace PersistedMcpTransport {
3175
+ /**
3176
+ * Connects to an MCP server over HTTP.
3177
+ */
3178
+ interface PersistedMcpTransportResourceHTTP {
3179
+ /**
3180
+ * Non-secret HTTP headers sent to the MCP server.
3181
+ */
3182
+ headers: {
3183
+ [key: string]: string;
3184
+ };
3185
+ /**
3186
+ * The URL of the MCP server.
3187
+ */
3188
+ server_url: string;
3189
+ /**
3190
+ * The type of the object. Always `http`.
3191
+ */
3192
+ type: 'http';
3193
+ }
3194
+ /**
3195
+ * Starts an MCP server as a local process.
3196
+ */
3197
+ interface PersistedMcpTransportResourceStdio {
3198
+ /**
3199
+ * Arguments passed to the MCP server command.
3200
+ */
3201
+ args: Array<string>;
3202
+ /**
3203
+ * The command used to start the MCP server.
3204
+ */
3205
+ command: string;
3206
+ /**
3207
+ * The working directory used to start the MCP server.
3208
+ */
3209
+ cwd: string;
3210
+ /**
3211
+ * Environment variable names inherited from the execution environment.
3212
+ */
3213
+ env_vars: Array<string>;
3214
+ /**
3215
+ * The type of the object. Always `stdio`.
3216
+ */
3217
+ type: 'stdio';
3218
+ }
3219
+ }
3220
+ /**
3221
+ * A credential-free transport used to connect to an MCP server.
3222
+ */
3223
+ export type PersistedMcpTransportParam = PersistedMcpTransportParam.PersistedMcpTransportConfigParamHTTP | PersistedMcpTransportParam.PersistedMcpTransportConfigParamStdio;
3224
+ export declare namespace PersistedMcpTransportParam {
3225
+ /**
3226
+ * Connects to an MCP server over HTTP.
3227
+ */
3228
+ interface PersistedMcpTransportConfigParamHTTP {
3229
+ /**
3230
+ * The URL of the MCP server.
3231
+ */
3232
+ server_url: string;
3233
+ /**
3234
+ * The type of the object. Always `http`.
3235
+ */
3236
+ type: 'http';
3237
+ /**
3238
+ * Non-secret HTTP headers sent to the MCP server.
3239
+ */
3240
+ headers?: {
3241
+ [key: string]: string;
3242
+ } | null;
3243
+ }
3244
+ /**
3245
+ * Starts an MCP server as a local process.
3246
+ */
3247
+ interface PersistedMcpTransportConfigParamStdio {
3248
+ /**
3249
+ * The command used to start the MCP server.
3250
+ */
3251
+ command: string;
3252
+ /**
3253
+ * The working directory used to start the MCP server.
3254
+ */
3255
+ cwd: string;
3256
+ /**
3257
+ * The type of the object. Always `stdio`.
3258
+ */
3259
+ type: 'stdio';
3260
+ /**
3261
+ * Arguments passed to the MCP server command.
3262
+ */
3263
+ args?: Array<string> | null;
3264
+ /**
3265
+ * Environment variable names to inherit from the selected execution environment.
3266
+ */
3267
+ env_vars?: Array<string> | null;
3268
+ }
3269
+ }
3270
+ /**
3271
+ * An error payload with the same public fields as Responses API streaming errors.
3272
+ */
3273
+ export interface SessionError {
3274
+ /**
3275
+ * The machine-readable error code, if any.
3276
+ */
3277
+ code: string | null;
3278
+ /**
3279
+ * A customer-safe explanation of the error.
3280
+ */
3281
+ message: string;
3282
+ /**
3283
+ * The request parameter associated with the error, if any.
3284
+ */
3285
+ param: string | null;
3286
+ /**
3287
+ * The error type.
3288
+ */
3289
+ type: string;
3290
+ }
3291
+ /**
3292
+ * A customer-safe error describing why a session request failed.
3293
+ */
3294
+ export interface SessionTurnError {
3295
+ /**
3296
+ * A stable, machine-readable failure category.
3297
+ *
3298
+ * - `context_length_exceeded` - The request exceeds the model's context window.
3299
+ * - `session_budget_exceeded` - The session has reached its usage budget.
3300
+ * - `usage_limit_exceeded` - The organization has reached a usage, plan, or
3301
+ * billing limit.
3302
+ * - `rate_limit_exceeded` - The request exceeds the available rate limit.
3303
+ * - `server_overloaded` - The model service is temporarily overloaded.
3304
+ * - `cyber_policy` - The request was rejected by a safety policy.
3305
+ * - `connection_failed` - The request could not connect to the model service.
3306
+ * - `server_error` - The model service encountered an unexpected error.
3307
+ * - `authentication_error` - The API credentials are invalid or lack the required
3308
+ * access.
3309
+ * - `invalid_request` - The request contains invalid input or configuration.
3310
+ * - `resource_not_found` - The requested model or resource is unavailable.
3311
+ * - `sandbox_error` - The request could not complete in its execution environment.
3312
+ * - `executor_version_incompatible` - The executor must be upgraded before it can
3313
+ * run this turn.
3314
+ * - `active_turn_not_steerable` - The session cannot accept additional input while
3315
+ * a request is running.
3316
+ * - `request_timeout` - The request timed out before the model service responded.
3317
+ * - `internal_error` - An unexpected internal error prevented the session request
3318
+ * from completing.
3319
+ */
3320
+ code: 'context_length_exceeded' | 'session_budget_exceeded' | 'usage_limit_exceeded' | 'rate_limit_exceeded' | 'server_overloaded' | 'cyber_policy' | 'connection_failed' | 'server_error' | 'authentication_error' | 'invalid_request' | 'resource_not_found' | 'sandbox_error' | 'executor_version_incompatible' | 'active_turn_not_steerable' | 'request_timeout' | 'internal_error';
3321
+ /**
3322
+ * A customer-safe explanation of the failure.
3323
+ */
3324
+ message: string;
3325
+ }
3326
+ /**
3327
+ * A confidential setup command executed before the hosted agent starts.
3328
+ */
3329
+ export interface SetupCommandParam {
3330
+ /**
3331
+ * The shell command to execute.
3332
+ */
3333
+ command: string;
3334
+ /**
3335
+ * The absolute working directory. Defaults to `/workspace`.
3336
+ */
3337
+ cwd?: string | null;
3338
+ }
3339
+ /**
3340
+ * A subagent created within a session.
3341
+ */
3342
+ export interface Subagent {
3343
+ /**
3344
+ * The ID of the subagent.
3345
+ */
3346
+ id: string;
3347
+ /**
3348
+ * The Unix timestamp, in seconds, when the subagent was closed. Null while active,
3349
+ * including after resume.
3350
+ */
3351
+ closed_at: number | null;
3352
+ /**
3353
+ * Initial task content, or null when unavailable. Text may contain placeholders
3354
+ * for images or audio when only a preview is available.
3355
+ */
3356
+ instructions: Array<AgentContent> | null;
3357
+ /**
3358
+ * The runner-assigned nickname, or null when unavailable.
3359
+ */
3360
+ name: string | null;
3361
+ /**
3362
+ * The object type. Always `agent.session.subagent`.
3363
+ */
3364
+ object: 'agent.session.subagent';
3365
+ /**
3366
+ * The Unix timestamp, in seconds, when the subagent was first opened. Resuming
3367
+ * does not change it.
3368
+ */
3369
+ opened_at: number;
3370
+ /**
3371
+ * The ID of the agent that created this subagent.
3372
+ */
3373
+ parent_agent_id: string;
3374
+ /**
3375
+ * The ID of the session that owns the subagent.
3376
+ */
3377
+ session_id: string;
3378
+ /**
3379
+ * The current status of the subagent.
3380
+ *
3381
+ * - `active` - The subagent remains available, including while idle between turns.
3382
+ * - `closed` - The subagent is closed.
3383
+ */
3384
+ status: 'active' | 'closed';
3385
+ }
3386
+ /**
3387
+ * A reasoning summary content part.
3388
+ */
3389
+ export interface SummaryText {
3390
+ /**
3391
+ * The reasoning summary text.
3392
+ */
3393
+ text: string;
3394
+ /**
3395
+ * The content type. Always `summary_text`.
3396
+ */
3397
+ type: 'summary_text';
3398
+ }
3399
+ /**
3400
+ * The effective output format for generated text.
3401
+ */
3402
+ export type TextFormat = TextFormat.TextFormatResourceText | TextFormat.TextFormatResourceJSONSchema;
3403
+ export declare namespace TextFormat {
3404
+ /**
3405
+ * Generates ordinary text without a structured-output constraint.
3406
+ */
3407
+ interface TextFormatResourceText {
3408
+ /**
3409
+ * The type of the object. Always `text`.
3410
+ */
3411
+ type: 'text';
3412
+ }
3413
+ /**
3414
+ * Constrains generated text to a JSON Schema.
3415
+ */
3416
+ interface TextFormatResourceJSONSchema {
3417
+ /**
3418
+ * The JSON Schema that generated text must match.
3419
+ */
3420
+ schema: {
3421
+ [key: string]: unknown;
3422
+ };
3423
+ /**
3424
+ * The type of the object. Always `json_schema`.
3425
+ */
3426
+ type: 'json_schema';
3427
+ }
3428
+ }
3429
+ /**
3430
+ * The output format for generated text.
3431
+ */
3432
+ export type TextFormatParam = TextFormatParam.TextFormatParamText | TextFormatParam.TextFormatParamJSONSchema;
3433
+ export declare namespace TextFormatParam {
3434
+ /**
3435
+ * Generates ordinary text without a structured-output constraint.
3436
+ */
3437
+ interface TextFormatParamText {
3438
+ /**
3439
+ * The type of the object. Always `text`.
3440
+ */
3441
+ type: 'text';
3442
+ }
3443
+ /**
3444
+ * Constrains generated text to a JSON Schema.
3445
+ */
3446
+ interface TextFormatParamJSONSchema {
3447
+ /**
3448
+ * The JSON Schema that generated text must match.
3449
+ */
3450
+ schema: {
3451
+ [key: string]: unknown;
3452
+ };
3453
+ /**
3454
+ * The type of the object. Always `json_schema`.
3455
+ */
3456
+ type: 'json_schema';
3457
+ }
3458
+ }
3459
+ /**
3460
+ * Recorded token usage for a session or turn. Usage is best effort and may change.
3461
+ */
3462
+ export interface TokenUsage {
3463
+ /**
3464
+ * The number of input tokens used by the agent.
3465
+ */
3466
+ input_tokens: number;
3467
+ /**
3468
+ * A breakdown of the agent's input token usage.
3469
+ */
3470
+ input_tokens_details: TokenUsage.InputTokensDetails;
3471
+ /**
3472
+ * The number of output tokens generated by the agent.
3473
+ */
3474
+ output_tokens: number;
3475
+ /**
3476
+ * A breakdown of the agent's output token usage.
3477
+ */
3478
+ output_tokens_details: TokenUsage.OutputTokensDetails;
3479
+ /**
3480
+ * The total number of input and output tokens used by the agent.
3481
+ */
3482
+ total_tokens: number;
3483
+ }
3484
+ export declare namespace TokenUsage {
3485
+ /**
3486
+ * A breakdown of the agent's input token usage.
3487
+ */
3488
+ interface InputTokensDetails {
3489
+ /**
3490
+ * The number of input tokens retrieved from the prompt cache.
3491
+ */
3492
+ cached_tokens: number;
3493
+ }
3494
+ /**
3495
+ * A breakdown of the agent's output token usage.
3496
+ */
3497
+ interface OutputTokensDetails {
3498
+ /**
3499
+ * The number of output tokens used for reasoning.
3500
+ */
3501
+ reasoning_tokens: number;
3502
+ }
3503
+ }
3504
+ /**
3505
+ * An action performed by the web search tool.
3506
+ */
3507
+ export type WebSearchAction = WebSearchAction.WebSearchActionResourceSearch | WebSearchAction.WebSearchActionResourceOpenPage | WebSearchAction.WebSearchActionResourceFindInPage | WebSearchAction.WebSearchActionResourceOther;
3508
+ export declare namespace WebSearchAction {
3509
+ /**
3510
+ * A search query or group of search queries.
3511
+ */
3512
+ interface WebSearchActionResourceSearch {
3513
+ /**
3514
+ * The search queries, when multiple queries were used.
3515
+ */
3516
+ queries: Array<string> | null;
3517
+ /**
3518
+ * The search query, when a single query was used.
3519
+ */
3520
+ query: string | null;
3521
+ /**
3522
+ * The type of the object. Always `search`.
3523
+ */
3524
+ type: 'search';
3525
+ }
3526
+ /**
3527
+ * Opens a web page.
3528
+ */
3529
+ interface WebSearchActionResourceOpenPage {
3530
+ /**
3531
+ * The type of the object. Always `open_page`.
3532
+ */
3533
+ type: 'open_page';
3534
+ /**
3535
+ * The URL of the page that was opened.
3536
+ */
3537
+ url: string | null;
3538
+ }
3539
+ /**
3540
+ * Finds text within a web page.
3541
+ */
3542
+ interface WebSearchActionResourceFindInPage {
3543
+ /**
3544
+ * The text pattern that was searched for.
3545
+ */
3546
+ pattern: string | null;
3547
+ /**
3548
+ * The type of the object. Always `find_in_page`.
3549
+ */
3550
+ type: 'find_in_page';
3551
+ /**
3552
+ * The URL of the page that was searched.
3553
+ */
3554
+ url: string | null;
3555
+ }
3556
+ /**
3557
+ * Another web search action.
3558
+ */
3559
+ interface WebSearchActionResourceOther {
3560
+ /**
3561
+ * The type of the object. Always `other`.
3562
+ */
3563
+ type: 'other';
3564
+ }
3565
+ }
3566
+ export interface AgentCreateParams {
3567
+ /**
3568
+ * The model to use for the agent. The requested model name is preserved.
3569
+ */
3570
+ model: string;
3571
+ /**
3572
+ * Additional instructions appended to the agent's default base instructions. Omit
3573
+ * or set to null to add no custom instructions.
3574
+ */
3575
+ instructions?: string | null;
3576
+ /**
3577
+ * Up to 16 string key-value pairs, with keys up to 64 and values up to 512
3578
+ * characters. Omission or null defaults to an empty map.
3579
+ */
3580
+ metadata?: {
3581
+ [key: string]: string;
3582
+ } | null;
3583
+ /**
3584
+ * Explicit configuration for creating and coordinating subagents.
3585
+ */
3586
+ multi_agent?: MultiAgentConfigParam | null;
3587
+ /**
3588
+ * A human-readable name for the agent. Omission or null leaves the agent unnamed.
3589
+ */
3590
+ name?: string | null;
3591
+ /**
3592
+ * Reasoning configuration for the agent.
3593
+ */
3594
+ reasoning?: AgentReasoningParam | null;
3595
+ /**
3596
+ * The service tier used for model requests.
3597
+ *
3598
+ * - `auto` - Selects the service tier automatically.
3599
+ * - `default` - Uses the default service tier.
3600
+ * - `flex` - Uses the flex service tier.
3601
+ * - `priority` - Uses the priority service tier.
3602
+ * - `fast` - Uses the fast service tier.
3603
+ */
3604
+ service_tier?: 'auto' | 'default' | 'flex' | 'priority' | 'fast' | null;
3605
+ /**
3606
+ * Configuration for text generated by the agent.
3607
+ */
3608
+ text?: AgentTextParam | null;
3609
+ /**
3610
+ * Tools available to the agent. Defaults to an empty list.
3611
+ */
3612
+ tools?: Array<PersistedAgentToolParam> | null;
3613
+ }
3614
+ export interface AgentUpdateParams {
3615
+ /**
3616
+ * Additional instructions appended to the agent's default base instructions. Omit
3617
+ * to leave unchanged.
3618
+ */
3619
+ instructions?: string | null;
3620
+ /**
3621
+ * Replaces all metadata. Omit to leave unchanged, or pass null or {} to clear it.
3622
+ * Up to 16 string key-value pairs, with keys up to 64 and values up to 512
3623
+ * characters.
3624
+ */
3625
+ metadata?: {
3626
+ [key: string]: string;
3627
+ } | null;
3628
+ /**
3629
+ * The model to use for the agent. The requested model name is preserved.
3630
+ */
3631
+ model?: string;
3632
+ /**
3633
+ * Explicit configuration for creating and coordinating subagents.
3634
+ */
3635
+ multi_agent?: MultiAgentConfigParam | null;
3636
+ /**
3637
+ * A replacement name. Omit to leave unchanged, or pass null to clear it.
3638
+ */
3639
+ name?: string | null;
3640
+ /**
3641
+ * Reasoning configuration for the agent.
3642
+ */
3643
+ reasoning?: AgentReasoningParam | null;
3644
+ /**
3645
+ * The service tier used for model requests.
3646
+ *
3647
+ * - `auto` - Selects the service tier automatically.
3648
+ * - `default` - Uses the default service tier.
3649
+ * - `flex` - Uses the flex service tier.
3650
+ * - `priority` - Uses the priority service tier.
3651
+ * - `fast` - Uses the fast service tier.
3652
+ */
3653
+ service_tier?: 'auto' | 'default' | 'flex' | 'priority' | 'fast' | null;
3654
+ /**
3655
+ * Configuration for text generated by the agent.
3656
+ */
3657
+ text?: AgentTextParam | null;
3658
+ /**
3659
+ * Tools available to the agent.
3660
+ */
3661
+ tools?: Array<PersistedAgentToolParam> | null;
3662
+ }
3663
+ export interface AgentListParams extends CursorPageParams {
3664
+ /**
3665
+ * The order in which resources are returned. Defaults to `desc`.
3666
+ *
3667
+ * - `asc` - Returns resources in ascending order.
3668
+ * - `desc` - Returns resources in descending order.
3669
+ */
3670
+ order?: 'asc' | 'desc';
3671
+ }
3672
+ export declare namespace Agents {
3673
+ export { type Agent as Agent, type AgentCloseSubagentCallItem as AgentCloseSubagentCallItem, type AgentCommandExecutionItem as AgentCommandExecutionItem, type AgentContent as AgentContent, type AgentCreateSubagentCallItem as AgentCreateSubagentCallItem, type AgentDeleted as AgentDeleted, type AgentFunctionCallItem as AgentFunctionCallItem, type AgentFunctionCallOutput as AgentFunctionCallOutput, type AgentFunctionCallOutputParam as AgentFunctionCallOutputParam, type AgentFunctionCallStatus as AgentFunctionCallStatus, type AgentInterruptSubagentCallItem as AgentInterruptSubagentCallItem, type AgentMcpCallItem as AgentMcpCallItem, type AgentOutputCommandExecutionOutputDeltaEvent as AgentOutputCommandExecutionOutputDeltaEvent, type AgentOutputItem as AgentOutputItem, type AgentOutputItemStatus as AgentOutputItemStatus, type AgentReasoning as AgentReasoning, type AgentReasoningItem as AgentReasoningItem, type AgentReasoningParam as AgentReasoningParam, type AgentResumeSubagentCallItem as AgentResumeSubagentCallItem, type AgentSendSubagentInputCallItem as AgentSendSubagentInputCallItem, type AgentSession as AgentSession, type AgentSessionAssistantMessage as AgentSessionAssistantMessage, type AgentSessionCreatedEvent as AgentSessionCreatedEvent, type AgentSessionDeleted as AgentSessionDeleted, type AgentSessionEnvironmentConnectedEvent as AgentSessionEnvironmentConnectedEvent, type AgentSessionEnvironmentDisconnectedEvent as AgentSessionEnvironmentDisconnectedEvent, type AgentSessionEnvironmentFailedEvent as AgentSessionEnvironmentFailedEvent, type AgentSessionEnvironmentPendingEvent as AgentSessionEnvironmentPendingEvent, type AgentSessionEnvironmentReadyEvent as AgentSessionEnvironmentReadyEvent, type AgentSessionEnvironmentState as AgentSessionEnvironmentState, type AgentSessionErrorEvent as AgentSessionErrorEvent, type AgentSessionEvent as AgentSessionEvent, type AgentSessionFailedEvent as AgentSessionFailedEvent, type AgentSessionIdleEvent as AgentSessionIdleEvent, type AgentSessionInProgressEvent as AgentSessionInProgressEvent, type AgentSessionInputMessageParam as AgentSessionInputMessageParam, type AgentSessionInputParam as AgentSessionInputParam, type AgentSessionItem as AgentSessionItem, type AgentSessionMessage as AgentSessionMessage, type AgentSessionMessageContent as AgentSessionMessageContent, type AgentSessionRequiresActionEvent as AgentSessionRequiresActionEvent, type AgentSessionSubagentActiveEvent as AgentSessionSubagentActiveEvent, type AgentSessionSubagentClosedEvent as AgentSessionSubagentClosedEvent, type AgentSessionSubagentCreatedEvent as AgentSessionSubagentCreatedEvent, type AgentSessionTurnCancelledEvent as AgentSessionTurnCancelledEvent, type AgentSessionTurnCompletedEvent as AgentSessionTurnCompletedEvent, type AgentSessionTurnContentPartAddedEvent as AgentSessionTurnContentPartAddedEvent, type AgentSessionTurnContentPartDoneEvent as AgentSessionTurnContentPartDoneEvent, type AgentSessionTurnCreatedEvent as AgentSessionTurnCreatedEvent, type AgentSessionTurnFailedEvent as AgentSessionTurnFailedEvent, type AgentSessionTurnInProgressEvent as AgentSessionTurnInProgressEvent, type AgentSessionTurnItemAddedEvent as AgentSessionTurnItemAddedEvent, type AgentSessionTurnItemDoneEvent as AgentSessionTurnItemDoneEvent, type AgentSessionTurnOutputTextDeltaEvent as AgentSessionTurnOutputTextDeltaEvent, type AgentSessionTurnOutputTextDoneEvent as AgentSessionTurnOutputTextDoneEvent, type AgentSessionTurnReasoningSummaryPartAddedEvent as AgentSessionTurnReasoningSummaryPartAddedEvent, type AgentSessionTurnReasoningSummaryPartDoneEvent as AgentSessionTurnReasoningSummaryPartDoneEvent, type AgentSessionTurnReasoningSummaryTextDeltaEvent as AgentSessionTurnReasoningSummaryTextDeltaEvent, type AgentSessionTurnReasoningSummaryTextDoneEvent as AgentSessionTurnReasoningSummaryTextDoneEvent, type AgentText as AgentText, type AgentTextParam as AgentTextParam, type AgentTool as AgentTool, type AgentToolParam as AgentToolParam, type AgentWaitForSubagentsCallItem as AgentWaitForSubagentsCallItem, type AgentWebSearchCallItem as AgentWebSearchCallItem, type Environment as Environment, type EnvironmentParam as EnvironmentParam, type HostedEnvironmentFile as HostedEnvironmentFile, type HostedEnvironmentFileID as HostedEnvironmentFileID, type HostedEnvironmentFileParam as HostedEnvironmentFileParam, type HostedPlugin as HostedPlugin, type HostedPluginParam as HostedPluginParam, type HostedSkill as HostedSkill, type HostedSkillParam as HostedSkillParam, type HostedSkillReference as HostedSkillReference, type InlineCapabilitySourceParam as InlineCapabilitySourceParam, type InputContent as InputContent, type InputContentParam as InputContentParam, type McpTransport as McpTransport, type McpTransportParam as McpTransportParam, type MultiAgentConfig as MultiAgentConfig, type MultiAgentConfigParam as MultiAgentConfigParam, type OutputText as OutputText, type PersistedAgentTool as PersistedAgentTool, type PersistedAgentToolParam as PersistedAgentToolParam, type PersistedMcpTransport as PersistedMcpTransport, type PersistedMcpTransportParam as PersistedMcpTransportParam, type SessionError as SessionError, type SessionTurnError as SessionTurnError, type SetupCommandParam as SetupCommandParam, type Subagent as Subagent, type SummaryText as SummaryText, type TextFormat as TextFormat, type TextFormatParam as TextFormatParam, type TokenUsage as TokenUsage, type WebSearchAction as WebSearchAction, type AgentsPage as AgentsPage, type AgentCreateParams as AgentCreateParams, type AgentUpdateParams as AgentUpdateParams, type AgentListParams as AgentListParams, };
3674
+ export { Environments as Environments, type EnvironmentInfo as EnvironmentInfo };
3675
+ export { Vaults as Vaults, type Vault as Vault, type VaultDeleted as VaultDeleted, type VaultStatus as VaultStatus, type VaultStatusFilter as VaultStatusFilter, type VaultsPage as VaultsPage, type VaultCreateParams as VaultCreateParams, type VaultListParams as VaultListParams, };
3676
+ export { Sessions as Sessions, type SessionCreateParams as SessionCreateParams, type SessionCreateParamsNonStreaming as SessionCreateParamsNonStreaming, type SessionCreateParamsStreaming as SessionCreateParamsStreaming, type SessionUpdateParams as SessionUpdateParams, type SessionListParams as SessionListParams, };
3677
+ }
3678
+ //# sourceMappingURL=agents.d.mts.map