@mastra/server 1.2.0 → 1.2.1-alpha.0

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 (140) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/{chunk-SEE2MAOJ.cjs → chunk-2IASKDHI.cjs} +6 -6
  3. package/dist/{chunk-SEE2MAOJ.cjs.map → chunk-2IASKDHI.cjs.map} +1 -1
  4. package/dist/{chunk-LTEIJ6D3.js → chunk-3BLDCVOI.js} +35 -10
  5. package/dist/chunk-3BLDCVOI.js.map +1 -0
  6. package/dist/{chunk-T4ZBRGJU.cjs → chunk-54WM3ARZ.cjs} +5 -5
  7. package/dist/{chunk-T4ZBRGJU.cjs.map → chunk-54WM3ARZ.cjs.map} +1 -1
  8. package/dist/{chunk-W7AZENC3.cjs → chunk-74IA7XCM.cjs} +9 -3
  9. package/dist/chunk-74IA7XCM.cjs.map +1 -0
  10. package/dist/chunk-C6BYMRIF.js +439 -0
  11. package/dist/chunk-C6BYMRIF.js.map +1 -0
  12. package/dist/{chunk-GQJJSFM3.cjs → chunk-C6OV4GNV.cjs} +12 -5
  13. package/dist/chunk-C6OV4GNV.cjs.map +1 -0
  14. package/dist/{chunk-FJTSBRYT.js → chunk-EBEU6MV3.js} +3 -3
  15. package/dist/{chunk-FJTSBRYT.js.map → chunk-EBEU6MV3.js.map} +1 -1
  16. package/dist/{chunk-7D3UAMQM.cjs → chunk-FPURK3UW.cjs} +4 -4
  17. package/dist/{chunk-7D3UAMQM.cjs.map → chunk-FPURK3UW.cjs.map} +1 -1
  18. package/dist/{chunk-OBH5ZLNK.js → chunk-HJHEELUG.js} +9 -3
  19. package/dist/chunk-HJHEELUG.js.map +1 -0
  20. package/dist/chunk-HKFP7TIK.cjs +441 -0
  21. package/dist/chunk-HKFP7TIK.cjs.map +1 -0
  22. package/dist/{chunk-DHDVJ5II.js → chunk-I6K3MJW2.js} +98 -3
  23. package/dist/chunk-I6K3MJW2.js.map +1 -0
  24. package/dist/{chunk-32IP4IQQ.js → chunk-IR2DWZGV.js} +27 -11
  25. package/dist/chunk-IR2DWZGV.js.map +1 -0
  26. package/dist/{chunk-Z3ZWANXZ.js → chunk-JXDIK7K7.js} +1063 -679
  27. package/dist/chunk-JXDIK7K7.js.map +1 -0
  28. package/dist/{chunk-2ABZICAN.cjs → chunk-KNIAR5I2.cjs} +1068 -684
  29. package/dist/chunk-KNIAR5I2.cjs.map +1 -0
  30. package/dist/{chunk-TGPGUUET.js → chunk-KTQFUXEE.js} +3 -3
  31. package/dist/{chunk-TGPGUUET.js.map → chunk-KTQFUXEE.js.map} +1 -1
  32. package/dist/{chunk-CAPYNS3W.cjs → chunk-LJD67EMO.cjs} +6 -6
  33. package/dist/{chunk-CAPYNS3W.cjs.map → chunk-LJD67EMO.cjs.map} +1 -1
  34. package/dist/{chunk-ZVYEL4VO.js → chunk-MF2CQT4X.js} +3 -3
  35. package/dist/{chunk-ZVYEL4VO.js.map → chunk-MF2CQT4X.js.map} +1 -1
  36. package/dist/{chunk-2HOMKKY4.cjs → chunk-MHBKTVTG.cjs} +100 -2
  37. package/dist/chunk-MHBKTVTG.cjs.map +1 -0
  38. package/dist/{chunk-E2JHVKGO.cjs → chunk-N5NS4BZP.cjs} +4 -4
  39. package/dist/{chunk-E2JHVKGO.cjs.map → chunk-N5NS4BZP.cjs.map} +1 -1
  40. package/dist/{chunk-WK2FRQEW.cjs → chunk-PRPEYHPF.cjs} +83 -67
  41. package/dist/chunk-PRPEYHPF.cjs.map +1 -0
  42. package/dist/{chunk-K4HSW5ZF.js → chunk-PWAXLHKP.js} +4 -4
  43. package/dist/{chunk-K4HSW5ZF.js.map → chunk-PWAXLHKP.js.map} +1 -1
  44. package/dist/{chunk-ZWYF2ADF.cjs → chunk-Q34I6QR2.cjs} +35 -10
  45. package/dist/chunk-Q34I6QR2.cjs.map +1 -0
  46. package/dist/{chunk-DURK4Z3A.js → chunk-T3RJ7II4.js} +17 -5
  47. package/dist/chunk-T3RJ7II4.js.map +1 -0
  48. package/dist/{chunk-7PYTUOM6.js → chunk-UXE2DSZR.js} +3 -3
  49. package/dist/{chunk-7PYTUOM6.js.map → chunk-UXE2DSZR.js.map} +1 -1
  50. package/dist/{chunk-OGSBJMPX.cjs → chunk-Y7IJYWO5.cjs} +28 -16
  51. package/dist/chunk-Y7IJYWO5.cjs.map +1 -0
  52. package/dist/{chunk-ZIAEKNPT.js → chunk-YMTY7TNF.js} +11 -4
  53. package/dist/chunk-YMTY7TNF.js.map +1 -0
  54. package/dist/docs/SKILL.md +16 -20
  55. package/dist/docs/{SOURCE_MAP.json → assets/SOURCE_MAP.json} +1 -1
  56. package/dist/docs/{server/01-custom-adapters.md → references/docs-server-custom-adapters.md} +25 -31
  57. package/dist/docs/references/reference-server-create-route.md +260 -0
  58. package/dist/docs/references/reference-server-mastra-server.md +298 -0
  59. package/dist/docs/references/reference-server-routes.md +306 -0
  60. package/dist/server/handlers/a2a.cjs +9 -9
  61. package/dist/server/handlers/a2a.js +1 -1
  62. package/dist/server/handlers/agent-builder.cjs +16 -16
  63. package/dist/server/handlers/agent-builder.js +1 -1
  64. package/dist/server/handlers/agent-versions.cjs +14 -14
  65. package/dist/server/handlers/agent-versions.d.ts +17 -0
  66. package/dist/server/handlers/agent-versions.d.ts.map +1 -1
  67. package/dist/server/handlers/agent-versions.js +1 -1
  68. package/dist/server/handlers/agents.cjs +32 -32
  69. package/dist/server/handlers/agents.d.ts.map +1 -1
  70. package/dist/server/handlers/agents.js +1 -1
  71. package/dist/server/handlers/scores.cjs +7 -7
  72. package/dist/server/handlers/scores.js +1 -1
  73. package/dist/server/handlers/stored-agents.cjs +6 -6
  74. package/dist/server/handlers/stored-agents.d.ts +65 -1
  75. package/dist/server/handlers/stored-agents.d.ts.map +1 -1
  76. package/dist/server/handlers/stored-agents.js +1 -1
  77. package/dist/server/handlers/tools.cjs +6 -6
  78. package/dist/server/handlers/tools.js +1 -1
  79. package/dist/server/handlers/vector.cjs +25 -13
  80. package/dist/server/handlers/vector.d.ts +25 -0
  81. package/dist/server/handlers/vector.d.ts.map +1 -1
  82. package/dist/server/handlers/vector.js +1 -1
  83. package/dist/server/handlers/voice.cjs +8 -8
  84. package/dist/server/handlers/voice.js +1 -1
  85. package/dist/server/handlers/workspace.cjs +26 -26
  86. package/dist/server/handlers/workspace.d.ts +8 -0
  87. package/dist/server/handlers/workspace.d.ts.map +1 -1
  88. package/dist/server/handlers/workspace.js +1 -1
  89. package/dist/server/handlers.cjs +14 -14
  90. package/dist/server/handlers.js +7 -7
  91. package/dist/server/schemas/agent-versions.d.ts +397 -7
  92. package/dist/server/schemas/agent-versions.d.ts.map +1 -1
  93. package/dist/server/schemas/memory-config.d.ts +51 -1
  94. package/dist/server/schemas/memory-config.d.ts.map +1 -1
  95. package/dist/server/schemas/stored-agents.d.ts +444 -8
  96. package/dist/server/schemas/stored-agents.d.ts.map +1 -1
  97. package/dist/server/schemas/vectors.d.ts +74 -0
  98. package/dist/server/schemas/vectors.d.ts.map +1 -1
  99. package/dist/server/schemas/workspace.d.ts +60 -0
  100. package/dist/server/schemas/workspace.d.ts.map +1 -1
  101. package/dist/server/server-adapter/index.cjs +93 -91
  102. package/dist/server/server-adapter/index.cjs.map +1 -1
  103. package/dist/server/server-adapter/index.js +13 -11
  104. package/dist/server/server-adapter/index.js.map +1 -1
  105. package/dist/server/server-adapter/routes/vectors.d.ts.map +1 -1
  106. package/dist/{token-6GSAFR2W-WGTMOPEU-JKP67ZX4.js → token-APYSY3BW-2DN6RAUY-6HYAXQSH.js} +11 -11
  107. package/dist/token-APYSY3BW-2DN6RAUY-6HYAXQSH.js.map +1 -0
  108. package/dist/{token-6GSAFR2W-WGTMOPEU-6HSZQUFZ.cjs → token-APYSY3BW-2DN6RAUY-BRZXW5U7.cjs} +14 -14
  109. package/dist/token-APYSY3BW-2DN6RAUY-BRZXW5U7.cjs.map +1 -0
  110. package/dist/token-util-RMHT2CPJ-RJEA3FAN-QWMGWKPO.js +8 -0
  111. package/dist/token-util-RMHT2CPJ-RJEA3FAN-QWMGWKPO.js.map +1 -0
  112. package/dist/token-util-RMHT2CPJ-RJEA3FAN-ZUFKWLV7.cjs +10 -0
  113. package/dist/token-util-RMHT2CPJ-RJEA3FAN-ZUFKWLV7.cjs.map +1 -0
  114. package/package.json +4 -4
  115. package/dist/chunk-24SISJRB.js +0 -250
  116. package/dist/chunk-24SISJRB.js.map +0 -1
  117. package/dist/chunk-2ABZICAN.cjs.map +0 -1
  118. package/dist/chunk-2HOMKKY4.cjs.map +0 -1
  119. package/dist/chunk-32IP4IQQ.js.map +0 -1
  120. package/dist/chunk-DHDVJ5II.js.map +0 -1
  121. package/dist/chunk-DURK4Z3A.js.map +0 -1
  122. package/dist/chunk-GQJJSFM3.cjs.map +0 -1
  123. package/dist/chunk-LTEIJ6D3.js.map +0 -1
  124. package/dist/chunk-OBH5ZLNK.js.map +0 -1
  125. package/dist/chunk-OGSBJMPX.cjs.map +0 -1
  126. package/dist/chunk-PWXUI3OG.cjs +0 -252
  127. package/dist/chunk-PWXUI3OG.cjs.map +0 -1
  128. package/dist/chunk-W7AZENC3.cjs.map +0 -1
  129. package/dist/chunk-WK2FRQEW.cjs.map +0 -1
  130. package/dist/chunk-Z3ZWANXZ.js.map +0 -1
  131. package/dist/chunk-ZIAEKNPT.js.map +0 -1
  132. package/dist/chunk-ZWYF2ADF.cjs.map +0 -1
  133. package/dist/docs/README.md +0 -31
  134. package/dist/docs/server/02-reference.md +0 -833
  135. package/dist/token-6GSAFR2W-WGTMOPEU-6HSZQUFZ.cjs.map +0 -1
  136. package/dist/token-6GSAFR2W-WGTMOPEU-JKP67ZX4.js.map +0 -1
  137. package/dist/token-util-NEHG7TUY-TV2H7N56-GGCGMPDG.js +0 -8
  138. package/dist/token-util-NEHG7TUY-TV2H7N56-GGCGMPDG.js.map +0 -1
  139. package/dist/token-util-NEHG7TUY-TV2H7N56-R7OENTCJ.cjs +0 -10
  140. package/dist/token-util-NEHG7TUY-TV2H7N56-R7OENTCJ.cjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { __commonJS as __commonJS$3, require_token_error as require_token_error$2, __toESM as __toESM$3 } from './chunk-RIX6WEJ2.js';
2
2
  import { __commonJS as __commonJS$1, require_token_error, __toESM } from './chunk-XKLJYRAA.js';
3
- import { __commonJS as __commonJS$2, require_token_error as require_token_error$1, __toESM as __toESM$1 } from './chunk-K4HSW5ZF.js';
3
+ import { __commonJS as __commonJS$2, require_token_error as require_token_error$1, __toESM as __toESM$1 } from './chunk-PWAXLHKP.js';
4
4
  import { e } from './chunk-3NG2FRSI.js';
5
5
  import { openai } from './chunk-LOA7RQYO.js';
6
6
  import { listWorkflowsResponseSchema, LIST_WORKFLOWS_ROUTE, workflowInfoSchema, GET_WORKFLOW_BY_ID_ROUTE, workflowRunsResponseSchema, listWorkflowRunsQuerySchema, LIST_WORKFLOW_RUNS_ROUTE, workflowRunResultSchema, workflowRunResultQuerySchema, GET_WORKFLOW_RUN_BY_ID_ROUTE, createWorkflowRunResponseSchema, CREATE_WORKFLOW_RUN_ROUTE, streamWorkflowBodySchema, STREAM_WORKFLOW_ROUTE, workflowExecutionResultSchema, startAsyncWorkflowBodySchema, START_ASYNC_WORKFLOW_ROUTE, workflowControlResponseSchema, START_WORKFLOW_RUN_ROUTE, OBSERVE_STREAM_WORKFLOW_ROUTE, resumeBodySchema, RESUME_ASYNC_WORKFLOW_ROUTE, RESUME_WORKFLOW_ROUTE, RESUME_STREAM_WORKFLOW_ROUTE, CANCEL_WORKFLOW_RUN_ROUTE, streamLegacyWorkflowBodySchema, STREAM_LEGACY_WORKFLOW_ROUTE, OBSERVE_STREAM_LEGACY_WORKFLOW_ROUTE } from './chunk-MSI7KYQL.js';
@@ -13,10 +13,10 @@ import { HTTPException } from './chunk-6QWQZI4Q.js';
13
13
  import { __commonJS, __export, __toESM as __toESM$2 } from './chunk-PR4QN5HX.js';
14
14
  import { Agent, isSupportedLanguageModel, tryGenerateWithJsonFallback, tryStreamWithJsonFallback, MessageList } from '@mastra/core/agent';
15
15
  import { InMemoryStore } from '@mastra/core/storage';
16
- import z18, { z, ZodObject, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$1 } from 'zod';
16
+ import { ZodFirstPartyTypeKind } from 'zod/v3';
17
+ import z18, { z, ZodObject } from 'zod';
17
18
  import * as z42 from 'zod/v4';
18
19
  import { z as z$1 } from 'zod/v4';
19
- import { ZodFirstPartyTypeKind } from 'zod/v3';
20
20
  import { coreFeatures } from '@mastra/core/features';
21
21
  import { MastraMemory, removeWorkingMemoryTags, extractWorkingMemoryContent } from '@mastra/core/memory';
22
22
  import { generateEmptyFromSchema } from '@mastra/core/utils';
@@ -3823,7 +3823,7 @@ var require_code2 = __commonJS5({
3823
3823
  return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
3824
3824
  }
3825
3825
  exports$1.schemaProperties = schemaProperties;
3826
- function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
3826
+ function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context2, passSchema) {
3827
3827
  const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
3828
3828
  const valCxt = [
3829
3829
  [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],
@@ -3834,7 +3834,7 @@ var require_code2 = __commonJS5({
3834
3834
  if (it.opts.dynamicRef)
3835
3835
  valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
3836
3836
  const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
3837
- return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`;
3837
+ return context2 !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context2}, ${args})` : (0, codegen_1._)`${func}(${args})`;
3838
3838
  }
3839
3839
  exports$1.callValidateCode = callValidateCode;
3840
3840
  var newRegExp = (0, codegen_1._)`new RegExp`;
@@ -9802,7 +9802,7 @@ function parseArrayDef2(def, refs) {
9802
9802
  const res = {
9803
9803
  type: "array"
9804
9804
  };
9805
- if (def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind$1.ZodAny) {
9805
+ if (def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind.ZodAny) {
9806
9806
  res.items = parseDef2(def.type._def, {
9807
9807
  ...refs,
9808
9808
  currentPath: [...refs.currentPath, "items"]
@@ -10319,7 +10319,7 @@ function parseRecordDef2(def, refs) {
10319
10319
  if (refs.target === "openAi") {
10320
10320
  console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
10321
10321
  }
10322
- if (refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind$1.ZodEnum) {
10322
+ if (refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
10323
10323
  return {
10324
10324
  type: "object",
10325
10325
  required: def.keyType._def.values,
@@ -10343,20 +10343,20 @@ function parseRecordDef2(def, refs) {
10343
10343
  if (refs.target === "openApi3") {
10344
10344
  return schema;
10345
10345
  }
10346
- if (def.keyType?._def.typeName === ZodFirstPartyTypeKind$1.ZodString && def.keyType._def.checks?.length) {
10346
+ if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
10347
10347
  const { type, ...keyType } = parseStringDef2(def.keyType._def, refs);
10348
10348
  return {
10349
10349
  ...schema,
10350
10350
  propertyNames: keyType
10351
10351
  };
10352
- } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind$1.ZodEnum) {
10352
+ } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
10353
10353
  return {
10354
10354
  ...schema,
10355
10355
  propertyNames: {
10356
10356
  enum: def.keyType._def.values
10357
10357
  }
10358
10358
  };
10359
- } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind$1.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind$1.ZodString && def.keyType._def.type._def.checks?.length) {
10359
+ } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
10360
10360
  const { type, ...keyType } = parseBrandedDef2(def.keyType._def, refs);
10361
10361
  return {
10362
10362
  ...schema,
@@ -10722,73 +10722,73 @@ var parseReadonlyDef2 = (def, refs) => {
10722
10722
  };
10723
10723
  var selectParser2 = (def, typeName, refs) => {
10724
10724
  switch (typeName) {
10725
- case ZodFirstPartyTypeKind$1.ZodString:
10725
+ case ZodFirstPartyTypeKind.ZodString:
10726
10726
  return parseStringDef2(def, refs);
10727
- case ZodFirstPartyTypeKind$1.ZodNumber:
10727
+ case ZodFirstPartyTypeKind.ZodNumber:
10728
10728
  return parseNumberDef2(def, refs);
10729
- case ZodFirstPartyTypeKind$1.ZodObject:
10729
+ case ZodFirstPartyTypeKind.ZodObject:
10730
10730
  return parseObjectDef2(def, refs);
10731
- case ZodFirstPartyTypeKind$1.ZodBigInt:
10731
+ case ZodFirstPartyTypeKind.ZodBigInt:
10732
10732
  return parseBigintDef2(def, refs);
10733
- case ZodFirstPartyTypeKind$1.ZodBoolean:
10733
+ case ZodFirstPartyTypeKind.ZodBoolean:
10734
10734
  return parseBooleanDef2();
10735
- case ZodFirstPartyTypeKind$1.ZodDate:
10735
+ case ZodFirstPartyTypeKind.ZodDate:
10736
10736
  return parseDateDef2(def, refs);
10737
- case ZodFirstPartyTypeKind$1.ZodUndefined:
10737
+ case ZodFirstPartyTypeKind.ZodUndefined:
10738
10738
  return parseUndefinedDef2(refs);
10739
- case ZodFirstPartyTypeKind$1.ZodNull:
10739
+ case ZodFirstPartyTypeKind.ZodNull:
10740
10740
  return parseNullDef2(refs);
10741
- case ZodFirstPartyTypeKind$1.ZodArray:
10741
+ case ZodFirstPartyTypeKind.ZodArray:
10742
10742
  return parseArrayDef2(def, refs);
10743
- case ZodFirstPartyTypeKind$1.ZodUnion:
10744
- case ZodFirstPartyTypeKind$1.ZodDiscriminatedUnion:
10743
+ case ZodFirstPartyTypeKind.ZodUnion:
10744
+ case ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
10745
10745
  return parseUnionDef2(def, refs);
10746
- case ZodFirstPartyTypeKind$1.ZodIntersection:
10746
+ case ZodFirstPartyTypeKind.ZodIntersection:
10747
10747
  return parseIntersectionDef2(def, refs);
10748
- case ZodFirstPartyTypeKind$1.ZodTuple:
10748
+ case ZodFirstPartyTypeKind.ZodTuple:
10749
10749
  return parseTupleDef2(def, refs);
10750
- case ZodFirstPartyTypeKind$1.ZodRecord:
10750
+ case ZodFirstPartyTypeKind.ZodRecord:
10751
10751
  return parseRecordDef2(def, refs);
10752
- case ZodFirstPartyTypeKind$1.ZodLiteral:
10752
+ case ZodFirstPartyTypeKind.ZodLiteral:
10753
10753
  return parseLiteralDef2(def, refs);
10754
- case ZodFirstPartyTypeKind$1.ZodEnum:
10754
+ case ZodFirstPartyTypeKind.ZodEnum:
10755
10755
  return parseEnumDef2(def);
10756
- case ZodFirstPartyTypeKind$1.ZodNativeEnum:
10756
+ case ZodFirstPartyTypeKind.ZodNativeEnum:
10757
10757
  return parseNativeEnumDef2(def);
10758
- case ZodFirstPartyTypeKind$1.ZodNullable:
10758
+ case ZodFirstPartyTypeKind.ZodNullable:
10759
10759
  return parseNullableDef2(def, refs);
10760
- case ZodFirstPartyTypeKind$1.ZodOptional:
10760
+ case ZodFirstPartyTypeKind.ZodOptional:
10761
10761
  return parseOptionalDef2(def, refs);
10762
- case ZodFirstPartyTypeKind$1.ZodMap:
10762
+ case ZodFirstPartyTypeKind.ZodMap:
10763
10763
  return parseMapDef2(def, refs);
10764
- case ZodFirstPartyTypeKind$1.ZodSet:
10764
+ case ZodFirstPartyTypeKind.ZodSet:
10765
10765
  return parseSetDef2(def, refs);
10766
- case ZodFirstPartyTypeKind$1.ZodLazy:
10766
+ case ZodFirstPartyTypeKind.ZodLazy:
10767
10767
  return () => def.getter()._def;
10768
- case ZodFirstPartyTypeKind$1.ZodPromise:
10768
+ case ZodFirstPartyTypeKind.ZodPromise:
10769
10769
  return parsePromiseDef2(def, refs);
10770
- case ZodFirstPartyTypeKind$1.ZodNaN:
10771
- case ZodFirstPartyTypeKind$1.ZodNever:
10770
+ case ZodFirstPartyTypeKind.ZodNaN:
10771
+ case ZodFirstPartyTypeKind.ZodNever:
10772
10772
  return parseNeverDef2(refs);
10773
- case ZodFirstPartyTypeKind$1.ZodEffects:
10773
+ case ZodFirstPartyTypeKind.ZodEffects:
10774
10774
  return parseEffectsDef2(def, refs);
10775
- case ZodFirstPartyTypeKind$1.ZodAny:
10775
+ case ZodFirstPartyTypeKind.ZodAny:
10776
10776
  return parseAnyDef2(refs);
10777
- case ZodFirstPartyTypeKind$1.ZodUnknown:
10777
+ case ZodFirstPartyTypeKind.ZodUnknown:
10778
10778
  return parseUnknownDef2(refs);
10779
- case ZodFirstPartyTypeKind$1.ZodDefault:
10779
+ case ZodFirstPartyTypeKind.ZodDefault:
10780
10780
  return parseDefaultDef2(def, refs);
10781
- case ZodFirstPartyTypeKind$1.ZodBranded:
10781
+ case ZodFirstPartyTypeKind.ZodBranded:
10782
10782
  return parseBrandedDef2(def, refs);
10783
- case ZodFirstPartyTypeKind$1.ZodReadonly:
10783
+ case ZodFirstPartyTypeKind.ZodReadonly:
10784
10784
  return parseReadonlyDef2(def, refs);
10785
- case ZodFirstPartyTypeKind$1.ZodCatch:
10785
+ case ZodFirstPartyTypeKind.ZodCatch:
10786
10786
  return parseCatchDef2(def, refs);
10787
- case ZodFirstPartyTypeKind$1.ZodPipeline:
10787
+ case ZodFirstPartyTypeKind.ZodPipeline:
10788
10788
  return parsePipelineDef2(def, refs);
10789
- case ZodFirstPartyTypeKind$1.ZodFunction:
10790
- case ZodFirstPartyTypeKind$1.ZodVoid:
10791
- case ZodFirstPartyTypeKind$1.ZodSymbol:
10789
+ case ZodFirstPartyTypeKind.ZodFunction:
10790
+ case ZodFirstPartyTypeKind.ZodVoid:
10791
+ case ZodFirstPartyTypeKind.ZodSymbol:
10792
10792
  return void 0;
10793
10793
  default:
10794
10794
  return /* @__PURE__ */ ((_) => void 0)();
@@ -11859,14 +11859,14 @@ var BaseContext = (
11859
11859
  return self._currentContext.get(key);
11860
11860
  };
11861
11861
  self.setValue = function(key, value) {
11862
- var context = new BaseContext23(self._currentContext);
11863
- context._currentContext.set(key, value);
11864
- return context;
11862
+ var context2 = new BaseContext23(self._currentContext);
11863
+ context2._currentContext.set(key, value);
11864
+ return context2;
11865
11865
  };
11866
11866
  self.deleteValue = function(key) {
11867
- var context = new BaseContext23(self._currentContext);
11868
- context._currentContext.delete(key);
11869
- return context;
11867
+ var context2 = new BaseContext23(self._currentContext);
11868
+ context2._currentContext.delete(key);
11869
+ return context2;
11870
11870
  };
11871
11871
  }
11872
11872
  return BaseContext23;
@@ -11971,16 +11971,16 @@ var ContextAPI = (
11971
11971
  ContextAPI23.prototype.active = function() {
11972
11972
  return this._getContextManager().active();
11973
11973
  };
11974
- ContextAPI23.prototype.with = function(context, fn, thisArg) {
11974
+ ContextAPI23.prototype.with = function(context2, fn, thisArg) {
11975
11975
  var _a172;
11976
11976
  var args = [];
11977
11977
  for (var _i = 3; _i < arguments.length; _i++) {
11978
11978
  args[_i - 3] = arguments[_i];
11979
11979
  }
11980
- return (_a172 = this._getContextManager()).with.apply(_a172, __spreadArray4([context, fn, thisArg], __read4(args), false));
11980
+ return (_a172 = this._getContextManager()).with.apply(_a172, __spreadArray4([context2, fn, thisArg], __read4(args), false));
11981
11981
  };
11982
- ContextAPI23.prototype.bind = function(context, target) {
11983
- return this._getContextManager().bind(context, target);
11982
+ ContextAPI23.prototype.bind = function(context2, target) {
11983
+ return this._getContextManager().bind(context2, target);
11984
11984
  };
11985
11985
  ContextAPI23.prototype._getContextManager = function() {
11986
11986
  return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER;
@@ -12048,24 +12048,24 @@ var NonRecordingSpan = (
12048
12048
  })()
12049
12049
  );
12050
12050
  var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
12051
- function getSpan(context) {
12052
- return context.getValue(SPAN_KEY) || void 0;
12051
+ function getSpan(context2) {
12052
+ return context2.getValue(SPAN_KEY) || void 0;
12053
12053
  }
12054
12054
  function getActiveSpan() {
12055
12055
  return getSpan(ContextAPI.getInstance().active());
12056
12056
  }
12057
- function setSpan(context, span) {
12058
- return context.setValue(SPAN_KEY, span);
12057
+ function setSpan(context2, span) {
12058
+ return context2.setValue(SPAN_KEY, span);
12059
12059
  }
12060
- function deleteSpan(context) {
12061
- return context.deleteValue(SPAN_KEY);
12060
+ function deleteSpan(context2) {
12061
+ return context2.deleteValue(SPAN_KEY);
12062
12062
  }
12063
- function setSpanContext(context, spanContext) {
12064
- return setSpan(context, new NonRecordingSpan(spanContext));
12063
+ function setSpanContext(context2, spanContext) {
12064
+ return setSpan(context2, new NonRecordingSpan(spanContext));
12065
12065
  }
12066
- function getSpanContext(context) {
12066
+ function getSpanContext(context2) {
12067
12067
  var _a172;
12068
- return (_a172 = getSpan(context)) === null || _a172 === void 0 ? void 0 : _a172.spanContext();
12068
+ return (_a172 = getSpan(context2)) === null || _a172 === void 0 ? void 0 : _a172.spanContext();
12069
12069
  }
12070
12070
  var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
12071
12071
  var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
@@ -12087,15 +12087,15 @@ var NoopTracer = (
12087
12087
  (function() {
12088
12088
  function NoopTracer23() {
12089
12089
  }
12090
- NoopTracer23.prototype.startSpan = function(name172, options, context) {
12091
- if (context === void 0) {
12092
- context = contextApi.active();
12090
+ NoopTracer23.prototype.startSpan = function(name172, options, context2) {
12091
+ if (context2 === void 0) {
12092
+ context2 = contextApi.active();
12093
12093
  }
12094
12094
  var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
12095
12095
  if (root) {
12096
12096
  return new NonRecordingSpan();
12097
12097
  }
12098
- var parentFromContext = context && getSpanContext(context);
12098
+ var parentFromContext = context2 && getSpanContext(context2);
12099
12099
  if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
12100
12100
  return new NonRecordingSpan(parentFromContext);
12101
12101
  } else {
@@ -12139,8 +12139,8 @@ var ProxyTracer = (
12139
12139
  this.version = version;
12140
12140
  this.options = options;
12141
12141
  }
12142
- ProxyTracer23.prototype.startSpan = function(name172, options, context) {
12143
- return this._getTracer().startSpan(name172, options, context);
12142
+ ProxyTracer23.prototype.startSpan = function(name172, options, context2) {
12143
+ return this._getTracer().startSpan(name172, options, context2);
12144
12144
  };
12145
12145
  ProxyTracer23.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
12146
12146
  var tracer = this._getTracer();
@@ -12498,16 +12498,16 @@ var object = ({
12498
12498
  }
12499
12499
  }
12500
12500
  },
12501
- parseOutput({ text: text23 }, context) {
12501
+ parseOutput({ text: text23 }, context2) {
12502
12502
  const parseResult = safeParseJSON({ text: text23 });
12503
12503
  if (!parseResult.success) {
12504
12504
  throw new NoObjectGeneratedError({
12505
12505
  message: "No object generated: could not parse the response.",
12506
12506
  cause: parseResult.error,
12507
12507
  text: text23,
12508
- response: context.response,
12509
- usage: context.usage,
12510
- finishReason: context.finishReason
12508
+ response: context2.response,
12509
+ usage: context2.usage,
12510
+ finishReason: context2.finishReason
12511
12511
  });
12512
12512
  }
12513
12513
  const validationResult = safeValidateTypes({
@@ -12519,9 +12519,9 @@ var object = ({
12519
12519
  message: "No object generated: response did not match schema.",
12520
12520
  cause: validationResult.error,
12521
12521
  text: text23,
12522
- response: context.response,
12523
- usage: context.usage,
12524
- finishReason: context.finishReason
12522
+ response: context2.response,
12523
+ usage: context2.usage,
12524
+ finishReason: context2.finishReason
12525
12525
  });
12526
12526
  }
12527
12527
  return validationResult.value;
@@ -13065,13 +13065,13 @@ var _AISDKError3 = class _AISDKError22 extends Error {
13065
13065
  * @param {unknown} [params.cause] - The underlying cause of the error.
13066
13066
  */
13067
13067
  constructor({
13068
- name: name144,
13068
+ name: name145,
13069
13069
  message,
13070
13070
  cause
13071
13071
  }) {
13072
13072
  super(message);
13073
13073
  this[_a2] = true;
13074
- this.name = name144;
13074
+ this.name = name145;
13075
13075
  this.cause = cause;
13076
13076
  }
13077
13077
  /**
@@ -13082,8 +13082,8 @@ var _AISDKError3 = class _AISDKError22 extends Error {
13082
13082
  static isInstance(error) {
13083
13083
  return _AISDKError22.hasMarker(error, marker2);
13084
13084
  }
13085
- static hasMarker(error, marker154) {
13086
- const markerSymbol = Symbol.for(marker154);
13085
+ static hasMarker(error, marker155) {
13086
+ const markerSymbol = Symbol.for(marker155);
13087
13087
  return error != null && typeof error === "object" && markerSymbol in error && typeof error[markerSymbol] === "boolean" && error[markerSymbol] === true;
13088
13088
  }
13089
13089
  };
@@ -13385,11 +13385,11 @@ var getRefs3 = (options) => {
13385
13385
  flags: { hasReferencedOpenAiAnyType: false },
13386
13386
  currentPath,
13387
13387
  propertyPath: void 0,
13388
- seen: new Map(Object.entries(_options.definitions).map(([name172, def]) => [
13388
+ seen: new Map(Object.entries(_options.definitions).map(([name173, def]) => [
13389
13389
  def._def,
13390
13390
  {
13391
13391
  def: def._def,
13392
- path: [..._options.basePath, _options.definitionPath, name172],
13392
+ path: [..._options.basePath, _options.definitionPath, name173],
13393
13393
  // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
13394
13394
  jsonSchema: void 0
13395
13395
  }
@@ -13436,7 +13436,7 @@ function parseArrayDef3(def, refs) {
13436
13436
  const res = {
13437
13437
  type: "array"
13438
13438
  };
13439
- if (def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind$1.ZodAny) {
13439
+ if (def.type?._def && def.type?._def?.typeName !== ZodFirstPartyTypeKind.ZodAny) {
13440
13440
  res.items = parseDef3(def.type._def, {
13441
13441
  ...refs,
13442
13442
  currentPath: [...refs.currentPath, "items"]
@@ -13953,7 +13953,7 @@ function parseRecordDef3(def, refs) {
13953
13953
  if (refs.target === "openAi") {
13954
13954
  console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
13955
13955
  }
13956
- if (refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind$1.ZodEnum) {
13956
+ if (refs.target === "openApi3" && def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
13957
13957
  return {
13958
13958
  type: "object",
13959
13959
  required: def.keyType._def.values,
@@ -13977,20 +13977,20 @@ function parseRecordDef3(def, refs) {
13977
13977
  if (refs.target === "openApi3") {
13978
13978
  return schema;
13979
13979
  }
13980
- if (def.keyType?._def.typeName === ZodFirstPartyTypeKind$1.ZodString && def.keyType._def.checks?.length) {
13980
+ if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
13981
13981
  const { type, ...keyType } = parseStringDef3(def.keyType._def, refs);
13982
13982
  return {
13983
13983
  ...schema,
13984
13984
  propertyNames: keyType
13985
13985
  };
13986
- } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind$1.ZodEnum) {
13986
+ } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodEnum) {
13987
13987
  return {
13988
13988
  ...schema,
13989
13989
  propertyNames: {
13990
13990
  enum: def.keyType._def.values
13991
13991
  }
13992
13992
  };
13993
- } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind$1.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind$1.ZodString && def.keyType._def.type._def.checks?.length) {
13993
+ } else if (def.keyType?._def.typeName === ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
13994
13994
  const { type, ...keyType } = parseBrandedDef3(def.keyType._def, refs);
13995
13995
  return {
13996
13996
  ...schema,
@@ -14356,73 +14356,73 @@ var parseReadonlyDef3 = (def, refs) => {
14356
14356
  };
14357
14357
  var selectParser3 = (def, typeName, refs) => {
14358
14358
  switch (typeName) {
14359
- case ZodFirstPartyTypeKind$1.ZodString:
14359
+ case ZodFirstPartyTypeKind.ZodString:
14360
14360
  return parseStringDef3(def, refs);
14361
- case ZodFirstPartyTypeKind$1.ZodNumber:
14361
+ case ZodFirstPartyTypeKind.ZodNumber:
14362
14362
  return parseNumberDef3(def, refs);
14363
- case ZodFirstPartyTypeKind$1.ZodObject:
14363
+ case ZodFirstPartyTypeKind.ZodObject:
14364
14364
  return parseObjectDef3(def, refs);
14365
- case ZodFirstPartyTypeKind$1.ZodBigInt:
14365
+ case ZodFirstPartyTypeKind.ZodBigInt:
14366
14366
  return parseBigintDef3(def, refs);
14367
- case ZodFirstPartyTypeKind$1.ZodBoolean:
14367
+ case ZodFirstPartyTypeKind.ZodBoolean:
14368
14368
  return parseBooleanDef3();
14369
- case ZodFirstPartyTypeKind$1.ZodDate:
14369
+ case ZodFirstPartyTypeKind.ZodDate:
14370
14370
  return parseDateDef3(def, refs);
14371
- case ZodFirstPartyTypeKind$1.ZodUndefined:
14371
+ case ZodFirstPartyTypeKind.ZodUndefined:
14372
14372
  return parseUndefinedDef3(refs);
14373
- case ZodFirstPartyTypeKind$1.ZodNull:
14373
+ case ZodFirstPartyTypeKind.ZodNull:
14374
14374
  return parseNullDef3(refs);
14375
- case ZodFirstPartyTypeKind$1.ZodArray:
14375
+ case ZodFirstPartyTypeKind.ZodArray:
14376
14376
  return parseArrayDef3(def, refs);
14377
- case ZodFirstPartyTypeKind$1.ZodUnion:
14378
- case ZodFirstPartyTypeKind$1.ZodDiscriminatedUnion:
14377
+ case ZodFirstPartyTypeKind.ZodUnion:
14378
+ case ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
14379
14379
  return parseUnionDef3(def, refs);
14380
- case ZodFirstPartyTypeKind$1.ZodIntersection:
14380
+ case ZodFirstPartyTypeKind.ZodIntersection:
14381
14381
  return parseIntersectionDef3(def, refs);
14382
- case ZodFirstPartyTypeKind$1.ZodTuple:
14382
+ case ZodFirstPartyTypeKind.ZodTuple:
14383
14383
  return parseTupleDef3(def, refs);
14384
- case ZodFirstPartyTypeKind$1.ZodRecord:
14384
+ case ZodFirstPartyTypeKind.ZodRecord:
14385
14385
  return parseRecordDef3(def, refs);
14386
- case ZodFirstPartyTypeKind$1.ZodLiteral:
14386
+ case ZodFirstPartyTypeKind.ZodLiteral:
14387
14387
  return parseLiteralDef3(def, refs);
14388
- case ZodFirstPartyTypeKind$1.ZodEnum:
14388
+ case ZodFirstPartyTypeKind.ZodEnum:
14389
14389
  return parseEnumDef3(def);
14390
- case ZodFirstPartyTypeKind$1.ZodNativeEnum:
14390
+ case ZodFirstPartyTypeKind.ZodNativeEnum:
14391
14391
  return parseNativeEnumDef3(def);
14392
- case ZodFirstPartyTypeKind$1.ZodNullable:
14392
+ case ZodFirstPartyTypeKind.ZodNullable:
14393
14393
  return parseNullableDef3(def, refs);
14394
- case ZodFirstPartyTypeKind$1.ZodOptional:
14394
+ case ZodFirstPartyTypeKind.ZodOptional:
14395
14395
  return parseOptionalDef3(def, refs);
14396
- case ZodFirstPartyTypeKind$1.ZodMap:
14396
+ case ZodFirstPartyTypeKind.ZodMap:
14397
14397
  return parseMapDef3(def, refs);
14398
- case ZodFirstPartyTypeKind$1.ZodSet:
14398
+ case ZodFirstPartyTypeKind.ZodSet:
14399
14399
  return parseSetDef3(def, refs);
14400
- case ZodFirstPartyTypeKind$1.ZodLazy:
14400
+ case ZodFirstPartyTypeKind.ZodLazy:
14401
14401
  return () => def.getter()._def;
14402
- case ZodFirstPartyTypeKind$1.ZodPromise:
14402
+ case ZodFirstPartyTypeKind.ZodPromise:
14403
14403
  return parsePromiseDef3(def, refs);
14404
- case ZodFirstPartyTypeKind$1.ZodNaN:
14405
- case ZodFirstPartyTypeKind$1.ZodNever:
14404
+ case ZodFirstPartyTypeKind.ZodNaN:
14405
+ case ZodFirstPartyTypeKind.ZodNever:
14406
14406
  return parseNeverDef3(refs);
14407
- case ZodFirstPartyTypeKind$1.ZodEffects:
14407
+ case ZodFirstPartyTypeKind.ZodEffects:
14408
14408
  return parseEffectsDef3(def, refs);
14409
- case ZodFirstPartyTypeKind$1.ZodAny:
14409
+ case ZodFirstPartyTypeKind.ZodAny:
14410
14410
  return parseAnyDef3(refs);
14411
- case ZodFirstPartyTypeKind$1.ZodUnknown:
14411
+ case ZodFirstPartyTypeKind.ZodUnknown:
14412
14412
  return parseUnknownDef3(refs);
14413
- case ZodFirstPartyTypeKind$1.ZodDefault:
14413
+ case ZodFirstPartyTypeKind.ZodDefault:
14414
14414
  return parseDefaultDef3(def, refs);
14415
- case ZodFirstPartyTypeKind$1.ZodBranded:
14415
+ case ZodFirstPartyTypeKind.ZodBranded:
14416
14416
  return parseBrandedDef3(def, refs);
14417
- case ZodFirstPartyTypeKind$1.ZodReadonly:
14417
+ case ZodFirstPartyTypeKind.ZodReadonly:
14418
14418
  return parseReadonlyDef3(def, refs);
14419
- case ZodFirstPartyTypeKind$1.ZodCatch:
14419
+ case ZodFirstPartyTypeKind.ZodCatch:
14420
14420
  return parseCatchDef3(def, refs);
14421
- case ZodFirstPartyTypeKind$1.ZodPipeline:
14421
+ case ZodFirstPartyTypeKind.ZodPipeline:
14422
14422
  return parsePipelineDef3(def, refs);
14423
- case ZodFirstPartyTypeKind$1.ZodFunction:
14424
- case ZodFirstPartyTypeKind$1.ZodVoid:
14425
- case ZodFirstPartyTypeKind$1.ZodSymbol:
14423
+ case ZodFirstPartyTypeKind.ZodFunction:
14424
+ case ZodFirstPartyTypeKind.ZodVoid:
14425
+ case ZodFirstPartyTypeKind.ZodSymbol:
14426
14426
  return void 0;
14427
14427
  default:
14428
14428
  return /* @__PURE__ */ ((_) => void 0)();
@@ -14484,17 +14484,17 @@ var addMeta3 = (def, refs, jsonSchema222) => {
14484
14484
  };
14485
14485
  var zodToJsonSchema3 = (schema, options) => {
14486
14486
  const refs = getRefs3(options);
14487
- let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name182, schema2]) => ({
14487
+ let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name183, schema2]) => ({
14488
14488
  ...acc,
14489
- [name182]: parseDef3(schema2._def, {
14489
+ [name183]: parseDef3(schema2._def, {
14490
14490
  ...refs,
14491
- currentPath: [...refs.basePath, refs.definitionPath, name182]
14491
+ currentPath: [...refs.basePath, refs.definitionPath, name183]
14492
14492
  }, true) ?? parseAnyDef3(refs)
14493
14493
  }), {}) : void 0;
14494
- const name172 = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
14495
- const main = parseDef3(schema._def, name172 === void 0 ? refs : {
14494
+ const name173 = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
14495
+ const main = parseDef3(schema._def, name173 === void 0 ? refs : {
14496
14496
  ...refs,
14497
- currentPath: [...refs.basePath, refs.definitionPath, name172]
14497
+ currentPath: [...refs.basePath, refs.definitionPath, name173]
14498
14498
  }, false) ?? parseAnyDef3(refs);
14499
14499
  const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
14500
14500
  if (title !== void 0) {
@@ -14518,18 +14518,18 @@ var zodToJsonSchema3 = (schema, options) => {
14518
14518
  };
14519
14519
  }
14520
14520
  }
14521
- const combined = name172 === void 0 ? definitions ? {
14521
+ const combined = name173 === void 0 ? definitions ? {
14522
14522
  ...main,
14523
14523
  [refs.definitionPath]: definitions
14524
14524
  } : main : {
14525
14525
  $ref: [
14526
14526
  ...refs.$refStrategy === "relative" ? [] : refs.basePath,
14527
14527
  refs.definitionPath,
14528
- name172
14528
+ name173
14529
14529
  ].join("/"),
14530
14530
  [refs.definitionPath]: {
14531
14531
  ...definitions,
14532
- [name172]: main
14532
+ [name173]: main
14533
14533
  }
14534
14534
  };
14535
14535
  if (refs.target === "jsonSchema7") {
@@ -15137,8 +15137,8 @@ function formatDataStreamPart2(type, value) {
15137
15137
  `;
15138
15138
  }
15139
15139
  function zodSchema2(zodSchema222, options) {
15140
- var _a172;
15141
- const useReferences = (_a172 = void 0) != null ? _a172 : false;
15140
+ var _a173;
15141
+ const useReferences = (_a173 = void 0) != null ? _a173 : false;
15142
15142
  return jsonSchema2(
15143
15143
  esm_default3(zodSchema222, {
15144
15144
  $refStrategy: useReferences ? "root" : "none",
@@ -15243,11 +15243,11 @@ var major2 = VERSION2.split(".")[0];
15243
15243
  var GLOBAL_OPENTELEMETRY_API_KEY2 = /* @__PURE__ */ Symbol.for("opentelemetry.js.api." + major2);
15244
15244
  var _global2 = _globalThis2;
15245
15245
  function registerGlobal2(type, instance, diag, allowOverride) {
15246
- var _a172;
15246
+ var _a173;
15247
15247
  if (allowOverride === void 0) {
15248
15248
  allowOverride = false;
15249
15249
  }
15250
- var api = _global2[GLOBAL_OPENTELEMETRY_API_KEY2] = (_a172 = _global2[GLOBAL_OPENTELEMETRY_API_KEY2]) !== null && _a172 !== void 0 ? _a172 : {
15250
+ var api = _global2[GLOBAL_OPENTELEMETRY_API_KEY2] = (_a173 = _global2[GLOBAL_OPENTELEMETRY_API_KEY2]) !== null && _a173 !== void 0 ? _a173 : {
15251
15251
  version: VERSION2
15252
15252
  };
15253
15253
  if (!allowOverride && api[type]) {
@@ -15265,8 +15265,8 @@ function registerGlobal2(type, instance, diag, allowOverride) {
15265
15265
  return true;
15266
15266
  }
15267
15267
  function getGlobal2(type) {
15268
- var _a172, _b17;
15269
- var globalVersion = (_a172 = _global2[GLOBAL_OPENTELEMETRY_API_KEY2]) === null || _a172 === void 0 ? void 0 : _a172.version;
15268
+ var _a173, _b17;
15269
+ var globalVersion = (_a173 = _global2[GLOBAL_OPENTELEMETRY_API_KEY2]) === null || _a173 === void 0 ? void 0 : _a173.version;
15270
15270
  if (!globalVersion || !isCompatible2(globalVersion)) {
15271
15271
  return;
15272
15272
  }
@@ -15435,13 +15435,13 @@ var DiagAPI2 = (
15435
15435
  }
15436
15436
  var self = this;
15437
15437
  var setLogger = function(logger, optionsOrLogLevel) {
15438
- var _a172, _b17, _c;
15438
+ var _a173, _b17, _c;
15439
15439
  if (optionsOrLogLevel === void 0) {
15440
15440
  optionsOrLogLevel = { logLevel: DiagLogLevel2.INFO };
15441
15441
  }
15442
15442
  if (logger === self) {
15443
15443
  var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
15444
- self.error((_a172 = err.stack) !== null && _a172 !== void 0 ? _a172 : err.message);
15444
+ self.error((_a173 = err.stack) !== null && _a173 !== void 0 ? _a173 : err.message);
15445
15445
  return false;
15446
15446
  }
15447
15447
  if (typeof optionsOrLogLevel === "number") {
@@ -15493,14 +15493,14 @@ var BaseContext2 = (
15493
15493
  return self._currentContext.get(key);
15494
15494
  };
15495
15495
  self.setValue = function(key, value) {
15496
- var context = new BaseContext222(self._currentContext);
15497
- context._currentContext.set(key, value);
15498
- return context;
15496
+ var context2 = new BaseContext222(self._currentContext);
15497
+ context2._currentContext.set(key, value);
15498
+ return context2;
15499
15499
  };
15500
15500
  self.deleteValue = function(key) {
15501
- var context = new BaseContext222(self._currentContext);
15502
- context._currentContext.delete(key);
15503
- return context;
15501
+ var context2 = new BaseContext222(self._currentContext);
15502
+ context2._currentContext.delete(key);
15503
+ return context2;
15504
15504
  };
15505
15505
  }
15506
15506
  return BaseContext222;
@@ -15605,16 +15605,16 @@ var ContextAPI2 = (
15605
15605
  ContextAPI222.prototype.active = function() {
15606
15606
  return this._getContextManager().active();
15607
15607
  };
15608
- ContextAPI222.prototype.with = function(context, fn, thisArg) {
15609
- var _a172;
15608
+ ContextAPI222.prototype.with = function(context2, fn, thisArg) {
15609
+ var _a173;
15610
15610
  var args = [];
15611
15611
  for (var _i = 3; _i < arguments.length; _i++) {
15612
15612
  args[_i - 3] = arguments[_i];
15613
15613
  }
15614
- return (_a172 = this._getContextManager()).with.apply(_a172, __spreadArray42([context, fn, thisArg], __read42(args), false));
15614
+ return (_a173 = this._getContextManager()).with.apply(_a173, __spreadArray42([context2, fn, thisArg], __read42(args), false));
15615
15615
  };
15616
- ContextAPI222.prototype.bind = function(context, target) {
15617
- return this._getContextManager().bind(context, target);
15616
+ ContextAPI222.prototype.bind = function(context2, target) {
15617
+ return this._getContextManager().bind(context2, target);
15618
15618
  };
15619
15619
  ContextAPI222.prototype._getContextManager = function() {
15620
15620
  return getGlobal2(API_NAME22) || NOOP_CONTEXT_MANAGER2;
@@ -15682,24 +15682,24 @@ var NonRecordingSpan2 = (
15682
15682
  })()
15683
15683
  );
15684
15684
  var SPAN_KEY2 = createContextKey2("OpenTelemetry Context Key SPAN");
15685
- function getSpan2(context) {
15686
- return context.getValue(SPAN_KEY2) || void 0;
15685
+ function getSpan2(context2) {
15686
+ return context2.getValue(SPAN_KEY2) || void 0;
15687
15687
  }
15688
15688
  function getActiveSpan2() {
15689
15689
  return getSpan2(ContextAPI2.getInstance().active());
15690
15690
  }
15691
- function setSpan2(context, span) {
15692
- return context.setValue(SPAN_KEY2, span);
15691
+ function setSpan2(context2, span) {
15692
+ return context2.setValue(SPAN_KEY2, span);
15693
15693
  }
15694
- function deleteSpan2(context) {
15695
- return context.deleteValue(SPAN_KEY2);
15694
+ function deleteSpan2(context2) {
15695
+ return context2.deleteValue(SPAN_KEY2);
15696
15696
  }
15697
- function setSpanContext2(context, spanContext) {
15698
- return setSpan2(context, new NonRecordingSpan2(spanContext));
15697
+ function setSpanContext2(context2, spanContext) {
15698
+ return setSpan2(context2, new NonRecordingSpan2(spanContext));
15699
15699
  }
15700
- function getSpanContext2(context) {
15701
- var _a172;
15702
- return (_a172 = getSpan2(context)) === null || _a172 === void 0 ? void 0 : _a172.spanContext();
15700
+ function getSpanContext2(context2) {
15701
+ var _a173;
15702
+ return (_a173 = getSpan2(context2)) === null || _a173 === void 0 ? void 0 : _a173.spanContext();
15703
15703
  }
15704
15704
  var VALID_TRACEID_REGEX2 = /^([0-9a-f]{32})$/i;
15705
15705
  var VALID_SPANID_REGEX2 = /^[0-9a-f]{16}$/i;
@@ -15721,22 +15721,22 @@ var NoopTracer2 = (
15721
15721
  (function() {
15722
15722
  function NoopTracer222() {
15723
15723
  }
15724
- NoopTracer222.prototype.startSpan = function(name172, options, context) {
15725
- if (context === void 0) {
15726
- context = contextApi2.active();
15724
+ NoopTracer222.prototype.startSpan = function(name173, options, context2) {
15725
+ if (context2 === void 0) {
15726
+ context2 = contextApi2.active();
15727
15727
  }
15728
15728
  var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
15729
15729
  if (root) {
15730
15730
  return new NonRecordingSpan2();
15731
15731
  }
15732
- var parentFromContext = context && getSpanContext2(context);
15732
+ var parentFromContext = context2 && getSpanContext2(context2);
15733
15733
  if (isSpanContext2(parentFromContext) && isSpanContextValid2(parentFromContext)) {
15734
15734
  return new NonRecordingSpan2(parentFromContext);
15735
15735
  } else {
15736
15736
  return new NonRecordingSpan2();
15737
15737
  }
15738
15738
  };
15739
- NoopTracer222.prototype.startActiveSpan = function(name172, arg2, arg3, arg4) {
15739
+ NoopTracer222.prototype.startActiveSpan = function(name173, arg2, arg3, arg4) {
15740
15740
  var opts;
15741
15741
  var ctx;
15742
15742
  var fn;
@@ -15753,7 +15753,7 @@ var NoopTracer2 = (
15753
15753
  fn = arg4;
15754
15754
  }
15755
15755
  var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi2.active();
15756
- var span = this.startSpan(name172, opts, parentContext);
15756
+ var span = this.startSpan(name173, opts, parentContext);
15757
15757
  var contextWithSpanSet = setSpan2(parentContext, span);
15758
15758
  return contextApi2.with(contextWithSpanSet, fn, void 0, span);
15759
15759
  };
@@ -15767,14 +15767,14 @@ var NOOP_TRACER2 = new NoopTracer2();
15767
15767
  var ProxyTracer2 = (
15768
15768
  /** @class */
15769
15769
  (function() {
15770
- function ProxyTracer222(_provider, name172, version, options) {
15770
+ function ProxyTracer222(_provider, name173, version, options) {
15771
15771
  this._provider = _provider;
15772
- this.name = name172;
15772
+ this.name = name173;
15773
15773
  this.version = version;
15774
15774
  this.options = options;
15775
15775
  }
15776
- ProxyTracer222.prototype.startSpan = function(name172, options, context) {
15777
- return this._getTracer().startSpan(name172, options, context);
15776
+ ProxyTracer222.prototype.startSpan = function(name173, options, context2) {
15777
+ return this._getTracer().startSpan(name173, options, context2);
15778
15778
  };
15779
15779
  ProxyTracer222.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
15780
15780
  var tracer = this._getTracer();
@@ -15811,20 +15811,20 @@ var ProxyTracerProvider2 = (
15811
15811
  (function() {
15812
15812
  function ProxyTracerProvider222() {
15813
15813
  }
15814
- ProxyTracerProvider222.prototype.getTracer = function(name172, version, options) {
15815
- var _a172;
15816
- return (_a172 = this.getDelegateTracer(name172, version, options)) !== null && _a172 !== void 0 ? _a172 : new ProxyTracer2(this, name172, version, options);
15814
+ ProxyTracerProvider222.prototype.getTracer = function(name173, version, options) {
15815
+ var _a173;
15816
+ return (_a173 = this.getDelegateTracer(name173, version, options)) !== null && _a173 !== void 0 ? _a173 : new ProxyTracer2(this, name173, version, options);
15817
15817
  };
15818
15818
  ProxyTracerProvider222.prototype.getDelegate = function() {
15819
- var _a172;
15820
- return (_a172 = this._delegate) !== null && _a172 !== void 0 ? _a172 : NOOP_TRACER_PROVIDER2;
15819
+ var _a173;
15820
+ return (_a173 = this._delegate) !== null && _a173 !== void 0 ? _a173 : NOOP_TRACER_PROVIDER2;
15821
15821
  };
15822
15822
  ProxyTracerProvider222.prototype.setDelegate = function(delegate) {
15823
15823
  this._delegate = delegate;
15824
15824
  };
15825
- ProxyTracerProvider222.prototype.getDelegateTracer = function(name172, version, options) {
15826
- var _a172;
15827
- return (_a172 = this._delegate) === null || _a172 === void 0 ? void 0 : _a172.getTracer(name172, version, options);
15825
+ ProxyTracerProvider222.prototype.getDelegateTracer = function(name173, version, options) {
15826
+ var _a173;
15827
+ return (_a173 = this._delegate) === null || _a173 === void 0 ? void 0 : _a173.getTracer(name173, version, options);
15828
15828
  };
15829
15829
  return ProxyTracerProvider222;
15830
15830
  })()
@@ -15866,8 +15866,8 @@ var TraceAPI2 = (
15866
15866
  TraceAPI222.prototype.getTracerProvider = function() {
15867
15867
  return getGlobal2(API_NAME32) || this._proxyTracerProvider;
15868
15868
  };
15869
- TraceAPI222.prototype.getTracer = function(name172, version) {
15870
- return this.getTracerProvider().getTracer(name172, version);
15869
+ TraceAPI222.prototype.getTracer = function(name173, version) {
15870
+ return this.getTracerProvider().getTracer(name173, version);
15871
15871
  };
15872
15872
  TraceAPI222.prototype.disable = function() {
15873
15873
  unregisterGlobal2(API_NAME32, DiagAPI2.instance());
@@ -15879,8 +15879,8 @@ var TraceAPI2 = (
15879
15879
  var trace = TraceAPI2.getInstance();
15880
15880
  var __defProp23 = Object.defineProperty;
15881
15881
  var __export3 = (target, all) => {
15882
- for (var name172 in all)
15883
- __defProp23(target, name172, { get: all[name172], enumerable: true });
15882
+ for (var name173 in all)
15883
+ __defProp23(target, name173, { get: all[name173], enumerable: true });
15884
15884
  };
15885
15885
  function prepareResponseHeaders2(headers, {
15886
15886
  contentType,
@@ -16042,7 +16042,7 @@ function getBaseTelemetryAttributes({
16042
16042
  telemetry,
16043
16043
  headers
16044
16044
  }) {
16045
- var _a172;
16045
+ var _a173;
16046
16046
  return {
16047
16047
  "ai.model.provider": model.provider,
16048
16048
  "ai.model.id": model.modelId,
@@ -16052,7 +16052,7 @@ function getBaseTelemetryAttributes({
16052
16052
  return attributes;
16053
16053
  }, {}),
16054
16054
  // add metadata as attributes:
16055
- ...Object.entries((_a172 = telemetry == null ? void 0 : telemetry.metadata) != null ? _a172 : {}).reduce(
16055
+ ...Object.entries((_a173 = telemetry == null ? void 0 : telemetry.metadata) != null ? _a173 : {}).reduce(
16056
16056
  (attributes, [key, value]) => {
16057
16057
  attributes[`ai.telemetry.metadata.${key}`] = value;
16058
16058
  return attributes;
@@ -16072,7 +16072,7 @@ var noopTracer = {
16072
16072
  startSpan() {
16073
16073
  return noopSpan;
16074
16074
  },
16075
- startActiveSpan(name172, arg1, arg2, arg3) {
16075
+ startActiveSpan(name173, arg1, arg2, arg3) {
16076
16076
  if (typeof arg1 === "function") {
16077
16077
  return arg1(noopSpan);
16078
16078
  }
@@ -16137,13 +16137,13 @@ function getTracer({
16137
16137
  return trace.getTracer("ai");
16138
16138
  }
16139
16139
  function recordSpan({
16140
- name: name172,
16140
+ name: name173,
16141
16141
  tracer,
16142
16142
  attributes,
16143
16143
  fn,
16144
16144
  endWhenDone = true
16145
16145
  }) {
16146
- return tracer.startActiveSpan(name172, { attributes }, async (span) => {
16146
+ return tracer.startActiveSpan(name173, { attributes }, async (span) => {
16147
16147
  try {
16148
16148
  const result = await fn(span);
16149
16149
  if (endWhenDone) {
@@ -16268,14 +16268,14 @@ async function embedMany({
16268
16268
  }),
16269
16269
  tracer,
16270
16270
  fn: async (doEmbedSpan) => {
16271
- var _a172;
16271
+ var _a173;
16272
16272
  const modelResponse = await model.doEmbed({
16273
16273
  values,
16274
16274
  abortSignal,
16275
16275
  headers
16276
16276
  });
16277
16277
  const embeddings3 = modelResponse.embeddings;
16278
- const usage2 = (_a172 = modelResponse.usage) != null ? _a172 : { tokens: NaN };
16278
+ const usage2 = (_a173 = modelResponse.usage) != null ? _a173 : { tokens: NaN };
16279
16279
  doEmbedSpan.setAttributes(
16280
16280
  selectTelemetryAttributes({
16281
16281
  telemetry,
@@ -16327,14 +16327,14 @@ async function embedMany({
16327
16327
  }),
16328
16328
  tracer,
16329
16329
  fn: async (doEmbedSpan) => {
16330
- var _a172;
16330
+ var _a173;
16331
16331
  const modelResponse = await model.doEmbed({
16332
16332
  values: chunk,
16333
16333
  abortSignal,
16334
16334
  headers
16335
16335
  });
16336
16336
  const embeddings2 = modelResponse.embeddings;
16337
- const usage2 = (_a172 = modelResponse.usage) != null ? _a172 : { tokens: NaN };
16337
+ const usage2 = (_a173 = modelResponse.usage) != null ? _a173 : { tokens: NaN };
16338
16338
  doEmbedSpan.setAttributes(
16339
16339
  selectTelemetryAttributes({
16340
16340
  telemetry,
@@ -16411,8 +16411,8 @@ var dataContentSchema2 = z.union([
16411
16411
  z.custom(
16412
16412
  // Buffer might not be available in some environments such as CloudFlare:
16413
16413
  (value) => {
16414
- var _a172, _b17;
16415
- return (_b17 = (_a172 = globalThis.Buffer) == null ? void 0 : _a172.isBuffer(value)) != null ? _b17 : false;
16414
+ var _a173, _b17;
16415
+ return (_b17 = (_a173 = globalThis.Buffer) == null ? void 0 : _a173.isBuffer(value)) != null ? _b17 : false;
16416
16416
  },
16417
16417
  { message: "Must be a Buffer" }
16418
16418
  )
@@ -16616,16 +16616,16 @@ var object2 = ({
16616
16616
  }
16617
16617
  }
16618
16618
  },
16619
- parseOutput({ text: text222 }, context) {
16619
+ parseOutput({ text: text222 }, context2) {
16620
16620
  const parseResult = safeParseJSON2({ text: text222 });
16621
16621
  if (!parseResult.success) {
16622
16622
  throw new NoObjectGeneratedError2({
16623
16623
  message: "No object generated: could not parse the response.",
16624
16624
  cause: parseResult.error,
16625
16625
  text: text222,
16626
- response: context.response,
16627
- usage: context.usage,
16628
- finishReason: context.finishReason
16626
+ response: context2.response,
16627
+ usage: context2.usage,
16628
+ finishReason: context2.finishReason
16629
16629
  });
16630
16630
  }
16631
16631
  const validationResult = safeValidateTypes2({
@@ -16637,9 +16637,9 @@ var object2 = ({
16637
16637
  message: "No object generated: response did not match schema.",
16638
16638
  cause: validationResult.error,
16639
16639
  text: text222,
16640
- response: context.response,
16641
- usage: context.usage,
16642
- finishReason: context.finishReason
16640
+ response: context2.response,
16641
+ usage: context2.usage,
16642
+ finishReason: context2.finishReason
16643
16643
  });
16644
16644
  }
16645
16645
  return validationResult.value;
@@ -16901,7 +16901,7 @@ function toDataStreamInternal3(stream, callbacks) {
16901
16901
  return stream.pipeThrough(
16902
16902
  new TransformStream({
16903
16903
  transform: async (value, controller) => {
16904
- var _a172;
16904
+ var _a173;
16905
16905
  if (typeof value === "string") {
16906
16906
  controller.enqueue(value);
16907
16907
  return;
@@ -16909,7 +16909,7 @@ function toDataStreamInternal3(stream, callbacks) {
16909
16909
  if ("event" in value) {
16910
16910
  if (value.event === "on_chat_model_stream") {
16911
16911
  forwardAIMessageChunk2(
16912
- (_a172 = value.data) == null ? void 0 : _a172.chunk,
16912
+ (_a173 = value.data) == null ? void 0 : _a173.chunk,
16913
16913
  controller
16914
16914
  );
16915
16915
  }
@@ -16932,7 +16932,7 @@ function toDataStream3(stream, callbacks) {
16932
16932
  );
16933
16933
  }
16934
16934
  function toDataStreamResponse3(stream, options) {
16935
- var _a172;
16935
+ var _a173;
16936
16936
  const dataStream = toDataStreamInternal3(
16937
16937
  stream,
16938
16938
  options == null ? void 0 : options.callbacks
@@ -16941,7 +16941,7 @@ function toDataStreamResponse3(stream, options) {
16941
16941
  const init = options == null ? void 0 : options.init;
16942
16942
  const responseStream = data ? mergeStreams2(data.stream, dataStream) : dataStream;
16943
16943
  return new Response(responseStream, {
16944
- status: (_a172 = init == null ? void 0 : init.status) != null ? _a172 : 200,
16944
+ status: (_a173 = init == null ? void 0 : init.status) != null ? _a173 : 200,
16945
16945
  statusText: init == null ? void 0 : init.statusText,
16946
16946
  headers: prepareResponseHeaders2(init == null ? void 0 : init.headers, {
16947
16947
  contentType: "text/plain; charset=utf-8",
@@ -16992,14 +16992,14 @@ function toDataStream22(stream, callbacks) {
16992
16992
  );
16993
16993
  }
16994
16994
  function toDataStreamResponse22(stream, options = {}) {
16995
- var _a172;
16995
+ var _a173;
16996
16996
  const { init, data, callbacks } = options;
16997
16997
  const dataStream = toDataStreamInternal22(stream, callbacks).pipeThrough(
16998
16998
  new TextEncoderStream()
16999
16999
  );
17000
17000
  const responseStream = data ? mergeStreams2(data.stream, dataStream) : dataStream;
17001
17001
  return new Response(responseStream, {
17002
- status: (_a172 = init == null ? void 0 : init.status) != null ? _a172 : 200,
17002
+ status: (_a173 = init == null ? void 0 : init.status) != null ? _a173 : 200,
17003
17003
  statusText: init == null ? void 0 : init.statusText,
17004
17004
  headers: prepareResponseHeaders2(init == null ? void 0 : init.headers, {
17005
17005
  contentType: "text/plain; charset=utf-8",
@@ -17034,13 +17034,13 @@ var _AISDKError32 = class _AISDKError222 extends Error {
17034
17034
  * @param {unknown} [params.cause] - The underlying cause of the error.
17035
17035
  */
17036
17036
  constructor({
17037
- name: name144,
17037
+ name: name145,
17038
17038
  message,
17039
17039
  cause
17040
17040
  }) {
17041
17041
  super(message);
17042
17042
  this[_a17] = true;
17043
- this.name = name144;
17043
+ this.name = name145;
17044
17044
  this.cause = cause;
17045
17045
  }
17046
17046
  /**
@@ -17051,8 +17051,8 @@ var _AISDKError32 = class _AISDKError222 extends Error {
17051
17051
  static isInstance(error) {
17052
17052
  return _AISDKError222.hasMarker(error, marker17);
17053
17053
  }
17054
- static hasMarker(error, marker154) {
17055
- const markerSymbol = Symbol.for(marker154);
17054
+ static hasMarker(error, marker155) {
17055
+ const markerSymbol = Symbol.for(marker155);
17056
17056
  return error != null && typeof error === "object" && markerSymbol in error && typeof error[markerSymbol] === "boolean" && error[markerSymbol] === true;
17057
17057
  }
17058
17058
  };
@@ -17426,11 +17426,11 @@ function handleFetchError({
17426
17426
  return error;
17427
17427
  }
17428
17428
  function getRuntimeEnvironmentUserAgent(globalThisAny = globalThis) {
17429
- var _a154, _b17, _c;
17429
+ var _a155, _b17, _c;
17430
17430
  if (globalThisAny.window) {
17431
17431
  return `runtime/browser`;
17432
17432
  }
17433
- if ((_a154 = globalThisAny.navigator) == null ? void 0 : _a154.userAgent) {
17433
+ if ((_a155 = globalThisAny.navigator) == null ? void 0 : _a155.userAgent) {
17434
17434
  return `runtime/${globalThisAny.navigator.userAgent.toLowerCase()}`;
17435
17435
  }
17436
17436
  if ((_c = (_b17 = globalThisAny.process) == null ? void 0 : _b17.versions) == null ? void 0 : _c.node) {
@@ -17952,11 +17952,11 @@ function parseAnyDef22() {
17952
17952
  return {};
17953
17953
  }
17954
17954
  function parseArrayDef22(def, refs) {
17955
- var _a154, _b17, _c;
17955
+ var _a155, _b17, _c;
17956
17956
  const res = {
17957
17957
  type: "array"
17958
17958
  };
17959
- if (((_a154 = def.type) == null ? void 0 : _a154._def) && ((_c = (_b17 = def.type) == null ? void 0 : _b17._def) == null ? void 0 : _c.typeName) !== ZodFirstPartyTypeKind.ZodAny) {
17959
+ if (((_a155 = def.type) == null ? void 0 : _a155._def) && ((_c = (_b17 = def.type) == null ? void 0 : _b17._def) == null ? void 0 : _c.typeName) !== ZodFirstPartyTypeKind.ZodAny) {
17960
17960
  res.items = parseDef22(def.type._def, {
17961
17961
  ...refs,
17962
17962
  currentPath: [...refs.currentPath, "items"]
@@ -18315,8 +18315,8 @@ function escapeNonAlphaNumeric22(source) {
18315
18315
  return result;
18316
18316
  }
18317
18317
  function addFormat22(schema, value, message, refs) {
18318
- var _a154;
18319
- if (schema.format || ((_a154 = schema.anyOf) == null ? void 0 : _a154.some((x) => x.format))) {
18318
+ var _a155;
18319
+ if (schema.format || ((_a155 = schema.anyOf) == null ? void 0 : _a155.some((x) => x.format))) {
18320
18320
  if (!schema.anyOf) {
18321
18321
  schema.anyOf = [];
18322
18322
  }
@@ -18335,8 +18335,8 @@ function addFormat22(schema, value, message, refs) {
18335
18335
  }
18336
18336
  }
18337
18337
  function addPattern22(schema, regex, message, refs) {
18338
- var _a154;
18339
- if (schema.pattern || ((_a154 = schema.allOf) == null ? void 0 : _a154.some((x) => x.pattern))) {
18338
+ var _a155;
18339
+ if (schema.pattern || ((_a155 = schema.allOf) == null ? void 0 : _a155.some((x) => x.pattern))) {
18340
18340
  if (!schema.allOf) {
18341
18341
  schema.allOf = [];
18342
18342
  }
@@ -18355,7 +18355,7 @@ function addPattern22(schema, regex, message, refs) {
18355
18355
  }
18356
18356
  }
18357
18357
  function stringifyRegExpWithFlags22(regex, refs) {
18358
- var _a154;
18358
+ var _a155;
18359
18359
  if (!refs.applyRegexFlags || !regex.flags) {
18360
18360
  return regex.source;
18361
18361
  }
@@ -18385,7 +18385,7 @@ function stringifyRegExpWithFlags22(regex, refs) {
18385
18385
  pattern += source[i];
18386
18386
  pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
18387
18387
  inCharRange = false;
18388
- } else if (source[i + 1] === "-" && ((_a154 = source[i + 2]) == null ? void 0 : _a154.match(/[a-z]/))) {
18388
+ } else if (source[i + 1] === "-" && ((_a155 = source[i + 2]) == null ? void 0 : _a155.match(/[a-z]/))) {
18389
18389
  pattern += source[i];
18390
18390
  inCharRange = true;
18391
18391
  } else {
@@ -18427,13 +18427,13 @@ function stringifyRegExpWithFlags22(regex, refs) {
18427
18427
  return pattern;
18428
18428
  }
18429
18429
  function parseRecordDef22(def, refs) {
18430
- var _a154, _b17, _c, _d, _e, _f;
18430
+ var _a155, _b17, _c, _d, _e, _f;
18431
18431
  const schema = {
18432
18432
  type: "object",
18433
- additionalProperties: (_a154 = parseDef22(def.valueType._def, {
18433
+ additionalProperties: (_a155 = parseDef22(def.valueType._def, {
18434
18434
  ...refs,
18435
18435
  currentPath: [...refs.currentPath, "additionalProperties"]
18436
- })) != null ? _a154 : refs.allowedAdditionalProperties
18436
+ })) != null ? _a155 : refs.allowedAdditionalProperties
18437
18437
  };
18438
18438
  if (((_b17 = def.keyType) == null ? void 0 : _b17._def.typeName) === ZodFirstPartyTypeKind.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) {
18439
18439
  const { type, ...keyType } = parseStringDef22(def.keyType._def, refs);
@@ -18690,8 +18690,8 @@ function safeIsOptional22(schema) {
18690
18690
  }
18691
18691
  }
18692
18692
  var parseOptionalDef22 = (def, refs) => {
18693
- var _a154;
18694
- if (refs.currentPath.toString() === ((_a154 = refs.propertyPath) == null ? void 0 : _a154.toString())) {
18693
+ var _a155;
18694
+ if (refs.currentPath.toString() === ((_a155 = refs.propertyPath) == null ? void 0 : _a155.toString())) {
18695
18695
  return parseDef22(def.innerType._def, refs);
18696
18696
  }
18697
18697
  const innerSchema = parseDef22(def.innerType._def, {
@@ -18861,10 +18861,10 @@ var selectParser22 = (def, typeName, refs) => {
18861
18861
  }
18862
18862
  };
18863
18863
  function parseDef22(def, refs, forceResolution = false) {
18864
- var _a154;
18864
+ var _a155;
18865
18865
  const seenItem = refs.seen.get(def);
18866
18866
  if (refs.override) {
18867
- const overrideResult = (_a154 = refs.override) == null ? void 0 : _a154.call(
18867
+ const overrideResult = (_a155 = refs.override) == null ? void 0 : _a155.call(
18868
18868
  refs,
18869
18869
  def,
18870
18870
  refs,
@@ -18930,11 +18930,11 @@ var getRefs22 = (options) => {
18930
18930
  currentPath,
18931
18931
  propertyPath: void 0,
18932
18932
  seen: new Map(
18933
- Object.entries(_options.definitions).map(([name144, def]) => [
18933
+ Object.entries(_options.definitions).map(([name145, def]) => [
18934
18934
  def._def,
18935
18935
  {
18936
18936
  def: def._def,
18937
- path: [..._options.basePath, _options.definitionPath, name144],
18937
+ path: [..._options.basePath, _options.definitionPath, name145],
18938
18938
  // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
18939
18939
  jsonSchema: void 0
18940
18940
  }
@@ -18943,7 +18943,7 @@ var getRefs22 = (options) => {
18943
18943
  };
18944
18944
  };
18945
18945
  var zodToJsonSchema23 = (schema, options) => {
18946
- var _a154;
18946
+ var _a155;
18947
18947
  const refs = getRefs22(options);
18948
18948
  let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce(
18949
18949
  (acc, [name224, schema2]) => {
@@ -18962,31 +18962,31 @@ var zodToJsonSchema23 = (schema, options) => {
18962
18962
  },
18963
18963
  {}
18964
18964
  ) : void 0;
18965
- const name144 = typeof options === "string" ? options : (options == null ? void 0 : options.nameStrategy) === "title" ? void 0 : options == null ? void 0 : options.name;
18966
- const main = (_a154 = parseDef22(
18965
+ const name145 = typeof options === "string" ? options : (options == null ? void 0 : options.nameStrategy) === "title" ? void 0 : options == null ? void 0 : options.name;
18966
+ const main = (_a155 = parseDef22(
18967
18967
  schema._def,
18968
- name144 === void 0 ? refs : {
18968
+ name145 === void 0 ? refs : {
18969
18969
  ...refs,
18970
- currentPath: [...refs.basePath, refs.definitionPath, name144]
18970
+ currentPath: [...refs.basePath, refs.definitionPath, name145]
18971
18971
  },
18972
18972
  false
18973
- )) != null ? _a154 : parseAnyDef22();
18973
+ )) != null ? _a155 : parseAnyDef22();
18974
18974
  const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
18975
18975
  if (title !== void 0) {
18976
18976
  main.title = title;
18977
18977
  }
18978
- const combined = name144 === void 0 ? definitions ? {
18978
+ const combined = name145 === void 0 ? definitions ? {
18979
18979
  ...main,
18980
18980
  [refs.definitionPath]: definitions
18981
18981
  } : main : {
18982
18982
  $ref: [
18983
18983
  ...refs.$refStrategy === "relative" ? [] : refs.basePath,
18984
18984
  refs.definitionPath,
18985
- name144
18985
+ name145
18986
18986
  ].join("/"),
18987
18987
  [refs.definitionPath]: {
18988
18988
  ...definitions,
18989
- [name144]: main
18989
+ [name145]: main
18990
18990
  }
18991
18991
  };
18992
18992
  combined.$schema = "http://json-schema.org/draft-07/schema#";
@@ -18994,8 +18994,8 @@ var zodToJsonSchema23 = (schema, options) => {
18994
18994
  };
18995
18995
  var zod_to_json_schema_default = zodToJsonSchema23;
18996
18996
  function zod3Schema(zodSchema222, options) {
18997
- var _a154;
18998
- const useReferences = (_a154 = void 0) != null ? _a154 : false;
18997
+ var _a155;
18998
+ const useReferences = (_a155 = void 0) != null ? _a155 : false;
18999
18999
  return jsonSchema22(
19000
19000
  // defer json schema creation to avoid unnecessary computation when only validation is needed
19001
19001
  () => zod_to_json_schema_default(zodSchema222, {
@@ -19010,8 +19010,8 @@ function zod3Schema(zodSchema222, options) {
19010
19010
  );
19011
19011
  }
19012
19012
  function zod4Schema(zodSchema222, options) {
19013
- var _a154;
19014
- const useReferences = (_a154 = void 0) != null ? _a154 : false;
19013
+ var _a155;
19014
+ const useReferences = (_a155 = void 0) != null ? _a155 : false;
19015
19015
  return jsonSchema22(
19016
19016
  // defer json schema creation to avoid unnecessary computation when only validation is needed
19017
19017
  () => z42.toJSONSchema(zodSchema222, {
@@ -19074,8 +19074,8 @@ var require_get_context = __commonJS$1({
19074
19074
  var __getOwnPropNames22 = Object.getOwnPropertyNames;
19075
19075
  var __hasOwnProp22 = Object.prototype.hasOwnProperty;
19076
19076
  var __export222 = (target, all) => {
19077
- for (var name162 in all)
19078
- __defProp222(target, name162, { get: all[name162], enumerable: true });
19077
+ for (var name163 in all)
19078
+ __defProp222(target, name163, { get: all[name163], enumerable: true });
19079
19079
  };
19080
19080
  var __copyProps22 = (to, from, except, desc) => {
19081
19081
  if (from && typeof from === "object" || typeof from === "function") {
@@ -19106,8 +19106,8 @@ var require_get_vercel_oidc_token = __commonJS$1({
19106
19106
  var __getOwnPropNames22 = Object.getOwnPropertyNames;
19107
19107
  var __hasOwnProp22 = Object.prototype.hasOwnProperty;
19108
19108
  var __export222 = (target, all) => {
19109
- for (var name162 in all)
19110
- __defProp222(target, name162, { get: all[name162], enumerable: true });
19109
+ for (var name163 in all)
19110
+ __defProp222(target, name163, { get: all[name163], enumerable: true });
19111
19111
  };
19112
19112
  var __copyProps22 = (to, from, except, desc) => {
19113
19113
  if (from && typeof from === "object" || typeof from === "function") {
@@ -19170,8 +19170,8 @@ var require_dist = __commonJS$1({
19170
19170
  var __getOwnPropNames22 = Object.getOwnPropertyNames;
19171
19171
  var __hasOwnProp22 = Object.prototype.hasOwnProperty;
19172
19172
  var __export222 = (target, all) => {
19173
- for (var name162 in all)
19174
- __defProp222(target, name162, { get: all[name162], enumerable: true });
19173
+ for (var name163 in all)
19174
+ __defProp222(target, name163, { get: all[name163], enumerable: true });
19175
19175
  };
19176
19176
  var __copyProps22 = (to, from, except, desc) => {
19177
19177
  if (from && typeof from === "object" || typeof from === "function") {
@@ -20124,11 +20124,11 @@ var major22 = VERSION222.split(".")[0];
20124
20124
  var GLOBAL_OPENTELEMETRY_API_KEY22 = /* @__PURE__ */ Symbol.for("opentelemetry.js.api." + major22);
20125
20125
  var _global22 = _globalThis22;
20126
20126
  function registerGlobal22(type, instance, diag, allowOverride) {
20127
- var _a162;
20127
+ var _a163;
20128
20128
  if (allowOverride === void 0) {
20129
20129
  allowOverride = false;
20130
20130
  }
20131
- var api = _global22[GLOBAL_OPENTELEMETRY_API_KEY22] = (_a162 = _global22[GLOBAL_OPENTELEMETRY_API_KEY22]) !== null && _a162 !== void 0 ? _a162 : {
20131
+ var api = _global22[GLOBAL_OPENTELEMETRY_API_KEY22] = (_a163 = _global22[GLOBAL_OPENTELEMETRY_API_KEY22]) !== null && _a163 !== void 0 ? _a163 : {
20132
20132
  version: VERSION222
20133
20133
  };
20134
20134
  if (!allowOverride && api[type]) {
@@ -20146,8 +20146,8 @@ function registerGlobal22(type, instance, diag, allowOverride) {
20146
20146
  return true;
20147
20147
  }
20148
20148
  function getGlobal22(type) {
20149
- var _a162, _b83;
20150
- var globalVersion = (_a162 = _global22[GLOBAL_OPENTELEMETRY_API_KEY22]) === null || _a162 === void 0 ? void 0 : _a162.version;
20149
+ var _a163, _b83;
20150
+ var globalVersion = (_a163 = _global22[GLOBAL_OPENTELEMETRY_API_KEY22]) === null || _a163 === void 0 ? void 0 : _a163.version;
20151
20151
  if (!globalVersion || !isCompatible22(globalVersion)) {
20152
20152
  return;
20153
20153
  }
@@ -20316,13 +20316,13 @@ var DiagAPI22 = (
20316
20316
  }
20317
20317
  var self = this;
20318
20318
  var setLogger = function(logger, optionsOrLogLevel) {
20319
- var _a162, _b83, _c;
20319
+ var _a163, _b83, _c;
20320
20320
  if (optionsOrLogLevel === void 0) {
20321
20321
  optionsOrLogLevel = { logLevel: DiagLogLevel22.INFO };
20322
20322
  }
20323
20323
  if (logger === self) {
20324
20324
  var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
20325
- self.error((_a162 = err.stack) !== null && _a162 !== void 0 ? _a162 : err.message);
20325
+ self.error((_a163 = err.stack) !== null && _a163 !== void 0 ? _a163 : err.message);
20326
20326
  return false;
20327
20327
  }
20328
20328
  if (typeof optionsOrLogLevel === "number") {
@@ -20374,14 +20374,14 @@ var BaseContext22 = (
20374
20374
  return self._currentContext.get(key);
20375
20375
  };
20376
20376
  self.setValue = function(key, value) {
20377
- var context = new BaseContext222(self._currentContext);
20378
- context._currentContext.set(key, value);
20379
- return context;
20377
+ var context2 = new BaseContext222(self._currentContext);
20378
+ context2._currentContext.set(key, value);
20379
+ return context2;
20380
20380
  };
20381
20381
  self.deleteValue = function(key) {
20382
- var context = new BaseContext222(self._currentContext);
20383
- context._currentContext.delete(key);
20384
- return context;
20382
+ var context2 = new BaseContext222(self._currentContext);
20383
+ context2._currentContext.delete(key);
20384
+ return context2;
20385
20385
  };
20386
20386
  }
20387
20387
  return BaseContext222;
@@ -20486,16 +20486,16 @@ var ContextAPI22 = (
20486
20486
  ContextAPI222.prototype.active = function() {
20487
20487
  return this._getContextManager().active();
20488
20488
  };
20489
- ContextAPI222.prototype.with = function(context, fn, thisArg) {
20490
- var _a162;
20489
+ ContextAPI222.prototype.with = function(context2, fn, thisArg) {
20490
+ var _a163;
20491
20491
  var args = [];
20492
20492
  for (var _i = 3; _i < arguments.length; _i++) {
20493
20493
  args[_i - 3] = arguments[_i];
20494
20494
  }
20495
- return (_a162 = this._getContextManager()).with.apply(_a162, __spreadArray422([context, fn, thisArg], __read422(args), false));
20495
+ return (_a163 = this._getContextManager()).with.apply(_a163, __spreadArray422([context2, fn, thisArg], __read422(args), false));
20496
20496
  };
20497
- ContextAPI222.prototype.bind = function(context, target) {
20498
- return this._getContextManager().bind(context, target);
20497
+ ContextAPI222.prototype.bind = function(context2, target) {
20498
+ return this._getContextManager().bind(context2, target);
20499
20499
  };
20500
20500
  ContextAPI222.prototype._getContextManager = function() {
20501
20501
  return getGlobal22(API_NAME222) || NOOP_CONTEXT_MANAGER22;
@@ -20563,24 +20563,24 @@ var NonRecordingSpan22 = (
20563
20563
  })()
20564
20564
  );
20565
20565
  var SPAN_KEY22 = createContextKey22("OpenTelemetry Context Key SPAN");
20566
- function getSpan22(context) {
20567
- return context.getValue(SPAN_KEY22) || void 0;
20566
+ function getSpan22(context2) {
20567
+ return context2.getValue(SPAN_KEY22) || void 0;
20568
20568
  }
20569
20569
  function getActiveSpan22() {
20570
20570
  return getSpan22(ContextAPI22.getInstance().active());
20571
20571
  }
20572
- function setSpan22(context, span) {
20573
- return context.setValue(SPAN_KEY22, span);
20572
+ function setSpan22(context2, span) {
20573
+ return context2.setValue(SPAN_KEY22, span);
20574
20574
  }
20575
- function deleteSpan22(context) {
20576
- return context.deleteValue(SPAN_KEY22);
20575
+ function deleteSpan22(context2) {
20576
+ return context2.deleteValue(SPAN_KEY22);
20577
20577
  }
20578
- function setSpanContext22(context, spanContext) {
20579
- return setSpan22(context, new NonRecordingSpan22(spanContext));
20578
+ function setSpanContext22(context2, spanContext) {
20579
+ return setSpan22(context2, new NonRecordingSpan22(spanContext));
20580
20580
  }
20581
- function getSpanContext22(context) {
20582
- var _a162;
20583
- return (_a162 = getSpan22(context)) === null || _a162 === void 0 ? void 0 : _a162.spanContext();
20581
+ function getSpanContext22(context2) {
20582
+ var _a163;
20583
+ return (_a163 = getSpan22(context2)) === null || _a163 === void 0 ? void 0 : _a163.spanContext();
20584
20584
  }
20585
20585
  var VALID_TRACEID_REGEX22 = /^([0-9a-f]{32})$/i;
20586
20586
  var VALID_SPANID_REGEX22 = /^[0-9a-f]{16}$/i;
@@ -20602,22 +20602,22 @@ var NoopTracer22 = (
20602
20602
  (function() {
20603
20603
  function NoopTracer222() {
20604
20604
  }
20605
- NoopTracer222.prototype.startSpan = function(name162, options, context) {
20606
- if (context === void 0) {
20607
- context = contextApi22.active();
20605
+ NoopTracer222.prototype.startSpan = function(name163, options, context2) {
20606
+ if (context2 === void 0) {
20607
+ context2 = contextApi22.active();
20608
20608
  }
20609
20609
  var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
20610
20610
  if (root) {
20611
20611
  return new NonRecordingSpan22();
20612
20612
  }
20613
- var parentFromContext = context && getSpanContext22(context);
20613
+ var parentFromContext = context2 && getSpanContext22(context2);
20614
20614
  if (isSpanContext22(parentFromContext) && isSpanContextValid22(parentFromContext)) {
20615
20615
  return new NonRecordingSpan22(parentFromContext);
20616
20616
  } else {
20617
20617
  return new NonRecordingSpan22();
20618
20618
  }
20619
20619
  };
20620
- NoopTracer222.prototype.startActiveSpan = function(name162, arg2, arg3, arg4) {
20620
+ NoopTracer222.prototype.startActiveSpan = function(name163, arg2, arg3, arg4) {
20621
20621
  var opts;
20622
20622
  var ctx;
20623
20623
  var fn;
@@ -20634,7 +20634,7 @@ var NoopTracer22 = (
20634
20634
  fn = arg4;
20635
20635
  }
20636
20636
  var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi22.active();
20637
- var span = this.startSpan(name162, opts, parentContext);
20637
+ var span = this.startSpan(name163, opts, parentContext);
20638
20638
  var contextWithSpanSet = setSpan22(parentContext, span);
20639
20639
  return contextApi22.with(contextWithSpanSet, fn, void 0, span);
20640
20640
  };
@@ -20648,14 +20648,14 @@ var NOOP_TRACER22 = new NoopTracer22();
20648
20648
  var ProxyTracer22 = (
20649
20649
  /** @class */
20650
20650
  (function() {
20651
- function ProxyTracer222(_provider, name162, version, options) {
20651
+ function ProxyTracer222(_provider, name163, version, options) {
20652
20652
  this._provider = _provider;
20653
- this.name = name162;
20653
+ this.name = name163;
20654
20654
  this.version = version;
20655
20655
  this.options = options;
20656
20656
  }
20657
- ProxyTracer222.prototype.startSpan = function(name162, options, context) {
20658
- return this._getTracer().startSpan(name162, options, context);
20657
+ ProxyTracer222.prototype.startSpan = function(name163, options, context2) {
20658
+ return this._getTracer().startSpan(name163, options, context2);
20659
20659
  };
20660
20660
  ProxyTracer222.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
20661
20661
  var tracer = this._getTracer();
@@ -20692,20 +20692,20 @@ var ProxyTracerProvider22 = (
20692
20692
  (function() {
20693
20693
  function ProxyTracerProvider222() {
20694
20694
  }
20695
- ProxyTracerProvider222.prototype.getTracer = function(name162, version, options) {
20696
- var _a162;
20697
- return (_a162 = this.getDelegateTracer(name162, version, options)) !== null && _a162 !== void 0 ? _a162 : new ProxyTracer22(this, name162, version, options);
20695
+ ProxyTracerProvider222.prototype.getTracer = function(name163, version, options) {
20696
+ var _a163;
20697
+ return (_a163 = this.getDelegateTracer(name163, version, options)) !== null && _a163 !== void 0 ? _a163 : new ProxyTracer22(this, name163, version, options);
20698
20698
  };
20699
20699
  ProxyTracerProvider222.prototype.getDelegate = function() {
20700
- var _a162;
20701
- return (_a162 = this._delegate) !== null && _a162 !== void 0 ? _a162 : NOOP_TRACER_PROVIDER22;
20700
+ var _a163;
20701
+ return (_a163 = this._delegate) !== null && _a163 !== void 0 ? _a163 : NOOP_TRACER_PROVIDER22;
20702
20702
  };
20703
20703
  ProxyTracerProvider222.prototype.setDelegate = function(delegate) {
20704
20704
  this._delegate = delegate;
20705
20705
  };
20706
- ProxyTracerProvider222.prototype.getDelegateTracer = function(name162, version, options) {
20707
- var _a162;
20708
- return (_a162 = this._delegate) === null || _a162 === void 0 ? void 0 : _a162.getTracer(name162, version, options);
20706
+ ProxyTracerProvider222.prototype.getDelegateTracer = function(name163, version, options) {
20707
+ var _a163;
20708
+ return (_a163 = this._delegate) === null || _a163 === void 0 ? void 0 : _a163.getTracer(name163, version, options);
20709
20709
  };
20710
20710
  return ProxyTracerProvider222;
20711
20711
  })()
@@ -20747,8 +20747,8 @@ var TraceAPI22 = (
20747
20747
  TraceAPI222.prototype.getTracerProvider = function() {
20748
20748
  return getGlobal22(API_NAME322) || this._proxyTracerProvider;
20749
20749
  };
20750
- TraceAPI222.prototype.getTracer = function(name162, version) {
20751
- return this.getTracerProvider().getTracer(name162, version);
20750
+ TraceAPI222.prototype.getTracer = function(name163, version) {
20751
+ return this.getTracerProvider().getTracer(name163, version);
20752
20752
  };
20753
20753
  TraceAPI222.prototype.disable = function() {
20754
20754
  unregisterGlobal22(API_NAME322, DiagAPI22.instance());
@@ -20760,8 +20760,8 @@ var TraceAPI22 = (
20760
20760
  var trace2 = TraceAPI22.getInstance();
20761
20761
  var __defProp32 = Object.defineProperty;
20762
20762
  var __export22 = (target, all) => {
20763
- for (var name162 in all)
20764
- __defProp32(target, name162, { get: all[name162], enumerable: true });
20763
+ for (var name163 in all)
20764
+ __defProp32(target, name163, { get: all[name163], enumerable: true });
20765
20765
  };
20766
20766
  var name222 = "AI_InvalidArgumentError";
20767
20767
  var marker2222 = `vercel.ai.error.${name222}`;
@@ -20859,8 +20859,8 @@ function resolveEmbeddingModel(model) {
20859
20859
  );
20860
20860
  }
20861
20861
  function getGlobalProvider() {
20862
- var _a162;
20863
- return (_a162 = globalThis.AI_SDK_DEFAULT_PROVIDER) != null ? _a162 : gateway;
20862
+ var _a163;
20863
+ return (_a163 = globalThis.AI_SDK_DEFAULT_PROVIDER) != null ? _a163 : gateway;
20864
20864
  }
20865
20865
  var VERSION32 = "5.0.101";
20866
20866
  var dataContentSchema22 = z$1.union([
@@ -20870,8 +20870,8 @@ var dataContentSchema22 = z$1.union([
20870
20870
  z$1.custom(
20871
20871
  // Buffer might not be available in some environments such as CloudFlare:
20872
20872
  (value) => {
20873
- var _a162, _b83;
20874
- return (_b83 = (_a162 = globalThis.Buffer) == null ? void 0 : _a162.isBuffer(value)) != null ? _b83 : false;
20873
+ var _a163, _b83;
20874
+ return (_b83 = (_a163 = globalThis.Buffer) == null ? void 0 : _a163.isBuffer(value)) != null ? _b83 : false;
20875
20875
  },
20876
20876
  { message: "Must be a Buffer" }
20877
20877
  )
@@ -21023,7 +21023,7 @@ function getBaseTelemetryAttributes2({
21023
21023
  telemetry,
21024
21024
  headers
21025
21025
  }) {
21026
- var _a162;
21026
+ var _a163;
21027
21027
  return {
21028
21028
  "ai.model.provider": model.provider,
21029
21029
  "ai.model.id": model.modelId,
@@ -21033,7 +21033,7 @@ function getBaseTelemetryAttributes2({
21033
21033
  return attributes;
21034
21034
  }, {}),
21035
21035
  // add metadata as attributes:
21036
- ...Object.entries((_a162 = telemetry == null ? void 0 : telemetry.metadata) != null ? _a162 : {}).reduce(
21036
+ ...Object.entries((_a163 = telemetry == null ? void 0 : telemetry.metadata) != null ? _a163 : {}).reduce(
21037
21037
  (attributes, [key, value]) => {
21038
21038
  attributes[`ai.telemetry.metadata.${key}`] = value;
21039
21039
  return attributes;
@@ -21053,7 +21053,7 @@ var noopTracer2 = {
21053
21053
  startSpan() {
21054
21054
  return noopSpan2;
21055
21055
  },
21056
- startActiveSpan(name162, arg1, arg2, arg3) {
21056
+ startActiveSpan(name163, arg1, arg2, arg3) {
21057
21057
  if (typeof arg1 === "function") {
21058
21058
  return arg1(noopSpan2);
21059
21059
  }
@@ -21118,13 +21118,13 @@ function getTracer2({
21118
21118
  return trace2.getTracer("ai");
21119
21119
  }
21120
21120
  function recordSpan2({
21121
- name: name162,
21121
+ name: name163,
21122
21122
  tracer,
21123
21123
  attributes,
21124
21124
  fn,
21125
21125
  endWhenDone = true
21126
21126
  }) {
21127
- return tracer.startActiveSpan(name162, { attributes }, async (span) => {
21127
+ return tracer.startActiveSpan(name163, { attributes }, async (span) => {
21128
21128
  try {
21129
21129
  const result = await fn(span);
21130
21130
  if (endWhenDone) {
@@ -21696,7 +21696,7 @@ async function embedMany2({
21696
21696
  }),
21697
21697
  tracer,
21698
21698
  fn: async (span) => {
21699
- var _a162;
21699
+ var _a163;
21700
21700
  const [maxEmbeddingsPerCall, supportsParallelCalls] = await Promise.all([
21701
21701
  model.maxEmbeddingsPerCall,
21702
21702
  model.supportsParallelCalls
@@ -21722,7 +21722,7 @@ async function embedMany2({
21722
21722
  }),
21723
21723
  tracer,
21724
21724
  fn: async (doEmbedSpan) => {
21725
- var _a172;
21725
+ var _a173;
21726
21726
  const modelResponse = await model.doEmbed({
21727
21727
  values,
21728
21728
  abortSignal,
@@ -21730,7 +21730,7 @@ async function embedMany2({
21730
21730
  providerOptions
21731
21731
  });
21732
21732
  const embeddings3 = modelResponse.embeddings;
21733
- const usage2 = (_a172 = modelResponse.usage) != null ? _a172 : { tokens: NaN };
21733
+ const usage2 = (_a173 = modelResponse.usage) != null ? _a173 : { tokens: NaN };
21734
21734
  doEmbedSpan.setAttributes(
21735
21735
  selectTelemetryAttributes2({
21736
21736
  telemetry,
@@ -21804,7 +21804,7 @@ async function embedMany2({
21804
21804
  }),
21805
21805
  tracer,
21806
21806
  fn: async (doEmbedSpan) => {
21807
- var _a172;
21807
+ var _a173;
21808
21808
  const modelResponse = await model.doEmbed({
21809
21809
  values: chunk,
21810
21810
  abortSignal,
@@ -21812,7 +21812,7 @@ async function embedMany2({
21812
21812
  providerOptions
21813
21813
  });
21814
21814
  const embeddings2 = modelResponse.embeddings;
21815
- const usage = (_a172 = modelResponse.usage) != null ? _a172 : { tokens: NaN };
21815
+ const usage = (_a173 = modelResponse.usage) != null ? _a173 : { tokens: NaN };
21816
21816
  doEmbedSpan.setAttributes(
21817
21817
  selectTelemetryAttributes2({
21818
21818
  telemetry,
@@ -21849,7 +21849,7 @@ async function embedMany2({
21849
21849
  result.providerMetadata
21850
21850
  )) {
21851
21851
  providerMetadata[providerName] = {
21852
- ...(_a162 = providerMetadata[providerName]) != null ? _a162 : {},
21852
+ ...(_a163 = providerMetadata[providerName]) != null ? _a163 : {},
21853
21853
  ...metadata
21854
21854
  };
21855
21855
  }
@@ -21932,16 +21932,16 @@ var object22 = ({
21932
21932
  }
21933
21933
  }
21934
21934
  },
21935
- async parseOutput({ text: text222 }, context) {
21935
+ async parseOutput({ text: text222 }, context2) {
21936
21936
  const parseResult = await safeParseJSON22({ text: text222 });
21937
21937
  if (!parseResult.success) {
21938
21938
  throw new NoObjectGeneratedError22({
21939
21939
  message: "No object generated: could not parse the response.",
21940
21940
  cause: parseResult.error,
21941
21941
  text: text222,
21942
- response: context.response,
21943
- usage: context.usage,
21944
- finishReason: context.finishReason
21942
+ response: context2.response,
21943
+ usage: context2.usage,
21944
+ finishReason: context2.finishReason
21945
21945
  });
21946
21946
  }
21947
21947
  const validationResult = await safeValidateTypes22({
@@ -21953,9 +21953,9 @@ var object22 = ({
21953
21953
  message: "No object generated: response did not match schema.",
21954
21954
  cause: validationResult.error,
21955
21955
  text: text222,
21956
- response: context.response,
21957
- usage: context.usage,
21958
- finishReason: context.finishReason
21956
+ response: context2.response,
21957
+ usage: context2.usage,
21958
+ finishReason: context2.finishReason
21959
21959
  });
21960
21960
  }
21961
21961
  return validationResult.value;
@@ -22105,34 +22105,61 @@ var symbol135 = Symbol.for(marker135);
22105
22105
  var _a135;
22106
22106
  var _b13;
22107
22107
  var TypeValidationError3 = class _TypeValidationError4 extends (_b13 = AISDKError3, _a135 = symbol135, _b13) {
22108
- constructor({ value, cause }) {
22108
+ constructor({
22109
+ value,
22110
+ cause,
22111
+ context: context2
22112
+ }) {
22113
+ let contextPrefix = "Type validation failed";
22114
+ if (context2 == null ? void 0 : context2.field) {
22115
+ contextPrefix += ` for ${context2.field}`;
22116
+ }
22117
+ if ((context2 == null ? void 0 : context2.entityName) || (context2 == null ? void 0 : context2.entityId)) {
22118
+ contextPrefix += " (";
22119
+ const parts = [];
22120
+ if (context2.entityName) {
22121
+ parts.push(context2.entityName);
22122
+ }
22123
+ if (context2.entityId) {
22124
+ parts.push(`id: "${context2.entityId}"`);
22125
+ }
22126
+ contextPrefix += parts.join(", ");
22127
+ contextPrefix += ")";
22128
+ }
22109
22129
  super({
22110
22130
  name: name125,
22111
- message: `Type validation failed: Value: ${JSON.stringify(value)}.
22131
+ message: `${contextPrefix}: Value: ${JSON.stringify(value)}.
22112
22132
  Error message: ${getErrorMessage4(cause)}`,
22113
22133
  cause
22114
22134
  });
22115
22135
  this[_a135] = true;
22116
22136
  this.value = value;
22137
+ this.context = context2;
22117
22138
  }
22118
22139
  static isInstance(error) {
22119
22140
  return AISDKError3.hasMarker(error, marker135);
22120
22141
  }
22121
22142
  /**
22122
22143
  * Wraps an error into a TypeValidationError.
22123
- * If the cause is already a TypeValidationError with the same value, it returns the cause.
22144
+ * If the cause is already a TypeValidationError with the same value and context, it returns the cause.
22124
22145
  * Otherwise, it creates a new TypeValidationError.
22125
22146
  *
22126
22147
  * @param {Object} params - The parameters for wrapping the error.
22127
22148
  * @param {unknown} params.value - The value that failed validation.
22128
22149
  * @param {unknown} params.cause - The original error or cause of the validation failure.
22150
+ * @param {TypeValidationContext} params.context - Optional context about what is being validated.
22129
22151
  * @returns {TypeValidationError} A TypeValidationError instance.
22130
22152
  */
22131
22153
  static wrap({
22132
22154
  value,
22133
- cause
22155
+ cause,
22156
+ context: context2
22134
22157
  }) {
22135
- return _TypeValidationError4.isInstance(cause) && cause.value === value ? cause : new _TypeValidationError4({ value, cause });
22158
+ var _a1522, _b152, _c;
22159
+ if (_TypeValidationError4.isInstance(cause) && cause.value === value && ((_a1522 = cause.context) == null ? void 0 : _a1522.field) === (context2 == null ? void 0 : context2.field) && ((_b152 = cause.context) == null ? void 0 : _b152.entityName) === (context2 == null ? void 0 : context2.entityName) && ((_c = cause.context) == null ? void 0 : _c.entityId) === (context2 == null ? void 0 : context2.entityId)) {
22160
+ return cause;
22161
+ }
22162
+ return new _TypeValidationError4({ value, cause, context: context2 });
22136
22163
  }
22137
22164
  };
22138
22165
  var ParseError2 = class extends Error {
@@ -22298,6 +22325,14 @@ function createAbortError2() {
22298
22325
  function extractResponseHeaders2(response) {
22299
22326
  return Object.fromEntries([...response.headers]);
22300
22327
  }
22328
+ var { btoa: btoa3 } = globalThis;
22329
+ function convertUint8ArrayToBase643(array2) {
22330
+ let latin1string = "";
22331
+ for (let i = 0; i < array2.length; i++) {
22332
+ latin1string += String.fromCodePoint(array2[i]);
22333
+ }
22334
+ return btoa3(latin1string);
22335
+ }
22301
22336
  var createIdGenerator3 = ({
22302
22337
  prefix,
22303
22338
  size = 16,
@@ -22341,6 +22376,25 @@ function isAbortError3(error) {
22341
22376
  error.name === "TimeoutError");
22342
22377
  }
22343
22378
  var FETCH_FAILED_ERROR_MESSAGES2 = ["fetch failed", "failed to fetch"];
22379
+ var BUN_ERROR_CODES = [
22380
+ "ConnectionRefused",
22381
+ "ConnectionClosed",
22382
+ "FailedToOpenSocket",
22383
+ "ECONNRESET",
22384
+ "ECONNREFUSED",
22385
+ "ETIMEDOUT",
22386
+ "EPIPE"
22387
+ ];
22388
+ function isBunNetworkError(error) {
22389
+ if (!(error instanceof Error)) {
22390
+ return false;
22391
+ }
22392
+ const code = error.code;
22393
+ if (typeof code === "string" && BUN_ERROR_CODES.includes(code)) {
22394
+ return true;
22395
+ }
22396
+ return false;
22397
+ }
22344
22398
  function handleFetchError2({
22345
22399
  error,
22346
22400
  url,
@@ -22362,6 +22416,15 @@ function handleFetchError2({
22362
22416
  });
22363
22417
  }
22364
22418
  }
22419
+ if (isBunNetworkError(error)) {
22420
+ return new APICallError3({
22421
+ message: `Cannot connect to API: ${error.message}`,
22422
+ cause: error,
22423
+ url,
22424
+ requestBodyValues,
22425
+ isRetryable: true
22426
+ });
22427
+ }
22365
22428
  return error;
22366
22429
  }
22367
22430
  function getRuntimeEnvironmentUserAgent2(globalThisAny = globalThis) {
@@ -22410,7 +22473,7 @@ function withUserAgentSuffix2(headers, ...userAgentSuffixParts) {
22410
22473
  );
22411
22474
  return Object.fromEntries(normalizedHeaders.entries());
22412
22475
  }
22413
- var VERSION4 = "4.0.0";
22476
+ var VERSION4 = "4.0.13";
22414
22477
  var getOriginalFetch3 = () => globalThis.fetch;
22415
22478
  var getFromApi2 = async ({
22416
22479
  url,
@@ -22543,30 +22606,39 @@ function secureJsonParse2(text42) {
22543
22606
  }
22544
22607
  }
22545
22608
  function addAdditionalPropertiesToJsonSchema(jsonSchema222) {
22546
- if (jsonSchema222.type === "object") {
22609
+ if (jsonSchema222.type === "object" || Array.isArray(jsonSchema222.type) && jsonSchema222.type.includes("object")) {
22547
22610
  jsonSchema222.additionalProperties = false;
22548
- const properties = jsonSchema222.properties;
22611
+ const { properties } = jsonSchema222;
22549
22612
  if (properties != null) {
22550
- for (const property in properties) {
22551
- properties[property] = addAdditionalPropertiesToJsonSchema(
22552
- properties[property]
22553
- );
22613
+ for (const key of Object.keys(properties)) {
22614
+ properties[key] = visit(properties[key]);
22554
22615
  }
22555
22616
  }
22556
22617
  }
22557
- if (jsonSchema222.type === "array" && jsonSchema222.items != null) {
22558
- if (Array.isArray(jsonSchema222.items)) {
22559
- jsonSchema222.items = jsonSchema222.items.map(
22560
- (item) => addAdditionalPropertiesToJsonSchema(item)
22561
- );
22562
- } else {
22563
- jsonSchema222.items = addAdditionalPropertiesToJsonSchema(
22564
- jsonSchema222.items
22565
- );
22618
+ if (jsonSchema222.items != null) {
22619
+ jsonSchema222.items = Array.isArray(jsonSchema222.items) ? jsonSchema222.items.map(visit) : visit(jsonSchema222.items);
22620
+ }
22621
+ if (jsonSchema222.anyOf != null) {
22622
+ jsonSchema222.anyOf = jsonSchema222.anyOf.map(visit);
22623
+ }
22624
+ if (jsonSchema222.allOf != null) {
22625
+ jsonSchema222.allOf = jsonSchema222.allOf.map(visit);
22626
+ }
22627
+ if (jsonSchema222.oneOf != null) {
22628
+ jsonSchema222.oneOf = jsonSchema222.oneOf.map(visit);
22629
+ }
22630
+ const { definitions } = jsonSchema222;
22631
+ if (definitions != null) {
22632
+ for (const key of Object.keys(definitions)) {
22633
+ definitions[key] = visit(definitions[key]);
22566
22634
  }
22567
22635
  }
22568
22636
  return jsonSchema222;
22569
22637
  }
22638
+ function visit(def) {
22639
+ if (typeof def === "boolean") return def;
22640
+ return addAdditionalPropertiesToJsonSchema(def);
22641
+ }
22570
22642
  var ignoreOverride32 = /* @__PURE__ */ Symbol(
22571
22643
  "Let zodToJsonSchema decide on which parser to use"
22572
22644
  );
@@ -23683,9 +23755,11 @@ function asSchema3(schema) {
23683
23755
  }
23684
23756
  function standardSchema(standardSchema2) {
23685
23757
  return jsonSchema3(
23686
- () => standardSchema2["~standard"].jsonSchema.input({
23687
- target: "draft-07"
23688
- }),
23758
+ () => addAdditionalPropertiesToJsonSchema(
23759
+ standardSchema2["~standard"].jsonSchema.input({
23760
+ target: "draft-07"
23761
+ })
23762
+ ),
23689
23763
  {
23690
23764
  validate: async (value) => {
23691
23765
  const result = await standardSchema2["~standard"].validate(value);
@@ -23748,17 +23822,19 @@ function zodSchema3(zodSchema222, options) {
23748
23822
  }
23749
23823
  async function validateTypes2({
23750
23824
  value,
23751
- schema
23825
+ schema,
23826
+ context: context2
23752
23827
  }) {
23753
- const result = await safeValidateTypes3({ value, schema });
23828
+ const result = await safeValidateTypes3({ value, schema, context: context2 });
23754
23829
  if (!result.success) {
23755
- throw TypeValidationError3.wrap({ value, cause: result.error });
23830
+ throw TypeValidationError3.wrap({ value, cause: result.error, context: context2 });
23756
23831
  }
23757
23832
  return result.value;
23758
23833
  }
23759
23834
  async function safeValidateTypes3({
23760
23835
  value,
23761
- schema
23836
+ schema,
23837
+ context: context2
23762
23838
  }) {
23763
23839
  const actualSchema = asSchema3(schema);
23764
23840
  try {
@@ -23771,13 +23847,13 @@ async function safeValidateTypes3({
23771
23847
  }
23772
23848
  return {
23773
23849
  success: false,
23774
- error: TypeValidationError3.wrap({ value, cause: result.error }),
23850
+ error: TypeValidationError3.wrap({ value, cause: result.error, context: context2 }),
23775
23851
  rawValue: value
23776
23852
  };
23777
23853
  } catch (error) {
23778
23854
  return {
23779
23855
  success: false,
23780
- error: TypeValidationError3.wrap({ value, cause: error }),
23856
+ error: TypeValidationError3.wrap({ value, cause: error, context: context2 }),
23781
23857
  rawValue: value
23782
23858
  };
23783
23859
  }
@@ -23925,6 +24001,38 @@ var postToApi2 = async ({
23925
24001
  throw handleFetchError2({ error, url, requestBodyValues: body.values });
23926
24002
  }
23927
24003
  };
24004
+ function tool(tool2) {
24005
+ return tool2;
24006
+ }
24007
+ function createProviderToolFactoryWithOutputSchema({
24008
+ id,
24009
+ inputSchema,
24010
+ outputSchema: outputSchema32,
24011
+ supportsDeferredResults
24012
+ }) {
24013
+ return ({
24014
+ execute,
24015
+ needsApproval,
24016
+ toModelOutput,
24017
+ onInputStart,
24018
+ onInputDelta,
24019
+ onInputAvailable,
24020
+ ...args
24021
+ }) => tool({
24022
+ type: "provider",
24023
+ id,
24024
+ args,
24025
+ inputSchema,
24026
+ outputSchema: outputSchema32,
24027
+ execute,
24028
+ needsApproval,
24029
+ toModelOutput,
24030
+ onInputStart,
24031
+ onInputDelta,
24032
+ onInputAvailable,
24033
+ supportsDeferredResults
24034
+ });
24035
+ }
23928
24036
  async function resolve2(value) {
23929
24037
  if (typeof value === "function") {
23930
24038
  value = value();
@@ -24026,14 +24134,14 @@ function withoutTrailingSlash2(url) {
24026
24134
  return url == null ? void 0 : url.replace(/\/$/, "");
24027
24135
  }
24028
24136
  var require_get_context2 = __commonJS$2({
24029
- "../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-context.js"(exports$1, module) {
24137
+ "../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/get-context.js"(exports$1, module) {
24030
24138
  var __defProp222 = Object.defineProperty;
24031
24139
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
24032
24140
  var __getOwnPropNames22 = Object.getOwnPropertyNames;
24033
24141
  var __hasOwnProp22 = Object.prototype.hasOwnProperty;
24034
24142
  var __export222 = (target, all) => {
24035
- for (var name144 in all)
24036
- __defProp222(target, name144, { get: all[name144], enumerable: true });
24143
+ for (var name21 in all)
24144
+ __defProp222(target, name21, { get: all[name21], enumerable: true });
24037
24145
  };
24038
24146
  var __copyProps22 = (to, from, except, desc) => {
24039
24147
  if (from && typeof from === "object" || typeof from === "function") {
@@ -24058,14 +24166,14 @@ var require_get_context2 = __commonJS$2({
24058
24166
  }
24059
24167
  });
24060
24168
  var require_get_vercel_oidc_token2 = __commonJS$2({
24061
- "../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(exports$1, module) {
24169
+ "../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token.js"(exports$1, module) {
24062
24170
  var __defProp222 = Object.defineProperty;
24063
24171
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
24064
24172
  var __getOwnPropNames22 = Object.getOwnPropertyNames;
24065
24173
  var __hasOwnProp22 = Object.prototype.hasOwnProperty;
24066
24174
  var __export222 = (target, all) => {
24067
- for (var name144 in all)
24068
- __defProp222(target, name144, { get: all[name144], enumerable: true });
24175
+ for (var name21 in all)
24176
+ __defProp222(target, name21, { get: all[name21], enumerable: true });
24069
24177
  };
24070
24178
  var __copyProps22 = (to, from, except, desc) => {
24071
24179
  if (from && typeof from === "object" || typeof from === "function") {
@@ -24094,19 +24202,23 @@ var require_get_vercel_oidc_token2 = __commonJS$2({
24094
24202
  }
24095
24203
  try {
24096
24204
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
24097
- await import('./token-util-NEHG7TUY-TV2H7N56-GGCGMPDG.js'),
24098
- await import('./token-6GSAFR2W-WGTMOPEU-JKP67ZX4.js')
24205
+ await import('./token-util-RMHT2CPJ-RJEA3FAN-QWMGWKPO.js'),
24206
+ await import('./token-APYSY3BW-2DN6RAUY-6HYAXQSH.js')
24099
24207
  ]);
24100
24208
  if (!token || isExpired(getTokenPayload(token))) {
24101
24209
  await refreshToken();
24102
24210
  token = getVercelOidcTokenSync2();
24103
24211
  }
24104
24212
  } catch (error) {
24105
- if (err?.message && error instanceof Error) {
24106
- error.message = `${err.message}
24213
+ let message = err instanceof Error ? err.message : "";
24214
+ if (error instanceof Error) {
24215
+ message = `${message}
24107
24216
  ${error.message}`;
24108
24217
  }
24109
- throw new import_token_error.VercelOidcTokenError(`Failed to refresh OIDC token`, error);
24218
+ if (message) {
24219
+ throw new import_token_error.VercelOidcTokenError(message);
24220
+ }
24221
+ throw error;
24110
24222
  }
24111
24223
  return token;
24112
24224
  }
@@ -24122,14 +24234,14 @@ ${error.message}`;
24122
24234
  }
24123
24235
  });
24124
24236
  var require_dist2 = __commonJS$2({
24125
- "../../../node_modules/.pnpm/@vercel+oidc@3.0.5/node_modules/@vercel/oidc/dist/index.js"(exports$1, module) {
24237
+ "../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/index.js"(exports$1, module) {
24126
24238
  var __defProp222 = Object.defineProperty;
24127
24239
  var __getOwnPropDesc22 = Object.getOwnPropertyDescriptor;
24128
24240
  var __getOwnPropNames22 = Object.getOwnPropertyNames;
24129
24241
  var __hasOwnProp22 = Object.prototype.hasOwnProperty;
24130
24242
  var __export222 = (target, all) => {
24131
- for (var name144 in all)
24132
- __defProp222(target, name144, { get: all[name144], enumerable: true });
24243
+ for (var name21 in all)
24244
+ __defProp222(target, name21, { get: all[name21], enumerable: true });
24133
24245
  };
24134
24246
  var __copyProps22 = (to, from, except, desc) => {
24135
24247
  if (from && typeof from === "object" || typeof from === "function") {
@@ -24161,12 +24273,14 @@ var GatewayError2 = class _GatewayError2 extends (_b16 = Error, _a20 = symbol20,
24161
24273
  constructor({
24162
24274
  message,
24163
24275
  statusCode = 500,
24164
- cause
24276
+ cause,
24277
+ generationId
24165
24278
  }) {
24166
- super(message);
24279
+ super(generationId ? `${message} [${generationId}]` : message);
24167
24280
  this[_a20] = true;
24168
24281
  this.statusCode = statusCode;
24169
24282
  this.cause = cause;
24283
+ this.generationId = generationId;
24170
24284
  }
24171
24285
  /**
24172
24286
  * Checks if the given error is a Gateway Error.
@@ -24189,9 +24303,10 @@ var GatewayAuthenticationError2 = class _GatewayAuthenticationError2 extends (_b
24189
24303
  constructor({
24190
24304
  message = "Authentication failed",
24191
24305
  statusCode = 401,
24192
- cause
24306
+ cause,
24307
+ generationId
24193
24308
  } = {}) {
24194
- super({ message, statusCode, cause });
24309
+ super({ message, statusCode, cause, generationId });
24195
24310
  this[_a26] = true;
24196
24311
  this.name = name20;
24197
24312
  this.type = "authentication_error";
@@ -24207,7 +24322,8 @@ var GatewayAuthenticationError2 = class _GatewayAuthenticationError2 extends (_b
24207
24322
  oidcTokenProvided,
24208
24323
  message = "Authentication failed",
24209
24324
  statusCode = 401,
24210
- cause
24325
+ cause,
24326
+ generationId
24211
24327
  }) {
24212
24328
  let contextualMessage;
24213
24329
  if (apiKeyProvided) {
@@ -24235,7 +24351,8 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
24235
24351
  return new _GatewayAuthenticationError2({
24236
24352
  message: contextualMessage,
24237
24353
  statusCode,
24238
- cause
24354
+ cause,
24355
+ generationId
24239
24356
  });
24240
24357
  }
24241
24358
  };
@@ -24248,9 +24365,10 @@ var GatewayInvalidRequestError2 = class extends (_b33 = GatewayError2, _a36 = sy
24248
24365
  constructor({
24249
24366
  message = "Invalid request",
24250
24367
  statusCode = 400,
24251
- cause
24368
+ cause,
24369
+ generationId
24252
24370
  } = {}) {
24253
- super({ message, statusCode, cause });
24371
+ super({ message, statusCode, cause, generationId });
24254
24372
  this[_a36] = true;
24255
24373
  this.name = name26;
24256
24374
  this.type = "invalid_request_error";
@@ -24268,9 +24386,10 @@ var GatewayRateLimitError2 = class extends (_b43 = GatewayError2, _a46 = symbol4
24268
24386
  constructor({
24269
24387
  message = "Rate limit exceeded",
24270
24388
  statusCode = 429,
24271
- cause
24389
+ cause,
24390
+ generationId
24272
24391
  } = {}) {
24273
- super({ message, statusCode, cause });
24392
+ super({ message, statusCode, cause, generationId });
24274
24393
  this[_a46] = true;
24275
24394
  this.name = name36;
24276
24395
  this.type = "rate_limit_exceeded";
@@ -24296,9 +24415,10 @@ var GatewayModelNotFoundError2 = class extends (_b53 = GatewayError2, _a56 = sym
24296
24415
  message = "Model not found",
24297
24416
  statusCode = 404,
24298
24417
  modelId,
24299
- cause
24418
+ cause,
24419
+ generationId
24300
24420
  } = {}) {
24301
- super({ message, statusCode, cause });
24421
+ super({ message, statusCode, cause, generationId });
24302
24422
  this[_a56] = true;
24303
24423
  this.name = name46;
24304
24424
  this.type = "model_not_found";
@@ -24317,9 +24437,10 @@ var GatewayInternalServerError2 = class extends (_b63 = GatewayError2, _a66 = sy
24317
24437
  constructor({
24318
24438
  message = "Internal server error",
24319
24439
  statusCode = 500,
24320
- cause
24440
+ cause,
24441
+ generationId
24321
24442
  } = {}) {
24322
- super({ message, statusCode, cause });
24443
+ super({ message, statusCode, cause, generationId });
24323
24444
  this[_a66] = true;
24324
24445
  this.name = name56;
24325
24446
  this.type = "internal_server_error";
@@ -24339,9 +24460,10 @@ var GatewayResponseError2 = class extends (_b73 = GatewayError2, _a76 = symbol76
24339
24460
  statusCode = 502,
24340
24461
  response,
24341
24462
  validationError,
24342
- cause
24463
+ cause,
24464
+ generationId
24343
24465
  } = {}) {
24344
- super({ message, statusCode, cause });
24466
+ super({ message, statusCode, cause, generationId });
24345
24467
  this[_a76] = true;
24346
24468
  this.name = name66;
24347
24469
  this.type = "response_error";
@@ -24359,34 +24481,49 @@ async function createGatewayErrorFromResponse2({
24359
24481
  cause,
24360
24482
  authMethod
24361
24483
  }) {
24484
+ var _a832;
24362
24485
  const parseResult = await safeValidateTypes3({
24363
24486
  value: response,
24364
24487
  schema: gatewayErrorResponseSchema2
24365
24488
  });
24366
24489
  if (!parseResult.success) {
24490
+ const rawGenerationId = typeof response === "object" && response !== null && "generationId" in response ? response.generationId : void 0;
24367
24491
  return new GatewayResponseError2({
24368
24492
  message: `Invalid error response format: ${defaultMessage}`,
24369
24493
  statusCode,
24370
24494
  response,
24371
24495
  validationError: parseResult.error,
24372
- cause
24496
+ cause,
24497
+ generationId: rawGenerationId
24373
24498
  });
24374
24499
  }
24375
24500
  const validatedResponse = parseResult.value;
24376
24501
  const errorType = validatedResponse.error.type;
24377
24502
  const message = validatedResponse.error.message;
24503
+ const generationId = (_a832 = validatedResponse.generationId) != null ? _a832 : void 0;
24378
24504
  switch (errorType) {
24379
24505
  case "authentication_error":
24380
24506
  return GatewayAuthenticationError2.createContextualError({
24381
24507
  apiKeyProvided: authMethod === "api-key",
24382
24508
  oidcTokenProvided: authMethod === "oidc",
24383
24509
  statusCode,
24384
- cause
24510
+ cause,
24511
+ generationId
24385
24512
  });
24386
24513
  case "invalid_request_error":
24387
- return new GatewayInvalidRequestError2({ message, statusCode, cause });
24514
+ return new GatewayInvalidRequestError2({
24515
+ message,
24516
+ statusCode,
24517
+ cause,
24518
+ generationId
24519
+ });
24388
24520
  case "rate_limit_exceeded":
24389
- return new GatewayRateLimitError2({ message, statusCode, cause });
24521
+ return new GatewayRateLimitError2({
24522
+ message,
24523
+ statusCode,
24524
+ cause,
24525
+ generationId
24526
+ });
24390
24527
  case "model_not_found": {
24391
24528
  const modelResult = await safeValidateTypes3({
24392
24529
  value: validatedResponse.error.param,
@@ -24396,13 +24533,24 @@ async function createGatewayErrorFromResponse2({
24396
24533
  message,
24397
24534
  statusCode,
24398
24535
  modelId: modelResult.success ? modelResult.value.modelId : void 0,
24399
- cause
24536
+ cause,
24537
+ generationId
24400
24538
  });
24401
24539
  }
24402
24540
  case "internal_server_error":
24403
- return new GatewayInternalServerError2({ message, statusCode, cause });
24541
+ return new GatewayInternalServerError2({
24542
+ message,
24543
+ statusCode,
24544
+ cause,
24545
+ generationId
24546
+ });
24404
24547
  default:
24405
- return new GatewayInternalServerError2({ message, statusCode, cause });
24548
+ return new GatewayInternalServerError2({
24549
+ message,
24550
+ statusCode,
24551
+ cause,
24552
+ generationId
24553
+ });
24406
24554
  }
24407
24555
  }
24408
24556
  var gatewayErrorResponseSchema2 = lazySchema(
@@ -24413,7 +24561,8 @@ var gatewayErrorResponseSchema2 = lazySchema(
24413
24561
  type: z$1.string().nullish(),
24414
24562
  param: z$1.unknown().nullish(),
24415
24563
  code: z$1.union([z$1.string(), z$1.number()]).nullish()
24416
- })
24564
+ }),
24565
+ generationId: z$1.string().nullish()
24417
24566
  })
24418
24567
  )
24419
24568
  );
@@ -24689,7 +24838,7 @@ var GatewayLanguageModel2 = class {
24689
24838
  }
24690
24839
  getModelConfigHeaders(modelId, streaming) {
24691
24840
  return {
24692
- "ai-language-model-specification-version": "2",
24841
+ "ai-language-model-specification-version": "3",
24693
24842
  "ai-language-model-id": modelId,
24694
24843
  "ai-language-model-streaming": String(streaming)
24695
24844
  };
@@ -24757,7 +24906,7 @@ var GatewayEmbeddingModel2 = class {
24757
24906
  }
24758
24907
  getModelConfigHeaders() {
24759
24908
  return {
24760
- "ai-embedding-model-specification-version": "2",
24909
+ "ai-embedding-model-specification-version": "3",
24761
24910
  "ai-model-id": this.modelId
24762
24911
  };
24763
24912
  }
@@ -24787,6 +24936,8 @@ var GatewayImageModel2 = class {
24787
24936
  size,
24788
24937
  aspectRatio,
24789
24938
  seed,
24939
+ files,
24940
+ mask,
24790
24941
  providerOptions,
24791
24942
  headers,
24792
24943
  abortSignal
@@ -24811,7 +24962,11 @@ var GatewayImageModel2 = class {
24811
24962
  ...size && { size },
24812
24963
  ...aspectRatio && { aspectRatio },
24813
24964
  ...seed && { seed },
24814
- ...providerOptions && { providerOptions }
24965
+ ...providerOptions && { providerOptions },
24966
+ ...files && {
24967
+ files: files.map((file) => maybeEncodeImageFile(file))
24968
+ },
24969
+ ...mask && { mask: maybeEncodeImageFile(mask) }
24815
24970
  },
24816
24971
  successfulResponseHandler: createJsonResponseHandler2(
24817
24972
  gatewayImageResponseSchema2
@@ -24843,11 +24998,20 @@ var GatewayImageModel2 = class {
24843
24998
  }
24844
24999
  getModelConfigHeaders() {
24845
25000
  return {
24846
- "ai-image-model-specification-version": "2",
25001
+ "ai-image-model-specification-version": "3",
24847
25002
  "ai-model-id": this.modelId
24848
25003
  };
24849
25004
  }
24850
25005
  };
25006
+ function maybeEncodeImageFile(file) {
25007
+ if (file.type === "file" && file.data instanceof Uint8Array) {
25008
+ return {
25009
+ ...file,
25010
+ data: convertUint8ArrayToBase643(file.data)
25011
+ };
25012
+ }
25013
+ return file;
25014
+ }
24851
25015
  var providerMetadataEntrySchema2 = z$1.object({
24852
25016
  images: z$1.array(z$1.unknown()).optional()
24853
25017
  }).catchall(z$1.unknown());
@@ -24862,11 +25026,183 @@ var gatewayImageResponseSchema2 = z$1.object({
24862
25026
  ).optional(),
24863
25027
  providerMetadata: z$1.record(z$1.string(), providerMetadataEntrySchema2).optional()
24864
25028
  });
25029
+ var parallelSearchInputSchema = lazySchema(
25030
+ () => zodSchema3(
25031
+ z.object({
25032
+ objective: z.string().describe(
25033
+ "Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."
25034
+ ),
25035
+ search_queries: z.array(z.string()).optional().describe(
25036
+ "Optional search queries to supplement the objective. Maximum 200 characters per query."
25037
+ ),
25038
+ mode: z.enum(["one-shot", "agentic"]).optional().describe(
25039
+ 'Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'
25040
+ ),
25041
+ max_results: z.number().optional().describe(
25042
+ "Maximum number of results to return (1-20). Defaults to 10 if not specified."
25043
+ ),
25044
+ source_policy: z.object({
25045
+ include_domains: z.array(z.string()).optional().describe("List of domains to include in search results."),
25046
+ exclude_domains: z.array(z.string()).optional().describe("List of domains to exclude from search results."),
25047
+ after_date: z.string().optional().describe(
25048
+ "Only include results published after this date (ISO 8601 format)."
25049
+ )
25050
+ }).optional().describe(
25051
+ "Source policy for controlling which domains to include/exclude and freshness."
25052
+ ),
25053
+ excerpts: z.object({
25054
+ max_chars_per_result: z.number().optional().describe("Maximum characters per result."),
25055
+ max_chars_total: z.number().optional().describe("Maximum total characters across all results.")
25056
+ }).optional().describe("Excerpt configuration for controlling result length."),
25057
+ fetch_policy: z.object({
25058
+ max_age_seconds: z.number().optional().describe(
25059
+ "Maximum age in seconds for cached content. Set to 0 to always fetch fresh content."
25060
+ )
25061
+ }).optional().describe("Fetch policy for controlling content freshness.")
25062
+ })
25063
+ )
25064
+ );
25065
+ var parallelSearchOutputSchema = lazySchema(
25066
+ () => zodSchema3(
25067
+ z.union([
25068
+ // Success response
25069
+ z.object({
25070
+ searchId: z.string(),
25071
+ results: z.array(
25072
+ z.object({
25073
+ url: z.string(),
25074
+ title: z.string(),
25075
+ excerpt: z.string(),
25076
+ publishDate: z.string().nullable().optional(),
25077
+ relevanceScore: z.number().optional()
25078
+ })
25079
+ )
25080
+ }),
25081
+ // Error response
25082
+ z.object({
25083
+ error: z.enum([
25084
+ "api_error",
25085
+ "rate_limit",
25086
+ "timeout",
25087
+ "invalid_input",
25088
+ "configuration_error",
25089
+ "unknown"
25090
+ ]),
25091
+ statusCode: z.number().optional(),
25092
+ message: z.string()
25093
+ })
25094
+ ])
25095
+ )
25096
+ );
25097
+ var parallelSearchToolFactory = createProviderToolFactoryWithOutputSchema({
25098
+ id: "gateway.parallel_search",
25099
+ inputSchema: parallelSearchInputSchema,
25100
+ outputSchema: parallelSearchOutputSchema
25101
+ });
25102
+ var parallelSearch = (config = {}) => parallelSearchToolFactory(config);
25103
+ var perplexitySearchInputSchema = lazySchema(
25104
+ () => zodSchema3(
25105
+ z.object({
25106
+ query: z.union([z.string(), z.array(z.string())]).describe(
25107
+ "Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."
25108
+ ),
25109
+ max_results: z.number().optional().describe(
25110
+ "Maximum number of search results to return (1-20, default: 10)"
25111
+ ),
25112
+ max_tokens_per_page: z.number().optional().describe(
25113
+ "Maximum number of tokens to extract per search result page (256-2048, default: 2048)"
25114
+ ),
25115
+ max_tokens: z.number().optional().describe(
25116
+ "Maximum total tokens across all search results (default: 25000, max: 1000000)"
25117
+ ),
25118
+ country: z.string().optional().describe(
25119
+ "Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"
25120
+ ),
25121
+ search_domain_filter: z.array(z.string()).optional().describe(
25122
+ "List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"
25123
+ ),
25124
+ search_language_filter: z.array(z.string()).optional().describe(
25125
+ "List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"
25126
+ ),
25127
+ search_after_date: z.string().optional().describe(
25128
+ "Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."
25129
+ ),
25130
+ search_before_date: z.string().optional().describe(
25131
+ "Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."
25132
+ ),
25133
+ last_updated_after_filter: z.string().optional().describe(
25134
+ "Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."
25135
+ ),
25136
+ last_updated_before_filter: z.string().optional().describe(
25137
+ "Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."
25138
+ ),
25139
+ search_recency_filter: z.enum(["day", "week", "month", "year"]).optional().describe(
25140
+ "Filter results by relative time period. Cannot be used with search_after_date or search_before_date."
25141
+ )
25142
+ })
25143
+ )
25144
+ );
25145
+ var perplexitySearchOutputSchema = lazySchema(
25146
+ () => zodSchema3(
25147
+ z.union([
25148
+ // Success response
25149
+ z.object({
25150
+ results: z.array(
25151
+ z.object({
25152
+ title: z.string(),
25153
+ url: z.string(),
25154
+ snippet: z.string(),
25155
+ date: z.string().optional(),
25156
+ lastUpdated: z.string().optional()
25157
+ })
25158
+ ),
25159
+ id: z.string()
25160
+ }),
25161
+ // Error response
25162
+ z.object({
25163
+ error: z.enum([
25164
+ "api_error",
25165
+ "rate_limit",
25166
+ "timeout",
25167
+ "invalid_input",
25168
+ "unknown"
25169
+ ]),
25170
+ statusCode: z.number().optional(),
25171
+ message: z.string()
25172
+ })
25173
+ ])
25174
+ )
25175
+ );
25176
+ var perplexitySearchToolFactory = createProviderToolFactoryWithOutputSchema({
25177
+ id: "gateway.perplexity_search",
25178
+ inputSchema: perplexitySearchInputSchema,
25179
+ outputSchema: perplexitySearchOutputSchema
25180
+ });
25181
+ var perplexitySearch = (config = {}) => perplexitySearchToolFactory(config);
25182
+ var gatewayTools = {
25183
+ /**
25184
+ * Search the web using Parallel AI's Search API for LLM-optimized excerpts.
25185
+ *
25186
+ * Takes a natural language objective and returns relevant excerpts,
25187
+ * replacing multiple keyword searches with a single call for broad
25188
+ * or complex queries. Supports different search types for depth vs
25189
+ * breadth tradeoffs.
25190
+ */
25191
+ parallelSearch,
25192
+ /**
25193
+ * Search the web using Perplexity's Search API for real-time information,
25194
+ * news, research papers, and articles.
25195
+ *
25196
+ * Provides ranked search results with advanced filtering options including
25197
+ * domain, language, date range, and recency filters.
25198
+ */
25199
+ perplexitySearch
25200
+ };
24865
25201
  async function getVercelRequestId2() {
24866
25202
  var _a832;
24867
25203
  return (_a832 = (0, import_oidc3.getContext)().headers) == null ? void 0 : _a832["x-vercel-id"];
24868
25204
  }
24869
- var VERSION5 = "3.0.0";
25205
+ var VERSION5 = "3.0.32";
24870
25206
  var AI_GATEWAY_PROTOCOL_VERSION2 = "0.0.1";
24871
25207
  function createGatewayProvider2(options = {}) {
24872
25208
  var _a832, _b83;
@@ -24876,8 +25212,8 @@ function createGatewayProvider2(options = {}) {
24876
25212
  let lastFetchTime = 0;
24877
25213
  const baseURL = (_b83 = withoutTrailingSlash2(options.baseURL)) != null ? _b83 : "https://ai-gateway.vercel.sh/v3/ai";
24878
25214
  const getHeaders = async () => {
24879
- const auth = await getGatewayAuthToken2(options);
24880
- if (auth) {
25215
+ try {
25216
+ const auth = await getGatewayAuthToken2(options);
24881
25217
  return withUserAgentSuffix2(
24882
25218
  {
24883
25219
  Authorization: `Bearer ${auth.token}`,
@@ -24887,12 +25223,14 @@ function createGatewayProvider2(options = {}) {
24887
25223
  },
24888
25224
  `ai-sdk/gateway/${VERSION5}`
24889
25225
  );
25226
+ } catch (error) {
25227
+ throw GatewayAuthenticationError2.createContextualError({
25228
+ apiKeyProvided: false,
25229
+ oidcTokenProvided: false,
25230
+ statusCode: 401,
25231
+ cause: error
25232
+ });
24890
25233
  }
24891
- throw GatewayAuthenticationError2.createContextualError({
24892
- apiKeyProvided: false,
24893
- oidcTokenProvided: false,
24894
- statusCode: 401
24895
- });
24896
25234
  };
24897
25235
  const createO11yHeaders = () => {
24898
25236
  const deploymentId = loadOptionalSetting2({
@@ -24991,6 +25329,7 @@ function createGatewayProvider2(options = {}) {
24991
25329
  };
24992
25330
  provider.embeddingModel = createEmbeddingModel;
24993
25331
  provider.textEmbeddingModel = createEmbeddingModel;
25332
+ provider.tools = gatewayTools;
24994
25333
  return provider;
24995
25334
  }
24996
25335
  var gateway2 = createGatewayProvider2();
@@ -25005,15 +25344,11 @@ async function getGatewayAuthToken2(options) {
25005
25344
  authMethod: "api-key"
25006
25345
  };
25007
25346
  }
25008
- try {
25009
- const oidcToken = await (0, import_oidc22.getVercelOidcToken)();
25010
- return {
25011
- token: oidcToken,
25012
- authMethod: "oidc"
25013
- };
25014
- } catch (e2) {
25015
- return null;
25016
- }
25347
+ const oidcToken = await (0, import_oidc22.getVercelOidcToken)();
25348
+ return {
25349
+ token: oidcToken,
25350
+ authMethod: "oidc"
25351
+ };
25017
25352
  }
25018
25353
  var _globalThis3 = typeof globalThis === "object" ? globalThis : global;
25019
25354
  var VERSION23 = "1.9.0";
@@ -25086,11 +25421,11 @@ var major3 = VERSION23.split(".")[0];
25086
25421
  var GLOBAL_OPENTELEMETRY_API_KEY3 = /* @__PURE__ */ Symbol.for("opentelemetry.js.api." + major3);
25087
25422
  var _global3 = _globalThis3;
25088
25423
  function registerGlobal3(type, instance, diag, allowOverride) {
25089
- var _a146;
25424
+ var _a21;
25090
25425
  if (allowOverride === void 0) {
25091
25426
  allowOverride = false;
25092
25427
  }
25093
- var api = _global3[GLOBAL_OPENTELEMETRY_API_KEY3] = (_a146 = _global3[GLOBAL_OPENTELEMETRY_API_KEY3]) !== null && _a146 !== void 0 ? _a146 : {
25428
+ var api = _global3[GLOBAL_OPENTELEMETRY_API_KEY3] = (_a21 = _global3[GLOBAL_OPENTELEMETRY_API_KEY3]) !== null && _a21 !== void 0 ? _a21 : {
25094
25429
  version: VERSION23
25095
25430
  };
25096
25431
  if (!allowOverride && api[type]) {
@@ -25108,8 +25443,8 @@ function registerGlobal3(type, instance, diag, allowOverride) {
25108
25443
  return true;
25109
25444
  }
25110
25445
  function getGlobal3(type) {
25111
- var _a146, _b83;
25112
- var globalVersion = (_a146 = _global3[GLOBAL_OPENTELEMETRY_API_KEY3]) === null || _a146 === void 0 ? void 0 : _a146.version;
25446
+ var _a21, _b83;
25447
+ var globalVersion = (_a21 = _global3[GLOBAL_OPENTELEMETRY_API_KEY3]) === null || _a21 === void 0 ? void 0 : _a21.version;
25113
25448
  if (!globalVersion || !isCompatible3(globalVersion)) {
25114
25449
  return;
25115
25450
  }
@@ -25278,13 +25613,13 @@ var DiagAPI3 = (
25278
25613
  }
25279
25614
  var self = this;
25280
25615
  var setLogger = function(logger, optionsOrLogLevel) {
25281
- var _a146, _b83, _c;
25616
+ var _a21, _b83, _c;
25282
25617
  if (optionsOrLogLevel === void 0) {
25283
25618
  optionsOrLogLevel = { logLevel: DiagLogLevel3.INFO };
25284
25619
  }
25285
25620
  if (logger === self) {
25286
25621
  var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
25287
- self.error((_a146 = err.stack) !== null && _a146 !== void 0 ? _a146 : err.message);
25622
+ self.error((_a21 = err.stack) !== null && _a21 !== void 0 ? _a21 : err.message);
25288
25623
  return false;
25289
25624
  }
25290
25625
  if (typeof optionsOrLogLevel === "number") {
@@ -25336,14 +25671,14 @@ var BaseContext3 = (
25336
25671
  return self._currentContext.get(key);
25337
25672
  };
25338
25673
  self.setValue = function(key, value) {
25339
- var context = new BaseContext222(self._currentContext);
25340
- context._currentContext.set(key, value);
25341
- return context;
25674
+ var context2 = new BaseContext222(self._currentContext);
25675
+ context2._currentContext.set(key, value);
25676
+ return context2;
25342
25677
  };
25343
25678
  self.deleteValue = function(key) {
25344
- var context = new BaseContext222(self._currentContext);
25345
- context._currentContext.delete(key);
25346
- return context;
25679
+ var context2 = new BaseContext222(self._currentContext);
25680
+ context2._currentContext.delete(key);
25681
+ return context2;
25347
25682
  };
25348
25683
  }
25349
25684
  return BaseContext222;
@@ -25448,16 +25783,16 @@ var ContextAPI3 = (
25448
25783
  ContextAPI222.prototype.active = function() {
25449
25784
  return this._getContextManager().active();
25450
25785
  };
25451
- ContextAPI222.prototype.with = function(context, fn, thisArg) {
25452
- var _a146;
25786
+ ContextAPI222.prototype.with = function(context2, fn, thisArg) {
25787
+ var _a21;
25453
25788
  var args = [];
25454
25789
  for (var _i = 3; _i < arguments.length; _i++) {
25455
25790
  args[_i - 3] = arguments[_i];
25456
25791
  }
25457
- return (_a146 = this._getContextManager()).with.apply(_a146, __spreadArray43([context, fn, thisArg], __read43(args), false));
25792
+ return (_a21 = this._getContextManager()).with.apply(_a21, __spreadArray43([context2, fn, thisArg], __read43(args), false));
25458
25793
  };
25459
- ContextAPI222.prototype.bind = function(context, target) {
25460
- return this._getContextManager().bind(context, target);
25794
+ ContextAPI222.prototype.bind = function(context2, target) {
25795
+ return this._getContextManager().bind(context2, target);
25461
25796
  };
25462
25797
  ContextAPI222.prototype._getContextManager = function() {
25463
25798
  return getGlobal3(API_NAME23) || NOOP_CONTEXT_MANAGER3;
@@ -25525,24 +25860,24 @@ var NonRecordingSpan3 = (
25525
25860
  })()
25526
25861
  );
25527
25862
  var SPAN_KEY3 = createContextKey3("OpenTelemetry Context Key SPAN");
25528
- function getSpan3(context) {
25529
- return context.getValue(SPAN_KEY3) || void 0;
25863
+ function getSpan3(context2) {
25864
+ return context2.getValue(SPAN_KEY3) || void 0;
25530
25865
  }
25531
25866
  function getActiveSpan3() {
25532
25867
  return getSpan3(ContextAPI3.getInstance().active());
25533
25868
  }
25534
- function setSpan3(context, span) {
25535
- return context.setValue(SPAN_KEY3, span);
25869
+ function setSpan3(context2, span) {
25870
+ return context2.setValue(SPAN_KEY3, span);
25536
25871
  }
25537
- function deleteSpan3(context) {
25538
- return context.deleteValue(SPAN_KEY3);
25872
+ function deleteSpan3(context2) {
25873
+ return context2.deleteValue(SPAN_KEY3);
25539
25874
  }
25540
- function setSpanContext3(context, spanContext) {
25541
- return setSpan3(context, new NonRecordingSpan3(spanContext));
25875
+ function setSpanContext3(context2, spanContext) {
25876
+ return setSpan3(context2, new NonRecordingSpan3(spanContext));
25542
25877
  }
25543
- function getSpanContext3(context) {
25544
- var _a146;
25545
- return (_a146 = getSpan3(context)) === null || _a146 === void 0 ? void 0 : _a146.spanContext();
25878
+ function getSpanContext3(context2) {
25879
+ var _a21;
25880
+ return (_a21 = getSpan3(context2)) === null || _a21 === void 0 ? void 0 : _a21.spanContext();
25546
25881
  }
25547
25882
  var VALID_TRACEID_REGEX3 = /^([0-9a-f]{32})$/i;
25548
25883
  var VALID_SPANID_REGEX3 = /^[0-9a-f]{16}$/i;
@@ -25564,22 +25899,22 @@ var NoopTracer3 = (
25564
25899
  (function() {
25565
25900
  function NoopTracer222() {
25566
25901
  }
25567
- NoopTracer222.prototype.startSpan = function(name144, options, context) {
25568
- if (context === void 0) {
25569
- context = contextApi3.active();
25902
+ NoopTracer222.prototype.startSpan = function(name21, options, context2) {
25903
+ if (context2 === void 0) {
25904
+ context2 = contextApi3.active();
25570
25905
  }
25571
25906
  var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
25572
25907
  if (root) {
25573
25908
  return new NonRecordingSpan3();
25574
25909
  }
25575
- var parentFromContext = context && getSpanContext3(context);
25910
+ var parentFromContext = context2 && getSpanContext3(context2);
25576
25911
  if (isSpanContext3(parentFromContext) && isSpanContextValid3(parentFromContext)) {
25577
25912
  return new NonRecordingSpan3(parentFromContext);
25578
25913
  } else {
25579
25914
  return new NonRecordingSpan3();
25580
25915
  }
25581
25916
  };
25582
- NoopTracer222.prototype.startActiveSpan = function(name144, arg2, arg3, arg4) {
25917
+ NoopTracer222.prototype.startActiveSpan = function(name21, arg2, arg3, arg4) {
25583
25918
  var opts;
25584
25919
  var ctx;
25585
25920
  var fn;
@@ -25596,7 +25931,7 @@ var NoopTracer3 = (
25596
25931
  fn = arg4;
25597
25932
  }
25598
25933
  var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi3.active();
25599
- var span = this.startSpan(name144, opts, parentContext);
25934
+ var span = this.startSpan(name21, opts, parentContext);
25600
25935
  var contextWithSpanSet = setSpan3(parentContext, span);
25601
25936
  return contextApi3.with(contextWithSpanSet, fn, void 0, span);
25602
25937
  };
@@ -25610,14 +25945,14 @@ var NOOP_TRACER3 = new NoopTracer3();
25610
25945
  var ProxyTracer3 = (
25611
25946
  /** @class */
25612
25947
  (function() {
25613
- function ProxyTracer222(_provider, name144, version, options) {
25948
+ function ProxyTracer222(_provider, name21, version, options) {
25614
25949
  this._provider = _provider;
25615
- this.name = name144;
25950
+ this.name = name21;
25616
25951
  this.version = version;
25617
25952
  this.options = options;
25618
25953
  }
25619
- ProxyTracer222.prototype.startSpan = function(name144, options, context) {
25620
- return this._getTracer().startSpan(name144, options, context);
25954
+ ProxyTracer222.prototype.startSpan = function(name21, options, context2) {
25955
+ return this._getTracer().startSpan(name21, options, context2);
25621
25956
  };
25622
25957
  ProxyTracer222.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
25623
25958
  var tracer = this._getTracer();
@@ -25654,20 +25989,20 @@ var ProxyTracerProvider3 = (
25654
25989
  (function() {
25655
25990
  function ProxyTracerProvider222() {
25656
25991
  }
25657
- ProxyTracerProvider222.prototype.getTracer = function(name144, version, options) {
25658
- var _a146;
25659
- return (_a146 = this.getDelegateTracer(name144, version, options)) !== null && _a146 !== void 0 ? _a146 : new ProxyTracer3(this, name144, version, options);
25992
+ ProxyTracerProvider222.prototype.getTracer = function(name21, version, options) {
25993
+ var _a21;
25994
+ return (_a21 = this.getDelegateTracer(name21, version, options)) !== null && _a21 !== void 0 ? _a21 : new ProxyTracer3(this, name21, version, options);
25660
25995
  };
25661
25996
  ProxyTracerProvider222.prototype.getDelegate = function() {
25662
- var _a146;
25663
- return (_a146 = this._delegate) !== null && _a146 !== void 0 ? _a146 : NOOP_TRACER_PROVIDER3;
25997
+ var _a21;
25998
+ return (_a21 = this._delegate) !== null && _a21 !== void 0 ? _a21 : NOOP_TRACER_PROVIDER3;
25664
25999
  };
25665
26000
  ProxyTracerProvider222.prototype.setDelegate = function(delegate) {
25666
26001
  this._delegate = delegate;
25667
26002
  };
25668
- ProxyTracerProvider222.prototype.getDelegateTracer = function(name144, version, options) {
25669
- var _a146;
25670
- return (_a146 = this._delegate) === null || _a146 === void 0 ? void 0 : _a146.getTracer(name144, version, options);
26003
+ ProxyTracerProvider222.prototype.getDelegateTracer = function(name21, version, options) {
26004
+ var _a21;
26005
+ return (_a21 = this._delegate) === null || _a21 === void 0 ? void 0 : _a21.getTracer(name21, version, options);
25671
26006
  };
25672
26007
  return ProxyTracerProvider222;
25673
26008
  })()
@@ -25678,6 +26013,7 @@ var SpanStatusCode3;
25678
26013
  SpanStatusCode222[SpanStatusCode222["OK"] = 1] = "OK";
25679
26014
  SpanStatusCode222[SpanStatusCode222["ERROR"] = 2] = "ERROR";
25680
26015
  })(SpanStatusCode3 || (SpanStatusCode3 = {}));
26016
+ var context = ContextAPI3.getInstance();
25681
26017
  var API_NAME33 = "trace";
25682
26018
  var TraceAPI3 = (
25683
26019
  /** @class */
@@ -25709,8 +26045,8 @@ var TraceAPI3 = (
25709
26045
  TraceAPI222.prototype.getTracerProvider = function() {
25710
26046
  return getGlobal3(API_NAME33) || this._proxyTracerProvider;
25711
26047
  };
25712
- TraceAPI222.prototype.getTracer = function(name144, version) {
25713
- return this.getTracerProvider().getTracer(name144, version);
26048
+ TraceAPI222.prototype.getTracer = function(name21, version) {
26049
+ return this.getTracerProvider().getTracer(name21, version);
25714
26050
  };
25715
26051
  TraceAPI222.prototype.disable = function() {
25716
26052
  unregisterGlobal3(API_NAME33, DiagAPI3.instance());
@@ -25722,8 +26058,8 @@ var TraceAPI3 = (
25722
26058
  var trace3 = TraceAPI3.getInstance();
25723
26059
  var __defProp4 = Object.defineProperty;
25724
26060
  var __export32 = (target, all) => {
25725
- for (var name144 in all)
25726
- __defProp4(target, name144, { get: all[name144], enumerable: true });
26061
+ for (var name21 in all)
26062
+ __defProp4(target, name21, { get: all[name21], enumerable: true });
25727
26063
  };
25728
26064
  var name76 = "AI_InvalidArgumentError";
25729
26065
  var marker86 = `vercel.ai.error.${name76}`;
@@ -25748,10 +26084,10 @@ var InvalidArgumentError23 = class extends AISDKError3 {
25748
26084
  }
25749
26085
  };
25750
26086
  _a86 = symbol86;
25751
- var name523 = "AI_NoObjectGeneratedError";
25752
- var marker523 = `vercel.ai.error.${name523}`;
25753
- var symbol523 = Symbol.for(marker523);
25754
- var _a523;
26087
+ var name86 = "AI_NoObjectGeneratedError";
26088
+ var marker823 = `vercel.ai.error.${name86}`;
26089
+ var symbol823 = Symbol.for(marker823);
26090
+ var _a823;
25755
26091
  var NoObjectGeneratedError3 = class extends AISDKError3 {
25756
26092
  constructor({
25757
26093
  message = "No object generated.",
@@ -25761,18 +26097,18 @@ var NoObjectGeneratedError3 = class extends AISDKError3 {
25761
26097
  usage,
25762
26098
  finishReason
25763
26099
  }) {
25764
- super({ name: name523, message, cause });
25765
- this[_a523] = true;
26100
+ super({ name: name86, message, cause });
26101
+ this[_a823] = true;
25766
26102
  this.text = text222;
25767
26103
  this.response = response;
25768
26104
  this.usage = usage;
25769
26105
  this.finishReason = finishReason;
25770
26106
  }
25771
26107
  static isInstance(error) {
25772
- return AISDKError3.hasMarker(error, marker523);
26108
+ return AISDKError3.hasMarker(error, marker823);
25773
26109
  }
25774
26110
  };
25775
- _a523 = symbol523;
26111
+ _a823 = symbol823;
25776
26112
  var UnsupportedModelVersionError3 = class extends AISDKError3 {
25777
26113
  constructor(options) {
25778
26114
  super({
@@ -25784,27 +26120,27 @@ var UnsupportedModelVersionError3 = class extends AISDKError3 {
25784
26120
  this.modelId = options.modelId;
25785
26121
  }
25786
26122
  };
25787
- var name126 = "AI_RetryError";
25788
- var marker125 = `vercel.ai.error.${name126}`;
25789
- var symbol125 = Symbol.for(marker125);
25790
- var _a125;
26123
+ var name192 = "AI_RetryError";
26124
+ var marker192 = `vercel.ai.error.${name192}`;
26125
+ var symbol192 = Symbol.for(marker192);
26126
+ var _a192;
25791
26127
  var RetryError3 = class extends AISDKError3 {
25792
26128
  constructor({
25793
26129
  message,
25794
26130
  reason,
25795
26131
  errors
25796
26132
  }) {
25797
- super({ name: name126, message });
25798
- this[_a125] = true;
26133
+ super({ name: name192, message });
26134
+ this[_a192] = true;
25799
26135
  this.reason = reason;
25800
26136
  this.errors = errors;
25801
26137
  this.lastError = errors[errors.length - 1];
25802
26138
  }
25803
26139
  static isInstance(error) {
25804
- return AISDKError3.hasMarker(error, marker125);
26140
+ return AISDKError3.hasMarker(error, marker192);
25805
26141
  }
25806
26142
  };
25807
- _a125 = symbol125;
26143
+ _a192 = symbol192;
25808
26144
  function formatWarning({
25809
26145
  warning,
25810
26146
  provider,
@@ -25909,10 +26245,19 @@ function resolveEmbeddingModel2(model) {
25909
26245
  return getGlobalProvider2().embeddingModel(model);
25910
26246
  }
25911
26247
  function getGlobalProvider2() {
25912
- var _a146;
25913
- return (_a146 = globalThis.AI_SDK_DEFAULT_PROVIDER) != null ? _a146 : gateway2;
26248
+ var _a21;
26249
+ return (_a21 = globalThis.AI_SDK_DEFAULT_PROVIDER) != null ? _a21 : gateway2;
26250
+ }
26251
+ function getTotalTimeoutMs(timeout) {
26252
+ if (timeout == null) {
26253
+ return void 0;
26254
+ }
26255
+ if (typeof timeout === "number") {
26256
+ return timeout;
26257
+ }
26258
+ return timeout.totalMs;
25914
26259
  }
25915
- var VERSION33 = "6.0.1";
26260
+ var VERSION33 = "6.0.69";
25916
26261
  var dataContentSchema3 = z$1.union([
25917
26262
  z$1.string(),
25918
26263
  z$1.instanceof(Uint8Array),
@@ -25920,8 +26265,8 @@ var dataContentSchema3 = z$1.union([
25920
26265
  z$1.custom(
25921
26266
  // Buffer might not be available in some environments such as CloudFlare:
25922
26267
  (value) => {
25923
- var _a146, _b83;
25924
- return (_b83 = (_a146 = globalThis.Buffer) == null ? void 0 : _a146.isBuffer(value)) != null ? _b83 : false;
26268
+ var _a21, _b83;
26269
+ return (_b83 = (_a21 = globalThis.Buffer) == null ? void 0 : _a21.isBuffer(value)) != null ? _b83 : false;
25925
26270
  },
25926
26271
  { message: "Must be a Buffer" }
25927
26272
  )
@@ -26135,17 +26480,26 @@ function getBaseTelemetryAttributes3({
26135
26480
  telemetry,
26136
26481
  headers
26137
26482
  }) {
26138
- var _a146;
26483
+ var _a21;
26139
26484
  return {
26140
26485
  "ai.model.provider": model.provider,
26141
26486
  "ai.model.id": model.modelId,
26142
26487
  // settings:
26143
26488
  ...Object.entries(settings).reduce((attributes, [key, value]) => {
26144
- attributes[`ai.settings.${key}`] = value;
26489
+ if (key === "timeout") {
26490
+ const totalTimeoutMs = getTotalTimeoutMs(
26491
+ value
26492
+ );
26493
+ if (totalTimeoutMs != null) {
26494
+ attributes[`ai.settings.${key}`] = totalTimeoutMs;
26495
+ }
26496
+ } else {
26497
+ attributes[`ai.settings.${key}`] = value;
26498
+ }
26145
26499
  return attributes;
26146
26500
  }, {}),
26147
26501
  // add metadata as attributes:
26148
- ...Object.entries((_a146 = telemetry == null ? void 0 : telemetry.metadata) != null ? _a146 : {}).reduce(
26502
+ ...Object.entries((_a21 = telemetry == null ? void 0 : telemetry.metadata) != null ? _a21 : {}).reduce(
26149
26503
  (attributes, [key, value]) => {
26150
26504
  attributes[`ai.telemetry.metadata.${key}`] = value;
26151
26505
  return attributes;
@@ -26165,7 +26519,7 @@ var noopTracer3 = {
26165
26519
  startSpan() {
26166
26520
  return noopSpan3;
26167
26521
  },
26168
- startActiveSpan(name144, arg1, arg2, arg3) {
26522
+ startActiveSpan(name21, arg1, arg2, arg3) {
26169
26523
  if (typeof arg1 === "function") {
26170
26524
  return arg1(noopSpan3);
26171
26525
  }
@@ -26230,18 +26584,19 @@ function getTracer3({
26230
26584
  return trace3.getTracer("ai");
26231
26585
  }
26232
26586
  async function recordSpan3({
26233
- name: name144,
26587
+ name: name21,
26234
26588
  tracer,
26235
26589
  attributes,
26236
26590
  fn,
26237
26591
  endWhenDone = true
26238
26592
  }) {
26239
26593
  return tracer.startActiveSpan(
26240
- name144,
26594
+ name21,
26241
26595
  { attributes: await attributes },
26242
26596
  async (span) => {
26597
+ const ctx = context.active();
26243
26598
  try {
26244
- const result = await fn(span);
26599
+ const result = await context.with(ctx, () => fn(span));
26245
26600
  if (endWhenDone) {
26246
26601
  span.end();
26247
26602
  }
@@ -26770,37 +27125,42 @@ async function parsePartialJson3(jsonText) {
26770
27125
  return { value: void 0, state: "failed-parse" };
26771
27126
  }
26772
27127
  var text3 = () => ({
27128
+ name: "text",
26773
27129
  responseFormat: Promise.resolve({ type: "text" }),
26774
27130
  async parseCompleteOutput({ text: text222 }) {
26775
27131
  return text222;
26776
27132
  },
26777
27133
  async parsePartialOutput({ text: text222 }) {
26778
27134
  return { partial: text222 };
27135
+ },
27136
+ createElementStreamTransform() {
27137
+ return void 0;
26779
27138
  }
26780
27139
  });
26781
27140
  var object3 = ({
26782
27141
  schema: inputSchema,
26783
- name: name144,
27142
+ name: name21,
26784
27143
  description
26785
27144
  }) => {
26786
27145
  const schema = asSchema3(inputSchema);
26787
27146
  return {
27147
+ name: "object",
26788
27148
  responseFormat: resolve2(schema.jsonSchema).then((jsonSchema222) => ({
26789
27149
  type: "json",
26790
27150
  schema: jsonSchema222,
26791
- ...name144 != null && { name: name144 },
27151
+ ...name21 != null && { name: name21 },
26792
27152
  ...description != null && { description }
26793
27153
  })),
26794
- async parseCompleteOutput({ text: text222 }, context) {
27154
+ async parseCompleteOutput({ text: text222 }, context2) {
26795
27155
  const parseResult = await safeParseJSON3({ text: text222 });
26796
27156
  if (!parseResult.success) {
26797
27157
  throw new NoObjectGeneratedError3({
26798
27158
  message: "No object generated: could not parse the response.",
26799
27159
  cause: parseResult.error,
26800
27160
  text: text222,
26801
- response: context.response,
26802
- usage: context.usage,
26803
- finishReason: context.finishReason
27161
+ response: context2.response,
27162
+ usage: context2.usage,
27163
+ finishReason: context2.finishReason
26804
27164
  });
26805
27165
  }
26806
27166
  const validationResult = await safeValidateTypes3({
@@ -26812,9 +27172,9 @@ var object3 = ({
26812
27172
  message: "No object generated: response did not match schema.",
26813
27173
  cause: validationResult.error,
26814
27174
  text: text222,
26815
- response: context.response,
26816
- usage: context.usage,
26817
- finishReason: context.finishReason
27175
+ response: context2.response,
27176
+ usage: context2.usage,
27177
+ finishReason: context2.finishReason
26818
27178
  });
26819
27179
  }
26820
27180
  return validationResult.value;
@@ -26834,16 +27194,20 @@ var object3 = ({
26834
27194
  };
26835
27195
  }
26836
27196
  }
27197
+ },
27198
+ createElementStreamTransform() {
27199
+ return void 0;
26837
27200
  }
26838
27201
  };
26839
27202
  };
26840
27203
  var array = ({
26841
27204
  element: inputElementSchema,
26842
- name: name144,
27205
+ name: name21,
26843
27206
  description
26844
27207
  }) => {
26845
27208
  const elementSchema = asSchema3(inputElementSchema);
26846
27209
  return {
27210
+ name: "array",
26847
27211
  // JSON schema that describes an array of elements:
26848
27212
  responseFormat: resolve2(elementSchema.jsonSchema).then((jsonSchema222) => {
26849
27213
  const { $schema, ...itemSchema } = jsonSchema222;
@@ -26858,20 +27222,20 @@ var array = ({
26858
27222
  required: ["elements"],
26859
27223
  additionalProperties: false
26860
27224
  },
26861
- ...name144 != null && { name: name144 },
27225
+ ...name21 != null && { name: name21 },
26862
27226
  ...description != null && { description }
26863
27227
  };
26864
27228
  }),
26865
- async parseCompleteOutput({ text: text222 }, context) {
27229
+ async parseCompleteOutput({ text: text222 }, context2) {
26866
27230
  const parseResult = await safeParseJSON3({ text: text222 });
26867
27231
  if (!parseResult.success) {
26868
27232
  throw new NoObjectGeneratedError3({
26869
27233
  message: "No object generated: could not parse the response.",
26870
27234
  cause: parseResult.error,
26871
27235
  text: text222,
26872
- response: context.response,
26873
- usage: context.usage,
26874
- finishReason: context.finishReason
27236
+ response: context2.response,
27237
+ usage: context2.usage,
27238
+ finishReason: context2.finishReason
26875
27239
  });
26876
27240
  }
26877
27241
  const outerValue = parseResult.value;
@@ -26883,9 +27247,9 @@ var array = ({
26883
27247
  cause: "response must be an object with an elements array"
26884
27248
  }),
26885
27249
  text: text222,
26886
- response: context.response,
26887
- usage: context.usage,
26888
- finishReason: context.finishReason
27250
+ response: context2.response,
27251
+ usage: context2.usage,
27252
+ finishReason: context2.finishReason
26889
27253
  });
26890
27254
  }
26891
27255
  for (const element of outerValue.elements) {
@@ -26898,9 +27262,9 @@ var array = ({
26898
27262
  message: "No object generated: response did not match schema.",
26899
27263
  cause: validationResult.error,
26900
27264
  text: text222,
26901
- response: context.response,
26902
- usage: context.usage,
26903
- finishReason: context.finishReason
27265
+ response: context2.response,
27266
+ usage: context2.usage,
27267
+ finishReason: context2.finishReason
26904
27268
  });
26905
27269
  }
26906
27270
  }
@@ -26933,15 +27297,28 @@ var array = ({
26933
27297
  return { partial: parsedElements };
26934
27298
  }
26935
27299
  }
27300
+ },
27301
+ createElementStreamTransform() {
27302
+ let publishedElements = 0;
27303
+ return new TransformStream({
27304
+ transform({ partialOutput }, controller) {
27305
+ if (partialOutput != null) {
27306
+ for (; publishedElements < partialOutput.length; publishedElements++) {
27307
+ controller.enqueue(partialOutput[publishedElements]);
27308
+ }
27309
+ }
27310
+ }
27311
+ });
26936
27312
  }
26937
27313
  };
26938
27314
  };
26939
27315
  var choice = ({
26940
27316
  options: choiceOptions,
26941
- name: name144,
27317
+ name: name21,
26942
27318
  description
26943
27319
  }) => {
26944
27320
  return {
27321
+ name: "choice",
26945
27322
  // JSON schema that describes an enumeration:
26946
27323
  responseFormat: Promise.resolve({
26947
27324
  type: "json",
@@ -26954,19 +27331,19 @@ var choice = ({
26954
27331
  required: ["result"],
26955
27332
  additionalProperties: false
26956
27333
  },
26957
- ...name144 != null && { name: name144 },
27334
+ ...name21 != null && { name: name21 },
26958
27335
  ...description != null && { description }
26959
27336
  }),
26960
- async parseCompleteOutput({ text: text222 }, context) {
27337
+ async parseCompleteOutput({ text: text222 }, context2) {
26961
27338
  const parseResult = await safeParseJSON3({ text: text222 });
26962
27339
  if (!parseResult.success) {
26963
27340
  throw new NoObjectGeneratedError3({
26964
27341
  message: "No object generated: could not parse the response.",
26965
27342
  cause: parseResult.error,
26966
27343
  text: text222,
26967
- response: context.response,
26968
- usage: context.usage,
26969
- finishReason: context.finishReason
27344
+ response: context2.response,
27345
+ usage: context2.usage,
27346
+ finishReason: context2.finishReason
26970
27347
  });
26971
27348
  }
26972
27349
  const outerValue = parseResult.value;
@@ -26978,9 +27355,9 @@ var choice = ({
26978
27355
  cause: "response must be an object that contains a choice value."
26979
27356
  }),
26980
27357
  text: text222,
26981
- response: context.response,
26982
- usage: context.usage,
26983
- finishReason: context.finishReason
27358
+ response: context2.response,
27359
+ usage: context2.usage,
27360
+ finishReason: context2.finishReason
26984
27361
  });
26985
27362
  }
26986
27363
  return outerValue.result;
@@ -27008,29 +27385,33 @@ var choice = ({
27008
27385
  }
27009
27386
  }
27010
27387
  }
27388
+ },
27389
+ createElementStreamTransform() {
27390
+ return void 0;
27011
27391
  }
27012
27392
  };
27013
27393
  };
27014
27394
  var json = ({
27015
- name: name144,
27395
+ name: name21,
27016
27396
  description
27017
27397
  } = {}) => {
27018
27398
  return {
27399
+ name: "json",
27019
27400
  responseFormat: Promise.resolve({
27020
27401
  type: "json",
27021
- ...name144 != null && { name: name144 },
27402
+ ...name21 != null && { name: name21 },
27022
27403
  ...description != null && { description }
27023
27404
  }),
27024
- async parseCompleteOutput({ text: text222 }, context) {
27405
+ async parseCompleteOutput({ text: text222 }, context2) {
27025
27406
  const parseResult = await safeParseJSON3({ text: text222 });
27026
27407
  if (!parseResult.success) {
27027
27408
  throw new NoObjectGeneratedError3({
27028
27409
  message: "No object generated: could not parse the response.",
27029
27410
  cause: parseResult.error,
27030
27411
  text: text222,
27031
- response: context.response,
27032
- usage: context.usage,
27033
- finishReason: context.finishReason
27412
+ response: context2.response,
27413
+ usage: context2.usage,
27414
+ finishReason: context2.finishReason
27034
27415
  });
27035
27416
  }
27036
27417
  return parseResult.value;
@@ -27047,6 +27428,9 @@ var json = ({
27047
27428
  return result.value === void 0 ? void 0 : { partial: result.value };
27048
27429
  }
27049
27430
  }
27431
+ },
27432
+ createElementStreamTransform() {
27433
+ return void 0;
27050
27434
  }
27051
27435
  };
27052
27436
  };
@@ -27109,7 +27493,7 @@ async function embedMany3({
27109
27493
  }),
27110
27494
  tracer,
27111
27495
  fn: async (span) => {
27112
- var _a146;
27496
+ var _a21;
27113
27497
  const [maxEmbeddingsPerCall, supportsParallelCalls] = await Promise.all([
27114
27498
  model.maxEmbeddingsPerCall,
27115
27499
  model.supportsParallelCalls
@@ -27134,7 +27518,7 @@ async function embedMany3({
27134
27518
  }),
27135
27519
  tracer,
27136
27520
  fn: async (doEmbedSpan) => {
27137
- var _a154;
27521
+ var _a22222;
27138
27522
  const modelResponse = await model.doEmbed({
27139
27523
  values,
27140
27524
  abortSignal,
@@ -27142,7 +27526,7 @@ async function embedMany3({
27142
27526
  providerOptions
27143
27527
  });
27144
27528
  const embeddings3 = modelResponse.embeddings;
27145
- const usage2 = (_a154 = modelResponse.usage) != null ? _a154 : { tokens: NaN };
27529
+ const usage2 = (_a22222 = modelResponse.usage) != null ? _a22222 : { tokens: NaN };
27146
27530
  doEmbedSpan.setAttributes(
27147
27531
  await selectTelemetryAttributes3({
27148
27532
  telemetry,
@@ -27223,7 +27607,7 @@ async function embedMany3({
27223
27607
  }),
27224
27608
  tracer,
27225
27609
  fn: async (doEmbedSpan) => {
27226
- var _a154;
27610
+ var _a22222;
27227
27611
  const modelResponse = await model.doEmbed({
27228
27612
  values: chunk,
27229
27613
  abortSignal,
@@ -27231,7 +27615,7 @@ async function embedMany3({
27231
27615
  providerOptions
27232
27616
  });
27233
27617
  const embeddings2 = modelResponse.embeddings;
27234
- const usage = (_a154 = modelResponse.usage) != null ? _a154 : { tokens: NaN };
27618
+ const usage = (_a22222 = modelResponse.usage) != null ? _a22222 : { tokens: NaN };
27235
27619
  doEmbedSpan.setAttributes(
27236
27620
  await selectTelemetryAttributes3({
27237
27621
  telemetry,
@@ -27270,7 +27654,7 @@ async function embedMany3({
27270
27654
  result.providerMetadata
27271
27655
  )) {
27272
27656
  providerMetadata[providerName] = {
27273
- ...(_a146 = providerMetadata[providerName]) != null ? _a146 : {},
27657
+ ...(_a21 = providerMetadata[providerName]) != null ? _a21 : {},
27274
27658
  ...metadata
27275
27659
  };
27276
27660
  }
@@ -27361,10 +27745,10 @@ var updateWorkingMemoryTool = (memoryConfig) => {
27361
27745
  id: "update-working-memory",
27362
27746
  description,
27363
27747
  inputSchema,
27364
- execute: async (inputData, context) => {
27365
- const threadId = context?.agent?.threadId;
27366
- const resourceId = context?.agent?.resourceId;
27367
- const memory = context?.memory;
27748
+ execute: async (inputData, context2) => {
27749
+ const threadId = context2?.agent?.threadId;
27750
+ const resourceId = context2?.agent?.resourceId;
27751
+ const memory = context2?.memory;
27368
27752
  if (!threadId || !memory || !resourceId) {
27369
27753
  throw new Error("Thread ID, Memory instance, and resourceId are required for working memory updates");
27370
27754
  }
@@ -27440,10 +27824,10 @@ var __experimental_updateWorkingMemoryToolVNext = (config) => {
27440
27824
  "The reason you're updating working memory. Passing any value other than 'append-new-memory' requires a searchString to be provided. Defaults to append-new-memory"
27441
27825
  )
27442
27826
  }),
27443
- execute: async (inputData, context) => {
27444
- const threadId = context?.agent?.threadId;
27445
- const resourceId = context?.agent?.resourceId;
27446
- const memory = context?.memory;
27827
+ execute: async (inputData, context2) => {
27828
+ const threadId = context2?.agent?.threadId;
27829
+ const resourceId = context2?.agent?.resourceId;
27830
+ const memory = context2?.memory;
27447
27831
  if (!threadId || !memory || !resourceId) {
27448
27832
  throw new Error("Thread ID, Memory instance, and resourceId are required for working memory updates");
27449
27833
  }
@@ -28550,9 +28934,9 @@ Notes:
28550
28934
  * @param context - Request context for runtime configuration
28551
28935
  * @returns Array of input processors configured for this memory instance
28552
28936
  */
28553
- async getInputProcessors(configuredProcessors = [], context) {
28554
- const processors = await super.getInputProcessors(configuredProcessors, context);
28555
- const om = await this.createOMProcessor(configuredProcessors, context);
28937
+ async getInputProcessors(configuredProcessors = [], context2) {
28938
+ const processors = await super.getInputProcessors(configuredProcessors, context2);
28939
+ const om = await this.createOMProcessor(configuredProcessors, context2);
28556
28940
  if (om) {
28557
28941
  processors.push(om);
28558
28942
  }
@@ -28563,9 +28947,9 @@ Notes:
28563
28947
  * OM needs processOutputResult to save messages at the end of the agent turn,
28564
28948
  * even when the observation threshold was never reached during the loop.
28565
28949
  */
28566
- async getOutputProcessors(configuredProcessors = [], context) {
28567
- const processors = await super.getOutputProcessors(configuredProcessors, context);
28568
- const om = await this.createOMProcessor(configuredProcessors, context);
28950
+ async getOutputProcessors(configuredProcessors = [], context2) {
28951
+ const processors = await super.getOutputProcessors(configuredProcessors, context2);
28952
+ const om = await this.createOMProcessor(configuredProcessors, context2);
28569
28953
  if (om) {
28570
28954
  processors.push(om);
28571
28955
  }
@@ -28576,11 +28960,11 @@ Notes:
28576
28960
  * A new instance is created per call — processorStates (e.g., sealedIds) are shared
28577
28961
  * via the ProcessorRunner's state map keyed by processor ID, not by instance identity.
28578
28962
  */
28579
- async createOMProcessor(configuredProcessors = [], context) {
28963
+ async createOMProcessor(configuredProcessors = [], context2) {
28580
28964
  const hasObservationalMemory = configuredProcessors.some(
28581
28965
  (p) => !("workflow" in p) && p.id === "observational-memory"
28582
28966
  );
28583
- const memoryContext = context?.get("MastraMemory");
28967
+ const memoryContext = context2?.get("MastraMemory");
28584
28968
  const runtimeMemoryConfig = memoryContext?.memoryConfig;
28585
28969
  const effectiveConfig = runtimeMemoryConfig ? this.getMergedThreadConfig(runtimeMemoryConfig) : this.threadConfig;
28586
28970
  const omConfig = normalizeObservationalMemoryConfig(effectiveConfig.observationalMemory);
@@ -31034,7 +31418,7 @@ export const mastra = new Mastra({
31034
31418
  /**
31035
31419
  * Enhanced task management system for complex coding tasks
31036
31420
  */
31037
- static async manageTaskList(context) {
31421
+ static async manageTaskList(context2) {
31038
31422
  if (!_AgentBuilderDefaults.taskStorage) {
31039
31423
  _AgentBuilderDefaults.taskStorage = /* @__PURE__ */ new Map();
31040
31424
  }
@@ -31046,16 +31430,16 @@ export const mastra = new Mastra({
31046
31430
  const sessionId = "current";
31047
31431
  const existingTasks = _AgentBuilderDefaults.taskStorage.get(sessionId) || [];
31048
31432
  try {
31049
- switch (context.action) {
31433
+ switch (context2.action) {
31050
31434
  case "create":
31051
- if (!context.tasks?.length) {
31435
+ if (!context2.tasks?.length) {
31052
31436
  return {
31053
31437
  success: false,
31054
31438
  tasks: existingTasks,
31055
31439
  message: "No tasks provided for creation"
31056
31440
  };
31057
31441
  }
31058
- const newTasks = context.tasks.map((task) => ({
31442
+ const newTasks = context2.tasks.map((task) => ({
31059
31443
  ...task,
31060
31444
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
31061
31445
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
@@ -31068,7 +31452,7 @@ export const mastra = new Mastra({
31068
31452
  message: `Created ${newTasks.length} new task(s)`
31069
31453
  };
31070
31454
  case "update":
31071
- if (!context.tasks?.length) {
31455
+ if (!context2.tasks?.length) {
31072
31456
  return {
31073
31457
  success: false,
31074
31458
  tasks: existingTasks,
@@ -31076,7 +31460,7 @@ export const mastra = new Mastra({
31076
31460
  };
31077
31461
  }
31078
31462
  const updatedTasks = existingTasks.map((existing) => {
31079
- const update = context.tasks.find((t) => t.id === existing.id);
31463
+ const update = context2.tasks.find((t) => t.id === existing.id);
31080
31464
  return update ? { ...existing, ...update, updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : existing;
31081
31465
  });
31082
31466
  _AgentBuilderDefaults.taskStorage.set(sessionId, updatedTasks);
@@ -31086,7 +31470,7 @@ export const mastra = new Mastra({
31086
31470
  message: "Tasks updated successfully"
31087
31471
  };
31088
31472
  case "complete":
31089
- if (!context.taskId) {
31473
+ if (!context2.taskId) {
31090
31474
  return {
31091
31475
  success: false,
31092
31476
  tasks: existingTasks,
@@ -31094,28 +31478,28 @@ export const mastra = new Mastra({
31094
31478
  };
31095
31479
  }
31096
31480
  const completedTasks = existingTasks.map(
31097
- (task) => task.id === context.taskId ? { ...task, status: "completed", updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : task
31481
+ (task) => task.id === context2.taskId ? { ...task, status: "completed", updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : task
31098
31482
  );
31099
31483
  _AgentBuilderDefaults.taskStorage.set(sessionId, completedTasks);
31100
31484
  return {
31101
31485
  success: true,
31102
31486
  tasks: completedTasks,
31103
- message: `Task ${context.taskId} marked as completed`
31487
+ message: `Task ${context2.taskId} marked as completed`
31104
31488
  };
31105
31489
  case "remove":
31106
- if (!context.taskId) {
31490
+ if (!context2.taskId) {
31107
31491
  return {
31108
31492
  success: false,
31109
31493
  tasks: existingTasks,
31110
31494
  message: "Task ID required for removal"
31111
31495
  };
31112
31496
  }
31113
- const filteredTasks = existingTasks.filter((task) => task.id !== context.taskId);
31497
+ const filteredTasks = existingTasks.filter((task) => task.id !== context2.taskId);
31114
31498
  _AgentBuilderDefaults.taskStorage.set(sessionId, filteredTasks);
31115
31499
  return {
31116
31500
  success: true,
31117
31501
  tasks: filteredTasks,
31118
- message: `Task ${context.taskId} removed`
31502
+ message: `Task ${context2.taskId} removed`
31119
31503
  };
31120
31504
  case "list":
31121
31505
  default:
@@ -31136,8 +31520,8 @@ export const mastra = new Mastra({
31136
31520
  /**
31137
31521
  * Perform multiple edits across files atomically
31138
31522
  */
31139
- static async performMultiEdit(context) {
31140
- const { operations, createBackup = false, projectPath = process.cwd() } = context;
31523
+ static async performMultiEdit(context2) {
31524
+ const { operations, createBackup = false, projectPath = process.cwd() } = context2;
31141
31525
  const results = [];
31142
31526
  try {
31143
31527
  for (const operation of operations) {
@@ -31200,8 +31584,8 @@ export const mastra = new Mastra({
31200
31584
  /**
31201
31585
  * Replace specific line ranges in a file with new content
31202
31586
  */
31203
- static async replaceLines(context) {
31204
- const { filePath, startLine, endLine, newContent, createBackup = false, projectPath = process.cwd() } = context;
31587
+ static async replaceLines(context2) {
31588
+ const { filePath, startLine, endLine, newContent, createBackup = false, projectPath = process.cwd() } = context2;
31205
31589
  try {
31206
31590
  const fullPath = isAbsolute(filePath) ? filePath : join(projectPath, filePath);
31207
31591
  const content = await readFile(fullPath, "utf-8");
@@ -31258,8 +31642,8 @@ export const mastra = new Mastra({
31258
31642
  /**
31259
31643
  * Show file lines with line numbers for debugging
31260
31644
  */
31261
- static async showFileLines(context) {
31262
- const { filePath, startLine, endLine, context: contextLines = 2, projectPath = process.cwd() } = context;
31645
+ static async showFileLines(context2) {
31646
+ const { filePath, startLine, endLine, context: contextLines = 2, projectPath = process.cwd() } = context2;
31263
31647
  try {
31264
31648
  const fullPath = isAbsolute(filePath) ? filePath : join(projectPath, filePath);
31265
31649
  const content = await readFile(fullPath, "utf-8");
@@ -31303,16 +31687,16 @@ export const mastra = new Mastra({
31303
31687
  /**
31304
31688
  * Signal task completion
31305
31689
  */
31306
- static async signalCompletion(context) {
31690
+ static async signalCompletion(context2) {
31307
31691
  const completionId = `completion_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
31308
31692
  let confidence = 70;
31309
- if (context.validation.testsRun) confidence += 15;
31310
- if (context.validation.buildsSuccessfully) confidence += 15;
31311
- if (context.validation.manualTestingRequired) confidence -= 10;
31693
+ if (context2.validation.testsRun) confidence += 15;
31694
+ if (context2.validation.buildsSuccessfully) confidence += 15;
31695
+ if (context2.validation.manualTestingRequired) confidence -= 10;
31312
31696
  let status;
31313
- if (context.validation.testsRun && context.validation.buildsSuccessfully) {
31697
+ if (context2.validation.testsRun && context2.validation.buildsSuccessfully) {
31314
31698
  status = "completed";
31315
- } else if (context.validation.manualTestingRequired) {
31699
+ } else if (context2.validation.manualTestingRequired) {
31316
31700
  status = "needs_testing";
31317
31701
  } else {
31318
31702
  status = "needs_review";
@@ -31320,16 +31704,16 @@ export const mastra = new Mastra({
31320
31704
  return {
31321
31705
  completionId,
31322
31706
  status,
31323
- summary: context.summary,
31707
+ summary: context2.summary,
31324
31708
  confidence: Math.min(100, Math.max(0, confidence))
31325
31709
  };
31326
31710
  }
31327
31711
  /**
31328
31712
  * Perform intelligent search with context
31329
31713
  */
31330
- static async performSmartSearch(context, projectPath) {
31714
+ static async performSmartSearch(context2, projectPath) {
31331
31715
  try {
31332
- const { query, type = "text", scope = {}, context: searchContext = {} } = context;
31716
+ const { query, type = "text", scope = {}, context: searchContext = {} } = context2;
31333
31717
  const { paths = ["."], fileTypes = [], excludePaths = [], maxResults = 50 } = scope;
31334
31718
  const { beforeLines = 2, afterLines = 2 } = searchContext;
31335
31719
  const rgArgs = [];
@@ -31406,7 +31790,7 @@ export const mastra = new Mastra({
31406
31790
  summary: {
31407
31791
  totalMatches: 0,
31408
31792
  filesSearched: 0,
31409
- patterns: [context.query]
31793
+ patterns: [context2.query]
31410
31794
  }
31411
31795
  };
31412
31796
  }
@@ -31417,9 +31801,9 @@ export const mastra = new Mastra({
31417
31801
  /**
31418
31802
  * Read file contents with optional line range
31419
31803
  */
31420
- static async readFile(context) {
31804
+ static async readFile(context2) {
31421
31805
  try {
31422
- const { filePath, startLine, endLine, encoding = "utf-8", projectPath } = context;
31806
+ const { filePath, startLine, endLine, encoding = "utf-8", projectPath } = context2;
31423
31807
  const resolvedPath = isAbsolute(filePath) ? filePath : resolve$1(projectPath || process.cwd(), filePath);
31424
31808
  const stats = await stat(resolvedPath);
31425
31809
  const content = await readFile(resolvedPath, { encoding });
@@ -31453,9 +31837,9 @@ export const mastra = new Mastra({
31453
31837
  /**
31454
31838
  * Write content to file with directory creation and backup options
31455
31839
  */
31456
- static async writeFile(context) {
31840
+ static async writeFile(context2) {
31457
31841
  try {
31458
- const { filePath, content, createDirs = true, encoding = "utf-8", projectPath } = context;
31842
+ const { filePath, content, createDirs = true, encoding = "utf-8", projectPath } = context2;
31459
31843
  const resolvedPath = isAbsolute(filePath) ? filePath : resolve$1(projectPath || process.cwd(), filePath);
31460
31844
  const dir = dirname(resolvedPath);
31461
31845
  if (createDirs) {
@@ -31471,7 +31855,7 @@ export const mastra = new Mastra({
31471
31855
  } catch (error) {
31472
31856
  return {
31473
31857
  success: false,
31474
- filePath: context.filePath,
31858
+ filePath: context2.filePath,
31475
31859
  message: `Failed to write file: ${error instanceof Error ? error.message : String(error)}`,
31476
31860
  errorMessage: error instanceof Error ? error.message : String(error)
31477
31861
  };
@@ -31480,7 +31864,7 @@ export const mastra = new Mastra({
31480
31864
  /**
31481
31865
  * List directory contents with filtering and metadata
31482
31866
  */
31483
- static async listDirectory(context) {
31867
+ static async listDirectory(context2) {
31484
31868
  try {
31485
31869
  const {
31486
31870
  path,
@@ -31490,7 +31874,7 @@ export const mastra = new Mastra({
31490
31874
  maxDepth = 10,
31491
31875
  includeMetadata = true,
31492
31876
  projectPath
31493
- } = context;
31877
+ } = context2;
31494
31878
  const gitignorePath = join(projectPath || process.cwd(), ".gitignore");
31495
31879
  let gitignoreFilter;
31496
31880
  try {
@@ -31562,7 +31946,7 @@ export const mastra = new Mastra({
31562
31946
  success: false,
31563
31947
  items: [],
31564
31948
  totalItems: 0,
31565
- path: context.path,
31949
+ path: context2.path,
31566
31950
  message: `Failed to list directory: ${error instanceof Error ? error.message : String(error)}`,
31567
31951
  errorMessage: error instanceof Error ? error.message : String(error)
31568
31952
  };
@@ -31571,10 +31955,10 @@ export const mastra = new Mastra({
31571
31955
  /**
31572
31956
  * Execute shell commands with proper error handling
31573
31957
  */
31574
- static async executeCommand(context) {
31958
+ static async executeCommand(context2) {
31575
31959
  const startTime = Date.now();
31576
31960
  try {
31577
- const { command, workingDirectory, timeout = 3e4, captureOutput = true, shell, env } = context;
31961
+ const { command, workingDirectory, timeout = 3e4, captureOutput = true, shell, env } = context2;
31578
31962
  const execOptions = {
31579
31963
  timeout,
31580
31964
  env: { ...process.env, ...env }
@@ -31603,8 +31987,8 @@ export const mastra = new Mastra({
31603
31987
  exitCode: error.code || 1,
31604
31988
  stdout: String(error.stdout || ""),
31605
31989
  stderr: String(error.stderr || ""),
31606
- command: context.command,
31607
- workingDirectory: context.workingDirectory,
31990
+ command: context2.command,
31991
+ workingDirectory: context2.workingDirectory,
31608
31992
  executionTime,
31609
31993
  errorMessage: error instanceof Error ? error.message : String(error)
31610
31994
  };
@@ -31613,7 +31997,7 @@ export const mastra = new Mastra({
31613
31997
  /**
31614
31998
  * Web search using a simple search approach
31615
31999
  */
31616
- static async webSearch(context) {
32000
+ static async webSearch(context2) {
31617
32001
  try {
31618
32002
  const {
31619
32003
  query,
@@ -31622,7 +32006,7 @@ export const mastra = new Mastra({
31622
32006
  // language = 'en',
31623
32007
  // includeImages = false,
31624
32008
  // dateRange = 'all',
31625
- } = context;
32009
+ } = context2;
31626
32010
  const startTime = Date.now();
31627
32011
  const searchUrl = `https://api.duckduckgo.com/?q=${encodeURIComponent(query)}&format=json&no_redirect=1&skip_disambig=1`;
31628
32012
  const response = await fetch(searchUrl);
@@ -31665,7 +32049,7 @@ export const mastra = new Mastra({
31665
32049
  } catch (error) {
31666
32050
  return {
31667
32051
  success: false,
31668
- query: context.query,
32052
+ query: context2.query,
31669
32053
  results: [],
31670
32054
  totalResults: 0,
31671
32055
  searchTime: 0,
@@ -36666,14 +37050,14 @@ var BaseContext4 = (
36666
37050
  return self._currentContext.get(key);
36667
37051
  };
36668
37052
  self.setValue = function(key, value) {
36669
- var context = new BaseContext23(self._currentContext);
36670
- context._currentContext.set(key, value);
36671
- return context;
37053
+ var context2 = new BaseContext23(self._currentContext);
37054
+ context2._currentContext.set(key, value);
37055
+ return context2;
36672
37056
  };
36673
37057
  self.deleteValue = function(key) {
36674
- var context = new BaseContext23(self._currentContext);
36675
- context._currentContext.delete(key);
36676
- return context;
37058
+ var context2 = new BaseContext23(self._currentContext);
37059
+ context2._currentContext.delete(key);
37060
+ return context2;
36677
37061
  };
36678
37062
  }
36679
37063
  return BaseContext23;
@@ -36778,16 +37162,16 @@ var ContextAPI4 = (
36778
37162
  ContextAPI23.prototype.active = function() {
36779
37163
  return this._getContextManager().active();
36780
37164
  };
36781
- ContextAPI23.prototype.with = function(context, fn, thisArg) {
37165
+ ContextAPI23.prototype.with = function(context2, fn, thisArg) {
36782
37166
  var _a16;
36783
37167
  var args = [];
36784
37168
  for (var _i = 3; _i < arguments.length; _i++) {
36785
37169
  args[_i - 3] = arguments[_i];
36786
37170
  }
36787
- return (_a16 = this._getContextManager()).with.apply(_a16, __spreadArray44([context, fn, thisArg], __read44(args), false));
37171
+ return (_a16 = this._getContextManager()).with.apply(_a16, __spreadArray44([context2, fn, thisArg], __read44(args), false));
36788
37172
  };
36789
- ContextAPI23.prototype.bind = function(context, target) {
36790
- return this._getContextManager().bind(context, target);
37173
+ ContextAPI23.prototype.bind = function(context2, target) {
37174
+ return this._getContextManager().bind(context2, target);
36791
37175
  };
36792
37176
  ContextAPI23.prototype._getContextManager = function() {
36793
37177
  return getGlobal4(API_NAME24) || NOOP_CONTEXT_MANAGER4;
@@ -36855,24 +37239,24 @@ var NonRecordingSpan4 = (
36855
37239
  })()
36856
37240
  );
36857
37241
  var SPAN_KEY4 = createContextKey4("OpenTelemetry Context Key SPAN");
36858
- function getSpan4(context) {
36859
- return context.getValue(SPAN_KEY4) || void 0;
37242
+ function getSpan4(context2) {
37243
+ return context2.getValue(SPAN_KEY4) || void 0;
36860
37244
  }
36861
37245
  function getActiveSpan4() {
36862
37246
  return getSpan4(ContextAPI4.getInstance().active());
36863
37247
  }
36864
- function setSpan4(context, span) {
36865
- return context.setValue(SPAN_KEY4, span);
37248
+ function setSpan4(context2, span) {
37249
+ return context2.setValue(SPAN_KEY4, span);
36866
37250
  }
36867
- function deleteSpan4(context) {
36868
- return context.deleteValue(SPAN_KEY4);
37251
+ function deleteSpan4(context2) {
37252
+ return context2.deleteValue(SPAN_KEY4);
36869
37253
  }
36870
- function setSpanContext4(context, spanContext) {
36871
- return setSpan4(context, new NonRecordingSpan4(spanContext));
37254
+ function setSpanContext4(context2, spanContext) {
37255
+ return setSpan4(context2, new NonRecordingSpan4(spanContext));
36872
37256
  }
36873
- function getSpanContext4(context) {
37257
+ function getSpanContext4(context2) {
36874
37258
  var _a16;
36875
- return (_a16 = getSpan4(context)) === null || _a16 === void 0 ? void 0 : _a16.spanContext();
37259
+ return (_a16 = getSpan4(context2)) === null || _a16 === void 0 ? void 0 : _a16.spanContext();
36876
37260
  }
36877
37261
  var VALID_TRACEID_REGEX4 = /^([0-9a-f]{32})$/i;
36878
37262
  var VALID_SPANID_REGEX4 = /^[0-9a-f]{16}$/i;
@@ -36894,15 +37278,15 @@ var NoopTracer4 = (
36894
37278
  (function() {
36895
37279
  function NoopTracer23() {
36896
37280
  }
36897
- NoopTracer23.prototype.startSpan = function(name16, options, context) {
36898
- if (context === void 0) {
36899
- context = contextApi4.active();
37281
+ NoopTracer23.prototype.startSpan = function(name16, options, context2) {
37282
+ if (context2 === void 0) {
37283
+ context2 = contextApi4.active();
36900
37284
  }
36901
37285
  var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
36902
37286
  if (root) {
36903
37287
  return new NonRecordingSpan4();
36904
37288
  }
36905
- var parentFromContext = context && getSpanContext4(context);
37289
+ var parentFromContext = context2 && getSpanContext4(context2);
36906
37290
  if (isSpanContext4(parentFromContext) && isSpanContextValid4(parentFromContext)) {
36907
37291
  return new NonRecordingSpan4(parentFromContext);
36908
37292
  } else {
@@ -36946,8 +37330,8 @@ var ProxyTracer4 = (
36946
37330
  this.version = version;
36947
37331
  this.options = options;
36948
37332
  }
36949
- ProxyTracer23.prototype.startSpan = function(name16, options, context) {
36950
- return this._getTracer().startSpan(name16, options, context);
37333
+ ProxyTracer23.prototype.startSpan = function(name16, options, context2) {
37334
+ return this._getTracer().startSpan(name16, options, context2);
36951
37335
  };
36952
37336
  ProxyTracer23.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
36953
37337
  var tracer = this._getTracer();
@@ -37607,16 +37991,16 @@ var object4 = ({
37607
37991
  }
37608
37992
  }
37609
37993
  },
37610
- async parseOutput({ text: text23 }, context) {
37994
+ async parseOutput({ text: text23 }, context2) {
37611
37995
  const parseResult = await safeParseJSON4({ text: text23 });
37612
37996
  if (!parseResult.success) {
37613
37997
  throw new NoObjectGeneratedError4({
37614
37998
  message: "No object generated: could not parse the response.",
37615
37999
  cause: parseResult.error,
37616
38000
  text: text23,
37617
- response: context.response,
37618
- usage: context.usage,
37619
- finishReason: context.finishReason
38001
+ response: context2.response,
38002
+ usage: context2.usage,
38003
+ finishReason: context2.finishReason
37620
38004
  });
37621
38005
  }
37622
38006
  const validationResult = await safeValidateTypes4({
@@ -37628,9 +38012,9 @@ var object4 = ({
37628
38012
  message: "No object generated: response did not match schema.",
37629
38013
  cause: validationResult.error,
37630
38014
  text: text23,
37631
- response: context.response,
37632
- usage: context.usage,
37633
- finishReason: context.finishReason
38015
+ response: context2.response,
38016
+ usage: context2.usage,
38017
+ finishReason: context2.finishReason
37634
38018
  });
37635
38019
  }
37636
38020
  return validationResult.value;
@@ -37669,7 +38053,7 @@ var PlanningIterationResultSchema = z.object({
37669
38053
  });
37670
38054
  var taskPlanningPrompts = {
37671
38055
  planningAgent: {
37672
- instructions: (context) => `You are a Mastra workflow planning expert. Your task is to create a detailed, executable task plan.
38056
+ instructions: (context2) => `You are a Mastra workflow planning expert. Your task is to create a detailed, executable task plan.
37673
38057
 
37674
38058
  PLANNING RESPONSIBILITIES:
37675
38059
  1. **Analyze Requirements**: Review the user's description and requirements thoroughly
@@ -37682,8 +38066,8 @@ PLANNING RESPONSIBILITIES:
37682
38066
  - NEVER ask questions that have already been answered before
37683
38067
  5. **Incorporate Feedback**: Use any previous answers or feedback to refine the plan
37684
38068
 
37685
- ${context.storedQAPairs.length > 0 ? `PREVIOUS QUESTION-ANSWER PAIRS (${context.storedQAPairs.length} total):
37686
- ${context.storedQAPairs.map(
38069
+ ${context2.storedQAPairs.length > 0 ? `PREVIOUS QUESTION-ANSWER PAIRS (${context2.storedQAPairs.length} total):
38070
+ ${context2.storedQAPairs.map(
37687
38071
  (pair, index) => `${index + 1}. Q: ${pair.question.question}
37688
38072
  A: ${pair.answer || "NOT ANSWERED YET"}
37689
38073
  Type: ${pair.question.type}
@@ -37694,45 +38078,45 @@ ${context.storedQAPairs.map(
37694
38078
  IMPORTANT: DO NOT ASK ANY QUESTIONS THAT HAVE ALREADY BEEN ASKED!` : ""}
37695
38079
 
37696
38080
  Based on the context and any user answers, create or refine the task plan.`,
37697
- refinementPrompt: (context) => `Refine the existing task plan based on all user answers collected so far.
38081
+ refinementPrompt: (context2) => `Refine the existing task plan based on all user answers collected so far.
37698
38082
 
37699
38083
  ANSWERED QUESTIONS AND RESPONSES:
37700
- ${context.storedQAPairs.filter((pair) => pair.answer).map(
38084
+ ${context2.storedQAPairs.filter((pair) => pair.answer).map(
37701
38085
  (pair, index) => `${index + 1}. Q: ${pair.question.question}
37702
38086
  A: ${pair.answer}
37703
38087
  Context: ${pair.question.context || "None"}`
37704
38088
  ).join("\n\n")}
37705
38089
 
37706
38090
  REQUIREMENTS:
37707
- - Action: ${context.action}
37708
- - Workflow Name: ${context.workflowName || "To be determined"}
37709
- - Description: ${context.description || "Not specified"}
37710
- - Requirements: ${context.requirements || "Not specified"}
38091
+ - Action: ${context2.action}
38092
+ - Workflow Name: ${context2.workflowName || "To be determined"}
38093
+ - Description: ${context2.description || "Not specified"}
38094
+ - Requirements: ${context2.requirements || "Not specified"}
37711
38095
 
37712
38096
  PROJECT CONTEXT:
37713
- - Discovered Workflows: ${JSON.stringify(context.discoveredWorkflows, null, 2)}
37714
- - Project Structure: ${JSON.stringify(context.projectStructure, null, 2)}
37715
- - Research: ${JSON.stringify(context.research, null, 2)}
38097
+ - Discovered Workflows: ${JSON.stringify(context2.discoveredWorkflows, null, 2)}
38098
+ - Project Structure: ${JSON.stringify(context2.projectStructure, null, 2)}
38099
+ - Research: ${JSON.stringify(context2.research, null, 2)}
37716
38100
 
37717
- ${context.hasTaskFeedback ? `
38101
+ ${context2.hasTaskFeedback ? `
37718
38102
  USER FEEDBACK ON PREVIOUS TASK LIST:
37719
- ${context.userAnswers?.taskFeedback}
38103
+ ${context2.userAnswers?.taskFeedback}
37720
38104
 
37721
38105
  PLEASE INCORPORATE THIS FEEDBACK INTO THE REFINED TASK LIST.` : ""}
37722
38106
 
37723
38107
  Refine the task list and determine if any additional questions are needed.`,
37724
- initialPrompt: (context) => `Create an initial task plan for ${context.action}ing a Mastra workflow.
38108
+ initialPrompt: (context2) => `Create an initial task plan for ${context2.action}ing a Mastra workflow.
37725
38109
 
37726
38110
  REQUIREMENTS:
37727
- - Action: ${context.action}
37728
- - Workflow Name: ${context.workflowName || "To be determined"}
37729
- - Description: ${context.description || "Not specified"}
37730
- - Requirements: ${context.requirements || "Not specified"}
38111
+ - Action: ${context2.action}
38112
+ - Workflow Name: ${context2.workflowName || "To be determined"}
38113
+ - Description: ${context2.description || "Not specified"}
38114
+ - Requirements: ${context2.requirements || "Not specified"}
37731
38115
 
37732
38116
  PROJECT CONTEXT:
37733
- - Discovered Workflows: ${JSON.stringify(context.discoveredWorkflows, null, 2)}
37734
- - Project Structure: ${JSON.stringify(context.projectStructure, null, 2)}
37735
- - Research: ${JSON.stringify(context.research, null, 2)}
38117
+ - Discovered Workflows: ${JSON.stringify(context2.discoveredWorkflows, null, 2)}
38118
+ - Project Structure: ${JSON.stringify(context2.projectStructure, null, 2)}
38119
+ - Research: ${JSON.stringify(context2.research, null, 2)}
37736
38120
 
37737
38121
  Create specific tasks and identify any questions that need user clarification.`
37738
38122
  },
@@ -38390,12 +38774,12 @@ RESEARCH OBJECTIVES:
38390
38774
  4. **Technical Details**: Understand schemas, steps, and configuration
38391
38775
 
38392
38776
  Use the available documentation and examples tools to gather comprehensive information about Mastra workflows.`,
38393
- prompt: (context) => `Research everything about Mastra workflows to help create or edit them effectively.
38777
+ prompt: (context2) => `Research everything about Mastra workflows to help create or edit them effectively.
38394
38778
 
38395
38779
  PROJECT CONTEXT:
38396
- - Project Structure: ${JSON.stringify(context.projectStructure, null, 2)}
38397
- - Dependencies: ${JSON.stringify(context.dependencies, null, 2)}
38398
- - Has Workflows Directory: ${context.hasWorkflowsDir}
38780
+ - Project Structure: ${JSON.stringify(context2.projectStructure, null, 2)}
38781
+ - Dependencies: ${JSON.stringify(context2.dependencies, null, 2)}
38782
+ - Has Workflows Directory: ${context2.hasWorkflowsDir}
38399
38783
 
38400
38784
  Focus on:
38401
38785
  1. How to create workflows using createWorkflow()
@@ -38408,21 +38792,21 @@ Focus on:
38408
38792
  Use the docs and examples tools to gather comprehensive information.`
38409
38793
  },
38410
38794
  executionAgent: {
38411
- instructions: (context) => `You are executing a workflow ${context.action} task for: "${context.workflowName}"
38795
+ instructions: (context2) => `You are executing a workflow ${context2.action} task for: "${context2.workflowName}"
38412
38796
 
38413
38797
  CRITICAL WORKFLOW EXECUTION REQUIREMENTS:
38414
38798
  1. **EXPLORE PROJECT STRUCTURE FIRST**: Use listDirectory and readFile tools to understand the existing project layout, folder structure, and conventions before creating any files
38415
38799
  2. **FOLLOW PROJECT CONVENTIONS**: Look at existing workflows, agents, and file structures to understand where new files should be placed (typically src/mastra/workflows/, src/mastra/agents/, etc.)
38416
38800
  3. **USE PRE-LOADED TASK LIST**: Your task list has been pre-populated in the taskManager tool. Use taskManager with action 'list' to see all tasks, and action 'update' to mark progress
38417
- 4. **COMPLETE EVERY SINGLE TASK**: You MUST complete ALL ${context.tasksLength} tasks that are already in the taskManager. Do not stop until every task is marked as 'completed'
38801
+ 4. **COMPLETE EVERY SINGLE TASK**: You MUST complete ALL ${context2.tasksLength} tasks that are already in the taskManager. Do not stop until every task is marked as 'completed'
38418
38802
  5. **Follow Task Dependencies**: Execute tasks in the correct order, respecting dependencies
38419
38803
  6. **Request User Input When Needed**: If you encounter choices (like email providers, databases, etc.) that require user decision, return questions for clarification
38420
38804
  7. **STRICT WORKFLOW ORGANIZATION**: When creating or editing workflows, you MUST follow this exact structure
38421
38805
 
38422
38806
  MANDATORY WORKFLOW FOLDER STRUCTURE:
38423
- When ${context.action === "create" ? "creating a new workflow" : "editing a workflow"}, you MUST organize files as follows:
38807
+ When ${context2.action === "create" ? "creating a new workflow" : "editing a workflow"}, you MUST organize files as follows:
38424
38808
 
38425
- \u{1F4C1} src/mastra/workflows/${context.workflowName?.toLowerCase().replace(/[^a-z0-9]/g, "-") || "new-workflow"}/
38809
+ \u{1F4C1} src/mastra/workflows/${context2.workflowName?.toLowerCase().replace(/[^a-z0-9]/g, "-") || "new-workflow"}/
38426
38810
  \u251C\u2500\u2500 \u{1F4C4} types.ts # All Zod schemas and TypeScript types
38427
38811
  \u251C\u2500\u2500 \u{1F4C4} steps.ts # All individual step definitions
38428
38812
  \u251C\u2500\u2500 \u{1F4C4} workflow.ts # Main workflow composition and export
@@ -38439,34 +38823,34 @@ CRITICAL FILE ORGANIZATION RULES:
38439
38823
 
38440
38824
  CRITICAL COMPLETION REQUIREMENTS:
38441
38825
  - ALWAYS explore the directory structure before creating files to understand where they should go
38442
- - You MUST complete ALL ${context.tasksLength} tasks before returning status='completed'
38826
+ - You MUST complete ALL ${context2.tasksLength} tasks before returning status='completed'
38443
38827
  - Use taskManager tool with action 'list' to see your current task list and action 'update' to mark tasks as 'in_progress' or 'completed'
38444
38828
  - If you need to make any decisions during implementation (choosing providers, configurations, etc.), return questions for user clarification
38445
38829
  - DO NOT make assumptions about file locations - explore first!
38446
38830
  - You cannot finish until ALL tasks in the taskManager are marked as 'completed'
38447
38831
 
38448
38832
  PROJECT CONTEXT:
38449
- - Action: ${context.action}
38450
- - Workflow Name: ${context.workflowName}
38451
- - Project Path: ${context.currentProjectPath}
38452
- - Discovered Workflows: ${JSON.stringify(context.discoveredWorkflows, null, 2)}
38453
- - Project Structure: ${JSON.stringify(context.projectStructure, null, 2)}
38833
+ - Action: ${context2.action}
38834
+ - Workflow Name: ${context2.workflowName}
38835
+ - Project Path: ${context2.currentProjectPath}
38836
+ - Discovered Workflows: ${JSON.stringify(context2.discoveredWorkflows, null, 2)}
38837
+ - Project Structure: ${JSON.stringify(context2.projectStructure, null, 2)}
38454
38838
 
38455
38839
  AVAILABLE RESEARCH:
38456
- ${JSON.stringify(context.research, null, 2)}
38840
+ ${JSON.stringify(context2.research, null, 2)}
38457
38841
 
38458
- PRE-LOADED TASK LIST (${context.tasksLength} tasks already in taskManager):
38459
- ${context.tasks.map((task) => `- ${task.id}: ${task.content} (Priority: ${task.priority})`).join("\n")}
38842
+ PRE-LOADED TASK LIST (${context2.tasksLength} tasks already in taskManager):
38843
+ ${context2.tasks.map((task) => `- ${task.id}: ${task.content} (Priority: ${task.priority})`).join("\n")}
38460
38844
 
38461
- ${context.resumeData ? `USER PROVIDED ANSWERS: ${JSON.stringify(context.resumeData.answers, null, 2)}` : ""}
38845
+ ${context2.resumeData ? `USER PROVIDED ANSWERS: ${JSON.stringify(context2.resumeData.answers, null, 2)}` : ""}
38462
38846
 
38463
38847
  Start by exploring the project structure, then use 'taskManager' with action 'list' to see your pre-loaded tasks, and work through each task systematically.`,
38464
- prompt: (context) => context.resumeData ? `Continue working on the task list. The user has provided answers to your questions: ${JSON.stringify(context.resumeData.answers, null, 2)}.
38848
+ prompt: (context2) => context2.resumeData ? `Continue working on the task list. The user has provided answers to your questions: ${JSON.stringify(context2.resumeData.answers, null, 2)}.
38465
38849
 
38466
- CRITICAL: You must complete ALL ${context.tasks.length} tasks that are pre-loaded in the taskManager. Use the taskManager tool with action 'list' to check your progress and continue with the next tasks. Do not stop until every single task is marked as 'completed'.` : `Begin executing the pre-loaded task list to ${context.action} the workflow "${context.workflowName}".
38850
+ CRITICAL: You must complete ALL ${context2.tasks.length} tasks that are pre-loaded in the taskManager. Use the taskManager tool with action 'list' to check your progress and continue with the next tasks. Do not stop until every single task is marked as 'completed'.` : `Begin executing the pre-loaded task list to ${context2.action} the workflow "${context2.workflowName}".
38467
38851
 
38468
38852
  CRITICAL REQUIREMENTS:
38469
- - Your ${context.tasks.length} tasks have been PRE-LOADED into the taskManager tool
38853
+ - Your ${context2.tasks.length} tasks have been PRE-LOADED into the taskManager tool
38470
38854
  - Start by exploring the project directory structure using listDirectory and readFile tools to understand:
38471
38855
  - Where workflows are typically stored (look for src/mastra/workflows/ or similar)
38472
38856
  - What the existing file structure looks like
@@ -38481,20 +38865,20 @@ CRITICAL FILE ORGANIZATION RULES:
38481
38865
  - **NEVER put everything in one file** - separate types, steps, and workflow composition
38482
38866
  - Follow the 4-file structure above for maximum maintainability and clarity
38483
38867
 
38484
- - DO NOT return status='completed' until ALL ${context.tasks.length} tasks are marked as 'completed' in the taskManager
38868
+ - DO NOT return status='completed' until ALL ${context2.tasks.length} tasks are marked as 'completed' in the taskManager
38485
38869
 
38486
- PRE-LOADED TASKS (${context.tasks.length} total tasks in taskManager):
38487
- ${context.tasks.map((task, index) => `${index + 1}. [${task.id}] ${task.content}`).join("\n")}
38870
+ PRE-LOADED TASKS (${context2.tasks.length} total tasks in taskManager):
38871
+ ${context2.tasks.map((task, index) => `${index + 1}. [${task.id}] ${task.content}`).join("\n")}
38488
38872
 
38489
38873
  Use taskManager with action 'list' to see the current status of all tasks. You must complete every single one before finishing.`,
38490
- iterationPrompt: (context) => `Continue working on the remaining tasks. You have already completed these tasks: [${context.completedTasks.map((t) => t.id).join(", ")}]
38874
+ iterationPrompt: (context2) => `Continue working on the remaining tasks. You have already completed these tasks: [${context2.completedTasks.map((t) => t.id).join(", ")}]
38491
38875
 
38492
- REMAINING TASKS TO COMPLETE (${context.pendingTasks.length} tasks):
38493
- ${context.pendingTasks.map((task, index) => `${index + 1}. [${task.id}] ${task.content}`).join("\n")}
38876
+ REMAINING TASKS TO COMPLETE (${context2.pendingTasks.length} tasks):
38877
+ ${context2.pendingTasks.map((task, index) => `${index + 1}. [${task.id}] ${task.content}`).join("\n")}
38494
38878
 
38495
- CRITICAL: You must complete ALL of these remaining ${context.pendingTasks.length} tasks. Use taskManager with action 'list' to check current status and action 'update' to mark tasks as completed.
38879
+ CRITICAL: You must complete ALL of these remaining ${context2.pendingTasks.length} tasks. Use taskManager with action 'list' to check current status and action 'update' to mark tasks as completed.
38496
38880
 
38497
- ${context.resumeData ? `USER PROVIDED ANSWERS: ${JSON.stringify(context.resumeData.answers, null, 2)}` : ""}`
38881
+ ${context2.resumeData ? `USER PROVIDED ANSWERS: ${JSON.stringify(context2.resumeData.answers, null, 2)}` : ""}`
38498
38882
  },
38499
38883
  validation: {
38500
38884
  instructions: `CRITICAL VALIDATION INSTRUCTIONS:
@@ -39500,5 +39884,5 @@ var OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE = createRoute({
39500
39884
  });
39501
39885
 
39502
39886
  export { CANCEL_AGENT_BUILDER_ACTION_RUN_ROUTE, CREATE_AGENT_BUILDER_ACTION_RUN_ROUTE, GET_AGENT_BUILDER_ACTION_BY_ID_ROUTE, GET_AGENT_BUILDER_ACTION_RUN_BY_ID_ROUTE, LIST_AGENT_BUILDER_ACTIONS_ROUTE, LIST_AGENT_BUILDER_ACTION_RUNS_ROUTE, OBSERVE_STREAM_AGENT_BUILDER_ACTION_ROUTE, OBSERVE_STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE, RESUME_AGENT_BUILDER_ACTION_ROUTE, RESUME_ASYNC_AGENT_BUILDER_ACTION_ROUTE, RESUME_STREAM_AGENT_BUILDER_ACTION_ROUTE, START_AGENT_BUILDER_ACTION_RUN_ROUTE, START_ASYNC_AGENT_BUILDER_ACTION_ROUTE, STREAM_AGENT_BUILDER_ACTION_ROUTE, STREAM_LEGACY_AGENT_BUILDER_ACTION_ROUTE, agent_builder_exports };
39503
- //# sourceMappingURL=chunk-Z3ZWANXZ.js.map
39504
- //# sourceMappingURL=chunk-Z3ZWANXZ.js.map
39887
+ //# sourceMappingURL=chunk-JXDIK7K7.js.map
39888
+ //# sourceMappingURL=chunk-JXDIK7K7.js.map