agents 0.2.14 → 0.2.15
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/dist/ai-chat-agent.d.ts +2 -2
- package/dist/ai-chat-agent.js +1 -1
- package/dist/ai-react.d.ts +3 -3
- package/dist/{client-CrWcaPgn.d.ts → client-C-nwz-3N.d.ts} +5 -5
- package/dist/codemode/ai.js +1 -1
- package/dist/{index-DpH9o0ao.d.ts → index-DWJSBMbz.d.ts} +171 -3
- package/dist/index.d.ts +16 -2
- package/dist/index.js +2 -2
- package/dist/mcp/client.d.ts +1 -1
- package/dist/mcp/index.d.ts +3 -71
- package/dist/mcp/index.js +3 -843
- package/dist/observability/index.js +1 -1
- package/dist/{react-LfPKBVtU.d.ts → react-GnTP-a01.d.ts} +2 -2
- package/dist/react.d.ts +3 -3
- package/dist/src-tpG9NtHy.js +2457 -0
- package/dist/src-tpG9NtHy.js.map +1 -0
- package/package.json +1 -2
- package/dist/mcp/index.js.map +0 -1
- package/dist/src-L3cHuAag.js +0 -1231
- package/dist/src-L3cHuAag.js.map +0 -1
- package/src/index.ts +0 -2167
package/dist/ai-chat-agent.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./client-
|
|
1
|
+
import "./client-C-nwz-3N.js";
|
|
2
2
|
import "./mcp-BEwaCsxO.js";
|
|
3
3
|
import "./do-oauth-client-provider-CCwGwnrA.js";
|
|
4
4
|
import "./index-W4JUkafc.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
AgentContext,
|
|
9
9
|
Connection,
|
|
10
10
|
WSMessage
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-DWJSBMbz.js";
|
|
12
12
|
import { StreamTextOnFinishCallback, ToolSet, UIMessage } from "ai";
|
|
13
13
|
|
|
14
14
|
//#region src/ai-chat-agent.d.ts
|
package/dist/ai-chat-agent.js
CHANGED
|
@@ -2,7 +2,7 @@ import { MessageType } from "./ai-types-UZlfLOYP.js";
|
|
|
2
2
|
import "./client-DjR-lC16.js";
|
|
3
3
|
import "./client-CZBVDDoO.js";
|
|
4
4
|
import "./do-oauth-client-provider-B2jr6UNq.js";
|
|
5
|
-
import { Agent } from "./src-
|
|
5
|
+
import { Agent } from "./src-tpG9NtHy.js";
|
|
6
6
|
import { autoTransformMessages } from "./ai-chat-v5-migration-gdyLiTd8.js";
|
|
7
7
|
|
|
8
8
|
//#region src/ai-chat-agent.ts
|
package/dist/ai-react.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./client-
|
|
1
|
+
import "./client-C-nwz-3N.js";
|
|
2
2
|
import "./mcp-BEwaCsxO.js";
|
|
3
3
|
import "./do-oauth-client-provider-CCwGwnrA.js";
|
|
4
4
|
import "./index-W4JUkafc.js";
|
|
5
5
|
import "./ai-types-BWW4umHY.js";
|
|
6
|
-
import "./index-
|
|
6
|
+
import "./index-DWJSBMbz.js";
|
|
7
7
|
import "./serializable-gtr9YMhp.js";
|
|
8
8
|
import "./client-CmMi85Sj.js";
|
|
9
|
-
import { useAgent } from "./react-
|
|
9
|
+
import { useAgent } from "./react-GnTP-a01.js";
|
|
10
10
|
import { UseChatOptions, useChat } from "@ai-sdk/react";
|
|
11
11
|
import { ChatInit, UIMessage } from "ai";
|
|
12
12
|
|
|
@@ -168,13 +168,13 @@ declare class MCPClientConnection {
|
|
|
168
168
|
| undefined;
|
|
169
169
|
required?: string[] | undefined;
|
|
170
170
|
};
|
|
171
|
+
description?: string | undefined;
|
|
171
172
|
_meta?:
|
|
172
173
|
| {
|
|
173
174
|
[x: string]: unknown;
|
|
174
175
|
}
|
|
175
176
|
| undefined;
|
|
176
177
|
title?: string | undefined;
|
|
177
|
-
description?: string | undefined;
|
|
178
178
|
icons?:
|
|
179
179
|
| {
|
|
180
180
|
[x: string]: unknown;
|
|
@@ -212,6 +212,7 @@ declare class MCPClientConnection {
|
|
|
212
212
|
[x: string]: unknown;
|
|
213
213
|
name: string;
|
|
214
214
|
uri: string;
|
|
215
|
+
description?: string | undefined;
|
|
215
216
|
_meta?:
|
|
216
217
|
| {
|
|
217
218
|
[x: string]: unknown;
|
|
@@ -219,7 +220,6 @@ declare class MCPClientConnection {
|
|
|
219
220
|
| undefined;
|
|
220
221
|
mimeType?: string | undefined;
|
|
221
222
|
title?: string | undefined;
|
|
222
|
-
description?: string | undefined;
|
|
223
223
|
icons?:
|
|
224
224
|
| {
|
|
225
225
|
[x: string]: unknown;
|
|
@@ -234,6 +234,7 @@ declare class MCPClientConnection {
|
|
|
234
234
|
{
|
|
235
235
|
[x: string]: unknown;
|
|
236
236
|
name: string;
|
|
237
|
+
description?: string | undefined;
|
|
237
238
|
_meta?:
|
|
238
239
|
| {
|
|
239
240
|
[x: string]: unknown;
|
|
@@ -248,7 +249,6 @@ declare class MCPClientConnection {
|
|
|
248
249
|
}[]
|
|
249
250
|
| undefined;
|
|
250
251
|
title?: string | undefined;
|
|
251
|
-
description?: string | undefined;
|
|
252
252
|
icons?:
|
|
253
253
|
| {
|
|
254
254
|
[x: string]: unknown;
|
|
@@ -264,6 +264,7 @@ declare class MCPClientConnection {
|
|
|
264
264
|
[x: string]: unknown;
|
|
265
265
|
name: string;
|
|
266
266
|
uriTemplate: string;
|
|
267
|
+
description?: string | undefined;
|
|
267
268
|
_meta?:
|
|
268
269
|
| {
|
|
269
270
|
[x: string]: unknown;
|
|
@@ -271,7 +272,6 @@ declare class MCPClientConnection {
|
|
|
271
272
|
| undefined;
|
|
272
273
|
mimeType?: string | undefined;
|
|
273
274
|
title?: string | undefined;
|
|
274
|
-
description?: string | undefined;
|
|
275
275
|
icons?:
|
|
276
276
|
| {
|
|
277
277
|
[x: string]: unknown;
|
|
@@ -5310,4 +5310,4 @@ export {
|
|
|
5310
5310
|
TransportType,
|
|
5311
5311
|
getNamespacedData
|
|
5312
5312
|
};
|
|
5313
|
-
//# sourceMappingURL=client-
|
|
5313
|
+
//# sourceMappingURL=client-C-nwz-3N.d.ts.map
|
package/dist/codemode/ai.js
CHANGED
|
@@ -2,7 +2,7 @@ import "../ai-types-UZlfLOYP.js";
|
|
|
2
2
|
import "../client-DjR-lC16.js";
|
|
3
3
|
import "../client-CZBVDDoO.js";
|
|
4
4
|
import "../do-oauth-client-provider-B2jr6UNq.js";
|
|
5
|
-
import { getAgentByName } from "../src-
|
|
5
|
+
import { getAgentByName } from "../src-tpG9NtHy.js";
|
|
6
6
|
import { generateObject, tool } from "ai";
|
|
7
7
|
import { openai } from "@ai-sdk/openai";
|
|
8
8
|
import { z } from "zod/v3";
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
BaseTransportType,
|
|
2
3
|
MCPClientManager,
|
|
3
4
|
MCPConnectionState,
|
|
5
|
+
MaybePromise,
|
|
6
|
+
ServeOptions,
|
|
4
7
|
TransportType
|
|
5
|
-
} from "./client-
|
|
8
|
+
} from "./client-C-nwz-3N.js";
|
|
6
9
|
import { Observability } from "./index-W4JUkafc.js";
|
|
7
10
|
import { MessageType } from "./ai-types-BWW4umHY.js";
|
|
8
11
|
import {
|
|
@@ -15,15 +18,169 @@ import {
|
|
|
15
18
|
} from "partyserver";
|
|
16
19
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
17
20
|
import {
|
|
21
|
+
ElicitRequest as ElicitRequest$1,
|
|
22
|
+
ElicitRequestSchema as ElicitRequestSchema$1,
|
|
23
|
+
ElicitResult,
|
|
24
|
+
ElicitResult as ElicitResult$1,
|
|
25
|
+
JSONRPCMessage,
|
|
18
26
|
Prompt,
|
|
19
27
|
Resource,
|
|
20
28
|
ServerCapabilities,
|
|
21
29
|
Tool
|
|
22
30
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
23
31
|
import { env } from "cloudflare:workers";
|
|
32
|
+
import { Server as Server$1 } from "@modelcontextprotocol/sdk/server/index.js";
|
|
33
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
34
|
+
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
24
35
|
|
|
36
|
+
//#region src/mcp/worker-transport.d.ts
|
|
37
|
+
interface WorkerTransportOptions {
|
|
38
|
+
sessionIdGenerator?: () => string;
|
|
39
|
+
enableJsonResponse?: boolean;
|
|
40
|
+
onsessioninitialized?: (sessionId: string) => void;
|
|
41
|
+
}
|
|
42
|
+
declare class WorkerTransport implements Transport {
|
|
43
|
+
private started;
|
|
44
|
+
private initialized;
|
|
45
|
+
private sessionIdGenerator?;
|
|
46
|
+
private enableJsonResponse;
|
|
47
|
+
private onsessioninitialized?;
|
|
48
|
+
private standaloneSseStreamId;
|
|
49
|
+
private streamMapping;
|
|
50
|
+
private requestToStreamMapping;
|
|
51
|
+
private requestResponseMap;
|
|
52
|
+
sessionId?: string;
|
|
53
|
+
onclose?: () => void;
|
|
54
|
+
onerror?: (error: Error) => void;
|
|
55
|
+
onmessage?: (message: JSONRPCMessage) => void;
|
|
56
|
+
constructor(options?: WorkerTransportOptions);
|
|
57
|
+
start(): Promise<void>;
|
|
58
|
+
handleRequest(request: Request, parsedBody?: unknown): Promise<Response>;
|
|
59
|
+
private handleGetRequest;
|
|
60
|
+
private handlePostRequest;
|
|
61
|
+
private handleDeleteRequest;
|
|
62
|
+
private handleOptionsRequest;
|
|
63
|
+
private handleUnsupportedRequest;
|
|
64
|
+
private validateSession;
|
|
65
|
+
close(): Promise<void>;
|
|
66
|
+
send(message: JSONRPCMessage): Promise<void>;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/mcp/handler.d.ts
|
|
70
|
+
interface CreateMcpHandlerOptions extends WorkerTransportOptions {
|
|
71
|
+
/**
|
|
72
|
+
* The route path that this MCP handler should respond to.
|
|
73
|
+
* If specified, the handler will only process requests that match this route.
|
|
74
|
+
* @default "/mcp"
|
|
75
|
+
*/
|
|
76
|
+
route?: string;
|
|
77
|
+
}
|
|
78
|
+
type OAuthExecutionContext = ExecutionContext & {
|
|
79
|
+
props?: Record<string, unknown>;
|
|
80
|
+
};
|
|
81
|
+
declare function experimental_createMcpHandler(
|
|
82
|
+
server: McpServer | Server$1,
|
|
83
|
+
options?: CreateMcpHandlerOptions
|
|
84
|
+
): (request: Request, env: unknown, ctx: ExecutionContext) => Promise<Response>;
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/mcp/auth-context.d.ts
|
|
87
|
+
interface McpAuthContext {
|
|
88
|
+
props: Record<string, unknown>;
|
|
89
|
+
}
|
|
90
|
+
declare function getMcpAuthContext(): McpAuthContext | undefined;
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/mcp/index.d.ts
|
|
93
|
+
declare abstract class McpAgent<
|
|
94
|
+
Env = unknown,
|
|
95
|
+
State = unknown,
|
|
96
|
+
Props extends Record<string, unknown> = Record<string, unknown>
|
|
97
|
+
> extends Agent<Env, State, Props> {
|
|
98
|
+
private _transport?;
|
|
99
|
+
props?: Props;
|
|
100
|
+
abstract server: MaybePromise<McpServer | Server$1>;
|
|
101
|
+
abstract init(): Promise<void>;
|
|
102
|
+
setInitializeRequest(initializeRequest: JSONRPCMessage): Promise<void>;
|
|
103
|
+
getInitializeRequest(): Promise<JSONRPCMessage | undefined>;
|
|
104
|
+
/** Read the transport type for this agent.
|
|
105
|
+
* This relies on the naming scheme being `sse:${sessionId}`
|
|
106
|
+
* or `streamable-http:${sessionId}`.
|
|
107
|
+
*/
|
|
108
|
+
getTransportType(): BaseTransportType;
|
|
109
|
+
/** Read the sessionId for this agent.
|
|
110
|
+
* This relies on the naming scheme being `sse:${sessionId}`
|
|
111
|
+
* or `streamable-http:${sessionId}`.
|
|
112
|
+
*/
|
|
113
|
+
getSessionId(): string;
|
|
114
|
+
/** Get the unique WebSocket. SSE transport only. */
|
|
115
|
+
private getWebSocket;
|
|
116
|
+
/** Returns a new transport matching the type of the Agent. */
|
|
117
|
+
private initTransport;
|
|
118
|
+
/** Update and store the props */
|
|
119
|
+
updateProps(props?: Props): Promise<void>;
|
|
120
|
+
reinitializeServer(): Promise<void>;
|
|
121
|
+
/** Sets up the MCP transport and server every time the Agent is started.*/
|
|
122
|
+
onStart(props?: Props): Promise<void>;
|
|
123
|
+
/** Validates new WebSocket connections. */
|
|
124
|
+
onConnect(
|
|
125
|
+
conn: Connection$1,
|
|
126
|
+
{ request: req }: ConnectionContext
|
|
127
|
+
): Promise<void>;
|
|
128
|
+
/** Handles MCP Messages for the legacy SSE transport. */
|
|
129
|
+
onSSEMcpMessage(
|
|
130
|
+
_sessionId: string,
|
|
131
|
+
messageBody: unknown
|
|
132
|
+
): Promise<Error | null>;
|
|
133
|
+
/** Elicit user input with a message and schema */
|
|
134
|
+
elicitInput(params: {
|
|
135
|
+
message: string;
|
|
136
|
+
requestedSchema: unknown;
|
|
137
|
+
}): Promise<ElicitResult>;
|
|
138
|
+
/** Wait for elicitation response through storage polling */
|
|
139
|
+
private _waitForElicitationResponse;
|
|
140
|
+
/** Handle elicitation responses */
|
|
141
|
+
private _handleElicitationResponse;
|
|
142
|
+
/** Return a handler for the given path for this MCP.
|
|
143
|
+
* Defaults to Streamable HTTP transport.
|
|
144
|
+
*/
|
|
145
|
+
static serve(
|
|
146
|
+
path: string,
|
|
147
|
+
{ binding, corsOptions, transport }?: ServeOptions
|
|
148
|
+
): {
|
|
149
|
+
fetch<Env>(
|
|
150
|
+
this: void,
|
|
151
|
+
request: Request,
|
|
152
|
+
env: Env,
|
|
153
|
+
ctx: ExecutionContext
|
|
154
|
+
): Promise<Response>;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Legacy api
|
|
158
|
+
**/
|
|
159
|
+
static mount(
|
|
160
|
+
path: string,
|
|
161
|
+
opts?: Omit<ServeOptions, "transport">
|
|
162
|
+
): {
|
|
163
|
+
fetch<Env>(
|
|
164
|
+
this: void,
|
|
165
|
+
request: Request,
|
|
166
|
+
env: Env,
|
|
167
|
+
ctx: ExecutionContext
|
|
168
|
+
): Promise<Response>;
|
|
169
|
+
};
|
|
170
|
+
static serveSSE(
|
|
171
|
+
path: string,
|
|
172
|
+
opts?: Omit<ServeOptions, "transport">
|
|
173
|
+
): {
|
|
174
|
+
fetch<Env>(
|
|
175
|
+
this: void,
|
|
176
|
+
request: Request,
|
|
177
|
+
env: Env,
|
|
178
|
+
ctx: ExecutionContext
|
|
179
|
+
): Promise<Response>;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
25
183
|
//#region src/index.d.ts
|
|
26
|
-
|
|
27
184
|
/**
|
|
28
185
|
* RPC request message from client
|
|
29
186
|
*/
|
|
@@ -542,12 +699,19 @@ export {
|
|
|
542
699
|
CallableMetadata,
|
|
543
700
|
type Connection$1 as Connection,
|
|
544
701
|
type ConnectionContext,
|
|
702
|
+
type CreateMcpHandlerOptions,
|
|
703
|
+
type ElicitRequest$1 as ElicitRequest,
|
|
704
|
+
ElicitRequestSchema$1 as ElicitRequestSchema,
|
|
705
|
+
type ElicitResult$1 as ElicitResult,
|
|
545
706
|
EmailResolver,
|
|
546
707
|
EmailRoutingOptions,
|
|
547
708
|
EmailSendOptions,
|
|
548
709
|
MCPServer,
|
|
549
710
|
MCPServerMessage,
|
|
550
711
|
MCPServersState,
|
|
712
|
+
McpAgent,
|
|
713
|
+
type McpAuthContext,
|
|
714
|
+
type OAuthExecutionContext,
|
|
551
715
|
QueueItem,
|
|
552
716
|
RPCRequest,
|
|
553
717
|
RPCResponse,
|
|
@@ -555,14 +719,18 @@ export {
|
|
|
555
719
|
StateUpdateMessage,
|
|
556
720
|
StreamingResponse,
|
|
557
721
|
type WSMessage,
|
|
722
|
+
WorkerTransport,
|
|
723
|
+
type WorkerTransportOptions,
|
|
558
724
|
callable,
|
|
559
725
|
createAddressBasedEmailResolver,
|
|
560
726
|
createCatchAllEmailResolver,
|
|
561
727
|
createHeaderBasedEmailResolver,
|
|
728
|
+
experimental_createMcpHandler,
|
|
562
729
|
getAgentByName,
|
|
563
730
|
getCurrentAgent,
|
|
731
|
+
getMcpAuthContext,
|
|
564
732
|
routeAgentEmail,
|
|
565
733
|
routeAgentRequest,
|
|
566
734
|
unstable_callable
|
|
567
735
|
};
|
|
568
|
-
//# sourceMappingURL=index-
|
|
736
|
+
//# sourceMappingURL=index-DWJSBMbz.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TransportType } from "./client-
|
|
1
|
+
import { TransportType } from "./client-C-nwz-3N.js";
|
|
2
2
|
import "./mcp-BEwaCsxO.js";
|
|
3
3
|
import "./do-oauth-client-provider-CCwGwnrA.js";
|
|
4
4
|
import "./index-W4JUkafc.js";
|
|
@@ -12,12 +12,15 @@ import {
|
|
|
12
12
|
CallableMetadata,
|
|
13
13
|
Connection,
|
|
14
14
|
ConnectionContext,
|
|
15
|
+
CreateMcpHandlerOptions,
|
|
15
16
|
EmailResolver,
|
|
16
17
|
EmailRoutingOptions,
|
|
17
18
|
EmailSendOptions,
|
|
18
19
|
MCPServer,
|
|
19
20
|
MCPServerMessage,
|
|
20
21
|
MCPServersState,
|
|
22
|
+
McpAuthContext,
|
|
23
|
+
OAuthExecutionContext,
|
|
21
24
|
QueueItem,
|
|
22
25
|
RPCRequest,
|
|
23
26
|
RPCResponse,
|
|
@@ -25,16 +28,20 @@ import {
|
|
|
25
28
|
StateUpdateMessage,
|
|
26
29
|
StreamingResponse,
|
|
27
30
|
WSMessage,
|
|
31
|
+
WorkerTransport,
|
|
32
|
+
WorkerTransportOptions,
|
|
28
33
|
callable,
|
|
29
34
|
createAddressBasedEmailResolver,
|
|
30
35
|
createCatchAllEmailResolver,
|
|
31
36
|
createHeaderBasedEmailResolver,
|
|
37
|
+
experimental_createMcpHandler,
|
|
32
38
|
getAgentByName,
|
|
33
39
|
getCurrentAgent,
|
|
40
|
+
getMcpAuthContext,
|
|
34
41
|
routeAgentEmail,
|
|
35
42
|
routeAgentRequest,
|
|
36
43
|
unstable_callable
|
|
37
|
-
} from "./index-
|
|
44
|
+
} from "./index-DWJSBMbz.js";
|
|
38
45
|
export {
|
|
39
46
|
Agent,
|
|
40
47
|
AgentContext,
|
|
@@ -44,12 +51,15 @@ export {
|
|
|
44
51
|
CallableMetadata,
|
|
45
52
|
Connection,
|
|
46
53
|
ConnectionContext,
|
|
54
|
+
CreateMcpHandlerOptions,
|
|
47
55
|
EmailResolver,
|
|
48
56
|
EmailRoutingOptions,
|
|
49
57
|
EmailSendOptions,
|
|
50
58
|
MCPServer,
|
|
51
59
|
MCPServerMessage,
|
|
52
60
|
MCPServersState,
|
|
61
|
+
McpAuthContext,
|
|
62
|
+
OAuthExecutionContext,
|
|
53
63
|
QueueItem,
|
|
54
64
|
RPCRequest,
|
|
55
65
|
RPCResponse,
|
|
@@ -58,12 +68,16 @@ export {
|
|
|
58
68
|
StreamingResponse,
|
|
59
69
|
TransportType,
|
|
60
70
|
WSMessage,
|
|
71
|
+
WorkerTransport,
|
|
72
|
+
WorkerTransportOptions,
|
|
61
73
|
callable,
|
|
62
74
|
createAddressBasedEmailResolver,
|
|
63
75
|
createCatchAllEmailResolver,
|
|
64
76
|
createHeaderBasedEmailResolver,
|
|
77
|
+
experimental_createMcpHandler,
|
|
65
78
|
getAgentByName,
|
|
66
79
|
getCurrentAgent,
|
|
80
|
+
getMcpAuthContext,
|
|
67
81
|
routeAgentEmail,
|
|
68
82
|
routeAgentRequest,
|
|
69
83
|
unstable_callable
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,6 @@ import "./ai-types-UZlfLOYP.js";
|
|
|
2
2
|
import "./client-DjR-lC16.js";
|
|
3
3
|
import "./client-CZBVDDoO.js";
|
|
4
4
|
import "./do-oauth-client-provider-B2jr6UNq.js";
|
|
5
|
-
import { Agent, StreamingResponse, callable, createAddressBasedEmailResolver, createCatchAllEmailResolver, createHeaderBasedEmailResolver, getAgentByName, getCurrentAgent, routeAgentEmail, routeAgentRequest, unstable_callable } from "./src-
|
|
5
|
+
import { Agent, StreamingResponse, WorkerTransport, callable, createAddressBasedEmailResolver, createCatchAllEmailResolver, createHeaderBasedEmailResolver, experimental_createMcpHandler, getAgentByName, getCurrentAgent, getMcpAuthContext, routeAgentEmail, routeAgentRequest, unstable_callable } from "./src-tpG9NtHy.js";
|
|
6
6
|
|
|
7
|
-
export { Agent, StreamingResponse, callable, createAddressBasedEmailResolver, createCatchAllEmailResolver, createHeaderBasedEmailResolver, getAgentByName, getCurrentAgent, routeAgentEmail, routeAgentRequest, unstable_callable };
|
|
7
|
+
export { Agent, StreamingResponse, WorkerTransport, callable, createAddressBasedEmailResolver, createCatchAllEmailResolver, createHeaderBasedEmailResolver, experimental_createMcpHandler, getAgentByName, getCurrentAgent, getMcpAuthContext, routeAgentEmail, routeAgentRequest, unstable_callable };
|
package/dist/mcp/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MCPClientManager, MCPClientOAuthCallbackConfig, MCPClientOAuthResult, getNamespacedData } from "../client-
|
|
1
|
+
import { MCPClientManager, MCPClientOAuthCallbackConfig, MCPClientOAuthResult, getNamespacedData } from "../client-C-nwz-3N.js";
|
|
2
2
|
import "../mcp-BEwaCsxO.js";
|
|
3
3
|
import "../do-oauth-client-provider-CCwGwnrA.js";
|
|
4
4
|
export { MCPClientManager, MCPClientOAuthCallbackConfig, MCPClientOAuthResult, getNamespacedData };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,75 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MCPClientOAuthCallbackConfig, MCPClientOAuthResult, SSEEdgeClientTransport, StreamableHTTPEdgeClientTransport } from "../client-C-nwz-3N.js";
|
|
2
2
|
import "../mcp-BEwaCsxO.js";
|
|
3
3
|
import "../do-oauth-client-provider-CCwGwnrA.js";
|
|
4
4
|
import "../index-W4JUkafc.js";
|
|
5
5
|
import "../ai-types-BWW4umHY.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
9
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
|
-
|
|
11
|
-
//#region src/mcp/index.d.ts
|
|
12
|
-
declare abstract class McpAgent<Env = unknown, State = unknown, Props extends Record<string, unknown> = Record<string, unknown>> extends Agent<Env, State, Props> {
|
|
13
|
-
private _transport?;
|
|
14
|
-
props?: Props;
|
|
15
|
-
abstract server: MaybePromise<McpServer | Server>;
|
|
16
|
-
abstract init(): Promise<void>;
|
|
17
|
-
setInitializeRequest(initializeRequest: JSONRPCMessage): Promise<void>;
|
|
18
|
-
getInitializeRequest(): Promise<JSONRPCMessage | undefined>;
|
|
19
|
-
/** Read the transport type for this agent.
|
|
20
|
-
* This relies on the naming scheme being `sse:${sessionId}`
|
|
21
|
-
* or `streamable-http:${sessionId}`.
|
|
22
|
-
*/
|
|
23
|
-
getTransportType(): BaseTransportType;
|
|
24
|
-
/** Read the sessionId for this agent.
|
|
25
|
-
* This relies on the naming scheme being `sse:${sessionId}`
|
|
26
|
-
* or `streamable-http:${sessionId}`.
|
|
27
|
-
*/
|
|
28
|
-
getSessionId(): string;
|
|
29
|
-
/** Get the unique WebSocket. SSE transport only. */
|
|
30
|
-
private getWebSocket;
|
|
31
|
-
/** Returns a new transport matching the type of the Agent. */
|
|
32
|
-
private initTransport;
|
|
33
|
-
/** Update and store the props */
|
|
34
|
-
updateProps(props?: Props): Promise<void>;
|
|
35
|
-
reinitializeServer(): Promise<void>;
|
|
36
|
-
/** Sets up the MCP transport and server every time the Agent is started.*/
|
|
37
|
-
onStart(props?: Props): Promise<void>;
|
|
38
|
-
/** Validates new WebSocket connections. */
|
|
39
|
-
onConnect(conn: Connection, {
|
|
40
|
-
request: req
|
|
41
|
-
}: ConnectionContext): Promise<void>;
|
|
42
|
-
/** Handles MCP Messages for the legacy SSE transport. */
|
|
43
|
-
onSSEMcpMessage(_sessionId: string, messageBody: unknown): Promise<Error | null>;
|
|
44
|
-
/** Elicit user input with a message and schema */
|
|
45
|
-
elicitInput(params: {
|
|
46
|
-
message: string;
|
|
47
|
-
requestedSchema: unknown;
|
|
48
|
-
}): Promise<ElicitResult$1>;
|
|
49
|
-
/** Wait for elicitation response through storage polling */
|
|
50
|
-
private _waitForElicitationResponse;
|
|
51
|
-
/** Handle elicitation responses */
|
|
52
|
-
private _handleElicitationResponse;
|
|
53
|
-
/** Return a handler for the given path for this MCP.
|
|
54
|
-
* Defaults to Streamable HTTP transport.
|
|
55
|
-
*/
|
|
56
|
-
static serve(path: string, {
|
|
57
|
-
binding,
|
|
58
|
-
corsOptions,
|
|
59
|
-
transport
|
|
60
|
-
}?: ServeOptions): {
|
|
61
|
-
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Legacy api
|
|
65
|
-
**/
|
|
66
|
-
static mount(path: string, opts?: Omit<ServeOptions, "transport">): {
|
|
67
|
-
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
68
|
-
};
|
|
69
|
-
static serveSSE(path: string, opts?: Omit<ServeOptions, "transport">): {
|
|
70
|
-
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
//#endregion
|
|
74
|
-
export { type ElicitRequest, ElicitRequestSchema, type ElicitResult, type MCPClientOAuthCallbackConfig, type MCPClientOAuthResult, McpAgent, SSEEdgeClientTransport, StreamableHTTPEdgeClientTransport };
|
|
75
|
-
//# sourceMappingURL=index.d.ts.map
|
|
6
|
+
import { CreateMcpHandlerOptions, ElicitRequest, ElicitRequestSchema, ElicitResult, McpAgent, McpAuthContext, OAuthExecutionContext, WorkerTransport, WorkerTransportOptions, experimental_createMcpHandler, getMcpAuthContext } from "../index-DWJSBMbz.js";
|
|
7
|
+
export { CreateMcpHandlerOptions, ElicitRequest, ElicitRequestSchema, ElicitResult, MCPClientOAuthCallbackConfig, MCPClientOAuthResult, McpAgent, McpAuthContext, OAuthExecutionContext, SSEEdgeClientTransport, StreamableHTTPEdgeClientTransport, WorkerTransport, WorkerTransportOptions, experimental_createMcpHandler, getMcpAuthContext };
|