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