agents 0.16.1 → 0.17.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 (127) hide show
  1. package/README.md +11 -8
  2. package/dist/{agent-tool-types-NofdbL9X.d.ts → agent-tool-types-Cd1TZPfB.d.ts} +595 -137
  3. package/dist/agent-tool-types.d.ts +34 -18
  4. package/dist/agent-tool-types.js +20 -1
  5. package/dist/agent-tool-types.js.map +1 -0
  6. package/dist/agent-tools-BXlsuX0d.js +304 -0
  7. package/dist/agent-tools-BXlsuX0d.js.map +1 -0
  8. package/dist/agent-tools-_E8wxUIK.d.ts +119 -0
  9. package/dist/agent-tools.d.ts +24 -18
  10. package/dist/agent-tools.js.map +1 -1
  11. package/dist/ai-chat-agent.d.ts +1 -1
  12. package/dist/ai-chat-agent.js +1 -2
  13. package/dist/ai-chat-agent.js.map +1 -1
  14. package/dist/ai-chat-v5-migration.d.ts +1 -1
  15. package/dist/ai-chat-v5-migration.js +1 -2
  16. package/dist/ai-chat-v5-migration.js.map +1 -1
  17. package/dist/ai-react.d.ts +1 -1
  18. package/dist/ai-react.js +1 -2
  19. package/dist/ai-react.js.map +1 -1
  20. package/dist/ai-types.d.ts +1 -7
  21. package/dist/ai-types.js +2 -8
  22. package/dist/ai-types.js.map +1 -1
  23. package/dist/browser/ai.js +1 -1
  24. package/dist/browser/index.js +1 -1
  25. package/dist/chat/index.d.ts +1923 -76
  26. package/dist/chat/index.js +1784 -278
  27. package/dist/chat/index.js.map +1 -1
  28. package/dist/chat/react.d.ts +602 -0
  29. package/dist/chat/react.js +1506 -0
  30. package/dist/chat/react.js.map +1 -0
  31. package/dist/chat-sdk/index.d.ts +4 -4
  32. package/dist/{classPrivateFieldGet2-CZ7QjTXN.js → classPrivateFieldGet2-DZBYAB34.js} +5 -5
  33. package/dist/{classPrivateMethodInitSpec-D-0__zd9.js → classPrivateMethodInitSpec-qMjJ6sHQ.js} +2 -2
  34. package/dist/{client-FUizKzj2.js → client-BZ-B3NhC.js} +19 -3
  35. package/dist/client-BZ-B3NhC.js.map +1 -0
  36. package/dist/client-tools-aIBO0Fk7.d.ts +53 -0
  37. package/dist/client.d.ts +76 -57
  38. package/dist/client.js +33 -5
  39. package/dist/client.js.map +1 -1
  40. package/dist/{compaction-helpers-DVcu5lPN.d.ts → compaction-helpers-wUz6M3us.d.ts} +20 -1
  41. package/dist/{connector-CrKhowfD.js → connector-CdldGF3h.js} +5 -5
  42. package/dist/{connector-CrKhowfD.js.map → connector-CdldGF3h.js.map} +1 -1
  43. package/dist/email.js +1 -1
  44. package/dist/email.js.map +1 -1
  45. package/dist/experimental/memory/session/index.d.ts +1 -1
  46. package/dist/experimental/memory/session/index.js +20 -2
  47. package/dist/experimental/memory/session/index.js.map +1 -1
  48. package/dist/experimental/memory/utils/index.d.ts +1 -1
  49. package/dist/{index-B7IbEeze.d.ts → index-CcbnKkNh.d.ts} +188 -14
  50. package/dist/index.d.ts +91 -71
  51. package/dist/index.js +562 -24
  52. package/dist/index.js.map +1 -1
  53. package/dist/mcp/client.d.ts +18 -14
  54. package/dist/mcp/client.js +1 -1
  55. package/dist/mcp/index.d.ts +30 -30
  56. package/dist/mcp/index.js +7 -7
  57. package/dist/mcp/index.js.map +1 -1
  58. package/dist/{agent-tools-3zLG7MgA.js → message-builder-BymO4N_D.js} +45 -126
  59. package/dist/message-builder-BymO4N_D.js.map +1 -0
  60. package/dist/observability/index.d.ts +1 -1
  61. package/dist/observability/index.js +4 -2
  62. package/dist/observability/index.js.map +1 -1
  63. package/dist/react.d.ts +123 -110
  64. package/dist/react.js +44 -11
  65. package/dist/react.js.map +1 -1
  66. package/dist/serializable.d.ts +1 -1
  67. package/dist/skills/compile.js +1 -1
  68. package/dist/skills/compile.js.map +1 -1
  69. package/dist/skills/index.js +5 -5
  70. package/dist/skills/index.js.map +1 -1
  71. package/dist/sub-routing.d.ts +6 -6
  72. package/dist/utils.js +1 -1
  73. package/dist/utils.js.map +1 -1
  74. package/dist/vite.js +5 -5
  75. package/dist/vite.js.map +1 -1
  76. package/dist/wire-types-nflOzNuU.js +240 -0
  77. package/dist/wire-types-nflOzNuU.js.map +1 -0
  78. package/dist/{workflow-types-SrZK_o9p.d.ts → workflow-types-Baz_PO5v.d.ts} +42 -22
  79. package/dist/workflow-types.d.ts +25 -21
  80. package/dist/workflow-types.js.map +1 -1
  81. package/dist/workflows.d.ts +22 -21
  82. package/dist/workflows.js +31 -7
  83. package/dist/workflows.js.map +1 -1
  84. package/docs/adding-to-existing-project.md +450 -0
  85. package/docs/agent-class.md +503 -0
  86. package/docs/agent-tools.md +552 -0
  87. package/docs/browse-the-web.md +430 -0
  88. package/docs/callable-methods.md +627 -0
  89. package/docs/chat-agents.md +1687 -0
  90. package/docs/chat-sdk.md +181 -0
  91. package/docs/client-sdk.md +520 -0
  92. package/docs/client-tools-continuation.md +177 -0
  93. package/docs/codemode.md +440 -0
  94. package/docs/configuration.md +775 -0
  95. package/docs/cross-domain-authentication.md +171 -0
  96. package/docs/durable-execution.md +537 -0
  97. package/docs/email.md +663 -0
  98. package/docs/get-current-agent.md +204 -0
  99. package/docs/getting-started.md +305 -0
  100. package/docs/http-websockets.md +668 -0
  101. package/docs/human-in-the-loop.md +661 -0
  102. package/docs/index.md +151 -0
  103. package/docs/long-running-agents.md +730 -0
  104. package/docs/mcp-client.md +620 -0
  105. package/docs/mcp-servers.md +526 -0
  106. package/docs/mcp-transports.md +308 -0
  107. package/docs/migration-to-ai-sdk-v5.md +96 -0
  108. package/docs/migration-to-ai-sdk-v6.md +163 -0
  109. package/docs/observability.md +261 -0
  110. package/docs/push-notifications.md +367 -0
  111. package/docs/queue.md +329 -0
  112. package/docs/readonly-connections.md +278 -0
  113. package/docs/resumable-streaming.md +127 -0
  114. package/docs/retries.md +444 -0
  115. package/docs/routing.md +749 -0
  116. package/docs/scheduling.md +898 -0
  117. package/docs/securing-mcp-servers.md +359 -0
  118. package/docs/server-driven-messages.md +477 -0
  119. package/docs/sessions.md +1024 -0
  120. package/docs/state.md +512 -0
  121. package/docs/sub-agents.md +389 -0
  122. package/docs/webhooks.md +604 -0
  123. package/docs/workflows.md +877 -0
  124. package/package.json +47 -15
  125. package/dist/agent-tools-3zLG7MgA.js.map +0 -1
  126. package/dist/agent-tools-DLquv-dp.d.ts +0 -14
  127. package/dist/client-FUizKzj2.js.map +0 -1
@@ -4,19 +4,18 @@ import {
4
4
  n as Observability,
5
5
  r as ObservabilityEvent,
6
6
  s as MCPObservabilityEvent
7
- } from "./index-B7IbEeze.js";
7
+ } from "./index-CcbnKkNh.js";
8
8
  import { t as AgentMcpOAuthProvider } from "./do-oauth-client-provider-D4ZwyBDu.js";
9
9
  import {
10
- _ as WorkflowPage,
11
- g as WorkflowInfo,
12
- h as WorkflowEventPayload,
13
- l as WorkflowCallback,
14
- s as RunWorkflowOptions,
15
- y as WorkflowQueryCriteria
16
- } from "./workflow-types-SrZK_o9p.js";
10
+ _ as WorkflowEventPayload,
11
+ d as WorkflowCallback,
12
+ l as RunWorkflowOptions,
13
+ v as WorkflowInfo,
14
+ x as WorkflowQueryCriteria,
15
+ y as WorkflowPage
16
+ } from "./workflow-types-Baz_PO5v.js";
17
17
  import { t as MessageType } from "./types-6Zo2zfoO.js";
18
18
  import { r as EmailResolver } from "./email-CL27preh.js";
19
- import { ToolSet, UIMessage } from "ai";
20
19
  import { RpcTarget } from "cloudflare:workers";
21
20
  import {
22
21
  Connection,
@@ -29,6 +28,7 @@ import {
29
28
  WSMessage,
30
29
  WSMessage as WSMessage$1
31
30
  } from "partyserver";
31
+ import { z } from "zod";
32
32
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
33
33
  import {
34
34
  SSEClientTransport,
@@ -57,7 +57,7 @@ import {
57
57
  Resource,
58
58
  ResourceTemplate,
59
59
  ServerCapabilities,
60
- Tool as Tool$1
60
+ Tool
61
61
  } from "@modelcontextprotocol/sdk/types.js";
62
62
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
63
63
  import {
@@ -819,8 +819,16 @@ declare class MCPClientConnection {
819
819
  connectionError: string | null;
820
820
  lastConnectedTransport: BaseTransportType | undefined;
821
821
  instructions?: string;
822
- tools: Tool$1[];
822
+ tools: Tool[];
823
823
  private _transport?;
824
+ /**
825
+ * Transport that received the 401 during the initial connect attempt.
826
+ * Kept so finishAuth() runs on the transport that captured the resource
827
+ * metadata URL from the WWW-Authenticate header — a fresh transport would
828
+ * rediscover from defaults and exchange the code at the wrong token
829
+ * endpoint when the authorization server is not at the default location.
830
+ */
831
+ private _pendingAuthTransport?;
824
832
  prompts: Prompt[];
825
833
  resources: Resource[];
826
834
  resourceTemplates: ResourceTemplate[];
@@ -884,7 +892,7 @@ declare class MCPClientConnection {
884
892
  * Notification handler registration for tools
885
893
  * Should only be called if serverCapabilities.tools exists
886
894
  */
887
- registerTools(): Promise<Tool$1[]>;
895
+ registerTools(): Promise<Tool[]>;
888
896
  /**
889
897
  * Notification handler registration for resources
890
898
  * Should only be called if serverCapabilities.resources exists
@@ -1074,6 +1082,22 @@ type MCPServerRow = {
1074
1082
  };
1075
1083
  //#endregion
1076
1084
  //#region src/mcp/client.d.ts
1085
+ type MCPAITool = {
1086
+ description?: string;
1087
+ title?: string;
1088
+ execute: (
1089
+ args: Record<string, unknown>,
1090
+ options?: unknown
1091
+ ) => Promise<unknown>;
1092
+ inputSchema: z.ZodType;
1093
+ outputSchema?: z.ZodType;
1094
+ };
1095
+ /**
1096
+ * Structural tool set returned by {@link MCPClientManager.getAITools}.
1097
+ * Compatible with the AI SDK without importing its types into the core
1098
+ * `agents` declaration graph.
1099
+ */
1100
+ type MCPAIToolSet = Record<string, MCPAITool>;
1077
1101
  /** Maximum length of a normalized MCP server id. */
1078
1102
  declare const MCP_SERVER_ID_MAX_LENGTH = 64;
1079
1103
  /**
@@ -1435,13 +1459,13 @@ declare class MCPClientManager {
1435
1459
  * @param filter - Optional filter to scope results to specific servers
1436
1460
  * @returns a set of tools that you can use with the AI SDK
1437
1461
  */
1438
- getAITools(filter?: MCPServerFilter): ToolSet;
1462
+ getAITools(filter?: MCPServerFilter): MCPAIToolSet;
1439
1463
  /**
1440
1464
  * @deprecated this has been renamed to getAITools(), and unstable_getAITools will be removed in the next major version
1441
1465
  * @param filter - Optional filter to scope results to specific servers
1442
1466
  * @returns a set of tools that you can use with the AI SDK
1443
1467
  */
1444
- unstable_getAITools(filter?: MCPServerFilter): ToolSet;
1468
+ unstable_getAITools(filter?: MCPServerFilter): MCPAIToolSet;
1445
1469
  /**
1446
1470
  * Closes all active in-memory connections to MCP servers.
1447
1471
  *
@@ -1719,7 +1743,9 @@ declare class MCPClientManager {
1719
1743
  uri: string;
1720
1744
  text: string;
1721
1745
  mimeType?: string | undefined;
1722
- _meta?: Record<string, unknown> | undefined;
1746
+ _meta /** Include only connections matching this server ID (or IDs). */?/** Include only connections matching this server ID (or IDs). */ :
1747
+ | Record<string, unknown>
1748
+ | undefined;
1723
1749
  }
1724
1750
  | {
1725
1751
  uri: string;
@@ -1758,7 +1784,11 @@ declare class MCPClientManager {
1758
1784
  icons?:
1759
1785
  | {
1760
1786
  src: string;
1761
- mimeType?: string | undefined;
1787
+ mimeType?/**
1788
+ * Event that fires whenever any MCP server state changes (registered, connected, removed, etc.)
1789
+ * This is useful for broadcasting server state to clients.
1790
+ */
1791
+ : string | undefined;
1762
1792
  sizes?: string[] | undefined;
1763
1793
  theme?: "light" | "dark" | undefined;
1764
1794
  }[]
@@ -1781,7 +1811,7 @@ declare class MCPClientManager {
1781
1811
  }>;
1782
1812
  }
1783
1813
  type NamespacedData = {
1784
- tools: (Tool$1 & {
1814
+ tools: (Tool & {
1785
1815
  serverId: string;
1786
1816
  })[];
1787
1817
  prompts: (Prompt & {
@@ -2069,6 +2099,9 @@ type ScheduleStorageRow = {
2069
2099
  owner_path?: string | null;
2070
2100
  owner_path_key?: string | null;
2071
2101
  };
2102
+ type DetachedReconcilePayload = {
2103
+ cadenceIndex?: number;
2104
+ };
2072
2105
  type ScheduleCriteria = {
2073
2106
  id?: string;
2074
2107
  type?: "scheduled" | "delayed" | "cron" | "interval";
@@ -2197,7 +2230,7 @@ type MCPServersState = {
2197
2230
  servers: {
2198
2231
  [id: string]: MCPServer;
2199
2232
  };
2200
- tools: (Tool$1 & {
2233
+ tools: (Tool & {
2201
2234
  serverId: string;
2202
2235
  })[];
2203
2236
  prompts: (Prompt & {
@@ -2314,6 +2347,8 @@ declare const DEFAULT_AGENT_STATIC_OPTIONS: {
2314
2347
  * wall-clock cap (which also tears the child down on `window-exceeded`).
2315
2348
  */
2316
2349
  agentToolReattachMaxWindowMs: number;
2350
+ detachedMaxBudgetMs: number;
2351
+ detachedNoProgressBudgetMs: number;
2317
2352
  };
2318
2353
  /**
2319
2354
  * Configuration options for the Agent.
@@ -2377,6 +2412,30 @@ interface AgentStaticOptions {
2377
2412
  * also disables the ceiling.
2378
2413
  */
2379
2414
  agentToolReattachMaxWindowMs?: number;
2415
+ /**
2416
+ * Absolute safety ceiling in milliseconds for a DETACHED ("background")
2417
+ * agent-tool run dispatched via `runAgentTool(cls, { detached: ... })`
2418
+ * (rfc-detached-agent-tools). A detached run has no awaiting parent turn, so
2419
+ * on expiry the parent gives up watching — delivers the completion hook with
2420
+ * `interrupted` / `budget-exceeded` and tears the child down — rather than
2421
+ * holding a concurrency slot + live facet forever. Unlike the re-attach
2422
+ * window this defaults to a FINITE value (24h) precisely because an abandoned
2423
+ * detached run has no observer to notice the leak. Override per-run via
2424
+ * `detached: { maxBudgetMs }`.
2425
+ */
2426
+ detachedMaxBudgetMs?: number;
2427
+ /**
2428
+ * Resetting no-progress window in milliseconds for a DETACHED agent-tool run
2429
+ * (rfc-detached-agent-tools §progress). Once the child has emitted at least
2430
+ * one `reportProgress` signal, the parent gives up if the run then goes
2431
+ * silent for this long; the window resets on every subsequent signal. A child
2432
+ * that never reports progress is bounded only by `detachedMaxBudgetMs` — we
2433
+ * never give up on a run merely for taking a long time, only for going silent
2434
+ * after it began reporting. Default: 1h. Set `0`/`Infinity` to disable (rely
2435
+ * on the absolute ceiling only). Override per-run via
2436
+ * `detached: { noProgressBudgetMs }`.
2437
+ */
2438
+ detachedNoProgressBudgetMs?: number;
2380
2439
  }
2381
2440
  declare function getCurrentAgent<
2382
2441
  T extends Agent<Cloudflare.Env> = Agent<Cloudflare.Env>
@@ -2484,6 +2543,10 @@ declare class Agent<
2484
2543
  private _recoveryNoProgressScans;
2485
2544
  /** @internal Single-flight background recovery for parent agent-tool rows. */
2486
2545
  private _agentToolRunRecoveryPromise;
2546
+ /** @internal Serializes detached-backbone arming against concurrent dispatch. */
2547
+ private _detachedBackboneArming;
2548
+ /** @internal Edge-trigger latch for the live-detached-count warning. */
2549
+ private _detachedLiveCountWarned;
2487
2550
  private _ParentClass;
2488
2551
  readonly mcp: MCPClientManager;
2489
2552
  /**
@@ -3294,6 +3357,17 @@ declare class Agent<
3294
3357
  ownerPath: ReadonlyArray<AgentPathStep>,
3295
3358
  row: ScheduleStorageRow
3296
3359
  ): Promise<boolean>;
3360
+ /**
3361
+ * Invoke an RPC method on this Agent or a descendant facet identified
3362
+ * by a root-first path. Used by AgentWorkflow to route callbacks and
3363
+ * `this.agent` calls back to the exact sub-agent that started a workflow.
3364
+ * @internal
3365
+ */
3366
+ _cf_invokeAgentPath(
3367
+ targetPath: ReadonlyArray<AgentPathStep>,
3368
+ method: string,
3369
+ args: unknown[]
3370
+ ): Promise<unknown>;
3297
3371
  /**
3298
3372
  * Recursively destroy a descendant facet identified by
3299
3373
  * `targetPath`. Walks down from `selfPath` until reaching the
@@ -3666,10 +3740,132 @@ declare class Agent<
3666
3740
  _run: AgentToolRunInfo,
3667
3741
  _result: AgentToolLifecycleResult
3668
3742
  ): Promise<void>;
3743
+ /**
3744
+ * Parent hook fired (best-effort) whenever a child agent-tool run emits a
3745
+ * `reportProgress` signal that is forwarded through this parent's tail. Use it
3746
+ * to meter / steer / surface progress server-side. Fires for both awaited and
3747
+ * detached runs; it is NOT durable — after eviction a detached run's latest
3748
+ * snapshot is read from `inspectAgentToolRun().progress` on reconcile instead.
3749
+ */
3750
+ onProgress(
3751
+ _run: AgentToolRunInfo,
3752
+ _progress: AgentToolProgressSnapshot
3753
+ ): Promise<void>;
3754
+ /**
3755
+ * Emit an ephemeral progress signal from a sub-agent that is currently running
3756
+ * as an agent tool. Rides the child's active turn stream as a transient
3757
+ * `data-agent-progress` part (re-broadcast to the parent's clients + surfaced
3758
+ * in `useAgentToolEvents`) and persists a latest-wins snapshot for recovery /
3759
+ * inspection. A no-op (with a dev warning) on the base `Agent`, which has no
3760
+ * streaming turn — overridden by chat hosts (`@cloudflare/think`,
3761
+ * `AIChatAgent`). See `design/rfc-detached-agent-tools.md`.
3762
+ */
3763
+ reportProgress<T = unknown>(
3764
+ _progress: AgentToolProgress<T>,
3765
+ _options?: {
3766
+ persist?: boolean;
3767
+ }
3768
+ ): Promise<void>;
3769
+ runAgentTool<Input = unknown>(
3770
+ cls: ChatCapableAgentClass,
3771
+ options: RunAgentToolOptions<Input> & {
3772
+ detached: true | DetachedAgentToolConfig;
3773
+ }
3774
+ ): Promise<DetachedRunAgentToolResult>;
3669
3775
  runAgentTool<Input = unknown, Output = unknown>(
3670
3776
  cls: ChatCapableAgentClass,
3671
3777
  options: RunAgentToolOptions<Input>
3672
3778
  ): Promise<RunAgentToolResult<Output>>;
3779
+ /**
3780
+ * Cancel an agent-tool run by id. Idempotent: cancelling an already-terminal
3781
+ * run is a no-op. Detached runs deliver through the guarded ledger so a wired
3782
+ * `onFinish` fires once with `status: "aborted"`; awaited runs leave terminal
3783
+ * observation to the awaiting/recovery path, avoiding duplicate finish hooks.
3784
+ */
3785
+ cancelAgentTool(runId: string, reason?: unknown): Promise<void>;
3786
+ /**
3787
+ * Parse + validate the `detached` option. Returns `null` for a non-detached
3788
+ * run, or the normalized config (with the validated `onFinish` method name)
3789
+ * for a detached one. Throws if `onFinish` does not name a method on this
3790
+ * agent — closures cannot survive Durable Object eviction, so the durable
3791
+ * hook is referenced by method name (the same contract as `schedule`).
3792
+ */
3793
+ private _parseDetachedOption;
3794
+ private _isAgentToolRowHardTerminal;
3795
+ private _hasOutstandingDetachedRuns;
3796
+ /** Detached runs still holding a concurrency slot (non-terminal). */
3797
+ private _liveDetachedRunCount;
3798
+ /**
3799
+ * Edge-triggered warning when live detached runs cross
3800
+ * `DETACHED_LIVE_COUNT_WARN_THRESHOLD`. Fires once on the up-crossing and
3801
+ * re-arms only after the count falls back below the threshold, so a parent
3802
+ * accumulating long-lived background runs surfaces a signal without spamming.
3803
+ */
3804
+ private _maybeWarnDetachedLiveCount;
3805
+ /**
3806
+ * Warm fast path for a detached run: tail the child to terminal (so the
3807
+ * parent re-broadcasts its live stream to clients) and deliver the completion
3808
+ * with low latency while the isolate stays alive. Best-effort — the durable
3809
+ * `_cfDetachedReconcileTick` backbone is the guarantee; anything this misses
3810
+ * (eviction, a child that has not yet reached terminal) the backbone collects.
3811
+ */
3812
+ private _detachedFastPath;
3813
+ /**
3814
+ * Single delivery funnel for a detached terminal. Both the warm fast path and
3815
+ * the durable backbone route through here, with INDEPENDENT ledger slots for
3816
+ * `finish` (the real terminal) vs `give_up` (budget exhausted). Each slot is
3817
+ * delivered at-least-once via a claim + lease:
3818
+ *
3819
+ * - Concurrent double-fire is prevented by the guarded CAS claim (RETURNING
3820
+ * yields the row only to the winner).
3821
+ * - A crash after the side effect but before `*_delivered_at` is written lets
3822
+ * the lease expire so a later reconcile re-delivers — hence handlers must be
3823
+ * idempotent.
3824
+ * - Two slots, not one, because `interrupted` is SOFT: a give-up followed by a
3825
+ * real completion is legitimate, and a single shared "delivered" bit would
3826
+ * dedupe the child's real late result away (the #1752 production incident).
3827
+ */
3828
+ private _deliverDetachedTerminal;
3829
+ private _safeRunOnError;
3830
+ /**
3831
+ * Run a detached terminal delivery (the `onAgentToolFinish` + per-run
3832
+ * `onFinish` callbacks) in an appropriate execution context. The base `Agent`
3833
+ * has no turn queue, so it only establishes `agentContext` — a handler that
3834
+ * calls `runAgentTool` / `setState` therefore works regardless of where the
3835
+ * delivery fired from.
3836
+ *
3837
+ * Chat-layer subclasses (`@cloudflare/think`, `@cloudflare/ai-chat`) override
3838
+ * this to additionally serialize delivery against their turn queue when
3839
+ * `serialize` is set: a fast-path push or backbone tick can land mid-turn, and
3840
+ * a state-mutating `onFinish` running concurrently with an active LLM turn is a
3841
+ * data race. The fast path and backbone never run synchronously inside a turn
3842
+ * (they fire from `waitUntil` / a scheduled alarm), so enqueuing them on the
3843
+ * turn queue is deadlock-free. An explicit `cancelAgentTool` runs with
3844
+ * `serialize` unset because it may be called from inside the very turn that
3845
+ * triggers it, where enqueuing would self-deadlock.
3846
+ */
3847
+ protected _runDetachedDelivery(
3848
+ invoke: () => Promise<void>,
3849
+ _options?: {
3850
+ serialize?: boolean;
3851
+ }
3852
+ ): Promise<void>;
3853
+ /**
3854
+ * Arm the self-scheduling detached reconcile backbone. Existing schedules are
3855
+ * reused for recovery/startup calls, but a fresh detached dispatch resets the
3856
+ * pending cadence to the fast end so new work is noticed promptly.
3857
+ */
3858
+ private _armDetachedBackbone;
3859
+ private _armDetachedBackboneInner;
3860
+ /**
3861
+ * Durable backbone for detached runs. Runs on a self-rescheduling alarm:
3862
+ * collects any detached run that has reached terminal but was not yet
3863
+ * delivered (e.g. the parent was evicted before the fast path landed), gives
3864
+ * up on any run past its absolute budget (tearing the child down), and
3865
+ * reschedules itself while any detached run remains undelivered — cancelling
3866
+ * itself once everything has settled (zero steady-state cost).
3867
+ */
3868
+ _cfDetachedReconcileTick(payload?: DetachedReconcilePayload): Promise<void>;
3673
3869
  hasAgentToolRun<T extends Agent>(
3674
3870
  cls: SubAgentClass<T>,
3675
3871
  runId: string
@@ -3726,6 +3922,34 @@ declare class Agent<
3726
3922
  * called repeatedly while a child streams.
3727
3923
  */
3728
3924
  protected _onAgentToolStreamProgress(): Promise<void>;
3925
+ /**
3926
+ * Best-effort observation of a forwarded child chunk: if it is a reserved
3927
+ * `data-agent-progress` frame, refresh the cached liveness timestamp on the
3928
+ * run row (a hint for a still-warm parent) and fire the public `onProgress`
3929
+ * hook. Never throws into the forward loop — the child's own persisted
3930
+ * snapshot (read via `inspectAgentToolRun`) remains authoritative for the
3931
+ * resetting no-progress budget after eviction.
3932
+ */
3933
+ private _observeForwardedProgress;
3934
+ /**
3935
+ * Deliver a milestone notification IF this run opted into it via
3936
+ * `detached: { onMilestones }` and the milestone name is in that set. Routes
3937
+ * to the overridable `_deliverDetachedMilestone` seam (a no-op on the base
3938
+ * `Agent`; chat hosts inject an idempotent synthetic chat message).
3939
+ */
3940
+ private _maybeDeliverDetachedMilestone;
3941
+ /**
3942
+ * Overridable seam for the `detached: { onMilestones }` convenience. The base
3943
+ * `Agent` has no chat surface, so this is a no-op; chat hosts
3944
+ * (`@cloudflare/think`, `AIChatAgent`) override it to submit an idempotent
3945
+ * synthetic message keyed on `(runId, milestone.name)`. Called from both the
3946
+ * warm tail and the backbone reconcile, so it MUST be idempotent.
3947
+ */
3948
+ protected _deliverDetachedMilestone(
3949
+ _run: AgentToolRunInfo,
3950
+ _milestone: AgentToolMilestone,
3951
+ _mode: "react" | "narrate"
3952
+ ): Promise<void>;
3729
3953
  private _broadcastAgentToolTerminal;
3730
3954
  private _asAgentToolChildAdapter;
3731
3955
  private _agentToolClassByName;
@@ -3931,10 +4155,29 @@ declare class Agent<
3931
4155
  * Start a workflow and track it in this Agent's database.
3932
4156
  * Automatically injects agent identity into the workflow params.
3933
4157
  *
4158
+ * The originating Agent identity is persisted in the workflow params so
4159
+ * callbacks (`this.agent` RPC, progress/completion/error, state updates)
4160
+ * route back to the exact Agent or sub-agent facet that started the run.
4161
+ * Note the following constraints:
4162
+ *
4163
+ * - **Resolution is by name.** Callbacks re-resolve the originating Agent via
4164
+ * `getAgentByName(...)`. Agents addressed by a raw Durable Object id
4165
+ * (`idFromString`/`get(id)`) rather than by name will not receive
4166
+ * callbacks on the same instance.
4167
+ * - **Sub-agent runs are facet-local.** A workflow started from a sub-agent
4168
+ * is tracked in that facet's own storage; the parent's `getWorkflows()` /
4169
+ * `getWorkflowById()` do not see it. Aggregate across facets yourself if
4170
+ * you need a combined view.
4171
+ * - **Class names must survive bundling.** The originating path is keyed by
4172
+ * `constructor.name`. Ensure your bundler preserves class names
4173
+ * (e.g. esbuild `keepNames: true`) so callbacks can be routed.
4174
+ *
3934
4175
  * @template P - Type of params to pass to the workflow
3935
4176
  * @param workflowName - Name of the workflow binding in env (e.g., 'MY_WORKFLOW')
3936
4177
  * @param params - Params to pass to the workflow
3937
- * @param options - Optional workflow options
4178
+ * @param options - Optional workflow options. For sub-agents, pass
4179
+ * `agentBinding` as the **root** Agent's Durable Object binding name, not a
4180
+ * child binding.
3938
4181
  * @returns The workflow instance ID
3939
4182
  *
3940
4183
  * @example
@@ -4204,16 +4447,15 @@ declare class Agent<
4204
4447
  * Convert a database row to WorkflowInfo
4205
4448
  */
4206
4449
  private _rowToWorkflowInfo;
4207
- /**
4208
- * Find the binding name for this Agent's namespace by matching class name.
4209
- * Returns undefined if no match found - use options.agentBinding as fallback.
4210
- */
4211
- private _findAgentBindingName;
4450
+ private _workflowOrigin;
4451
+ private _findAgentBindingNameForClass;
4212
4452
  private _findBindingNameForNamespace;
4213
4453
  private _restoreRpcMcpServers;
4214
4454
  /**
4215
4455
  * Handle a callback from a workflow.
4216
- * Called when the Agent receives a callback at /_workflow/callback.
4456
+ * Invoked via the internal `_workflow_handleCallback` RPC whenever an
4457
+ * {@link AgentWorkflow} reports progress, completion, an error, or a custom
4458
+ * event back to its originating Agent (or sub-agent facet).
4217
4459
  * Override this to handle all callback types in one place.
4218
4460
  *
4219
4461
  * @param callback - The callback payload
@@ -4532,6 +4774,10 @@ type AgentToolTerminalStatus = Extract<
4532
4774
  * - `inspect-failed` — inspecting the child failed during parent recovery.
4533
4775
  * - `recovery-deadline` — the overall parent-recovery deadline elapsed before
4534
4776
  * this run could be reconciled.
4777
+ * - `budget-exceeded` — a detached run's absolute `maxBudgetMs` ceiling elapsed
4778
+ * before it reached a terminal. The parent gave up watching and tore the
4779
+ * child down. Like `window-exceeded` this is a soft seal: a child that
4780
+ * completes anyway can still repair the run and re-fire the completion hook.
4535
4781
  */
4536
4782
  type AgentToolInterruptedReason =
4537
4783
  | "no-progress"
@@ -4539,7 +4785,8 @@ type AgentToolInterruptedReason =
4539
4785
  | "not-tailable"
4540
4786
  | "inspect-timeout"
4541
4787
  | "inspect-failed"
4542
- | "recovery-deadline";
4788
+ | "recovery-deadline"
4789
+ | "budget-exceeded";
4543
4790
  /**
4544
4791
  * Structured failure envelope an `agentTool()` returns when a sub-agent run
4545
4792
  * does not complete. Instead of an opaque error string the parent model would
@@ -4572,6 +4819,70 @@ type AgentToolDisplayMetadata = {
4572
4819
  name?: string;
4573
4820
  icon?: string;
4574
4821
  } & Record<string, unknown>;
4822
+ /**
4823
+ * Reserved chunk type a sub-agent emits via `reportProgress` while it runs.
4824
+ * Rides the child's own UI-message stream as a **transient** data part, so it
4825
+ * re-broadcasts to the parent's clients (via the parent's tail) and surfaces in
4826
+ * `useAgentToolEvents` without persisting into the child's stored message parts.
4827
+ * See `design/rfc-detached-agent-tools.md` §"Progress and milestone signaling".
4828
+ */
4829
+ declare const AGENT_TOOL_PROGRESS_PART = "data-agent-progress";
4830
+ /**
4831
+ * Reserved chunk type a sub-agent emits via `reportProgress({ milestone })`.
4832
+ * Unlike the ephemeral progress part this rides the child's stream as a
4833
+ * **persisted** data part, so it survives eviction, replays on drill-in, and
4834
+ * re-resolves milestone waiters. See `design/rfc-detached-agent-tools.md`.
4835
+ */
4836
+ declare const AGENT_TOOL_MILESTONE_PART = "data-agent-milestone";
4837
+ /**
4838
+ * Ephemeral progress signal a running sub-agent emits with `reportProgress`. The
4839
+ * well-known fields drive generic UI (a bar + status line) with no per-app
4840
+ * convention; `data` is an app-specific escape hatch that is **live-only** by
4841
+ * default (not persisted) unless `reportProgress(p, { persist: true })`. Naming a
4842
+ * `milestone` promotes the signal to the **durable** tier: it persists as one row
4843
+ * per milestone, replays, and (with `data`) is retained.
4844
+ */
4845
+ type AgentToolProgress<T = unknown> = {
4846
+ /** 0..1 — drives a progress bar. */ fraction?: number /** Human-readable status line, e.g. "Ingested 40k/80k rows". */;
4847
+ message?: string /** Coarse stage label, e.g. "scaffolding" | "deploying". */;
4848
+ phase?: string;
4849
+ /**
4850
+ * Present ⇒ a **durable** milestone: persisted, replayable, and surfaced as a
4851
+ * distinct row in `AgentToolRunState.milestones` / `inspectAgentToolRun`. Use
4852
+ * for named phase boundaries ("schema-ready", "preview-ready", "deployed").
4853
+ */
4854
+ milestone?: string /** App-specific payload; live-only for progress, persisted for milestones. */;
4855
+ data?: T;
4856
+ };
4857
+ /**
4858
+ * A durable milestone a sub-agent reached, projected onto `AgentToolRunState`
4859
+ * and `inspectAgentToolRun`. `sequence` is monotonic per run so replay/live
4860
+ * races dedupe on `(runId, sequence)`.
4861
+ */
4862
+ type AgentToolMilestone = {
4863
+ name: string /** Monotonic per-run ordinal; dedupe key for replay vs live races. */;
4864
+ sequence: number /** Epoch ms the milestone was reached. */;
4865
+ at: number /** App-specific payload carried with the milestone (persisted). */;
4866
+ data?: unknown;
4867
+ };
4868
+ /**
4869
+ * Latest progress snapshot persisted on the child run row and surfaced through
4870
+ * `inspectAgentToolRun` + `AgentToolRunState`. Only the safe-to-inspect fields
4871
+ * are retained by default; `at` is the emit timestamp (drives the resetting
4872
+ * no-progress budget).
4873
+ */
4874
+ type AgentToolProgressSnapshot = {
4875
+ fraction?: number;
4876
+ message?: string;
4877
+ phase?: string;
4878
+ /**
4879
+ * Set when this signal was a durable milestone (`reportProgress({ milestone })`).
4880
+ * Lets an `onProgress` consumer branch on milestone vs. ephemeral progress.
4881
+ */
4882
+ milestone?: string /** Epoch ms of the latest signal. */;
4883
+ at: number /** Present only when the emitter opted into persisting `data`. */;
4884
+ data?: unknown;
4885
+ };
4575
4886
  type AgentToolRunInfo = {
4576
4887
  runId: string;
4577
4888
  parentToolCallId?: string;
@@ -4579,6 +4890,11 @@ type AgentToolRunInfo = {
4579
4890
  inputPreview?: unknown;
4580
4891
  status: AgentToolRunStatus;
4581
4892
  display?: AgentToolDisplayMetadata;
4893
+ /**
4894
+ * Caller-controlled `metadata.source` for chat-agent `detached.notify`
4895
+ * completions. Present only for detached notify runs that supplied one.
4896
+ */
4897
+ notifySource?: string;
4582
4898
  displayOrder: number;
4583
4899
  startedAt: number;
4584
4900
  completedAt?: number;
@@ -4594,7 +4910,80 @@ type AgentToolLifecycleResult = {
4594
4910
  */
4595
4911
  childStillRunning?: boolean;
4596
4912
  };
4597
- type RunAgentToolOptions<Input = unknown> = {
4913
+ /**
4914
+ * Configuration for a detached ("background") agent-tool run. See
4915
+ * `design/rfc-detached-agent-tools.md`.
4916
+ *
4917
+ * Callbacks are referenced by **method name** on the dispatching agent (the same
4918
+ * durable, eviction-surviving pattern as `Agent.schedule`) — never closures,
4919
+ * which cannot be rehydrated after the Durable Object is evicted.
4920
+ *
4921
+ * `Self` is threaded from `runAgentTool(cls, options)` so the method names are
4922
+ * type-checked against the calling agent's own methods.
4923
+ */
4924
+ type DetachedAgentToolConfig<Self = Record<string, unknown>> = {
4925
+ /**
4926
+ * Method invoked once per terminal delivery. Branch on `result.status`:
4927
+ * `"completed" | "error" | "aborted" | "interrupted"`. A budget give-up
4928
+ * arrives as `status: "interrupted"` with `reason: "budget-exceeded"`; because
4929
+ * `interrupted` is soft, a child that later completes can fire the hook again
4930
+ * with `"completed"`, so a give-up never hides a late real result. Make the
4931
+ * handler idempotent.
4932
+ */
4933
+ onFinish?: Extract<keyof Self, string>;
4934
+ /**
4935
+ * Absolute safety ceiling — a backstop against a child that runs forever. On
4936
+ * expiry the parent gives up watching (delivers `onFinish` with
4937
+ * `interrupted` / `budget-exceeded`) and tears the child down. Defaults to the
4938
+ * parent-level `detachedMaxBudgetMs`.
4939
+ */
4940
+ maxBudgetMs?: number;
4941
+ /**
4942
+ * Per-run override of the resetting no-progress window (ms). Once the child
4943
+ * emits its first `reportProgress`, the parent gives up if it then goes silent
4944
+ * for this long (resets on each signal). Defaults to the parent-level
4945
+ * `detachedNoProgressBudgetMs` (1h). `0`/`Infinity` disables it.
4946
+ */
4947
+ noProgressBudgetMs?: number;
4948
+ /**
4949
+ * Chat-agent convenience (`@cloudflare/think` / `AIChatAgent`): when the run
4950
+ * finishes, inject a message into the chat so the model can react to the
4951
+ * result, instead of you wiring `onFinish` by hand. Sugar that auto-targets
4952
+ * the agent's `_cfDetachedNotifyFinish` hook; ignored on a base `Agent` that
4953
+ * does not implement it, and ignored when `onFinish` is also set (an explicit
4954
+ * `onFinish` wins). Pass `{ source }` to fit the injected message into your
4955
+ * app's existing metadata taxonomy. Override `formatDetachedCompletion()` to
4956
+ * customize the injected text.
4957
+ */
4958
+ notify?:
4959
+ | boolean
4960
+ | {
4961
+ source?: string;
4962
+ };
4963
+ /**
4964
+ * Chat-agent convenience: milestone names that, when the detached run reaches
4965
+ * them, surface an idempotent synthetic message in the chat BEFORE the run
4966
+ * finishes. Each `(runId, name)` fires at most once (idempotency-keyed),
4967
+ * whether observed live or reconciled after eviction. Override the wording via
4968
+ * `formatDetachedMilestone()`. Requires a chat host (`@cloudflare/think`); a
4969
+ * no-op on a base `Agent`.
4970
+ *
4971
+ * Two delivery modes (the string-array shorthand defaults to `"narrate"`):
4972
+ * - `"narrate"` (default) — inject a synthetic **assistant** message directly
4973
+ * (no inference): a cheap, honest status line ("Found 2 sources…") that does
4974
+ * not trigger a model turn. Best for pure progress narration.
4975
+ * - `"react"` — inject a **user-role** turn so the model responds to the
4976
+ * milestone (steer, start dependent work, narrate with context). Costs a
4977
+ * model turn. Opt in for milestones the agent should *act on*.
4978
+ */
4979
+ onMilestones?:
4980
+ | string[]
4981
+ | {
4982
+ names: string[];
4983
+ mode?: "react" | "narrate";
4984
+ };
4985
+ };
4986
+ type RunAgentToolOptions<Input = unknown, Self = Record<string, unknown>> = {
4598
4987
  input: Input;
4599
4988
  runId?: string;
4600
4989
  parentToolCallId?: string;
@@ -4602,6 +4991,30 @@ type RunAgentToolOptions<Input = unknown> = {
4602
4991
  signal?: AbortSignal;
4603
4992
  inputPreview?: unknown;
4604
4993
  display?: AgentToolDisplayMetadata;
4994
+ /**
4995
+ * Run the sub-agent **detached**: dispatch it, let the current turn continue,
4996
+ * and (optionally) get a durable callback when it finishes. `true` is
4997
+ * fire-and-forget (observe via `agent-tool-event` frames + the global
4998
+ * `onAgentToolFinish` hook); an object adds the targeted, eviction-surviving
4999
+ * `onFinish` callback. A detached run does NOT inherit `options.signal` — it
5000
+ * must outlive the spawning turn; cancel it explicitly via `cancelAgentTool`.
5001
+ */
5002
+ detached?: boolean | DetachedAgentToolConfig<Self>;
5003
+ };
5004
+ /**
5005
+ * Result of dispatching a detached run. Returns immediately after dispatch
5006
+ * rather than after completion.
5007
+ */
5008
+ type DetachedRunAgentToolResult = {
5009
+ runId: string;
5010
+ agentType: string;
5011
+ /**
5012
+ * `"running"` on a successful dispatch; `"error"` if dispatch itself failed
5013
+ * (e.g. the `maxConcurrentAgentTools` cap was exceeded — rejected
5014
+ * synchronously, no child started, no callback wired).
5015
+ */
5016
+ status: "running" | "error";
5017
+ error?: string;
4605
5018
  };
4606
5019
  type RunAgentToolResult<Output = unknown> = {
4607
5020
  runId: string;
@@ -4634,6 +5047,19 @@ type AgentToolRunInspection<Output = unknown> = {
4634
5047
  error?: string;
4635
5048
  startedAt: number;
4636
5049
  completedAt?: number;
5050
+ /**
5051
+ * Latest progress snapshot the child has persisted, so a rehydrated parent
5052
+ * (recovery / backbone reconcile) can reconstruct "where is this run" and
5053
+ * reset the resetting no-progress budget without having tailed the live
5054
+ * stream. Absent until the child emits its first `reportProgress`.
5055
+ */
5056
+ progress?: AgentToolProgressSnapshot;
5057
+ /**
5058
+ * Durable milestones the child has persisted, ordered by `sequence`. Lets a
5059
+ * rehydrated parent (recovery / backbone reconcile) replay milestone-gated
5060
+ * work and milestone notifications without having observed the live stream.
5061
+ */
5062
+ milestones?: AgentToolMilestone[];
4637
5063
  };
4638
5064
  type AgentToolStoredChunk = {
4639
5065
  sequence: number;
@@ -4713,7 +5139,10 @@ type AgentToolEventMessage = {
4713
5139
  replay?: true;
4714
5140
  event: AgentToolEvent;
4715
5141
  };
4716
- type AgentToolRunState = {
5142
+ type AgentToolRunPart = {
5143
+ type: string;
5144
+ };
5145
+ type AgentToolRunState<Part extends AgentToolRunPart = AgentToolRunPart> = {
4717
5146
  runId: string;
4718
5147
  agentType: string;
4719
5148
  parentToolCallId?: string;
@@ -4721,7 +5150,15 @@ type AgentToolRunState = {
4721
5150
  order: number;
4722
5151
  display?: AgentToolDisplayMetadata;
4723
5152
  status: "running" | "completed" | "error" | "aborted" | "interrupted";
4724
- parts: UIMessage["parts"];
5153
+ /**
5154
+ * Message parts reconstructed from the child agent's streamed chunks.
5155
+ *
5156
+ * The default stays framework-neutral so importing `agents` does not require
5157
+ * an AI SDK peer. AI SDK consumers can use
5158
+ * `AgentToolRunState<UIMessage["parts"][number]>` when they need its exact
5159
+ * discriminated union.
5160
+ */
5161
+ parts: Part[];
4725
5162
  summary?: string;
4726
5163
  error?: string;
4727
5164
  /**
@@ -4731,120 +5168,141 @@ type AgentToolRunState = {
4731
5168
  */
4732
5169
  reason?: AgentToolInterruptedReason;
4733
5170
  childStillRunning?: boolean;
5171
+ /**
5172
+ * Latest progress snapshot, projected from the child's transient
5173
+ * `data-agent-progress` signals so a UI can render a bar / ETA / phase label
5174
+ * for a running (especially detached / background) run without drilling in.
5175
+ */
5176
+ progress?: AgentToolProgressSnapshot;
5177
+ /**
5178
+ * Durable milestones the run has reached, ordered by `sequence` (deduped
5179
+ * across replay/live races). Drives milestone chips / a phase timeline.
5180
+ */
5181
+ milestones?: AgentToolMilestone[];
4734
5182
  subAgent: {
4735
5183
  agent: string;
4736
5184
  name: string;
4737
5185
  };
4738
5186
  };
4739
- type AgentToolEventState = {
4740
- runsById: Record<string, AgentToolRunState>;
4741
- runsByToolCallId: Record<string, AgentToolRunState[]>;
4742
- unboundRuns: AgentToolRunState[];
5187
+ type AgentToolEventState<Part extends AgentToolRunPart = AgentToolRunPart> = {
5188
+ runsById: Record<string, AgentToolRunState<Part>>;
5189
+ runsByToolCallId: Record<string, AgentToolRunState<Part>[]>;
5190
+ unboundRuns: AgentToolRunState<Part>[];
4743
5191
  };
4744
5192
  //#endregion
4745
5193
  export {
4746
- StreamingResponse as $,
4747
- DeleteFibersOptions as A,
4748
- McpAgent as At,
4749
- MCPServerMessage as B,
4750
- WorkerTransportOptions as Bt,
4751
- AgentNamespace as C,
4752
- RPCClientTransportOptions as Ct,
4753
- Connection$1 as D,
4754
- ElicitRequest$1 as Dt,
4755
- CallableMetadata as E,
4756
- RPC_DO_PREFIX as Et,
4757
- FiberRecoveryContext as F,
4758
- experimental_createMcpHandler as Ft,
4759
- RoutingRetryOptions as G,
4760
- SUB_PREFIX as Gt,
4761
- QueueItem as H,
4762
- StreamableHTTPEdgeClientTransport as Ht,
4763
- FiberRecoveryResult as I,
4764
- McpAuthContext as It,
4765
- SendEmailOptions as J,
4766
- parseSubAgentPath as Jt,
4767
- Schedule as K,
4768
- SubAgentPathMatch as Kt,
4769
- FiberStatus as L,
4770
- getMcpAuthContext as Lt,
4771
- EmailSendBinding as M,
4772
- DurableObjectEventStore as Mt,
4773
- FiberContext as N,
4774
- CreateMcpHandlerOptions as Nt,
4775
- ConnectionContext$1 as O,
4776
- ElicitRequestSchema$1 as Ot,
4777
- FiberInspection as P,
4778
- createMcpHandler as Pt,
4779
- StateUpdateMessage as Q,
4780
- ListFibersOptions as R,
4781
- TransportState as Rt,
4782
- AgentGetOptions as S,
4783
- RPCClientTransport as St,
4784
- AgentStaticOptions as T,
4785
- RPCServerTransportOptions as Tt,
4786
- RPCRequest as U,
4787
- McpClientOptions as Ut,
4788
- MCPServersState as V,
4789
- SSEEdgeClientTransport as Vt,
4790
- RPCResponse as W,
4791
- TransportType as Wt,
4792
- StartFiberOptions as X,
4793
- SqlError as Y,
4794
- routeSubAgentRequest as Yt,
4795
- StartFiberResult as Z,
4796
- RunAgentToolResult as _,
4797
- MCPServerOptions as _t,
4798
- AgentToolEventState as a,
4799
- getCurrentAgent as at,
4800
- Agent as b,
4801
- getNamespacedData as bt,
4802
- AgentToolLifecycleResult as c,
4803
- unstable_callable as ct,
4804
- AgentToolRunState as d,
4805
- MCPClientOAuthCallbackConfig as dt,
4806
- SubAgentClass as et,
4807
- AgentToolRunStatus as f,
4808
- MCPClientOAuthResult as ft,
4809
- RunAgentToolOptions as g,
4810
- MCPServerFilter as gt,
4811
- ChatCapableAgentClass as h,
4812
- MCPOAuthCallbackResult as ht,
4813
- AgentToolEventMessage as i,
4814
- getAgentByName as it,
4815
- EmailRoutingOptions as j,
4816
- ClearableEventStore as jt,
4817
- DEFAULT_AGENT_STATIC_OPTIONS as k,
4818
- ElicitResult$1 as kt,
4819
- AgentToolRunInfo as l,
4820
- MCPClientManager as lt,
4821
- AgentToolTerminalStatus as m,
4822
- MCPDiscoverResult as mt,
4823
- AgentToolDisplayMetadata as n,
4824
- WSMessage$1 as nt,
4825
- AgentToolFailure as o,
4826
- routeAgentEmail as ot,
4827
- AgentToolStoredChunk as p,
4828
- MCPConnectionResult as pt,
4829
- ScheduleCriteria as q,
4830
- getSubAgentByName as qt,
4831
- AgentToolEvent as r,
4832
- callable as rt,
4833
- AgentToolInterruptedReason as s,
4834
- routeAgentRequest as st,
4835
- AgentToolChildAdapter as t,
4836
- SubAgentStub as tt,
4837
- AgentToolRunInspection as u,
4838
- MCPClientManagerOptions as ut,
4839
- AddMcpServerOptions as v,
4840
- MCP_SERVER_ID_MAX_LENGTH as vt,
4841
- AgentOptions as w,
4842
- RPCServerTransport as wt,
4843
- AgentContext as x,
4844
- normalizeServerId as xt,
4845
- AddRpcMcpServerOptions as y,
4846
- RegisterServerOptions as yt,
4847
- MCPServer as z,
4848
- WorkerTransport as zt
5194
+ RoutingRetryOptions as $,
5195
+ McpClientOptions as $t,
5196
+ AgentGetOptions as A,
5197
+ getNamespacedData as At,
5198
+ EmailSendBinding as B,
5199
+ McpAgent as Bt,
5200
+ DetachedRunAgentToolResult as C,
5201
+ MCPConnectionResult as Ct,
5202
+ AddRpcMcpServerOptions as D,
5203
+ MCPServerOptions as Dt,
5204
+ AddMcpServerOptions as E,
5205
+ MCPServerFilter as Et,
5206
+ Connection$1 as F,
5207
+ RPCServerTransportOptions as Ft,
5208
+ FiberStatus as G,
5209
+ experimental_createMcpHandler as Gt,
5210
+ FiberInspection as H,
5211
+ DurableObjectEventStore as Ht,
5212
+ ConnectionContext$1 as I,
5213
+ RPC_DO_PREFIX as It,
5214
+ MCPServerMessage as J,
5215
+ TransportState as Jt,
5216
+ ListFibersOptions as K,
5217
+ McpAuthContext as Kt,
5218
+ DEFAULT_AGENT_STATIC_OPTIONS as L,
5219
+ ElicitRequest$1 as Lt,
5220
+ AgentOptions as M,
5221
+ RPCClientTransport as Mt,
5222
+ AgentStaticOptions as N,
5223
+ RPCClientTransportOptions as Nt,
5224
+ Agent as O,
5225
+ MCP_SERVER_ID_MAX_LENGTH as Ot,
5226
+ CallableMetadata as P,
5227
+ RPCServerTransport as Pt,
5228
+ RPCResponse as Q,
5229
+ StreamableHTTPEdgeClientTransport as Qt,
5230
+ DeleteFibersOptions as R,
5231
+ ElicitRequestSchema$1 as Rt,
5232
+ DetachedAgentToolConfig as S,
5233
+ MCPClientOAuthResult as St,
5234
+ RunAgentToolResult as T,
5235
+ MCPOAuthCallbackResult as Tt,
5236
+ FiberRecoveryContext as U,
5237
+ CreateMcpHandlerOptions as Ut,
5238
+ FiberContext as V,
5239
+ ClearableEventStore as Vt,
5240
+ FiberRecoveryResult as W,
5241
+ createMcpHandler as Wt,
5242
+ QueueItem as X,
5243
+ WorkerTransportOptions as Xt,
5244
+ MCPServersState as Y,
5245
+ WorkerTransport as Yt,
5246
+ RPCRequest as Z,
5247
+ SSEEdgeClientTransport as Zt,
5248
+ AgentToolRunState as _,
5249
+ MCPAITool as _t,
5250
+ AgentToolEvent as a,
5251
+ routeSubAgentRequest as an,
5252
+ StartFiberResult as at,
5253
+ AgentToolTerminalStatus as b,
5254
+ MCPClientManagerOptions as bt,
5255
+ AgentToolFailure as c,
5256
+ SubAgentClass as ct,
5257
+ AgentToolMilestone as d,
5258
+ callable as dt,
5259
+ TransportType as en,
5260
+ Schedule as et,
5261
+ AgentToolProgress as f,
5262
+ getAgentByName as ft,
5263
+ AgentToolRunPart as g,
5264
+ unstable_callable as gt,
5265
+ AgentToolRunInspection as h,
5266
+ routeAgentRequest as ht,
5267
+ AgentToolDisplayMetadata as i,
5268
+ parseSubAgentPath as in,
5269
+ StartFiberOptions as it,
5270
+ AgentNamespace as j,
5271
+ normalizeServerId as jt,
5272
+ AgentContext as k,
5273
+ RegisterServerOptions as kt,
5274
+ AgentToolInterruptedReason as l,
5275
+ SubAgentStub as lt,
5276
+ AgentToolRunInfo as m,
5277
+ routeAgentEmail as mt,
5278
+ AGENT_TOOL_PROGRESS_PART as n,
5279
+ SubAgentPathMatch as nn,
5280
+ SendEmailOptions as nt,
5281
+ AgentToolEventMessage as o,
5282
+ StateUpdateMessage as ot,
5283
+ AgentToolProgressSnapshot as p,
5284
+ getCurrentAgent as pt,
5285
+ MCPServer as q,
5286
+ getMcpAuthContext as qt,
5287
+ AgentToolChildAdapter as r,
5288
+ getSubAgentByName as rn,
5289
+ SqlError as rt,
5290
+ AgentToolEventState as s,
5291
+ StreamingResponse as st,
5292
+ AGENT_TOOL_MILESTONE_PART as t,
5293
+ SUB_PREFIX as tn,
5294
+ ScheduleCriteria as tt,
5295
+ AgentToolLifecycleResult as u,
5296
+ WSMessage$1 as ut,
5297
+ AgentToolRunStatus as v,
5298
+ MCPAIToolSet as vt,
5299
+ RunAgentToolOptions as w,
5300
+ MCPDiscoverResult as wt,
5301
+ ChatCapableAgentClass as x,
5302
+ MCPClientOAuthCallbackConfig as xt,
5303
+ AgentToolStoredChunk as y,
5304
+ MCPClientManager as yt,
5305
+ EmailRoutingOptions as z,
5306
+ ElicitResult$1 as zt
4849
5307
  };
4850
- //# sourceMappingURL=agent-tool-types-NofdbL9X.d.ts.map
5308
+ //# sourceMappingURL=agent-tool-types-Cd1TZPfB.d.ts.map