agents 0.26.0 → 0.28.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 (301) hide show
  1. package/README.md +8 -9
  2. package/dist/abortable-C1SpfVoi.js +21 -0
  3. package/dist/abortable-C1SpfVoi.js.map +1 -0
  4. package/dist/{agent-routing-0DR0Tk2v.d.ts → agent-routing-QDcchcQP.d.ts} +16 -16
  5. package/dist/agent-routing.d.ts +1 -1
  6. package/dist/agent-tool-types.d.ts +1 -1
  7. package/dist/{agent-tools-YrATZJu2.d.ts → agent-tools-DHL2XI7u.d.ts} +2 -2
  8. package/dist/agent-tools.d.ts +1 -1
  9. package/dist/ai-ahruGw7e.d.ts +239 -0
  10. package/dist/ai-sdk-Bdsf6mSA.js +2444 -0
  11. package/dist/ai-sdk-Bdsf6mSA.js.map +1 -0
  12. package/dist/apply-chunks-1FheRb9W.js +99 -0
  13. package/dist/apply-chunks-1FheRb9W.js.map +1 -0
  14. package/dist/broadcast-state-CEyI4uAK.js +69 -0
  15. package/dist/broadcast-state-CEyI4uAK.js.map +1 -0
  16. package/dist/browser/ai.d.ts +8 -227
  17. package/dist/browser/ai.js +259 -1
  18. package/dist/browser/ai.js.map +1 -0
  19. package/dist/browser/index.d.ts +56 -46
  20. package/dist/browser/index.js +4 -361
  21. package/dist/browser/{ai-sdk.d.ts → tools/ai-sdk.d.ts} +7 -7
  22. package/dist/browser/{ai-sdk.js → tools/ai-sdk.js} +6 -5
  23. package/dist/browser/tools/ai-sdk.js.map +1 -0
  24. package/dist/browser/tools/pi.d.ts +111 -0
  25. package/dist/browser/tools/pi.js +119 -0
  26. package/dist/browser/tools/pi.js.map +1 -0
  27. package/dist/browser/{tanstack-ai.d.ts → tools/tanstack-ai.d.ts} +39 -37
  28. package/dist/browser/{tanstack-ai.js → tools/tanstack-ai.js} +73 -59
  29. package/dist/browser/tools/tanstack-ai.js.map +1 -0
  30. package/dist/browser-CEdNlsaD.js +481 -0
  31. package/dist/browser-CEdNlsaD.js.map +1 -0
  32. package/dist/{browser-DE3d-RLk.d.ts → browser-D30VlpcA.d.ts} +63 -37
  33. package/dist/{browser-tool-CQ10e6Kj.js → browser-tool-4iomavs_.js} +198 -62
  34. package/dist/browser-tool-4iomavs_.js.map +1 -0
  35. package/dist/{browser-tool-DuNdlwZ9.d.ts → browser-tool-vtrPOV8e.d.ts} +25 -6
  36. package/dist/{capability-B4WbF81e.js → capability-DBAKc6UZ.js} +1 -3
  37. package/dist/capability-DBAKc6UZ.js.map +1 -0
  38. package/dist/{capability-runner-DBAnGr6L.d.ts → capability-runner-BiVUtjqC.d.ts} +9 -7
  39. package/dist/channel-Bak_6zDP.d.ts +333 -0
  40. package/dist/chat/index.d.ts +11 -9
  41. package/dist/chat/index.js +5 -194
  42. package/dist/chat/index.js.map +1 -1
  43. package/dist/chat/react.d.ts +2 -4
  44. package/dist/chat/react.js +3 -1
  45. package/dist/chat/react.js.map +1 -1
  46. package/dist/chat-sdk/index.d.ts +1 -1
  47. package/dist/chat-sdk/index.js +1 -1
  48. package/dist/cli.js +144 -0
  49. package/dist/{client-je3koD9Z.d.ts → client-BGIQKJhX.d.ts} +2 -2
  50. package/dist/{client-fyQrLGkD.js → client-BnYbNT3z.js} +29 -5
  51. package/dist/client-BnYbNT3z.js.map +1 -0
  52. package/dist/client-tools-aIBO0Fk7.d.ts +53 -0
  53. package/dist/client.d.ts +1 -1
  54. package/dist/{connector-58XDGvc3.js → connector-CtZylXdk.js} +3 -603
  55. package/dist/connector-CtZylXdk.js.map +1 -0
  56. package/dist/{connector-Cl-VqPmA.d.ts → connector-DEXzVoaY.d.ts} +9 -374
  57. package/dist/conversations-FjHDRZyD.d.ts +192 -0
  58. package/dist/{current-agent-vAk_5JMt.d.ts → current-agent-CKgT5d1O.d.ts} +3 -5
  59. package/dist/current-agent-DhoDkSnH.js.map +1 -1
  60. package/dist/daemon-core-Buubj-y1.js +481 -0
  61. package/dist/daemon-core-Buubj-y1.js.map +1 -0
  62. package/dist/daemon-core-CbohVPAu.d.ts +132 -0
  63. package/dist/{do-oauth-client-provider-Tmf1vgKz.d.ts → do-oauth-client-provider-DfsUcpc3.d.ts} +7 -1
  64. package/dist/{durable-object-lifecycle-HhgOMWq9.d.ts → durable-object-lifecycle-DOI_bzCH.d.ts} +2 -2
  65. package/dist/{channels/email.d.ts → experimental/channels/email/index.d.ts} +25 -12
  66. package/dist/{channels/email.js → experimental/channels/email/index.js} +13 -35
  67. package/dist/experimental/channels/email/index.js.map +1 -0
  68. package/dist/experimental/channels/index.d.ts +270 -0
  69. package/dist/experimental/channels/index.js +1186 -0
  70. package/dist/experimental/channels/index.js.map +1 -0
  71. package/dist/{channels/slack.d.ts → experimental/channels/slack/index.d.ts} +19 -9
  72. package/dist/experimental/channels/slack/index.js +267 -0
  73. package/dist/experimental/channels/slack/index.js.map +1 -0
  74. package/dist/{channels/telegram.d.ts → experimental/channels/telegram/index.d.ts} +19 -9
  75. package/dist/experimental/channels/telegram/index.js +198 -0
  76. package/dist/experimental/channels/telegram/index.js.map +1 -0
  77. package/dist/experimental/channels/web/ai-sdk.d.ts +55 -0
  78. package/dist/experimental/channels/web/ai-sdk.js +266 -0
  79. package/dist/experimental/channels/web/ai-sdk.js.map +1 -0
  80. package/dist/experimental/channels/web/client.d.ts +97 -0
  81. package/dist/experimental/channels/web/client.js +349 -0
  82. package/dist/experimental/channels/web/client.js.map +1 -0
  83. package/dist/experimental/channels/web/index.d.ts +189 -0
  84. package/dist/experimental/channels/web/index.js +332 -0
  85. package/dist/experimental/channels/web/index.js.map +1 -0
  86. package/dist/gateway-BFO6vRDn.d.ts +100 -0
  87. package/dist/handle-zAzh0UW2.d.ts +460 -0
  88. package/dist/harness/ai-sdk/index.d.ts +175 -0
  89. package/dist/harness/ai-sdk/index.js +605 -0
  90. package/dist/harness/ai-sdk/index.js.map +1 -0
  91. package/dist/harness/container/daemon/index.d.ts +76 -0
  92. package/dist/harness/container/daemon/index.js +3 -0
  93. package/dist/harness/container/index.d.ts +740 -0
  94. package/dist/harness/container/index.js +2152 -0
  95. package/dist/harness/container/index.js.map +1 -0
  96. package/dist/harness/container/runtime/index.d.ts +144 -0
  97. package/dist/harness/container/runtime/index.js +1082 -0
  98. package/dist/harness/container/runtime/index.js.map +1 -0
  99. package/dist/harness/opencode/index.d.ts +369 -0
  100. package/dist/harness/opencode/index.js +1072 -0
  101. package/dist/harness/opencode/index.js.map +1 -0
  102. package/dist/harness/pi/index.d.ts +3 -2
  103. package/dist/harness/pi/index.js +3 -3
  104. package/dist/harness/store/index.d.ts +24 -0
  105. package/dist/harness/store/index.js +2 -0
  106. package/dist/harness/think/index.d.ts +821 -0
  107. package/dist/harness/think/index.js +2721 -0
  108. package/dist/harness/think/index.js.map +1 -0
  109. package/dist/harness-B6B9S3rb.d.ts +203 -0
  110. package/dist/{images-iiTDSyRu.js → images-Ce9SCu3X.js} +2 -248
  111. package/dist/images-Ce9SCu3X.js.map +1 -0
  112. package/dist/{index-BreL0YrQ.d.ts → index-BEL3ZV-s.d.ts} +2 -6
  113. package/dist/index-CBt8oRJt.d.ts +198 -0
  114. package/dist/index.d.ts +5 -5
  115. package/dist/index.js +2 -2
  116. package/dist/ingress-EFbrS547.js +9 -0
  117. package/dist/ingress-EFbrS547.js.map +1 -0
  118. package/dist/input-schema-BQykTEp_.js +20 -0
  119. package/dist/input-schema-BQykTEp_.js.map +1 -0
  120. package/dist/input-schema-D2QAtHZH.js +23 -0
  121. package/dist/input-schema-D2QAtHZH.js.map +1 -0
  122. package/dist/internal-kmw70xwR.js +46 -0
  123. package/dist/internal-kmw70xwR.js.map +1 -0
  124. package/dist/internal_context.d.ts +1 -1
  125. package/dist/lifecycle/index.d.ts +3 -3
  126. package/dist/lifecycle/index.js +2 -2
  127. package/dist/{lifecycle-CFu6OV03.js → lifecycle-DGorpAmA.js} +2 -4
  128. package/dist/lifecycle-DGorpAmA.js.map +1 -0
  129. package/dist/mcp/client/do-oauth-client-provider.d.ts +1 -1
  130. package/dist/mcp/client/do-oauth-client-provider.js +9 -0
  131. package/dist/mcp/client/do-oauth-client-provider.js.map +1 -1
  132. package/dist/mcp/client/index.d.ts +1 -1
  133. package/dist/mcp/client/index.js +1 -1
  134. package/dist/mcp/client/x402.d.ts +35 -4
  135. package/dist/mcp/client/x402.js +24 -3
  136. package/dist/mcp/client/x402.js.map +1 -1
  137. package/dist/mcp/index.d.ts +1 -1
  138. package/dist/mcp/index.js +2 -2
  139. package/dist/models/ai-sdk/index.d.ts +16 -14
  140. package/dist/models/ai-sdk/index.js +1 -2442
  141. package/dist/models/opencode/index.d.ts +65 -0
  142. package/dist/models/opencode/index.js +285 -0
  143. package/dist/models/opencode/index.js.map +1 -0
  144. package/dist/models/pi-ai/index.d.ts +9 -7
  145. package/dist/models/pi-ai/index.js +2 -1
  146. package/dist/models/pi-ai/index.js.map +1 -1
  147. package/dist/options-CiIsJHXR.d.ts +130 -0
  148. package/dist/protocol-BEgrJYC5.d.ts +331 -0
  149. package/dist/protocol-CukuI73M.d.ts +386 -0
  150. package/dist/protocol-cOklVBBD.js +227 -0
  151. package/dist/protocol-cOklVBBD.js.map +1 -0
  152. package/dist/{protocol-kHsr-f0X.js → protocol-eXeJxhgu.js} +2 -67
  153. package/dist/protocol-eXeJxhgu.js.map +1 -0
  154. package/dist/protocol-y2sSY584.js +148 -0
  155. package/dist/protocol-y2sSY584.js.map +1 -0
  156. package/dist/queue/index.d.ts +1 -1
  157. package/dist/queue/index.js +1 -1
  158. package/dist/{queue-BB-zfIYF.js → queue-CcIjVYTE.js} +2 -2
  159. package/dist/{queue-BB-zfIYF.js.map → queue-CcIjVYTE.js.map} +1 -1
  160. package/dist/react.d.ts +2 -2
  161. package/dist/routing/index.d.ts +2 -2
  162. package/dist/routing/index.js +1 -1
  163. package/dist/{scheduler-RdACNXDP.d.ts → scheduler-BCLESHSC.d.ts} +2 -12
  164. package/dist/{scheduler-DZ3xQfeK.js → scheduler-FIHv2-kJ.js} +2 -4
  165. package/dist/scheduler-FIHv2-kJ.js.map +1 -0
  166. package/dist/schedules/index.d.ts +1 -1
  167. package/dist/schedules/index.js +1 -1
  168. package/dist/serializable.d.ts +1 -1
  169. package/dist/session-store-Do4xkDcf.js +606 -0
  170. package/dist/session-store-Do4xkDcf.js.map +1 -0
  171. package/dist/session-store-DoPY12xM.d.ts +383 -0
  172. package/dist/sessions/index.d.ts +11 -434
  173. package/dist/sessions/index.js +1 -2271
  174. package/dist/sessions-_vN5BEZX.js +2272 -0
  175. package/dist/sessions-_vN5BEZX.js.map +1 -0
  176. package/dist/settings-C45hDliX.js +253 -0
  177. package/dist/settings-C45hDliX.js.map +1 -0
  178. package/dist/{transport-PfFnt-Ld.d.ts → settings-NgGwF7Qt.d.ts} +14 -208
  179. package/dist/{src-BZeu-SCD.js → src-CQxJFv4l.js} +8 -8
  180. package/dist/src-CQxJFv4l.js.map +1 -0
  181. package/dist/stall-watchdog-BpRF2uwG.js +195 -0
  182. package/dist/stall-watchdog-BpRF2uwG.js.map +1 -0
  183. package/dist/state/index.d.ts +1 -1
  184. package/dist/state/index.js +1 -3
  185. package/dist/state/index.js.map +1 -1
  186. package/dist/store-BKM4Xm9M.d.ts +332 -0
  187. package/dist/store-CslVzfN7.js +458 -0
  188. package/dist/store-CslVzfN7.js.map +1 -0
  189. package/dist/streams/index.d.ts +1 -1
  190. package/dist/streams/index.js +1 -1
  191. package/dist/{streams-DW-UCOUc.js → streams-lsHMJhRW.js} +17 -4
  192. package/dist/streams-lsHMJhRW.js.map +1 -0
  193. package/dist/{streams-Cmkj9QfW.d.ts → streams-vrCtbUIn.d.ts} +2 -2
  194. package/dist/sub-routing.d.ts +1 -1
  195. package/dist/tasks/index.d.ts +1 -1
  196. package/dist/tasks/index.js +1 -1
  197. package/dist/{tasks-68DESxf0.js → tasks-BN_5AWqI.js} +3 -2
  198. package/dist/tasks-BN_5AWqI.js.map +1 -0
  199. package/dist/{tasks-9YxYtByh.d.ts → tasks-E89KdwkS.d.ts} +2 -2
  200. package/dist/tool-CTp72Jb_.d.ts +278 -0
  201. package/dist/tool-CxKsvxjm.js +1126 -0
  202. package/dist/tool-CxKsvxjm.js.map +1 -0
  203. package/dist/tool-DoVberpN.d.ts +301 -0
  204. package/dist/tool-cQRkwSZZ.js +410 -0
  205. package/dist/tool-cQRkwSZZ.js.map +1 -0
  206. package/dist/tool-helpers-O5BDVEAY.js +58 -0
  207. package/dist/tool-helpers-O5BDVEAY.js.map +1 -0
  208. package/dist/transport-k2mFrtL8.d.ts +200 -0
  209. package/dist/turns-DCV3ycDl.js +317 -0
  210. package/dist/turns-DCV3ycDl.js.map +1 -0
  211. package/dist/voice/client.js +1 -1
  212. package/dist/voice/index.d.ts +2 -2
  213. package/dist/voice/index.js +1 -1
  214. package/dist/web/fetch/index.d.ts +89 -0
  215. package/dist/web/fetch/index.js +20 -0
  216. package/dist/web/fetch/index.js.map +1 -0
  217. package/dist/web/fetch/tools/ai-sdk.d.ts +80 -0
  218. package/dist/web/fetch/tools/ai-sdk.js +47 -0
  219. package/dist/web/fetch/tools/ai-sdk.js.map +1 -0
  220. package/dist/web/fetch/tools/pi.d.ts +84 -0
  221. package/dist/web/fetch/tools/pi.js +88 -0
  222. package/dist/web/fetch/tools/pi.js.map +1 -0
  223. package/dist/web/fetch/tools/tanstack-ai.d.ts +78 -0
  224. package/dist/web/fetch/tools/tanstack-ai.js +45 -0
  225. package/dist/web/fetch/tools/tanstack-ai.js.map +1 -0
  226. package/dist/web/search/index.d.ts +58 -0
  227. package/dist/web/search/index.js +2 -0
  228. package/dist/web/search/tools/ai-sdk.d.ts +77 -0
  229. package/dist/web/search/tools/ai-sdk.js +46 -0
  230. package/dist/web/search/tools/ai-sdk.js.map +1 -0
  231. package/dist/web/search/tools/pi.d.ts +82 -0
  232. package/dist/web/search/tools/pi.js +89 -0
  233. package/dist/web/search/tools/pi.js.map +1 -0
  234. package/dist/web/search/tools/tanstack-ai.d.ts +71 -0
  235. package/dist/web/search/tools/tanstack-ai.js +46 -0
  236. package/dist/web/search/tools/tanstack-ai.js.map +1 -0
  237. package/dist/websockets/index.d.ts +12 -296
  238. package/dist/websockets/index.js +1 -1
  239. package/dist/{websockets-Ci-LZFHH.js → websockets-C3zy8YR0.js} +20 -8
  240. package/dist/websockets-C3zy8YR0.js.map +1 -0
  241. package/dist/{wire-types-CrjKvDyi.d.ts → wire-types-Cv0iwjk5.d.ts} +3 -51
  242. package/dist/workflow-types.d.ts +1 -1
  243. package/dist/workflows.d.ts +1 -1
  244. package/dist/workflows.js +1 -1
  245. package/docs/browse-the-web.md +29 -1
  246. package/docs/fetch-the-web.md +276 -0
  247. package/docs/harnesses/pi.md +25 -0
  248. package/docs/harnesses/think.md +215 -0
  249. package/docs/index.md +99 -75
  250. package/docs/lifecycle.md +42 -3
  251. package/docs/queue.md +2 -3
  252. package/docs/scheduling.md +2 -6
  253. package/docs/search-the-web.md +135 -0
  254. package/package.json +148 -44
  255. package/dist/ai-fm7xx1BK.js +0 -312
  256. package/dist/ai-fm7xx1BK.js.map +0 -1
  257. package/dist/browser/ai-sdk.js.map +0 -1
  258. package/dist/browser/index.js.map +0 -1
  259. package/dist/browser/tanstack-ai.js.map +0 -1
  260. package/dist/browser-tool-CQ10e6Kj.js.map +0 -1
  261. package/dist/capability-B4WbF81e.js.map +0 -1
  262. package/dist/channel-Bnm4S7T2.d.ts +0 -491
  263. package/dist/channels/ai-sdk.d.ts +0 -46
  264. package/dist/channels/ai-sdk.js +0 -120
  265. package/dist/channels/ai-sdk.js.map +0 -1
  266. package/dist/channels/email.js.map +0 -1
  267. package/dist/channels/index.d.ts +0 -233
  268. package/dist/channels/index.js +0 -608
  269. package/dist/channels/index.js.map +0 -1
  270. package/dist/channels/slack.js +0 -614
  271. package/dist/channels/slack.js.map +0 -1
  272. package/dist/channels/tanstack-ai.d.ts +0 -39
  273. package/dist/channels/tanstack-ai.js +0 -17
  274. package/dist/channels/tanstack-ai.js.map +0 -1
  275. package/dist/channels/telegram.js +0 -427
  276. package/dist/channels/telegram.js.map +0 -1
  277. package/dist/channels/voice.d.ts +0 -45
  278. package/dist/channels/voice.js +0 -122
  279. package/dist/channels/voice.js.map +0 -1
  280. package/dist/client-fyQrLGkD.js.map +0 -1
  281. package/dist/connector-58XDGvc3.js.map +0 -1
  282. package/dist/images-iiTDSyRu.js.map +0 -1
  283. package/dist/index-BB0kqhIz.d.ts +0 -101
  284. package/dist/ingress-BfetZbMO.js +0 -83
  285. package/dist/ingress-BfetZbMO.js.map +0 -1
  286. package/dist/internal-CYlgHl1l.js +0 -59
  287. package/dist/internal-CYlgHl1l.js.map +0 -1
  288. package/dist/lifecycle-CFu6OV03.js.map +0 -1
  289. package/dist/models/ai-sdk/index.js.map +0 -1
  290. package/dist/protocol-kHsr-f0X.js.map +0 -1
  291. package/dist/scheduler-DZ3xQfeK.js.map +0 -1
  292. package/dist/sessions/index.js.map +0 -1
  293. package/dist/src-BZeu-SCD.js.map +0 -1
  294. package/dist/streams-DW-UCOUc.js.map +0 -1
  295. package/dist/surface-bZZJqBka.js +0 -17
  296. package/dist/surface-bZZJqBka.js.map +0 -1
  297. package/dist/tasks-68DESxf0.js.map +0 -1
  298. package/dist/tool-schema-CBjGPrsQ.js +0 -31
  299. package/dist/tool-schema-CBjGPrsQ.js.map +0 -1
  300. package/dist/websockets-Ci-LZFHH.js.map +0 -1
  301. package/docs/channels.md +0 -323
@@ -0,0 +1,740 @@
1
+ import {
2
+ _ as LifecycleJobContext,
3
+ n as CapabilityStartContext,
4
+ s as LifecycleCapability,
5
+ v as LifecycleJobOutcome
6
+ } from "../../capability-runner-BiVUtjqC.js";
7
+ import {
8
+ d as ContainerInputPart,
9
+ f as ContainerMessage,
10
+ g as ContainerWhenBusy,
11
+ h as ContainerSettings,
12
+ l as ContainerEvent,
13
+ m as ContainerPart,
14
+ u as ContainerInput,
15
+ x as JsonValue
16
+ } from "../../protocol-BEgrJYC5.js";
17
+ import { r as JsonValue$1, t as HarnessStore } from "../../store-BKM4Xm9M.js";
18
+ import { WorkerEntrypoint } from "cloudflare:workers";
19
+
20
+ //#region src/harness/container/egress.d.ts
21
+ /** One intercepted host and where its requests go. */
22
+ type EgressRoute = {
23
+ /** The placeholder hostname the CLI calls, such as `anthropic.harness.internal`. */ readonly host: string /** The real base URL. The request's path and query are appended. */;
24
+ readonly upstream: string /** Headers to set on the forwarded request, such as credentials. */;
25
+ readonly headers: {
26
+ readonly [name: string]: string;
27
+ } /** Headers to drop from the CLI's request, such as its placeholder key. */;
28
+ readonly strip: readonly string[];
29
+ };
30
+ /** What `ContainerEgress` is given, as its props. */
31
+ type ContainerEgressProps = {
32
+ readonly routes: readonly EgressRoute[];
33
+ };
34
+ /**
35
+ * The `ctx.exports` entry for `ContainerEgress`: called with props, it
36
+ * returns the `Fetcher` an intercept hands requests to.
37
+ */
38
+ type ContainerEgressBinding = (init: {
39
+ readonly props: ContainerEgressProps;
40
+ }) => Fetcher;
41
+ /**
42
+ * The egress for a `ContainerHarness`'s credentials. Export it from your
43
+ * Worker's main module so `ctx.exports.ContainerEgress` exists:
44
+ *
45
+ * ```ts
46
+ * export { ContainerEgress } from "agents/harness/container";
47
+ * ```
48
+ *
49
+ * @experimental The API may change before it stabilizes.
50
+ */
51
+ declare class ContainerEgress extends WorkerEntrypoint<
52
+ unknown,
53
+ ContainerEgressProps
54
+ > {
55
+ /**
56
+ * Forward one request the container made.
57
+ *
58
+ * @param request - The intercepted request.
59
+ * @returns The upstream's response.
60
+ */
61
+ fetch(request: Request): Promise<Response>;
62
+ }
63
+ //#endregion
64
+ //#region src/harness/container/managed-image.d.ts
65
+ /**
66
+ * One setup command, run once in the fresh container and kept in its
67
+ * snapshot.
68
+ *
69
+ * Steps run as root by default. A step with `user: "agent"` runs as the
70
+ * user the CLI runs as, with `HOME=/home/agent`: anything it puts in that
71
+ * home (installed plugins and mods, `~/.claude/settings.json`, skills,
72
+ * `~/.codex/config.toml`) is in every session's home, because each session
73
+ * home starts as a copy of it.
74
+ */
75
+ type SetupStep = {
76
+ /** What the step does, for error messages. */ readonly name: string;
77
+ readonly command: readonly string[] /** Who runs it. Default `root`. */;
78
+ readonly user?: "root" | "agent";
79
+ };
80
+ //#endregion
81
+ //#region src/harness/container/agents.d.ts
82
+ /**
83
+ * Where a CLI's model requests go, and the credentials they carry. Added
84
+ * outside the container, by `ContainerEgress`.
85
+ *
86
+ * - Straight to the provider: `{ apiKey }`.
87
+ * - AI Gateway with Unified Billing: `{ baseUrl: `${gateway}/anthropic`,
88
+ * apiKey: gatewayToken }`; the gateway takes its token as the key.
89
+ * - AI Gateway with BYOK: `{ baseUrl, headers: { "cf-aig-authorization":
90
+ * `Bearer ${gatewayToken}` } }`; the gateway holds the provider key.
91
+ */
92
+ type ProviderConnection = {
93
+ /** Sent the way the provider expects: `x-api-key`, or `Authorization: Bearer`. */ readonly apiKey?: string;
94
+ /**
95
+ * The provider's base URL, as its SDK names it (`ANTHROPIC_BASE_URL`,
96
+ * `OPENAI_BASE_URL`). Default: the provider's own API.
97
+ */
98
+ readonly baseUrl?: string /** More headers on every model request, such as gateway metadata. */;
99
+ readonly headers?: {
100
+ readonly [name: string]: string;
101
+ };
102
+ };
103
+ /** How the container is built. */
104
+ type ContainerImage =
105
+ /**
106
+ * `cloudflare/debian-trixie`, set up at runtime by the harness: the
107
+ * steps run once and the result is snapshotted. The harness installs the
108
+ * daemon.
109
+ */
110
+ | {
111
+ readonly kind: "managed";
112
+ readonly setup: readonly SetupStep[];
113
+ } /** An image you built, whose entrypoint runs the daemon itself. */
114
+ | {
115
+ readonly kind: "custom";
116
+ readonly image: string;
117
+ };
118
+ /** What runs in the container. Build one with a preset. */
119
+ type ContainerAgent = {
120
+ /** The daemon adapter: `claude-code`, `codex`, `echo`, or your own. */ readonly adapter: string;
121
+ readonly image: ContainerImage /** Environment for the daemon and the CLI. Never put secrets here. */;
122
+ readonly env: {
123
+ readonly [name: string]: string;
124
+ } /** Hosts the harness intercepts to add credentials. */;
125
+ readonly egress: readonly EgressRoute[] /** The model and adapter options new sessions start with. */;
126
+ readonly model?: string;
127
+ readonly options?: JsonValue;
128
+ };
129
+ /** `claudeCode()`'s options: its provider connection and settings. */
130
+ type ClaudeCodeAgentOptions = ProviderConnection & {
131
+ /** Default `claude-sonnet-4-5`. Change one session's with `setModel`. */ readonly model?: string /** The `@anthropic-ai/claude-code` version. Default `2.1.289`. */;
132
+ readonly version?: string;
133
+ readonly appendSystemPrompt?: string;
134
+ readonly allowedTools?: readonly string[];
135
+ readonly disallowedTools?: readonly string[];
136
+ readonly maxTurns?: number;
137
+ /**
138
+ * More setup steps, run after the install and kept in the snapshot. Use
139
+ * `user: "agent"` to install plugins, mods or settings in the agent's
140
+ * home, which every session home starts from.
141
+ */
142
+ readonly setup?: readonly SetupStep[];
143
+ };
144
+ /**
145
+ * Claude Code, installed at runtime on `cloudflare/debian-trixie`.
146
+ *
147
+ * @param options - Its provider connection (`apiKey`, `baseUrl`,
148
+ * `headers`) and settings.
149
+ * @returns The agent, for `ContainerHarness`'s `agent`.
150
+ *
151
+ * @experimental The API may change before it stabilizes.
152
+ */
153
+ declare function claudeCode(options: ClaudeCodeAgentOptions): ContainerAgent;
154
+ /** `codex()`'s options: its provider connection and settings. */
155
+ type CodexAgentOptions = ProviderConnection & {
156
+ /** Default `gpt-5.1`. Change one session's with `setModel`. */ readonly model?: string /** The `@openai/codex` version. Default `0.157.0`. */;
157
+ readonly version?: string /** Extra `-c key=value` config overrides. */;
158
+ readonly config?: readonly string[];
159
+ /**
160
+ * More setup steps, run after the install and kept in the snapshot. Use
161
+ * `user: "agent"` to install plugins, mods or settings in the agent's
162
+ * home, which every session home starts from.
163
+ */
164
+ readonly setup?: readonly SetupStep[];
165
+ };
166
+ /**
167
+ * Codex, installed at runtime on `cloudflare/debian-trixie`.
168
+ *
169
+ * @param options - Its provider connection (`apiKey`, `baseUrl`,
170
+ * `headers`) and settings.
171
+ * @returns The agent, for `ContainerHarness`'s `agent`.
172
+ *
173
+ * @experimental The API may change before it stabilizes.
174
+ */
175
+ declare function codex(options: CodexAgentOptions): ContainerAgent;
176
+ /** `containerAgent()`'s options. */
177
+ type CustomAgentOptions = {
178
+ /** Your image, such as `ctx.container.images.agent`. Its entrypoint runs the daemon. */ readonly image: string /** The adapter its daemon runs. */;
179
+ readonly adapter: string;
180
+ readonly env?: {
181
+ readonly [name: string]: string;
182
+ };
183
+ readonly egress?: readonly EgressRoute[];
184
+ readonly model?: string;
185
+ readonly options?: JsonValue;
186
+ };
187
+ /**
188
+ * An agent in an image you built, whose entrypoint serves the daemon
189
+ * (`serveFromEnv` from `agents/harness/container/runtime`).
190
+ *
191
+ * @param options - The image, the adapter, and its environment.
192
+ * @returns The agent, for `ContainerHarness`'s `agent`.
193
+ *
194
+ * @experimental The API may change before it stabilizes.
195
+ */
196
+ declare function containerAgent(options: CustomAgentOptions): ContainerAgent;
197
+ /**
198
+ * The echo adapter on `cloudflare/debian-trixie`: no CLI, no model, no
199
+ * credentials. For smoke tests of the whole path.
200
+ *
201
+ * @returns The agent, for `ContainerHarness`'s `agent`.
202
+ *
203
+ * @experimental The API may change before it stabilizes.
204
+ */
205
+ declare function echoAgent(): ContainerAgent;
206
+ //#endregion
207
+ //#region src/harness/container/types.d.ts
208
+ /**
209
+ * `ContainerHarness`'s own types: how the harness addresses sessions and
210
+ * reports operations. They mirror `agents/harness/pi` one for one, so code
211
+ * written against one harness reads the same against the other. Transcript
212
+ * messages and events are the wire's types (`ContainerMessage`,
213
+ * `ContainerEvent`), the one format every container adapter produces.
214
+ */
215
+ /** A session, addressed by its id. The root is `"root"`. */
216
+ type ContainerSessionId = string;
217
+ /** Options for submitting a prompt. */
218
+ type ContainerSubmitOptions = {
219
+ /** Default: the root session. */ readonly session?: ContainerSessionId /** Idempotency key. Submitting the same id twice returns the same receipt. */;
220
+ readonly operationId?: string;
221
+ /**
222
+ * What the submission does when the session is already running.
223
+ *
224
+ * - `followUp` (default): answered after the current run, as its own run.
225
+ * - `steer`: joins the running turn, when the adapter can steer;
226
+ * otherwise it is queued as a follow-up.
227
+ */
228
+ readonly whenBusy?: ContainerWhenBusy;
229
+ };
230
+ /** Addresses one session. */
231
+ type ContainerSessionOptions = {
232
+ /** Default: the root session. */ readonly session?: ContainerSessionId;
233
+ };
234
+ /** Returned once a submission is durable. It says nothing about the model yet. */
235
+ type ContainerReceipt = {
236
+ readonly operationId: string;
237
+ readonly session: ContainerSessionId /** False when this operation id was already submitted. */;
238
+ readonly accepted: boolean;
239
+ };
240
+ /** How one operation ended. */
241
+ type ContainerOperationResult = {
242
+ readonly operationId: string;
243
+ readonly session: ContainerSessionId /** `done`: answered. `unanswered`: failed, aborted, or lost with its container. */;
244
+ readonly status: "done" | "unanswered";
245
+ /**
246
+ * Why an unanswered operation ended: the adapter's reason, `aborted`,
247
+ * `container_lost` (its container stopped mid-run), `not_found`, or
248
+ * `container_unavailable` (no container could be started).
249
+ */
250
+ readonly reason?: string /** The final assistant text, when answered. */;
251
+ readonly text?: string;
252
+ };
253
+ /** What `prompt()` returns: the result and the transcript after it. */
254
+ type ContainerPromptResponse = ContainerOperationResult & {
255
+ /** The session's active transcript after the operation. */ readonly messages: readonly ContainerMessage[];
256
+ };
257
+ /** A submission that has not settled yet. */
258
+ type ContainerPendingOperation = {
259
+ readonly operationId: string;
260
+ readonly session: ContainerSessionId /** `queued`, or `running` in the container. */;
261
+ readonly status: "queued" | "running";
262
+ };
263
+ /** One session, as `sessions.list()` reports it. */
264
+ type ContainerSessionInfo = {
265
+ readonly id: ContainerSessionId /** The session this one was forked from. */;
266
+ readonly parent?: ContainerSessionId;
267
+ readonly busy: boolean;
268
+ };
269
+ /** Where the container is, as the harness sees it. */
270
+ type ContainerStatus =
271
+ | "starting"
272
+ | "ready" /** The container stopped while it had work; that work is reconciled. */
273
+ | "lost" /** The container was stopped after it went idle. */
274
+ | "stopped";
275
+ /** One event on a session's stream. */
276
+ type ContainerSessionEvent =
277
+ /** What the adapter reported, tagged with its operation. */ | (ContainerEvent & {
278
+ readonly operationId: string | null;
279
+ })
280
+ | {
281
+ readonly type: "operation-start";
282
+ readonly operationId: string;
283
+ }
284
+ | {
285
+ readonly type: "operation-end";
286
+ readonly result: ContainerOperationResult;
287
+ }
288
+ | {
289
+ readonly type: "container";
290
+ readonly status: ContainerStatus;
291
+ };
292
+ /** The state of a session when a stream starts. */
293
+ type ContainerSessionSnapshot = {
294
+ readonly session: ContainerSessionId;
295
+ readonly messages: readonly ContainerMessage[];
296
+ readonly pending: readonly ContainerPendingOperation[];
297
+ readonly busy: boolean;
298
+ };
299
+ /**
300
+ * A session's events: the snapshot taken when the stream was opened, then
301
+ * every event after it, in batches, including any that arrived before
302
+ * `start()`. An event may repeat what the snapshot already shows; messages
303
+ * are keyed by id. Live: events reach listeners in the isolate that runs
304
+ * the harness. Call `stop()` when done, started or not.
305
+ */
306
+ type ContainerEventStream = {
307
+ readonly snapshot: ContainerSessionSnapshot /** Start delivering events. Call once. */;
308
+ start(
309
+ listener: (events: readonly ContainerSessionEvent[]) => void
310
+ ): void /** Stop delivering events. */;
311
+ stop(): Promise<void>;
312
+ };
313
+ //#endregion
314
+ //#region src/harness/container/harness.d.ts
315
+ /** The root session's id. */
316
+ declare const ROOT_SESSION: ContainerSessionId;
317
+ /** A container instance size: a named type or a custom shape. */
318
+ type ContainerInstance =
319
+ | "lite"
320
+ | "standard-1"
321
+ | "standard-2"
322
+ | "standard-3"
323
+ | "standard-4"
324
+ | {
325
+ readonly vcpu: number;
326
+ readonly memoryMib: number;
327
+ readonly diskMb: number;
328
+ };
329
+ /** Applied to a session the first time it is created. */
330
+ type ContainerSessionDefaults = {
331
+ /** The adapter's model name. Change one session's with `session.setModel`. */ readonly model?: string /** Adapter options, passed through to the adapter untouched. */;
332
+ readonly options?: JsonValue$1;
333
+ };
334
+ /** `ContainerHarness`'s options. */
335
+ type ContainerHarnessOptions = {
336
+ /** The object's container: `ctx.container`. */ readonly container: Container /** What runs in it: `claudeCode()`, `codex()`, or `containerAgent()`. */;
337
+ readonly agent: ContainerAgent;
338
+ /**
339
+ * `ctx.exports.ContainerEgress`, which adds the agent's credentials to
340
+ * its requests outside the container. Required when the agent has egress
341
+ * routes (every preset does). Export `ContainerEgress` from
342
+ * your Worker's main module.
343
+ */
344
+ readonly egress?: ContainerEgressBinding /** Instance size. Default `standard-1`. */;
345
+ readonly instance?: ContainerInstance;
346
+ /**
347
+ * Whether the container may reach the Internet beyond its egress routes.
348
+ * Default true: managed images need it to install their CLI in setup.
349
+ * Commands the agent runs can then reach any host (credentials still
350
+ * stay outside: only the egress routes carry them). Set false, with a
351
+ * `containerAgent()` image that has its CLI installed, to allow nothing
352
+ * but the egress routes.
353
+ */
354
+ readonly enableInternet?: boolean /** Where the daemon listens. Default 8080. */;
355
+ readonly port?: number;
356
+ /**
357
+ * How long the container keeps running after its last work, in
358
+ * milliseconds. The harness then snapshots its filesystem (workspace
359
+ * included) and stops it; the next prompt starts a new one from that
360
+ * snapshot and resumes the session in it. Default five minutes; at most
361
+ * six hours less two minutes (the platform's own stop comes two minutes
362
+ * later, and the harness must snapshot first).
363
+ */
364
+ readonly idleTimeoutMs?: number /** How long a new container may take to answer. Default 60 seconds. */;
365
+ readonly startTimeoutMs?: number /** What a new session starts with. Default: the agent's model and options. */;
366
+ readonly defaults?: ContainerSessionDefaults;
367
+ /**
368
+ * What happens to an operation whose container stopped while it ran.
369
+ *
370
+ * - `fail` (default): it settles `unanswered` with `container_lost`. The
371
+ * session itself survives: the next prompt resumes it in a new
372
+ * container, from everything the adapter persisted.
373
+ * - `retry`: it runs again from the start in the new container. Only safe
374
+ * when the agent's tools can be repeated.
375
+ */
376
+ readonly onContainerLost?:
377
+ | "fail"
378
+ | "retry" /** Table prefix for the session store. Default `container_`. */;
379
+ readonly storePrefix?: string;
380
+ };
381
+ /**
382
+ * An agent CLI running in a Cloudflare Container, driven from a Durable
383
+ * Object, behind the same interface as `PiHarness`: `harness.prompt()`,
384
+ * `harness.sessions`, `harness.session(id)`.
385
+ *
386
+ * The harness does not know which agent runs in the container. A preset
387
+ * (`claudeCode()`, `codex()`) says what to install and which adapter the
388
+ * daemon runs; the harness builds the container from
389
+ * `cloudflare/debian-trixie` on first use, installs the bundled daemon, and
390
+ * snapshots the result, so there is no image to build. Credentials stay
391
+ * outside: the CLI calls a placeholder host, and `ContainerEgress` adds the
392
+ * real key. Any adapter that produces `ContainerEvent`s works, including
393
+ * one in an image of your own (`containerAgent()`).
394
+ *
395
+ * The object owns the durable record, in a `HarnessStore`: sessions,
396
+ * operations, the transcript, and the adapter's resume state. The container
397
+ * is disposable. It is started on demand with `ctx.container.start()`, kept
398
+ * for `idleTimeoutMs` after its last work, and then stopped. The next
399
+ * prompt starts a new container and hands the adapter everything it
400
+ * persisted, so the agent resumes its own session there.
401
+ *
402
+ * Each session has one Lifecycle wake job. It runs while the session has
403
+ * open operations: it starts or reattaches to the container, reconciles
404
+ * what the container knows with what the object stored, delivers queued
405
+ * operations, and waits for them, rescheduling itself as a heartbeat. An
406
+ * eviction mid-run leaves the job due, so its alarm restarts the object,
407
+ * which reattaches and replays the frames it missed from its cursor.
408
+ *
409
+ * Recovery, by what was lost:
410
+ *
411
+ * - **The object** (eviction, deploy): the container keeps running for
412
+ * `idleTimeoutMs`. The wake reattaches and replays from the cursor.
413
+ * - **The socket**: the same, on the next heartbeat.
414
+ * - **The container** (idle stop, crash, platform restart): a new one
415
+ * answers with a different runtime id. The session is reopened in it
416
+ * from the persisted resume state; queued operations run there; an
417
+ * operation that was running is settled `container_lost` or run again,
418
+ * per `onContainerLost`.
419
+ *
420
+ * @experimental The API may change before it stabilizes.
421
+ */
422
+ declare class ContainerHarness extends LifecycleCapability {
423
+ #private;
424
+ /** Every session in this object. */
425
+ readonly sessions: ContainerSessions;
426
+ /**
427
+ * @param options - The container, the agent, and session defaults.
428
+ */
429
+ constructor(options: ContainerHarnessOptions);
430
+ /** Reopen the store, re-arm the container's idle timeout, and wake open sessions. */
431
+ onStart(_context: CapabilityStartContext): Promise<void>;
432
+ /** Dispatch the harness's jobs: one wake per session, and the idle stop. */
433
+ onJob(context: LifecycleJobContext): Promise<LifecycleJobOutcome | void>;
434
+ /** Close the session sockets. Durable state and the container are untouched. */
435
+ dispose(): Promise<void>;
436
+ /**
437
+ * A handle on one session. No I/O until you call it.
438
+ *
439
+ * @param id - The session. Default: the root session.
440
+ * @returns The handle.
441
+ */
442
+ session(id?: ContainerSessionId): ContainerSession;
443
+ /**
444
+ * Submit a prompt and wait for its answer.
445
+ *
446
+ * @param input - The prompt.
447
+ * @param options - Session, idempotency key, and busy behaviour.
448
+ * @returns The result, with the session's transcript after it.
449
+ */
450
+ prompt(
451
+ input: ContainerInput,
452
+ options?: ContainerSubmitOptions
453
+ ): Promise<ContainerPromptResponse>;
454
+ /**
455
+ * Durably submit a prompt. Resolves before the agent runs.
456
+ *
457
+ * @param input - The prompt.
458
+ * @param options - Session, idempotency key, and busy behaviour.
459
+ * @returns The receipt.
460
+ */
461
+ submit(
462
+ input: ContainerInput,
463
+ options?: ContainerSubmitOptions
464
+ ): Promise<ContainerReceipt>;
465
+ /**
466
+ * Stop one operation, or everything running in a session.
467
+ *
468
+ * @param options - The session, and optionally one operation.
469
+ * @returns Whether anything was stopped.
470
+ */
471
+ abort(
472
+ options?: ContainerSessionOptions & {
473
+ readonly operationId?: string;
474
+ }
475
+ ): Promise<boolean>;
476
+ /**
477
+ * Wait for an operation to settle.
478
+ *
479
+ * @param operationId - The operation.
480
+ * @param options - The session, and a signal that stops only the wait.
481
+ * @returns How it ended.
482
+ */
483
+ wait(
484
+ operationId: string,
485
+ options?: ContainerSessionOptions & {
486
+ readonly signal?: AbortSignal;
487
+ }
488
+ ): Promise<ContainerOperationResult>;
489
+ /**
490
+ * The session's active transcript.
491
+ *
492
+ * @param options - The session.
493
+ * @returns Its messages since the newest reset.
494
+ */
495
+ messages(options?: ContainerSessionOptions): Promise<ContainerMessage[]>;
496
+ /**
497
+ * Submissions that have not settled yet, oldest first.
498
+ *
499
+ * @param options - Narrow to one session. Default: every session.
500
+ * @returns The open operations.
501
+ */
502
+ pending(
503
+ options?: ContainerSessionOptions
504
+ ): Promise<ContainerPendingOperation[]>;
505
+ /**
506
+ * The container, as the harness sees it.
507
+ *
508
+ * @returns Whether it runs, and the id the harness started it with.
509
+ */
510
+ container(): Promise<{
511
+ readonly running: boolean;
512
+ readonly runtimeId: string | undefined;
513
+ }>;
514
+ /**
515
+ * Stop the container now. Sessions survive: the next prompt starts a new
516
+ * container and resumes them in it. Running operations are reconciled as
517
+ * if the container had died.
518
+ */
519
+ stop(): Promise<void>;
520
+ /** @internal */
521
+ store(): Promise<HarnessStore>;
522
+ /** @internal Create a session with the defaults, or fork one. */
523
+ createSession(
524
+ id: ContainerSessionId,
525
+ from?: ContainerSessionId
526
+ ): Promise<void>;
527
+ /** @internal */
528
+ enqueue(
529
+ session: ContainerSessionId,
530
+ input: ContainerInput,
531
+ options: ContainerSubmitOptions
532
+ ): Promise<ContainerReceipt>;
533
+ /** @internal Withdraw or abort one operation, or all of a session's. */
534
+ withdraw(
535
+ session: ContainerSessionId,
536
+ operationId: string | undefined
537
+ ): Promise<boolean>;
538
+ /** @internal Wait for an operation to settle. */
539
+ settled(
540
+ session: ContainerSessionId,
541
+ operationId: string,
542
+ signal?: AbortSignal
543
+ ): Promise<ContainerOperationResult>;
544
+ /** @internal The active transcript. */
545
+ transcript(session: ContainerSessionId): Promise<ContainerMessage[]>;
546
+ /** @internal */
547
+ busy(session: ContainerSessionId): Promise<boolean>;
548
+ /** @internal Start a new context: a new agent session, without history. */
549
+ resetSession(
550
+ session: ContainerSessionId,
551
+ handoff: string | undefined
552
+ ): Promise<void>;
553
+ /** @internal */
554
+ setModel(session: ContainerSessionId, model: string): Promise<void>;
555
+ /** @internal */
556
+ events(session: ContainerSessionId): Promise<ContainerEventStream>;
557
+ }
558
+ /**
559
+ * One session, addressed through the harness.
560
+ *
561
+ * @experimental The API may change before it stabilizes.
562
+ */
563
+ declare class ContainerSession {
564
+ #private;
565
+ /** The session id. */
566
+ readonly id: ContainerSessionId;
567
+ /**
568
+ * @param harness - The harness.
569
+ * @param id - The session id.
570
+ */
571
+ constructor(harness: ContainerHarness, id: ContainerSessionId);
572
+ /**
573
+ * Durably submit a prompt. Resolves before the agent runs.
574
+ *
575
+ * @param input - The prompt.
576
+ * @param options - Idempotency key and busy behaviour.
577
+ * @returns The receipt.
578
+ */
579
+ submit(
580
+ input: ContainerInput,
581
+ options?: ContainerSubmitOptions
582
+ ): Promise<ContainerReceipt>;
583
+ /**
584
+ * Submit and wait for the answer and the updated transcript.
585
+ *
586
+ * @param input - The prompt.
587
+ * @param options - Idempotency key and busy behaviour.
588
+ * @returns The result, with the transcript after it.
589
+ */
590
+ prompt(
591
+ input: ContainerInput,
592
+ options?: ContainerSubmitOptions
593
+ ): Promise<ContainerPromptResponse>;
594
+ /**
595
+ * Join the running turn, when the adapter can steer; otherwise queue.
596
+ *
597
+ * @param input - The prompt.
598
+ * @param options - Idempotency key.
599
+ * @returns The receipt.
600
+ */
601
+ steer(
602
+ input: ContainerInput,
603
+ options?: Omit<ContainerSubmitOptions, "whenBusy">
604
+ ): Promise<ContainerReceipt>;
605
+ /**
606
+ * Wait for an operation to settle. Aborting `signal` stops only the wait.
607
+ *
608
+ * @param operationId - The operation.
609
+ * @param signal - Stops the wait.
610
+ * @returns How it ended.
611
+ */
612
+ wait(
613
+ operationId: string,
614
+ signal?: AbortSignal
615
+ ): Promise<ContainerOperationResult>;
616
+ /**
617
+ * Withdraw or abort one operation, or, with no id, every open operation
618
+ * of the session. Aborted operations settle `unanswered` with `aborted`.
619
+ *
620
+ * @param operationId - The operation. Default: all of them.
621
+ * @returns Whether anything was open to abort (always true with no id).
622
+ */
623
+ abort(operationId?: string): Promise<boolean>;
624
+ /**
625
+ * Start a new context: a new agent session without the old history,
626
+ * optionally seeded with a handoff note prepended to the next prompt.
627
+ * Throws while the session is busy.
628
+ *
629
+ * @param handoff - The note.
630
+ */
631
+ reset(handoff?: string): Promise<void>;
632
+ /**
633
+ * Change this session's model, by the adapter's model name.
634
+ *
635
+ * @param model - The model.
636
+ */
637
+ setModel(model: string): Promise<void>;
638
+ /**
639
+ * The active transcript, since the newest reset.
640
+ *
641
+ * @returns The messages, oldest first.
642
+ */
643
+ messages(): Promise<ContainerMessage[]>;
644
+ /**
645
+ * This session's events: a snapshot, then live batches.
646
+ *
647
+ * @returns The stream.
648
+ */
649
+ events(): Promise<ContainerEventStream>;
650
+ /**
651
+ * Whether the session has open operations.
652
+ *
653
+ * @returns True while anything is queued or running.
654
+ */
655
+ busy(): Promise<boolean>;
656
+ }
657
+ /**
658
+ * Every session in this object.
659
+ *
660
+ * @experimental The API may change before it stabilizes.
661
+ */
662
+ declare class ContainerSessions {
663
+ #private;
664
+ /**
665
+ * @param harness - The harness.
666
+ */
667
+ constructor(harness: ContainerHarness);
668
+ /**
669
+ * A handle on one session.
670
+ *
671
+ * @param id - The session id.
672
+ * @returns The handle.
673
+ */
674
+ get(id: ContainerSessionId): ContainerSession;
675
+ /**
676
+ * A new top-level session, with the harness's defaults.
677
+ *
678
+ * @returns The new session.
679
+ */
680
+ create(): Promise<ContainerSession>;
681
+ /**
682
+ * A new session that continues `from`'s history as a branch.
683
+ *
684
+ * @param from - The session to fork.
685
+ * @returns The new session.
686
+ */
687
+ fork(from: ContainerSessionId): Promise<ContainerSession>;
688
+ /**
689
+ * Every session, oldest first.
690
+ *
691
+ * @returns Each session's id, parent, and whether it is busy.
692
+ */
693
+ list(): Promise<ContainerSessionInfo[]>;
694
+ }
695
+ //#endregion
696
+ export {
697
+ type ClaudeCodeAgentOptions,
698
+ type CodexAgentOptions,
699
+ type ContainerAgent,
700
+ ContainerEgress,
701
+ type ContainerEgressBinding,
702
+ type ContainerEgressProps,
703
+ type ContainerEvent,
704
+ type ContainerEventStream,
705
+ ContainerHarness,
706
+ type ContainerHarnessOptions,
707
+ type ContainerImage,
708
+ type ContainerInput,
709
+ type ContainerInputPart,
710
+ type ContainerInstance,
711
+ type ContainerMessage,
712
+ type ContainerOperationResult,
713
+ type ContainerPart,
714
+ type ContainerPendingOperation,
715
+ type ContainerPromptResponse,
716
+ type ContainerReceipt,
717
+ ContainerSession,
718
+ type ContainerSessionDefaults,
719
+ type ContainerSessionEvent,
720
+ type ContainerSessionId,
721
+ type ContainerSessionInfo,
722
+ type ContainerSessionOptions,
723
+ type ContainerSessionSnapshot,
724
+ ContainerSessions,
725
+ type ContainerSettings,
726
+ type ContainerStatus,
727
+ type ContainerSubmitOptions,
728
+ type ContainerWhenBusy,
729
+ type CustomAgentOptions,
730
+ type EgressRoute,
731
+ type JsonValue,
732
+ type ProviderConnection,
733
+ ROOT_SESSION,
734
+ type SetupStep,
735
+ claudeCode,
736
+ codex,
737
+ containerAgent,
738
+ echoAgent
739
+ };
740
+ //# sourceMappingURL=index.d.ts.map