agents 0.33.0 → 0.34.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 +1 -1
- package/dist/{agent-routing-vVMA7m8Y.d.ts → agent-routing-BSoZzNiP.d.ts} +537 -373
- package/dist/agent-routing.d.ts +1 -1
- package/dist/agent-tool-types.d.ts +1 -1
- package/dist/{agent-tools-gGXXkf1z.d.ts → agent-tools-Be-hpRpH.d.ts} +2 -2
- package/dist/agent-tools.d.ts +1 -1
- package/dist/{ai-sdk-Kon40i0q.js → ai-sdk-CRMlEBX7.js} +75 -44
- package/dist/ai-sdk-CRMlEBX7.js.map +1 -0
- package/dist/browser/ai.js +1 -1
- package/dist/browser/index.d.ts +7 -3
- package/dist/browser/index.js +2 -2
- package/dist/browser/tools/ai-sdk.d.ts +68 -3
- package/dist/browser/tools/pi.d.ts +2 -2
- package/dist/browser/tools/tanstack-ai.d.ts +2 -2
- package/dist/{browser-CI97khiJ.d.ts → browser-C9T74n4c.d.ts} +84 -5
- package/dist/{browser-tool-Cxtiwfua.d.ts → browser-tool-DxAYQY9T.d.ts} +2 -2
- package/dist/capability-DBAKc6UZ.js.map +1 -1
- package/dist/{capability-runner-BiVUtjqC.d.ts → capability-runner-uFOdSANC.d.ts} +3 -2
- package/dist/chat/index.d.ts +37 -6
- package/dist/chat/index.js +39 -3
- package/dist/chat/index.js.map +1 -1
- package/dist/chat-sdk/index.d.ts +3 -3
- package/dist/chat-sdk/index.js +1 -1
- package/dist/cli.js +64 -63
- package/dist/client-CkT8voRY.js +3740 -0
- package/dist/client-CkT8voRY.js.map +1 -0
- package/dist/{client-eSfgYvd3.d.ts → client-DqS6oequ.d.ts} +2 -2
- package/dist/client.d.ts +1 -1
- package/dist/{connector-Dl098To-.js → connector-Bphz6wIw.js} +16 -4
- package/dist/connector-Bphz6wIw.js.map +1 -0
- package/dist/{conversations-FjHDRZyD.d.ts → conversations-CoAYNW_q.d.ts} +4 -4
- package/dist/{current-agent-CKgT5d1O.d.ts → current-agent-DShbQHDO.d.ts} +24 -3
- package/dist/current-agent-DhoDkSnH.js.map +1 -1
- package/dist/{do-oauth-client-provider-DtNqv7oj.d.ts → do-oauth-client-provider-BsT8-vtd.d.ts} +22 -2
- package/dist/{durable-object-lifecycle-DOI_bzCH.d.ts → durable-object-lifecycle-CRCA6O0W.d.ts} +2 -2
- package/dist/experimental/channels/index.d.ts +2 -2
- package/dist/experimental/channels/web/index.d.ts +2 -2
- package/dist/experimental/channels/web/index.js +1 -1
- package/dist/experimental/webmcp.js +1 -1
- package/dist/{gateway-BFO6vRDn.d.ts → gateway-Dz8zyZBJ.d.ts} +2 -2
- package/dist/harness/ai-sdk/index.d.ts +2 -2
- package/dist/harness/container/index.d.ts +2 -2
- package/dist/harness/container/index.js +1 -1
- package/dist/harness/container/index.js.map +1 -1
- package/dist/harness/opencode/index.d.ts +1 -1
- package/dist/harness/pi/index.d.ts +128 -12
- package/dist/harness/pi/index.js +128 -20
- package/dist/harness/pi/index.js.map +1 -1
- package/dist/harness/think/index.d.ts +2 -2
- package/dist/{images-CfuRCjwq.js → images-D4gtE06D.js} +119 -27
- package/dist/images-D4gtE06D.js.map +1 -0
- package/dist/{index-8k4qsX1T.d.ts → index-BXVgv6tp.d.ts} +4 -4
- package/dist/{index-BEL3ZV-s.d.ts → index-Cs7Ed9la.d.ts} +2 -2
- package/dist/{index-CBt8oRJt.d.ts → index-XiZxauMU.d.ts} +3 -3
- package/dist/index.d.ts +21 -21
- package/dist/index.js +2 -2
- package/dist/{input-schema-0uUu392-.js → input-schema-D6GilRXI.js} +2 -2
- package/dist/{input-schema-0uUu392-.js.map → input-schema-D6GilRXI.js.map} +1 -1
- package/dist/{input-schema-waggtYrH.js → input-schema-y8W5bOdM.js} +2 -2
- package/dist/{input-schema-waggtYrH.js.map → input-schema-y8W5bOdM.js.map} +1 -1
- package/dist/internal_context.d.ts +1 -1
- package/dist/lifecycle/index.d.ts +3 -3
- package/dist/lifecycle/index.js +1 -1
- package/dist/{lifecycle-v1rKHV2C.js → lifecycle-CB5Dmtrt.js} +126 -38
- package/dist/lifecycle-CB5Dmtrt.js.map +1 -0
- package/dist/mcp/client/do-oauth-client-provider.d.ts +1 -1
- package/dist/mcp/client/do-oauth-client-provider.js +45 -2
- package/dist/mcp/client/do-oauth-client-provider.js.map +1 -1
- package/dist/mcp/client/index.d.ts +42 -36
- package/dist/mcp/client/index.js +2 -2
- package/dist/mcp/client/x402.d.ts +8 -8
- package/dist/mcp/index.d.ts +17 -17
- package/dist/mcp/index.js +5 -5
- package/dist/mcp/index.js.map +1 -1
- package/dist/models/ai-sdk/index.d.ts +9 -5
- package/dist/models/ai-sdk/index.js +1 -1
- package/dist/models/opencode/index.d.ts +3 -3
- package/dist/models/opencode/index.js +2 -2
- package/dist/models/opencode/index.js.map +1 -1
- package/dist/models/pi-ai/index.d.ts +4 -4
- package/dist/models/pi-ai/index.js +53 -29
- package/dist/models/pi-ai/index.js.map +1 -1
- package/dist/{options-CiIsJHXR.d.ts → options-CiXaymmZ.d.ts} +2 -2
- package/dist/queue/index.d.ts +1 -1
- package/dist/queue/index.js +1 -1
- package/dist/{queue-CcIjVYTE.js → queue-B_wl6K0Z.js} +24 -5
- package/dist/queue-B_wl6K0Z.js.map +1 -0
- package/dist/react.d.ts +2 -2
- package/dist/routing/index.d.ts +2 -2
- package/dist/{scheduler-BCLESHSC.d.ts → scheduler-CTpR0Ct0.d.ts} +2 -2
- package/dist/{scheduler-FIHv2-kJ.js → scheduler-DGNEmxQR.js} +2 -1
- package/dist/scheduler-DGNEmxQR.js.map +1 -0
- package/dist/schedules/index.d.ts +1 -1
- package/dist/schedules/index.js +1 -1
- package/dist/serializable.d.ts +1 -1
- package/dist/session-CRY0bGiI.js.map +1 -1
- package/dist/sessions/index.d.ts +1 -1
- package/dist/{settings-Dk2il2Hf.js → settings-D2F_qONv.js} +11 -2
- package/dist/settings-D2F_qONv.js.map +1 -0
- package/dist/{src-DoGNJ4Ud.js → src-BO1FdLK1.js} +145 -86
- package/dist/src-BO1FdLK1.js.map +1 -0
- package/dist/state/index.d.ts +1 -1
- package/dist/streams/index.d.ts +1 -1
- package/dist/{streams-vrCtbUIn.d.ts → streams-CAZxZBDg.d.ts} +2 -2
- package/dist/sub-routing.d.ts +12 -12
- package/dist/tasks/index.d.ts +1 -1
- package/dist/tasks/index.js +1 -1
- package/dist/{tasks-BN_5AWqI.js → tasks-Cf_UfEO4.js} +2 -1
- package/dist/{tasks-BN_5AWqI.js.map → tasks-Cf_UfEO4.js.map} +1 -1
- package/dist/{tasks-E89KdwkS.d.ts → tasks-Cs8ilctE.d.ts} +2 -2
- package/dist/{tool-DkT_DJBm.js → tool-CmAGY6Fo.js} +24 -3
- package/dist/tool-CmAGY6Fo.js.map +1 -0
- package/dist/{tool-CxKsvxjm.js → tool-Kxcj8_22.js} +24 -4
- package/dist/tool-Kxcj8_22.js.map +1 -0
- package/dist/{transport-5moD2pW5.d.ts → transport-hV8AW4Bv.d.ts} +45 -12
- package/dist/voice/index.d.ts +2 -2
- package/dist/web/fetch/index.js +1 -1
- package/dist/web/fetch/tools/ai-sdk.js +2 -2
- package/dist/web/fetch/tools/pi.d.ts +5 -0
- package/dist/web/fetch/tools/pi.js +25 -2
- package/dist/web/fetch/tools/pi.js.map +1 -1
- package/dist/web/fetch/tools/tanstack-ai.js +2 -2
- package/dist/web/search/index.js +1 -1
- package/dist/web/search/tools/ai-sdk.js +2 -2
- package/dist/web/search/tools/pi.d.ts +4 -0
- package/dist/web/search/tools/pi.js +23 -2
- package/dist/web/search/tools/pi.js.map +1 -1
- package/dist/web/search/tools/tanstack-ai.js +2 -2
- package/dist/websockets/index.d.ts +2 -2
- package/dist/websockets/index.js +1 -1
- package/dist/{websockets-C6SJtWCJ.js → websockets-W4uhRg4-.js} +68 -5
- package/dist/websockets-W4uhRg4-.js.map +1 -0
- package/dist/workflow-types.d.ts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/docs/agent-class.md +30 -4
- package/docs/browse-the-web.md +14 -0
- package/docs/chat-agents.md +13 -10
- package/docs/client-tools-continuation.md +1 -1
- package/docs/codemode.md +1 -1
- package/docs/configuration.md +6 -3
- package/docs/cross-domain-authentication.md +1 -1
- package/docs/fetch-the-web.md +20 -0
- package/docs/harnesses/pi.md +211 -22
- package/docs/harnesses/think.md +1 -1
- package/docs/http-websockets.md +40 -32
- package/docs/human-in-the-loop.md +2 -2
- package/docs/lifecycle.md +56 -0
- package/docs/mcp-client.md +104 -7
- package/docs/models-pi-ai.md +24 -10
- package/docs/models.md +42 -17
- package/docs/resumable-streaming.md +1 -1
- package/docs/retries.md +3 -6
- package/docs/search-the-web.md +10 -0
- package/docs/voice.md +1 -1
- package/package.json +13 -12
- package/dist/ai-sdk-CpuRsjP5.d.ts +0 -72
- package/dist/ai-sdk-Kon40i0q.js.map +0 -1
- package/dist/client-DMWujQJ1.js +0 -2325
- package/dist/client-DMWujQJ1.js.map +0 -1
- package/dist/connector-Dl098To-.js.map +0 -1
- package/dist/images-CfuRCjwq.js.map +0 -1
- package/dist/lifecycle-v1rKHV2C.js.map +0 -1
- package/dist/queue-CcIjVYTE.js.map +0 -1
- package/dist/scheduler-FIHv2-kJ.js.map +0 -1
- package/dist/settings-Dk2il2Hf.js.map +0 -1
- package/dist/src-DoGNJ4Ud.js.map +0 -1
- package/dist/tool-CxKsvxjm.js.map +0 -1
- package/dist/tool-DkT_DJBm.js.map +0 -1
- package/dist/websockets-C6SJtWCJ.js.map +0 -1
|
@@ -1,56 +1,62 @@
|
|
|
1
1
|
import {
|
|
2
|
-
$t as
|
|
2
|
+
$t as MCPElicitationHandlers,
|
|
3
3
|
At as ElicitRequest,
|
|
4
|
-
Bt as
|
|
5
|
-
Ft as
|
|
6
|
-
Gt as
|
|
7
|
-
Ht as
|
|
4
|
+
Bt as MCPClientElicitationHandler,
|
|
5
|
+
Ft as MCPConnectionNotFoundError,
|
|
6
|
+
Gt as MCPOAuthCallbackResult,
|
|
7
|
+
Ht as MCPClientManagerOptions,
|
|
8
8
|
It as MCPClientManager,
|
|
9
|
-
Jt as
|
|
10
|
-
Kt as
|
|
11
|
-
Lt as
|
|
12
|
-
Mt as
|
|
13
|
-
Nt as
|
|
14
|
-
Pt as
|
|
15
|
-
Qt as
|
|
16
|
-
Rt as
|
|
17
|
-
Ut as
|
|
18
|
-
Vt as
|
|
19
|
-
Wt as
|
|
20
|
-
Xt as
|
|
21
|
-
Yt as
|
|
22
|
-
Zt as
|
|
23
|
-
en as
|
|
9
|
+
Jt as MCPServerSettlement,
|
|
10
|
+
Kt as MCPServerFilter,
|
|
11
|
+
Lt as MCPClientOAuthCallbackConfig,
|
|
12
|
+
Mt as MCP_SERVER_ID_MAX_LENGTH,
|
|
13
|
+
Nt as normalizeServerId,
|
|
14
|
+
Pt as MCPAuthorizationRequiredError,
|
|
15
|
+
Qt as MCPElicitationHandler,
|
|
16
|
+
Rt as MCPClientOAuthResult,
|
|
17
|
+
Ut as MCPConnectionResult,
|
|
18
|
+
Vt as MCPClientElicitationHandlers,
|
|
19
|
+
Wt as MCPDiscoverResult,
|
|
20
|
+
Xt as MCPAITool,
|
|
21
|
+
Yt as RegisterServerOptions,
|
|
22
|
+
Zt as MCPAIToolSet,
|
|
23
|
+
en as McpRpcAgent,
|
|
24
24
|
jt as ElicitResult,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
nn as RPCClientTransportOptions,
|
|
26
|
+
qt as MCPServerOptions,
|
|
27
|
+
rn as RPC_DO_PREFIX,
|
|
28
|
+
tn as RPCClientTransport,
|
|
29
|
+
zt as getNamespacedData
|
|
30
|
+
} from "../../agent-routing-BSoZzNiP.js";
|
|
28
31
|
import { i as McpClientOptions } from "../../types-D2naO3rA.js";
|
|
29
32
|
export {
|
|
30
33
|
type ElicitRequest,
|
|
31
34
|
type ElicitResult,
|
|
32
|
-
MCPAITool,
|
|
33
|
-
MCPAIToolSet,
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
type MCPAITool,
|
|
36
|
+
type MCPAIToolSet,
|
|
37
|
+
MCPAuthorizationRequiredError,
|
|
38
|
+
type MCPClientElicitationHandler,
|
|
39
|
+
type MCPClientElicitationHandlers,
|
|
36
40
|
MCPClientManager,
|
|
37
|
-
MCPClientManagerOptions,
|
|
38
|
-
MCPClientOAuthCallbackConfig,
|
|
39
|
-
MCPClientOAuthResult,
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
type MCPClientManagerOptions,
|
|
42
|
+
type MCPClientOAuthCallbackConfig,
|
|
43
|
+
type MCPClientOAuthResult,
|
|
44
|
+
MCPConnectionNotFoundError,
|
|
45
|
+
type MCPConnectionResult,
|
|
46
|
+
type MCPDiscoverResult,
|
|
42
47
|
type MCPElicitationHandler,
|
|
43
48
|
type MCPElicitationHandlers,
|
|
44
|
-
MCPOAuthCallbackResult,
|
|
45
|
-
MCPServerFilter,
|
|
46
|
-
MCPServerOptions,
|
|
49
|
+
type MCPOAuthCallbackResult,
|
|
50
|
+
type MCPServerFilter,
|
|
51
|
+
type MCPServerOptions,
|
|
52
|
+
type MCPServerSettlement,
|
|
47
53
|
MCP_SERVER_ID_MAX_LENGTH,
|
|
48
54
|
type McpClientOptions,
|
|
49
55
|
type McpRpcAgent,
|
|
50
56
|
RPCClientTransport,
|
|
51
57
|
type RPCClientTransportOptions,
|
|
52
58
|
RPC_DO_PREFIX,
|
|
53
|
-
RegisterServerOptions,
|
|
59
|
+
type RegisterServerOptions,
|
|
54
60
|
getNamespacedData,
|
|
55
61
|
normalizeServerId
|
|
56
62
|
};
|
package/dist/mcp/client/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
export { MCPClientManager, MCP_SERVER_ID_MAX_LENGTH, RPCClientTransport, RPC_DO_PREFIX, getNamespacedData, normalizeServerId };
|
|
1
|
+
import { c as getNamespacedData, l as RPCClientTransport, n as MCP_SERVER_ID_MAX_LENGTH, o as MCPAuthorizationRequiredError, r as normalizeServerId, s as MCPConnectionNotFoundError, t as MCPClientManager, u as RPC_DO_PREFIX } from "../../client-CkT8voRY.js";
|
|
2
|
+
export { MCPAuthorizationRequiredError, MCPClientManager, MCPConnectionNotFoundError, MCP_SERVER_ID_MAX_LENGTH, RPCClientTransport, RPC_DO_PREFIX, getNamespacedData, normalizeServerId };
|
|
@@ -5,22 +5,22 @@ import {
|
|
|
5
5
|
CallToolRequestOptions,
|
|
6
6
|
Client
|
|
7
7
|
} from "@modelcontextprotocol/client";
|
|
8
|
+
import { Client as Client$1 } from "@modelcontextprotocol/sdk/client/index.js";
|
|
8
9
|
import {
|
|
9
10
|
CallToolResult,
|
|
11
|
+
ToolAnnotations
|
|
12
|
+
} from "@modelcontextprotocol/sdk/types.js";
|
|
13
|
+
import {
|
|
14
|
+
CallToolResult as CallToolResult$1,
|
|
10
15
|
McpServer,
|
|
11
16
|
RegisteredTool,
|
|
12
17
|
ServerContext
|
|
13
18
|
} from "@modelcontextprotocol/server";
|
|
14
|
-
import {
|
|
15
|
-
CallToolResult as CallToolResult$1,
|
|
16
|
-
ToolAnnotations
|
|
17
|
-
} from "@modelcontextprotocol/sdk/types.js";
|
|
18
19
|
import {
|
|
19
20
|
McpServer as McpServer$1,
|
|
20
21
|
RegisteredTool as RegisteredTool$1,
|
|
21
22
|
ToolCallback
|
|
22
23
|
} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
23
|
-
import { Client as Client$1 } from "@modelcontextprotocol/sdk/client/index.js";
|
|
24
24
|
import {
|
|
25
25
|
FacilitatorConfig,
|
|
26
26
|
FacilitatorConfig as FacilitatorConfig$1
|
|
@@ -67,7 +67,7 @@ type PaidToolCallback<
|
|
|
67
67
|
? (
|
|
68
68
|
args: z.infer<z.ZodObject<Args>>,
|
|
69
69
|
ctx: ServerContext
|
|
70
|
-
) => CallToolResult | Promise<CallToolResult>
|
|
70
|
+
) => CallToolResult$1 | Promise<CallToolResult$1>
|
|
71
71
|
: ToolCallback<Args>;
|
|
72
72
|
interface X402AugmentedServer<
|
|
73
73
|
Server extends McpServer$1 | McpServer = McpServer$1
|
|
@@ -101,7 +101,7 @@ interface X402AugmentedClient {
|
|
|
101
101
|
| null,
|
|
102
102
|
params: CallToolRequest["params"],
|
|
103
103
|
options?: CallToolRequestOptions
|
|
104
|
-
): Promise<CallToolResult
|
|
104
|
+
): Promise<CallToolResult>;
|
|
105
105
|
/**
|
|
106
106
|
* @deprecated Prefer the request-options overload. Explicit legacy result
|
|
107
107
|
* schemas remain honored through the SDK v2 request funnel.
|
|
@@ -113,7 +113,7 @@ interface X402AugmentedClient {
|
|
|
113
113
|
params: CallToolRequest["params"],
|
|
114
114
|
resultSchema: LegacyCallToolResultSchema,
|
|
115
115
|
options?: CallToolRequestOptions
|
|
116
|
-
): Promise<CallToolResult
|
|
116
|
+
): Promise<CallToolResult>;
|
|
117
117
|
}
|
|
118
118
|
type X402ClientConfig = {
|
|
119
119
|
/**
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
S as ConnectionContext,
|
|
3
3
|
x as Connection
|
|
4
|
-
} from "../capability-runner-
|
|
4
|
+
} from "../capability-runner-uFOdSANC.js";
|
|
5
5
|
import {
|
|
6
|
-
$t as
|
|
7
|
-
Bt as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Vt as
|
|
15
|
-
Wt as
|
|
16
|
-
Xt as MCPElicitationHandlers,
|
|
17
|
-
Yt as MCPElicitationHandler,
|
|
6
|
+
$t as MCPElicitationHandlers,
|
|
7
|
+
Bt as MCPClientElicitationHandler,
|
|
8
|
+
Lt as MCPClientOAuthCallbackConfig,
|
|
9
|
+
Mt as MCP_SERVER_ID_MAX_LENGTH,
|
|
10
|
+
Nt as normalizeServerId,
|
|
11
|
+
Qt as MCPElicitationHandler,
|
|
12
|
+
Rt as MCPClientOAuthResult,
|
|
13
|
+
Ut as MCPConnectionResult,
|
|
14
|
+
Vt as MCPClientElicitationHandlers,
|
|
15
|
+
Wt as MCPDiscoverResult,
|
|
18
16
|
c as Agent,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
nn as RPCClientTransportOptions,
|
|
18
|
+
qt as MCPServerOptions,
|
|
19
|
+
rn as RPC_DO_PREFIX,
|
|
20
|
+
tn as RPCClientTransport
|
|
21
|
+
} from "../agent-routing-BSoZzNiP.js";
|
|
22
22
|
import {
|
|
23
23
|
a as ServeOptions,
|
|
24
24
|
i as McpClientOptions,
|
|
@@ -40,7 +40,6 @@ import {
|
|
|
40
40
|
StreamableHTTPClientTransport,
|
|
41
41
|
StreamableHTTPClientTransportOptions
|
|
42
42
|
} from "@modelcontextprotocol/client";
|
|
43
|
-
import { McpServerFactory } from "@modelcontextprotocol/server";
|
|
44
43
|
import {
|
|
45
44
|
ElicitRequestSchema,
|
|
46
45
|
ElicitResult as ElicitResult$2,
|
|
@@ -49,6 +48,7 @@ import {
|
|
|
49
48
|
MessageExtraInfo as MessageExtraInfo$1,
|
|
50
49
|
RequestId
|
|
51
50
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
51
|
+
import { McpServerFactory } from "@modelcontextprotocol/server";
|
|
52
52
|
import { McpServer as McpServer$1 } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
53
53
|
import { Server as Server$1 } from "@modelcontextprotocol/sdk/server/index.js";
|
|
54
54
|
import {
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getAgentByName } from "../agent-routing.js";
|
|
2
2
|
import "../types.js";
|
|
3
|
-
import { i as getCurrentAgent, t as Agent } from "../src-
|
|
4
|
-
import {
|
|
3
|
+
import { i as getCurrentAgent, t as Agent } from "../src-BO1FdLK1.js";
|
|
4
|
+
import { d as isDurableObjectNamespace, l as RPCClientTransport, n as MCP_SERVER_ID_MAX_LENGTH, r as normalizeServerId, u as RPC_DO_PREFIX } from "../client-CkT8voRY.js";
|
|
5
5
|
import { n as getMcpAuthContext, r as runWithAuthContext, t as createStatelessMcpHandler } from "../handler-stateless-B5hU3dxK.js";
|
|
6
6
|
import { SSEClientTransport, StreamableHTTPClientTransport } from "@modelcontextprotocol/client";
|
|
7
|
+
import { ElicitRequestSchema, InitializeRequestSchema, JSONRPCMessageSchema, SUPPORTED_PROTOCOL_VERSIONS, isInitializeRequest, isJSONRPCErrorResponse, isJSONRPCNotification, isJSONRPCRequest, isJSONRPCResultResponse } from "@modelcontextprotocol/sdk/types.js";
|
|
7
8
|
import { McpServer, Server } from "@modelcontextprotocol/server";
|
|
8
|
-
import { ElicitRequestSchema, InitializeRequestSchema, JSONRPCMessageSchema, SUPPORTED_PROTOCOL_VERSIONS, isInitializeRequest, isJSONRPCErrorResponse, isJSONRPCNotification, isJSONRPCRequest as isJSONRPCRequest$1, isJSONRPCResultResponse } from "@modelcontextprotocol/sdk/types.js";
|
|
9
9
|
import { McpServer as McpServer$1 } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
10
|
import { Server as Server$1 } from "@modelcontextprotocol/sdk/server/index.js";
|
|
11
11
|
import { WebStandardStreamableHTTPServerTransport as WebStandardStreamableHTTPServerTransport$1 } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
|
|
@@ -720,7 +720,7 @@ var StreamableHTTPServerTransport = class {
|
|
|
720
720
|
let messages;
|
|
721
721
|
if (Array.isArray(rawMessage)) messages = rawMessage.map((msg) => JSONRPCMessageSchema.parse(msg));
|
|
722
722
|
else messages = [JSONRPCMessageSchema.parse(rawMessage)];
|
|
723
|
-
const hasRequests = messages.some(isJSONRPCRequest
|
|
723
|
+
const hasRequests = messages.some(isJSONRPCRequest);
|
|
724
724
|
if (!hasRequests) for (const message of messages) {
|
|
725
725
|
if (this.messageInterceptor) {
|
|
726
726
|
if (await this.messageInterceptor(message, {
|
|
@@ -737,7 +737,7 @@ var StreamableHTTPServerTransport = class {
|
|
|
737
737
|
const { connection, agent } = getCurrentAgent();
|
|
738
738
|
if (!connection) throw new Error("Connection was not found in handlePostRequest");
|
|
739
739
|
if (!agent) throw new Error("Agent was not found in handlePostRequest");
|
|
740
|
-
const requestIds = messages.filter(isJSONRPCRequest
|
|
740
|
+
const requestIds = messages.filter(isJSONRPCRequest).map((message) => message.id);
|
|
741
741
|
const streamId = connection.id;
|
|
742
742
|
const postState = {
|
|
743
743
|
streamId,
|