agents 0.25.0 → 0.27.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 (238) hide show
  1. package/README.md +8 -9
  2. package/dist/{agent-routing-0DR0Tk2v.d.ts → agent-routing-Bhdbvf7s.d.ts} +13 -8
  3. package/dist/agent-routing.d.ts +1 -1
  4. package/dist/agent-tool-types.d.ts +1 -1
  5. package/dist/{agent-tools-YrATZJu2.d.ts → agent-tools-bJZwBMfq.d.ts} +2 -2
  6. package/dist/agent-tools.d.ts +1 -1
  7. package/dist/ai-sdk-OoGkFy3s.js +2444 -0
  8. package/dist/ai-sdk-OoGkFy3s.js.map +1 -0
  9. package/dist/apply-chunks-1FheRb9W.js +99 -0
  10. package/dist/apply-chunks-1FheRb9W.js.map +1 -0
  11. package/dist/broadcast-state-CEyI4uAK.js +69 -0
  12. package/dist/broadcast-state-CEyI4uAK.js.map +1 -0
  13. package/dist/browser/ai-sdk.d.ts +1 -1
  14. package/dist/browser/ai-sdk.js +2 -2
  15. package/dist/browser/ai-sdk.js.map +1 -1
  16. package/dist/browser/index.d.ts +1 -1
  17. package/dist/browser/tanstack-ai.d.ts +1 -1
  18. package/dist/browser/tanstack-ai.js +1 -1
  19. package/dist/{browser-DE3d-RLk.d.ts → browser-tmkcAAI3.d.ts} +2 -2
  20. package/dist/{browser-tool-DuNdlwZ9.d.ts → browser-tool-Bn-nzJQI.d.ts} +3 -3
  21. package/dist/{browser-tool-CQ10e6Kj.js → browser-tool-CBqs6hqa.js} +58 -18
  22. package/dist/browser-tool-CBqs6hqa.js.map +1 -0
  23. package/dist/capability-B4WbF81e.js.map +1 -1
  24. package/dist/{capability-runner-DBAnGr6L.d.ts → capability-runner-O5VbQzqg.d.ts} +9 -1
  25. package/dist/channel-Bak_6zDP.d.ts +333 -0
  26. package/dist/chat/index.d.ts +11 -9
  27. package/dist/chat/index.js +5 -194
  28. package/dist/chat/index.js.map +1 -1
  29. package/dist/chat/react.d.ts +2 -4
  30. package/dist/chat/react.js +3 -1
  31. package/dist/chat/react.js.map +1 -1
  32. package/dist/chat-sdk/index.d.ts +1 -1
  33. package/dist/chat-sdk/index.js +1 -1
  34. package/dist/cli.js +144 -0
  35. package/dist/{client-fyQrLGkD.js → client-1tEQ1Oqz.js} +27 -2
  36. package/dist/{client-fyQrLGkD.js.map → client-1tEQ1Oqz.js.map} +1 -1
  37. package/dist/{client-je3koD9Z.d.ts → client-DS3Dz9l0.d.ts} +2 -2
  38. package/dist/client-tools-aIBO0Fk7.d.ts +53 -0
  39. package/dist/client.d.ts +1 -1
  40. package/dist/conversations-DH0ut_8n.d.ts +192 -0
  41. package/dist/{current-agent-vAk_5JMt.d.ts → current-agent-C07C5o5Y.d.ts} +3 -3
  42. package/dist/daemon-core-Buubj-y1.js +481 -0
  43. package/dist/daemon-core-Buubj-y1.js.map +1 -0
  44. package/dist/daemon-core-CbohVPAu.d.ts +132 -0
  45. package/dist/{do-oauth-client-provider-Tmf1vgKz.d.ts → do-oauth-client-provider-DfsUcpc3.d.ts} +7 -1
  46. package/dist/{durable-object-lifecycle-HhgOMWq9.d.ts → durable-object-lifecycle-DRqp475_.d.ts} +2 -2
  47. package/dist/{channels/email.d.ts → experimental/channels/email/index.d.ts} +25 -12
  48. package/dist/{channels/email.js → experimental/channels/email/index.js} +13 -35
  49. package/dist/experimental/channels/email/index.js.map +1 -0
  50. package/dist/experimental/channels/index.d.ts +270 -0
  51. package/dist/experimental/channels/index.js +1186 -0
  52. package/dist/experimental/channels/index.js.map +1 -0
  53. package/dist/{channels/slack.d.ts → experimental/channels/slack/index.d.ts} +19 -9
  54. package/dist/experimental/channels/slack/index.js +267 -0
  55. package/dist/experimental/channels/slack/index.js.map +1 -0
  56. package/dist/{channels/telegram.d.ts → experimental/channels/telegram/index.d.ts} +19 -9
  57. package/dist/experimental/channels/telegram/index.js +198 -0
  58. package/dist/experimental/channels/telegram/index.js.map +1 -0
  59. package/dist/experimental/channels/web/ai-sdk.d.ts +55 -0
  60. package/dist/experimental/channels/web/ai-sdk.js +266 -0
  61. package/dist/experimental/channels/web/ai-sdk.js.map +1 -0
  62. package/dist/experimental/channels/web/client.d.ts +97 -0
  63. package/dist/experimental/channels/web/client.js +349 -0
  64. package/dist/experimental/channels/web/client.js.map +1 -0
  65. package/dist/experimental/channels/web/index.d.ts +189 -0
  66. package/dist/experimental/channels/web/index.js +332 -0
  67. package/dist/experimental/channels/web/index.js.map +1 -0
  68. package/dist/gateway-BDC07gYO.d.ts +100 -0
  69. package/dist/handle-zAzh0UW2.d.ts +460 -0
  70. package/dist/harness/ai-sdk/index.d.ts +175 -0
  71. package/dist/harness/ai-sdk/index.js +605 -0
  72. package/dist/harness/ai-sdk/index.js.map +1 -0
  73. package/dist/harness/container/daemon/index.d.ts +76 -0
  74. package/dist/harness/container/daemon/index.js +3 -0
  75. package/dist/harness/container/index.d.ts +740 -0
  76. package/dist/harness/container/index.js +2152 -0
  77. package/dist/harness/container/index.js.map +1 -0
  78. package/dist/harness/container/runtime/index.d.ts +144 -0
  79. package/dist/harness/container/runtime/index.js +1082 -0
  80. package/dist/harness/container/runtime/index.js.map +1 -0
  81. package/dist/harness/opencode/index.d.ts +369 -0
  82. package/dist/harness/opencode/index.js +1072 -0
  83. package/dist/harness/opencode/index.js.map +1 -0
  84. package/dist/{harnesses → harness}/pi/index.d.ts +85 -88
  85. package/dist/{harnesses → harness}/pi/index.js +196 -77
  86. package/dist/harness/pi/index.js.map +1 -0
  87. package/dist/harness/store/index.d.ts +24 -0
  88. package/dist/harness/store/index.js +2 -0
  89. package/dist/harness/think/index.d.ts +821 -0
  90. package/dist/harness/think/index.js +2529 -0
  91. package/dist/harness/think/index.js.map +1 -0
  92. package/dist/harness-B6B9S3rb.d.ts +203 -0
  93. package/dist/{images-iiTDSyRu.js → images-Ce9SCu3X.js} +2 -248
  94. package/dist/images-Ce9SCu3X.js.map +1 -0
  95. package/dist/{index-BreL0YrQ.d.ts → index-D0A5tbWu.d.ts} +2 -2
  96. package/dist/index-Ib_4dwOo.d.ts +200 -0
  97. package/dist/index.d.ts +5 -5
  98. package/dist/index.js +2 -2
  99. package/dist/ingress-EFbrS547.js +9 -0
  100. package/dist/ingress-EFbrS547.js.map +1 -0
  101. package/dist/input-schema-DNrpTu49.js +23 -0
  102. package/dist/input-schema-DNrpTu49.js.map +1 -0
  103. package/dist/internal-kmw70xwR.js +46 -0
  104. package/dist/internal-kmw70xwR.js.map +1 -0
  105. package/dist/internal_context.d.ts +1 -1
  106. package/dist/lifecycle/index.d.ts +3 -3
  107. package/dist/mcp/client/do-oauth-client-provider.d.ts +1 -1
  108. package/dist/mcp/client/do-oauth-client-provider.js +9 -0
  109. package/dist/mcp/client/do-oauth-client-provider.js.map +1 -1
  110. package/dist/mcp/client/index.d.ts +1 -1
  111. package/dist/mcp/client/index.js +1 -1
  112. package/dist/mcp/client/x402.d.ts +35 -4
  113. package/dist/mcp/client/x402.js +24 -3
  114. package/dist/mcp/client/x402.js.map +1 -1
  115. package/dist/mcp/index.d.ts +1 -1
  116. package/dist/mcp/index.js +2 -2
  117. package/dist/models/ai-sdk/index.d.ts +16 -14
  118. package/dist/models/ai-sdk/index.js +1 -2442
  119. package/dist/models/opencode/index.d.ts +65 -0
  120. package/dist/models/opencode/index.js +285 -0
  121. package/dist/models/opencode/index.js.map +1 -0
  122. package/dist/models/pi-ai/index.d.ts +23 -21
  123. package/dist/models/pi-ai/index.js +7 -6
  124. package/dist/models/pi-ai/index.js.map +1 -1
  125. package/dist/options-pwTNq9z6.d.ts +134 -0
  126. package/dist/protocol-BEgrJYC5.d.ts +331 -0
  127. package/dist/protocol-CukuI73M.d.ts +386 -0
  128. package/dist/protocol-cOklVBBD.js +227 -0
  129. package/dist/protocol-cOklVBBD.js.map +1 -0
  130. package/dist/{protocol-kHsr-f0X.js → protocol-eXeJxhgu.js} +2 -67
  131. package/dist/protocol-eXeJxhgu.js.map +1 -0
  132. package/dist/protocol-y2sSY584.js +148 -0
  133. package/dist/protocol-y2sSY584.js.map +1 -0
  134. package/dist/queue/index.d.ts +1 -1
  135. package/dist/react.d.ts +2 -2
  136. package/dist/routing/index.d.ts +2 -2
  137. package/dist/{scheduler-RdACNXDP.d.ts → scheduler-CrFCnv_J.d.ts} +2 -2
  138. package/dist/schedules/index.d.ts +1 -1
  139. package/dist/serializable.d.ts +1 -1
  140. package/dist/sessions/index.d.ts +11 -434
  141. package/dist/sessions/index.js +1 -2271
  142. package/dist/sessions-B9pNuxdT.js +2272 -0
  143. package/dist/sessions-B9pNuxdT.js.map +1 -0
  144. package/dist/settings-C45hDliX.js +253 -0
  145. package/dist/settings-C45hDliX.js.map +1 -0
  146. package/dist/{transport-PfFnt-Ld.d.ts → settings-NgGwF7Qt.d.ts} +14 -208
  147. package/dist/{src-BZeu-SCD.js → src-DgCbZtIR.js} +4 -4
  148. package/dist/{src-BZeu-SCD.js.map → src-DgCbZtIR.js.map} +1 -1
  149. package/dist/stall-watchdog-BpRF2uwG.js +195 -0
  150. package/dist/stall-watchdog-BpRF2uwG.js.map +1 -0
  151. package/dist/state/index.d.ts +1 -1
  152. package/dist/store-DLeqKuj3.d.ts +310 -0
  153. package/dist/store-vgcPYo8K.js +432 -0
  154. package/dist/store-vgcPYo8K.js.map +1 -0
  155. package/dist/streams/index.d.ts +1 -1
  156. package/dist/streams/index.js +1 -1
  157. package/dist/{streams-DW-UCOUc.js → streams-CITClVer.js} +16 -3
  158. package/dist/streams-CITClVer.js.map +1 -0
  159. package/dist/{streams-Cmkj9QfW.d.ts → streams-fbG61qM8.d.ts} +2 -2
  160. package/dist/sub-routing.d.ts +1 -1
  161. package/dist/tasks/index.d.ts +1 -1
  162. package/dist/tasks/index.js +1 -1
  163. package/dist/{tasks-68DESxf0.js → tasks-CkTZNaV1.js} +2 -1
  164. package/dist/tasks-CkTZNaV1.js.map +1 -0
  165. package/dist/{tasks-9YxYtByh.d.ts → tasks-PtlB4Uyn.d.ts} +2 -2
  166. package/dist/tool-3PA8xjB_.js +421 -0
  167. package/dist/tool-3PA8xjB_.js.map +1 -0
  168. package/dist/tool-BPJEbwaX.d.ts +278 -0
  169. package/dist/transport-k2mFrtL8.d.ts +200 -0
  170. package/dist/turns-DCV3ycDl.js +317 -0
  171. package/dist/turns-DCV3ycDl.js.map +1 -0
  172. package/dist/voice/client.js +1 -1
  173. package/dist/voice/index.d.ts +2 -2
  174. package/dist/voice/index.js +1 -1
  175. package/dist/websearch/index.d.ts +58 -0
  176. package/dist/websearch/index.js +2 -0
  177. package/dist/websearch/tools/ai-sdk.d.ts +77 -0
  178. package/dist/websearch/tools/ai-sdk.js +46 -0
  179. package/dist/websearch/tools/ai-sdk.js.map +1 -0
  180. package/dist/websearch/tools/pi.d.ts +82 -0
  181. package/dist/websearch/tools/pi.js +89 -0
  182. package/dist/websearch/tools/pi.js.map +1 -0
  183. package/dist/websearch/tools/tanstack-ai.d.ts +71 -0
  184. package/dist/websearch/tools/tanstack-ai.js +46 -0
  185. package/dist/websearch/tools/tanstack-ai.js.map +1 -0
  186. package/dist/websockets/index.d.ts +12 -296
  187. package/dist/websockets/index.js +1 -1
  188. package/dist/{websockets-Ci-LZFHH.js → websockets-CmENGb-Z.js} +18 -4
  189. package/dist/websockets-CmENGb-Z.js.map +1 -0
  190. package/dist/{wire-types-CrjKvDyi.d.ts → wire-types-Cv0iwjk5.d.ts} +3 -51
  191. package/dist/workflow-types.d.ts +1 -1
  192. package/dist/workflows.d.ts +1 -1
  193. package/dist/workflows.js +1 -1
  194. package/docs/browse-the-web.md +3 -0
  195. package/docs/harnesses/pi.md +114 -32
  196. package/docs/harnesses/think.md +215 -0
  197. package/docs/index.md +4 -3
  198. package/docs/lifecycle.md +40 -0
  199. package/docs/models-pi-ai.md +5 -5
  200. package/docs/search-the-web.md +133 -0
  201. package/package.json +126 -47
  202. package/dist/browser-tool-CQ10e6Kj.js.map +0 -1
  203. package/dist/channel-Bnm4S7T2.d.ts +0 -491
  204. package/dist/channels/ai-sdk.d.ts +0 -46
  205. package/dist/channels/ai-sdk.js +0 -120
  206. package/dist/channels/ai-sdk.js.map +0 -1
  207. package/dist/channels/email.js.map +0 -1
  208. package/dist/channels/index.d.ts +0 -233
  209. package/dist/channels/index.js +0 -608
  210. package/dist/channels/index.js.map +0 -1
  211. package/dist/channels/slack.js +0 -614
  212. package/dist/channels/slack.js.map +0 -1
  213. package/dist/channels/tanstack-ai.d.ts +0 -39
  214. package/dist/channels/tanstack-ai.js +0 -17
  215. package/dist/channels/tanstack-ai.js.map +0 -1
  216. package/dist/channels/telegram.js +0 -427
  217. package/dist/channels/telegram.js.map +0 -1
  218. package/dist/channels/voice.d.ts +0 -45
  219. package/dist/channels/voice.js +0 -122
  220. package/dist/channels/voice.js.map +0 -1
  221. package/dist/harnesses/pi/index.js.map +0 -1
  222. package/dist/images-iiTDSyRu.js.map +0 -1
  223. package/dist/index-BB0kqhIz.d.ts +0 -101
  224. package/dist/ingress-BfetZbMO.js +0 -83
  225. package/dist/ingress-BfetZbMO.js.map +0 -1
  226. package/dist/internal-CYlgHl1l.js +0 -59
  227. package/dist/internal-CYlgHl1l.js.map +0 -1
  228. package/dist/models/ai-sdk/index.js.map +0 -1
  229. package/dist/protocol-kHsr-f0X.js.map +0 -1
  230. package/dist/sessions/index.js.map +0 -1
  231. package/dist/streams-DW-UCOUc.js.map +0 -1
  232. package/dist/surface-bZZJqBka.js +0 -17
  233. package/dist/surface-bZZJqBka.js.map +0 -1
  234. package/dist/tasks-68DESxf0.js.map +0 -1
  235. package/dist/tool-schema-CBjGPrsQ.js +0 -31
  236. package/dist/tool-schema-CBjGPrsQ.js.map +0 -1
  237. package/dist/websockets-Ci-LZFHH.js.map +0 -1
  238. package/docs/channels.md +0 -323
@@ -1,4 +1,4 @@
1
- import { c as Agent } from "./agent-routing-0DR0Tk2v.js";
1
+ import { c as Agent } from "./agent-routing-Bhdbvf7s.js";
2
2
  import {
3
3
  ClientParameters,
4
4
  Method,
@@ -443,4 +443,4 @@ export {
443
443
  splitCallOptions as x,
444
444
  isTerminalCloseEvent as y
445
445
  };
446
- //# sourceMappingURL=client-je3koD9Z.d.ts.map
446
+ //# sourceMappingURL=client-DS3Dz9l0.d.ts.map
@@ -0,0 +1,53 @@
1
+ import { JSONSchema7, Tool, ToolSet } from "ai";
2
+
3
+ //#region src/chat/client-tools.d.ts
4
+ /**
5
+ * Wire-format tool schema sent from the client.
6
+ * Uses `parameters` (JSONSchema7) rather than AI SDK's `inputSchema`
7
+ * because Zod schemas cannot be serialized over the wire.
8
+ */
9
+ type ClientToolSchema = {
10
+ /** Unique name for the tool */ name: string /** Human-readable description of what the tool does */;
11
+ description?: Tool["description"] /** JSON Schema defining the tool's input parameters */;
12
+ parameters?: JSONSchema7;
13
+ };
14
+ /**
15
+ * Executes a client-defined tool and returns its output.
16
+ *
17
+ * Used for the RPC path (e.g. a parent agent delegating to a Think sub-agent)
18
+ * where the caller can run the client tools itself, rather than the
19
+ * browser/WebSocket path where results are sent back asynchronously.
20
+ */
21
+ type ClientToolExecutor = (call: {
22
+ /** The name of the client tool the model called. */ toolName: string /** The model-generated input for the tool call. */;
23
+ input: unknown /** The AI SDK tool-call id for the invocation. */;
24
+ toolCallId: string;
25
+ }) => unknown | Promise<unknown>;
26
+ /**
27
+ * Converts client tool schemas to AI SDK tool format.
28
+ *
29
+ * By default these tools have no `execute` function — when the AI model calls
30
+ * them, the tool call is sent back to the client for execution.
31
+ *
32
+ * When `options.execute` is provided, each tool is built WITH an `execute` that
33
+ * delegates to it. This is used by the RPC path (e.g. a parent agent driving a
34
+ * Think sub-agent) so the model's client-tool call is resolved inline within
35
+ * the same turn.
36
+ *
37
+ * @param clientTools - Array of tool schemas from the client
38
+ * @param options - Optional `execute` delegate to run the tools inline
39
+ * @returns Record of AI SDK tools that can be spread into your tools object
40
+ */
41
+ declare function createToolsFromClientSchemas(
42
+ clientTools?: ClientToolSchema[],
43
+ options?: {
44
+ execute?: ClientToolExecutor;
45
+ }
46
+ ): ToolSet;
47
+ //#endregion
48
+ export {
49
+ ClientToolSchema as n,
50
+ createToolsFromClientSchemas as r,
51
+ ClientToolExecutor as t
52
+ };
53
+ //# sourceMappingURL=client-tools-aIBO0Fk7.d.ts.map
package/dist/client.d.ts CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  v as createStubProxy,
22
22
  x as splitCallOptions,
23
23
  y as isTerminalCloseEvent
24
- } from "./client-je3koD9Z.js";
24
+ } from "./client-DS3Dz9l0.js";
25
25
  export {
26
26
  AgentClient,
27
27
  AgentClientFetchOptions,
@@ -0,0 +1,192 @@
1
+ import { s as LifecycleCapability } from "./capability-runner-O5VbQzqg.js";
2
+ import { n as Streams } from "./streams-fbG61qM8.js";
3
+ import {
4
+ _ as TranscriptMessage,
5
+ a as DispatchResult,
6
+ b as ChannelMessageSurface,
7
+ c as InboundEvent,
8
+ i as ConversationSnapshot,
9
+ m as ResponseChunk,
10
+ n as ConversationInfo,
11
+ o as EventOrigin,
12
+ r as ConversationOperation,
13
+ s as GatewayOrigin,
14
+ y as TurnStatus
15
+ } from "./protocol-CukuI73M.js";
16
+ import { i as WebSockets } from "./index-Ib_4dwOo.js";
17
+ import { t as AgentHarness } from "./harness-B6B9S3rb.js";
18
+
19
+ //#region src/experimental/channels/conversations.d.ts
20
+ /**
21
+ * An inbound event as the gateway sends it. An approval response from a
22
+ * webhook names no turn; Channels finds it from the conversation snapshot.
23
+ */
24
+ type GatewayEvent =
25
+ | InboundEvent
26
+ | Omit<
27
+ Extract<
28
+ InboundEvent,
29
+ {
30
+ type: "approval-response";
31
+ }
32
+ >,
33
+ "turnId"
34
+ >;
35
+ /** How a response finished, as a reader sees it. */
36
+ type ResponseEnding = "ended" | "interrupted" | "not-found";
37
+ /** A change Channels pushes to every channel showing a conversation. */
38
+ type ConversationUpdate =
39
+ | {
40
+ type: "turn";
41
+ turn: TurnStatus;
42
+ }
43
+ | {
44
+ type: "messages";
45
+ messages: TranscriptMessage[] /** Set when the messages arrived as an inbound event. */;
46
+ origin?: EventOrigin /** The inbound event's id, set with `origin`. */;
47
+ eventId?: string;
48
+ }
49
+ | {
50
+ type: "reset";
51
+ }
52
+ | {
53
+ type: "response-end";
54
+ responseId: string;
55
+ ending: ResponseEnding;
56
+ };
57
+ type ResponseReadOptions = {
58
+ from?: number;
59
+ signal?: AbortSignal;
60
+ onChunks(
61
+ from: number,
62
+ chunks: ResponseChunk[]
63
+ ): void /** Everything recorded so far has been read; what follows is live. */;
64
+ onCaughtUp(cursor: number): void;
65
+ };
66
+ /** Durable state a channel keeps in the agent, private to that channel. */
67
+ type ChannelState = {
68
+ get<T>(key: string): T | undefined;
69
+ put(key: string, value: unknown): void;
70
+ delete(key: string): void;
71
+ };
72
+ /** What Channels gives a mounted channel. */
73
+ type ChannelsHost = {
74
+ readonly channelKey: string;
75
+ /**
76
+ * The WebSockets this Channels' channels share: the instance Channels was
77
+ * given, or else the one the first channel to ask creates. Install it with
78
+ * `Lifecycle.use(channels.websockets)`.
79
+ */
80
+ websockets(
81
+ create: () => WebSockets
82
+ ): WebSockets /** This channel's surfaces that have joined the conversation. */;
83
+ surfaces(conversationId: string): Promise<ChannelMessageSurface[]>;
84
+ readonly state: ChannelState;
85
+ snapshot(
86
+ conversationId: string
87
+ ): Promise<ConversationSnapshot> /** The conversation a surface joins when it names none. */;
88
+ defaultConversation(): string /** The conversation operations the agent supports. */;
89
+ readonly operations: readonly ConversationOperation[] /** The agent's conversations. */;
90
+ listConversations(): Promise<ConversationInfo[]>;
91
+ /**
92
+ * Deliver an event to the agent. Resolves once the agent accepted it and
93
+ * rejects if the agent threw.
94
+ */
95
+ dispatch(event: InboundEvent, origin: EventOrigin): Promise<DispatchResult>;
96
+ readResponse(
97
+ conversationId: string,
98
+ responseId: string,
99
+ options: ResponseReadOptions
100
+ ): Promise<ResponseEnding>;
101
+ };
102
+ /** An interface that shows conversations, such as the Web Channel. */
103
+ interface ConversationChannel {
104
+ /** Called once, when Channels is constructed. Take shared dependencies here. */
105
+ mount(host: ChannelsHost): void;
106
+ publish(
107
+ conversationId: string,
108
+ update: ConversationUpdate
109
+ ): void | Promise<void>;
110
+ }
111
+ type ChannelsOptions = {
112
+ /**
113
+ * The agent: its sessions are served as conversations, a conversation's
114
+ * id being its session's id.
115
+ */
116
+ harness: AgentHarness /** Install it before Channels. */;
117
+ streams: Streams /** Shared with channels that serve WebSockets, such as the Web Channel. */;
118
+ websockets?: WebSockets;
119
+ channels: Record<string, ConversationChannel>;
120
+ };
121
+ type ForHarnessOptions = {
122
+ channels: Record<
123
+ string,
124
+ ConversationChannel
125
+ > /** Default: a new Streams, exposed as `channels.streams`. */;
126
+ streams?: Streams /** Default: one the Web Channel creates, exposed as `channels.websockets`. */;
127
+ websockets?: WebSockets;
128
+ };
129
+ /**
130
+ * Serves an agent harness's sessions as conversations: carries inbound
131
+ * events to the harness, and responses, turn statuses and transcript
132
+ * updates back to every channel showing the conversation.
133
+ */
134
+ declare class Channels extends LifecycleCapability {
135
+ #private;
136
+ /**
137
+ * Channels for any shared-interface harness, with their own Streams and
138
+ * (when a channel needs them) WebSockets. Lifecycle does not install one
139
+ * capability from another yet, so install them alongside:
140
+ *
141
+ * ```ts
142
+ * readonly channels = Channels.forHarness(harness, {
143
+ * channels: { web: new WebChannel() }
144
+ * });
145
+ * readonly lifecycle = Lifecycle.install(this)
146
+ * .use(this.harness)
147
+ * .use(this.channels.streams)
148
+ * .use(this.channels)
149
+ * .use(this.channels.websockets);
150
+ *
151
+ * receive(event: GatewayEvent, origin: GatewayOrigin) {
152
+ * return this.channels.receive(event, origin);
153
+ * }
154
+ * ```
155
+ */
156
+ static forHarness(
157
+ harness: AgentHarness,
158
+ options: ForHarnessOptions
159
+ ): Channels;
160
+ /** The responses' Streams. Install it before Channels. */
161
+ readonly streams: Streams;
162
+ constructor(options: ChannelsOptions);
163
+ /**
164
+ * The WebSockets the channels share. Install it with Lifecycle. Throws
165
+ * when no channel uses WebSockets.
166
+ */
167
+ get websockets(): WebSockets;
168
+ /** Mark responses left streaming by an earlier instance as interrupted. */
169
+ onStart(): Promise<void>;
170
+ /**
171
+ * Deliver an inbound event from the gateway, through the same path as
172
+ * the agent's own channels. The agent calls this from its RPC method.
173
+ */
174
+ receive(
175
+ event: GatewayEvent,
176
+ from: GatewayOrigin | EventOrigin
177
+ ): Promise<void>;
178
+ }
179
+ //#endregion
180
+ export {
181
+ ConversationChannel as a,
182
+ GatewayEvent as c,
183
+ ChannelsOptions as i,
184
+ ResponseEnding as l,
185
+ Channels as n,
186
+ ConversationUpdate as o,
187
+ ChannelsHost as r,
188
+ ForHarnessOptions as s,
189
+ ChannelState as t,
190
+ ResponseReadOptions as u
191
+ };
192
+ //# sourceMappingURL=conversations-DH0ut_8n.d.ts.map
@@ -3,8 +3,8 @@ import {
3
3
  o as MemoryLimitContext,
4
4
  v as LifecycleJobOutcome,
5
5
  x as Connection
6
- } from "./capability-runner-DBAnGr6L.js";
7
- import { t as Lifecycle } from "./durable-object-lifecycle-HhgOMWq9.js";
6
+ } from "./capability-runner-O5VbQzqg.js";
7
+ import { t as Lifecycle } from "./durable-object-lifecycle-DRqp475_.js";
8
8
  import { AsyncLocalStorage } from "node:async_hooks";
9
9
  import { DurableObject } from "cloudflare:workers";
10
10
 
@@ -90,4 +90,4 @@ export {
90
90
  LifecycleObject as r,
91
91
  AgentContextStore as t
92
92
  };
93
- //# sourceMappingURL=current-agent-vAk_5JMt.d.ts.map
93
+ //# sourceMappingURL=current-agent-C07C5o5Y.d.ts.map