agents 0.0.0-33ff003 → 0.0.0-352d62c
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 +131 -25
- package/dist/ai-chat-agent.d.ts +10 -5
- package/dist/ai-chat-agent.js +75 -42
- package/dist/ai-chat-agent.js.map +1 -1
- package/dist/ai-react.d.ts +14 -9
- package/dist/ai-react.js +31 -31
- package/dist/ai-react.js.map +1 -1
- package/dist/ai-types.d.ts +27 -9
- package/dist/ai-types.js +6 -0
- package/dist/chunk-EEKLJYON.js +17 -0
- package/dist/chunk-EEKLJYON.js.map +1 -0
- package/dist/{chunk-Y67CHZBI.js → chunk-EM3J4KV7.js} +168 -34
- package/dist/chunk-EM3J4KV7.js.map +1 -0
- package/dist/chunk-ID62XSAS.js +1290 -0
- package/dist/chunk-ID62XSAS.js.map +1 -0
- package/dist/{chunk-BZXOAZUX.js → chunk-PVQZBKN7.js} +5 -5
- package/dist/chunk-PVQZBKN7.js.map +1 -0
- package/dist/{chunk-QSGN3REV.js → chunk-QEVM4BVL.js} +10 -17
- package/dist/chunk-QEVM4BVL.js.map +1 -0
- package/dist/client-DgyzBU_8.d.ts +4601 -0
- package/dist/client.d.ts +8 -2
- package/dist/client.js +2 -2
- package/dist/index.d.ts +192 -19
- package/dist/index.js +11 -5
- package/dist/mcp/client.d.ts +9 -781
- package/dist/mcp/client.js +1 -2
- package/dist/mcp/do-oauth-client-provider.js +1 -2
- package/dist/mcp/index.d.ts +38 -10
- package/dist/mcp/index.js +238 -62
- package/dist/mcp/index.js.map +1 -1
- package/dist/observability/index.d.ts +46 -0
- package/dist/observability/index.js +11 -0
- package/dist/react.d.ts +81 -11
- package/dist/react.js +20 -10
- package/dist/react.js.map +1 -1
- package/dist/schedule.d.ts +6 -6
- package/dist/schedule.js +4 -6
- package/dist/schedule.js.map +1 -1
- package/dist/serializable.d.ts +32 -0
- package/dist/serializable.js +1 -0
- package/dist/serializable.js.map +1 -0
- package/package.json +79 -71
- package/src/index.ts +865 -187
- package/dist/chunk-BZXOAZUX.js.map +0 -1
- package/dist/chunk-NOUFNU2O.js +0 -12
- package/dist/chunk-NPGUKHFR.js +0 -773
- package/dist/chunk-NPGUKHFR.js.map +0 -1
- package/dist/chunk-QSGN3REV.js.map +0 -1
- package/dist/chunk-Y67CHZBI.js.map +0 -1
- /package/dist/{chunk-NOUFNU2O.js.map → observability/index.js.map} +0 -0
package/dist/mcp/client.js
CHANGED
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { MCPClientManager } from '
|
|
1
|
+
import { M as MCPClientManager } from '../client-DgyzBU_8.js';
|
|
2
|
+
export { S as SSEEdgeClientTransport, a as StreamableHTTPEdgeClientTransport } from '../client-DgyzBU_8.js';
|
|
2
3
|
import { DurableObject } from 'cloudflare:workers';
|
|
3
|
-
import { Connection, WSMessage } from 'partyserver';
|
|
4
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
4
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
|
+
import { ElicitResult } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
export { ElicitRequest, ElicitRequestSchema, ElicitResult } from '@modelcontextprotocol/sdk/types.js';
|
|
8
|
+
import { Connection, WSMessage } from 'partyserver';
|
|
6
9
|
import 'zod';
|
|
7
|
-
import '@modelcontextprotocol/sdk/types.js';
|
|
8
10
|
import '@modelcontextprotocol/sdk/client/index.js';
|
|
11
|
+
import '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
12
|
+
import 'ai';
|
|
9
13
|
import '@modelcontextprotocol/sdk/client/sse.js';
|
|
14
|
+
import '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
10
15
|
import './do-oauth-client-provider.js';
|
|
11
16
|
import '@modelcontextprotocol/sdk/client/auth.js';
|
|
12
17
|
import '@modelcontextprotocol/sdk/shared/auth.js';
|
|
13
|
-
import '@modelcontextprotocol/sdk/shared/protocol.js';
|
|
14
|
-
import 'ai';
|
|
15
18
|
|
|
16
19
|
interface CORSOptions {
|
|
17
20
|
origin?: string;
|
|
@@ -40,6 +43,13 @@ declare abstract class McpAgent<Env = unknown, State = unknown, Props extends Re
|
|
|
40
43
|
get state(): State;
|
|
41
44
|
sql<T = Record<string, string | number | boolean | null>>(strings: TemplateStringsArray, ...values: (string | number | boolean | null)[]): T[];
|
|
42
45
|
setState(state: State): void;
|
|
46
|
+
/**
|
|
47
|
+
* Elicit user input with a message and schema
|
|
48
|
+
*/
|
|
49
|
+
elicitInput(params: {
|
|
50
|
+
message: string;
|
|
51
|
+
requestedSchema: unknown;
|
|
52
|
+
}): Promise<ElicitResult>;
|
|
43
53
|
onStateUpdate(state: State | undefined, source: Connection | "server"): void;
|
|
44
54
|
onStart(): Promise<void>;
|
|
45
55
|
/**
|
|
@@ -49,31 +59,49 @@ declare abstract class McpAgent<Env = unknown, State = unknown, Props extends Re
|
|
|
49
59
|
props: Props;
|
|
50
60
|
initRun: boolean;
|
|
51
61
|
abstract init(): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Handle errors that occur during initialization or operation.
|
|
64
|
+
* Override this method to provide custom error handling.
|
|
65
|
+
* @param error - The error that occurred
|
|
66
|
+
* @returns An error response object with status code and message
|
|
67
|
+
*/
|
|
68
|
+
onError(error: Error): {
|
|
69
|
+
status: number;
|
|
70
|
+
message: string;
|
|
71
|
+
};
|
|
52
72
|
_init(props: Props): Promise<void>;
|
|
53
73
|
setInitialized(): Promise<void>;
|
|
54
74
|
isInitialized(): Promise<boolean>;
|
|
75
|
+
updateProps(props: Props): Promise<void>;
|
|
55
76
|
private _initialize;
|
|
56
77
|
fetch(request: Request): Promise<Response>;
|
|
57
78
|
getWebSocket(): WebSocket | null;
|
|
58
79
|
getWebSocketForResponseID(id: string): WebSocket | null;
|
|
59
80
|
onMessage(connection: Connection, event: WSMessage): Promise<void>;
|
|
60
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Wait for elicitation response through storage polling
|
|
83
|
+
*/
|
|
84
|
+
private _waitForElicitationResponse;
|
|
85
|
+
/**
|
|
86
|
+
* Handle elicitation responses */
|
|
87
|
+
private _handleElicitationResponse;
|
|
88
|
+
onSSEMcpMessage(_sessionId: string, messageBody: unknown): Promise<Error | null>;
|
|
61
89
|
webSocketMessage(ws: WebSocket, event: ArrayBuffer | string): Promise<void>;
|
|
62
90
|
webSocketError(ws: WebSocket, error: unknown): Promise<void>;
|
|
63
91
|
webSocketClose(ws: WebSocket, code: number, reason: string, wasClean: boolean): Promise<void>;
|
|
64
|
-
static mount(path: string, { binding, corsOptions
|
|
92
|
+
static mount(path: string, { binding, corsOptions }?: {
|
|
65
93
|
binding?: string;
|
|
66
94
|
corsOptions?: CORSOptions;
|
|
67
95
|
}): {
|
|
68
96
|
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
69
97
|
};
|
|
70
|
-
static serveSSE(path: string, { binding, corsOptions
|
|
98
|
+
static serveSSE(path: string, { binding, corsOptions }?: {
|
|
71
99
|
binding?: string;
|
|
72
100
|
corsOptions?: CORSOptions;
|
|
73
101
|
}): {
|
|
74
102
|
fetch<Env>(this: void, request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
75
103
|
};
|
|
76
|
-
static serve(path: string, { binding, corsOptions
|
|
104
|
+
static serve(path: string, { binding, corsOptions }?: {
|
|
77
105
|
binding?: string;
|
|
78
106
|
corsOptions?: CORSOptions;
|
|
79
107
|
}): {
|