@mastra/memory 1.41.0 → 1.41.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.
@@ -3710,7 +3710,7 @@ function trimStartOfStream() {
3710
3710
  return text2;
3711
3711
  };
3712
3712
  }
3713
- // ../_vendored/ai_v5/dist/dist-CjxSswTJ.js
3713
+ // ../_vendored/ai_v5/dist/dist-BYnbJEqC.js
3714
3714
  var marker$1$16 = "vercel.ai.error";
3715
3715
  var symbol$1$17 = Symbol.for(marker$1$16);
3716
3716
  var _a$1$2;
@@ -4271,7 +4271,7 @@ function withUserAgentSuffix$2(headers, ...userAgentSuffixParts) {
4271
4271
  normalizedHeaders.set("user-agent", [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(" "));
4272
4272
  return Object.fromEntries(normalizedHeaders.entries());
4273
4273
  }
4274
- var VERSION$8 = "3.0.43";
4274
+ var VERSION$8 = "3.0.44";
4275
4275
  var getOriginalFetch$3 = () => globalThis.fetch;
4276
4276
  var getFromApi$2 = async ({ url, headers = {}, successfulResponseHandler, failedResponseHandler, abortSignal, fetch = getOriginalFetch$3() }) => {
4277
4277
  try {
@@ -5695,10 +5695,24 @@ function asSchema$2(schema) {
5695
5695
  }) : isSchema$2(schema) ? schema : typeof schema === "function" ? schema() : zodSchema$2(schema);
5696
5696
  }
5697
5697
  var { btoa: btoa$3, atob: atob$6 } = globalThis;
5698
+ var typedArrayTag$2 = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get;
5699
+ var arrayBufferByteLength$2 = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
5700
+ function isUint8Array$2(value) {
5701
+ return ArrayBuffer.isView(value) && typedArrayTag$2.call(value) === "Uint8Array";
5702
+ }
5703
+ function isArrayBuffer$2(value) {
5704
+ if (typeof value !== "object" || value === null || !("byteLength" in value)) return false;
5705
+ try {
5706
+ arrayBufferByteLength$2.call(value);
5707
+ return true;
5708
+ } catch (e) {
5709
+ return false;
5710
+ }
5711
+ }
5698
5712
  function withoutTrailingSlash$2(url) {
5699
5713
  return url == null ? void 0 : url.replace(/\/$/, "");
5700
5714
  }
5701
- // ../_vendored/ai_v5/dist/dist-BB1ns2jp.js
5715
+ // ../_vendored/ai_v5/dist/dist-oTd7Lp_i.js
5702
5716
  function getContext$2() {
5703
5717
  return { headers: {} };
5704
5718
  }
@@ -6034,6 +6048,7 @@ function isTimeoutError$2(error) {
6034
6048
  }
6035
6049
  async function asGatewayError$2(error, authMethod) {
6036
6050
  var _a10;
6051
+ if ((error instanceof Error || typeof DOMException === "function" && error instanceof DOMException) && (error.name === "AbortError" || error.name === "TimeoutError")) throw error;
6037
6052
  if (GatewayError$2.isInstance(error)) return error;
6038
6053
  if (isTimeoutError$2(error)) return GatewayTimeoutError$2.createTimeoutError({
6039
6054
  originalMessage: error instanceof Error ? error.message : "Unknown error",
@@ -6677,7 +6692,7 @@ async function getVercelRequestId$2() {
6677
6692
  var _a10;
6678
6693
  return (_a10 = getContext$2().headers) == null ? void 0 : _a10["x-vercel-id"];
6679
6694
  }
6680
- var VERSION$7 = "2.0.174";
6695
+ var VERSION$7 = "2.0.176";
6681
6696
  var AI_GATEWAY_PROTOCOL_VERSION$2 = "0.0.1";
6682
6697
  function createGatewayProvider$1(options = {}) {
6683
6698
  var _a10, _b10;
@@ -7712,11 +7727,11 @@ function getGlobalProvider$2() {
7712
7727
  var _a17;
7713
7728
  return (_a17 = globalThis.AI_SDK_DEFAULT_PROVIDER) != null ? _a17 : gateway$2;
7714
7729
  }
7715
- var VERSION$6 = "5.0.283";
7730
+ var VERSION$6 = "5.0.285";
7716
7731
  var dataContentSchema$1 = zod_v4.z.union([
7717
7732
  zod_v4.z.string(),
7718
- zod_v4.z.instanceof(Uint8Array),
7719
- zod_v4.z.instanceof(ArrayBuffer),
7733
+ zod_v4.z.custom(isUint8Array$2, { message: "Must be a Uint8Array" }),
7734
+ zod_v4.z.custom(isArrayBuffer$2, { message: "Must be an ArrayBuffer" }),
7720
7735
  zod_v4.z.custom((value) => {
7721
7736
  var _a17, _b;
7722
7737
  return (_b = (_a17 = globalThis.Buffer) == null ? void 0 : _a17.isBuffer(value)) != null ? _b : false;
@@ -8618,7 +8633,7 @@ var object$3 = ({ schema: inputSchema }) => {
8618
8633
  }
8619
8634
  };
8620
8635
  };
8621
- // ../_vendored/ai_v6/dist/dist-Cdb_i6Zs.js
8636
+ // ../_vendored/ai_v6/dist/dist-DwNW4Hp7.js
8622
8637
  var marker$1$14 = "vercel.ai.error";
8623
8638
  var symbol$1$15 = Symbol.for(marker$1$14);
8624
8639
  var _a$1$1;
@@ -9022,6 +9037,20 @@ function convertUint8ArrayToBase64$1(array) {
9022
9037
  for (let i = 0; i < array.length; i += chunkSize) chunks.push(String.fromCodePoint(...array.subarray(i, i + chunkSize)));
9023
9038
  return btoa$2(chunks.join(""));
9024
9039
  }
9040
+ var typedArrayTag$1 = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get;
9041
+ var arrayBufferByteLength$1 = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
9042
+ function isUint8Array$1(value) {
9043
+ return ArrayBuffer.isView(value) && typedArrayTag$1.call(value) === "Uint8Array";
9044
+ }
9045
+ function isArrayBuffer$1(value) {
9046
+ if (typeof value !== "object" || value === null || !("byteLength" in value)) return false;
9047
+ try {
9048
+ arrayBufferByteLength$1.call(value);
9049
+ return true;
9050
+ } catch (e) {
9051
+ return false;
9052
+ }
9053
+ }
9025
9054
  async function cancelResponseBody$1(response) {
9026
9055
  var _a2;
9027
9056
  try {
@@ -9476,7 +9505,7 @@ function withUserAgentSuffix$1(headers, ...userAgentSuffixParts) {
9476
9505
  normalizedHeaders.set("user-agent", [currentUserAgentHeader, ...userAgentSuffixParts].filter(Boolean).join(" "));
9477
9506
  return Object.fromEntries(normalizedHeaders.entries());
9478
9507
  }
9479
- var VERSION$5 = "4.0.63";
9508
+ var VERSION$5 = "4.0.64";
9480
9509
  var getOriginalFetch$1 = () => globalThis.fetch;
9481
9510
  var getFromApi$1 = async ({ url, headers = {}, successfulResponseHandler, failedResponseHandler, abortSignal, fetch, validateUrl, credentialedOrigin, trustedOrigin }) => {
9482
9511
  try {
@@ -10952,7 +10981,7 @@ var createJsonResponseHandler$1 = (responseSchema) => async ({ response, url, re
10952
10981
  function withoutTrailingSlash$1(url) {
10953
10982
  return url == null ? void 0 : url.replace(/\/$/, "");
10954
10983
  }
10955
- // ../_vendored/ai_v6/dist/dist-nkEfZgfI.js
10984
+ // ../_vendored/ai_v6/dist/dist-B9RoRXxy.js
10956
10985
  function getContext$1() {
10957
10986
  return { headers: {} };
10958
10987
  }
@@ -11342,6 +11371,7 @@ function isTimeoutError$1(error) {
11342
11371
  }
11343
11372
  async function asGatewayError$1(error, authMethod) {
11344
11373
  var _a11;
11374
+ if ((error instanceof Error || typeof DOMException === "function" && error instanceof DOMException) && (error.name === "AbortError" || error.name === "TimeoutError")) throw error;
11345
11375
  if (GatewayError$1.isInstance(error)) return error;
11346
11376
  if (isTimeoutError$1(error)) return GatewayTimeoutError$1.createTimeoutError({
11347
11377
  originalMessage: error instanceof Error ? error.message : "Unknown error",
@@ -12402,6 +12432,54 @@ var browserbaseSearchToolFactory$1 = createProviderToolFactoryWithOutputSchema({
12402
12432
  })])))
12403
12433
  });
12404
12434
  var browserbaseSearch$1 = (config = {}) => browserbaseSearchToolFactory$1(config);
12435
+ var gatewayToolErrorSchema$1 = () => zod.z.object({
12436
+ error: zod.z.enum([
12437
+ "api_error",
12438
+ "configuration_error",
12439
+ "execution_error",
12440
+ "gateway_rate_limit",
12441
+ "invalid_input",
12442
+ "rate_limit",
12443
+ "timeout",
12444
+ "unknown",
12445
+ "unknown_tool"
12446
+ ]),
12447
+ message: zod.z.string(),
12448
+ statusCode: zod.z.number().optional(),
12449
+ retryAfter: zod.z.string().optional(),
12450
+ statusText: zod.z.string().optional()
12451
+ }).passthrough();
12452
+ var deepseekFetchToolFactory$1 = createProviderToolFactoryWithOutputSchema({
12453
+ id: "gateway.deepseek_fetch",
12454
+ inputSchema: lazySchema$1(() => zodSchema$1(zod.z.object({ url: zod.z.string().describe("URL to fetch, at most 8192 characters; HTTP(S) only, without a username or password.") }))),
12455
+ outputSchema: lazySchema$1(() => zodSchema$1(zod.z.union([zod.z.object({
12456
+ title: zod.z.string().nullish(),
12457
+ content: zod.z.string()
12458
+ }).passthrough(), gatewayToolErrorSchema$1()])))
12459
+ });
12460
+ var deepseekFetch$1 = (config = {}) => deepseekFetchToolFactory$1(config);
12461
+ var deepseekSearchToolFactory$1 = createProviderToolFactoryWithOutputSchema({
12462
+ id: "gateway.deepseek_search",
12463
+ inputSchema: lazySchema$1(() => zodSchema$1(zod.z.object({
12464
+ query: zod.z.string().describe("Web search query, 1 to 128 Unicode characters. Supports site:, -site:, lang:, after:, before:, and quoted phrases."),
12465
+ count: zod.z.number().int().optional().describe("Number of results, 1 to 50 (default: 10)."),
12466
+ need_content: zod.z.boolean().optional().describe("Include available page content (default: false)."),
12467
+ ori_question: zod.z.string().nullable().optional().describe("Original user question, 1 to 128 Unicode characters.")
12468
+ }))),
12469
+ outputSchema: lazySchema$1(() => zodSchema$1(zod.z.union([zod.z.object({ results: zod.z.array(zod.z.object({
12470
+ authority: zod.z.number().nullish(),
12471
+ content: zod.z.string().nullish(),
12472
+ date: zod.z.string().nullish(),
12473
+ rerank_score: zod.z.number().nullish(),
12474
+ site_icon: zod.z.string().nullish(),
12475
+ site_name: zod.z.string().nullish(),
12476
+ snippet: zod.z.string().nullish(),
12477
+ summary: zod.z.string().nullish(),
12478
+ title: zod.z.string().nullish(),
12479
+ url: zod.z.string().nullish()
12480
+ }).passthrough()) }).passthrough(), gatewayToolErrorSchema$1()])))
12481
+ });
12482
+ var deepseekSearch$1 = (config = {}) => deepseekSearchToolFactory$1(config);
12405
12483
  var exaSearchToolFactory$1 = createProviderToolFactoryWithOutputSchema({
12406
12484
  id: "gateway.exa_search",
12407
12485
  inputSchema: lazySchema$1(() => zodSchema$1(zod.z.object({
@@ -12558,21 +12636,7 @@ var parallelSearchToolFactory$1 = createProviderToolFactoryWithOutputSchema({
12558
12636
  count: zod.z.number().optional()
12559
12637
  })).nullable().optional(),
12560
12638
  session_id: zod.z.string().optional()
12561
- }), zod.z.object({
12562
- error: zod.z.enum([
12563
- "api_error",
12564
- "configuration_error",
12565
- "execution_error",
12566
- "gateway_rate_limit",
12567
- "invalid_input",
12568
- "rate_limit",
12569
- "timeout",
12570
- "unknown",
12571
- "unknown_tool"
12572
- ]),
12573
- statusCode: zod.z.number().optional(),
12574
- message: zod.z.string()
12575
- })])))
12639
+ }), gatewayToolErrorSchema$1()])))
12576
12640
  });
12577
12641
  var parallelSearch$1 = (config = {}) => parallelSearchToolFactory$1(config);
12578
12642
  var perplexitySearchToolFactory$1 = createProviderToolFactoryWithOutputSchema({
@@ -12803,19 +12867,7 @@ var takoSearchToolFactory$1 = createProviderToolFactoryWithOutputSchema({
12803
12867
  }).nullish()
12804
12868
  }).nullish(),
12805
12869
  related: zod.z.array(zod.z.object({}).passthrough()).nullish()
12806
- }).passthrough(), zod.z.object({
12807
- error: zod.z.enum([
12808
- "api_error",
12809
- "configuration_error",
12810
- "execution_error",
12811
- "invalid_input",
12812
- "rate_limit",
12813
- "timeout",
12814
- "unknown_tool"
12815
- ]),
12816
- statusCode: zod.z.number().optional(),
12817
- message: zod.z.string()
12818
- })])))
12870
+ }).passthrough(), gatewayToolErrorSchema$1()])))
12819
12871
  });
12820
12872
  var takoSearch$1 = (config = {}) => takoSearchToolFactory$1(config);
12821
12873
  var gatewayTools$1 = {
@@ -12834,6 +12886,16 @@ var gatewayTools$1 = {
12834
12886
  */
12835
12887
  browserbaseSearch: browserbaseSearch$1,
12836
12888
  /**
12889
+ * Fetch a page as Markdown through DeepSeek's standalone Fetch API.
12890
+ * Executed by AI Gateway for any model, separate from native model web search.
12891
+ */
12892
+ deepseekFetch: deepseekFetch$1,
12893
+ /**
12894
+ * Search the web through DeepSeek's standalone Search API.
12895
+ * Executed by AI Gateway for any model, separate from native model web search.
12896
+ */
12897
+ deepseekSearch: deepseekSearch$1,
12898
+ /**
12837
12899
  * Search the web using Exa for current information and token-efficient
12838
12900
  * excerpts optimized for agent workflows.
12839
12901
  *
@@ -12872,7 +12934,7 @@ async function getVercelRequestId$1() {
12872
12934
  var _a11;
12873
12935
  return (_a11 = getContext$1().headers) == null ? void 0 : _a11["x-vercel-id"];
12874
12936
  }
12875
- var VERSION$4 = "3.0.226";
12937
+ var VERSION$4 = "3.0.228";
12876
12938
  var AI_GATEWAY_PROTOCOL_VERSION$1 = "0.0.1";
12877
12939
  function createGatewayProvider(options = {}) {
12878
12940
  var _a11, _b11;
@@ -14048,11 +14110,11 @@ function getTotalTimeoutMs(timeout) {
14048
14110
  if (typeof timeout === "number") return timeout;
14049
14111
  return timeout.totalMs;
14050
14112
  }
14051
- var VERSION$3 = "6.0.320";
14113
+ var VERSION$3 = "6.0.322";
14052
14114
  var dataContentSchema = zod_v4.z.union([
14053
14115
  zod_v4.z.string(),
14054
- zod_v4.z.instanceof(Uint8Array),
14055
- zod_v4.z.instanceof(ArrayBuffer),
14116
+ zod_v4.z.custom(isUint8Array$1, { message: "Must be a Uint8Array" }),
14117
+ zod_v4.z.custom(isArrayBuffer$1, { message: "Must be an ArrayBuffer" }),
14056
14118
  zod_v4.z.custom((value) => {
14057
14119
  var _a23, _b;
14058
14120
  return (_b = (_a23 = globalThis.Buffer) == null ? void 0 : _a23.isBuffer(value)) != null ? _b : false;
@@ -15244,7 +15306,7 @@ createIdGenerator$1({
15244
15306
  prefix: "aiobj",
15245
15307
  size: 24
15246
15308
  });
15247
- // ../_vendored/ai_v7/dist/dist-VDS1iOhH.js
15309
+ // ../_vendored/ai_v7/dist/dist-CwN1TMYk.js
15248
15310
  /**
15249
15311
  * Symbol used for identifying AI SDK Error instances.
15250
15312
  * Enables checking if an error is an instance of AISDKError across package versions.
@@ -15843,7 +15905,9 @@ const { btoa: btoa$1, atob: atob$2 } = globalThis;
15843
15905
  function convertBase64ToUint8Array(base64String) {
15844
15906
  const base64Url = base64String.replace(/-/g, "+").replace(/_/g, "/");
15845
15907
  const latin1string = atob$2(base64Url);
15846
- return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
15908
+ const bytes = new Uint8Array(latin1string.length);
15909
+ for (let i = 0; i < latin1string.length; i++) bytes[i] = latin1string.charCodeAt(i);
15910
+ return bytes;
15847
15911
  }
15848
15912
  function convertUint8ArrayToBase64(array) {
15849
15913
  if (typeof globalThis.Buffer?.from === "function") return globalThis.Buffer.from(array.buffer, array.byteOffset, array.byteLength).toString("base64");
@@ -15852,6 +15916,20 @@ function convertUint8ArrayToBase64(array) {
15852
15916
  for (let i = 0; i < array.length; i += chunkSize) chunks.push(String.fromCodePoint(...array.subarray(i, i + chunkSize)));
15853
15917
  return btoa$1(chunks.join(""));
15854
15918
  }
15919
+ const typedArrayTag = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get;
15920
+ const arrayBufferByteLength = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
15921
+ function isUint8Array(value) {
15922
+ return ArrayBuffer.isView(value) && typedArrayTag.call(value) === "Uint8Array";
15923
+ }
15924
+ function isArrayBuffer(value) {
15925
+ if (typeof value !== "object" || value === null || !("byteLength" in value)) return false;
15926
+ try {
15927
+ arrayBufferByteLength.call(value);
15928
+ return true;
15929
+ } catch {
15930
+ return false;
15931
+ }
15932
+ }
15855
15933
  /**
15856
15934
  * Extracts the headers from a response object and returns them as a key-value object.
15857
15935
  *
@@ -15929,7 +16007,7 @@ function handleFetchError({ error, url, requestBodyValues }) {
15929
16007
  }
15930
16008
  return error;
15931
16009
  }
15932
- const VERSION$2 = "5.0.72";
16010
+ const VERSION$2 = "5.0.74";
15933
16011
  /**
15934
16012
  * Normalizes different header inputs into a plain record with lower-case keys.
15935
16013
  * Entries with `undefined` or `null` values are removed.
@@ -18420,7 +18498,7 @@ function isSegment(value) {
18420
18498
  function withoutTrailingSlash(url) {
18421
18499
  return url?.replace(/\/$/, "");
18422
18500
  }
18423
- // ../_vendored/ai_v7/dist/dist-BBvYSanG.js
18501
+ // ../_vendored/ai_v7/dist/dist-D6YcYEgU.js
18424
18502
  /**
18425
18503
  * Symbol used to define custom serialization for user-defined class instances.
18426
18504
  * The static method should accept an instance and return serializable data.
@@ -21125,6 +21203,54 @@ const browserbaseSearchToolFactory = createProviderExecutedToolFactory({
21125
21203
  })])))
21126
21204
  });
21127
21205
  const browserbaseSearch = (config = {}) => browserbaseSearchToolFactory(config);
21206
+ const gatewayToolErrorSchema = () => z$5.object({
21207
+ error: z$5.enum([
21208
+ "api_error",
21209
+ "configuration_error",
21210
+ "execution_error",
21211
+ "gateway_rate_limit",
21212
+ "invalid_input",
21213
+ "rate_limit",
21214
+ "timeout",
21215
+ "unknown",
21216
+ "unknown_tool"
21217
+ ]),
21218
+ message: z$5.string(),
21219
+ statusCode: z$5.number().optional(),
21220
+ retryAfter: z$5.string().optional(),
21221
+ statusText: z$5.string().optional()
21222
+ }).passthrough();
21223
+ const deepseekFetchToolFactory = createProviderExecutedToolFactory({
21224
+ id: "gateway.deepseek_fetch",
21225
+ inputSchema: lazySchema(() => zodSchema(z$5.object({ url: z$5.string().describe("URL to fetch, at most 8192 characters; HTTP(S) only, without a username or password.") }))),
21226
+ outputSchema: lazySchema(() => zodSchema(z$5.union([z$5.object({
21227
+ title: z$5.string().nullish(),
21228
+ content: z$5.string()
21229
+ }).passthrough(), gatewayToolErrorSchema()])))
21230
+ });
21231
+ const deepseekFetch = (config = {}) => deepseekFetchToolFactory(config);
21232
+ const deepseekSearchToolFactory = createProviderExecutedToolFactory({
21233
+ id: "gateway.deepseek_search",
21234
+ inputSchema: lazySchema(() => zodSchema(z$5.object({
21235
+ query: z$5.string().describe("Web search query, 1 to 128 Unicode characters. Supports site:, -site:, lang:, after:, before:, and quoted phrases."),
21236
+ count: z$5.number().int().optional().describe("Number of results, 1 to 50 (default: 10)."),
21237
+ need_content: z$5.boolean().optional().describe("Include available page content (default: false)."),
21238
+ ori_question: z$5.string().nullable().optional().describe("Original user question, 1 to 128 Unicode characters.")
21239
+ }))),
21240
+ outputSchema: lazySchema(() => zodSchema(z$5.union([z$5.object({ results: z$5.array(z$5.object({
21241
+ authority: z$5.number().nullish(),
21242
+ content: z$5.string().nullish(),
21243
+ date: z$5.string().nullish(),
21244
+ rerank_score: z$5.number().nullish(),
21245
+ site_icon: z$5.string().nullish(),
21246
+ site_name: z$5.string().nullish(),
21247
+ snippet: z$5.string().nullish(),
21248
+ summary: z$5.string().nullish(),
21249
+ title: z$5.string().nullish(),
21250
+ url: z$5.string().nullish()
21251
+ }).passthrough()) }).passthrough(), gatewayToolErrorSchema()])))
21252
+ });
21253
+ const deepseekSearch = (config = {}) => deepseekSearchToolFactory(config);
21128
21254
  const exaSearchToolFactory = createProviderExecutedToolFactory({
21129
21255
  id: "gateway.exa_search",
21130
21256
  inputSchema: lazySchema(() => zodSchema(z$5.object({
@@ -21281,21 +21407,7 @@ const parallelSearchToolFactory = createProviderExecutedToolFactory({
21281
21407
  count: z$5.number().optional()
21282
21408
  })).nullable().optional(),
21283
21409
  session_id: z$5.string().optional()
21284
- }), z$5.object({
21285
- error: z$5.enum([
21286
- "api_error",
21287
- "configuration_error",
21288
- "execution_error",
21289
- "gateway_rate_limit",
21290
- "invalid_input",
21291
- "rate_limit",
21292
- "timeout",
21293
- "unknown",
21294
- "unknown_tool"
21295
- ]),
21296
- statusCode: z$5.number().optional(),
21297
- message: z$5.string()
21298
- })])))
21410
+ }), gatewayToolErrorSchema()])))
21299
21411
  });
21300
21412
  const parallelSearch = (config = {}) => parallelSearchToolFactory(config);
21301
21413
  const perplexitySearchToolFactory = createProviderExecutedToolFactory({
@@ -21526,19 +21638,7 @@ const takoSearchToolFactory = createProviderExecutedToolFactory({
21526
21638
  }).nullish()
21527
21639
  }).nullish(),
21528
21640
  related: z$5.array(z$5.object({}).passthrough()).nullish()
21529
- }).passthrough(), z$5.object({
21530
- error: z$5.enum([
21531
- "api_error",
21532
- "configuration_error",
21533
- "execution_error",
21534
- "invalid_input",
21535
- "rate_limit",
21536
- "timeout",
21537
- "unknown_tool"
21538
- ]),
21539
- statusCode: z$5.number().optional(),
21540
- message: z$5.string()
21541
- })])))
21641
+ }).passthrough(), gatewayToolErrorSchema()])))
21542
21642
  });
21543
21643
  const takoSearch = (config = {}) => takoSearchToolFactory(config);
21544
21644
  /**
@@ -21560,6 +21660,16 @@ const gatewayTools = {
21560
21660
  */
21561
21661
  browserbaseSearch,
21562
21662
  /**
21663
+ * Fetch a page as Markdown through DeepSeek's standalone Fetch API.
21664
+ * Executed by AI Gateway for any model, separate from native model web search.
21665
+ */
21666
+ deepseekFetch,
21667
+ /**
21668
+ * Search the web through DeepSeek's standalone Search API.
21669
+ * Executed by AI Gateway for any model, separate from native model web search.
21670
+ */
21671
+ deepseekSearch,
21672
+ /**
21563
21673
  * Search the web using Exa for current information and token-efficient
21564
21674
  * excerpts optimized for agent workflows.
21565
21675
  *
@@ -21597,7 +21707,7 @@ const gatewayTools = {
21597
21707
  async function getVercelRequestId() {
21598
21708
  return getContext().headers?.["x-vercel-id"];
21599
21709
  }
21600
- const VERSION$1 = "4.0.132";
21710
+ const VERSION$1 = "4.0.135";
21601
21711
  const AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
21602
21712
  /** Response shape of `POST /v1/realtime/client-secrets`. `expiresAt` is epoch seconds. */
21603
21713
  const gatewayClientSecretResponseSchema = lazySchema(() => zodSchema(z$5.object({
@@ -22405,7 +22515,7 @@ function resolveEmbeddingModel(model) {
22405
22515
  function getGlobalProvider() {
22406
22516
  return asProviderV4(globalThis.AI_SDK_DEFAULT_PROVIDER ?? gateway);
22407
22517
  }
22408
- const VERSION = "7.0.159";
22518
+ const VERSION = "7.0.162";
22409
22519
  /**
22410
22520
  * Reads a property by an untrusted key, ignoring inherited prototype members.
22411
22521
  *
@@ -23275,8 +23385,8 @@ createIdGenerator({
23275
23385
  });
23276
23386
  const fileInlineDataSchema = z$4.union([
23277
23387
  z$4.string(),
23278
- z$4.instanceof(Uint8Array),
23279
- z$4.instanceof(ArrayBuffer),
23388
+ z$4.custom(isUint8Array, { message: "Must be a Uint8Array" }),
23389
+ z$4.custom(isArrayBuffer, { message: "Must be an ArrayBuffer" }),
23280
23390
  z$4.custom(isBuffer, { message: "Must be a Buffer" })
23281
23391
  ]);
23282
23392
  const providerReferenceSchema = z$4.record(z$4.string(), z$4.string());
@@ -23579,15 +23689,7 @@ createIdGenerator({
23579
23689
  size: 24
23580
23690
  });
23581
23691
  // src/processors/observational-memory/constants.ts
23582
- var constants_exports = /* @__PURE__ */ __exportAll({
23583
- OBSERVATIONAL_MEMORY_DEFAULTS: () => OBSERVATIONAL_MEMORY_DEFAULTS,
23584
- OBSERVATION_CONTEXT_INSTRUCTIONS: () => OBSERVATION_CONTEXT_INSTRUCTIONS,
23585
- OBSERVATION_CONTEXT_PROMPT: () => OBSERVATION_CONTEXT_PROMPT,
23586
- OBSERVATION_CONTEXT_PROMPT_THREAD: () => OBSERVATION_CONTEXT_PROMPT_THREAD,
23587
- OBSERVATION_CONTINUATION_HINT: () => OBSERVATION_CONTINUATION_HINT,
23588
- getObservationContextPrompt: () => getObservationContextPrompt,
23589
- getRetrievalInstructions: () => getRetrievalInstructions
23590
- });
23692
+ var constants_exports = /* @__PURE__ */ __exportAll({ OBSERVATION_CONTINUATION_HINT: () => OBSERVATION_CONTINUATION_HINT });
23591
23693
  /**
23592
23694
  * Default configuration values matching the spec
23593
23695
  */
@@ -39919,44 +40021,11 @@ function getObservationsAsOf(activeObservations, asOf) {
39919
40021
  }
39920
40022
  // src/processors/observational-memory/index.ts
39921
40023
  var observational_memory_exports = /* @__PURE__ */ __exportAll({
39922
- AUTO_MODEL_BY_PROVIDER: () => AUTO_MODEL_BY_PROVIDER,
39923
- Extractor: () => Extractor,
39924
- ModelByInputTokens: () => ModelByInputTokens,
39925
- OBSERVATIONAL_MEMORY_DEFAULTS: () => OBSERVATIONAL_MEMORY_DEFAULTS,
39926
- OBSERVATION_CONTEXT_INSTRUCTIONS: () => OBSERVATION_CONTEXT_INSTRUCTIONS,
39927
- OBSERVATION_CONTEXT_PROMPT: () => OBSERVATION_CONTEXT_PROMPT,
39928
- OBSERVATION_CONTEXT_PROMPT_THREAD: () => OBSERVATION_CONTEXT_PROMPT_THREAD,
39929
- OBSERVATION_CONTINUATION_HINT: () => OBSERVATION_CONTINUATION_HINT,
39930
- OBSERVER_SYSTEM_PROMPT: () => OBSERVER_SYSTEM_PROMPT,
39931
40024
  ObservationalMemory: () => ObservationalMemory,
39932
- ObservationalMemoryProcessor: () => ObservationalMemoryProcessor,
39933
- TokenCounter: () => TokenCounter,
39934
- WorkingMemoryExtractor: () => WorkingMemoryExtractor,
39935
- buildObserverPrompt: () => buildObserverPrompt,
39936
- buildObserverSystemPrompt: () => buildObserverSystemPrompt,
39937
- combineObservationGroupRanges: () => combineObservationGroupRanges,
39938
- deriveObservationGroupProvenance: () => deriveObservationGroupProvenance,
39939
- extractCurrentTask: () => extractCurrentTask,
39940
- formatMessagesForObserver: () => formatMessagesForObserver,
39941
- getObservationContextPrompt: () => getObservationContextPrompt,
39942
- getObservationsAsOf: () => getObservationsAsOf,
39943
- hasCurrentTaskSection: () => hasCurrentTaskSection,
39944
- injectAnchorIds: () => injectAnchorIds,
39945
- optimizeObservationsForContext: () => optimizeObservationsForContext,
39946
- parseAnchorId: () => parseAnchorId,
39947
- parseObservationGroups: () => parseObservationGroups,
39948
- parseObserverOutput: () => parseObserverOutput,
39949
- reconcileObservationGroupsFromReflection: () => reconcileObservationGroupsFromReflection,
39950
- renderObservationGroupsForReflection: () => renderObservationGroupsForReflection,
39951
- resolveAutoModelId: () => resolveAutoModelId,
39952
- stripEphemeralAnchorIds: () => stripEphemeralAnchorIds,
39953
- stripObservationGroups: () => stripObservationGroups,
39954
- summarizeConversation: () => summarizeConversation,
39955
- wrapInObservationGroup: () => wrapInObservationGroup
40025
+ ObservationalMemoryProcessor: () => ObservationalMemoryProcessor
39956
40026
  });
39957
40027
  // src/processors/working-memory-state/index.ts
39958
40028
  var working_memory_state_exports = /* @__PURE__ */ __exportAll({
39959
- WORKING_MEMORY_STATE_ID: () => WORKING_MEMORY_STATE_ID,
39960
40029
  WORKING_MEMORY_STATE_PROCESSOR_ID: () => WORKING_MEMORY_STATE_PROCESSOR_ID,
39961
40030
  WorkingMemoryStateProcessor: () => WorkingMemoryStateProcessor
39962
40031
  });
@@ -42823,4 +42892,4 @@ Object.defineProperty(exports, "wrapInObservationGroup", {
42823
42892
  }
42824
42893
  });
42825
42894
 
42826
- //# sourceMappingURL=src-gNoNdZv8.cjs.map
42895
+ //# sourceMappingURL=src-BbbBzTaj.cjs.map