agents 0.0.0-eede2bd → 0.0.0-f0c6dce

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 (56) hide show
  1. package/README.md +131 -25
  2. package/dist/ai-chat-agent.d.ts +40 -10
  3. package/dist/ai-chat-agent.js +246 -143
  4. package/dist/ai-chat-agent.js.map +1 -1
  5. package/dist/ai-chat-v5-migration.d.ts +152 -0
  6. package/dist/ai-chat-v5-migration.js +19 -0
  7. package/dist/ai-react.d.ts +71 -67
  8. package/dist/ai-react.js +160 -55
  9. package/dist/ai-react.js.map +1 -1
  10. package/dist/ai-types.d.ts +36 -19
  11. package/dist/ai-types.js +6 -0
  12. package/dist/chunk-AVYJQSLW.js +17 -0
  13. package/dist/chunk-AVYJQSLW.js.map +1 -0
  14. package/dist/chunk-MWQSU7GK.js +1301 -0
  15. package/dist/chunk-MWQSU7GK.js.map +1 -0
  16. package/dist/chunk-PVQZBKN7.js +106 -0
  17. package/dist/chunk-PVQZBKN7.js.map +1 -0
  18. package/dist/chunk-QEVM4BVL.js +116 -0
  19. package/dist/chunk-QEVM4BVL.js.map +1 -0
  20. package/dist/chunk-UJVEAURM.js +150 -0
  21. package/dist/chunk-UJVEAURM.js.map +1 -0
  22. package/dist/{chunk-Q5ZBHY4Z.js → chunk-VYENMKFS.js} +209 -53
  23. package/dist/chunk-VYENMKFS.js.map +1 -0
  24. package/dist/client-B9tFv5gX.d.ts +4607 -0
  25. package/dist/client.d.ts +16 -2
  26. package/dist/client.js +7 -126
  27. package/dist/client.js.map +1 -1
  28. package/dist/index.d.ts +264 -23
  29. package/dist/index.js +13 -3
  30. package/dist/mcp/client.d.ts +9 -775
  31. package/dist/mcp/client.js +1 -2
  32. package/dist/mcp/do-oauth-client-provider.d.ts +3 -3
  33. package/dist/mcp/do-oauth-client-provider.js +3 -103
  34. package/dist/mcp/do-oauth-client-provider.js.map +1 -1
  35. package/dist/mcp/index.d.ts +49 -11
  36. package/dist/mcp/index.js +330 -184
  37. package/dist/mcp/index.js.map +1 -1
  38. package/dist/observability/index.d.ts +46 -0
  39. package/dist/observability/index.js +11 -0
  40. package/dist/observability/index.js.map +1 -0
  41. package/dist/react.d.ts +89 -5
  42. package/dist/react.js +23 -9
  43. package/dist/react.js.map +1 -1
  44. package/dist/schedule.d.ts +81 -7
  45. package/dist/schedule.js +19 -8
  46. package/dist/schedule.js.map +1 -1
  47. package/dist/serializable.d.ts +32 -0
  48. package/dist/serializable.js +1 -0
  49. package/dist/serializable.js.map +1 -0
  50. package/package.json +83 -68
  51. package/src/index.ts +1132 -145
  52. package/dist/chunk-5W7ZWKOP.js +0 -617
  53. package/dist/chunk-5W7ZWKOP.js.map +0 -1
  54. package/dist/chunk-HMLY7DHA.js +0 -16
  55. package/dist/chunk-Q5ZBHY4Z.js.map +0 -1
  56. /package/dist/{chunk-HMLY7DHA.js.map → ai-chat-v5-migration.js.map} +0 -0
@@ -1,617 +0,0 @@
1
- import {
2
- MCPClientManager
3
- } from "./chunk-Q5ZBHY4Z.js";
4
- import {
5
- __privateAdd,
6
- __privateGet,
7
- __privateMethod,
8
- __privateSet
9
- } from "./chunk-HMLY7DHA.js";
10
-
11
- // src/index.ts
12
- import {
13
- Server,
14
- routePartykitRequest,
15
- getServerByName
16
- } from "partyserver";
17
- import { parseCronExpression } from "cron-schedule";
18
- import { nanoid } from "nanoid";
19
- import { AsyncLocalStorage } from "node:async_hooks";
20
- function isRPCRequest(msg) {
21
- return typeof msg === "object" && msg !== null && "type" in msg && msg.type === "rpc" && "id" in msg && typeof msg.id === "string" && "method" in msg && typeof msg.method === "string" && "args" in msg && Array.isArray(msg.args);
22
- }
23
- function isStateUpdateMessage(msg) {
24
- return typeof msg === "object" && msg !== null && "type" in msg && msg.type === "cf_agent_state" && "state" in msg;
25
- }
26
- var callableMetadata = /* @__PURE__ */ new Map();
27
- function unstable_callable(metadata = {}) {
28
- return function callableDecorator(target, context) {
29
- if (!callableMetadata.has(target)) {
30
- callableMetadata.set(target, metadata);
31
- }
32
- return target;
33
- };
34
- }
35
- function getNextCronTime(cron) {
36
- const interval = parseCronExpression(cron);
37
- return interval.getNextDate();
38
- }
39
- var STATE_ROW_ID = "cf_state_row_id";
40
- var STATE_WAS_CHANGED = "cf_state_was_changed";
41
- var DEFAULT_STATE = {};
42
- var agentContext = new AsyncLocalStorage();
43
- function getCurrentAgent() {
44
- const store = agentContext.getStore();
45
- if (!store) {
46
- return {
47
- agent: void 0,
48
- connection: void 0,
49
- request: void 0
50
- };
51
- }
52
- return store;
53
- }
54
- var _state, _ParentClass, _Agent_instances, setStateInternal_fn, tryCatch_fn, scheduleNextAlarm_fn, isCallable_fn;
55
- var Agent = class extends Server {
56
- constructor(ctx, env) {
57
- super(ctx, env);
58
- __privateAdd(this, _Agent_instances);
59
- __privateAdd(this, _state, DEFAULT_STATE);
60
- __privateAdd(this, _ParentClass, Object.getPrototypeOf(this).constructor);
61
- this.mcp = new MCPClientManager(__privateGet(this, _ParentClass).name, "0.0.1");
62
- /**
63
- * Initial state for the Agent
64
- * Override to provide default state values
65
- */
66
- this.initialState = DEFAULT_STATE;
67
- this.sql`
68
- CREATE TABLE IF NOT EXISTS cf_agents_state (
69
- id TEXT PRIMARY KEY NOT NULL,
70
- state TEXT
71
- )
72
- `;
73
- void this.ctx.blockConcurrencyWhile(async () => {
74
- return __privateMethod(this, _Agent_instances, tryCatch_fn).call(this, async () => {
75
- this.sql`
76
- CREATE TABLE IF NOT EXISTS cf_agents_schedules (
77
- id TEXT PRIMARY KEY NOT NULL DEFAULT (randomblob(9)),
78
- callback TEXT,
79
- payload TEXT,
80
- type TEXT NOT NULL CHECK(type IN ('scheduled', 'delayed', 'cron')),
81
- time INTEGER,
82
- delayInSeconds INTEGER,
83
- cron TEXT,
84
- created_at INTEGER DEFAULT (unixepoch())
85
- )
86
- `;
87
- await this.alarm();
88
- });
89
- });
90
- const _onRequest = this.onRequest.bind(this);
91
- this.onRequest = (request) => {
92
- return agentContext.run(
93
- { agent: this, connection: void 0, request },
94
- async () => {
95
- return __privateMethod(this, _Agent_instances, tryCatch_fn).call(this, () => _onRequest(request));
96
- }
97
- );
98
- };
99
- const _onMessage = this.onMessage.bind(this);
100
- this.onMessage = async (connection, message) => {
101
- return agentContext.run(
102
- { agent: this, connection, request: void 0 },
103
- async () => {
104
- if (typeof message !== "string") {
105
- return __privateMethod(this, _Agent_instances, tryCatch_fn).call(this, () => _onMessage(connection, message));
106
- }
107
- let parsed;
108
- try {
109
- parsed = JSON.parse(message);
110
- } catch (e) {
111
- return __privateMethod(this, _Agent_instances, tryCatch_fn).call(this, () => _onMessage(connection, message));
112
- }
113
- if (isStateUpdateMessage(parsed)) {
114
- __privateMethod(this, _Agent_instances, setStateInternal_fn).call(this, parsed.state, connection);
115
- return;
116
- }
117
- if (isRPCRequest(parsed)) {
118
- try {
119
- const { id, method, args } = parsed;
120
- const methodFn = this[method];
121
- if (typeof methodFn !== "function") {
122
- throw new Error(`Method ${method} does not exist`);
123
- }
124
- if (!__privateMethod(this, _Agent_instances, isCallable_fn).call(this, method)) {
125
- throw new Error(`Method ${method} is not callable`);
126
- }
127
- const metadata = callableMetadata.get(methodFn);
128
- if (metadata?.streaming) {
129
- const stream = new StreamingResponse(connection, id);
130
- await methodFn.apply(this, [stream, ...args]);
131
- return;
132
- }
133
- const result = await methodFn.apply(this, args);
134
- const response = {
135
- type: "rpc",
136
- id,
137
- success: true,
138
- result,
139
- done: true
140
- };
141
- connection.send(JSON.stringify(response));
142
- } catch (e) {
143
- const response = {
144
- type: "rpc",
145
- id: parsed.id,
146
- success: false,
147
- error: e instanceof Error ? e.message : "Unknown error occurred"
148
- };
149
- connection.send(JSON.stringify(response));
150
- console.error("RPC error:", e);
151
- }
152
- return;
153
- }
154
- return __privateMethod(this, _Agent_instances, tryCatch_fn).call(this, () => _onMessage(connection, message));
155
- }
156
- );
157
- };
158
- const _onConnect = this.onConnect.bind(this);
159
- this.onConnect = (connection, ctx2) => {
160
- return agentContext.run(
161
- { agent: this, connection, request: ctx2.request },
162
- async () => {
163
- setTimeout(() => {
164
- if (this.state) {
165
- connection.send(
166
- JSON.stringify({
167
- type: "cf_agent_state",
168
- state: this.state
169
- })
170
- );
171
- }
172
- return __privateMethod(this, _Agent_instances, tryCatch_fn).call(this, () => _onConnect(connection, ctx2));
173
- }, 20);
174
- }
175
- );
176
- };
177
- }
178
- /**
179
- * Current state of the Agent
180
- */
181
- get state() {
182
- if (__privateGet(this, _state) !== DEFAULT_STATE) {
183
- return __privateGet(this, _state);
184
- }
185
- const wasChanged = this.sql`
186
- SELECT state FROM cf_agents_state WHERE id = ${STATE_WAS_CHANGED}
187
- `;
188
- const result = this.sql`
189
- SELECT state FROM cf_agents_state WHERE id = ${STATE_ROW_ID}
190
- `;
191
- if (wasChanged[0]?.state === "true" || // we do this check for people who updated their code before we shipped wasChanged
192
- result[0]?.state) {
193
- const state = result[0]?.state;
194
- __privateSet(this, _state, JSON.parse(state));
195
- return __privateGet(this, _state);
196
- }
197
- if (this.initialState === DEFAULT_STATE) {
198
- return void 0;
199
- }
200
- this.setState(this.initialState);
201
- return this.initialState;
202
- }
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(strings, ...values) {
211
- let query = "";
212
- try {
213
- query = strings.reduce(
214
- (acc, str, i) => acc + str + (i < values.length ? "?" : ""),
215
- ""
216
- );
217
- return [...this.ctx.storage.sql.exec(query, ...values)];
218
- } catch (e) {
219
- console.error(`failed to execute sql query: ${query}`, e);
220
- throw this.onError(e);
221
- }
222
- }
223
- /**
224
- * Update the Agent's state
225
- * @param state New state to set
226
- */
227
- setState(state) {
228
- __privateMethod(this, _Agent_instances, setStateInternal_fn).call(this, state, "server");
229
- }
230
- /**
231
- * Called when the Agent's state is updated
232
- * @param state Updated state
233
- * @param source Source of the state update ("server" or a client connection)
234
- */
235
- onStateUpdate(state, source) {
236
- }
237
- /**
238
- * Called when the Agent receives an email
239
- * @param email Email message to process
240
- */
241
- onEmail(email) {
242
- return agentContext.run(
243
- { agent: this, connection: void 0, request: void 0 },
244
- async () => {
245
- console.error("onEmail not implemented");
246
- }
247
- );
248
- }
249
- onError(connectionOrError, error) {
250
- let theError;
251
- if (connectionOrError && error) {
252
- theError = error;
253
- console.error(
254
- "Error on websocket connection:",
255
- connectionOrError.id,
256
- theError
257
- );
258
- console.error(
259
- "Override onError(connection, error) to handle websocket connection errors"
260
- );
261
- } else {
262
- theError = connectionOrError;
263
- console.error("Error on server:", theError);
264
- console.error("Override onError(error) to handle server errors");
265
- }
266
- throw theError;
267
- }
268
- /**
269
- * Render content (not implemented in base class)
270
- */
271
- render() {
272
- throw new Error("Not implemented");
273
- }
274
- /**
275
- * Schedule a task to be executed in the future
276
- * @template T Type of the payload data
277
- * @param when When to execute the task (Date, seconds delay, or cron expression)
278
- * @param callback Name of the method to call
279
- * @param payload Data to pass to the callback
280
- * @returns Schedule object representing the scheduled task
281
- */
282
- async schedule(when, callback, payload) {
283
- const id = nanoid(9);
284
- if (typeof callback !== "string") {
285
- throw new Error("Callback must be a string");
286
- }
287
- if (typeof this[callback] !== "function") {
288
- throw new Error(`this.${callback} is not a function`);
289
- }
290
- if (when instanceof Date) {
291
- const timestamp = Math.floor(when.getTime() / 1e3);
292
- this.sql`
293
- INSERT OR REPLACE INTO cf_agents_schedules (id, callback, payload, type, time)
294
- VALUES (${id}, ${callback}, ${JSON.stringify(
295
- payload
296
- )}, 'scheduled', ${timestamp})
297
- `;
298
- await __privateMethod(this, _Agent_instances, scheduleNextAlarm_fn).call(this);
299
- return {
300
- id,
301
- callback,
302
- payload,
303
- time: timestamp,
304
- type: "scheduled"
305
- };
306
- }
307
- if (typeof when === "number") {
308
- const time = new Date(Date.now() + when * 1e3);
309
- const timestamp = Math.floor(time.getTime() / 1e3);
310
- this.sql`
311
- INSERT OR REPLACE INTO cf_agents_schedules (id, callback, payload, type, delayInSeconds, time)
312
- VALUES (${id}, ${callback}, ${JSON.stringify(
313
- payload
314
- )}, 'delayed', ${when}, ${timestamp})
315
- `;
316
- await __privateMethod(this, _Agent_instances, scheduleNextAlarm_fn).call(this);
317
- return {
318
- id,
319
- callback,
320
- payload,
321
- delayInSeconds: when,
322
- time: timestamp,
323
- type: "delayed"
324
- };
325
- }
326
- if (typeof when === "string") {
327
- const nextExecutionTime = getNextCronTime(when);
328
- const timestamp = Math.floor(nextExecutionTime.getTime() / 1e3);
329
- this.sql`
330
- INSERT OR REPLACE INTO cf_agents_schedules (id, callback, payload, type, cron, time)
331
- VALUES (${id}, ${callback}, ${JSON.stringify(
332
- payload
333
- )}, 'cron', ${when}, ${timestamp})
334
- `;
335
- await __privateMethod(this, _Agent_instances, scheduleNextAlarm_fn).call(this);
336
- return {
337
- id,
338
- callback,
339
- payload,
340
- cron: when,
341
- time: timestamp,
342
- type: "cron"
343
- };
344
- }
345
- throw new Error("Invalid schedule type");
346
- }
347
- /**
348
- * Get a scheduled task by ID
349
- * @template T Type of the payload data
350
- * @param id ID of the scheduled task
351
- * @returns The Schedule object or undefined if not found
352
- */
353
- async getSchedule(id) {
354
- const result = this.sql`
355
- SELECT * FROM cf_agents_schedules WHERE id = ${id}
356
- `;
357
- if (!result) {
358
- console.error(`schedule ${id} not found`);
359
- return void 0;
360
- }
361
- return { ...result[0], payload: JSON.parse(result[0].payload) };
362
- }
363
- /**
364
- * Get scheduled tasks matching the given criteria
365
- * @template T Type of the payload data
366
- * @param criteria Criteria to filter schedules
367
- * @returns Array of matching Schedule objects
368
- */
369
- getSchedules(criteria = {}) {
370
- let query = "SELECT * FROM cf_agents_schedules WHERE 1=1";
371
- const params = [];
372
- if (criteria.id) {
373
- query += " AND id = ?";
374
- params.push(criteria.id);
375
- }
376
- if (criteria.type) {
377
- query += " AND type = ?";
378
- params.push(criteria.type);
379
- }
380
- if (criteria.timeRange) {
381
- query += " AND time >= ? AND time <= ?";
382
- const start = criteria.timeRange.start || /* @__PURE__ */ new Date(0);
383
- const end = criteria.timeRange.end || /* @__PURE__ */ new Date(999999999999999);
384
- params.push(
385
- Math.floor(start.getTime() / 1e3),
386
- Math.floor(end.getTime() / 1e3)
387
- );
388
- }
389
- const result = this.ctx.storage.sql.exec(query, ...params).toArray().map((row) => ({
390
- ...row,
391
- payload: JSON.parse(row.payload)
392
- }));
393
- return result;
394
- }
395
- /**
396
- * Cancel a scheduled task
397
- * @param id ID of the task to cancel
398
- * @returns true if the task was cancelled, false otherwise
399
- */
400
- async cancelSchedule(id) {
401
- this.sql`DELETE FROM cf_agents_schedules WHERE id = ${id}`;
402
- await __privateMethod(this, _Agent_instances, scheduleNextAlarm_fn).call(this);
403
- return true;
404
- }
405
- /**
406
- * Method called when an alarm fires
407
- * Executes any scheduled tasks that are due
408
- */
409
- async alarm() {
410
- const now = Math.floor(Date.now() / 1e3);
411
- const result = this.sql`
412
- SELECT * FROM cf_agents_schedules WHERE time <= ${now}
413
- `;
414
- for (const row of result || []) {
415
- const callback = this[row.callback];
416
- if (!callback) {
417
- console.error(`callback ${row.callback} not found`);
418
- continue;
419
- }
420
- await agentContext.run(
421
- { agent: this, connection: void 0, request: void 0 },
422
- async () => {
423
- try {
424
- await callback.bind(this)(JSON.parse(row.payload), row);
425
- } catch (e) {
426
- console.error(`error executing callback "${row.callback}"`, e);
427
- }
428
- }
429
- );
430
- if (row.type === "cron") {
431
- const nextExecutionTime = getNextCronTime(row.cron);
432
- const nextTimestamp = Math.floor(nextExecutionTime.getTime() / 1e3);
433
- this.sql`
434
- UPDATE cf_agents_schedules SET time = ${nextTimestamp} WHERE id = ${row.id}
435
- `;
436
- } else {
437
- this.sql`
438
- DELETE FROM cf_agents_schedules WHERE id = ${row.id}
439
- `;
440
- }
441
- }
442
- await __privateMethod(this, _Agent_instances, scheduleNextAlarm_fn).call(this);
443
- }
444
- /**
445
- * Destroy the Agent, removing all state and scheduled tasks
446
- */
447
- async destroy() {
448
- this.sql`DROP TABLE IF EXISTS cf_agents_state`;
449
- this.sql`DROP TABLE IF EXISTS cf_agents_schedules`;
450
- await this.ctx.storage.deleteAlarm();
451
- await this.ctx.storage.deleteAll();
452
- }
453
- };
454
- _state = new WeakMap();
455
- _ParentClass = new WeakMap();
456
- _Agent_instances = new WeakSet();
457
- setStateInternal_fn = function(state, source = "server") {
458
- __privateSet(this, _state, state);
459
- this.sql`
460
- INSERT OR REPLACE INTO cf_agents_state (id, state)
461
- VALUES (${STATE_ROW_ID}, ${JSON.stringify(state)})
462
- `;
463
- this.sql`
464
- INSERT OR REPLACE INTO cf_agents_state (id, state)
465
- VALUES (${STATE_WAS_CHANGED}, ${JSON.stringify(true)})
466
- `;
467
- this.broadcast(
468
- JSON.stringify({
469
- type: "cf_agent_state",
470
- state
471
- }),
472
- source !== "server" ? [source.id] : []
473
- );
474
- return __privateMethod(this, _Agent_instances, tryCatch_fn).call(this, () => {
475
- const { connection, request } = agentContext.getStore() || {};
476
- return agentContext.run(
477
- { agent: this, connection, request },
478
- async () => {
479
- return this.onStateUpdate(state, source);
480
- }
481
- );
482
- });
483
- };
484
- tryCatch_fn = async function(fn) {
485
- try {
486
- return await fn();
487
- } catch (e) {
488
- throw this.onError(e);
489
- }
490
- };
491
- scheduleNextAlarm_fn = async function() {
492
- const result = this.sql`
493
- SELECT time FROM cf_agents_schedules
494
- WHERE time > ${Math.floor(Date.now() / 1e3)}
495
- ORDER BY time ASC
496
- LIMIT 1
497
- `;
498
- if (!result) return;
499
- if (result.length > 0 && "time" in result[0]) {
500
- const nextTime = result[0].time * 1e3;
501
- await this.ctx.storage.setAlarm(nextTime);
502
- }
503
- };
504
- /**
505
- * Get all methods marked as callable on this Agent
506
- * @returns A map of method names to their metadata
507
- */
508
- isCallable_fn = function(method) {
509
- return callableMetadata.has(this[method]);
510
- };
511
- /**
512
- * Agent configuration options
513
- */
514
- Agent.options = {
515
- /** Whether the Agent should hibernate when inactive */
516
- hibernate: true
517
- // default to hibernate
518
- };
519
- async function routeAgentRequest(request, env, options) {
520
- const corsHeaders = options?.cors === true ? {
521
- "Access-Control-Allow-Origin": "*",
522
- "Access-Control-Allow-Methods": "GET, POST, HEAD, OPTIONS",
523
- "Access-Control-Allow-Credentials": "true",
524
- "Access-Control-Max-Age": "86400"
525
- } : options?.cors;
526
- if (request.method === "OPTIONS") {
527
- if (corsHeaders) {
528
- return new Response(null, {
529
- headers: corsHeaders
530
- });
531
- }
532
- console.warn(
533
- "Received an OPTIONS request, but cors was not enabled. Pass `cors: true` or `cors: { ...custom cors headers }` to routeAgentRequest to enable CORS."
534
- );
535
- }
536
- let response = await routePartykitRequest(
537
- request,
538
- env,
539
- {
540
- prefix: "agents",
541
- ...options
542
- }
543
- );
544
- if (response && corsHeaders && request.headers.get("upgrade")?.toLowerCase() !== "websocket" && request.headers.get("Upgrade")?.toLowerCase() !== "websocket") {
545
- response = new Response(response.body, {
546
- headers: {
547
- ...response.headers,
548
- ...corsHeaders
549
- }
550
- });
551
- }
552
- return response;
553
- }
554
- async function routeAgentEmail(email, env, options) {
555
- }
556
- async function getAgentByName(namespace, name, options) {
557
- return getServerByName(namespace, name, options);
558
- }
559
- var _connection, _id, _closed;
560
- var StreamingResponse = class {
561
- constructor(connection, id) {
562
- __privateAdd(this, _connection);
563
- __privateAdd(this, _id);
564
- __privateAdd(this, _closed, false);
565
- __privateSet(this, _connection, connection);
566
- __privateSet(this, _id, id);
567
- }
568
- /**
569
- * Send a chunk of data to the client
570
- * @param chunk The data to send
571
- */
572
- send(chunk) {
573
- if (__privateGet(this, _closed)) {
574
- throw new Error("StreamingResponse is already closed");
575
- }
576
- const response = {
577
- type: "rpc",
578
- id: __privateGet(this, _id),
579
- success: true,
580
- result: chunk,
581
- done: false
582
- };
583
- __privateGet(this, _connection).send(JSON.stringify(response));
584
- }
585
- /**
586
- * End the stream and send the final chunk (if any)
587
- * @param finalChunk Optional final chunk of data to send
588
- */
589
- end(finalChunk) {
590
- if (__privateGet(this, _closed)) {
591
- throw new Error("StreamingResponse is already closed");
592
- }
593
- __privateSet(this, _closed, true);
594
- const response = {
595
- type: "rpc",
596
- id: __privateGet(this, _id),
597
- success: true,
598
- result: finalChunk,
599
- done: true
600
- };
601
- __privateGet(this, _connection).send(JSON.stringify(response));
602
- }
603
- };
604
- _connection = new WeakMap();
605
- _id = new WeakMap();
606
- _closed = new WeakMap();
607
-
608
- export {
609
- unstable_callable,
610
- getCurrentAgent,
611
- Agent,
612
- routeAgentRequest,
613
- routeAgentEmail,
614
- getAgentByName,
615
- StreamingResponse
616
- };
617
- //# sourceMappingURL=chunk-5W7ZWKOP.js.map