agents 0.0.0-c5e3a32 → 0.0.0-c67d4b4
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 +234 -6
- package/dist/ai-chat-agent.d.ts +20 -18
- package/dist/ai-chat-agent.js +532 -260
- package/dist/ai-chat-agent.js.map +1 -1
- package/dist/ai-chat-v5-migration-DBHGW4Hv.js +155 -0
- package/dist/ai-chat-v5-migration-DBHGW4Hv.js.map +1 -0
- package/dist/ai-chat-v5-migration.d.ts +155 -0
- package/dist/ai-chat-v5-migration.js +3 -0
- package/dist/ai-react.d.ts +73 -85
- package/dist/ai-react.js +261 -199
- package/dist/ai-react.js.map +1 -1
- package/dist/ai-types-B3aQaFv3.js +20 -0
- package/dist/ai-types-B3aQaFv3.js.map +1 -0
- package/dist/ai-types-D5YoPrBZ.d.ts +95 -0
- package/dist/ai-types.d.ts +6 -74
- package/dist/ai-types.js +3 -1
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +27 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-BfiZ3HQd.js +117 -0
- package/dist/client-BfiZ3HQd.js.map +1 -0
- package/dist/client-CbWe9FBd.d.ts +104 -0
- package/dist/client-DZhjV_XA.js +719 -0
- package/dist/client-DZhjV_XA.js.map +1 -0
- package/dist/client-DZuq0CXm.d.ts +5283 -0
- package/dist/client.d.ts +11 -92
- package/dist/client.js +4 -11
- package/dist/codemode/ai.d.ts +27 -0
- package/dist/codemode/ai.js +151 -0
- package/dist/codemode/ai.js.map +1 -0
- package/dist/do-oauth-client-provider-CswoD5Lu.js +93 -0
- package/dist/do-oauth-client-provider-CswoD5Lu.js.map +1 -0
- package/dist/do-oauth-client-provider-DGc5pP0l.d.ts +55 -0
- package/dist/{index-DukU3sIa.d.ts → index-DHakc8tU.d.ts} +140 -145
- package/dist/index-DhJCaDWd.d.ts +58 -0
- package/dist/index.d.ts +69 -37
- package/dist/index.js +7 -28
- package/dist/mcp/client.d.ts +4 -1055
- package/dist/mcp/client.js +3 -9
- package/dist/mcp/do-oauth-client-provider.d.ts +2 -41
- package/dist/mcp/do-oauth-client-provider.js +3 -7
- package/dist/mcp/index.d.ts +190 -81
- package/dist/mcp/index.js +1427 -770
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/x402.d.ts +34 -0
- package/dist/mcp/x402.js +194 -0
- package/dist/mcp/x402.js.map +1 -0
- package/dist/mcp-Dw5vDrY8.d.ts +61 -0
- package/dist/observability/index.d.ts +3 -12
- package/dist/observability/index.js +7 -10
- package/dist/react-Ce7gmqP6.d.ts +113 -0
- package/dist/react.d.ts +10 -119
- package/dist/react.js +183 -110
- package/dist/react.js.map +1 -1
- package/dist/schedule.d.ts +91 -14
- package/dist/schedule.js +46 -21
- package/dist/schedule.js.map +1 -1
- package/dist/serializable-CymX8ovI.d.ts +39 -0
- package/dist/serializable.d.ts +7 -32
- package/dist/serializable.js +1 -1
- package/dist/src-C8K3lu37.js +1231 -0
- package/dist/src-C8K3lu37.js.map +1 -0
- package/package.json +76 -27
- package/dist/ai-types.js.map +0 -1
- package/dist/chunk-EDUDXISR.js +0 -1148
- package/dist/chunk-EDUDXISR.js.map +0 -1
- package/dist/chunk-KUH345EY.js +0 -116
- package/dist/chunk-KUH345EY.js.map +0 -1
- package/dist/chunk-MW5BQ2FW.js +0 -469
- package/dist/chunk-MW5BQ2FW.js.map +0 -1
- package/dist/chunk-PVQZBKN7.js +0 -106
- package/dist/chunk-PVQZBKN7.js.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp/client.js.map +0 -1
- package/dist/mcp/do-oauth-client-provider.js.map +0 -1
- package/dist/observability/index.js.map +0 -1
- package/dist/serializable.js.map +0 -1
- package/src/index.ts +0 -1732
|
@@ -1,87 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
a as MCPConnectionState,
|
|
3
|
+
t as MCPClientManager,
|
|
4
|
+
u as TransportType
|
|
5
|
+
} from "./client-DZuq0CXm.js";
|
|
6
|
+
import { t as Observability } from "./index-DhJCaDWd.js";
|
|
7
|
+
import { n as MessageType } from "./ai-types-D5YoPrBZ.js";
|
|
8
|
+
import {
|
|
9
|
+
Connection,
|
|
10
|
+
Connection as Connection$1,
|
|
11
|
+
ConnectionContext,
|
|
12
|
+
PartyServerOptions,
|
|
13
|
+
Server,
|
|
14
|
+
WSMessage
|
|
15
|
+
} from "partyserver";
|
|
1
16
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
17
|
import {
|
|
3
|
-
ServerCapabilities,
|
|
4
|
-
Tool,
|
|
5
18
|
Prompt,
|
|
6
|
-
Resource
|
|
19
|
+
Resource,
|
|
20
|
+
ServerCapabilities,
|
|
21
|
+
Tool
|
|
7
22
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
8
|
-
import {
|
|
9
|
-
import { MCPClientManager } from "./mcp/client.js";
|
|
10
|
-
import { Message } from "ai";
|
|
23
|
+
import { env } from "cloudflare:workers";
|
|
11
24
|
|
|
12
|
-
|
|
13
|
-
T extends string,
|
|
14
|
-
Payload extends Record<string, unknown> = {}
|
|
15
|
-
> = {
|
|
16
|
-
type: T;
|
|
17
|
-
/**
|
|
18
|
-
* The unique identifier for the event
|
|
19
|
-
*/
|
|
20
|
-
id: string;
|
|
21
|
-
/**
|
|
22
|
-
* The message to display in the logs for this event, should the implementation choose to display
|
|
23
|
-
* a human-readable message.
|
|
24
|
-
*/
|
|
25
|
-
displayMessage: string;
|
|
26
|
-
/**
|
|
27
|
-
* The payload of the event
|
|
28
|
-
*/
|
|
29
|
-
payload: Payload;
|
|
30
|
-
/**
|
|
31
|
-
* The timestamp of the event in milliseconds since epoch
|
|
32
|
-
*/
|
|
33
|
-
timestamp: number;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* The type of events that can be emitted by an Agent
|
|
37
|
-
*/
|
|
38
|
-
type ObservabilityEvent =
|
|
39
|
-
| BaseEvent<
|
|
40
|
-
"state:update",
|
|
41
|
-
{
|
|
42
|
-
state: unknown;
|
|
43
|
-
previousState: unknown;
|
|
44
|
-
}
|
|
45
|
-
>
|
|
46
|
-
| BaseEvent<
|
|
47
|
-
"rpc",
|
|
48
|
-
{
|
|
49
|
-
method: string;
|
|
50
|
-
args: unknown[];
|
|
51
|
-
streaming?: boolean;
|
|
52
|
-
success: boolean;
|
|
53
|
-
}
|
|
54
|
-
>
|
|
55
|
-
| BaseEvent<
|
|
56
|
-
"message:request" | "message:response",
|
|
57
|
-
{
|
|
58
|
-
message: Message[];
|
|
59
|
-
}
|
|
60
|
-
>
|
|
61
|
-
| BaseEvent<"message:clear">
|
|
62
|
-
| BaseEvent<
|
|
63
|
-
"schedule:create" | "schedule:execute" | "schedule:cancel",
|
|
64
|
-
Schedule<unknown>
|
|
65
|
-
>
|
|
66
|
-
| BaseEvent<"destroy">
|
|
67
|
-
| BaseEvent<
|
|
68
|
-
"connect",
|
|
69
|
-
{
|
|
70
|
-
connectionId: string;
|
|
71
|
-
}
|
|
72
|
-
>;
|
|
73
|
-
interface Observability {
|
|
74
|
-
/**
|
|
75
|
-
* Emit an event for the Agent's observability implementation to handle.
|
|
76
|
-
* @param event - The event to emit
|
|
77
|
-
* @param ctx - The execution context of the invocation
|
|
78
|
-
*/
|
|
79
|
-
emit(event: ObservabilityEvent, ctx: DurableObjectState): void;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* A generic observability implementation that logs events to the console.
|
|
83
|
-
*/
|
|
84
|
-
declare const genericObservability: Observability;
|
|
25
|
+
//#region src/index.d.ts
|
|
85
26
|
|
|
86
27
|
/**
|
|
87
28
|
* RPC request message from client
|
|
@@ -96,14 +37,14 @@ type RPCRequest = {
|
|
|
96
37
|
* State update message from client
|
|
97
38
|
*/
|
|
98
39
|
type StateUpdateMessage = {
|
|
99
|
-
type:
|
|
40
|
+
type: MessageType.CF_AGENT_STATE;
|
|
100
41
|
state: unknown;
|
|
101
42
|
};
|
|
102
43
|
/**
|
|
103
44
|
* RPC response message to client
|
|
104
45
|
*/
|
|
105
46
|
type RPCResponse = {
|
|
106
|
-
type:
|
|
47
|
+
type: MessageType.RPC;
|
|
107
48
|
id: string;
|
|
108
49
|
} & (
|
|
109
50
|
| {
|
|
@@ -134,12 +75,24 @@ type CallableMetadata = {
|
|
|
134
75
|
* Decorator that marks a method as callable by clients
|
|
135
76
|
* @param metadata Optional metadata about the callable method
|
|
136
77
|
*/
|
|
137
|
-
declare function
|
|
78
|
+
declare function callable(
|
|
138
79
|
metadata?: CallableMetadata
|
|
139
80
|
): <This, Args extends unknown[], Return>(
|
|
140
81
|
target: (this: This, ...args: Args) => Return,
|
|
141
82
|
context: ClassMethodDecoratorContext
|
|
142
83
|
) => (this: This, ...args: Args) => Return;
|
|
84
|
+
/**
|
|
85
|
+
* Decorator that marks a method as callable by clients
|
|
86
|
+
* @deprecated this has been renamed to callable, and unstable_callable will be removed in the next major version
|
|
87
|
+
* @param metadata Optional metadata about the callable method
|
|
88
|
+
*/
|
|
89
|
+
declare const unstable_callable: (metadata?: CallableMetadata) => void;
|
|
90
|
+
type QueueItem<T = string> = {
|
|
91
|
+
id: string;
|
|
92
|
+
payload: T;
|
|
93
|
+
callback: keyof Agent<unknown>;
|
|
94
|
+
created_at: number;
|
|
95
|
+
};
|
|
143
96
|
/**
|
|
144
97
|
* Represents a scheduled task within an Agent
|
|
145
98
|
* @template T Type of the payload data
|
|
@@ -179,7 +132,7 @@ type Schedule<T = string> = {
|
|
|
179
132
|
* MCP Server state update message from server -> Client
|
|
180
133
|
*/
|
|
181
134
|
type MCPServerMessage = {
|
|
182
|
-
type:
|
|
135
|
+
type: MessageType.CF_AGENT_MCP_SERVERS;
|
|
183
136
|
mcp: MCPServersState;
|
|
184
137
|
};
|
|
185
138
|
type MCPServersState = {
|
|
@@ -194,7 +147,7 @@ type MCPServer = {
|
|
|
194
147
|
name: string;
|
|
195
148
|
server_url: string;
|
|
196
149
|
auth_url: string | null;
|
|
197
|
-
state:
|
|
150
|
+
state: MCPConnectionState;
|
|
198
151
|
instructions: string | null;
|
|
199
152
|
capabilities: ServerCapabilities | null;
|
|
200
153
|
};
|
|
@@ -211,10 +164,16 @@ declare function getCurrentAgent<
|
|
|
211
164
|
* @template Env Environment type containing bindings
|
|
212
165
|
* @template State State type to store within the Agent
|
|
213
166
|
*/
|
|
214
|
-
declare class Agent<
|
|
167
|
+
declare class Agent<
|
|
168
|
+
Env = typeof env,
|
|
169
|
+
State = unknown,
|
|
170
|
+
Props extends Record<string, unknown> = Record<string, unknown>
|
|
171
|
+
> extends Server<Env, Props> {
|
|
215
172
|
private _state;
|
|
173
|
+
private _disposables;
|
|
174
|
+
private _mcpStateRestored;
|
|
216
175
|
private _ParentClass;
|
|
217
|
-
mcp: MCPClientManager;
|
|
176
|
+
readonly mcp: MCPClientManager;
|
|
218
177
|
/**
|
|
219
178
|
* Initial state for the Agent
|
|
220
179
|
* Override to provide default state values
|
|
@@ -293,6 +252,42 @@ declare class Agent<Env, State = unknown> extends Server<Env> {
|
|
|
293
252
|
* Render content (not implemented in base class)
|
|
294
253
|
*/
|
|
295
254
|
render(): void;
|
|
255
|
+
/**
|
|
256
|
+
* Queue a task to be executed in the future
|
|
257
|
+
* @param payload Payload to pass to the callback
|
|
258
|
+
* @param callback Name of the method to call
|
|
259
|
+
* @returns The ID of the queued task
|
|
260
|
+
*/
|
|
261
|
+
queue<T = unknown>(callback: keyof this, payload: T): Promise<string>;
|
|
262
|
+
private _flushingQueue;
|
|
263
|
+
private _flushQueue;
|
|
264
|
+
/**
|
|
265
|
+
* Dequeue a task by ID
|
|
266
|
+
* @param id ID of the task to dequeue
|
|
267
|
+
*/
|
|
268
|
+
dequeue(id: string): Promise<void>;
|
|
269
|
+
/**
|
|
270
|
+
* Dequeue all tasks
|
|
271
|
+
*/
|
|
272
|
+
dequeueAll(): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* Dequeue all tasks by callback
|
|
275
|
+
* @param callback Name of the callback to dequeue
|
|
276
|
+
*/
|
|
277
|
+
dequeueAllByCallback(callback: string): Promise<void>;
|
|
278
|
+
/**
|
|
279
|
+
* Get a queued task by ID
|
|
280
|
+
* @param id ID of the task to get
|
|
281
|
+
* @returns The task or undefined if not found
|
|
282
|
+
*/
|
|
283
|
+
getQueue(id: string): Promise<QueueItem<string> | undefined>;
|
|
284
|
+
/**
|
|
285
|
+
* Get all queues by key and value
|
|
286
|
+
* @param key Key to filter by
|
|
287
|
+
* @param value Value to filter by
|
|
288
|
+
* @returns Array of matching QueueItem objects
|
|
289
|
+
*/
|
|
290
|
+
getQueues(key: string, value: string): Promise<QueueItem<string>[]>;
|
|
296
291
|
/**
|
|
297
292
|
* Schedule a task to be executed in the future
|
|
298
293
|
* @template T Type of the payload data
|
|
@@ -352,58 +347,50 @@ declare class Agent<Env, State = unknown> extends Server<Env> {
|
|
|
352
347
|
* @returns A map of method names to their metadata
|
|
353
348
|
*/
|
|
354
349
|
private _isCallable;
|
|
350
|
+
private _ensureMcpStateRestored;
|
|
355
351
|
/**
|
|
356
352
|
* Connect to a new MCP Server
|
|
357
353
|
*
|
|
354
|
+
* @param serverName Name of the MCP server
|
|
358
355
|
* @param url MCP Server SSE URL
|
|
359
|
-
* @param callbackHost Base host for the agent, used for the redirect URI.
|
|
356
|
+
* @param callbackHost Base host for the agent, used for the redirect URI. If not provided, will be derived from the current request.
|
|
360
357
|
* @param agentsPrefix agents routing prefix if not using `agents`
|
|
361
|
-
* @param options MCP client and transport
|
|
358
|
+
* @param options MCP client and transport options
|
|
362
359
|
* @returns authUrl
|
|
363
360
|
*/
|
|
364
361
|
addMcpServer(
|
|
365
362
|
serverName: string,
|
|
366
363
|
url: string,
|
|
367
|
-
callbackHost
|
|
364
|
+
callbackHost?: string,
|
|
368
365
|
agentsPrefix?: string,
|
|
369
366
|
options?: {
|
|
370
367
|
client?: ConstructorParameters<typeof Client>[1];
|
|
371
|
-
transport?: {
|
|
372
|
-
headers: HeadersInit;
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
): Promise<{
|
|
376
|
-
id: string;
|
|
377
|
-
authUrl: string | undefined;
|
|
378
|
-
}>;
|
|
379
|
-
_connectToMcpServerInternal(
|
|
380
|
-
_serverName: string,
|
|
381
|
-
url: string,
|
|
382
|
-
callbackUrl: string,
|
|
383
|
-
options?: {
|
|
384
|
-
client?: ConstructorParameters<typeof Client>[1];
|
|
385
|
-
/**
|
|
386
|
-
* We don't expose the normal set of transport options because:
|
|
387
|
-
* 1) we can't serialize things like the auth provider or a fetch function into the DB for reconnection purposes
|
|
388
|
-
* 2) We probably want these options to be agnostic to the transport type (SSE vs Streamable)
|
|
389
|
-
*
|
|
390
|
-
* This has the limitation that you can't override fetch, but I think headers should handle nearly all cases needed (i.e. non-standard bearer auth).
|
|
391
|
-
*/
|
|
392
368
|
transport?: {
|
|
393
369
|
headers?: HeadersInit;
|
|
370
|
+
type?: TransportType;
|
|
394
371
|
};
|
|
395
|
-
},
|
|
396
|
-
reconnect?: {
|
|
397
|
-
id: string;
|
|
398
|
-
oauthClientId?: string;
|
|
399
372
|
}
|
|
400
373
|
): Promise<{
|
|
401
374
|
id: string;
|
|
402
375
|
authUrl: string | undefined;
|
|
403
|
-
clientId: string | undefined;
|
|
404
376
|
}>;
|
|
377
|
+
private _connectToMcpServerInternal;
|
|
405
378
|
removeMcpServer(id: string): Promise<void>;
|
|
379
|
+
/**
|
|
380
|
+
* Clear the auth_url for an MCP server after successful OAuth authentication
|
|
381
|
+
* This prevents the agent from continuously asking for OAuth on reconnect
|
|
382
|
+
* @param id The server ID to clear auth_url for
|
|
383
|
+
*/
|
|
384
|
+
private clearMcpServerAuthUrl;
|
|
406
385
|
getMcpServers(): MCPServersState;
|
|
386
|
+
private broadcastMcpServers;
|
|
387
|
+
/**
|
|
388
|
+
* Handle OAuth callback response using MCPClientManager configuration
|
|
389
|
+
* @param result OAuth callback result
|
|
390
|
+
* @param request The original request (needed for base URL)
|
|
391
|
+
* @returns Response for the OAuth callback
|
|
392
|
+
*/
|
|
393
|
+
private handleOAuthCallbackResponse;
|
|
407
394
|
}
|
|
408
395
|
/**
|
|
409
396
|
* Namespace for creating Agent instances
|
|
@@ -511,12 +498,17 @@ type EmailSendOptions = {
|
|
|
511
498
|
* @param options Options for Agent creation
|
|
512
499
|
* @returns Promise resolving to an Agent instance stub
|
|
513
500
|
*/
|
|
514
|
-
declare function getAgentByName<
|
|
501
|
+
declare function getAgentByName<
|
|
502
|
+
Env,
|
|
503
|
+
T extends Agent<Env>,
|
|
504
|
+
Props extends Record<string, unknown> = Record<string, unknown>
|
|
505
|
+
>(
|
|
515
506
|
namespace: AgentNamespace<T>,
|
|
516
507
|
name: string,
|
|
517
508
|
options?: {
|
|
518
509
|
jurisdiction?: DurableObjectJurisdiction;
|
|
519
510
|
locationHint?: DurableObjectLocationHint;
|
|
511
|
+
props?: Props;
|
|
520
512
|
}
|
|
521
513
|
): Promise<DurableObjectStub<T>>;
|
|
522
514
|
/**
|
|
@@ -538,34 +530,37 @@ declare class StreamingResponse {
|
|
|
538
530
|
*/
|
|
539
531
|
end(finalChunk?: unknown): void;
|
|
540
532
|
}
|
|
541
|
-
|
|
533
|
+
//#endregion
|
|
542
534
|
export {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
535
|
+
unstable_callable as A,
|
|
536
|
+
createAddressBasedEmailResolver as C,
|
|
537
|
+
getCurrentAgent as D,
|
|
538
|
+
getAgentByName as E,
|
|
539
|
+
routeAgentEmail as O,
|
|
540
|
+
callable as S,
|
|
541
|
+
createHeaderBasedEmailResolver as T,
|
|
542
|
+
RPCResponse as _,
|
|
543
|
+
AgentOptions as a,
|
|
544
|
+
StreamingResponse as b,
|
|
545
|
+
ConnectionContext as c,
|
|
546
|
+
EmailSendOptions as d,
|
|
547
|
+
MCPServer as f,
|
|
548
|
+
RPCRequest as g,
|
|
549
|
+
QueueItem as h,
|
|
550
|
+
AgentNamespace as i,
|
|
551
|
+
routeAgentRequest as k,
|
|
552
|
+
EmailResolver as l,
|
|
553
|
+
MCPServersState as m,
|
|
554
|
+
AgentContext as n,
|
|
555
|
+
CallableMetadata as o,
|
|
556
|
+
MCPServerMessage as p,
|
|
557
|
+
AgentEmail as r,
|
|
558
|
+
Connection$1 as s,
|
|
559
|
+
Agent as t,
|
|
560
|
+
EmailRoutingOptions as u,
|
|
561
|
+
Schedule as v,
|
|
562
|
+
createCatchAllEmailResolver as w,
|
|
563
|
+
WSMessage as x,
|
|
564
|
+
StateUpdateMessage as y
|
|
571
565
|
};
|
|
566
|
+
//# sourceMappingURL=index-DHakc8tU.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { n as BaseEvent, t as MCPObservabilityEvent } from "./mcp-Dw5vDrY8.js";
|
|
2
|
+
|
|
3
|
+
//#region src/observability/agent.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Agent-specific observability events
|
|
7
|
+
* These track the lifecycle and operations of an Agent
|
|
8
|
+
*/
|
|
9
|
+
type AgentObservabilityEvent =
|
|
10
|
+
| BaseEvent<"state:update", {}>
|
|
11
|
+
| BaseEvent<
|
|
12
|
+
"rpc",
|
|
13
|
+
{
|
|
14
|
+
method: string;
|
|
15
|
+
streaming?: boolean;
|
|
16
|
+
}
|
|
17
|
+
>
|
|
18
|
+
| BaseEvent<"message:request" | "message:response", {}>
|
|
19
|
+
| BaseEvent<"message:clear">
|
|
20
|
+
| BaseEvent<
|
|
21
|
+
"schedule:create" | "schedule:execute" | "schedule:cancel",
|
|
22
|
+
{
|
|
23
|
+
callback: string;
|
|
24
|
+
id: string;
|
|
25
|
+
}
|
|
26
|
+
>
|
|
27
|
+
| BaseEvent<"destroy">
|
|
28
|
+
| BaseEvent<
|
|
29
|
+
"connect",
|
|
30
|
+
{
|
|
31
|
+
connectionId: string;
|
|
32
|
+
}
|
|
33
|
+
>;
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/observability/index.d.ts
|
|
36
|
+
/**
|
|
37
|
+
* Union of all observability event types from different domains
|
|
38
|
+
*/
|
|
39
|
+
type ObservabilityEvent = AgentObservabilityEvent | MCPObservabilityEvent;
|
|
40
|
+
interface Observability {
|
|
41
|
+
/**
|
|
42
|
+
* Emit an event for the Agent's observability implementation to handle.
|
|
43
|
+
* @param event - The event to emit
|
|
44
|
+
* @param ctx - The execution context of the invocation (optional)
|
|
45
|
+
*/
|
|
46
|
+
emit(event: ObservabilityEvent, ctx?: DurableObjectState): void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A generic observability implementation that logs events to the console.
|
|
50
|
+
*/
|
|
51
|
+
declare const genericObservability: Observability;
|
|
52
|
+
//#endregion
|
|
53
|
+
export {
|
|
54
|
+
ObservabilityEvent as n,
|
|
55
|
+
genericObservability as r,
|
|
56
|
+
Observability as t
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=index-DhJCaDWd.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,38 +1,70 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "
|
|
3
|
-
|
|
4
|
-
import "./
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { u as TransportType } from "./client-DZuq0CXm.js";
|
|
2
|
+
import "./mcp-Dw5vDrY8.js";
|
|
3
|
+
import "./do-oauth-client-provider-DGc5pP0l.js";
|
|
4
|
+
import "./index-DhJCaDWd.js";
|
|
5
|
+
import "./ai-types-D5YoPrBZ.js";
|
|
6
|
+
import {
|
|
7
|
+
A as unstable_callable,
|
|
8
|
+
C as createAddressBasedEmailResolver,
|
|
9
|
+
D as getCurrentAgent,
|
|
10
|
+
E as getAgentByName,
|
|
11
|
+
O as routeAgentEmail,
|
|
12
|
+
S as callable,
|
|
13
|
+
T as createHeaderBasedEmailResolver,
|
|
14
|
+
_ as RPCResponse,
|
|
15
|
+
a as AgentOptions,
|
|
16
|
+
b as StreamingResponse,
|
|
17
|
+
c as ConnectionContext,
|
|
18
|
+
d as EmailSendOptions,
|
|
15
19
|
f as MCPServer,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
s as
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
g as RPCRequest,
|
|
21
|
+
h as QueueItem,
|
|
22
|
+
i as AgentNamespace,
|
|
23
|
+
k as routeAgentRequest,
|
|
24
|
+
l as EmailResolver,
|
|
25
|
+
m as MCPServersState,
|
|
26
|
+
n as AgentContext,
|
|
27
|
+
o as CallableMetadata,
|
|
28
|
+
p as MCPServerMessage,
|
|
29
|
+
r as AgentEmail,
|
|
30
|
+
s as Connection,
|
|
31
|
+
t as Agent,
|
|
32
|
+
u as EmailRoutingOptions,
|
|
33
|
+
v as Schedule,
|
|
34
|
+
w as createCatchAllEmailResolver,
|
|
35
|
+
x as WSMessage,
|
|
36
|
+
y as StateUpdateMessage
|
|
37
|
+
} from "./index-DHakc8tU.js";
|
|
38
|
+
export {
|
|
39
|
+
Agent,
|
|
40
|
+
AgentContext,
|
|
41
|
+
AgentEmail,
|
|
42
|
+
AgentNamespace,
|
|
43
|
+
AgentOptions,
|
|
44
|
+
CallableMetadata,
|
|
45
|
+
Connection,
|
|
46
|
+
ConnectionContext,
|
|
47
|
+
EmailResolver,
|
|
48
|
+
EmailRoutingOptions,
|
|
49
|
+
EmailSendOptions,
|
|
50
|
+
MCPServer,
|
|
51
|
+
MCPServerMessage,
|
|
52
|
+
MCPServersState,
|
|
53
|
+
QueueItem,
|
|
54
|
+
RPCRequest,
|
|
55
|
+
RPCResponse,
|
|
56
|
+
Schedule,
|
|
57
|
+
StateUpdateMessage,
|
|
58
|
+
StreamingResponse,
|
|
59
|
+
TransportType,
|
|
60
|
+
WSMessage,
|
|
61
|
+
callable,
|
|
62
|
+
createAddressBasedEmailResolver,
|
|
63
|
+
createCatchAllEmailResolver,
|
|
64
|
+
createHeaderBasedEmailResolver,
|
|
65
|
+
getAgentByName,
|
|
66
|
+
getCurrentAgent,
|
|
67
|
+
routeAgentEmail,
|
|
68
|
+
routeAgentRequest,
|
|
69
|
+
unstable_callable
|
|
70
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
getCurrentAgent,
|
|
9
|
-
routeAgentEmail,
|
|
10
|
-
routeAgentRequest,
|
|
11
|
-
unstable_callable
|
|
12
|
-
} from "./chunk-EDUDXISR.js";
|
|
13
|
-
import "./chunk-MW5BQ2FW.js";
|
|
14
|
-
import "./chunk-PVQZBKN7.js";
|
|
15
|
-
import "./chunk-KUH345EY.js";
|
|
16
|
-
export {
|
|
17
|
-
Agent,
|
|
18
|
-
StreamingResponse,
|
|
19
|
-
createAddressBasedEmailResolver,
|
|
20
|
-
createCatchAllEmailResolver,
|
|
21
|
-
createHeaderBasedEmailResolver,
|
|
22
|
-
getAgentByName,
|
|
23
|
-
getCurrentAgent,
|
|
24
|
-
routeAgentEmail,
|
|
25
|
-
routeAgentRequest,
|
|
26
|
-
unstable_callable
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import "./ai-types-B3aQaFv3.js";
|
|
2
|
+
import "./client-BfiZ3HQd.js";
|
|
3
|
+
import "./client-DZhjV_XA.js";
|
|
4
|
+
import "./do-oauth-client-provider-CswoD5Lu.js";
|
|
5
|
+
import { a as createCatchAllEmailResolver, c as getCurrentAgent, d as unstable_callable, i as createAddressBasedEmailResolver, l as routeAgentEmail, n as StreamingResponse, o as createHeaderBasedEmailResolver, r as callable, s as getAgentByName, t as Agent, u as routeAgentRequest } from "./src-C8K3lu37.js";
|
|
6
|
+
|
|
7
|
+
export { Agent, StreamingResponse, callable, createAddressBasedEmailResolver, createCatchAllEmailResolver, createHeaderBasedEmailResolver, getAgentByName, getCurrentAgent, routeAgentEmail, routeAgentRequest, unstable_callable };
|