agents 0.16.2 → 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.
- package/README.md +11 -8
- package/dist/{agent-tool-types-CTw3UJUP.d.ts → agent-tool-types-Cd1TZPfB.d.ts} +587 -137
- package/dist/agent-tool-types.d.ts +34 -18
- package/dist/agent-tool-types.js +20 -1
- package/dist/agent-tool-types.js.map +1 -0
- package/dist/agent-tools-BXlsuX0d.js +304 -0
- package/dist/agent-tools-BXlsuX0d.js.map +1 -0
- package/dist/agent-tools-_E8wxUIK.d.ts +119 -0
- package/dist/agent-tools.d.ts +24 -18
- package/dist/agent-tools.js.map +1 -1
- package/dist/ai-chat-agent.d.ts +1 -1
- package/dist/ai-chat-agent.js +1 -2
- package/dist/ai-chat-agent.js.map +1 -1
- package/dist/ai-chat-v5-migration.d.ts +1 -1
- package/dist/ai-chat-v5-migration.js +1 -2
- package/dist/ai-chat-v5-migration.js.map +1 -1
- package/dist/ai-react.d.ts +1 -1
- package/dist/ai-react.js +1 -2
- package/dist/ai-react.js.map +1 -1
- package/dist/ai-types.d.ts +1 -7
- package/dist/ai-types.js +2 -8
- package/dist/ai-types.js.map +1 -1
- package/dist/browser/ai.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/chat/index.d.ts +1918 -72
- package/dist/chat/index.js +1730 -245
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/react.d.ts +602 -0
- package/dist/chat/react.js +1506 -0
- package/dist/chat/react.js.map +1 -0
- package/dist/chat-sdk/index.d.ts +4 -4
- package/dist/{classPrivateFieldGet2-CZ7QjTXN.js → classPrivateFieldGet2-DZBYAB34.js} +5 -5
- package/dist/{classPrivateMethodInitSpec-D-0__zd9.js → classPrivateMethodInitSpec-qMjJ6sHQ.js} +2 -2
- package/dist/{client-BXJ9n2f7.js → client-BZ-B3NhC.js} +2 -2
- package/dist/client-BZ-B3NhC.js.map +1 -0
- package/dist/client-tools-aIBO0Fk7.d.ts +53 -0
- package/dist/client.d.ts +76 -57
- package/dist/client.js +33 -5
- package/dist/client.js.map +1 -1
- package/dist/{connector-CrKhowfD.js → connector-CdldGF3h.js} +5 -5
- package/dist/{connector-CrKhowfD.js.map → connector-CdldGF3h.js.map} +1 -1
- package/dist/email.js +1 -1
- package/dist/email.js.map +1 -1
- package/dist/{index-B7IbEeze.d.ts → index-CcbnKkNh.d.ts} +188 -14
- package/dist/index.d.ts +91 -71
- package/dist/index.js +562 -24
- package/dist/index.js.map +1 -1
- package/dist/mcp/client.d.ts +18 -14
- package/dist/mcp/client.js +1 -1
- package/dist/mcp/index.d.ts +30 -30
- package/dist/mcp/index.js +7 -7
- package/dist/mcp/index.js.map +1 -1
- package/dist/{agent-tools-3zLG7MgA.js → message-builder-BymO4N_D.js} +45 -126
- package/dist/message-builder-BymO4N_D.js.map +1 -0
- package/dist/observability/index.d.ts +1 -1
- package/dist/observability/index.js +4 -2
- package/dist/observability/index.js.map +1 -1
- package/dist/react.d.ts +123 -110
- package/dist/react.js +44 -11
- package/dist/react.js.map +1 -1
- package/dist/serializable.d.ts +1 -1
- package/dist/skills/compile.js +1 -1
- package/dist/skills/compile.js.map +1 -1
- package/dist/skills/index.js +5 -5
- package/dist/skills/index.js.map +1 -1
- package/dist/sub-routing.d.ts +6 -6
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/dist/vite.js +5 -5
- package/dist/vite.js.map +1 -1
- package/dist/wire-types-nflOzNuU.js +240 -0
- package/dist/wire-types-nflOzNuU.js.map +1 -0
- package/dist/{workflow-types-SrZK_o9p.d.ts → workflow-types-Baz_PO5v.d.ts} +42 -22
- package/dist/workflow-types.d.ts +25 -21
- package/dist/workflow-types.js.map +1 -1
- package/dist/workflows.d.ts +22 -21
- package/dist/workflows.js +31 -7
- package/dist/workflows.js.map +1 -1
- package/docs/adding-to-existing-project.md +450 -0
- package/docs/agent-class.md +503 -0
- package/docs/agent-tools.md +552 -0
- package/docs/browse-the-web.md +430 -0
- package/docs/callable-methods.md +627 -0
- package/docs/chat-agents.md +1687 -0
- package/docs/chat-sdk.md +181 -0
- package/docs/client-sdk.md +520 -0
- package/docs/client-tools-continuation.md +177 -0
- package/docs/codemode.md +440 -0
- package/docs/configuration.md +775 -0
- package/docs/cross-domain-authentication.md +171 -0
- package/docs/durable-execution.md +537 -0
- package/docs/email.md +663 -0
- package/docs/get-current-agent.md +204 -0
- package/docs/getting-started.md +305 -0
- package/docs/http-websockets.md +668 -0
- package/docs/human-in-the-loop.md +661 -0
- package/docs/index.md +151 -0
- package/docs/long-running-agents.md +730 -0
- package/docs/mcp-client.md +620 -0
- package/docs/mcp-servers.md +526 -0
- package/docs/mcp-transports.md +308 -0
- package/docs/migration-to-ai-sdk-v5.md +96 -0
- package/docs/migration-to-ai-sdk-v6.md +163 -0
- package/docs/observability.md +261 -0
- package/docs/push-notifications.md +367 -0
- package/docs/queue.md +329 -0
- package/docs/readonly-connections.md +278 -0
- package/docs/resumable-streaming.md +127 -0
- package/docs/retries.md +444 -0
- package/docs/routing.md +749 -0
- package/docs/scheduling.md +898 -0
- package/docs/securing-mcp-servers.md +359 -0
- package/docs/server-driven-messages.md +477 -0
- package/docs/sessions.md +1024 -0
- package/docs/state.md +512 -0
- package/docs/sub-agents.md +389 -0
- package/docs/webhooks.md +604 -0
- package/docs/workflows.md +877 -0
- package/package.json +41 -14
- package/dist/agent-tools-3zLG7MgA.js.map +0 -1
- package/dist/agent-tools-DZhI5F6Q.d.ts +0 -14
- package/dist/client-BXJ9n2f7.js.map +0 -1
package/dist/mcp/client.d.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
At as getNamespacedData,
|
|
3
|
+
Ct as MCPConnectionResult,
|
|
4
|
+
Dt as MCPServerOptions,
|
|
5
|
+
Et as MCPServerFilter,
|
|
6
|
+
Ot as MCP_SERVER_ID_MAX_LENGTH,
|
|
7
|
+
St as MCPClientOAuthResult,
|
|
8
|
+
Tt as MCPOAuthCallbackResult,
|
|
9
|
+
_t as MCPAITool,
|
|
10
|
+
bt as MCPClientManagerOptions,
|
|
11
|
+
jt as normalizeServerId,
|
|
12
|
+
kt as RegisterServerOptions,
|
|
13
|
+
vt as MCPAIToolSet,
|
|
14
|
+
wt as MCPDiscoverResult,
|
|
15
|
+
xt as MCPClientOAuthCallbackConfig,
|
|
16
|
+
yt as MCPClientManager
|
|
17
|
+
} from "../agent-tool-types-Cd1TZPfB.js";
|
|
16
18
|
export {
|
|
19
|
+
MCPAITool,
|
|
20
|
+
MCPAIToolSet,
|
|
17
21
|
MCPClientManager,
|
|
18
22
|
MCPClientManagerOptions,
|
|
19
23
|
MCPClientOAuthCallbackConfig,
|
package/dist/mcp/client.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as normalizeServerId, n as MCP_SERVER_ID_MAX_LENGTH, r as getNamespacedData, t as MCPClientManager } from "../client-
|
|
1
|
+
import { i as normalizeServerId, n as MCP_SERVER_ID_MAX_LENGTH, r as getNamespacedData, t as MCPClientManager } from "../client-BZ-B3NhC.js";
|
|
2
2
|
export { MCPClientManager, MCP_SERVER_ID_MAX_LENGTH, getNamespacedData, normalizeServerId };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
Bt as
|
|
4
|
-
Ct as
|
|
5
|
-
Dt as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Ht as
|
|
9
|
-
It as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
wt as
|
|
29
|
-
xt as
|
|
30
|
-
zt as
|
|
31
|
-
} from "../agent-tool-types-
|
|
2
|
+
$t as McpClientOptions,
|
|
3
|
+
Bt as McpAgent,
|
|
4
|
+
Ct as MCPConnectionResult,
|
|
5
|
+
Dt as MCPServerOptions,
|
|
6
|
+
Ft as RPCServerTransportOptions,
|
|
7
|
+
Gt as experimental_createMcpHandler,
|
|
8
|
+
Ht as DurableObjectEventStore,
|
|
9
|
+
It as RPC_DO_PREFIX,
|
|
10
|
+
Jt as TransportState,
|
|
11
|
+
Kt as McpAuthContext,
|
|
12
|
+
Lt as ElicitRequest,
|
|
13
|
+
Mt as RPCClientTransport,
|
|
14
|
+
Nt as RPCClientTransportOptions,
|
|
15
|
+
Ot as MCP_SERVER_ID_MAX_LENGTH,
|
|
16
|
+
Pt as RPCServerTransport,
|
|
17
|
+
Qt as StreamableHTTPEdgeClientTransport,
|
|
18
|
+
Rt as ElicitRequestSchema,
|
|
19
|
+
St as MCPClientOAuthResult,
|
|
20
|
+
Ut as CreateMcpHandlerOptions,
|
|
21
|
+
Vt as ClearableEventStore,
|
|
22
|
+
Wt as createMcpHandler,
|
|
23
|
+
Xt as WorkerTransportOptions,
|
|
24
|
+
Yt as WorkerTransport,
|
|
25
|
+
Zt as SSEEdgeClientTransport,
|
|
26
|
+
jt as normalizeServerId,
|
|
27
|
+
qt as getMcpAuthContext,
|
|
28
|
+
wt as MCPDiscoverResult,
|
|
29
|
+
xt as MCPClientOAuthCallbackConfig,
|
|
30
|
+
zt as ElicitResult
|
|
31
|
+
} from "../agent-tool-types-Cd1TZPfB.js";
|
|
32
32
|
export {
|
|
33
33
|
type ClearableEventStore,
|
|
34
34
|
type CreateMcpHandlerOptions,
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../types.js";
|
|
2
|
-
import { c as RPC_DO_PREFIX, i as normalizeServerId, n as MCP_SERVER_ID_MAX_LENGTH, o as RPCClientTransport, s as RPCServerTransport } from "../client-
|
|
2
|
+
import { c as RPC_DO_PREFIX, i as normalizeServerId, n as MCP_SERVER_ID_MAX_LENGTH, o as RPCClientTransport, s as RPCServerTransport } from "../client-BZ-B3NhC.js";
|
|
3
3
|
import { Agent, getAgentByName, getCurrentAgent } from "../index.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
@@ -588,6 +588,7 @@ var StreamableHTTPServerTransport = class {
|
|
|
588
588
|
this._streamResponseIds = /* @__PURE__ */ new Map();
|
|
589
589
|
const { agent } = getCurrentAgent();
|
|
590
590
|
if (!agent) throw new Error("McpAgent was not found in Transport constructor");
|
|
591
|
+
this._agent = agent;
|
|
591
592
|
this.sessionId = agent.getSessionId();
|
|
592
593
|
this._eventStore = options.eventStore;
|
|
593
594
|
}
|
|
@@ -747,8 +748,7 @@ var StreamableHTTPServerTransport = class {
|
|
|
747
748
|
}
|
|
748
749
|
}
|
|
749
750
|
async close() {
|
|
750
|
-
const
|
|
751
|
-
if (!agent) throw new Error("Agent was not found in close");
|
|
751
|
+
const agent = this._agent;
|
|
752
752
|
for (const conn of agent.getConnections()) conn.close(1e3, "Session closed");
|
|
753
753
|
this.onclose?.();
|
|
754
754
|
}
|
|
@@ -803,8 +803,7 @@ var StreamableHTTPServerTransport = class {
|
|
|
803
803
|
* there is at most one to send on.
|
|
804
804
|
*/
|
|
805
805
|
async sendStandalone(message) {
|
|
806
|
-
const
|
|
807
|
-
if (!agent) throw new Error("Agent was not found in send");
|
|
806
|
+
const agent = this._agent;
|
|
808
807
|
const eventId = await this._eventStore?.storeEvent(STANDALONE_STREAM_ID, message);
|
|
809
808
|
const standalone = Array.from(agent.getConnections()).find((conn) => conn.state?._standaloneSse);
|
|
810
809
|
if (standalone) this.writeSSEEvent(standalone, message, eventId);
|
|
@@ -817,8 +816,9 @@ var StreamableHTTPServerTransport = class {
|
|
|
817
816
|
* {@link sendOnStream} for the actual store / write / cleanup.
|
|
818
817
|
*/
|
|
819
818
|
async sendForRequest(message, requestId) {
|
|
820
|
-
const
|
|
821
|
-
|
|
819
|
+
const agent = this._agent;
|
|
820
|
+
const context = getCurrentAgent();
|
|
821
|
+
const originatingConnection = context.agent === agent ? context.connection : void 0;
|
|
822
822
|
const matchingConnections = Array.from(agent.getConnections()).filter((conn) => conn.state?.requestIds?.includes(requestId));
|
|
823
823
|
const liveConnection = matchingConnections.find((conn) => conn.id === originatingConnection?.id) ?? (matchingConnections.length === 1 ? matchingConnections[0] : null);
|
|
824
824
|
if (!liveConnection && matchingConnections.length > 1) {
|