agents 0.0.0-fe9e8d3 → 0.0.0-ff431ff
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 +255 -27
- package/dist/ai-chat-agent.d.ts +47 -18
- package/dist/ai-chat-agent.js +532 -226
- package/dist/ai-chat-agent.js.map +1 -1
- package/dist/ai-chat-v5-migration-DBHGW4Hv.js +155 -0
- package/dist/ai-chat-v5-migration-DBHGW4Hv.js.map +1 -0
- package/dist/ai-chat-v5-migration.d.ts +155 -0
- package/dist/ai-chat-v5-migration.js +3 -0
- package/dist/ai-react.d.ts +73 -72
- package/dist/ai-react.js +261 -200
- package/dist/ai-react.js.map +1 -1
- package/dist/ai-types-B3aQaFv3.js +20 -0
- package/dist/ai-types-B3aQaFv3.js.map +1 -0
- package/dist/ai-types-D5YoPrBZ.d.ts +95 -0
- package/dist/ai-types.d.ts +6 -74
- package/dist/ai-types.js +3 -1
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +27 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-BfiZ3HQd.js +117 -0
- package/dist/client-BfiZ3HQd.js.map +1 -0
- package/dist/client-CbWe9FBd.d.ts +104 -0
- package/dist/client-DbS2uI6p.d.ts +5315 -0
- package/dist/client-JMskg2fw.js +793 -0
- package/dist/client-JMskg2fw.js.map +1 -0
- package/dist/client.d.ts +12 -79
- package/dist/client.js +3 -130
- package/dist/codemode/ai.d.ts +27 -0
- package/dist/codemode/ai.js +151 -0
- package/dist/codemode/ai.js.map +1 -0
- package/dist/do-oauth-client-provider-CswoD5Lu.js +93 -0
- package/dist/do-oauth-client-provider-CswoD5Lu.js.map +1 -0
- package/dist/do-oauth-client-provider-DGc5pP0l.d.ts +55 -0
- package/dist/index-DhJCaDWd.d.ts +58 -0
- package/dist/index-DxXJbYBM.d.ts +560 -0
- package/dist/index.d.ts +62 -306
- package/dist/index.js +7 -21
- package/dist/mcp/client.d.ts +4 -777
- package/dist/mcp/client.js +3 -10
- package/dist/mcp/do-oauth-client-provider.d.ts +2 -41
- package/dist/mcp/do-oauth-client-provider.js +2 -106
- package/dist/mcp/index.d.ts +151 -71
- package/dist/mcp/index.js +1359 -797
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/x402.d.ts +34 -0
- package/dist/mcp/x402.js +194 -0
- package/dist/mcp/x402.js.map +1 -0
- package/dist/mcp-Dw5vDrY8.d.ts +61 -0
- package/dist/observability/index.d.ts +3 -0
- package/dist/observability/index.js +7 -0
- package/dist/react-BIh615qN.d.ts +115 -0
- package/dist/react.d.ts +10 -39
- package/dist/react.js +183 -98
- package/dist/react.js.map +1 -1
- package/dist/schedule.d.ts +89 -12
- package/dist/schedule.js +46 -23
- package/dist/schedule.js.map +1 -1
- package/dist/serializable-CymX8ovI.d.ts +39 -0
- package/dist/serializable.d.ts +7 -0
- package/dist/serializable.js +1 -0
- package/dist/src-nFNV3Ttx.js +1216 -0
- package/dist/src-nFNV3Ttx.js.map +1 -0
- package/package.json +115 -66
- package/dist/ai-types.js.map +0 -1
- package/dist/chunk-HD4VEHBA.js +0 -608
- package/dist/chunk-HD4VEHBA.js.map +0 -1
- package/dist/chunk-HMLY7DHA.js +0 -16
- package/dist/chunk-HMLY7DHA.js.map +0 -1
- package/dist/chunk-Q5ZBHY4Z.js +0 -456
- package/dist/chunk-Q5ZBHY4Z.js.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp/client.js.map +0 -1
- package/dist/mcp/do-oauth-client-provider.js.map +0 -1
- package/src/index.ts +0 -942
package/dist/mcp/client.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "../chunk-Q5ZBHY4Z.js";
|
|
5
|
-
import "../chunk-HMLY7DHA.js";
|
|
6
|
-
export {
|
|
7
|
-
MCPClientManager,
|
|
8
|
-
getNamespacedData
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=client.js.map
|
|
1
|
+
import { n as getNamespacedData, t as MCPClientManager } from "../client-JMskg2fw.js";
|
|
2
|
+
|
|
3
|
+
export { MCPClientManager, getNamespacedData };
|
|
@@ -1,41 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
interface AgentsOAuthProvider extends OAuthClientProvider {
|
|
5
|
-
authUrl: string | undefined;
|
|
6
|
-
clientId: string | undefined;
|
|
7
|
-
serverId: string | undefined;
|
|
8
|
-
}
|
|
9
|
-
declare class DurableObjectOAuthClientProvider implements AgentsOAuthProvider {
|
|
10
|
-
storage: DurableObjectStorage;
|
|
11
|
-
clientName: string;
|
|
12
|
-
baseRedirectUrl: string;
|
|
13
|
-
private authUrl_;
|
|
14
|
-
private serverId_;
|
|
15
|
-
private clientId_;
|
|
16
|
-
constructor(storage: DurableObjectStorage, clientName: string, baseRedirectUrl: string);
|
|
17
|
-
get clientMetadata(): OAuthClientMetadata;
|
|
18
|
-
get redirectUrl(): string;
|
|
19
|
-
get clientId(): string;
|
|
20
|
-
set clientId(clientId_: string);
|
|
21
|
-
get serverId(): string;
|
|
22
|
-
set serverId(serverId_: string);
|
|
23
|
-
keyPrefix(clientId: string): string;
|
|
24
|
-
clientInfoKey(clientId: string): string;
|
|
25
|
-
clientInformation(): Promise<OAuthClientInformation | undefined>;
|
|
26
|
-
saveClientInformation(clientInformation: OAuthClientInformationFull): Promise<void>;
|
|
27
|
-
tokenKey(clientId: string): string;
|
|
28
|
-
tokens(): Promise<OAuthTokens | undefined>;
|
|
29
|
-
saveTokens(tokens: OAuthTokens): Promise<void>;
|
|
30
|
-
get authUrl(): string | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Because this operates on the server side (but we need browser auth), we send this url back to the user
|
|
33
|
-
* and require user interact to initiate the redirect flow
|
|
34
|
-
*/
|
|
35
|
-
redirectToAuthorization(authUrl: URL): Promise<void>;
|
|
36
|
-
codeVerifierKey(clientId: string): string;
|
|
37
|
-
saveCodeVerifier(verifier: string): Promise<void>;
|
|
38
|
-
codeVerifier(): Promise<string>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { type AgentsOAuthProvider, DurableObjectOAuthClientProvider };
|
|
1
|
+
import { n as DurableObjectOAuthClientProvider, t as AgentsOAuthProvider } from "../do-oauth-client-provider-DGc5pP0l.js";
|
|
2
|
+
export { AgentsOAuthProvider, DurableObjectOAuthClientProvider };
|
|
@@ -1,107 +1,3 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import { t as DurableObjectOAuthClientProvider } from "../do-oauth-client-provider-CswoD5Lu.js";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var DurableObjectOAuthClientProvider = class {
|
|
5
|
-
constructor(storage, clientName, baseRedirectUrl) {
|
|
6
|
-
this.storage = storage;
|
|
7
|
-
this.clientName = clientName;
|
|
8
|
-
this.baseRedirectUrl = baseRedirectUrl;
|
|
9
|
-
}
|
|
10
|
-
get clientMetadata() {
|
|
11
|
-
return {
|
|
12
|
-
redirect_uris: [this.redirectUrl],
|
|
13
|
-
token_endpoint_auth_method: "none",
|
|
14
|
-
grant_types: ["authorization_code", "refresh_token"],
|
|
15
|
-
response_types: ["code"],
|
|
16
|
-
client_name: this.clientName,
|
|
17
|
-
client_uri: "example.com"
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
get redirectUrl() {
|
|
21
|
-
return `${this.baseRedirectUrl}/${this.serverId}`;
|
|
22
|
-
}
|
|
23
|
-
get clientId() {
|
|
24
|
-
if (!this.clientId_) {
|
|
25
|
-
throw new Error("Trying to access clientId before it was set");
|
|
26
|
-
}
|
|
27
|
-
return this.clientId_;
|
|
28
|
-
}
|
|
29
|
-
set clientId(clientId_) {
|
|
30
|
-
this.clientId_ = clientId_;
|
|
31
|
-
}
|
|
32
|
-
get serverId() {
|
|
33
|
-
if (!this.serverId_) {
|
|
34
|
-
throw new Error("Trying to access serverId before it was set");
|
|
35
|
-
}
|
|
36
|
-
return this.serverId_;
|
|
37
|
-
}
|
|
38
|
-
set serverId(serverId_) {
|
|
39
|
-
this.serverId_ = serverId_;
|
|
40
|
-
}
|
|
41
|
-
keyPrefix(clientId) {
|
|
42
|
-
return `/${this.clientName}/${this.serverId}/${clientId}`;
|
|
43
|
-
}
|
|
44
|
-
clientInfoKey(clientId) {
|
|
45
|
-
return `${this.keyPrefix(clientId)}/client_info/`;
|
|
46
|
-
}
|
|
47
|
-
async clientInformation() {
|
|
48
|
-
if (!this.clientId_) {
|
|
49
|
-
return void 0;
|
|
50
|
-
}
|
|
51
|
-
return await this.storage.get(
|
|
52
|
-
this.clientInfoKey(this.clientId)
|
|
53
|
-
) ?? void 0;
|
|
54
|
-
}
|
|
55
|
-
async saveClientInformation(clientInformation) {
|
|
56
|
-
await this.storage.put(
|
|
57
|
-
this.clientInfoKey(clientInformation.client_id),
|
|
58
|
-
clientInformation
|
|
59
|
-
);
|
|
60
|
-
this.clientId = clientInformation.client_id;
|
|
61
|
-
}
|
|
62
|
-
tokenKey(clientId) {
|
|
63
|
-
return `${this.keyPrefix(clientId)}/token`;
|
|
64
|
-
}
|
|
65
|
-
async tokens() {
|
|
66
|
-
if (!this.clientId_) {
|
|
67
|
-
return void 0;
|
|
68
|
-
}
|
|
69
|
-
return await this.storage.get(this.tokenKey(this.clientId)) ?? void 0;
|
|
70
|
-
}
|
|
71
|
-
async saveTokens(tokens) {
|
|
72
|
-
await this.storage.put(this.tokenKey(this.clientId), tokens);
|
|
73
|
-
}
|
|
74
|
-
get authUrl() {
|
|
75
|
-
return this.authUrl_;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Because this operates on the server side (but we need browser auth), we send this url back to the user
|
|
79
|
-
* and require user interact to initiate the redirect flow
|
|
80
|
-
*/
|
|
81
|
-
async redirectToAuthorization(authUrl) {
|
|
82
|
-
const client_id = authUrl.searchParams.get("client_id");
|
|
83
|
-
if (client_id) {
|
|
84
|
-
authUrl.searchParams.append("state", client_id);
|
|
85
|
-
}
|
|
86
|
-
this.authUrl_ = authUrl.toString();
|
|
87
|
-
}
|
|
88
|
-
codeVerifierKey(clientId) {
|
|
89
|
-
return `${this.keyPrefix(clientId)}/code_verifier`;
|
|
90
|
-
}
|
|
91
|
-
async saveCodeVerifier(verifier) {
|
|
92
|
-
await this.storage.put(this.codeVerifierKey(this.clientId), verifier);
|
|
93
|
-
}
|
|
94
|
-
async codeVerifier() {
|
|
95
|
-
const codeVerifier = await this.storage.get(
|
|
96
|
-
this.codeVerifierKey(this.clientId)
|
|
97
|
-
);
|
|
98
|
-
if (!codeVerifier) {
|
|
99
|
-
throw new Error("No code verifier found");
|
|
100
|
-
}
|
|
101
|
-
return codeVerifier;
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
export {
|
|
105
|
-
DurableObjectOAuthClientProvider
|
|
106
|
-
};
|
|
107
|
-
//# sourceMappingURL=do-oauth-client-provider.js.map
|
|
3
|
+
export { DurableObjectOAuthClientProvider };
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,74 +1,154 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
12
|
-
import '@modelcontextprotocol/sdk/shared/auth.js';
|
|
13
|
-
import '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
14
|
-
import 'ai';
|
|
1
|
+
import { c as MaybePromise, d as StreamableHTTPEdgeClientTransport, f as SSEEdgeClientTransport, l as ServeOptions, n as MCPClientOAuthCallbackConfig, o as BaseTransportType, r as MCPClientOAuthResult, s as CORSOptions } from "../client-DbS2uI6p.js";
|
|
2
|
+
import "../mcp-Dw5vDrY8.js";
|
|
3
|
+
import "../do-oauth-client-provider-DGc5pP0l.js";
|
|
4
|
+
import "../index-DhJCaDWd.js";
|
|
5
|
+
import "../ai-types-D5YoPrBZ.js";
|
|
6
|
+
import { c as ConnectionContext, s as Connection, t as Agent } from "../index-DxXJbYBM.js";
|
|
7
|
+
import { ElicitRequest, ElicitRequestSchema, ElicitResult, ElicitResult as ElicitResult$1, JSONRPCMessage, MessageExtraInfo } from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
9
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
|
+
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
//#region src/mcp/worker-transport.d.ts
|
|
13
|
+
interface WorkerTransportOptions {
|
|
14
|
+
sessionIdGenerator?: () => string;
|
|
15
|
+
enableJsonResponse?: boolean;
|
|
16
|
+
onsessioninitialized?: (sessionId: string) => void;
|
|
17
|
+
corsOptions?: CORSOptions;
|
|
21
18
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
webSocketMessage(ws: WebSocket, event: ArrayBuffer | string): Promise<void>;
|
|
52
|
-
webSocketError(ws: WebSocket, error: unknown): Promise<void>;
|
|
53
|
-
webSocketClose(ws: WebSocket, code: number, reason: string, wasClean: boolean): Promise<void>;
|
|
54
|
-
static mount(path: string, { binding, corsOptions, }?: {
|
|
55
|
-
binding?: string;
|
|
56
|
-
corsOptions?: CORSOptions;
|
|
57
|
-
}): {
|
|
58
|
-
fetch<Env>(request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
59
|
-
};
|
|
60
|
-
static serveSSE(path: string, { binding, corsOptions, }?: {
|
|
61
|
-
binding?: string;
|
|
62
|
-
corsOptions?: CORSOptions;
|
|
63
|
-
}): {
|
|
64
|
-
fetch<Env>(request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
65
|
-
};
|
|
66
|
-
static serve(path: string, { binding, corsOptions, }?: {
|
|
67
|
-
binding?: string;
|
|
68
|
-
corsOptions?: CORSOptions;
|
|
69
|
-
}): {
|
|
70
|
-
fetch<Env>(request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
71
|
-
};
|
|
19
|
+
declare class WorkerTransport implements Transport {
|
|
20
|
+
private started;
|
|
21
|
+
private initialized;
|
|
22
|
+
private sessionIdGenerator?;
|
|
23
|
+
private enableJsonResponse;
|
|
24
|
+
private onsessioninitialized?;
|
|
25
|
+
private standaloneSseStreamId;
|
|
26
|
+
private streamMapping;
|
|
27
|
+
private requestToStreamMapping;
|
|
28
|
+
private requestResponseMap;
|
|
29
|
+
private corsOptions?;
|
|
30
|
+
private protocolVersion?;
|
|
31
|
+
sessionId?: string;
|
|
32
|
+
onclose?: () => void;
|
|
33
|
+
onerror?: (error: Error) => void;
|
|
34
|
+
onmessage?: (message: JSONRPCMessage, extra?: MessageExtraInfo) => void;
|
|
35
|
+
constructor(options?: WorkerTransportOptions);
|
|
36
|
+
start(): Promise<void>;
|
|
37
|
+
private validateProtocolVersion;
|
|
38
|
+
private getHeaders;
|
|
39
|
+
handleRequest(request: Request, parsedBody?: unknown): Promise<Response>;
|
|
40
|
+
private handleGetRequest;
|
|
41
|
+
private handlePostRequest;
|
|
42
|
+
private handleDeleteRequest;
|
|
43
|
+
private handleOptionsRequest;
|
|
44
|
+
private handleUnsupportedRequest;
|
|
45
|
+
private validateSession;
|
|
46
|
+
close(): Promise<void>;
|
|
47
|
+
send(message: JSONRPCMessage): Promise<void>;
|
|
72
48
|
}
|
|
73
|
-
|
|
74
|
-
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/mcp/handler.d.ts
|
|
51
|
+
interface CreateMcpHandlerOptions extends WorkerTransportOptions {
|
|
52
|
+
/**
|
|
53
|
+
* The route path that this MCP handler should respond to.
|
|
54
|
+
* If specified, the handler will only process requests that match this route.
|
|
55
|
+
* @default "/mcp"
|
|
56
|
+
*/
|
|
57
|
+
route?: string;
|
|
58
|
+
/**
|
|
59
|
+
* CORS configuration options for handling cross-origin requests.
|
|
60
|
+
* These options are passed to the WorkerTransport which handles adding
|
|
61
|
+
* CORS headers to all responses.
|
|
62
|
+
*
|
|
63
|
+
* Default values are:
|
|
64
|
+
* - origin: "*"
|
|
65
|
+
* - headers: "Content-Type, Accept, Authorization, mcp-session-id, MCP-Protocol-Version"
|
|
66
|
+
* - methods: "GET, POST, DELETE, OPTIONS"
|
|
67
|
+
* - exposeHeaders: "mcp-session-id"
|
|
68
|
+
* - maxAge: 86400
|
|
69
|
+
*
|
|
70
|
+
* Provided options will overwrite the defaults.
|
|
71
|
+
*/
|
|
72
|
+
corsOptions?: CORSOptions;
|
|
73
|
+
}
|
|
74
|
+
type OAuthExecutionContext = ExecutionContext & {
|
|
75
|
+
props?: Record<string, unknown>;
|
|
76
|
+
};
|
|
77
|
+
declare function createMcpHandler(server: McpServer | Server, options?: CreateMcpHandlerOptions): (request: Request, env: unknown, ctx: ExecutionContext) => Promise<Response>;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated This has been renamed to createMcpHandler, and experimental_createMcpHandler will be removed in the next major version
|
|
80
|
+
*/
|
|
81
|
+
declare function experimental_createMcpHandler(server: McpServer | Server, options?: CreateMcpHandlerOptions): (request: Request, env: unknown, ctx: ExecutionContext) => Promise<Response>;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/mcp/auth-context.d.ts
|
|
84
|
+
interface McpAuthContext {
|
|
85
|
+
props: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
declare function getMcpAuthContext(): McpAuthContext | undefined;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/mcp/index.d.ts
|
|
90
|
+
declare abstract class McpAgent<Env = unknown, State = unknown, Props extends Record<string, unknown> = Record<string, unknown>> extends Agent<Env, State, Props> {
|
|
91
|
+
private _transport?;
|
|
92
|
+
props?: Props;
|
|
93
|
+
abstract server: MaybePromise<McpServer | Server>;
|
|
94
|
+
abstract init(): Promise<void>;
|
|
95
|
+
setInitializeRequest(initializeRequest: JSONRPCMessage): Promise<void>;
|
|
96
|
+
getInitializeRequest(): Promise<JSONRPCMessage | undefined>;
|
|
97
|
+
/** Read the transport type for this agent.
|
|
98
|
+
* This relies on the naming scheme being `sse:${sessionId}`
|
|
99
|
+
* or `streamable-http:${sessionId}`.
|
|
100
|
+
*/
|
|
101
|
+
getTransportType(): BaseTransportType;
|
|
102
|
+
/** Read the sessionId for this agent.
|
|
103
|
+
* This relies on the naming scheme being `sse:${sessionId}`
|
|
104
|
+
* or `streamable-http:${sessionId}`.
|
|
105
|
+
*/
|
|
106
|
+
getSessionId(): string;
|
|
107
|
+
/** Get the unique WebSocket. SSE transport only. */
|
|
108
|
+
private getWebSocket;
|
|
109
|
+
/** Returns a new transport matching the type of the Agent. */
|
|
110
|
+
private initTransport;
|
|
111
|
+
/** Update and store the props */
|
|
112
|
+
updateProps(props?: Props): Promise<void>;
|
|
113
|
+
reinitializeServer(): Promise<void>;
|
|
114
|
+
/** Sets up the MCP transport and server every time the Agent is started.*/
|
|
115
|
+
onStart(props?: Props): Promise<void>;
|
|
116
|
+
/** Validates new WebSocket connections. */
|
|
117
|
+
onConnect(conn: Connection, {
|
|
118
|
+
request: req
|
|
119
|
+
}: ConnectionContext): Promise<void>;
|
|
120
|
+
/** Handles MCP Messages for the legacy SSE transport. */
|
|
121
|
+
onSSEMcpMessage(_sessionId: string, messageBody: unknown): Promise<Error | null>;
|
|
122
|
+
/** Elicit user input with a message and schema */
|
|
123
|
+
elicitInput(params: {
|
|
124
|
+
message: string;
|
|
125
|
+
requestedSchema: unknown;
|
|
126
|
+
}): Promise<ElicitResult$1>;
|
|
127
|
+
/** Wait for elicitation response through storage polling */
|
|
128
|
+
private _waitForElicitationResponse;
|
|
129
|
+
/** Handle elicitation responses */
|
|
130
|
+
private _handleElicitationResponse;
|
|
131
|
+
/** Return a handler for the given path for this MCP.
|
|
132
|
+
* Defaults to Streamable HTTP transport.
|
|
133
|
+
*/
|
|
134
|
+
static serve(path: string, {
|
|
135
|
+
binding,
|
|
136
|
+
corsOptions,
|
|
137
|
+
transport,
|
|
138
|
+
jurisdiction
|
|
139
|
+
}?: ServeOptions): {
|
|
140
|
+
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Legacy api
|
|
144
|
+
**/
|
|
145
|
+
static mount(path: string, opts?: Omit<ServeOptions, "transport">): {
|
|
146
|
+
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
147
|
+
};
|
|
148
|
+
static serveSSE(path: string, opts?: Omit<ServeOptions, "transport">): {
|
|
149
|
+
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { type CreateMcpHandlerOptions, type ElicitRequest, ElicitRequestSchema, type ElicitResult, type MCPClientOAuthCallbackConfig, type MCPClientOAuthResult, McpAgent, type McpAuthContext, type OAuthExecutionContext, SSEEdgeClientTransport, StreamableHTTPEdgeClientTransport, WorkerTransport, type WorkerTransportOptions, createMcpHandler, experimental_createMcpHandler, getMcpAuthContext };
|
|
154
|
+
//# sourceMappingURL=index.d.ts.map
|