agents 0.23.0 → 0.25.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 (187) hide show
  1. package/dist/{agent-routing-DE5zmCQ8.d.ts → agent-routing-0DR0Tk2v.d.ts} +270 -190
  2. package/dist/agent-routing.d.ts +1 -1
  3. package/dist/agent-routing.js.map +1 -1
  4. package/dist/agent-tool-types.d.ts +13 -7
  5. package/dist/agent-tool-types.js +23 -1
  6. package/dist/agent-tool-types.js.map +1 -1
  7. package/dist/{agent-tools-y7zLfw4Q.js → agent-tools-CdJC-8Dc.js} +72 -9
  8. package/dist/agent-tools-CdJC-8Dc.js.map +1 -0
  9. package/dist/{agent-tools-DtXMTDGM.d.ts → agent-tools-YrATZJu2.d.ts} +29 -15
  10. package/dist/agent-tools.d.ts +6 -4
  11. package/dist/agent-tools.js.map +1 -1
  12. package/dist/ai-fm7xx1BK.js +312 -0
  13. package/dist/ai-fm7xx1BK.js.map +1 -0
  14. package/dist/base64-redaction-C1Uu29t5.js +59 -0
  15. package/dist/base64-redaction-C1Uu29t5.js.map +1 -0
  16. package/dist/browser/ai-sdk.d.ts +90 -0
  17. package/dist/browser/ai-sdk.js +51 -0
  18. package/dist/browser/ai-sdk.js.map +1 -0
  19. package/dist/browser/ai.d.ts +4 -4
  20. package/dist/browser/ai.js +1 -347
  21. package/dist/browser/index.d.ts +81 -79
  22. package/dist/browser/index.js +361 -2
  23. package/dist/browser/index.js.map +1 -0
  24. package/dist/browser/tanstack-ai.d.ts +96 -1
  25. package/dist/browser/tanstack-ai.js +62 -2
  26. package/dist/browser/tanstack-ai.js.map +1 -1
  27. package/dist/browser-DE3d-RLk.d.ts +275 -0
  28. package/dist/browser-tool-CQ10e6Kj.js +480 -0
  29. package/dist/browser-tool-CQ10e6Kj.js.map +1 -0
  30. package/dist/browser-tool-DuNdlwZ9.d.ts +73 -0
  31. package/dist/{capability-BjSKYpzg.js → capability-B4WbF81e.js} +2 -1
  32. package/dist/capability-B4WbF81e.js.map +1 -0
  33. package/dist/{capability-runner-Be_-PLR1.d.ts → capability-runner-DBAnGr6L.d.ts} +45 -15
  34. package/dist/chat/index.d.ts +341 -232
  35. package/dist/chat/index.js +602 -72
  36. package/dist/chat/index.js.map +1 -1
  37. package/dist/chat/react.d.ts +42 -2
  38. package/dist/chat/react.js +191 -35
  39. package/dist/chat/react.js.map +1 -1
  40. package/dist/chat/transport.d.ts +1 -1
  41. package/dist/chat/transport.js +1 -1
  42. package/dist/chat-sdk/index.d.ts +17 -3
  43. package/dist/chat-sdk/index.js +28 -2
  44. package/dist/chat-sdk/index.js.map +1 -1
  45. package/dist/client-4OlMIJx-.js +591 -0
  46. package/dist/client-4OlMIJx-.js.map +1 -0
  47. package/dist/{client-jagG8a9_.js → client-fyQrLGkD.js} +2 -2
  48. package/dist/{client-jagG8a9_.js.map → client-fyQrLGkD.js.map} +1 -1
  49. package/dist/client-je3koD9Z.d.ts +446 -0
  50. package/dist/client.d.ts +29 -283
  51. package/dist/client.js +2 -274
  52. package/dist/{connector-CptFKzRh.js → connector-58XDGvc3.js} +251 -120
  53. package/dist/connector-58XDGvc3.js.map +1 -0
  54. package/dist/{connector-CkQD4MK3.d.ts → connector-Cl-VqPmA.d.ts} +244 -146
  55. package/dist/context/index.d.ts +29 -0
  56. package/dist/context/index.js +64 -17
  57. package/dist/context/index.js.map +1 -1
  58. package/dist/current-agent-DhoDkSnH.js.map +1 -1
  59. package/dist/current-agent-vAk_5JMt.d.ts +93 -0
  60. package/dist/{current-agent-Da_C9a3b.d.ts → durable-object-lifecycle-HhgOMWq9.d.ts} +26 -127
  61. package/dist/harnesses/pi/index.d.ts +348 -0
  62. package/dist/harnesses/pi/index.js +754 -0
  63. package/dist/harnesses/pi/index.js.map +1 -0
  64. package/dist/images-iiTDSyRu.js +1631 -0
  65. package/dist/images-iiTDSyRu.js.map +1 -0
  66. package/dist/index-BreL0YrQ.d.ts +78 -0
  67. package/dist/index-kbSUIer3.d.ts +343 -0
  68. package/dist/index.d.ts +43 -41
  69. package/dist/index.js +2 -2
  70. package/dist/internal_context.d.ts +1 -1
  71. package/dist/lifecycle/index.d.ts +19 -17
  72. package/dist/lifecycle/index.js +2 -2
  73. package/dist/{lifecycle-CMRGjZdw.js → lifecycle-CFu6OV03.js} +73 -29
  74. package/dist/lifecycle-CFu6OV03.js.map +1 -0
  75. package/dist/mcp/client/index.d.ts +20 -20
  76. package/dist/mcp/client/index.js +1 -1
  77. package/dist/mcp/client/x402.js +21 -19
  78. package/dist/mcp/client/x402.js.map +1 -1
  79. package/dist/mcp/index.d.ts +35 -35
  80. package/dist/mcp/index.js +2 -2
  81. package/dist/{message-builder-BymO4N_D.js → message-builder-DAl9AhHH.js} +89 -4
  82. package/dist/message-builder-DAl9AhHH.js.map +1 -0
  83. package/dist/models/ai-sdk/index.d.ts +353 -0
  84. package/dist/models/ai-sdk/index.js +2443 -0
  85. package/dist/models/ai-sdk/index.js.map +1 -0
  86. package/dist/models/pi-ai/index.d.ts +313 -0
  87. package/dist/models/pi-ai/index.js +1795 -0
  88. package/dist/models/pi-ai/index.js.map +1 -0
  89. package/dist/observability/ai/index.js +20 -4
  90. package/dist/observability/ai/index.js.map +1 -1
  91. package/dist/{protocol-B0nh6KNf.js → protocol-kHsr-f0X.js} +26 -12
  92. package/dist/{protocol-B0nh6KNf.js.map → protocol-kHsr-f0X.js.map} +1 -1
  93. package/dist/queue/index.d.ts +123 -0
  94. package/dist/queue/index.js +2 -0
  95. package/dist/queue-BB-zfIYF.js +406 -0
  96. package/dist/queue-BB-zfIYF.js.map +1 -0
  97. package/dist/react.d.ts +31 -13
  98. package/dist/react.js +190 -71
  99. package/dist/react.js.map +1 -1
  100. package/dist/{retries-D9Ds-1lz.d.ts → retries-CV6AkXmQ.d.ts} +23 -8
  101. package/dist/retries.d.ts +12 -8
  102. package/dist/retries.js +19 -1
  103. package/dist/retries.js.map +1 -1
  104. package/dist/routing/index.d.ts +2 -2
  105. package/dist/routing/index.js +1 -1
  106. package/dist/{scheduler-DD9NdYbF.js → scheduler-DZ3xQfeK.js} +4 -11
  107. package/dist/scheduler-DZ3xQfeK.js.map +1 -0
  108. package/dist/{scheduler-Dwh85ZGl.d.ts → scheduler-RdACNXDP.d.ts} +6 -6
  109. package/dist/schedules/index.d.ts +1 -1
  110. package/dist/schedules/index.js +1 -1
  111. package/dist/serializable.d.ts +1 -1
  112. package/dist/sessions/index.d.ts +70 -3
  113. package/dist/sessions/index.js +276 -67
  114. package/dist/sessions/index.js.map +1 -1
  115. package/dist/skills/index.d.ts +29 -314
  116. package/dist/socket-address.d.ts +16 -0
  117. package/dist/socket-address.js +19 -0
  118. package/dist/socket-address.js.map +1 -0
  119. package/dist/{src-DlSHshb2.js → src-BZeu-SCD.js} +541 -500
  120. package/dist/src-BZeu-SCD.js.map +1 -0
  121. package/dist/state/index.d.ts +6 -0
  122. package/dist/state/index.js +137 -0
  123. package/dist/state/index.js.map +1 -0
  124. package/dist/streams/index.d.ts +1 -1
  125. package/dist/streams/index.js +1 -1
  126. package/dist/{streams-D6tJ0NN9.d.ts → streams-Cmkj9QfW.d.ts} +4 -2
  127. package/dist/{streams-DZKgAj9b.js → streams-DW-UCOUc.js} +9 -2
  128. package/dist/streams-DW-UCOUc.js.map +1 -0
  129. package/dist/sub-routing.d.ts +12 -12
  130. package/dist/tasks/index.d.ts +1 -1
  131. package/dist/tasks/index.js +1 -1
  132. package/dist/{tasks-ylZgBjhj.js → tasks-68DESxf0.js} +3 -3
  133. package/dist/{tasks-ylZgBjhj.js.map → tasks-68DESxf0.js.map} +1 -1
  134. package/dist/{tasks-BRJ5zgya.d.ts → tasks-9YxYtByh.d.ts} +5 -5
  135. package/dist/transport-PfFnt-Ld.d.ts +525 -0
  136. package/dist/transport-protocol-BxyngQ_R.js +25 -0
  137. package/dist/transport-protocol-BxyngQ_R.js.map +1 -0
  138. package/dist/transport-protocol-ZTew5Wso.d.ts +27 -0
  139. package/dist/types-BA4anrjI.d.ts +70 -0
  140. package/dist/voice/index.d.ts +2 -2
  141. package/dist/websockets/index.d.ts +195 -69
  142. package/dist/websockets/index.js +3 -2
  143. package/dist/websockets-Ci-LZFHH.js +1030 -0
  144. package/dist/websockets-Ci-LZFHH.js.map +1 -0
  145. package/dist/wire-types-CnMt6_HR.js.map +1 -1
  146. package/dist/wire-types-CrjKvDyi.d.ts +300 -0
  147. package/dist/workflow-types.d.ts +25 -25
  148. package/dist/workflows.d.ts +21 -21
  149. package/dist/workflows.js +1 -1
  150. package/dist/{ws-chat-transport-UNRIS2xl.d.ts → ws-chat-transport-BbT1A5Lc.d.ts} +51 -2
  151. package/dist/{ws-chat-transport-rWwta645.js → ws-chat-transport-cqMKq3IY.js} +143 -16
  152. package/dist/ws-chat-transport-cqMKq3IY.js.map +1 -0
  153. package/docs/agent-class.md +2 -2
  154. package/docs/agent-tools.md +29 -4
  155. package/docs/browse-the-web.md +87 -5
  156. package/docs/chat-agents.md +124 -16
  157. package/docs/client-sdk.md +30 -0
  158. package/docs/context.md +27 -0
  159. package/docs/durable-execution.md +2 -0
  160. package/docs/harnesses/pi.md +91 -0
  161. package/docs/human-in-the-loop.md +4 -0
  162. package/docs/index.md +4 -1
  163. package/docs/lifecycle.md +114 -23
  164. package/docs/models-pi-ai.md +325 -0
  165. package/docs/models.md +504 -0
  166. package/docs/queue.md +135 -241
  167. package/docs/resumable-streaming.md +2 -0
  168. package/docs/retries.md +1 -1
  169. package/docs/routing.md +13 -13
  170. package/docs/sessions.md +36 -1
  171. package/docs/state.md +1 -0
  172. package/docs/sub-agents.md +12 -3
  173. package/package.json +51 -3
  174. package/dist/agent-tools-y7zLfw4Q.js.map +0 -1
  175. package/dist/browser/ai.js.map +0 -1
  176. package/dist/capability-BjSKYpzg.js.map +0 -1
  177. package/dist/client-tools-aIBO0Fk7.d.ts +0 -53
  178. package/dist/client.js.map +0 -1
  179. package/dist/connector-CptFKzRh.js.map +0 -1
  180. package/dist/lifecycle-CMRGjZdw.js.map +0 -1
  181. package/dist/message-builder-BymO4N_D.js.map +0 -1
  182. package/dist/scheduler-DD9NdYbF.js.map +0 -1
  183. package/dist/src-DlSHshb2.js.map +0 -1
  184. package/dist/streams-DZKgAj9b.js.map +0 -1
  185. package/dist/websockets-DUfRHPRq.js +0 -502
  186. package/dist/websockets-DUfRHPRq.js.map +0 -1
  187. package/dist/ws-chat-transport-rWwta645.js.map +0 -1
@@ -1,20 +1,20 @@
1
1
  import {
2
- _ as LifecycleJobOutcome,
3
- b as Connection,
4
- g as LifecycleJobContext,
2
+ S as ConnectionContext,
3
+ T as WSMessage,
4
+ _ as LifecycleJobContext,
5
5
  o as MemoryLimitContext,
6
6
  s as LifecycleCapability,
7
7
  t as CapabilityRequestContext,
8
8
  u as LifecycleRouteAddress,
9
- w as WSMessage,
10
- x as ConnectionContext
11
- } from "./capability-runner-Be_-PLR1.js";
12
- import { t as RetryOptions } from "./retries-D9Ds-1lz.js";
9
+ v as LifecycleJobOutcome,
10
+ x as Connection
11
+ } from "./capability-runner-DBAnGr6L.js";
12
+ import { t as RetryOptions } from "./retries-CV6AkXmQ.js";
13
13
  import {
14
- c as LifecycleRouteEnvelope,
15
- n as CurrentAgentContext,
16
- o as Lifecycle
17
- } from "./current-agent-Da_C9a3b.js";
14
+ r as LifecycleRouteEnvelope,
15
+ t as Lifecycle
16
+ } from "./durable-object-lifecycle-HhgOMWq9.js";
17
+ import { n as CurrentAgentContext } from "./current-agent-vAk_5JMt.js";
18
18
  import { t as AgentEmail } from "./internal_context-BlxFEWfn.js";
19
19
  import { r as EmailResolver, s as SendEmailOptions } from "./email-7TatiTnl.js";
20
20
  import {
@@ -41,8 +41,10 @@ import {
41
41
  i as Schedule,
42
42
  o as ScheduleOptions,
43
43
  t as Scheduler
44
- } from "./scheduler-Dwh85ZGl.js";
45
- import { l as TaskHandlers, r as Tasks } from "./tasks-BRJ5zgya.js";
44
+ } from "./scheduler-RdACNXDP.js";
45
+ import { i as QueueItem } from "./types-BA4anrjI.js";
46
+ import { l as TaskHandlers, r as Tasks } from "./tasks-9YxYtByh.js";
47
+ import { t as State } from "./index-BreL0YrQ.js";
46
48
  import { t as CallableMetadata } from "./callable-decorator-DP__HhBA.js";
47
49
  import { AsyncLocalStorage } from "node:async_hooks";
48
50
  import {
@@ -405,6 +407,11 @@ type RootFacetRpcSurface = {
405
407
  connectionId: string,
406
408
  state: unknown
407
409
  ): Promise<unknown>;
410
+ _cf_closeSubAgentConnectionsForPrefix(
411
+ prefix: ReadonlyArray<AgentPathStep>,
412
+ code: number,
413
+ reason: string
414
+ ): Promise<void>;
408
415
  };
409
416
  //#endregion
410
417
  //#region src/dynamic-agents/bridges.d.ts
@@ -547,9 +554,6 @@ interface DynamicAgentHostPort {
547
554
  ): boolean;
548
555
  hasSubAgent(className: string, name: string): boolean;
549
556
  _cf_resolveSubAgent(className: string, name: string): Promise<unknown>;
550
- _cf_cleanupFacetPrefix(
551
- ownerPath: ReadonlyArray<AgentPathStep>
552
- ): Promise<void>;
553
557
  _cf_routeLifecycle(
554
558
  target: LifecycleRouteAddress | undefined,
555
559
  envelope: LifecycleRouteEnvelope
@@ -561,6 +565,9 @@ interface DynamicAgentHostPort {
561
565
  readonly tasks: {
562
566
  __DO_NOT_USE_WILL_BREAK__cleanupRoutePrefix(prefix: string): Promise<void>;
563
567
  };
568
+ readonly _queue: {
569
+ __DO_NOT_USE_WILL_BREAK__cleanupRoutePrefix(prefix: string): Promise<void>;
570
+ };
564
571
  /** Local (non-facet-index) durable fiber recovery pass. */
565
572
  _checkRunFibers(): Promise<void>;
566
573
  /** Overridable RPC entry points — call via the host so subclass overrides intercept. */
@@ -586,20 +593,12 @@ interface DynamicAgentHostPort {
586
593
  tag?: string
587
594
  ): Iterable<Connection<TState>>;
588
595
  };
589
- _ensureConnectionWrapped(connection: Connection): void;
590
596
  _unsafe_getConnectionFlag(connection: Connection, key: string): unknown;
591
597
  _unsafe_setConnectionFlag(
592
598
  connection: Connection,
593
599
  key: string,
594
600
  value: unknown
595
601
  ): void;
596
- readonly _rawStateAccessors: {
597
- get(connection: Connection):
598
- | {
599
- getRaw(): unknown;
600
- }
601
- | undefined;
602
- };
603
602
  shouldConnectionBeReadonly(
604
603
  connection: Connection,
605
604
  context: {
@@ -613,7 +612,6 @@ interface DynamicAgentHostPort {
613
612
  request: Request;
614
613
  }
615
614
  ): boolean;
616
- _setConnectionNoProtocol(connection: Connection): void;
617
615
  getConnectionTags(
618
616
  connection: Connection,
619
617
  context: {
@@ -692,8 +690,9 @@ declare class DynamicAgentsInternal extends LifecycleCapability {
692
690
  rootResolvesToSelf(): boolean;
693
691
  /**
694
692
  * Clean root-owned bookkeeping for a sub-tree of facets: bulk-cancel
695
- * schedules and routed Task wake mirrors under the owner-path prefix,
696
- * and delete root-side facet fiber recovery leases for the same sub-tree.
693
+ * schedules, queue items, and routed Task wake mirrors under the
694
+ * owner-path prefix, and delete root-side facet fiber recovery leases for
695
+ * the same sub-tree.
697
696
  */
698
697
  cleanupPrefix(ownerPath: ReadonlyArray<AgentPathStep>): Promise<void>;
699
698
  /**
@@ -764,6 +763,12 @@ declare class DynamicAgentsInternal extends LifecycleCapability {
764
763
  * storage. Transitively deletes the child's own children.
765
764
  */
766
765
  delete(className: string, name: string): Promise<void>;
766
+ /** Root-side: close sockets whose `/sub/...` target is under `prefix`. */
767
+ closeConnectionsForPrefix(
768
+ prefix: ReadonlyArray<AgentPathStep>,
769
+ code: number,
770
+ reason: string
771
+ ): void;
767
772
  /** Drop all facet-side virtual connections (test/rehydration hook). */
768
773
  clearVirtualConnections(): void;
769
774
  /** Facet-side lookup of a virtual connection by id. */
@@ -3688,6 +3693,20 @@ declare const AGENT_TOOL_PROGRESS_PART = "data-agent-progress";
3688
3693
  * re-resolves milestone waiters. See `design/rfc-detached-agent-tools.md`.
3689
3694
  */
3690
3695
  declare const AGENT_TOOL_MILESTONE_PART = "data-agent-milestone";
3696
+ /**
3697
+ * Whether a chunk body is a progress or milestone frame. These are broadcast
3698
+ * but never written to the child's chunk store, so they have no stored-chunk
3699
+ * position and must not take part in stored-position numbering or dedupe.
3700
+ */
3701
+ declare function isAgentToolLifecycleChunk(body: string): boolean;
3702
+ /**
3703
+ * Whether a forwarded chunk has no stored-chunk position: a progress or
3704
+ * milestone frame, or a chunk too large to store. Such chunks carry the next
3705
+ * stored position without consuming it.
3706
+ */
3707
+ declare function isPositionlessAgentToolChunk(
3708
+ chunk: AgentToolStoredChunk
3709
+ ): boolean;
3691
3710
  /**
3692
3711
  * Ephemeral progress signal a running sub-agent emits with `reportProgress`. The
3693
3712
  * well-known fields drive generic UI (a bar + status line) with no per-app
@@ -3854,7 +3873,17 @@ type RunAgentToolOptions<Input = unknown, Self = Record<string, unknown>> = {
3854
3873
  * must outlive the spawning turn; cancel it explicitly via `cancelAgentTool`.
3855
3874
  */
3856
3875
  detached?: boolean | DetachedAgentToolConfig<Self>;
3876
+ /**
3877
+ * Which child events reach the parent's clients. `"full"` (default) forwards
3878
+ * every streamed chunk. `"terminal"` forwards only lifecycle events: started,
3879
+ * progress and milestone frames, and the terminal event. The child still
3880
+ * persists its whole stream, and the parent still tails it for completion,
3881
+ * cancellation, progress and recovery. Use it for a headless parent with no
3882
+ * client watching the child. Not supported with `detached`.
3883
+ */
3884
+ eventDelivery?: AgentToolEventDelivery;
3857
3885
  };
3886
+ type AgentToolEventDelivery = "full" | "terminal";
3858
3887
  /**
3859
3888
  * Result of dispatching a detached run. Returns immediately after dispatch
3860
3889
  * rather than after completion.
@@ -3918,6 +3947,12 @@ type AgentToolRunInspection<Output = unknown> = {
3918
3947
  type AgentToolStoredChunk = {
3919
3948
  sequence: number;
3920
3949
  body: string;
3950
+ /**
3951
+ * Set when the child broadcast this chunk but could not store it (it exceeds
3952
+ * the stored-chunk size limit). The chunk is never replayed, so it carries
3953
+ * the next stored position without consuming it and dedupes on this id.
3954
+ */
3955
+ unstoredId?: string;
3921
3956
  };
3922
3957
  type AgentToolChildAdapter<Input = unknown, Output = unknown> = {
3923
3958
  startAgentToolRun(
@@ -3925,11 +3960,23 @@ type AgentToolChildAdapter<Input = unknown, Output = unknown> = {
3925
3960
  options: {
3926
3961
  runId: string;
3927
3962
  signal?: AbortSignal;
3963
+ /**
3964
+ * `"terminal"` means no client is watching this run's chunks, so the
3965
+ * child can skip broadcasting them.
3966
+ */
3967
+ eventDelivery?: AgentToolEventDelivery;
3928
3968
  }
3929
3969
  ): Promise<AgentToolRunInspection<Output>>;
3930
3970
  cancelAgentToolRun(runId: string, reason?: unknown): Promise<void>;
3931
3971
  inspectAgentToolRun(
3932
- runId: string
3972
+ runId: string,
3973
+ options?: {
3974
+ /**
3975
+ * `false` reports the stored row as-is instead of first reconciling
3976
+ * (and possibly sealing) a stale run. Defaults to `true`.
3977
+ */
3978
+ reconcile?: boolean;
3979
+ }
3933
3980
  ): Promise<AgentToolRunInspection<Output> | null>;
3934
3981
  getAgentToolChunks(
3935
3982
  runId: string,
@@ -3957,7 +4004,8 @@ type AgentToolEvent =
3957
4004
  | {
3958
4005
  kind: "chunk";
3959
4006
  runId: string;
3960
- body: string;
4007
+ body: string /** See {@link AgentToolStoredChunk.unstoredId}. */;
4008
+ unstoredId?: string;
3961
4009
  }
3962
4010
  | {
3963
4011
  kind: "finished";
@@ -4083,13 +4131,6 @@ type RPCResponse = {
4083
4131
  error: string;
4084
4132
  }
4085
4133
  );
4086
- type QueueItem<T = string> = {
4087
- id: string;
4088
- payload: T;
4089
- callback: keyof Agent<Cloudflare.Env>;
4090
- created_at: number;
4091
- retry?: RetryOptions;
4092
- };
4093
4134
  type DetachedReconcilePayload = {
4094
4135
  cadenceIndex?: number;
4095
4136
  };
@@ -4327,9 +4368,9 @@ declare const DEFAULT_AGENT_STATIC_OPTIONS: {
4327
4368
  /**
4328
4369
  * Optional hard wall-clock ceiling (ms) on a single agent-tool re-attach
4329
4370
  * (#1630). Caps the total wait even as the no-progress budget re-arms across
4330
- * stream-closes. Defaults to `Infinity` (no implicit cap), mirroring
4331
- * chat-recovery's `maxRecoveryWork` (#1672): a healthy, still-advancing child
4332
- * is followed for as long as it makes progress — a hung child is bounded by
4371
+ * stream-closes. Defaults to `Infinity` (no implicit cap, #1672): a healthy,
4372
+ * still-advancing child is followed for as long as it makes progress — a
4373
+ * hung child is bounded by
4333
4374
  * the no-progress budget, and a content-runaway by the child's own
4334
4375
  * `maxRecoveryWork` / `shouldKeepRecovering`. Set a finite value to impose a
4335
4376
  * wall-clock cap (which also tears the child down on `window-exceeded`).
@@ -4399,9 +4440,9 @@ interface AgentStaticOptions {
4399
4440
  /**
4400
4441
  * Optional hard wall-clock ceiling in milliseconds on a single agent-tool
4401
4442
  * re-attach (#1630). Caps the total wait even as the no-progress budget
4402
- * re-arms across stream-closes. Default: `Infinity` (no implicit cap),
4403
- * mirroring chat-recovery's `maxRecoveryWork` (#1672) — a healthy,
4404
- * still-advancing child is followed for as long as it makes progress, exactly
4443
+ * re-arms across stream-closes. Default: `Infinity` (no implicit cap,
4444
+ * #1672) — a healthy, still-advancing child is followed for as long as it
4445
+ * makes progress, exactly
4405
4446
  * as on the live (never-evicted) path. Set a finite value to impose a
4406
4447
  * wall-clock cap (which also tears the child down on `window-exceeded`); `0`
4407
4448
  * also disables the ceiling.
@@ -4466,12 +4507,12 @@ type WorkflowName<E> = WorkflowBinding<E> | (string & {});
4466
4507
  /**
4467
4508
  * Base class for creating Agent implementations
4468
4509
  * @template Env Environment type containing bindings
4469
- * @template State State type to store within the Agent
4510
+ * @template TState State type to store within the Agent
4470
4511
  */
4471
4512
  declare class Agent<
4472
4513
  Env extends Cloudflare.Env = Cloudflare.Env,
4473
- State = unknown,
4474
- Props extends Record<string, unknown> = Record<string, unknown>
4514
+ TState = unknown,
4515
+ Props extends object = object
4475
4516
  > extends DurableObject<Env> {
4476
4517
  /**
4477
4518
  * Runtime lifecycle and reusable durable capabilities for this Agent.
@@ -4489,6 +4530,16 @@ declare class Agent<
4489
4530
  * from paths that do not pass through the capability (facet bridging,
4490
4531
  * direct calls).
4491
4532
  */
4533
+ /**
4534
+ * Durable state: the `cf_agents_state` row, lazy load, validated persistence.
4535
+ * `initialState` stays on Agent (a subclass field, initialized after this
4536
+ * one) and is seeded by the `state` getter. Typed `<unknown>` rather than
4537
+ * `<TState>` because `TState` appears in both `get()` and `set()` positions,
4538
+ * which would make `Agent`'s own `TState` parameter invariant and break
4539
+ * `Subclass -> Agent<Env, unknown>` assignability; the typed boundary is
4540
+ * re-established in `state` / `setState`.
4541
+ */
4542
+ readonly _state: State<unknown>;
4492
4543
  private readonly _webSockets;
4493
4544
  /** Run user initialization after lifecycle components have started. */
4494
4545
  onStart(_props?: Props): void | Promise<void>;
@@ -4515,7 +4566,6 @@ declare class Agent<
4515
4566
  ): string[] | Promise<string[]>;
4516
4567
  /** @internal Ensure lifecycle startup before a native RPC implementation. */
4517
4568
  __unsafe_ensureInitialized(props?: Props): Promise<void>;
4518
- private _state;
4519
4569
  private _disposables;
4520
4570
  private _destroyed;
4521
4571
  /**
@@ -4523,7 +4573,6 @@ declare class Agent<
4523
4573
  * Used by internal flag methods (readonly, no-protocol) to read/write
4524
4574
  * _cf_-prefixed keys without going through the user-facing state/setState.
4525
4575
  */
4526
- private _rawStateAccessors;
4527
4576
  /**
4528
4577
  * Cached persistence-hook dispatch mode, computed once in the constructor.
4529
4578
  * - "new" → call onStateChanged
@@ -4616,6 +4665,12 @@ declare class Agent<
4616
4665
  * cancelSchedule() methods are the stable surface.
4617
4666
  */
4618
4667
  readonly scheduler: Scheduler;
4668
+ /**
4669
+ * Durable background-work capability installed into this Agent's
4670
+ * Lifecycle. Agent's queue()/dequeue()/dequeueAll()/dequeueAllByCallback()/
4671
+ * getQueue()/getQueues() methods are its surface.
4672
+ */
4673
+ private readonly _queue;
4619
4674
  /**
4620
4675
  * Durable replayable execution capability installed into this Agent's
4621
4676
  * Lifecycle. Declare definitions on the overridable
@@ -4647,7 +4702,7 @@ declare class Agent<
4647
4702
  * Initial state for the Agent
4648
4703
  * Override to provide default state values
4649
4704
  */
4650
- initialState: State;
4705
+ initialState: TState;
4651
4706
  /**
4652
4707
  * Stable key for Workers AI session affinity (prefix-cache optimization).
4653
4708
  *
@@ -4667,9 +4722,12 @@ declare class Agent<
4667
4722
  */
4668
4723
  get sessionAffinity(): string;
4669
4724
  /**
4670
- * Current state of the Agent
4725
+ * Current state of the Agent.
4726
+ *
4727
+ * Delegates to the State capability, which owns lazy load and the
4728
+ * in-memory cache; Agent seeds `initialState` on first access.
4671
4729
  */
4672
- get state(): State;
4730
+ get state(): TState;
4673
4731
  /**
4674
4732
  * Agent configuration options.
4675
4733
  * Override in subclasses - only specify what you want to change.
@@ -4722,6 +4780,14 @@ declare class Agent<
4722
4780
  * local dev and the constructor only runs once per DO instance).
4723
4781
  */
4724
4782
  protected _ensureSchema(): void;
4783
+ /**
4784
+ * Read the Agent's schema version from its KV key. A DO created before the
4785
+ * State capability owned `cf_agents_state` has the version as a row in that
4786
+ * table instead: read it once, move it to the key, and delete the row so the
4787
+ * table is left with a single owner. Synchronous (`storage.kv`) because the
4788
+ * constructor gates DDL on it.
4789
+ */
4790
+ private _readSchemaVersion;
4725
4791
  constructor(ctx: AgentContext, env: Env);
4726
4792
  private _restoreAgentFacetContext;
4727
4793
  /**
@@ -4736,26 +4802,20 @@ declare class Agent<
4736
4802
  * @param excludeIds Additional connection IDs to exclude (e.g. the source)
4737
4803
  */
4738
4804
  private _broadcastProtocol;
4739
- private _setStateInternal;
4805
+ /**
4806
+ * React to a persisted state change from the State capability.
4807
+ *
4808
+ * Reproduces the pre-migration steps 3-4: broadcast the new state to
4809
+ * protocol-enabled connections (excluding the originating connection) and
4810
+ * run the notification hook off the invocation tail.
4811
+ */
4812
+ private _handleStateChanged;
4740
4813
  /**
4741
4814
  * Update the Agent's state
4742
4815
  * @param state New state to set
4743
4816
  * @throws Error if called from a readonly connection context
4744
4817
  */
4745
- setState(state: State): void;
4746
- /**
4747
- * Wraps connection.state and connection.setState so that internal
4748
- * _cf_-prefixed flags (readonly, no-protocol) are hidden from user code
4749
- * and cannot be accidentally overwritten.
4750
- *
4751
- * Idempotent — safe to call multiple times on the same connection.
4752
- * After hibernation, the _rawStateAccessors WeakMap is empty but the
4753
- * connection's state getter still reads from the persisted WebSocket
4754
- * attachment. Calling this method re-captures the raw getter so that
4755
- * predicate methods (isConnectionReadonly, isConnectionProtocolEnabled)
4756
- * work correctly post-hibernation.
4757
- */
4758
- private _ensureConnectionWrapped;
4818
+ setState(state: TState): void;
4759
4819
  /**
4760
4820
  * Mark a connection as readonly or readwrite
4761
4821
  * @param connection The connection to mark
@@ -4789,8 +4849,8 @@ declare class Agent<
4789
4849
  *
4790
4850
  * Write an internal `_cf_`-prefixed flag to the raw connection state,
4791
4851
  * bypassing the user-facing state wrapper. The key must be registered
4792
- * in `CF_INTERNAL_KEYS` so it is preserved across user `setState` calls
4793
- * and hidden from `connection.state`.
4852
+ * with `registerInternalConnectionKeys` so it is preserved across user
4853
+ * `setState` calls and hidden from `connection.state`.
4794
4854
  *
4795
4855
  * @internal
4796
4856
  */
@@ -4840,18 +4900,13 @@ declare class Agent<
4840
4900
  * @returns True if the connection receives protocol messages
4841
4901
  */
4842
4902
  isConnectionProtocolEnabled(connection: Connection): boolean;
4843
- /**
4844
- * Mark a connection as having protocol messages disabled.
4845
- * Called internally when shouldSendProtocolMessages returns false.
4846
- */
4847
- private _setConnectionNoProtocol;
4848
4903
  /**
4849
4904
  * Called before the Agent's state is persisted and broadcast.
4850
4905
  * Override to validate or reject an update by throwing an error.
4851
4906
  *
4852
4907
  * IMPORTANT: This hook must be synchronous.
4853
4908
  */
4854
- validateStateChange(_nextState: State, _source: Connection | "server"): void;
4909
+ validateStateChange(_nextState: TState, _source: Connection | "server"): void;
4855
4910
  /**
4856
4911
  * Called after the Agent's state has been persisted and broadcast to all clients.
4857
4912
  * This is a notification hook — errors here are routed to onError and do not
@@ -4861,7 +4916,7 @@ declare class Agent<
4861
4916
  * @param source Source of the state update ("server" or a client connection)
4862
4917
  */
4863
4918
  onStateChanged(
4864
- _state: State | undefined,
4919
+ _state: TState | undefined,
4865
4920
  _source: Connection | "server"
4866
4921
  ): void;
4867
4922
  /**
@@ -4876,7 +4931,7 @@ declare class Agent<
4876
4931
  * @param source Source of the state update ("server" or a client connection)
4877
4932
  */
4878
4933
  onStateUpdate(
4879
- _state: State | undefined,
4934
+ _state: TState | undefined,
4880
4935
  _source: Connection | "server"
4881
4936
  ): void;
4882
4937
  /**
@@ -4974,11 +5029,16 @@ declare class Agent<
4974
5029
  }
4975
5030
  ): Promise<T>;
4976
5031
  /**
4977
- * Queue a task to be executed in the future
5032
+ * Queue a task to run in the background.
5033
+ *
5034
+ * The item is durable: it runs from the Lifecycle alarm event loop after
5035
+ * this call returns, in push order, one at a time, with retries per
5036
+ * `options.retry`, and survives the Durable Object leaving memory.
4978
5037
  * @param callback Name of the method to call
4979
5038
  * @param payload Payload to pass to the callback
4980
5039
  * @param options Options for the queued task
4981
5040
  * @param options.retry Retry options for the callback execution
5041
+ * @param options.id Stable id; a push with an existing id replaces that item
4982
5042
  * @returns The ID of the queued task
4983
5043
  */
4984
5044
  queue<T = unknown>(
@@ -4986,37 +5046,36 @@ declare class Agent<
4986
5046
  payload: T,
4987
5047
  options?: {
4988
5048
  retry?: RetryOptions;
5049
+ id?: string;
4989
5050
  }
4990
5051
  ): Promise<string>;
4991
- private _flushingQueue;
4992
- private _flushQueue;
4993
5052
  /**
4994
5053
  * Dequeue a task by ID
4995
5054
  * @param id ID of the task to dequeue
4996
5055
  */
4997
- dequeue(id: string): void;
5056
+ dequeue(id: string): Promise<boolean>;
4998
5057
  /**
4999
5058
  * Dequeue all tasks
5000
5059
  */
5001
- dequeueAll(): void;
5060
+ dequeueAll(): Promise<number>;
5002
5061
  /**
5003
5062
  * Dequeue all tasks by callback
5004
5063
  * @param callback Name of the callback to dequeue
5005
5064
  */
5006
- dequeueAllByCallback(callback: string): void;
5065
+ dequeueAllByCallback(callback: string): Promise<number>;
5007
5066
  /**
5008
5067
  * Get a queued task by ID
5009
5068
  * @param id ID of the task to get
5010
5069
  * @returns The task or undefined if not found
5011
5070
  */
5012
- getQueue(id: string): QueueItem<string> | undefined;
5071
+ getQueue<T = unknown>(id: string): Promise<QueueItem<T> | undefined>;
5013
5072
  /**
5014
- * Get all queues by key and value
5073
+ * Get all queued tasks whose payload has `key` equal to `value`
5015
5074
  * @param key Key to filter by
5016
5075
  * @param value Value to filter by
5017
5076
  * @returns Array of matching QueueItem objects
5018
5077
  */
5019
- getQueues(key: string, value: string): QueueItem<string>[];
5078
+ getQueues<T = unknown>(key: string, value: string): Promise<QueueItem<T>[]>;
5020
5079
  private _lifecycleRouteAddress;
5021
5080
  private _routeLifecycleToRoot;
5022
5081
  private _routeLifecycleToTarget;
@@ -5493,6 +5552,11 @@ declare class Agent<
5493
5552
  code?: number,
5494
5553
  reason?: string
5495
5554
  ): Promise<void>;
5555
+ _cf_closeSubAgentConnectionsForPrefix(
5556
+ prefix: ReadonlyArray<AgentPathStep>,
5557
+ code: number,
5558
+ reason: string
5559
+ ): Promise<void>;
5496
5560
  _cf_setSubAgentConnectionState(
5497
5561
  connectionId: string,
5498
5562
  state: unknown
@@ -5916,8 +5980,23 @@ declare class Agent<
5916
5980
  private _stringifyAgentToolOutput;
5917
5981
  private _broadcastAgentToolEvent;
5918
5982
  private _broadcastAgentToolChunks;
5983
+ private _isTerminalOnlyAgentToolRun;
5919
5984
  private _broadcastAgentToolStoredChunks;
5985
+ /**
5986
+ * One budget shared by every step of a bounded recovery read, so a run's
5987
+ * total time stays within `timeoutMs`. Returns the remaining milliseconds,
5988
+ * never below 1 because a non-positive timeout means "unbounded".
5989
+ */
5990
+ private _agentToolRecoveryDeadline;
5920
5991
  private _broadcastAgentToolStoredChunksFromAdapter;
5992
+ /**
5993
+ * Milestones are persisted on the child run rather than in its chunk log, so
5994
+ * replay re-emits them from the child's inspection. The client dedupes them
5995
+ * on the milestone's own sequence, so a milestone already seen live is a no-op.
5996
+ * They carry the next stored-chunk sequence without consuming it, matching
5997
+ * the live path.
5998
+ */
5999
+ private _broadcastAgentToolMilestones;
5921
6000
  private _forwardAgentToolStream;
5922
6001
  /**
5923
6002
  * Hook invoked by `_forwardAgentToolStream` after a child produces output that
@@ -6011,9 +6090,9 @@ declare class Agent<
6011
6090
  * dies and recovers again during deploy churn is still collected. A genuinely
6012
6091
  * silent/hung child can never block recovery forever: it seals `interrupted`
6013
6092
  * after one `noProgressTimeoutMs` window. `maxWindowMs` is an OPTIONAL hard
6014
- * wall-clock ceiling (default `Infinity` — uncapped, mirroring #1672's
6015
- * `maxRecoveryWork`); set it finite to also bound a child that keeps
6016
- * progressing, which seals `window-exceeded` and tears the child down.
6093
+ * wall-clock ceiling (default `Infinity` — uncapped, #1672); set it finite
6094
+ * to also bound a child that keeps progressing, which seals
6095
+ * `window-exceeded` and tears the child down.
6017
6096
  *
6018
6097
  * Returns the terminal `result` (and `completedAt`) when the child reaches a
6019
6098
  * terminal status, plus the advanced broadcast `sequence`. Returns
@@ -6029,6 +6108,8 @@ declare class Agent<
6029
6108
  private _scheduleAgentToolRunRecovery;
6030
6109
  private _agentToolRunRecoveryRunIds;
6031
6110
  private _getAgentToolChunksForRecovery;
6111
+ /** Resolve to `undefined` when `promise` rejects or outlasts `timeoutMs`. */
6112
+ private _settleWithinRecoveryTimeout;
6032
6113
  /**
6033
6114
  * Shared facet resolution — takes a CamelCase class name string
6034
6115
  * (matching `ctx.exports`) rather than a class reference. Both
@@ -6731,7 +6812,7 @@ interface AgentRouteMatch<Env = Cloudflare.Env> {
6731
6812
  }
6732
6813
  interface AgentRouteOptions<
6733
6814
  Env = Cloudflare.Env,
6734
- Props extends Record<string, unknown> = Record<string, unknown>
6815
+ Props extends object = object
6735
6816
  > {
6736
6817
  /** URL prefix before the binding and instance name. Default: `agents`. */
6737
6818
  prefix?: string;
@@ -6774,10 +6855,7 @@ interface AgentRouteOptions<
6774
6855
  /** Configuration options for {@link routeAgentRequest}. */
6775
6856
  type AgentOptions<Env> = AgentRouteOptions<Env>;
6776
6857
  /** Options for resolving and starting a named Agent. */
6777
- type AgentGetOptions<
6778
- Env,
6779
- Props extends Record<string, unknown> = Record<string, unknown>
6780
- > = Pick<
6858
+ type AgentGetOptions<Env, Props extends object = object> = Pick<
6781
6859
  AgentRouteOptions<Env, Props>,
6782
6860
  "jurisdiction" | "locationHint" | "props" | "routingRetry"
6783
6861
  >;
@@ -6807,7 +6885,7 @@ declare function routeAgentRequest<Env>(
6807
6885
  declare function getAgentByName<
6808
6886
  Env extends Cloudflare.Env = Cloudflare.Env,
6809
6887
  T extends Agent<Env> = Agent<Env>,
6810
- Props extends Record<string, unknown> = Record<string, unknown>
6888
+ Props extends object = object
6811
6889
  >(
6812
6890
  namespace: DurableObjectNamespace<T>,
6813
6891
  name: string,
@@ -6816,143 +6894,145 @@ declare function getAgentByName<
6816
6894
  //#endregion
6817
6895
  export {
6818
6896
  ChatCapableAgentClass as $,
6819
- RPC_DO_PREFIX as $t,
6820
- StreamingResponse as A,
6821
- routeSubAgentRequest as An,
6822
- MCPAITool as At,
6897
+ RPCServerTransport as $t,
6898
+ getCurrentAgent as A,
6899
+ getSubAgentByName as An,
6900
+ ElicitRequest$1 as At,
6823
6901
  AgentToolFailure as B,
6824
- MCPOAuthCallbackResult as Bt,
6902
+ MCPConnectionResult as Bt,
6825
6903
  MCPServersState as C,
6826
- SubAgentPathMatch as Cn,
6827
- WorkflowProgressCallback as Ct,
6828
- StartFiberOptions as D,
6829
- buildSubAgentPathUnchecked as Dn,
6830
- WorkflowTrackingRow as Dt,
6831
- RPCResponse as E,
6832
- buildSubAgentPath as En,
6833
- WorkflowStatus as Et,
6834
- AgentToolChildAdapter as F,
6835
- MCPClientManagerOptions as Ft,
6904
+ BuildAgentPathOptions as Cn,
6905
+ WorkflowInfo as Ct,
6906
+ StartFiberResult as D,
6907
+ buildAgentUrl as Dn,
6908
+ WorkflowRejectedError as Dt,
6909
+ StartFiberOptions as E,
6910
+ buildAgentPath as En,
6911
+ WorkflowQueryCriteria as Et,
6912
+ AgentToolDisplayMetadata as F,
6913
+ MCPClientElicitationHandlers as Ft,
6836
6914
  AgentToolProgressSnapshot as G,
6837
- getNamespacedData as Gt,
6915
+ MCP_SERVER_ID_MAX_LENGTH as Gt,
6838
6916
  AgentToolLifecycleResult as H,
6839
- MCPServerOptions as Ht,
6840
- AgentToolDisplayMetadata as I,
6841
- MCPClientOAuthCallbackConfig as It,
6917
+ MCPOAuthCallbackResult as Ht,
6918
+ AgentToolEvent as I,
6919
+ MCPClientManager as It,
6842
6920
  AgentToolRunPart as J,
6843
- MCPElicitationHandlers as Jt,
6921
+ normalizeServerId as Jt,
6844
6922
  AgentToolRunInfo as K,
6845
- normalizeServerId as Kt,
6846
- AgentToolEvent as L,
6847
- MCPClientOAuthResult as Lt,
6848
- routeAgentEmail as M,
6849
- MCPClientElicitationHandler as Mt,
6850
- AGENT_TOOL_MILESTONE_PART as N,
6851
- MCPClientElicitationHandlers as Nt,
6852
- StartFiberResult as O,
6853
- getSubAgentByName as On,
6854
- ElicitRequest$1 as Ot,
6855
- AGENT_TOOL_PROGRESS_PART as P,
6856
- MCPClientManager as Pt,
6923
+ RegisterServerOptions as Kt,
6924
+ AgentToolEventDelivery as L,
6925
+ MCPClientManagerOptions as Lt,
6926
+ AGENT_TOOL_MILESTONE_PART as M,
6927
+ routeSubAgentRequest as Mn,
6928
+ MCPAITool as Mt,
6929
+ AGENT_TOOL_PROGRESS_PART as N,
6930
+ withInvocationScope as Nn,
6931
+ MCPAIToolSet as Nt,
6932
+ StateUpdateMessage as O,
6933
+ buildSubAgentPath as On,
6934
+ WorkflowStatus as Ot,
6935
+ AgentToolChildAdapter as P,
6936
+ MCPClientElicitationHandler as Pt,
6857
6937
  AgentToolTerminalStatus as Q,
6858
- RPCServerTransportOptions as Qt,
6938
+ RPCClientTransportOptions as Qt,
6859
6939
  AgentToolEventMessage as R,
6860
- MCPConnectionResult as Rt,
6940
+ MCPClientOAuthCallbackConfig as Rt,
6861
6941
  MCPServerMessage as S,
6862
- SUB_PREFIX as Sn,
6863
- WorkflowPage as St,
6864
- RPCRequest as T,
6865
- buildAgentUrl as Tn,
6866
- WorkflowRejectedError as Tt,
6942
+ AgentPathStep as Sn,
6943
+ WorkflowEventPayload as St,
6944
+ RPCResponse as T,
6945
+ SubAgentPathMatch as Tn,
6946
+ WorkflowProgressCallback as Tt,
6867
6947
  AgentToolMilestone as U,
6868
- MCP_SERVER_ID_MAX_LENGTH as Ut,
6948
+ MCPServerFilter as Ut,
6869
6949
  AgentToolInterruptedReason as V,
6870
- MCPServerFilter as Vt,
6950
+ MCPDiscoverResult as Vt,
6871
6951
  AgentToolProgress as W,
6872
- RegisterServerOptions as Wt,
6952
+ MCPServerOptions as Wt,
6873
6953
  AgentToolRunStatus as X,
6874
- RPCClientTransportOptions as Xt,
6954
+ MCPElicitationHandlers as Xt,
6875
6955
  AgentToolRunState as Y,
6876
- RPCClientTransport as Yt,
6956
+ MCPElicitationHandler as Yt,
6877
6957
  AgentToolStoredChunk as Z,
6878
- RPCServerTransport as Zt,
6958
+ RPCClientTransport as Zt,
6879
6959
  FiberRecoveryContext as _,
6880
- StreamableHTTPEdgeClientTransport as _n,
6881
- WorkflowCompleteCallback as _t,
6960
+ WorkerTransportOptions as _n,
6961
+ WorkflowCallbackBase as _t,
6882
6962
  routeAgentRequest as a,
6883
- DurableObjectEventStore as an,
6884
- AgentWorkflowInternalParams as at,
6963
+ McpAgent as an,
6964
+ isPositionlessAgentToolChunk as at,
6885
6965
  ListFibersOptions as b,
6886
- AgentPathStep as bn,
6887
- WorkflowEventPayload as bt,
6966
+ DynamicAgentClass as bn,
6967
+ WorkflowErrorCallback as bt,
6888
6968
  Agent as c,
6889
- CreateLegacyMcpHandlerOptions as cn,
6890
- AgentWorkflowPathStep as ct,
6969
+ createMcpHandler$1 as cn,
6970
+ AgentWorkflowOrigin as ct,
6891
6971
  AgentStaticOptions as d,
6892
- createLegacyMcpHandler as dn,
6893
- DefaultProgress as dt,
6894
- ElicitRequest$2 as en,
6972
+ CreateMcpHandlerOptions$1 as dn,
6973
+ AgentWorkflowStep as dt,
6974
+ RPCServerTransportOptions as en,
6895
6975
  DetachedAgentToolConfig as et,
6896
6976
  DEFAULT_AGENT_STATIC_OPTIONS as f,
6897
- MCPStorageApi as fn,
6898
- RunWorkflowOptions as ft,
6977
+ LegacyMcpHandler as fn,
6978
+ ApprovalEventPayload as ft,
6899
6979
  FiberInspection as g,
6900
- SSEEdgeClientTransport as gn,
6901
- WorkflowCallbackType as gt,
6980
+ WorkerTransport as gn,
6981
+ WorkflowCallback as gt,
6902
6982
  FiberContext as h,
6903
- WorkerTransportOptions as hn,
6904
- WorkflowCallbackBase as ht,
6983
+ TransportState as hn,
6984
+ WaitForApprovalOptions as ht,
6905
6985
  getAgentByName as i,
6906
- ClearableEventStore as in,
6907
- AgentWorkflowEvent as it,
6908
- getCurrentAgent as j,
6909
- withInvocationScope as jn,
6910
- MCPAIToolSet as jt,
6911
- StateUpdateMessage as k,
6912
- parseSubAgentPath as kn,
6913
- ElicitResult$2 as kt,
6986
+ ElicitResult$3 as in,
6987
+ isAgentToolLifecycleChunk as it,
6988
+ routeAgentEmail as j,
6989
+ parseSubAgentPath as jn,
6990
+ ElicitResult$2 as jt,
6991
+ StreamingResponse as k,
6992
+ buildSubAgentPathUnchecked as kn,
6993
+ WorkflowTrackingRow as kt,
6914
6994
  AgentContext as l,
6915
- CreateMcpHandlerOptions$1 as ln,
6916
- AgentWorkflowStep as lt,
6995
+ experimental_createMcpHandler as ln,
6996
+ AgentWorkflowParams as lt,
6917
6997
  EmailRoutingOptions as m,
6918
- WorkerTransport as mn,
6919
- WorkflowCallback as mt,
6998
+ MCPStorageApi as mn,
6999
+ RunWorkflowOptions as mt,
6920
7000
  AgentOptions as n,
6921
- ElicitResult$3 as nn,
7001
+ ElicitRequest$2 as nn,
6922
7002
  RunAgentToolOptions as nt,
6923
7003
  AddMcpServerOptions as o,
6924
- createMcpHandler$1 as on,
6925
- AgentWorkflowOrigin as ot,
7004
+ ClearableEventStore as on,
7005
+ AgentWorkflowEvent as ot,
6926
7006
  DeleteFibersOptions as p,
6927
- TransportState as pn,
6928
- WaitForApprovalOptions as pt,
7007
+ createLegacyMcpHandler as pn,
7008
+ DefaultProgress as pt,
6929
7009
  AgentToolRunInspection as q,
6930
- MCPElicitationHandler as qt,
7010
+ getNamespacedData as qt,
6931
7011
  RoutingRetryOptions as r,
6932
- McpAgent as rn,
7012
+ ElicitRequestSchema as rn,
6933
7013
  RunAgentToolResult as rt,
6934
7014
  AddRpcMcpServerOptions as s,
6935
- experimental_createMcpHandler as sn,
6936
- AgentWorkflowParams as st,
7015
+ DurableObjectEventStore as sn,
7016
+ AgentWorkflowInternalParams as st,
6937
7017
  AgentGetOptions as t,
6938
- ElicitRequestSchema as tn,
7018
+ RPC_DO_PREFIX as tn,
6939
7019
  DetachedRunAgentToolResult as tt,
6940
7020
  AgentNamespace as u,
6941
- LegacyMcpHandler as un,
6942
- ApprovalEventPayload as ut,
7021
+ CreateLegacyMcpHandlerOptions as un,
7022
+ AgentWorkflowPathStep as ut,
6943
7023
  FiberRecoveryResult as v,
6944
- DynamicAgentClass as vn,
6945
- WorkflowErrorCallback as vt,
6946
- QueueItem as w,
6947
- buildAgentPath as wn,
6948
- WorkflowQueryCriteria as wt,
7024
+ SSEEdgeClientTransport as vn,
7025
+ WorkflowCallbackType as vt,
7026
+ RPCRequest as w,
7027
+ SUB_PREFIX as wn,
7028
+ WorkflowPage as wt,
6949
7029
  MCPServer as x,
6950
- BuildAgentPathOptions as xn,
6951
- WorkflowInfo as xt,
7030
+ DynamicAgentStub as xn,
7031
+ WorkflowEventCallback as xt,
6952
7032
  FiberStatus as y,
6953
- DynamicAgentStub as yn,
6954
- WorkflowEventCallback as yt,
7033
+ StreamableHTTPEdgeClientTransport as yn,
7034
+ WorkflowCompleteCallback as yt,
6955
7035
  AgentToolEventState as z,
6956
- MCPDiscoverResult as zt
7036
+ MCPClientOAuthResult as zt
6957
7037
  };
6958
- //# sourceMappingURL=agent-routing-DE5zmCQ8.d.ts.map
7038
+ //# sourceMappingURL=agent-routing-0DR0Tk2v.d.ts.map