agents 0.0.0-f913299 → 0.0.0-f973b54
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 +2 -6
- package/dist/ai-chat-agent.d.ts +22 -2
- package/dist/ai-chat-agent.js +94 -30
- package/dist/ai-chat-agent.js.map +1 -1
- package/dist/ai-react.d.ts +5 -3
- package/dist/ai-react.js +37 -22
- package/dist/ai-react.js.map +1 -1
- package/dist/ai-types.d.ts +5 -0
- package/dist/{chunk-X6BBKLSC.js → chunk-HN5JVKAZ.js} +111 -73
- package/dist/chunk-HN5JVKAZ.js.map +1 -0
- package/dist/chunk-Q5ZBHY4Z.js +456 -0
- package/dist/chunk-Q5ZBHY4Z.js.map +1 -0
- package/dist/client.js +16 -23
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +20 -8
- package/dist/index.js +4 -3
- package/dist/mcp/client.d.ts +777 -0
- package/dist/mcp/client.js +10 -0
- package/dist/mcp/client.js.map +1 -0
- package/dist/mcp/do-oauth-client-provider.d.ts +41 -0
- package/dist/mcp/do-oauth-client-provider.js +107 -0
- package/dist/mcp/do-oauth-client-provider.js.map +1 -0
- package/dist/mcp/index.d.ts +74 -0
- package/dist/mcp/index.js +808 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/react.js +34 -27
- package/dist/react.js.map +1 -1
- package/package.json +38 -5
- package/src/index.ts +144 -92
- package/dist/chunk-X6BBKLSC.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { Server, Connection, PartyServerOptions } from "partyserver";
|
|
2
2
|
export { Connection, ConnectionContext, WSMessage } from "partyserver";
|
|
3
|
-
import {
|
|
3
|
+
import { MCPClientManager } from "./mcp/client.js";
|
|
4
|
+
import "zod";
|
|
5
|
+
import "@modelcontextprotocol/sdk/types.js";
|
|
6
|
+
import "@modelcontextprotocol/sdk/client/index.js";
|
|
7
|
+
import "@modelcontextprotocol/sdk/client/sse.js";
|
|
8
|
+
import "./mcp/do-oauth-client-provider.js";
|
|
9
|
+
import "@modelcontextprotocol/sdk/client/auth.js";
|
|
10
|
+
import "@modelcontextprotocol/sdk/shared/auth.js";
|
|
11
|
+
import "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
12
|
+
import "ai";
|
|
4
13
|
|
|
5
14
|
/**
|
|
6
15
|
* RPC request message from client
|
|
@@ -59,10 +68,6 @@ declare function unstable_callable(
|
|
|
59
68
|
target: (this: This, ...args: Args) => Return,
|
|
60
69
|
context: ClassMethodDecoratorContext
|
|
61
70
|
) => (this: This, ...args: Args) => Return;
|
|
62
|
-
/**
|
|
63
|
-
* A class for creating workflow entry points that can be used with Cloudflare Workers
|
|
64
|
-
*/
|
|
65
|
-
declare class WorkflowEntrypoint extends WorkflowEntrypoint$1 {}
|
|
66
71
|
/**
|
|
67
72
|
* Represents a scheduled task within an Agent
|
|
68
73
|
* @template T Type of the payload data
|
|
@@ -98,6 +103,13 @@ type Schedule<T = string> = {
|
|
|
98
103
|
cron: string;
|
|
99
104
|
}
|
|
100
105
|
);
|
|
106
|
+
declare function getCurrentAgent<
|
|
107
|
+
T extends Agent<unknown, unknown> = Agent<unknown, unknown>,
|
|
108
|
+
>(): {
|
|
109
|
+
agent: T;
|
|
110
|
+
connection: Connection | undefined;
|
|
111
|
+
request: Request<unknown, CfProperties<unknown>> | undefined;
|
|
112
|
+
};
|
|
101
113
|
/**
|
|
102
114
|
* Base class for creating Agent implementations
|
|
103
115
|
* @template Env Environment type containing bindings
|
|
@@ -105,6 +117,7 @@ type Schedule<T = string> = {
|
|
|
105
117
|
*/
|
|
106
118
|
declare class Agent<Env, State = unknown> extends Server<Env> {
|
|
107
119
|
#private;
|
|
120
|
+
mcp: MCPClientManager;
|
|
108
121
|
/**
|
|
109
122
|
* Initial state for the Agent
|
|
110
123
|
* Override to provide default state values
|
|
@@ -148,7 +161,7 @@ declare class Agent<Env, State = unknown> extends Server<Env> {
|
|
|
148
161
|
* Called when the Agent receives an email
|
|
149
162
|
* @param email Email message to process
|
|
150
163
|
*/
|
|
151
|
-
onEmail(email: ForwardableEmailMessage): void
|
|
164
|
+
onEmail(email: ForwardableEmailMessage): Promise<void>;
|
|
152
165
|
onError(connection: Connection, error: unknown): void | Promise<void>;
|
|
153
166
|
onError(error: unknown): void | Promise<void>;
|
|
154
167
|
/**
|
|
@@ -182,7 +195,6 @@ declare class Agent<Env, State = unknown> extends Server<Env> {
|
|
|
182
195
|
* @returns Array of matching Schedule objects
|
|
183
196
|
*/
|
|
184
197
|
getSchedules<T = string>(criteria?: {
|
|
185
|
-
description?: string;
|
|
186
198
|
id?: string;
|
|
187
199
|
type?: "scheduled" | "delayed" | "cron";
|
|
188
200
|
timeRange?: {
|
|
@@ -294,8 +306,8 @@ export {
|
|
|
294
306
|
type Schedule,
|
|
295
307
|
type StateUpdateMessage,
|
|
296
308
|
StreamingResponse,
|
|
297
|
-
WorkflowEntrypoint,
|
|
298
309
|
getAgentByName,
|
|
310
|
+
getCurrentAgent,
|
|
299
311
|
routeAgentEmail,
|
|
300
312
|
routeAgentRequest,
|
|
301
313
|
unstable_callable,
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Agent,
|
|
3
3
|
StreamingResponse,
|
|
4
|
-
WorkflowEntrypoint,
|
|
5
4
|
getAgentByName,
|
|
5
|
+
getCurrentAgent,
|
|
6
6
|
routeAgentEmail,
|
|
7
7
|
routeAgentRequest,
|
|
8
8
|
unstable_callable
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HN5JVKAZ.js";
|
|
10
|
+
import "./chunk-Q5ZBHY4Z.js";
|
|
10
11
|
import "./chunk-HMLY7DHA.js";
|
|
11
12
|
export {
|
|
12
13
|
Agent,
|
|
13
14
|
StreamingResponse,
|
|
14
|
-
WorkflowEntrypoint,
|
|
15
15
|
getAgentByName,
|
|
16
|
+
getCurrentAgent,
|
|
16
17
|
routeAgentEmail,
|
|
17
18
|
routeAgentRequest,
|
|
18
19
|
unstable_callable
|