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