agents 0.0.0-cb5957e → 0.0.0-cccbd0f

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 (99) hide show
  1. package/README.md +5 -3
  2. package/dist/ai-chat-agent.d.ts +91 -20
  3. package/dist/ai-chat-agent.js +798 -644
  4. package/dist/ai-chat-agent.js.map +1 -1
  5. package/dist/ai-chat-v5-migration-BSiGZmYU.js +155 -0
  6. package/dist/ai-chat-v5-migration-BSiGZmYU.js.map +1 -0
  7. package/dist/ai-chat-v5-migration.d.ts +7 -4
  8. package/dist/ai-chat-v5-migration.js +3 -20
  9. package/dist/ai-react.d.ts +19 -24
  10. package/dist/ai-react.js +393 -349
  11. package/dist/ai-react.js.map +1 -1
  12. package/dist/ai-types-81H_-Uxh.d.ts +103 -0
  13. package/dist/ai-types-CrMqkwc_.js +24 -0
  14. package/dist/ai-types-CrMqkwc_.js.map +1 -0
  15. package/dist/ai-types.d.ts +6 -92
  16. package/dist/ai-types.js +3 -8
  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-B3SR12TQ.js +117 -0
  21. package/dist/client-B3SR12TQ.js.map +1 -0
  22. package/dist/client-BAQA84dr.d.ts +104 -0
  23. package/dist/client-BZ-xTxF5.js +901 -0
  24. package/dist/client-BZ-xTxF5.js.map +1 -0
  25. package/dist/client-ctTw3KHG.d.ts +1440 -0
  26. package/dist/client.d.ts +11 -92
  27. package/dist/client.js +4 -13
  28. package/dist/codemode/ai.d.ts +19 -17
  29. package/dist/codemode/ai.js +90 -5051
  30. package/dist/codemode/ai.js.map +1 -1
  31. package/dist/do-oauth-client-provider-Cs9QpXYp.js +93 -0
  32. package/dist/do-oauth-client-provider-Cs9QpXYp.js.map +1 -0
  33. package/dist/do-oauth-client-provider-UhQDpDb8.d.ts +134 -0
  34. package/dist/index-BUle9RiP.d.ts +58 -0
  35. package/dist/index-D2dnUH0r.d.ts +578 -0
  36. package/dist/index.d.ts +55 -542
  37. package/dist/index.js +7 -32
  38. package/dist/mcp/client.d.ts +4 -12
  39. package/dist/mcp/client.js +4 -10
  40. package/dist/mcp/do-oauth-client-provider.d.ts +2 -42
  41. package/dist/mcp/do-oauth-client-provider.js +3 -8
  42. package/dist/mcp/index.d.ts +190 -76
  43. package/dist/mcp/index.js +1428 -1080
  44. package/dist/mcp/index.js.map +1 -1
  45. package/dist/mcp/x402.d.ts +22 -27
  46. package/dist/mcp/x402.js +190 -3187
  47. package/dist/mcp/x402.js.map +1 -1
  48. package/dist/{mcp-BH1fJeiU.d.ts → mcp-BwPscEiF.d.ts} +6 -3
  49. package/dist/observability/index.d.ts +3 -34
  50. package/dist/observability/index.js +7 -12
  51. package/dist/react-B_ENAdCe.d.ts +113 -0
  52. package/dist/react.d.ts +10 -127
  53. package/dist/react.js +173 -200
  54. package/dist/react.js.map +1 -1
  55. package/dist/schedule.d.ts +13 -10
  56. package/dist/schedule.js +43 -33
  57. package/dist/schedule.js.map +1 -1
  58. package/dist/serializable-faDkMCai.d.ts +39 -0
  59. package/dist/serializable.d.ts +7 -32
  60. package/dist/serializable.js +1 -1
  61. package/dist/src-C6rC6ZpH.js +1248 -0
  62. package/dist/src-C6rC6ZpH.js.map +1 -0
  63. package/package.json +58 -32
  64. package/dist/_esm-LV5FJ3HK.js +0 -3922
  65. package/dist/_esm-LV5FJ3HK.js.map +0 -1
  66. package/dist/ai-chat-v5-migration.js.map +0 -1
  67. package/dist/ai-types.js.map +0 -1
  68. package/dist/ccip-CMBYN64O.js +0 -15
  69. package/dist/ccip-CMBYN64O.js.map +0 -1
  70. package/dist/chunk-254F4GDT.js +0 -1343
  71. package/dist/chunk-254F4GDT.js.map +0 -1
  72. package/dist/chunk-3OT2NNEW.js +0 -941
  73. package/dist/chunk-3OT2NNEW.js.map +0 -1
  74. package/dist/chunk-5Y6BEZDY.js +0 -276
  75. package/dist/chunk-5Y6BEZDY.js.map +0 -1
  76. package/dist/chunk-BER7KXUJ.js +0 -18
  77. package/dist/chunk-BER7KXUJ.js.map +0 -1
  78. package/dist/chunk-JJBFIGUC.js +0 -5202
  79. package/dist/chunk-JJBFIGUC.js.map +0 -1
  80. package/dist/chunk-PR4QN5HX.js +0 -43
  81. package/dist/chunk-PR4QN5HX.js.map +0 -1
  82. package/dist/chunk-QEVM4BVL.js +0 -116
  83. package/dist/chunk-QEVM4BVL.js.map +0 -1
  84. package/dist/chunk-TYAY6AU6.js +0 -159
  85. package/dist/chunk-TYAY6AU6.js.map +0 -1
  86. package/dist/chunk-UJVEAURM.js +0 -150
  87. package/dist/chunk-UJVEAURM.js.map +0 -1
  88. package/dist/chunk-Z44WASMA.js +0 -114
  89. package/dist/chunk-Z44WASMA.js.map +0 -1
  90. package/dist/client-DVoPb3-C.d.ts +0 -5120
  91. package/dist/client.js.map +0 -1
  92. package/dist/index.js.map +0 -1
  93. package/dist/mcp/client.js.map +0 -1
  94. package/dist/mcp/do-oauth-client-provider.js.map +0 -1
  95. package/dist/observability/index.js.map +0 -1
  96. package/dist/secp256k1-M22GZP2U.js +0 -2193
  97. package/dist/secp256k1-M22GZP2U.js.map +0 -1
  98. package/dist/serializable.js.map +0 -1
  99. package/src/index.ts +0 -2031
@@ -0,0 +1,578 @@
1
+ import {
2
+ l as MCPConnectionState,
3
+ m as TransportType,
4
+ t as MCPClientManager
5
+ } from "./client-ctTw3KHG.js";
6
+ import { t as Observability } from "./index-BUle9RiP.js";
7
+ import { n as MessageType } from "./ai-types-81H_-Uxh.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 = string> = {
91
+ id: string;
92
+ payload: T;
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 = 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;
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
+ serverId: string;
144
+ })[];
145
+ prompts: (Prompt & {
146
+ serverId: string;
147
+ })[];
148
+ resources: (Resource & {
149
+ serverId: string;
150
+ })[];
151
+ };
152
+ type MCPServer = {
153
+ name: string;
154
+ server_url: string;
155
+ auth_url: string | null;
156
+ state: MCPConnectionState;
157
+ instructions: string | null;
158
+ capabilities: ServerCapabilities | null;
159
+ };
160
+ declare function getCurrentAgent<
161
+ T extends Agent<unknown, unknown> = Agent<unknown, unknown>
162
+ >(): {
163
+ agent: T | undefined;
164
+ connection: Connection | undefined;
165
+ request: Request | undefined;
166
+ email: AgentEmail | undefined;
167
+ };
168
+ /**
169
+ * Base class for creating Agent implementations
170
+ * @template Env Environment type containing bindings
171
+ * @template State State type to store within the Agent
172
+ */
173
+ declare class Agent<
174
+ Env = typeof env,
175
+ State = unknown,
176
+ Props extends Record<string, unknown> = Record<string, unknown>
177
+ > extends Server<Env, Props> {
178
+ private _state;
179
+ private _disposables;
180
+ private _destroyed;
181
+ private _ParentClass;
182
+ readonly mcp: MCPClientManager;
183
+ /**
184
+ * Initial state for the Agent
185
+ * Override to provide default state values
186
+ */
187
+ initialState: State;
188
+ /**
189
+ * Current state of the Agent
190
+ */
191
+ get state(): State;
192
+ /**
193
+ * Agent configuration options
194
+ */
195
+ static options: {
196
+ /** Whether the Agent should hibernate when inactive */
197
+ hibernate: boolean;
198
+ };
199
+ /**
200
+ * The observability implementation to use for the Agent
201
+ */
202
+ observability?: Observability;
203
+ /**
204
+ * Execute SQL queries against the Agent's database
205
+ * @template T Type of the returned rows
206
+ * @param strings SQL query template strings
207
+ * @param values Values to be inserted into the query
208
+ * @returns Array of query results
209
+ */
210
+ sql<T = Record<string, string | number | boolean | null>>(
211
+ strings: TemplateStringsArray,
212
+ ...values: (string | number | boolean | null)[]
213
+ ): T[];
214
+ constructor(ctx: AgentContext, env: Env);
215
+ private _setStateInternal;
216
+ /**
217
+ * Update the Agent's state
218
+ * @param state New state to set
219
+ */
220
+ setState(state: State): void;
221
+ /**
222
+ * Called when the Agent's state is updated
223
+ * @param state Updated state
224
+ * @param source Source of the state update ("server" or a client connection)
225
+ */
226
+ onStateUpdate(state: State | undefined, source: Connection | "server"): void;
227
+ /**
228
+ * Called when the Agent receives an email via routeAgentEmail()
229
+ * Override this method to handle incoming emails
230
+ * @param email Email message to process
231
+ */
232
+ _onEmail(email: AgentEmail): Promise<void>;
233
+ /**
234
+ * Reply to an email
235
+ * @param email The email to reply to
236
+ * @param options Options for the reply
237
+ * @returns void
238
+ */
239
+ replyToEmail(
240
+ email: AgentEmail,
241
+ options: {
242
+ fromName: string;
243
+ subject?: string | undefined;
244
+ body: string;
245
+ contentType?: string;
246
+ headers?: Record<string, string>;
247
+ }
248
+ ): Promise<void>;
249
+ private _tryCatch;
250
+ /**
251
+ * Automatically wrap custom methods with agent context
252
+ * This ensures getCurrentAgent() works in all custom methods without decorators
253
+ */
254
+ private _autoWrapCustomMethods;
255
+ onError(connection: Connection, error: unknown): void | Promise<void>;
256
+ onError(error: unknown): void | Promise<void>;
257
+ /**
258
+ * Render content (not implemented in base class)
259
+ */
260
+ render(): void;
261
+ /**
262
+ * Queue a task to be executed in the future
263
+ * @param payload Payload to pass to the callback
264
+ * @param callback Name of the method to call
265
+ * @returns The ID of the queued task
266
+ */
267
+ queue<T = unknown>(callback: keyof this, payload: T): Promise<string>;
268
+ private _flushingQueue;
269
+ private _flushQueue;
270
+ /**
271
+ * Dequeue a task by ID
272
+ * @param id ID of the task to dequeue
273
+ */
274
+ dequeue(id: string): Promise<void>;
275
+ /**
276
+ * Dequeue all tasks
277
+ */
278
+ dequeueAll(): Promise<void>;
279
+ /**
280
+ * Dequeue all tasks by callback
281
+ * @param callback Name of the callback to dequeue
282
+ */
283
+ dequeueAllByCallback(callback: string): Promise<void>;
284
+ /**
285
+ * Get a queued task by ID
286
+ * @param id ID of the task to get
287
+ * @returns The task or undefined if not found
288
+ */
289
+ getQueue(id: string): Promise<QueueItem<string> | undefined>;
290
+ /**
291
+ * Get all queues by key and value
292
+ * @param key Key to filter by
293
+ * @param value Value to filter by
294
+ * @returns Array of matching QueueItem objects
295
+ */
296
+ getQueues(key: string, value: string): Promise<QueueItem<string>[]>;
297
+ /**
298
+ * Schedule a task to be executed in the future
299
+ * @template T Type of the payload data
300
+ * @param when When to execute the task (Date, seconds delay, or cron expression)
301
+ * @param callback Name of the method to call
302
+ * @param payload Data to pass to the callback
303
+ * @returns Schedule object representing the scheduled task
304
+ */
305
+ schedule<T = string>(
306
+ when: Date | string | number,
307
+ callback: keyof this,
308
+ payload?: T
309
+ ): Promise<Schedule<T>>;
310
+ /**
311
+ * Get a scheduled task by ID
312
+ * @template T Type of the payload data
313
+ * @param id ID of the scheduled task
314
+ * @returns The Schedule object or undefined if not found
315
+ */
316
+ getSchedule<T = string>(id: string): Promise<Schedule<T> | undefined>;
317
+ /**
318
+ * Get scheduled tasks matching the given criteria
319
+ * @template T Type of the payload data
320
+ * @param criteria Criteria to filter schedules
321
+ * @returns Array of matching Schedule objects
322
+ */
323
+ getSchedules<T = string>(criteria?: {
324
+ id?: string;
325
+ type?: "scheduled" | "delayed" | "cron";
326
+ timeRange?: {
327
+ start?: Date;
328
+ end?: Date;
329
+ };
330
+ }): Schedule<T>[];
331
+ /**
332
+ * Cancel a scheduled task
333
+ * @param id ID of the task to cancel
334
+ * @returns true if the task was cancelled, false otherwise
335
+ */
336
+ cancelSchedule(id: string): Promise<boolean>;
337
+ private _scheduleNextAlarm;
338
+ /**
339
+ * Method called when an alarm fires.
340
+ * Executes any scheduled tasks that are due.
341
+ *
342
+ * @remarks
343
+ * To schedule a task, please use the `this.schedule` method instead.
344
+ * See {@link https://developers.cloudflare.com/agents/api-reference/schedule-tasks/}
345
+ */
346
+ readonly alarm: () => Promise<void>;
347
+ /**
348
+ * Destroy the Agent, removing all state and scheduled tasks
349
+ */
350
+ destroy(): Promise<void>;
351
+ /**
352
+ * Get all methods marked as callable on this Agent
353
+ * @returns A map of method names to their metadata
354
+ */
355
+ private _isCallable;
356
+ /**
357
+ * Connect to a new MCP Server
358
+ *
359
+ * @param serverName Name of the MCP server
360
+ * @param url MCP Server SSE URL
361
+ * @param callbackHost Base host for the agent, used for the redirect URI. If not provided, will be derived from the current request.
362
+ * @param agentsPrefix agents routing prefix if not using `agents`
363
+ * @param options MCP client and transport options
364
+ * @returns authUrl
365
+ */
366
+ addMcpServer(
367
+ serverName: string,
368
+ url: string,
369
+ callbackHost?: string,
370
+ agentsPrefix?: string,
371
+ options?: {
372
+ client?: ConstructorParameters<typeof Client>[1];
373
+ transport?: {
374
+ headers?: HeadersInit;
375
+ type?: TransportType;
376
+ };
377
+ }
378
+ ): Promise<{
379
+ id: string;
380
+ authUrl: string | undefined;
381
+ }>;
382
+ removeMcpServer(id: string): Promise<void>;
383
+ getMcpServers(): Promise<MCPServersState>;
384
+ private broadcastMcpServers;
385
+ /**
386
+ * Handle MCP OAuth callback request if it's an OAuth callback.
387
+ *
388
+ * This method encapsulates the entire OAuth callback flow:
389
+ * 1. Checks if the request is an MCP OAuth callback
390
+ * 2. Processes the OAuth code exchange
391
+ * 3. Establishes the connection if successful
392
+ * 4. Broadcasts MCP server state updates
393
+ * 5. Returns the appropriate HTTP response
394
+ *
395
+ * @param request The incoming HTTP request
396
+ * @returns Response if this was an OAuth callback, null otherwise
397
+ */
398
+ private handleMcpOAuthCallback;
399
+ /**
400
+ * Handle OAuth callback response using MCPClientManager configuration
401
+ * @param result OAuth callback result
402
+ * @param request The original request (needed for base URL)
403
+ * @returns Response for the OAuth callback
404
+ */
405
+ private handleOAuthCallbackResponse;
406
+ }
407
+ /**
408
+ * Namespace for creating Agent instances
409
+ * @template Agentic Type of the Agent class
410
+ */
411
+ type AgentNamespace<Agentic extends Agent<unknown>> =
412
+ DurableObjectNamespace<Agentic>;
413
+ /**
414
+ * Agent's durable context
415
+ */
416
+ type AgentContext = DurableObjectState;
417
+ /**
418
+ * Configuration options for Agent routing
419
+ */
420
+ type AgentOptions<Env> = PartyServerOptions<Env> & {
421
+ /**
422
+ * Whether to enable CORS for the Agent
423
+ */
424
+ cors?: boolean | HeadersInit | undefined;
425
+ };
426
+ /**
427
+ * Route a request to the appropriate Agent
428
+ * @param request Request to route
429
+ * @param env Environment containing Agent bindings
430
+ * @param options Routing options
431
+ * @returns Response from the Agent or undefined if no route matched
432
+ */
433
+ declare function routeAgentRequest<Env>(
434
+ request: Request,
435
+ env: Env,
436
+ options?: AgentOptions<Env>
437
+ ): Promise<Response | null>;
438
+ type EmailResolver<Env> = (
439
+ email: ForwardableEmailMessage,
440
+ env: Env
441
+ ) => Promise<{
442
+ agentName: string;
443
+ agentId: string;
444
+ } | null>;
445
+ /**
446
+ * Create a resolver that uses the message-id header to determine the agent to route the email to
447
+ * @returns A function that resolves the agent to route the email to
448
+ */
449
+ declare function createHeaderBasedEmailResolver<Env>(): EmailResolver<Env>;
450
+ /**
451
+ * Create a resolver that uses the email address to determine the agent to route the email to
452
+ * @param defaultAgentName The default agent name to use if the email address does not contain a sub-address
453
+ * @returns A function that resolves the agent to route the email to
454
+ */
455
+ declare function createAddressBasedEmailResolver<Env>(
456
+ defaultAgentName: string
457
+ ): EmailResolver<Env>;
458
+ /**
459
+ * Create a resolver that uses the agentName and agentId to determine the agent to route the email to
460
+ * @param agentName The name of the agent to route the email to
461
+ * @param agentId The id of the agent to route the email to
462
+ * @returns A function that resolves the agent to route the email to
463
+ */
464
+ declare function createCatchAllEmailResolver<Env>(
465
+ agentName: string,
466
+ agentId: string
467
+ ): EmailResolver<Env>;
468
+ type EmailRoutingOptions<Env> = AgentOptions<Env> & {
469
+ resolver: EmailResolver<Env>;
470
+ };
471
+ /**
472
+ * Route an email to the appropriate Agent
473
+ * @param email The email to route
474
+ * @param env The environment containing the Agent bindings
475
+ * @param options The options for routing the email
476
+ * @returns A promise that resolves when the email has been routed
477
+ */
478
+ declare function routeAgentEmail<Env>(
479
+ email: ForwardableEmailMessage,
480
+ env: Env,
481
+ options: EmailRoutingOptions<Env>
482
+ ): Promise<void>;
483
+ type AgentEmail = {
484
+ from: string;
485
+ to: string;
486
+ getRaw: () => Promise<Uint8Array>;
487
+ headers: Headers;
488
+ rawSize: number;
489
+ setReject: (reason: string) => void;
490
+ forward: (rcptTo: string, headers?: Headers) => Promise<void>;
491
+ reply: (options: { from: string; to: string; raw: string }) => Promise<void>;
492
+ };
493
+ type EmailSendOptions = {
494
+ to: string;
495
+ subject: string;
496
+ body: string;
497
+ contentType?: string;
498
+ headers?: Record<string, string>;
499
+ includeRoutingHeaders?: boolean;
500
+ agentName?: string;
501
+ agentId?: string;
502
+ domain?: string;
503
+ };
504
+ /**
505
+ * Get or create an Agent by name
506
+ * @template Env Environment type containing bindings
507
+ * @template T Type of the Agent class
508
+ * @param namespace Agent namespace
509
+ * @param name Name of the Agent instance
510
+ * @param options Options for Agent creation
511
+ * @returns Promise resolving to an Agent instance stub
512
+ */
513
+ declare function getAgentByName<
514
+ Env,
515
+ T extends Agent<Env>,
516
+ Props extends Record<string, unknown> = Record<string, unknown>
517
+ >(
518
+ namespace: AgentNamespace<T>,
519
+ name: string,
520
+ options?: {
521
+ jurisdiction?: DurableObjectJurisdiction;
522
+ locationHint?: DurableObjectLocationHint;
523
+ props?: Props;
524
+ }
525
+ ): Promise<DurableObjectStub<T>>;
526
+ /**
527
+ * A wrapper for streaming responses in callable methods
528
+ */
529
+ declare class StreamingResponse {
530
+ private _connection;
531
+ private _id;
532
+ private _closed;
533
+ constructor(connection: Connection, id: string);
534
+ /**
535
+ * Send a chunk of data to the client
536
+ * @param chunk The data to send
537
+ */
538
+ send(chunk: unknown): void;
539
+ /**
540
+ * End the stream and send the final chunk (if any)
541
+ * @param finalChunk Optional final chunk of data to send
542
+ */
543
+ end(finalChunk?: unknown): void;
544
+ }
545
+ //#endregion
546
+ export {
547
+ unstable_callable as A,
548
+ createAddressBasedEmailResolver as C,
549
+ getCurrentAgent as D,
550
+ getAgentByName as E,
551
+ routeAgentEmail as O,
552
+ callable as S,
553
+ createHeaderBasedEmailResolver as T,
554
+ RPCResponse as _,
555
+ AgentOptions as a,
556
+ StreamingResponse as b,
557
+ ConnectionContext as c,
558
+ EmailSendOptions as d,
559
+ MCPServer as f,
560
+ RPCRequest as g,
561
+ QueueItem as h,
562
+ AgentNamespace as i,
563
+ routeAgentRequest as k,
564
+ EmailResolver as l,
565
+ MCPServersState as m,
566
+ AgentContext as n,
567
+ CallableMetadata as o,
568
+ MCPServerMessage as p,
569
+ AgentEmail as r,
570
+ Connection$1 as s,
571
+ Agent as t,
572
+ EmailRoutingOptions as u,
573
+ Schedule as v,
574
+ createCatchAllEmailResolver as w,
575
+ WSMessage as x,
576
+ StateUpdateMessage as y
577
+ };
578
+ //# sourceMappingURL=index-D2dnUH0r.d.ts.map