agents 0.0.0-f641104 → 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/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 { WorkflowEntrypoint as WorkflowEntrypoint$1 } from "cloudflare:workers";
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-X6BBKLSC.js";
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