agents 0.0.0-f973b54 → 0.0.0-fac1fe8

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 (56) hide show
  1. package/README.md +157 -27
  2. package/dist/ai-chat-agent.d.ts +40 -10
  3. package/dist/ai-chat-agent.js +268 -143
  4. package/dist/ai-chat-agent.js.map +1 -1
  5. package/dist/ai-chat-v5-migration.d.ts +152 -0
  6. package/dist/ai-chat-v5-migration.js +19 -0
  7. package/dist/ai-react.d.ts +71 -67
  8. package/dist/ai-react.js +160 -54
  9. package/dist/ai-react.js.map +1 -1
  10. package/dist/ai-types.d.ts +36 -19
  11. package/dist/ai-types.js +6 -0
  12. package/dist/chunk-AVYJQSLW.js +17 -0
  13. package/dist/chunk-AVYJQSLW.js.map +1 -0
  14. package/dist/chunk-LL2AFX7V.js +109 -0
  15. package/dist/chunk-LL2AFX7V.js.map +1 -0
  16. package/dist/{chunk-Q5ZBHY4Z.js → chunk-MH46VMM4.js} +209 -53
  17. package/dist/chunk-MH46VMM4.js.map +1 -0
  18. package/dist/chunk-QEVM4BVL.js +116 -0
  19. package/dist/chunk-QEVM4BVL.js.map +1 -0
  20. package/dist/chunk-UJVEAURM.js +150 -0
  21. package/dist/chunk-UJVEAURM.js.map +1 -0
  22. package/dist/chunk-YDUDMOL6.js +1296 -0
  23. package/dist/chunk-YDUDMOL6.js.map +1 -0
  24. package/dist/client-CvaJdLQA.d.ts +5015 -0
  25. package/dist/client.d.ts +16 -2
  26. package/dist/client.js +7 -126
  27. package/dist/client.js.map +1 -1
  28. package/dist/index.d.ts +275 -25
  29. package/dist/index.js +13 -3
  30. package/dist/mcp/client.d.ts +9 -775
  31. package/dist/mcp/client.js +1 -2
  32. package/dist/mcp/do-oauth-client-provider.d.ts +4 -3
  33. package/dist/mcp/do-oauth-client-provider.js +3 -103
  34. package/dist/mcp/do-oauth-client-provider.js.map +1 -1
  35. package/dist/mcp/index.d.ts +73 -50
  36. package/dist/mcp/index.js +878 -661
  37. package/dist/mcp/index.js.map +1 -1
  38. package/dist/observability/index.d.ts +46 -0
  39. package/dist/observability/index.js +11 -0
  40. package/dist/observability/index.js.map +1 -0
  41. package/dist/react.d.ts +89 -5
  42. package/dist/react.js +23 -9
  43. package/dist/react.js.map +1 -1
  44. package/dist/schedule.d.ts +81 -7
  45. package/dist/schedule.js +19 -8
  46. package/dist/schedule.js.map +1 -1
  47. package/dist/serializable.d.ts +32 -0
  48. package/dist/serializable.js +1 -0
  49. package/dist/serializable.js.map +1 -0
  50. package/package.json +86 -67
  51. package/src/index.ts +1164 -157
  52. package/dist/chunk-HMLY7DHA.js +0 -16
  53. package/dist/chunk-HN5JVKAZ.js +0 -606
  54. package/dist/chunk-HN5JVKAZ.js.map +0 -1
  55. package/dist/chunk-Q5ZBHY4Z.js.map +0 -1
  56. /package/dist/{chunk-HMLY7DHA.js.map → ai-chat-v5-migration.js.map} +0 -0
@@ -1,8 +1,7 @@
1
1
  import {
2
2
  MCPClientManager,
3
3
  getNamespacedData
4
- } from "../chunk-Q5ZBHY4Z.js";
5
- import "../chunk-HMLY7DHA.js";
4
+ } from "../chunk-MH46VMM4.js";
6
5
  export {
7
6
  MCPClientManager,
8
7
  getNamespacedData
@@ -10,11 +10,12 @@ declare class DurableObjectOAuthClientProvider implements AgentsOAuthProvider {
10
10
  storage: DurableObjectStorage;
11
11
  clientName: string;
12
12
  baseRedirectUrl: string;
13
- private authUrl_;
14
- private serverId_;
15
- private clientId_;
13
+ private _authUrl_;
14
+ private _serverId_;
15
+ private _clientId_;
16
16
  constructor(storage: DurableObjectStorage, clientName: string, baseRedirectUrl: string);
17
17
  get clientMetadata(): OAuthClientMetadata;
18
+ get clientUri(): string;
18
19
  get redirectUrl(): string;
19
20
  get clientId(): string;
20
21
  set clientId(clientId_: string);
@@ -1,106 +1,6 @@
1
- import "../chunk-HMLY7DHA.js";
2
-
3
- // src/mcp/do-oauth-client-provider.ts
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
- };
1
+ import {
2
+ DurableObjectOAuthClientProvider
3
+ } from "../chunk-LL2AFX7V.js";
104
4
  export {
105
5
  DurableObjectOAuthClientProvider
106
6
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/mcp/do-oauth-client-provider.ts"],"sourcesContent":["import type { OAuthClientProvider } from \"@modelcontextprotocol/sdk/client/auth.js\";\nimport type {\n OAuthTokens,\n OAuthClientMetadata,\n OAuthClientInformation,\n OAuthClientInformationFull,\n} from \"@modelcontextprotocol/sdk/shared/auth.js\";\n\n// A slight extension to the standard OAuthClientProvider interface because `redirectToAuthorization` doesn't give us the interface we need\n// This allows us to track authentication for a specific server and associated dynamic client registration\nexport interface AgentsOAuthProvider extends OAuthClientProvider {\n authUrl: string | undefined;\n clientId: string | undefined;\n serverId: string | undefined;\n}\n\nexport class DurableObjectOAuthClientProvider implements AgentsOAuthProvider {\n private authUrl_: string | undefined;\n private serverId_: string | undefined;\n private clientId_: string | undefined;\n\n constructor(\n public storage: DurableObjectStorage,\n public clientName: string,\n public baseRedirectUrl: string\n ) {}\n\n get clientMetadata(): OAuthClientMetadata {\n return {\n redirect_uris: [this.redirectUrl],\n token_endpoint_auth_method: \"none\",\n grant_types: [\"authorization_code\", \"refresh_token\"],\n response_types: [\"code\"],\n client_name: this.clientName,\n client_uri: \"example.com\",\n };\n }\n\n get redirectUrl() {\n return `${this.baseRedirectUrl}/${this.serverId}`;\n }\n\n get clientId() {\n if (!this.clientId_) {\n throw new Error(\"Trying to access clientId before it was set\");\n }\n return this.clientId_;\n }\n\n set clientId(clientId_: string) {\n this.clientId_ = clientId_;\n }\n\n get serverId() {\n if (!this.serverId_) {\n throw new Error(\"Trying to access serverId before it was set\");\n }\n return this.serverId_;\n }\n\n set serverId(serverId_: string) {\n this.serverId_ = serverId_;\n }\n\n keyPrefix(clientId: string) {\n return `/${this.clientName}/${this.serverId}/${clientId}`;\n }\n\n clientInfoKey(clientId: string) {\n return `${this.keyPrefix(clientId)}/client_info/`;\n }\n\n async clientInformation(): Promise<OAuthClientInformation | undefined> {\n if (!this.clientId_) {\n return undefined;\n }\n return (\n (await this.storage.get<OAuthClientInformation>(\n this.clientInfoKey(this.clientId)\n )) ?? undefined\n );\n }\n\n async saveClientInformation(\n clientInformation: OAuthClientInformationFull\n ): Promise<void> {\n await this.storage.put(\n this.clientInfoKey(clientInformation.client_id),\n clientInformation\n );\n this.clientId = clientInformation.client_id;\n }\n\n tokenKey(clientId: string) {\n return `${this.keyPrefix(clientId)}/token`;\n }\n\n async tokens(): Promise<OAuthTokens | undefined> {\n if (!this.clientId_) {\n return undefined;\n }\n return (\n (await this.storage.get<OAuthTokens>(this.tokenKey(this.clientId))) ??\n undefined\n );\n }\n\n async saveTokens(tokens: OAuthTokens): Promise<void> {\n await this.storage.put(this.tokenKey(this.clientId), tokens);\n }\n\n get authUrl() {\n return this.authUrl_;\n }\n\n /**\n * Because this operates on the server side (but we need browser auth), we send this url back to the user\n * and require user interact to initiate the redirect flow\n */\n async redirectToAuthorization(authUrl: URL): Promise<void> {\n // We want to track the client ID in state here because the typescript SSE client sometimes does\n // a dynamic client registration AFTER generating this redirect URL.\n const client_id = authUrl.searchParams.get(\"client_id\");\n if (client_id) {\n authUrl.searchParams.append(\"state\", client_id);\n }\n this.authUrl_ = authUrl.toString();\n }\n\n codeVerifierKey(clientId: string) {\n return `${this.keyPrefix(clientId)}/code_verifier`;\n }\n\n async saveCodeVerifier(verifier: string): Promise<void> {\n await this.storage.put(this.codeVerifierKey(this.clientId), verifier);\n }\n\n async codeVerifier(): Promise<string> {\n const codeVerifier = await this.storage.get<string>(\n this.codeVerifierKey(this.clientId)\n );\n if (!codeVerifier) {\n throw new Error(\"No code verifier found\");\n }\n return codeVerifier;\n }\n}\n"],"mappings":";;;AAgBO,IAAM,mCAAN,MAAsE;AAAA,EAK3E,YACS,SACA,YACA,iBACP;AAHO;AACA;AACA;AAAA,EACN;AAAA,EAEH,IAAI,iBAAsC;AACxC,WAAO;AAAA,MACL,eAAe,CAAC,KAAK,WAAW;AAAA,MAChC,4BAA4B;AAAA,MAC5B,aAAa,CAAC,sBAAsB,eAAe;AAAA,MACnD,gBAAgB,CAAC,MAAM;AAAA,MACvB,aAAa,KAAK;AAAA,MAClB,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EAEA,IAAI,cAAc;AAChB,WAAO,GAAG,KAAK,eAAe,IAAI,KAAK,QAAQ;AAAA,EACjD;AAAA,EAEA,IAAI,WAAW;AACb,QAAI,CAAC,KAAK,WAAW;AACnB,YAAM,IAAI,MAAM,6CAA6C;AAAA,IAC/D;AACA,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,SAAS,WAAmB;AAC9B,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA,IAAI,WAAW;AACb,QAAI,CAAC,KAAK,WAAW;AACnB,YAAM,IAAI,MAAM,6CAA6C;AAAA,IAC/D;AACA,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,SAAS,WAAmB;AAC9B,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA,UAAU,UAAkB;AAC1B,WAAO,IAAI,KAAK,UAAU,IAAI,KAAK,QAAQ,IAAI,QAAQ;AAAA,EACzD;AAAA,EAEA,cAAc,UAAkB;AAC9B,WAAO,GAAG,KAAK,UAAU,QAAQ,CAAC;AAAA,EACpC;AAAA,EAEA,MAAM,oBAAiE;AACrE,QAAI,CAAC,KAAK,WAAW;AACnB,aAAO;AAAA,IACT;AACA,WACG,MAAM,KAAK,QAAQ;AAAA,MAClB,KAAK,cAAc,KAAK,QAAQ;AAAA,IAClC,KAAM;AAAA,EAEV;AAAA,EAEA,MAAM,sBACJ,mBACe;AACf,UAAM,KAAK,QAAQ;AAAA,MACjB,KAAK,cAAc,kBAAkB,SAAS;AAAA,MAC9C;AAAA,IACF;AACA,SAAK,WAAW,kBAAkB;AAAA,EACpC;AAAA,EAEA,SAAS,UAAkB;AACzB,WAAO,GAAG,KAAK,UAAU,QAAQ,CAAC;AAAA,EACpC;AAAA,EAEA,MAAM,SAA2C;AAC/C,QAAI,CAAC,KAAK,WAAW;AACnB,aAAO;AAAA,IACT;AACA,WACG,MAAM,KAAK,QAAQ,IAAiB,KAAK,SAAS,KAAK,QAAQ,CAAC,KACjE;AAAA,EAEJ;AAAA,EAEA,MAAM,WAAW,QAAoC;AACnD,UAAM,KAAK,QAAQ,IAAI,KAAK,SAAS,KAAK,QAAQ,GAAG,MAAM;AAAA,EAC7D;AAAA,EAEA,IAAI,UAAU;AACZ,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,wBAAwB,SAA6B;AAGzD,UAAM,YAAY,QAAQ,aAAa,IAAI,WAAW;AACtD,QAAI,WAAW;AACb,cAAQ,aAAa,OAAO,SAAS,SAAS;AAAA,IAChD;AACA,SAAK,WAAW,QAAQ,SAAS;AAAA,EACnC;AAAA,EAEA,gBAAgB,UAAkB;AAChC,WAAO,GAAG,KAAK,UAAU,QAAQ,CAAC;AAAA,EACpC;AAAA,EAEA,MAAM,iBAAiB,UAAiC;AACtD,UAAM,KAAK,QAAQ,IAAI,KAAK,gBAAgB,KAAK,QAAQ,GAAG,QAAQ;AAAA,EACtE;AAAA,EAEA,MAAM,eAAgC;AACpC,UAAM,eAAe,MAAM,KAAK,QAAQ;AAAA,MACtC,KAAK,gBAAgB,KAAK,QAAQ;AAAA,IACpC;AACA,QAAI,CAAC,cAAc;AACjB,YAAM,IAAI,MAAM,wBAAwB;AAAA,IAC1C;AACA,WAAO;AAAA,EACT;AACF;","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,73 +1,96 @@
1
- import { MCPClientManager } from './client.js';
2
- import { DurableObject } from 'cloudflare:workers';
3
- import { Connection, WSMessage } from 'partyserver';
4
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
5
1
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
6
- import 'zod';
7
- import '@modelcontextprotocol/sdk/types.js';
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { ElicitResult } from '@modelcontextprotocol/sdk/types.js';
4
+ export { ElicitRequest, ElicitRequestSchema, ElicitResult } from '@modelcontextprotocol/sdk/types.js';
5
+ import { Agent, AgentContext } from '../index.js';
6
+ export { S as SSEEdgeClientTransport, a as StreamableHTTPEdgeClientTransport } from '../client-CvaJdLQA.js';
7
+ import { Connection, ConnectionContext, WSMessage } from 'partyserver';
8
+ import 'cloudflare:workers';
8
9
  import '@modelcontextprotocol/sdk/client/index.js';
10
+ import '../observability/index.js';
11
+ import '../ai-types.js';
12
+ import 'ai';
13
+ import 'zod';
14
+ import '@modelcontextprotocol/sdk/shared/protocol.js';
9
15
  import '@modelcontextprotocol/sdk/client/sse.js';
16
+ import '@modelcontextprotocol/sdk/client/streamableHttp.js';
10
17
  import './do-oauth-client-provider.js';
11
18
  import '@modelcontextprotocol/sdk/client/auth.js';
12
19
  import '@modelcontextprotocol/sdk/shared/auth.js';
13
- import '@modelcontextprotocol/sdk/shared/protocol.js';
14
- import 'ai';
15
20
 
21
+ type MaybePromise<T> = T | Promise<T>;
22
+ type TransportType = "sse" | "streamable-http";
16
23
  interface CORSOptions {
17
24
  origin?: string;
18
25
  methods?: string;
19
26
  headers?: string;
20
27
  maxAge?: number;
28
+ exposeHeaders?: string;
21
29
  }
22
- type MaybePromise<T> = T | Promise<T>;
23
- declare abstract class McpAgent<Env = unknown, State = unknown, Props extends Record<string, unknown> = Record<string, unknown>> extends DurableObject<Env> {
24
- #private;
25
- get mcp(): MCPClientManager;
26
- protected constructor(ctx: DurableObjectState, env: Env);
27
- /**
28
- * Agents API allowlist
29
- */
30
- initialState: State;
31
- get state(): State;
32
- sql<T = Record<string, string | number | boolean | null>>(strings: TemplateStringsArray, ...values: (string | number | boolean | null)[]): T[];
33
- setState(state: State): void;
34
- onStateUpdate(state: State | undefined, source: Connection | "server"): void;
35
- onStart(): Promise<void>;
36
- /**
37
- * McpAgent API
38
- */
30
+ interface ServeOptions {
31
+ binding?: string;
32
+ corsOptions?: CORSOptions;
33
+ transport?: TransportType;
34
+ }
35
+
36
+ declare abstract class McpAgent<Env = unknown, State = unknown, Props extends Record<string, unknown> = Record<string, unknown>> extends Agent<Env, State, Props> {
37
+ private _transport?;
38
+ private _requestIdToConnectionId;
39
+ private _standaloneSseConnectionId?;
40
+ props?: Props;
39
41
  abstract server: MaybePromise<McpServer | Server>;
40
- props: Props;
41
- initRun: boolean;
42
42
  abstract init(): Promise<void>;
43
- _init(props: Props): Promise<void>;
43
+ constructor(ctx: AgentContext, env: Env);
44
44
  setInitialized(): Promise<void>;
45
45
  isInitialized(): Promise<boolean>;
46
- fetch(request: Request): Promise<Response>;
47
- getWebSocket(): WebSocket | null;
48
- getWebSocketForResponseID(id: string): WebSocket | null;
46
+ /** Read the transport type for this agent.
47
+ * This relies on the naming scheme being `sse:${sessionId}`
48
+ * or `streamable-http:${sessionId}`.
49
+ */
50
+ getTransportType(): TransportType;
51
+ /** Get the WebSocket for the standalone SSE if any. Streamable HTTP only. */
52
+ private getWebSocketForStandaloneSse;
53
+ /** Get the unique WebSocket. SSE transport only. */
54
+ private getWebSocket;
55
+ /** Get the corresponding WebSocket for a responseId. Streamable HTTP only. */
56
+ private getWebSocketForResponseID;
57
+ /** Returns a new transport matching the type of the Agent. */
58
+ private initTransport;
59
+ /** Update and store the props */
60
+ updateProps(props?: Props): Promise<void>;
61
+ /** Sets up the MCP transport and server every time the Agent is started.*/
62
+ onStart(props?: Props): Promise<void>;
63
+ /** Validates new WebSocket connections. */
64
+ onConnect(conn: Connection, _: ConnectionContext): Promise<void>;
65
+ /** Handles MCP Messages for Streamable HTTP. */
49
66
  onMessage(connection: Connection, event: WSMessage): Promise<void>;
50
- onSSEMcpMessage(sessionId: string, request: Request): Promise<Error | null>;
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>;
67
+ /** Remove clients from our cache when they disconnect */
68
+ onClose(conn: Connection, _code: number, _reason: string, _wasClean: boolean): Promise<void>;
69
+ /** Handles MCP Messages for the legacy SSE transport. */
70
+ onSSEMcpMessage(_sessionId: string, messageBody: unknown): Promise<Error | null>;
71
+ /** Elicit user input with a message and schema */
72
+ elicitInput(params: {
73
+ message: string;
74
+ requestedSchema: unknown;
75
+ }): Promise<ElicitResult>;
76
+ /** Wait for elicitation response through storage polling */
77
+ private _waitForElicitationResponse;
78
+ /** Handle elicitation responses */
79
+ private _handleElicitationResponse;
80
+ /** Return a handler for the given path for this MCP.
81
+ * Defaults to Streamable HTTP transport.
82
+ */
83
+ static serve(path: string, { binding, corsOptions, transport }?: ServeOptions): {
84
+ fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
59
85
  };
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>;
86
+ /**
87
+ * Legacy api
88
+ **/
89
+ static mount(path: string, opts?: Omit<ServeOptions, "transport">): {
90
+ fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
65
91
  };
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>;
92
+ static serveSSE(path: string, opts?: Omit<ServeOptions, "transport">): {
93
+ fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
71
94
  };
72
95
  }
73
96