@mastra/client-js 0.0.0-iterate-traces-ui-again-20250912091900 → 0.0.0-just-snapshot-20251014192224

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 (40) hide show
  1. package/CHANGELOG.md +380 -3
  2. package/README.md +6 -10
  3. package/dist/client.d.ts +35 -39
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/index.cjs +521 -606
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +520 -607
  10. package/dist/index.js.map +1 -1
  11. package/dist/resources/agent-builder.d.ts +5 -6
  12. package/dist/resources/agent-builder.d.ts.map +1 -1
  13. package/dist/resources/agent.d.ts +54 -36
  14. package/dist/resources/agent.d.ts.map +1 -1
  15. package/dist/resources/index.d.ts +0 -2
  16. package/dist/resources/index.d.ts.map +1 -1
  17. package/dist/resources/mcp-tool.d.ts +2 -1
  18. package/dist/resources/mcp-tool.d.ts.map +1 -1
  19. package/dist/resources/observability.d.ts +17 -1
  20. package/dist/resources/observability.d.ts.map +1 -1
  21. package/dist/resources/tool.d.ts +2 -1
  22. package/dist/resources/tool.d.ts.map +1 -1
  23. package/dist/resources/vector.d.ts +5 -2
  24. package/dist/resources/vector.d.ts.map +1 -1
  25. package/dist/resources/workflow.d.ts +119 -19
  26. package/dist/resources/workflow.d.ts.map +1 -1
  27. package/dist/tools.d.ts +22 -0
  28. package/dist/tools.d.ts.map +1 -0
  29. package/dist/types.d.ts +58 -48
  30. package/dist/types.d.ts.map +1 -1
  31. package/dist/utils/index.d.ts +1 -0
  32. package/dist/utils/index.d.ts.map +1 -1
  33. package/dist/utils/process-mastra-stream.d.ts.map +1 -1
  34. package/package.json +5 -6
  35. package/dist/resources/legacy-workflow.d.ts +0 -87
  36. package/dist/resources/legacy-workflow.d.ts.map +0 -1
  37. package/dist/resources/network.d.ts +0 -30
  38. package/dist/resources/network.d.ts.map +0 -1
  39. package/dist/resources/vNextNetwork.d.ts +0 -42
  40. package/dist/resources/vNextNetwork.d.ts.map +0 -1
package/dist/index.cjs CHANGED
@@ -27,6 +27,14 @@ function base64RuntimeContext(runtimeContext) {
27
27
  }
28
28
  return void 0;
29
29
  }
30
+ function runtimeContextQueryString(runtimeContext) {
31
+ const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
32
+ if (!runtimeContextParam) return "";
33
+ const searchParams = new URLSearchParams();
34
+ searchParams.set("runtimeContext", runtimeContextParam);
35
+ const queryString = searchParams.toString();
36
+ return queryString ? `?${queryString}` : "";
37
+ }
30
38
  function isZodType(value) {
31
39
  return typeof value === "object" && value !== null && "_def" in value && "parse" in value && typeof value.parse === "function" && "safeParse" in value && typeof value.safeParse === "function";
32
40
  }
@@ -89,7 +97,7 @@ async function sharedProcessMastraStream({
89
97
  if (line.startsWith("data: ")) {
90
98
  const data = line.slice(6);
91
99
  if (data === "[DONE]") {
92
- console.log("\u{1F3C1} Stream finished");
100
+ console.info("\u{1F3C1} Stream finished");
93
101
  return;
94
102
  }
95
103
  try {
@@ -211,7 +219,9 @@ async function executeToolCallAndRespond({
211
219
  resourceId,
212
220
  threadId,
213
221
  runtimeContext,
214
- tracingContext: { currentSpan: void 0 }
222
+ tracingContext: { currentSpan: void 0 },
223
+ suspend: async () => {
224
+ }
215
225
  },
216
226
  {
217
227
  messages: response.messages,
@@ -219,11 +229,7 @@ async function executeToolCallAndRespond({
219
229
  }
220
230
  );
221
231
  const updatedMessages = [
222
- {
223
- role: "user",
224
- content: params.messages
225
- },
226
- ...response.response.messages,
232
+ ...response.response.messages || [],
227
233
  {
228
234
  role: "tool",
229
235
  content: [
@@ -286,30 +292,20 @@ var AgentVoice = class extends BaseResource {
286
292
  /**
287
293
  * Get available speakers for the agent's voice provider
288
294
  * @param runtimeContext - Optional runtime context to pass as query parameter
295
+ * @param runtimeContext - Optional runtime context to pass as query parameter
289
296
  * @returns Promise containing list of available speakers
290
297
  */
291
298
  getSpeakers(runtimeContext) {
292
- const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
293
- const searchParams = new URLSearchParams();
294
- if (runtimeContextParam) {
295
- searchParams.set("runtimeContext", runtimeContextParam);
296
- }
297
- const queryString = searchParams.toString();
298
- return this.request(`/api/agents/${this.agentId}/voice/speakers${queryString ? `?${queryString}` : ""}`);
299
+ return this.request(`/api/agents/${this.agentId}/voice/speakers${runtimeContextQueryString(runtimeContext)}`);
299
300
  }
300
301
  /**
301
302
  * Get the listener configuration for the agent's voice provider
302
303
  * @param runtimeContext - Optional runtime context to pass as query parameter
304
+ * @param runtimeContext - Optional runtime context to pass as query parameter
303
305
  * @returns Promise containing a check if the agent has listening capabilities
304
306
  */
305
307
  getListener(runtimeContext) {
306
- const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
307
- const searchParams = new URLSearchParams();
308
- if (runtimeContextParam) {
309
- searchParams.set("runtimeContext", runtimeContextParam);
310
- }
311
- const queryString = searchParams.toString();
312
- return this.request(`/api/agents/${this.agentId}/voice/listener${queryString ? `?${queryString}` : ""}`);
308
+ return this.request(`/api/agents/${this.agentId}/voice/listener${runtimeContextQueryString(runtimeContext)}`);
313
309
  }
314
310
  };
315
311
  var Agent = class extends BaseResource {
@@ -321,23 +317,11 @@ var Agent = class extends BaseResource {
321
317
  voice;
322
318
  /**
323
319
  * Retrieves details about the agent
324
- * @param runtimeContext - Runtime context to use for the agent
320
+ * @param runtimeContext - Optional runtime context to pass as query parameter
325
321
  * @returns Promise containing agent details including model and instructions
326
322
  */
327
323
  details(runtimeContext) {
328
- const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
329
- const searchParams = new URLSearchParams();
330
- if (runtimeContextParam) {
331
- searchParams.set("runtimeContext", runtimeContextParam);
332
- }
333
- const queryString = searchParams.toString();
334
- return this.request(`/api/agents/${this.agentId}${queryString ? `?${queryString}` : ""}`);
335
- }
336
- async generate(params) {
337
- console.warn(
338
- "Deprecation NOTICE:Generate method will switch to use generateVNext implementation September 23rd, 2025. Please use generateLegacy if you don't want to upgrade just yet."
339
- );
340
- return this.generateLegacy(params);
324
+ return this.request(`/api/agents/${this.agentId}${runtimeContextQueryString(runtimeContext)}`);
341
325
  }
342
326
  async generateLegacy(params) {
343
327
  const processedParams = {
@@ -370,7 +354,9 @@ var Agent = class extends BaseResource {
370
354
  resourceId,
371
355
  threadId,
372
356
  runtimeContext,
373
- tracingContext: { currentSpan: void 0 }
357
+ tracingContext: { currentSpan: void 0 },
358
+ suspend: async () => {
359
+ }
374
360
  },
375
361
  {
376
362
  messages: response.messages,
@@ -378,10 +364,6 @@ var Agent = class extends BaseResource {
378
364
  }
379
365
  );
380
366
  const updatedMessages = [
381
- {
382
- role: "user",
383
- content: params.messages
384
- },
385
367
  ...response.response.messages,
386
368
  {
387
369
  role: "tool",
@@ -404,7 +386,16 @@ var Agent = class extends BaseResource {
404
386
  }
405
387
  return response;
406
388
  }
407
- async generateVNext(params) {
389
+ async generate(messagesOrParams, options) {
390
+ let params;
391
+ if (typeof messagesOrParams === "object" && "messages" in messagesOrParams) {
392
+ params = messagesOrParams;
393
+ } else {
394
+ params = {
395
+ messages: messagesOrParams,
396
+ ...options
397
+ };
398
+ }
408
399
  const processedParams = {
409
400
  ...params,
410
401
  output: params.output ? zodToJsonSchema(params.output) : void 0,
@@ -417,7 +408,7 @@ var Agent = class extends BaseResource {
417
408
  };
418
409
  const { runId, resourceId, threadId, runtimeContext } = processedParams;
419
410
  const response = await this.request(
420
- `/api/agents/${this.agentId}/generate/vnext`,
411
+ `/api/agents/${this.agentId}/generate`,
421
412
  {
422
413
  method: "POST",
423
414
  body: processedParams
@@ -431,7 +422,7 @@ var Agent = class extends BaseResource {
431
422
  resourceId,
432
423
  threadId,
433
424
  runtimeContext,
434
- respondFn: this.generateVNext.bind(this)
425
+ respondFn: this.generate.bind(this)
435
426
  });
436
427
  }
437
428
  return response;
@@ -698,17 +689,6 @@ var Agent = class extends BaseResource {
698
689
  });
699
690
  onFinish?.({ message, finishReason, usage });
700
691
  }
701
- /**
702
- * Streams a response from the agent
703
- * @param params - Stream parameters including prompt
704
- * @returns Promise containing the enhanced Response object with processDataStream method
705
- */
706
- async stream(params) {
707
- console.warn(
708
- "Deprecation NOTICE:\nStream method will switch to use streamVNext implementation September 23rd, 2025. Please use streamLegacy if you don't want to upgrade just yet."
709
- );
710
- return this.streamLegacy(params);
711
- }
712
692
  /**
713
693
  * Streams a response from the agent
714
694
  * @param params - Stream parameters including prompt
@@ -723,7 +703,7 @@ var Agent = class extends BaseResource {
723
703
  clientTools: processClientTools(params.clientTools)
724
704
  };
725
705
  const { readable, writable } = new TransformStream();
726
- const response = await this.processStreamResponse(processedParams, writable);
706
+ const response = await this.processStreamResponseLegacy(processedParams, writable);
727
707
  const streamResponse = new Response(readable, {
728
708
  status: response.status,
729
709
  statusText: response.statusText,
@@ -810,6 +790,14 @@ var Agent = class extends BaseResource {
810
790
  // but this is completely wrong and this fn is probably broken. Remove ":any" and you'll see a bunch of type errors
811
791
  onChunk: async (chunk) => {
812
792
  switch (chunk.type) {
793
+ case "tripwire": {
794
+ message.parts.push({
795
+ type: "text",
796
+ text: chunk.payload.tripwireReason
797
+ });
798
+ execUpdate();
799
+ break;
800
+ }
813
801
  case "step-start": {
814
802
  if (!replaceLastMessage) {
815
803
  message.id = chunk.payload.messageId;
@@ -990,8 +978,8 @@ var Agent = class extends BaseResource {
990
978
  });
991
979
  onFinish?.({ message, finishReason, usage });
992
980
  }
993
- async processStreamResponse_vNext(processedParams, writable) {
994
- const response = await this.request(`/api/agents/${this.agentId}/stream/vnext`, {
981
+ async processStreamResponse(processedParams, writable) {
982
+ const response = await this.request(`/api/agents/${this.agentId}/stream`, {
995
983
  method: "POST",
996
984
  body: processedParams,
997
985
  stream: true
@@ -1006,18 +994,17 @@ var Agent = class extends BaseResource {
1006
994
  streamForWritable.pipeTo(
1007
995
  new WritableStream({
1008
996
  async write(chunk) {
997
+ let writer;
1009
998
  try {
999
+ writer = writable.getWriter();
1010
1000
  const text = new TextDecoder().decode(chunk);
1011
- if (text.includes("[DONE]")) {
1012
- return;
1013
- }
1001
+ const lines = text.split("\n\n");
1002
+ const readableLines = lines.filter((line) => line !== "[DONE]").join("\n\n");
1003
+ await writer.write(new TextEncoder().encode(readableLines));
1014
1004
  } catch {
1015
- }
1016
- const writer = writable.getWriter();
1017
- try {
1018
- await writer.write(chunk);
1005
+ await writer?.write(chunk);
1019
1006
  } finally {
1020
- writer.releaseLock();
1007
+ writer?.releaseLock();
1021
1008
  }
1022
1009
  }
1023
1010
  }),
@@ -1043,9 +1030,11 @@ var Agent = class extends BaseResource {
1043
1030
  if (toolCall) {
1044
1031
  toolCalls.push(toolCall);
1045
1032
  }
1033
+ let shouldExecuteClientTool = false;
1046
1034
  for (const toolCall2 of toolCalls) {
1047
1035
  const clientTool = processedParams.clientTools?.[toolCall2.toolName];
1048
1036
  if (clientTool && clientTool.execute) {
1037
+ shouldExecuteClientTool = true;
1049
1038
  const result = await clientTool.execute(
1050
1039
  {
1051
1040
  context: toolCall2?.args,
@@ -1054,7 +1043,9 @@ var Agent = class extends BaseResource {
1054
1043
  threadId: processedParams.threadId,
1055
1044
  runtimeContext: processedParams.runtimeContext,
1056
1045
  // TODO: Pass proper tracing context when client-js supports tracing
1057
- tracingContext: { currentSpan: void 0 }
1046
+ tracingContext: { currentSpan: void 0 },
1047
+ suspend: async () => {
1048
+ }
1058
1049
  },
1059
1050
  {
1060
1051
  messages: response.messages,
@@ -1080,10 +1071,8 @@ var Agent = class extends BaseResource {
1080
1071
  toolInvocation.state = "result";
1081
1072
  toolInvocation.result = result;
1082
1073
  }
1083
- const originalMessages = processedParams.messages;
1084
- const messageArray = Array.isArray(originalMessages) ? originalMessages : [originalMessages];
1085
- const updatedMessages = lastMessage != null ? [...messageArray, ...messages.filter((m) => m.id !== lastMessage.id), lastMessage] : [...messageArray, ...messages];
1086
- this.processStreamResponse_vNext(
1074
+ const updatedMessages = lastMessage != null ? [...messages.filter((m) => m.id !== lastMessage.id), lastMessage] : [...messages];
1075
+ this.processStreamResponse(
1087
1076
  {
1088
1077
  ...processedParams,
1089
1078
  messages: updatedMessages
@@ -1094,6 +1083,11 @@ var Agent = class extends BaseResource {
1094
1083
  });
1095
1084
  }
1096
1085
  }
1086
+ if (!shouldExecuteClientTool) {
1087
+ setTimeout(() => {
1088
+ writable.close();
1089
+ }, 0);
1090
+ }
1097
1091
  } else {
1098
1092
  setTimeout(() => {
1099
1093
  writable.close();
@@ -1133,7 +1127,16 @@ var Agent = class extends BaseResource {
1133
1127
  };
1134
1128
  return streamResponse;
1135
1129
  }
1136
- async streamVNext(params) {
1130
+ async stream(messagesOrParams, options) {
1131
+ let params;
1132
+ if (typeof messagesOrParams === "object" && "messages" in messagesOrParams) {
1133
+ params = messagesOrParams;
1134
+ } else {
1135
+ params = {
1136
+ messages: messagesOrParams,
1137
+ ...options
1138
+ };
1139
+ }
1137
1140
  const processedParams = {
1138
1141
  ...params,
1139
1142
  output: params.output ? zodToJsonSchema(params.output) : void 0,
@@ -1145,7 +1148,7 @@ var Agent = class extends BaseResource {
1145
1148
  } : void 0
1146
1149
  };
1147
1150
  const { readable, writable } = new TransformStream();
1148
- const response = await this.processStreamResponse_vNext(processedParams, writable);
1151
+ const response = await this.processStreamResponse(processedParams, writable);
1149
1152
  const streamResponse = new Response(readable, {
1150
1153
  status: response.status,
1151
1154
  statusText: response.statusText,
@@ -1164,7 +1167,7 @@ var Agent = class extends BaseResource {
1164
1167
  /**
1165
1168
  * Processes the stream response and handles tool calls
1166
1169
  */
1167
- async processStreamResponse(processedParams, writable) {
1170
+ async processStreamResponseLegacy(processedParams, writable) {
1168
1171
  const response = await this.request(`/api/agents/${this.agentId}/stream-legacy`, {
1169
1172
  method: "POST",
1170
1173
  body: processedParams,
@@ -1209,7 +1212,9 @@ var Agent = class extends BaseResource {
1209
1212
  threadId: processedParams.threadId,
1210
1213
  runtimeContext: processedParams.runtimeContext,
1211
1214
  // TODO: Pass proper tracing context when client-js supports tracing
1212
- tracingContext: { currentSpan: void 0 }
1215
+ tracingContext: { currentSpan: void 0 },
1216
+ suspend: async () => {
1217
+ }
1213
1218
  },
1214
1219
  {
1215
1220
  messages: response.messages,
@@ -1247,12 +1252,10 @@ var Agent = class extends BaseResource {
1247
1252
  } finally {
1248
1253
  writer.releaseLock();
1249
1254
  }
1250
- const originalMessages = processedParams.messages;
1251
- const messageArray = Array.isArray(originalMessages) ? originalMessages : [originalMessages];
1252
- this.processStreamResponse(
1255
+ this.processStreamResponseLegacy(
1253
1256
  {
1254
1257
  ...processedParams,
1255
- messages: [...messageArray, ...messages.filter((m) => m.id !== lastMessage.id), lastMessage]
1258
+ messages: [...messages.filter((m) => m.id !== lastMessage.id), lastMessage]
1256
1259
  },
1257
1260
  writable
1258
1261
  ).catch((error) => {
@@ -1282,13 +1285,7 @@ var Agent = class extends BaseResource {
1282
1285
  * @returns Promise containing tool details
1283
1286
  */
1284
1287
  getTool(toolId, runtimeContext) {
1285
- const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
1286
- const searchParams = new URLSearchParams();
1287
- if (runtimeContextParam) {
1288
- searchParams.set("runtimeContext", runtimeContextParam);
1289
- }
1290
- const queryString = searchParams.toString();
1291
- return this.request(`/api/agents/${this.agentId}/tools/${toolId}${queryString ? `?${queryString}` : ""}`);
1288
+ return this.request(`/api/agents/${this.agentId}/tools/${toolId}${runtimeContextQueryString(runtimeContext)}`);
1292
1289
  }
1293
1290
  /**
1294
1291
  * Executes a tool for the agent
@@ -1312,13 +1309,7 @@ var Agent = class extends BaseResource {
1312
1309
  * @returns Promise containing agent evaluations
1313
1310
  */
1314
1311
  evals(runtimeContext) {
1315
- const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
1316
- const searchParams = new URLSearchParams();
1317
- if (runtimeContextParam) {
1318
- searchParams.set("runtimeContext", runtimeContextParam);
1319
- }
1320
- const queryString = searchParams.toString();
1321
- return this.request(`/api/agents/${this.agentId}/evals/ci${queryString ? `?${queryString}` : ""}`);
1312
+ return this.request(`/api/agents/${this.agentId}/evals/ci${runtimeContextQueryString(runtimeContext)}`);
1322
1313
  }
1323
1314
  /**
1324
1315
  * Retrieves live evaluation results for the agent
@@ -1326,13 +1317,7 @@ var Agent = class extends BaseResource {
1326
1317
  * @returns Promise containing live agent evaluations
1327
1318
  */
1328
1319
  liveEvals(runtimeContext) {
1329
- const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
1330
- const searchParams = new URLSearchParams();
1331
- if (runtimeContextParam) {
1332
- searchParams.set("runtimeContext", runtimeContextParam);
1333
- }
1334
- const queryString = searchParams.toString();
1335
- return this.request(`/api/agents/${this.agentId}/evals/live${queryString ? `?${queryString}` : ""}`);
1320
+ return this.request(`/api/agents/${this.agentId}/evals/live${runtimeContextQueryString(runtimeContext)}`);
1336
1321
  }
1337
1322
  /**
1338
1323
  * Updates the model for the agent
@@ -1345,61 +1330,33 @@ var Agent = class extends BaseResource {
1345
1330
  body: params
1346
1331
  });
1347
1332
  }
1348
- };
1349
- var Network = class extends BaseResource {
1350
- constructor(options, networkId) {
1351
- super(options);
1352
- this.networkId = networkId;
1353
- }
1354
1333
  /**
1355
- * Retrieves details about the network
1356
- * @returns Promise containing network details
1357
- */
1358
- details() {
1359
- return this.request(`/api/networks/${this.networkId}`);
1360
- }
1361
- /**
1362
- * Generates a response from the agent
1363
- * @param params - Generation parameters including prompt
1364
- * @returns Promise containing the generated response
1334
+ * Updates the model for the agent in the model list
1335
+ * @param params - Parameters for updating the model
1336
+ * @returns Promise containing the updated model
1365
1337
  */
1366
- generate(params) {
1367
- const processedParams = {
1368
- ...params,
1369
- output: zodToJsonSchema(params.output),
1370
- experimental_output: zodToJsonSchema(params.experimental_output)
1371
- };
1372
- return this.request(`/api/networks/${this.networkId}/generate`, {
1338
+ updateModelInModelList({ modelConfigId, ...params }) {
1339
+ return this.request(`/api/agents/${this.agentId}/models/${modelConfigId}`, {
1373
1340
  method: "POST",
1374
- body: processedParams
1341
+ body: params
1375
1342
  });
1376
1343
  }
1377
1344
  /**
1378
- * Streams a response from the agent
1379
- * @param params - Stream parameters including prompt
1380
- * @returns Promise containing the enhanced Response object with processDataStream method
1345
+ * Reorders the models for the agent
1346
+ * @param params - Parameters for reordering the model list
1347
+ * @returns Promise containing the updated model list
1381
1348
  */
1382
- async stream(params) {
1383
- const processedParams = {
1384
- ...params,
1385
- output: zodToJsonSchema(params.output),
1386
- experimental_output: zodToJsonSchema(params.experimental_output)
1387
- };
1388
- const response = await this.request(`/api/networks/${this.networkId}/stream`, {
1349
+ reorderModelList(params) {
1350
+ return this.request(`/api/agents/${this.agentId}/models/reorder`, {
1389
1351
  method: "POST",
1390
- body: processedParams,
1391
- stream: true
1352
+ body: params
1392
1353
  });
1393
- if (!response.body) {
1394
- throw new Error("No response body");
1395
- }
1396
- response.processDataStream = async (options = {}) => {
1397
- await uiUtils.processDataStream({
1398
- stream: response.body,
1399
- ...options
1400
- });
1401
- };
1402
- return response;
1354
+ }
1355
+ async generateVNext(_messagesOrParams, _options) {
1356
+ throw new Error("generateVNext has been renamed to generate. Please use generate instead.");
1357
+ }
1358
+ async streamVNext(_messagesOrParams, _options) {
1359
+ throw new Error("streamVNext has been renamed to stream. Please use stream instead.");
1403
1360
  }
1404
1361
  };
1405
1362
 
@@ -1490,10 +1447,13 @@ var Vector = class extends BaseResource {
1490
1447
  /**
1491
1448
  * Retrieves details about a specific vector index
1492
1449
  * @param indexName - Name of the index to get details for
1450
+ * @param runtimeContext - Optional runtime context to pass as query parameter
1493
1451
  * @returns Promise containing vector index details
1494
1452
  */
1495
- details(indexName) {
1496
- return this.request(`/api/vector/${this.vectorName}/indexes/${indexName}`);
1453
+ details(indexName, runtimeContext) {
1454
+ return this.request(
1455
+ `/api/vector/${this.vectorName}/indexes/${indexName}${runtimeContextQueryString(runtimeContext)}`
1456
+ );
1497
1457
  }
1498
1458
  /**
1499
1459
  * Deletes a vector index
@@ -1507,10 +1467,11 @@ var Vector = class extends BaseResource {
1507
1467
  }
1508
1468
  /**
1509
1469
  * Retrieves a list of all available indexes
1470
+ * @param runtimeContext - Optional runtime context to pass as query parameter
1510
1471
  * @returns Promise containing array of index names
1511
1472
  */
1512
- getIndexes() {
1513
- return this.request(`/api/vector/${this.vectorName}/indexes`);
1473
+ getIndexes(runtimeContext) {
1474
+ return this.request(`/api/vector/${this.vectorName}/indexes${runtimeContextQueryString(runtimeContext)}`);
1514
1475
  }
1515
1476
  /**
1516
1477
  * Creates a new vector index
@@ -1547,123 +1508,50 @@ var Vector = class extends BaseResource {
1547
1508
  }
1548
1509
  };
1549
1510
 
1550
- // src/resources/legacy-workflow.ts
1551
- var RECORD_SEPARATOR = "";
1552
- var LegacyWorkflow = class extends BaseResource {
1553
- constructor(options, workflowId) {
1511
+ // src/resources/tool.ts
1512
+ var Tool = class extends BaseResource {
1513
+ constructor(options, toolId) {
1554
1514
  super(options);
1555
- this.workflowId = workflowId;
1556
- }
1557
- /**
1558
- * Retrieves details about the legacy workflow
1559
- * @returns Promise containing legacy workflow details including steps and graphs
1560
- */
1561
- details() {
1562
- return this.request(`/api/workflows/legacy/${this.workflowId}`);
1563
- }
1564
- /**
1565
- * Retrieves all runs for a legacy workflow
1566
- * @param params - Parameters for filtering runs
1567
- * @returns Promise containing legacy workflow runs array
1568
- */
1569
- runs(params) {
1570
- const searchParams = new URLSearchParams();
1571
- if (params?.fromDate) {
1572
- searchParams.set("fromDate", params.fromDate.toISOString());
1573
- }
1574
- if (params?.toDate) {
1575
- searchParams.set("toDate", params.toDate.toISOString());
1576
- }
1577
- if (params?.limit) {
1578
- searchParams.set("limit", String(params.limit));
1579
- }
1580
- if (params?.offset) {
1581
- searchParams.set("offset", String(params.offset));
1582
- }
1583
- if (params?.resourceId) {
1584
- searchParams.set("resourceId", params.resourceId);
1585
- }
1586
- if (searchParams.size) {
1587
- return this.request(`/api/workflows/legacy/${this.workflowId}/runs?${searchParams}`);
1588
- } else {
1589
- return this.request(`/api/workflows/legacy/${this.workflowId}/runs`);
1590
- }
1591
- }
1592
- /**
1593
- * Creates a new legacy workflow run
1594
- * @returns Promise containing the generated run ID
1595
- */
1596
- createRun(params) {
1597
- const searchParams = new URLSearchParams();
1598
- if (!!params?.runId) {
1599
- searchParams.set("runId", params.runId);
1600
- }
1601
- return this.request(`/api/workflows/legacy/${this.workflowId}/create-run?${searchParams.toString()}`, {
1602
- method: "POST"
1603
- });
1604
- }
1605
- /**
1606
- * Starts a legacy workflow run synchronously without waiting for the workflow to complete
1607
- * @param params - Object containing the runId and triggerData
1608
- * @returns Promise containing success message
1609
- */
1610
- start(params) {
1611
- return this.request(`/api/workflows/legacy/${this.workflowId}/start?runId=${params.runId}`, {
1612
- method: "POST",
1613
- body: params?.triggerData
1614
- });
1515
+ this.toolId = toolId;
1615
1516
  }
1616
1517
  /**
1617
- * Resumes a suspended legacy workflow step synchronously without waiting for the workflow to complete
1618
- * @param stepId - ID of the step to resume
1619
- * @param runId - ID of the legacy workflow run
1620
- * @param context - Context to resume the legacy workflow with
1621
- * @returns Promise containing the legacy workflow resume results
1518
+ * Retrieves details about the tool
1519
+ * @param runtimeContext - Optional runtime context to pass as query parameter
1520
+ * @returns Promise containing tool details including description and schemas
1622
1521
  */
1623
- resume({
1624
- stepId,
1625
- runId,
1626
- context
1627
- }) {
1628
- return this.request(`/api/workflows/legacy/${this.workflowId}/resume?runId=${runId}`, {
1629
- method: "POST",
1630
- body: {
1631
- stepId,
1632
- context
1633
- }
1634
- });
1522
+ details(runtimeContext) {
1523
+ return this.request(`/api/tools/${this.toolId}${runtimeContextQueryString(runtimeContext)}`);
1635
1524
  }
1636
1525
  /**
1637
- * Starts a workflow run asynchronously and returns a promise that resolves when the workflow is complete
1638
- * @param params - Object containing the optional runId and triggerData
1639
- * @returns Promise containing the workflow execution results
1526
+ * Executes the tool with the provided parameters
1527
+ * @param params - Parameters required for tool execution
1528
+ * @returns Promise containing the tool execution results
1640
1529
  */
1641
- startAsync(params) {
1642
- const searchParams = new URLSearchParams();
1643
- if (!!params?.runId) {
1644
- searchParams.set("runId", params.runId);
1530
+ execute(params) {
1531
+ const url = new URLSearchParams();
1532
+ if (params.runId) {
1533
+ url.set("runId", params.runId);
1645
1534
  }
1646
- return this.request(`/api/workflows/legacy/${this.workflowId}/start-async?${searchParams.toString()}`, {
1535
+ const body = {
1536
+ data: params.data,
1537
+ runtimeContext: parseClientRuntimeContext(params.runtimeContext)
1538
+ };
1539
+ return this.request(`/api/tools/${this.toolId}/execute?${url.toString()}`, {
1647
1540
  method: "POST",
1648
- body: params?.triggerData
1541
+ body
1649
1542
  });
1650
1543
  }
1651
- /**
1652
- * Resumes a suspended legacy workflow step asynchronously and returns a promise that resolves when the workflow is complete
1653
- * @param params - Object containing the runId, stepId, and context
1654
- * @returns Promise containing the workflow resume results
1655
- */
1656
- resumeAsync(params) {
1657
- return this.request(`/api/workflows/legacy/${this.workflowId}/resume-async?runId=${params.runId}`, {
1658
- method: "POST",
1659
- body: {
1660
- stepId: params.stepId,
1661
- context: params.context
1662
- }
1663
- });
1544
+ };
1545
+
1546
+ // src/resources/workflow.ts
1547
+ var RECORD_SEPARATOR = "";
1548
+ var Workflow = class extends BaseResource {
1549
+ constructor(options, workflowId) {
1550
+ super(options);
1551
+ this.workflowId = workflowId;
1664
1552
  }
1665
1553
  /**
1666
- * Creates an async generator that processes a readable stream and yields records
1554
+ * Creates an async generator that processes a readable stream and yields workflow records
1667
1555
  * separated by the Record Separator character (\x1E)
1668
1556
  *
1669
1557
  * @param stream - The readable stream to process
@@ -1708,128 +1596,24 @@ var LegacyWorkflow = class extends BaseResource {
1708
1596
  }
1709
1597
  }
1710
1598
  /**
1711
- * Watches legacy workflow transitions in real-time
1712
- * @param runId - Optional run ID to filter the watch stream
1713
- * @returns AsyncGenerator that yields parsed records from the legacy workflow watch stream
1714
- */
1715
- async watch({ runId }, onRecord) {
1716
- const response = await this.request(`/api/workflows/legacy/${this.workflowId}/watch?runId=${runId}`, {
1717
- stream: true
1718
- });
1719
- if (!response.ok) {
1720
- throw new Error(`Failed to watch legacy workflow: ${response.statusText}`);
1721
- }
1722
- if (!response.body) {
1723
- throw new Error("Response body is null");
1724
- }
1725
- for await (const record of this.streamProcessor(response.body)) {
1726
- onRecord(record);
1727
- }
1728
- }
1729
- };
1730
-
1731
- // src/resources/tool.ts
1732
- var Tool = class extends BaseResource {
1733
- constructor(options, toolId) {
1734
- super(options);
1735
- this.toolId = toolId;
1736
- }
1737
- /**
1738
- * Retrieves details about the tool
1739
- * @returns Promise containing tool details including description and schemas
1599
+ * Retrieves details about the workflow
1600
+ * @param runtimeContext - Optional runtime context to pass as query parameter
1601
+ * @returns Promise containing workflow details including steps and graphs
1740
1602
  */
1741
- details() {
1742
- return this.request(`/api/tools/${this.toolId}`);
1603
+ details(runtimeContext) {
1604
+ return this.request(`/api/workflows/${this.workflowId}${runtimeContextQueryString(runtimeContext)}`);
1743
1605
  }
1744
1606
  /**
1745
- * Executes the tool with the provided parameters
1746
- * @param params - Parameters required for tool execution
1747
- * @returns Promise containing the tool execution results
1607
+ * Retrieves all runs for a workflow
1608
+ * @param params - Parameters for filtering runs
1609
+ * @param runtimeContext - Optional runtime context to pass as query parameter
1610
+ * @returns Promise containing workflow runs array
1748
1611
  */
1749
- execute(params) {
1750
- const url = new URLSearchParams();
1751
- if (params.runId) {
1752
- url.set("runId", params.runId);
1753
- }
1754
- const body = {
1755
- data: params.data,
1756
- runtimeContext: parseClientRuntimeContext(params.runtimeContext)
1757
- };
1758
- return this.request(`/api/tools/${this.toolId}/execute?${url.toString()}`, {
1759
- method: "POST",
1760
- body
1761
- });
1762
- }
1763
- };
1764
-
1765
- // src/resources/workflow.ts
1766
- var RECORD_SEPARATOR2 = "";
1767
- var Workflow = class extends BaseResource {
1768
- constructor(options, workflowId) {
1769
- super(options);
1770
- this.workflowId = workflowId;
1771
- }
1772
- /**
1773
- * Creates an async generator that processes a readable stream and yields workflow records
1774
- * separated by the Record Separator character (\x1E)
1775
- *
1776
- * @param stream - The readable stream to process
1777
- * @returns An async generator that yields parsed records
1778
- */
1779
- async *streamProcessor(stream) {
1780
- const reader = stream.getReader();
1781
- let doneReading = false;
1782
- let buffer = "";
1783
- try {
1784
- while (!doneReading) {
1785
- const { done, value } = await reader.read();
1786
- doneReading = done;
1787
- if (done && !value) continue;
1788
- try {
1789
- const decoded = value ? new TextDecoder().decode(value) : "";
1790
- const chunks = (buffer + decoded).split(RECORD_SEPARATOR2);
1791
- buffer = chunks.pop() || "";
1792
- for (const chunk of chunks) {
1793
- if (chunk) {
1794
- if (typeof chunk === "string") {
1795
- try {
1796
- const parsedChunk = JSON.parse(chunk);
1797
- yield parsedChunk;
1798
- } catch {
1799
- }
1800
- }
1801
- }
1802
- }
1803
- } catch {
1804
- }
1805
- }
1806
- if (buffer) {
1807
- try {
1808
- yield JSON.parse(buffer);
1809
- } catch {
1810
- }
1811
- }
1812
- } finally {
1813
- reader.cancel().catch(() => {
1814
- });
1815
- }
1816
- }
1817
- /**
1818
- * Retrieves details about the workflow
1819
- * @returns Promise containing workflow details including steps and graphs
1820
- */
1821
- details() {
1822
- return this.request(`/api/workflows/${this.workflowId}`);
1823
- }
1824
- /**
1825
- * Retrieves all runs for a workflow
1826
- * @param params - Parameters for filtering runs
1827
- * @returns Promise containing workflow runs array
1828
- */
1829
- runs(params) {
1830
- const searchParams = new URLSearchParams();
1831
- if (params?.fromDate) {
1832
- searchParams.set("fromDate", params.fromDate.toISOString());
1612
+ runs(params, runtimeContext) {
1613
+ const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
1614
+ const searchParams = new URLSearchParams();
1615
+ if (params?.fromDate) {
1616
+ searchParams.set("fromDate", params.fromDate.toISOString());
1833
1617
  }
1834
1618
  if (params?.toDate) {
1835
1619
  searchParams.set("toDate", params.toDate.toISOString());
@@ -1843,6 +1627,9 @@ var Workflow = class extends BaseResource {
1843
1627
  if (params?.resourceId) {
1844
1628
  searchParams.set("resourceId", params.resourceId);
1845
1629
  }
1630
+ if (runtimeContextParam) {
1631
+ searchParams.set("runtimeContext", runtimeContextParam);
1632
+ }
1846
1633
  if (searchParams.size) {
1847
1634
  return this.request(`/api/workflows/${this.workflowId}/runs?${searchParams}`);
1848
1635
  } else {
@@ -1852,18 +1639,22 @@ var Workflow = class extends BaseResource {
1852
1639
  /**
1853
1640
  * Retrieves a specific workflow run by its ID
1854
1641
  * @param runId - The ID of the workflow run to retrieve
1642
+ * @param runtimeContext - Optional runtime context to pass as query parameter
1855
1643
  * @returns Promise containing the workflow run details
1856
1644
  */
1857
- runById(runId) {
1858
- return this.request(`/api/workflows/${this.workflowId}/runs/${runId}`);
1645
+ runById(runId, runtimeContext) {
1646
+ return this.request(`/api/workflows/${this.workflowId}/runs/${runId}${runtimeContextQueryString(runtimeContext)}`);
1859
1647
  }
1860
1648
  /**
1861
1649
  * Retrieves the execution result for a specific workflow run by its ID
1862
1650
  * @param runId - The ID of the workflow run to retrieve the execution result for
1651
+ * @param runtimeContext - Optional runtime context to pass as query parameter
1863
1652
  * @returns Promise containing the workflow run execution result
1864
1653
  */
1865
- runExecutionResult(runId) {
1866
- return this.request(`/api/workflows/${this.workflowId}/runs/${runId}/execution-result`);
1654
+ runExecutionResult(runId, runtimeContext) {
1655
+ return this.request(
1656
+ `/api/workflows/${this.workflowId}/runs/${runId}/execution-result${runtimeContextQueryString(runtimeContext)}`
1657
+ );
1867
1658
  }
1868
1659
  /**
1869
1660
  * Cancels a specific workflow run by its ID
@@ -1886,27 +1677,83 @@ var Workflow = class extends BaseResource {
1886
1677
  body: { event: params.event, data: params.data }
1887
1678
  });
1888
1679
  }
1680
+ /**
1681
+ * @deprecated Use createRunAsync() instead.
1682
+ * @throws {Error} Always throws an error directing users to use createRunAsync()
1683
+ */
1684
+ async createRun(_params) {
1685
+ throw new Error(
1686
+ "createRun() has been deprecated. Please use createRunAsync() instead.\n\nMigration guide:\n Before: const run = workflow.createRun();\n After: const run = await workflow.createRunAsync();\n\nNote: createRunAsync() is an async method, so make sure your calling function is async."
1687
+ );
1688
+ }
1889
1689
  /**
1890
1690
  * Creates a new workflow run
1891
1691
  * @param params - Optional object containing the optional runId
1892
- * @returns Promise containing the runId of the created run
1692
+ * @returns Promise containing the runId of the created run with methods to control execution
1893
1693
  */
1894
- createRun(params) {
1694
+ async createRunAsync(params) {
1895
1695
  const searchParams = new URLSearchParams();
1896
1696
  if (!!params?.runId) {
1897
1697
  searchParams.set("runId", params.runId);
1898
1698
  }
1899
- return this.request(`/api/workflows/${this.workflowId}/create-run?${searchParams.toString()}`, {
1900
- method: "POST"
1901
- });
1902
- }
1903
- /**
1904
- * Creates a new workflow run (alias for createRun)
1905
- * @param params - Optional object containing the optional runId
1906
- * @returns Promise containing the runId of the created run
1907
- */
1908
- createRunAsync(params) {
1909
- return this.createRun(params);
1699
+ const res = await this.request(
1700
+ `/api/workflows/${this.workflowId}/create-run?${searchParams.toString()}`,
1701
+ {
1702
+ method: "POST"
1703
+ }
1704
+ );
1705
+ const runId = res.runId;
1706
+ return {
1707
+ runId,
1708
+ start: async (p) => {
1709
+ return this.start({
1710
+ runId,
1711
+ inputData: p.inputData,
1712
+ runtimeContext: p.runtimeContext,
1713
+ tracingOptions: p.tracingOptions
1714
+ });
1715
+ },
1716
+ startAsync: async (p) => {
1717
+ return this.startAsync({
1718
+ runId,
1719
+ inputData: p.inputData,
1720
+ runtimeContext: p.runtimeContext,
1721
+ tracingOptions: p.tracingOptions
1722
+ });
1723
+ },
1724
+ watch: async (onRecord) => {
1725
+ return this.watch({ runId }, onRecord);
1726
+ },
1727
+ stream: async (p) => {
1728
+ return this.stream({ runId, inputData: p.inputData, runtimeContext: p.runtimeContext });
1729
+ },
1730
+ resume: async (p) => {
1731
+ return this.resume({
1732
+ runId,
1733
+ step: p.step,
1734
+ resumeData: p.resumeData,
1735
+ runtimeContext: p.runtimeContext,
1736
+ tracingOptions: p.tracingOptions
1737
+ });
1738
+ },
1739
+ resumeAsync: async (p) => {
1740
+ return this.resumeAsync({
1741
+ runId,
1742
+ step: p.step,
1743
+ resumeData: p.resumeData,
1744
+ runtimeContext: p.runtimeContext,
1745
+ tracingOptions: p.tracingOptions
1746
+ });
1747
+ },
1748
+ resumeStreamVNext: async (p) => {
1749
+ return this.resumeStreamVNext({
1750
+ runId,
1751
+ step: p.step,
1752
+ resumeData: p.resumeData,
1753
+ runtimeContext: p.runtimeContext
1754
+ });
1755
+ }
1756
+ };
1910
1757
  }
1911
1758
  /**
1912
1759
  * Starts a workflow run synchronously without waiting for the workflow to complete
@@ -1917,7 +1764,7 @@ var Workflow = class extends BaseResource {
1917
1764
  const runtimeContext = parseClientRuntimeContext(params.runtimeContext);
1918
1765
  return this.request(`/api/workflows/${this.workflowId}/start?runId=${params.runId}`, {
1919
1766
  method: "POST",
1920
- body: { inputData: params?.inputData, runtimeContext }
1767
+ body: { inputData: params?.inputData, runtimeContext, tracingOptions: params.tracingOptions }
1921
1768
  });
1922
1769
  }
1923
1770
  /**
@@ -1929,16 +1776,17 @@ var Workflow = class extends BaseResource {
1929
1776
  step,
1930
1777
  runId,
1931
1778
  resumeData,
1779
+ tracingOptions,
1932
1780
  ...rest
1933
1781
  }) {
1934
1782
  const runtimeContext = parseClientRuntimeContext(rest.runtimeContext);
1935
1783
  return this.request(`/api/workflows/${this.workflowId}/resume?runId=${runId}`, {
1936
1784
  method: "POST",
1937
- stream: true,
1938
1785
  body: {
1939
1786
  step,
1940
1787
  resumeData,
1941
- runtimeContext
1788
+ runtimeContext,
1789
+ tracingOptions
1942
1790
  }
1943
1791
  });
1944
1792
  }
@@ -1955,7 +1803,7 @@ var Workflow = class extends BaseResource {
1955
1803
  const runtimeContext = parseClientRuntimeContext(params.runtimeContext);
1956
1804
  return this.request(`/api/workflows/${this.workflowId}/start-async?${searchParams.toString()}`, {
1957
1805
  method: "POST",
1958
- body: { inputData: params.inputData, runtimeContext }
1806
+ body: { inputData: params.inputData, runtimeContext, tracingOptions: params.tracingOptions }
1959
1807
  });
1960
1808
  }
1961
1809
  /**
@@ -1973,12 +1821,12 @@ var Workflow = class extends BaseResource {
1973
1821
  `/api/workflows/${this.workflowId}/stream?${searchParams.toString()}`,
1974
1822
  {
1975
1823
  method: "POST",
1976
- body: { inputData: params.inputData, runtimeContext },
1824
+ body: { inputData: params.inputData, runtimeContext, tracingOptions: params.tracingOptions },
1977
1825
  stream: true
1978
1826
  }
1979
1827
  );
1980
1828
  if (!response.ok) {
1981
- throw new Error(`Failed to stream vNext workflow: ${response.statusText}`);
1829
+ throw new Error(`Failed to stream workflow: ${response.statusText}`);
1982
1830
  }
1983
1831
  if (!response.body) {
1984
1832
  throw new Error("Response body is null");
@@ -1990,7 +1838,54 @@ var Workflow = class extends BaseResource {
1990
1838
  async transform(chunk, controller) {
1991
1839
  try {
1992
1840
  const decoded = new TextDecoder().decode(chunk);
1993
- const chunks = decoded.split(RECORD_SEPARATOR2);
1841
+ const chunks = decoded.split(RECORD_SEPARATOR);
1842
+ for (const chunk2 of chunks) {
1843
+ if (chunk2) {
1844
+ const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
1845
+ try {
1846
+ const parsedChunk = JSON.parse(newChunk);
1847
+ controller.enqueue(parsedChunk);
1848
+ failedChunk = void 0;
1849
+ } catch {
1850
+ failedChunk = newChunk;
1851
+ }
1852
+ }
1853
+ }
1854
+ } catch {
1855
+ }
1856
+ }
1857
+ });
1858
+ return response.body.pipeThrough(transformStream);
1859
+ }
1860
+ /**
1861
+ * Observes workflow stream for a workflow run
1862
+ * @param params - Object containing the runId
1863
+ * @returns Promise containing the workflow execution results
1864
+ */
1865
+ async observeStream(params) {
1866
+ const searchParams = new URLSearchParams();
1867
+ searchParams.set("runId", params.runId);
1868
+ const response = await this.request(
1869
+ `/api/workflows/${this.workflowId}/observe-stream?${searchParams.toString()}`,
1870
+ {
1871
+ method: "POST",
1872
+ stream: true
1873
+ }
1874
+ );
1875
+ if (!response.ok) {
1876
+ throw new Error(`Failed to observe workflow stream: ${response.statusText}`);
1877
+ }
1878
+ if (!response.body) {
1879
+ throw new Error("Response body is null");
1880
+ }
1881
+ let failedChunk = void 0;
1882
+ const transformStream = new TransformStream({
1883
+ start() {
1884
+ },
1885
+ async transform(chunk, controller) {
1886
+ try {
1887
+ const decoded = new TextDecoder().decode(chunk);
1888
+ const chunks = decoded.split(RECORD_SEPARATOR);
1994
1889
  for (const chunk2 of chunks) {
1995
1890
  if (chunk2) {
1996
1891
  const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
@@ -2024,7 +1919,12 @@ var Workflow = class extends BaseResource {
2024
1919
  `/api/workflows/${this.workflowId}/streamVNext?${searchParams.toString()}`,
2025
1920
  {
2026
1921
  method: "POST",
2027
- body: { inputData: params.inputData, runtimeContext },
1922
+ body: {
1923
+ inputData: params.inputData,
1924
+ runtimeContext,
1925
+ closeOnSuspend: params.closeOnSuspend,
1926
+ tracingOptions: params.tracingOptions
1927
+ },
2028
1928
  stream: true
2029
1929
  }
2030
1930
  );
@@ -2041,7 +1941,54 @@ var Workflow = class extends BaseResource {
2041
1941
  async transform(chunk, controller) {
2042
1942
  try {
2043
1943
  const decoded = new TextDecoder().decode(chunk);
2044
- const chunks = decoded.split(RECORD_SEPARATOR2);
1944
+ const chunks = decoded.split(RECORD_SEPARATOR);
1945
+ for (const chunk2 of chunks) {
1946
+ if (chunk2) {
1947
+ const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
1948
+ try {
1949
+ const parsedChunk = JSON.parse(newChunk);
1950
+ controller.enqueue(parsedChunk);
1951
+ failedChunk = void 0;
1952
+ } catch {
1953
+ failedChunk = newChunk;
1954
+ }
1955
+ }
1956
+ }
1957
+ } catch {
1958
+ }
1959
+ }
1960
+ });
1961
+ return response.body.pipeThrough(transformStream);
1962
+ }
1963
+ /**
1964
+ * Observes workflow vNext stream for a workflow run
1965
+ * @param params - Object containing the runId
1966
+ * @returns Promise containing the workflow execution results
1967
+ */
1968
+ async observeStreamVNext(params) {
1969
+ const searchParams = new URLSearchParams();
1970
+ searchParams.set("runId", params.runId);
1971
+ const response = await this.request(
1972
+ `/api/workflows/${this.workflowId}/observe-streamVNext?${searchParams.toString()}`,
1973
+ {
1974
+ method: "POST",
1975
+ stream: true
1976
+ }
1977
+ );
1978
+ if (!response.ok) {
1979
+ throw new Error(`Failed to observe stream vNext workflow: ${response.statusText}`);
1980
+ }
1981
+ if (!response.body) {
1982
+ throw new Error("Response body is null");
1983
+ }
1984
+ let failedChunk = void 0;
1985
+ const transformStream = new TransformStream({
1986
+ start() {
1987
+ },
1988
+ async transform(chunk, controller) {
1989
+ try {
1990
+ const decoded = new TextDecoder().decode(chunk);
1991
+ const chunks = decoded.split(RECORD_SEPARATOR);
2045
1992
  for (const chunk2 of chunks) {
2046
1993
  if (chunk2) {
2047
1994
  const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
@@ -2072,9 +2019,64 @@ var Workflow = class extends BaseResource {
2072
2019
  body: {
2073
2020
  step: params.step,
2074
2021
  resumeData: params.resumeData,
2075
- runtimeContext
2022
+ runtimeContext,
2023
+ tracingOptions: params.tracingOptions
2024
+ }
2025
+ });
2026
+ }
2027
+ /**
2028
+ * Resumes a suspended workflow step that uses streamVNext asynchronously and returns a promise that resolves when the workflow is complete
2029
+ * @param params - Object containing the runId, step, resumeData and runtimeContext
2030
+ * @returns Promise containing the workflow resume results
2031
+ */
2032
+ async resumeStreamVNext(params) {
2033
+ const searchParams = new URLSearchParams();
2034
+ searchParams.set("runId", params.runId);
2035
+ const runtimeContext = parseClientRuntimeContext(params.runtimeContext);
2036
+ const response = await this.request(
2037
+ `/api/workflows/${this.workflowId}/resume-stream?${searchParams.toString()}`,
2038
+ {
2039
+ method: "POST",
2040
+ body: {
2041
+ step: params.step,
2042
+ resumeData: params.resumeData,
2043
+ runtimeContext,
2044
+ tracingOptions: params.tracingOptions
2045
+ },
2046
+ stream: true
2047
+ }
2048
+ );
2049
+ if (!response.ok) {
2050
+ throw new Error(`Failed to stream vNext workflow: ${response.statusText}`);
2051
+ }
2052
+ if (!response.body) {
2053
+ throw new Error("Response body is null");
2054
+ }
2055
+ let failedChunk = void 0;
2056
+ const transformStream = new TransformStream({
2057
+ start() {
2058
+ },
2059
+ async transform(chunk, controller) {
2060
+ try {
2061
+ const decoded = new TextDecoder().decode(chunk);
2062
+ const chunks = decoded.split(RECORD_SEPARATOR);
2063
+ for (const chunk2 of chunks) {
2064
+ if (chunk2) {
2065
+ const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
2066
+ try {
2067
+ const parsedChunk = JSON.parse(newChunk);
2068
+ controller.enqueue(parsedChunk);
2069
+ failedChunk = void 0;
2070
+ } catch {
2071
+ failedChunk = newChunk;
2072
+ }
2073
+ }
2074
+ }
2075
+ } catch {
2076
+ }
2076
2077
  }
2077
2078
  });
2079
+ return response.body.pipeThrough(transformStream);
2078
2080
  }
2079
2081
  /**
2080
2082
  * Watches workflow transitions in real-time
@@ -2112,7 +2114,7 @@ var Workflow = class extends BaseResource {
2112
2114
  async start(controller) {
2113
2115
  try {
2114
2116
  for await (const record of records) {
2115
- const json = JSON.stringify(record) + RECORD_SEPARATOR2;
2117
+ const json = JSON.stringify(record) + RECORD_SEPARATOR;
2116
2118
  controller.enqueue(encoder.encode(json));
2117
2119
  }
2118
2120
  controller.close();
@@ -2210,10 +2212,11 @@ var MCPTool = class extends BaseResource {
2210
2212
  }
2211
2213
  /**
2212
2214
  * Retrieves details about this specific tool from the MCP server.
2215
+ * @param runtimeContext - Optional runtime context to pass as query parameter
2213
2216
  * @returns Promise containing the tool's information (name, description, schema).
2214
2217
  */
2215
- details() {
2216
- return this.request(`/api/mcp/${this.serverId}/tools/${this.toolId}`);
2218
+ details(runtimeContext) {
2219
+ return this.request(`/api/mcp/${this.serverId}/tools/${this.toolId}${runtimeContextQueryString(runtimeContext)}`);
2217
2220
  }
2218
2221
  /**
2219
2222
  * Executes this specific tool on the MCP server.
@@ -2234,7 +2237,7 @@ var MCPTool = class extends BaseResource {
2234
2237
  };
2235
2238
 
2236
2239
  // src/resources/agent-builder.ts
2237
- var RECORD_SEPARATOR3 = "";
2240
+ var RECORD_SEPARATOR2 = "";
2238
2241
  var AgentBuilder = class extends BaseResource {
2239
2242
  constructor(options, actionId) {
2240
2243
  super(options);
@@ -2269,11 +2272,20 @@ var AgentBuilder = class extends BaseResource {
2269
2272
  };
2270
2273
  }
2271
2274
  }
2275
+ /**
2276
+ * @deprecated Use createRunAsync() instead.
2277
+ * @throws {Error} Always throws an error directing users to use createRunAsync()
2278
+ */
2279
+ async createRun(_params) {
2280
+ throw new Error(
2281
+ "createRun() has been deprecated. Please use createRunAsync() instead.\n\nMigration guide:\n Before: const run = agentBuilder.createRun();\n After: const run = await agentBuilder.createRunAsync();\n\nNote: createRunAsync() is an async method, so make sure your calling function is async."
2282
+ );
2283
+ }
2272
2284
  /**
2273
2285
  * Creates a new agent builder action run and returns the runId.
2274
2286
  * This calls `/api/agent-builder/:actionId/create-run`.
2275
2287
  */
2276
- async createRun(params) {
2288
+ async createRunAsync(params) {
2277
2289
  const searchParams = new URLSearchParams();
2278
2290
  if (!!params?.runId) {
2279
2291
  searchParams.set("runId", params.runId);
@@ -2283,14 +2295,6 @@ var AgentBuilder = class extends BaseResource {
2283
2295
  method: "POST"
2284
2296
  });
2285
2297
  }
2286
- /**
2287
- * Creates a new workflow run (alias for createRun)
2288
- * @param params - Optional object containing the optional runId
2289
- * @returns Promise containing the runId of the created run
2290
- */
2291
- createRunAsync(params) {
2292
- return this.createRun(params);
2293
- }
2294
2298
  /**
2295
2299
  * Starts agent builder action asynchronously and waits for completion.
2296
2300
  * This calls `/api/agent-builder/:actionId/start-async`.
@@ -2373,7 +2377,7 @@ var AgentBuilder = class extends BaseResource {
2373
2377
  if (done && !value) continue;
2374
2378
  try {
2375
2379
  const decoded = value ? new TextDecoder().decode(value) : "";
2376
- const chunks = (buffer + decoded).split(RECORD_SEPARATOR3);
2380
+ const chunks = (buffer + decoded).split(RECORD_SEPARATOR2);
2377
2381
  buffer = chunks.pop() || "";
2378
2382
  for (const chunk of chunks) {
2379
2383
  if (chunk) {
@@ -2430,7 +2434,7 @@ var AgentBuilder = class extends BaseResource {
2430
2434
  async transform(chunk, controller) {
2431
2435
  try {
2432
2436
  const decoded = new TextDecoder().decode(chunk);
2433
- const chunks = decoded.split(RECORD_SEPARATOR3);
2437
+ const chunks = decoded.split(RECORD_SEPARATOR2);
2434
2438
  for (const chunk2 of chunks) {
2435
2439
  if (chunk2) {
2436
2440
  const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
@@ -2479,7 +2483,7 @@ var AgentBuilder = class extends BaseResource {
2479
2483
  async transform(chunk, controller) {
2480
2484
  try {
2481
2485
  const decoded = new TextDecoder().decode(chunk);
2482
- const chunks = decoded.split(RECORD_SEPARATOR3);
2486
+ const chunks = decoded.split(RECORD_SEPARATOR2);
2483
2487
  for (const chunk2 of chunks) {
2484
2488
  if (chunk2) {
2485
2489
  const newChunk = failedChunk ? failedChunk + chunk2 : chunk2;
@@ -2650,6 +2654,31 @@ var Observability = class extends BaseResource {
2650
2654
  const queryString = searchParams.toString();
2651
2655
  return this.request(`/api/observability/traces${queryString ? `?${queryString}` : ""}`);
2652
2656
  }
2657
+ /**
2658
+ * Retrieves scores by trace ID and span ID
2659
+ * @param params - Parameters containing trace ID, span ID, and pagination options
2660
+ * @returns Promise containing scores and pagination info
2661
+ */
2662
+ getScoresBySpan(params) {
2663
+ const { traceId, spanId, page, perPage } = params;
2664
+ const searchParams = new URLSearchParams();
2665
+ if (page !== void 0) {
2666
+ searchParams.set("page", String(page));
2667
+ }
2668
+ if (perPage !== void 0) {
2669
+ searchParams.set("perPage", String(perPage));
2670
+ }
2671
+ const queryString = searchParams.toString();
2672
+ return this.request(
2673
+ `/api/observability/traces/${encodeURIComponent(traceId)}/${encodeURIComponent(spanId)}/scores${queryString ? `?${queryString}` : ""}`
2674
+ );
2675
+ }
2676
+ score(params) {
2677
+ return this.request(`/api/observability/traces/score`, {
2678
+ method: "POST",
2679
+ body: { ...params }
2680
+ });
2681
+ }
2653
2682
  };
2654
2683
 
2655
2684
  // src/resources/network-memory-thread.ts
@@ -2715,144 +2744,6 @@ var NetworkMemoryThread = class extends BaseResource {
2715
2744
  }
2716
2745
  };
2717
2746
 
2718
- // src/resources/vNextNetwork.ts
2719
- var RECORD_SEPARATOR4 = "";
2720
- var VNextNetwork = class extends BaseResource {
2721
- constructor(options, networkId) {
2722
- super(options);
2723
- this.networkId = networkId;
2724
- }
2725
- /**
2726
- * Retrieves details about the network
2727
- * @returns Promise containing vNext network details
2728
- */
2729
- details() {
2730
- return this.request(`/api/networks/v-next/${this.networkId}`);
2731
- }
2732
- /**
2733
- * Generates a response from the v-next network
2734
- * @param params - Generation parameters including message
2735
- * @returns Promise containing the generated response
2736
- */
2737
- generate(params) {
2738
- return this.request(`/api/networks/v-next/${this.networkId}/generate`, {
2739
- method: "POST",
2740
- body: {
2741
- ...params,
2742
- runtimeContext: parseClientRuntimeContext(params.runtimeContext)
2743
- }
2744
- });
2745
- }
2746
- /**
2747
- * Generates a response from the v-next network using multiple primitives
2748
- * @param params - Generation parameters including message
2749
- * @returns Promise containing the generated response
2750
- */
2751
- loop(params) {
2752
- return this.request(`/api/networks/v-next/${this.networkId}/loop`, {
2753
- method: "POST",
2754
- body: {
2755
- ...params,
2756
- runtimeContext: parseClientRuntimeContext(params.runtimeContext)
2757
- }
2758
- });
2759
- }
2760
- async *streamProcessor(stream) {
2761
- const reader = stream.getReader();
2762
- let doneReading = false;
2763
- let buffer = "";
2764
- try {
2765
- while (!doneReading) {
2766
- const { done, value } = await reader.read();
2767
- doneReading = done;
2768
- if (done && !value) continue;
2769
- try {
2770
- const decoded = value ? new TextDecoder().decode(value) : "";
2771
- const chunks = (buffer + decoded).split(RECORD_SEPARATOR4);
2772
- buffer = chunks.pop() || "";
2773
- for (const chunk of chunks) {
2774
- if (chunk) {
2775
- if (typeof chunk === "string") {
2776
- try {
2777
- const parsedChunk = JSON.parse(chunk);
2778
- yield parsedChunk;
2779
- } catch {
2780
- }
2781
- }
2782
- }
2783
- }
2784
- } catch {
2785
- }
2786
- }
2787
- if (buffer) {
2788
- try {
2789
- yield JSON.parse(buffer);
2790
- } catch {
2791
- }
2792
- }
2793
- } finally {
2794
- reader.cancel().catch(() => {
2795
- });
2796
- }
2797
- }
2798
- /**
2799
- * Streams a response from the v-next network
2800
- * @param params - Stream parameters including message
2801
- * @returns Promise containing the results
2802
- */
2803
- async stream(params, onRecord) {
2804
- const response = await this.request(`/api/networks/v-next/${this.networkId}/stream`, {
2805
- method: "POST",
2806
- body: {
2807
- ...params,
2808
- runtimeContext: parseClientRuntimeContext(params.runtimeContext)
2809
- },
2810
- stream: true
2811
- });
2812
- if (!response.ok) {
2813
- throw new Error(`Failed to stream vNext network: ${response.statusText}`);
2814
- }
2815
- if (!response.body) {
2816
- throw new Error("Response body is null");
2817
- }
2818
- for await (const record of this.streamProcessor(response.body)) {
2819
- if (typeof record === "string") {
2820
- onRecord(JSON.parse(record));
2821
- } else {
2822
- onRecord(record);
2823
- }
2824
- }
2825
- }
2826
- /**
2827
- * Streams a response from the v-next network loop
2828
- * @param params - Stream parameters including message
2829
- * @returns Promise containing the results
2830
- */
2831
- async loopStream(params, onRecord) {
2832
- const response = await this.request(`/api/networks/v-next/${this.networkId}/loop-stream`, {
2833
- method: "POST",
2834
- body: {
2835
- ...params,
2836
- runtimeContext: parseClientRuntimeContext(params.runtimeContext)
2837
- },
2838
- stream: true
2839
- });
2840
- if (!response.ok) {
2841
- throw new Error(`Failed to stream vNext network loop: ${response.statusText}`);
2842
- }
2843
- if (!response.body) {
2844
- throw new Error("Response body is null");
2845
- }
2846
- for await (const record of this.streamProcessor(response.body)) {
2847
- if (typeof record === "string") {
2848
- onRecord(JSON.parse(record));
2849
- } else {
2850
- onRecord(record);
2851
- }
2852
- }
2853
- }
2854
- };
2855
-
2856
2747
  // src/client.ts
2857
2748
  var MastraClient = class extends BaseResource {
2858
2749
  observability;
@@ -2862,7 +2753,7 @@ var MastraClient = class extends BaseResource {
2862
2753
  }
2863
2754
  /**
2864
2755
  * Retrieves all available agents
2865
- * @param runtimeContext - Runtime context to use for the agents
2756
+ * @param runtimeContext - Optional runtime context to pass as query parameter
2866
2757
  * @returns Promise containing map of agent IDs to agent details
2867
2758
  */
2868
2759
  getAgents(runtimeContext) {
@@ -2890,6 +2781,14 @@ var MastraClient = class extends BaseResource {
2890
2781
  getMemoryThreads(params) {
2891
2782
  return this.request(`/api/memory/threads?resourceid=${params.resourceId}&agentId=${params.agentId}`);
2892
2783
  }
2784
+ /**
2785
+ * Retrieves memory config for a resource
2786
+ * @param params - Parameters containing the resource ID
2787
+ * @returns Promise containing array of memory threads
2788
+ */
2789
+ getMemoryConfig(params) {
2790
+ return this.request(`/api/memory/config?agentId=${params.agentId}`);
2791
+ }
2893
2792
  /**
2894
2793
  * Creates a new memory thread
2895
2794
  * @param params - Parameters for creating the memory thread
@@ -2906,6 +2805,24 @@ var MastraClient = class extends BaseResource {
2906
2805
  getMemoryThread(threadId, agentId) {
2907
2806
  return new MemoryThread(this.options, threadId, agentId);
2908
2807
  }
2808
+ getThreadMessages(threadId, opts = {}) {
2809
+ let url = "";
2810
+ if (opts.agentId) {
2811
+ url = `/api/memory/threads/${threadId}/messages?agentId=${opts.agentId}`;
2812
+ } else if (opts.networkId) {
2813
+ url = `/api/memory/network/threads/${threadId}/messages?networkId=${opts.networkId}`;
2814
+ }
2815
+ return this.request(url);
2816
+ }
2817
+ deleteThread(threadId, opts = {}) {
2818
+ let url = "";
2819
+ if (opts.agentId) {
2820
+ url = `/api/memory/threads/${threadId}?agentId=${opts.agentId}`;
2821
+ } else if (opts.networkId) {
2822
+ url = `/api/memory/network/threads/${threadId}?networkId=${opts.networkId}`;
2823
+ }
2824
+ return this.request(url, { method: "DELETE" });
2825
+ }
2909
2826
  /**
2910
2827
  * Saves messages to memory
2911
2828
  * @param params - Parameters containing messages to save
@@ -2968,10 +2885,17 @@ var MastraClient = class extends BaseResource {
2968
2885
  }
2969
2886
  /**
2970
2887
  * Retrieves all available tools
2888
+ * @param runtimeContext - Optional runtime context to pass as query parameter
2971
2889
  * @returns Promise containing map of tool IDs to tool details
2972
2890
  */
2973
- getTools() {
2974
- return this.request("/api/tools");
2891
+ getTools(runtimeContext) {
2892
+ const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
2893
+ const searchParams = new URLSearchParams();
2894
+ if (runtimeContextParam) {
2895
+ searchParams.set("runtimeContext", runtimeContextParam);
2896
+ }
2897
+ const queryString = searchParams.toString();
2898
+ return this.request(`/api/tools${queryString ? `?${queryString}` : ""}`);
2975
2899
  }
2976
2900
  /**
2977
2901
  * Gets a tool instance by ID
@@ -2981,27 +2905,19 @@ var MastraClient = class extends BaseResource {
2981
2905
  getTool(toolId) {
2982
2906
  return new Tool(this.options, toolId);
2983
2907
  }
2984
- /**
2985
- * Retrieves all available legacy workflows
2986
- * @returns Promise containing map of legacy workflow IDs to legacy workflow details
2987
- */
2988
- getLegacyWorkflows() {
2989
- return this.request("/api/workflows/legacy");
2990
- }
2991
- /**
2992
- * Gets a legacy workflow instance by ID
2993
- * @param workflowId - ID of the legacy workflow to retrieve
2994
- * @returns Legacy Workflow instance
2995
- */
2996
- getLegacyWorkflow(workflowId) {
2997
- return new LegacyWorkflow(this.options, workflowId);
2998
- }
2999
2908
  /**
3000
2909
  * Retrieves all available workflows
2910
+ * @param runtimeContext - Optional runtime context to pass as query parameter
3001
2911
  * @returns Promise containing map of workflow IDs to workflow details
3002
2912
  */
3003
- getWorkflows() {
3004
- return this.request("/api/workflows");
2913
+ getWorkflows(runtimeContext) {
2914
+ const runtimeContextParam = base64RuntimeContext(parseClientRuntimeContext(runtimeContext));
2915
+ const searchParams = new URLSearchParams();
2916
+ if (runtimeContextParam) {
2917
+ searchParams.set("runtimeContext", runtimeContextParam);
2918
+ }
2919
+ const queryString = searchParams.toString();
2920
+ return this.request(`/api/workflows${queryString ? `?${queryString}` : ""}`);
3005
2921
  }
3006
2922
  /**
3007
2923
  * Gets a workflow instance by ID
@@ -3169,36 +3085,6 @@ var MastraClient = class extends BaseResource {
3169
3085
  return this.request(`/api/telemetry`);
3170
3086
  }
3171
3087
  }
3172
- /**
3173
- * Retrieves all available networks
3174
- * @returns Promise containing map of network IDs to network details
3175
- */
3176
- getNetworks() {
3177
- return this.request("/api/networks");
3178
- }
3179
- /**
3180
- * Retrieves all available vNext networks
3181
- * @returns Promise containing map of vNext network IDs to vNext network details
3182
- */
3183
- getVNextNetworks() {
3184
- return this.request("/api/networks/v-next");
3185
- }
3186
- /**
3187
- * Gets a network instance by ID
3188
- * @param networkId - ID of the network to retrieve
3189
- * @returns Network instance
3190
- */
3191
- getNetwork(networkId) {
3192
- return new Network(this.options, networkId);
3193
- }
3194
- /**
3195
- * Gets a vNext network instance by ID
3196
- * @param networkId - ID of the vNext network to retrieve
3197
- * @returns vNext Network instance
3198
- */
3199
- getVNextNetwork(networkId) {
3200
- return new VNextNetwork(this.options, networkId);
3201
- }
3202
3088
  /**
3203
3089
  * Retrieves a list of available MCP servers.
3204
3090
  * @param params - Optional parameters for pagination (limit, offset).
@@ -3303,7 +3189,7 @@ var MastraClient = class extends BaseResource {
3303
3189
  * @returns Promise containing the scorer
3304
3190
  */
3305
3191
  getScorer(scorerId) {
3306
- return this.request(`/api/scores/scorers/${scorerId}`);
3192
+ return this.request(`/api/scores/scorers/${encodeURIComponent(scorerId)}`);
3307
3193
  }
3308
3194
  getScoresByScorerId(params) {
3309
3195
  const { page, perPage, scorerId, entityId, entityType } = params;
@@ -3321,7 +3207,7 @@ var MastraClient = class extends BaseResource {
3321
3207
  searchParams.set("perPage", String(perPage));
3322
3208
  }
3323
3209
  const queryString = searchParams.toString();
3324
- return this.request(`/api/scores/scorer/${scorerId}${queryString ? `?${queryString}` : ""}`);
3210
+ return this.request(`/api/scores/scorer/${encodeURIComponent(scorerId)}${queryString ? `?${queryString}` : ""}`);
3325
3211
  }
3326
3212
  /**
3327
3213
  * Retrieves scores by run ID
@@ -3338,7 +3224,7 @@ var MastraClient = class extends BaseResource {
3338
3224
  searchParams.set("perPage", String(perPage));
3339
3225
  }
3340
3226
  const queryString = searchParams.toString();
3341
- return this.request(`/api/scores/run/${runId}${queryString ? `?${queryString}` : ""}`);
3227
+ return this.request(`/api/scores/run/${encodeURIComponent(runId)}${queryString ? `?${queryString}` : ""}`);
3342
3228
  }
3343
3229
  /**
3344
3230
  * Retrieves scores by entity ID and type
@@ -3355,7 +3241,9 @@ var MastraClient = class extends BaseResource {
3355
3241
  searchParams.set("perPage", String(perPage));
3356
3242
  }
3357
3243
  const queryString = searchParams.toString();
3358
- return this.request(`/api/scores/entity/${entityType}/${entityId}${queryString ? `?${queryString}` : ""}`);
3244
+ return this.request(
3245
+ `/api/scores/entity/${encodeURIComponent(entityType)}/${encodeURIComponent(entityId)}${queryString ? `?${queryString}` : ""}`
3246
+ );
3359
3247
  }
3360
3248
  /**
3361
3249
  * Saves a score
@@ -3381,8 +3269,35 @@ var MastraClient = class extends BaseResource {
3381
3269
  getAITraces(params) {
3382
3270
  return this.observability.getTraces(params);
3383
3271
  }
3272
+ getScoresBySpan(params) {
3273
+ return this.observability.getScoresBySpan(params);
3274
+ }
3275
+ score(params) {
3276
+ return this.observability.score(params);
3277
+ }
3278
+ };
3279
+
3280
+ // src/tools.ts
3281
+ var ClientTool = class {
3282
+ id;
3283
+ description;
3284
+ inputSchema;
3285
+ outputSchema;
3286
+ execute;
3287
+ constructor(opts) {
3288
+ this.id = opts.id;
3289
+ this.description = opts.description;
3290
+ this.inputSchema = opts.inputSchema;
3291
+ this.outputSchema = opts.outputSchema;
3292
+ this.execute = opts.execute;
3293
+ }
3384
3294
  };
3295
+ function createTool(opts) {
3296
+ return new ClientTool(opts);
3297
+ }
3385
3298
 
3299
+ exports.ClientTool = ClientTool;
3386
3300
  exports.MastraClient = MastraClient;
3301
+ exports.createTool = createTool;
3387
3302
  //# sourceMappingURL=index.cjs.map
3388
3303
  //# sourceMappingURL=index.cjs.map