agents 0.0.0-e03246e → 0.0.0-e1af284

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.
Files changed (72) hide show
  1. package/README.md +255 -27
  2. package/dist/ai-chat-agent.d.ts +59 -11
  3. package/dist/ai-chat-agent.js +532 -160
  4. package/dist/ai-chat-agent.js.map +1 -1
  5. package/dist/ai-chat-v5-migration-DBHGW4Hv.js +155 -0
  6. package/dist/ai-chat-v5-migration-DBHGW4Hv.js.map +1 -0
  7. package/dist/ai-chat-v5-migration.d.ts +155 -0
  8. package/dist/ai-chat-v5-migration.js +3 -0
  9. package/dist/ai-react.d.ts +73 -72
  10. package/dist/ai-react.js +261 -192
  11. package/dist/ai-react.js.map +1 -1
  12. package/dist/ai-types-B3aQaFv3.js +20 -0
  13. package/dist/ai-types-B3aQaFv3.js.map +1 -0
  14. package/dist/ai-types-D5YoPrBZ.d.ts +95 -0
  15. package/dist/ai-types.d.ts +6 -69
  16. package/dist/ai-types.js +3 -1
  17. package/dist/cli.d.ts +8 -0
  18. package/dist/cli.js +27 -0
  19. package/dist/cli.js.map +1 -0
  20. package/dist/client-9Ld2_lnt.js +786 -0
  21. package/dist/client-9Ld2_lnt.js.map +1 -0
  22. package/dist/client-BIwY43Ed.d.ts +5315 -0
  23. package/dist/client-BfiZ3HQd.js +117 -0
  24. package/dist/client-BfiZ3HQd.js.map +1 -0
  25. package/dist/client-CbWe9FBd.d.ts +104 -0
  26. package/dist/client.d.ts +12 -79
  27. package/dist/client.js +3 -130
  28. package/dist/codemode/ai.d.ts +27 -0
  29. package/dist/codemode/ai.js +151 -0
  30. package/dist/codemode/ai.js.map +1 -0
  31. package/dist/do-oauth-client-provider-CswoD5Lu.js +93 -0
  32. package/dist/do-oauth-client-provider-CswoD5Lu.js.map +1 -0
  33. package/dist/do-oauth-client-provider-DGc5pP0l.d.ts +55 -0
  34. package/dist/index-Bp6UrXKf.d.ts +560 -0
  35. package/dist/index-DhJCaDWd.d.ts +58 -0
  36. package/dist/index.d.ts +63 -301
  37. package/dist/index.js +7 -22
  38. package/dist/mcp/client.d.ts +4 -675
  39. package/dist/mcp/client.js +2 -267
  40. package/dist/mcp/do-oauth-client-provider.d.ts +2 -0
  41. package/dist/mcp/do-oauth-client-provider.js +3 -0
  42. package/dist/mcp/index.d.ts +151 -42
  43. package/dist/mcp/index.js +1362 -335
  44. package/dist/mcp/index.js.map +1 -1
  45. package/dist/mcp/x402.d.ts +34 -0
  46. package/dist/mcp/x402.js +194 -0
  47. package/dist/mcp/x402.js.map +1 -0
  48. package/dist/mcp-Dw5vDrY8.d.ts +61 -0
  49. package/dist/observability/index.d.ts +3 -0
  50. package/dist/observability/index.js +7 -0
  51. package/dist/react-BRVSan-t.d.ts +115 -0
  52. package/dist/react.d.ts +10 -39
  53. package/dist/react.js +183 -98
  54. package/dist/react.js.map +1 -1
  55. package/dist/schedule.d.ts +89 -12
  56. package/dist/schedule.js +46 -23
  57. package/dist/schedule.js.map +1 -1
  58. package/dist/serializable-CymX8ovI.d.ts +39 -0
  59. package/dist/serializable.d.ts +7 -0
  60. package/dist/serializable.js +1 -0
  61. package/dist/src-Dz0H9hSU.js +1200 -0
  62. package/dist/src-Dz0H9hSU.js.map +1 -0
  63. package/package.json +121 -50
  64. package/dist/ai-types.js.map +0 -1
  65. package/dist/chunk-HMLY7DHA.js +0 -16
  66. package/dist/chunk-HMLY7DHA.js.map +0 -1
  67. package/dist/chunk-YMUU7QHV.js +0 -595
  68. package/dist/chunk-YMUU7QHV.js.map +0 -1
  69. package/dist/client.js.map +0 -1
  70. package/dist/index.js.map +0 -1
  71. package/dist/mcp/client.js.map +0 -1
  72. package/src/index.ts +0 -919
@@ -0,0 +1,560 @@
1
+ import {
2
+ a as MCPConnectionState,
3
+ t as MCPClientManager,
4
+ u as TransportType
5
+ } from "./client-BIwY43Ed.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";
16
+ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
17
+ import {
18
+ Prompt,
19
+ Resource,
20
+ ServerCapabilities,
21
+ Tool
22
+ } from "@modelcontextprotocol/sdk/types.js";
23
+ import { env } from "cloudflare:workers";
24
+
25
+ //#region src/index.d.ts
26
+
27
+ /**
28
+ * RPC request message from client
29
+ */
30
+ type RPCRequest = {
31
+ type: "rpc";
32
+ id: string;
33
+ method: string;
34
+ args: unknown[];
35
+ };
36
+ /**
37
+ * State update message from client
38
+ */
39
+ type StateUpdateMessage = {
40
+ type: MessageType.CF_AGENT_STATE;
41
+ state: unknown;
42
+ };
43
+ /**
44
+ * RPC response message to client
45
+ */
46
+ type RPCResponse = {
47
+ type: MessageType.RPC;
48
+ id: string;
49
+ } & (
50
+ | {
51
+ success: true;
52
+ result: unknown;
53
+ done?: false;
54
+ }
55
+ | {
56
+ success: true;
57
+ result: unknown;
58
+ done: true;
59
+ }
60
+ | {
61
+ success: false;
62
+ error: string;
63
+ }
64
+ );
65
+ /**
66
+ * Metadata for a callable method
67
+ */
68
+ type CallableMetadata = {
69
+ /** Optional description of what the method does */
70
+ description?: string;
71
+ /** Whether the method supports streaming responses */
72
+ streaming?: boolean;
73
+ };
74
+ /**
75
+ * Decorator that marks a method as callable by clients
76
+ * @param metadata Optional metadata about the callable method
77
+ */
78
+ declare function callable(
79
+ metadata?: CallableMetadata
80
+ ): <This, Args extends unknown[], Return>(
81
+ target: (this: This, ...args: Args) => Return,
82
+ context: ClassMethodDecoratorContext
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$1 = string> = {
91
+ id: string;
92
+ payload: T$1;
93
+ callback: keyof Agent<unknown>;
94
+ created_at: number;
95
+ };
96
+ /**
97
+ * Represents a scheduled task within an Agent
98
+ * @template T Type of the payload data
99
+ */
100
+ type Schedule<T$1 = string> = {
101
+ /** Unique identifier for the schedule */
102
+ id: string;
103
+ /** Name of the method to be called */
104
+ callback: string;
105
+ /** Data to be passed to the callback */
106
+ payload: T$1;
107
+ } & (
108
+ | {
109
+ /** Type of schedule for one-time execution at a specific time */
110
+ type: "scheduled";
111
+ /** Timestamp when the task should execute */
112
+ time: number;
113
+ }
114
+ | {
115
+ /** Type of schedule for delayed execution */
116
+ type: "delayed";
117
+ /** Timestamp when the task should execute */
118
+ time: number;
119
+ /** Number of seconds to delay execution */
120
+ delayInSeconds: number;
121
+ }
122
+ | {
123
+ /** Type of schedule for recurring execution based on cron expression */
124
+ type: "cron";
125
+ /** Timestamp for the next execution */
126
+ time: number;
127
+ /** Cron expression defining the schedule */
128
+ cron: string;
129
+ }
130
+ );
131
+ /**
132
+ * MCP Server state update message from server -> Client
133
+ */
134
+ type MCPServerMessage = {
135
+ type: MessageType.CF_AGENT_MCP_SERVERS;
136
+ mcp: MCPServersState;
137
+ };
138
+ type MCPServersState = {
139
+ servers: {
140
+ [id: string]: MCPServer;
141
+ };
142
+ tools: Tool[];
143
+ prompts: Prompt[];
144
+ resources: Resource[];
145
+ };
146
+ type MCPServer = {
147
+ name: string;
148
+ server_url: string;
149
+ auth_url: string | null;
150
+ state: MCPConnectionState;
151
+ instructions: string | null;
152
+ capabilities: ServerCapabilities | null;
153
+ };
154
+ declare function getCurrentAgent<
155
+ T$1 extends Agent<unknown, unknown> = Agent<unknown, unknown>
156
+ >(): {
157
+ agent: T$1 | undefined;
158
+ connection: Connection | undefined;
159
+ request: Request | undefined;
160
+ email: AgentEmail | undefined;
161
+ };
162
+ /**
163
+ * Base class for creating Agent implementations
164
+ * @template Env Environment type containing bindings
165
+ * @template State State type to store within the Agent
166
+ */
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> {
172
+ private _state;
173
+ private _disposables;
174
+ private _mcpStateRestored;
175
+ private _ParentClass;
176
+ readonly mcp: MCPClientManager;
177
+ /**
178
+ * Initial state for the Agent
179
+ * Override to provide default state values
180
+ */
181
+ initialState: State;
182
+ /**
183
+ * Current state of the Agent
184
+ */
185
+ get state(): State;
186
+ /**
187
+ * Agent configuration options
188
+ */
189
+ static options: {
190
+ /** Whether the Agent should hibernate when inactive */
191
+ hibernate: boolean;
192
+ };
193
+ /**
194
+ * The observability implementation to use for the Agent
195
+ */
196
+ observability?: Observability;
197
+ /**
198
+ * Execute SQL queries against the Agent's database
199
+ * @template T Type of the returned rows
200
+ * @param strings SQL query template strings
201
+ * @param values Values to be inserted into the query
202
+ * @returns Array of query results
203
+ */
204
+ sql<T = Record<string, string | number | boolean | null>>(
205
+ strings: TemplateStringsArray,
206
+ ...values: (string | number | boolean | null)[]
207
+ ): T[];
208
+ constructor(ctx: AgentContext, env: Env);
209
+ private _setStateInternal;
210
+ /**
211
+ * Update the Agent's state
212
+ * @param state New state to set
213
+ */
214
+ setState(state: State): void;
215
+ /**
216
+ * Called when the Agent's state is updated
217
+ * @param state Updated state
218
+ * @param source Source of the state update ("server" or a client connection)
219
+ */
220
+ onStateUpdate(state: State | undefined, source: Connection | "server"): void;
221
+ /**
222
+ * Called when the Agent receives an email via routeAgentEmail()
223
+ * Override this method to handle incoming emails
224
+ * @param email Email message to process
225
+ */
226
+ _onEmail(email: AgentEmail): Promise<void>;
227
+ /**
228
+ * Reply to an email
229
+ * @param email The email to reply to
230
+ * @param options Options for the reply
231
+ * @returns void
232
+ */
233
+ replyToEmail(
234
+ email: AgentEmail,
235
+ options: {
236
+ fromName: string;
237
+ subject?: string | undefined;
238
+ body: string;
239
+ contentType?: string;
240
+ headers?: Record<string, string>;
241
+ }
242
+ ): Promise<void>;
243
+ private _tryCatch;
244
+ /**
245
+ * Automatically wrap custom methods with agent context
246
+ * This ensures getCurrentAgent() works in all custom methods without decorators
247
+ */
248
+ private _autoWrapCustomMethods;
249
+ onError(connection: Connection, error: unknown): void | Promise<void>;
250
+ onError(error: unknown): void | Promise<void>;
251
+ /**
252
+ * Render content (not implemented in base class)
253
+ */
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>[]>;
291
+ /**
292
+ * Schedule a task to be executed in the future
293
+ * @template T Type of the payload data
294
+ * @param when When to execute the task (Date, seconds delay, or cron expression)
295
+ * @param callback Name of the method to call
296
+ * @param payload Data to pass to the callback
297
+ * @returns Schedule object representing the scheduled task
298
+ */
299
+ schedule<T = string>(
300
+ when: Date | string | number,
301
+ callback: keyof this,
302
+ payload?: T
303
+ ): Promise<Schedule<T>>;
304
+ /**
305
+ * Get a scheduled task by ID
306
+ * @template T Type of the payload data
307
+ * @param id ID of the scheduled task
308
+ * @returns The Schedule object or undefined if not found
309
+ */
310
+ getSchedule<T = string>(id: string): Promise<Schedule<T> | undefined>;
311
+ /**
312
+ * Get scheduled tasks matching the given criteria
313
+ * @template T Type of the payload data
314
+ * @param criteria Criteria to filter schedules
315
+ * @returns Array of matching Schedule objects
316
+ */
317
+ getSchedules<T = string>(criteria?: {
318
+ id?: string;
319
+ type?: "scheduled" | "delayed" | "cron";
320
+ timeRange?: {
321
+ start?: Date;
322
+ end?: Date;
323
+ };
324
+ }): Schedule<T>[];
325
+ /**
326
+ * Cancel a scheduled task
327
+ * @param id ID of the task to cancel
328
+ * @returns true if the task was cancelled, false otherwise
329
+ */
330
+ cancelSchedule(id: string): Promise<boolean>;
331
+ private _scheduleNextAlarm;
332
+ /**
333
+ * Method called when an alarm fires.
334
+ * Executes any scheduled tasks that are due.
335
+ *
336
+ * @remarks
337
+ * To schedule a task, please use the `this.schedule` method instead.
338
+ * See {@link https://developers.cloudflare.com/agents/api-reference/schedule-tasks/}
339
+ */
340
+ readonly alarm: () => Promise<void>;
341
+ /**
342
+ * Destroy the Agent, removing all state and scheduled tasks
343
+ */
344
+ destroy(): Promise<void>;
345
+ /**
346
+ * Get all methods marked as callable on this Agent
347
+ * @returns A map of method names to their metadata
348
+ */
349
+ private _isCallable;
350
+ private _ensureMcpStateRestored;
351
+ /**
352
+ * Connect to a new MCP Server
353
+ *
354
+ * @param serverName Name of the MCP server
355
+ * @param url MCP Server SSE URL
356
+ * @param callbackHost Base host for the agent, used for the redirect URI. If not provided, will be derived from the current request.
357
+ * @param agentsPrefix agents routing prefix if not using `agents`
358
+ * @param options MCP client and transport options
359
+ * @returns authUrl
360
+ */
361
+ addMcpServer(
362
+ serverName: string,
363
+ url: string,
364
+ callbackHost?: string,
365
+ agentsPrefix?: string,
366
+ options?: {
367
+ client?: ConstructorParameters<typeof Client>[1];
368
+ transport?: {
369
+ headers?: HeadersInit;
370
+ type?: TransportType;
371
+ };
372
+ }
373
+ ): Promise<{
374
+ id: string;
375
+ authUrl: string | undefined;
376
+ }>;
377
+ private _connectToMcpServerInternal;
378
+ removeMcpServer(id: string): Promise<void>;
379
+ getMcpServers(): MCPServersState;
380
+ private broadcastMcpServers;
381
+ /**
382
+ * Handle OAuth callback response using MCPClientManager configuration
383
+ * @param result OAuth callback result
384
+ * @param request The original request (needed for base URL)
385
+ * @returns Response for the OAuth callback
386
+ */
387
+ private handleOAuthCallbackResponse;
388
+ }
389
+ /**
390
+ * Namespace for creating Agent instances
391
+ * @template Agentic Type of the Agent class
392
+ */
393
+ type AgentNamespace<Agentic extends Agent<unknown>> =
394
+ DurableObjectNamespace<Agentic>;
395
+ /**
396
+ * Agent's durable context
397
+ */
398
+ type AgentContext = DurableObjectState;
399
+ /**
400
+ * Configuration options for Agent routing
401
+ */
402
+ type AgentOptions<Env> = PartyServerOptions<Env> & {
403
+ /**
404
+ * Whether to enable CORS for the Agent
405
+ */
406
+ cors?: boolean | HeadersInit | undefined;
407
+ };
408
+ /**
409
+ * Route a request to the appropriate Agent
410
+ * @param request Request to route
411
+ * @param env Environment containing Agent bindings
412
+ * @param options Routing options
413
+ * @returns Response from the Agent or undefined if no route matched
414
+ */
415
+ declare function routeAgentRequest<Env>(
416
+ request: Request,
417
+ env: Env,
418
+ options?: AgentOptions<Env>
419
+ ): Promise<Response | null>;
420
+ type EmailResolver<Env> = (
421
+ email: ForwardableEmailMessage,
422
+ env: Env
423
+ ) => Promise<{
424
+ agentName: string;
425
+ agentId: string;
426
+ } | null>;
427
+ /**
428
+ * Create a resolver that uses the message-id header to determine the agent to route the email to
429
+ * @returns A function that resolves the agent to route the email to
430
+ */
431
+ declare function createHeaderBasedEmailResolver<Env>(): EmailResolver<Env>;
432
+ /**
433
+ * Create a resolver that uses the email address to determine the agent to route the email to
434
+ * @param defaultAgentName The default agent name to use if the email address does not contain a sub-address
435
+ * @returns A function that resolves the agent to route the email to
436
+ */
437
+ declare function createAddressBasedEmailResolver<Env>(
438
+ defaultAgentName: string
439
+ ): EmailResolver<Env>;
440
+ /**
441
+ * Create a resolver that uses the agentName and agentId to determine the agent to route the email to
442
+ * @param agentName The name of the agent to route the email to
443
+ * @param agentId The id of the agent to route the email to
444
+ * @returns A function that resolves the agent to route the email to
445
+ */
446
+ declare function createCatchAllEmailResolver<Env>(
447
+ agentName: string,
448
+ agentId: string
449
+ ): EmailResolver<Env>;
450
+ type EmailRoutingOptions<Env> = AgentOptions<Env> & {
451
+ resolver: EmailResolver<Env>;
452
+ };
453
+ /**
454
+ * Route an email to the appropriate Agent
455
+ * @param email The email to route
456
+ * @param env The environment containing the Agent bindings
457
+ * @param options The options for routing the email
458
+ * @returns A promise that resolves when the email has been routed
459
+ */
460
+ declare function routeAgentEmail<Env>(
461
+ email: ForwardableEmailMessage,
462
+ env: Env,
463
+ options: EmailRoutingOptions<Env>
464
+ ): Promise<void>;
465
+ type AgentEmail = {
466
+ from: string;
467
+ to: string;
468
+ getRaw: () => Promise<Uint8Array>;
469
+ headers: Headers;
470
+ rawSize: number;
471
+ setReject: (reason: string) => void;
472
+ forward: (rcptTo: string, headers?: Headers) => Promise<void>;
473
+ reply: (options: { from: string; to: string; raw: string }) => Promise<void>;
474
+ };
475
+ type EmailSendOptions = {
476
+ to: string;
477
+ subject: string;
478
+ body: string;
479
+ contentType?: string;
480
+ headers?: Record<string, string>;
481
+ includeRoutingHeaders?: boolean;
482
+ agentName?: string;
483
+ agentId?: string;
484
+ domain?: string;
485
+ };
486
+ /**
487
+ * Get or create an Agent by name
488
+ * @template Env Environment type containing bindings
489
+ * @template T Type of the Agent class
490
+ * @param namespace Agent namespace
491
+ * @param name Name of the Agent instance
492
+ * @param options Options for Agent creation
493
+ * @returns Promise resolving to an Agent instance stub
494
+ */
495
+ declare function getAgentByName<
496
+ Env,
497
+ T$1 extends Agent<Env>,
498
+ Props extends Record<string, unknown> = Record<string, unknown>
499
+ >(
500
+ namespace: AgentNamespace<T$1>,
501
+ name: string,
502
+ options?: {
503
+ jurisdiction?: DurableObjectJurisdiction;
504
+ locationHint?: DurableObjectLocationHint;
505
+ props?: Props;
506
+ }
507
+ ): Promise<DurableObjectStub<T$1>>;
508
+ /**
509
+ * A wrapper for streaming responses in callable methods
510
+ */
511
+ declare class StreamingResponse {
512
+ private _connection;
513
+ private _id;
514
+ private _closed;
515
+ constructor(connection: Connection, id: string);
516
+ /**
517
+ * Send a chunk of data to the client
518
+ * @param chunk The data to send
519
+ */
520
+ send(chunk: unknown): void;
521
+ /**
522
+ * End the stream and send the final chunk (if any)
523
+ * @param finalChunk Optional final chunk of data to send
524
+ */
525
+ end(finalChunk?: unknown): void;
526
+ }
527
+ //#endregion
528
+ export {
529
+ unstable_callable as A,
530
+ createAddressBasedEmailResolver as C,
531
+ getCurrentAgent as D,
532
+ getAgentByName as E,
533
+ routeAgentEmail as O,
534
+ callable as S,
535
+ createHeaderBasedEmailResolver as T,
536
+ RPCResponse as _,
537
+ AgentOptions as a,
538
+ StreamingResponse as b,
539
+ ConnectionContext as c,
540
+ EmailSendOptions as d,
541
+ MCPServer as f,
542
+ RPCRequest as g,
543
+ QueueItem as h,
544
+ AgentNamespace as i,
545
+ routeAgentRequest as k,
546
+ EmailResolver as l,
547
+ MCPServersState as m,
548
+ AgentContext as n,
549
+ CallableMetadata as o,
550
+ MCPServerMessage as p,
551
+ AgentEmail as r,
552
+ Connection$1 as s,
553
+ Agent as t,
554
+ EmailRoutingOptions as u,
555
+ Schedule as v,
556
+ createCatchAllEmailResolver as w,
557
+ WSMessage as x,
558
+ StateUpdateMessage as y
559
+ };
560
+ //# sourceMappingURL=index-Bp6UrXKf.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