@mastra/fastembed 1.3.5-alpha.0 → 1.3.5-alpha.2
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.
- package/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +65 -13
- package/dist/_types/@internal_ai-v6/dist/index.d.ts +110 -35
- package/dist/fastembed.d.ts.map +1 -1
- package/dist/index.cjs +63 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +62 -84
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { pipeline } from "stream/promises";
|
|
|
7
7
|
import { AddedToken, Tokenizer } from "@anush008/tokenizers";
|
|
8
8
|
import { downloadFile } from "@huggingface/hub";
|
|
9
9
|
import * as ort from "onnxruntime-node";
|
|
10
|
-
|
|
10
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/util.js
|
|
11
11
|
function getEnumValues(entries) {
|
|
12
12
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
13
13
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -559,8 +559,7 @@ function constantCatch(value) {
|
|
|
559
559
|
fn[CONSTANT_CATCH] = true;
|
|
560
560
|
return fn;
|
|
561
561
|
}
|
|
562
|
-
|
|
563
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/core.js
|
|
562
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/core.js
|
|
564
563
|
var _a$8;
|
|
565
564
|
const _zodDesc = {
|
|
566
565
|
value: void 0,
|
|
@@ -666,8 +665,7 @@ function config(newConfig) {
|
|
|
666
665
|
if (newConfig) Object.assign(globalConfig, newConfig);
|
|
667
666
|
return globalConfig;
|
|
668
667
|
}
|
|
669
|
-
|
|
670
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/errors.js
|
|
668
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/errors.js
|
|
671
669
|
function _getMessage() {
|
|
672
670
|
const internals = this._zod;
|
|
673
671
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -781,8 +779,7 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
781
779
|
processError(error);
|
|
782
780
|
return fieldErrors;
|
|
783
781
|
}
|
|
784
|
-
|
|
785
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/parse.js
|
|
782
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/parse.js
|
|
786
783
|
function finalizeParams(callee, params) {
|
|
787
784
|
return {
|
|
788
785
|
callee: params?.callee ?? callee,
|
|
@@ -984,8 +981,7 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
984
981
|
const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
985
982
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
986
983
|
};
|
|
987
|
-
|
|
988
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/regexes.js
|
|
984
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/regexes.js
|
|
989
985
|
/**
|
|
990
986
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
991
987
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -1057,8 +1053,7 @@ const boolean$1 = /^(?:true|false)$/i;
|
|
|
1057
1053
|
const _null$2 = /^null$/i;
|
|
1058
1054
|
const lowercase = /^[^A-Z]*$/;
|
|
1059
1055
|
const uppercase = /^[^a-z]*$/;
|
|
1060
|
-
|
|
1061
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/checks.js
|
|
1056
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/checks.js
|
|
1062
1057
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
1063
1058
|
var _a;
|
|
1064
1059
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1388,8 +1383,7 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
|
|
|
1388
1383
|
payload.value = def.tx(payload.value);
|
|
1389
1384
|
};
|
|
1390
1385
|
});
|
|
1391
|
-
|
|
1392
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/doc.js
|
|
1386
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/doc.js
|
|
1393
1387
|
var Doc = class {
|
|
1394
1388
|
constructor(args = [], closed = {}) {
|
|
1395
1389
|
this.content = [];
|
|
@@ -1422,15 +1416,13 @@ var Doc = class {
|
|
|
1422
1416
|
return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
|
|
1423
1417
|
}
|
|
1424
1418
|
};
|
|
1425
|
-
|
|
1426
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/versions.js
|
|
1419
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/versions.js
|
|
1427
1420
|
const version = {
|
|
1428
1421
|
major: 4,
|
|
1429
1422
|
minor: 6,
|
|
1430
1423
|
patch: 7
|
|
1431
1424
|
};
|
|
1432
|
-
|
|
1433
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/schemas.js
|
|
1425
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/schemas.js
|
|
1434
1426
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1435
1427
|
var _a;
|
|
1436
1428
|
inst ?? (inst = {});
|
|
@@ -2915,8 +2907,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
2915
2907
|
payload.issues.push(issue(_iss));
|
|
2916
2908
|
}
|
|
2917
2909
|
}
|
|
2918
|
-
|
|
2919
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/memoizer.js
|
|
2910
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/memoizer.js
|
|
2920
2911
|
var $ZodCyclicError = class extends Error {
|
|
2921
2912
|
constructor() {
|
|
2922
2913
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3168,8 +3159,7 @@ function isBackEdge(ctx, value) {
|
|
|
3168
3159
|
const backEdges = ctx[STATE]?.backEdges;
|
|
3169
3160
|
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
3170
3161
|
}
|
|
3171
|
-
|
|
3172
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/locales/en.js
|
|
3162
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/locales/en.js
|
|
3173
3163
|
const error = () => {
|
|
3174
3164
|
const Sizable = {
|
|
3175
3165
|
string: {
|
|
@@ -3276,8 +3266,7 @@ const error = () => {
|
|
|
3276
3266
|
function en_default() {
|
|
3277
3267
|
return { localeError: error() };
|
|
3278
3268
|
}
|
|
3279
|
-
|
|
3280
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/registries.js
|
|
3269
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/registries.js
|
|
3281
3270
|
var _a$6;
|
|
3282
3271
|
var $ZodRegistry = class {
|
|
3283
3272
|
constructor() {
|
|
@@ -3323,8 +3312,7 @@ function registry() {
|
|
|
3323
3312
|
}
|
|
3324
3313
|
(_a$6 = globalThis).__zod_globalRegistry ?? (_a$6.__zod_globalRegistry = registry());
|
|
3325
3314
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
3326
|
-
|
|
3327
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/api.js
|
|
3315
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/api.js
|
|
3328
3316
|
function snapshotChecks(def) {
|
|
3329
3317
|
if (def.checks) def.checks = [...def.checks];
|
|
3330
3318
|
return def;
|
|
@@ -3858,8 +3846,7 @@ function _check(fn, params) {
|
|
|
3858
3846
|
ch._zod.check = fn;
|
|
3859
3847
|
return ch;
|
|
3860
3848
|
}
|
|
3861
|
-
|
|
3862
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/to-json-schema.js
|
|
3849
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/to-json-schema.js
|
|
3863
3850
|
function assignProps(target, ...sources) {
|
|
3864
3851
|
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
3865
3852
|
return target;
|
|
@@ -4302,8 +4289,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
4302
4289
|
extractDefs(ctx, schema);
|
|
4303
4290
|
return finalize(ctx, schema);
|
|
4304
4291
|
};
|
|
4305
|
-
|
|
4306
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/json-schema-processors.js
|
|
4292
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/json-schema-processors.js
|
|
4307
4293
|
const narrowMin = (agg, key, value) => {
|
|
4308
4294
|
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
4309
4295
|
};
|
|
@@ -4948,8 +4934,7 @@ function toJSONSchema(input, params) {
|
|
|
4948
4934
|
extractDefs(ctx, input);
|
|
4949
4935
|
return finalize(ctx, input);
|
|
4950
4936
|
}
|
|
4951
|
-
|
|
4952
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/errors.js
|
|
4937
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/errors.js
|
|
4953
4938
|
const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
4954
4939
|
function _lazyMethod(proto, key, make) {
|
|
4955
4940
|
Object.defineProperty(proto, key, {
|
|
@@ -4998,8 +4983,7 @@ const initializer = (inst, issues) => {
|
|
|
4998
4983
|
});
|
|
4999
4984
|
};
|
|
5000
4985
|
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
5001
|
-
|
|
5002
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/parse.js
|
|
4986
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/parse.js
|
|
5003
4987
|
const parse = /* @__PURE__ */ _parse$2(ZodRealError);
|
|
5004
4988
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5005
4989
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -5012,8 +4996,7 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
|
|
|
5012
4996
|
const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
5013
4997
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5014
4998
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5015
|
-
|
|
5016
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/schemas.js
|
|
4999
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/schemas.js
|
|
5017
5000
|
function _ensureDefaultLocale() {
|
|
5018
5001
|
if (!globalConfig.localeError) config(en_default());
|
|
5019
5002
|
}
|
|
@@ -5942,8 +5925,7 @@ function _instanceof(cls, params = {}) {
|
|
|
5942
5925
|
};
|
|
5943
5926
|
return inst;
|
|
5944
5927
|
}
|
|
5945
|
-
|
|
5946
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/helpers/util.js
|
|
5928
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/helpers/util.js
|
|
5947
5929
|
var util;
|
|
5948
5930
|
(function(util) {
|
|
5949
5931
|
util.assertEqual = (_) => {};
|
|
@@ -6038,8 +6020,7 @@ const getParsedType = (data) => {
|
|
|
6038
6020
|
default: return ZodParsedType.unknown;
|
|
6039
6021
|
}
|
|
6040
6022
|
};
|
|
6041
|
-
|
|
6042
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/ZodError.js
|
|
6023
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/ZodError.js
|
|
6043
6024
|
const ZodIssueCode = util.arrayToEnum([
|
|
6044
6025
|
"invalid_type",
|
|
6045
6026
|
"invalid_literal",
|
|
@@ -6148,8 +6129,7 @@ var ZodError = class ZodError extends Error {
|
|
|
6148
6129
|
ZodError.create = (issues) => {
|
|
6149
6130
|
return new ZodError(issues);
|
|
6150
6131
|
};
|
|
6151
|
-
|
|
6152
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/locales/en.js
|
|
6132
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/locales/en.js
|
|
6153
6133
|
const errorMap = (issue, _ctx) => {
|
|
6154
6134
|
let message;
|
|
6155
6135
|
switch (issue.code) {
|
|
@@ -6226,14 +6206,12 @@ const errorMap = (issue, _ctx) => {
|
|
|
6226
6206
|
}
|
|
6227
6207
|
return { message };
|
|
6228
6208
|
};
|
|
6229
|
-
|
|
6230
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/errors.js
|
|
6209
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/errors.js
|
|
6231
6210
|
let overrideErrorMap = errorMap;
|
|
6232
6211
|
function getErrorMap() {
|
|
6233
6212
|
return overrideErrorMap;
|
|
6234
6213
|
}
|
|
6235
|
-
|
|
6236
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/helpers/parseUtil.js
|
|
6214
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/helpers/parseUtil.js
|
|
6237
6215
|
const makeIssue = (params) => {
|
|
6238
6216
|
const { data, path, errorMaps, issueData } = params;
|
|
6239
6217
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -6336,15 +6314,13 @@ const isAborted = (x) => x.status === "aborted";
|
|
|
6336
6314
|
const isDirty = (x) => x.status === "dirty";
|
|
6337
6315
|
const isValid = (x) => x.status === "valid";
|
|
6338
6316
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
6339
|
-
|
|
6340
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/helpers/errorUtil.js
|
|
6317
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/helpers/errorUtil.js
|
|
6341
6318
|
var errorUtil;
|
|
6342
6319
|
(function(errorUtil) {
|
|
6343
6320
|
errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
6344
6321
|
errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
6345
6322
|
})(errorUtil || (errorUtil = {}));
|
|
6346
|
-
|
|
6347
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/types.js
|
|
6323
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v3/types.js
|
|
6348
6324
|
var ParseInputLazyPath = class {
|
|
6349
6325
|
constructor(parent, value, path, key) {
|
|
6350
6326
|
this._cachedPath = [];
|
|
@@ -9504,8 +9480,7 @@ ZodOptional.create;
|
|
|
9504
9480
|
ZodNullable.create;
|
|
9505
9481
|
ZodEffects.createWithPreprocess;
|
|
9506
9482
|
ZodPipeline.create;
|
|
9507
|
-
|
|
9508
|
-
//#region ../_vendored/ai_v5/dist/dist-OCi48HWi.js
|
|
9483
|
+
// ../_vendored/ai_v5/dist/dist-DRvrQv6K.js
|
|
9509
9484
|
var marker$1$6 = "vercel.ai.error";
|
|
9510
9485
|
var symbol$1$6 = Symbol.for(marker$1$6);
|
|
9511
9486
|
var _a$1$6;
|
|
@@ -10723,8 +10698,7 @@ function asSchema$2(schema) {
|
|
|
10723
10698
|
}) : isSchema$2(schema) ? schema : typeof schema === "function" ? schema() : zodSchema$2(schema);
|
|
10724
10699
|
}
|
|
10725
10700
|
var { btoa: btoa$3, atob: atob$5 } = globalThis;
|
|
10726
|
-
|
|
10727
|
-
//#region ../_vendored/ai_v5/dist/index.js
|
|
10701
|
+
// ../_vendored/ai_v5/dist/index.js
|
|
10728
10702
|
/** only globals that common to node and browsers are allowed */
|
|
10729
10703
|
var _globalThis$1 = typeof globalThis === "object" ? globalThis : global;
|
|
10730
10704
|
var VERSION$1$3 = "1.9.0";
|
|
@@ -11512,40 +11486,40 @@ var API_NAME$5 = "trace";
|
|
|
11512
11486
|
})().getInstance();
|
|
11513
11487
|
var __defProp$3 = Object.defineProperty;
|
|
11514
11488
|
var __export$2 = (target, all) => {
|
|
11515
|
-
for (var
|
|
11516
|
-
get: all[
|
|
11489
|
+
for (var name17 in all) __defProp$3(target, name17, {
|
|
11490
|
+
get: all[name17],
|
|
11517
11491
|
enumerable: true
|
|
11518
11492
|
});
|
|
11519
11493
|
};
|
|
11520
|
-
var
|
|
11521
|
-
var
|
|
11522
|
-
var
|
|
11523
|
-
var
|
|
11494
|
+
var name7$4 = "AI_NoObjectGeneratedError";
|
|
11495
|
+
var marker7$4 = `vercel.ai.error.${name7$4}`;
|
|
11496
|
+
var symbol7$4 = Symbol.for(marker7$4);
|
|
11497
|
+
var _a7$4;
|
|
11524
11498
|
var NoObjectGeneratedError$2 = class extends AISDKError$2 {
|
|
11525
11499
|
constructor({ message = "No object generated.", cause, text: text2, response, usage, finishReason }) {
|
|
11526
11500
|
super({
|
|
11527
|
-
name:
|
|
11501
|
+
name: name7$4,
|
|
11528
11502
|
message,
|
|
11529
11503
|
cause
|
|
11530
11504
|
});
|
|
11531
|
-
this[
|
|
11505
|
+
this[_a7$4] = true;
|
|
11532
11506
|
this.text = text2;
|
|
11533
11507
|
this.response = response;
|
|
11534
11508
|
this.usage = usage;
|
|
11535
11509
|
this.finishReason = finishReason;
|
|
11536
11510
|
}
|
|
11537
11511
|
static isInstance(error) {
|
|
11538
|
-
return AISDKError$2.hasMarker(error,
|
|
11512
|
+
return AISDKError$2.hasMarker(error, marker7$4);
|
|
11539
11513
|
}
|
|
11540
11514
|
};
|
|
11541
|
-
|
|
11515
|
+
_a7$4 = symbol7$4;
|
|
11542
11516
|
var dataContentSchema$2 = union([
|
|
11543
11517
|
string(),
|
|
11544
11518
|
_instanceof(Uint8Array),
|
|
11545
11519
|
_instanceof(ArrayBuffer),
|
|
11546
11520
|
custom((value) => {
|
|
11547
|
-
var
|
|
11548
|
-
return (_b = (
|
|
11521
|
+
var _a17, _b;
|
|
11522
|
+
return (_b = (_a17 = globalThis.Buffer) == null ? void 0 : _a17.isBuffer(value)) != null ? _b : false;
|
|
11549
11523
|
}, { message: "Must be a Buffer" })
|
|
11550
11524
|
]);
|
|
11551
11525
|
var jsonValueSchema$2 = lazy(() => union([
|
|
@@ -12035,8 +12009,7 @@ function customProvider$2({ languageModels, textEmbeddingModels, imageModels, tr
|
|
|
12035
12009
|
}
|
|
12036
12010
|
};
|
|
12037
12011
|
}
|
|
12038
|
-
|
|
12039
|
-
//#region ../_vendored/ai_v4/dist/dist-Cm5DZgxA.js
|
|
12012
|
+
// ../_vendored/ai_v4/dist/dist-DlRWVOEI.js
|
|
12040
12013
|
var marker$4 = "vercel.ai.error";
|
|
12041
12014
|
var symbol$4 = Symbol.for(marker$4);
|
|
12042
12015
|
var _a$4;
|
|
@@ -12171,8 +12144,7 @@ Error message: ${getErrorMessage(cause)}`,
|
|
|
12171
12144
|
};
|
|
12172
12145
|
_a13$3 = symbol13$3;
|
|
12173
12146
|
var TypeValidationError$1 = _TypeValidationError;
|
|
12174
|
-
|
|
12175
|
-
//#region ../_vendored/ai_v4/dist/index.js
|
|
12147
|
+
// ../_vendored/ai_v4/dist/index.js
|
|
12176
12148
|
var __create = Object.create;
|
|
12177
12149
|
var __defProp$1 = Object.defineProperty;
|
|
12178
12150
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -15303,8 +15275,7 @@ function trimStartOfStream() {
|
|
|
15303
15275
|
return text2;
|
|
15304
15276
|
};
|
|
15305
15277
|
}
|
|
15306
|
-
|
|
15307
|
-
//#region ../_vendored/ai_v6/dist/dist-B3lfSiDN.js
|
|
15278
|
+
// ../_vendored/ai_v6/dist/dist-Dl1sIpsh.js
|
|
15308
15279
|
var marker$1 = "vercel.ai.error";
|
|
15309
15280
|
var symbol$1 = Symbol.for(marker$1);
|
|
15310
15281
|
var _a$1;
|
|
@@ -16541,8 +16512,7 @@ async function resolve(value) {
|
|
|
16541
16512
|
return value;
|
|
16542
16513
|
}
|
|
16543
16514
|
new TextDecoder();
|
|
16544
|
-
|
|
16545
|
-
//#region ../_vendored/ai_v6/dist/index.js
|
|
16515
|
+
// ../_vendored/ai_v6/dist/index.js
|
|
16546
16516
|
const VERSION$1 = "1.9.1";
|
|
16547
16517
|
const re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
16548
16518
|
/**
|
|
@@ -18311,8 +18281,7 @@ function customProvider({ languageModels, embeddingModels, imageModels, transcri
|
|
|
18311
18281
|
}
|
|
18312
18282
|
};
|
|
18313
18283
|
}
|
|
18314
|
-
|
|
18315
|
-
//#region src/fastembed.ts
|
|
18284
|
+
// src/fastembed.ts
|
|
18316
18285
|
/**
|
|
18317
18286
|
* Forked from fastembed-js (https://github.com/Anush008/fastembed-js)
|
|
18318
18287
|
* Original author: Anush008 <anushshetty90@gmail.com>
|
|
@@ -18416,7 +18385,7 @@ function loadTokenizerFromDir(modelDir, maxLength) {
|
|
|
18416
18385
|
const tokenizerFilePath = path.join(modelDir.toString(), "tokenizer_config.json");
|
|
18417
18386
|
if (!fs.existsSync(tokenizerFilePath)) throw new Error(`Tokenizer config file not found at ${tokenizerFilePath}`);
|
|
18418
18387
|
const tokenizerConfig = JSON.parse(fs.readFileSync(tokenizerFilePath, "utf-8"));
|
|
18419
|
-
maxLength = Math.min(maxLength, tokenizerConfig["model_max_length"]);
|
|
18388
|
+
maxLength = Math.min(maxLength, tokenizerConfig["model_max_length"] ?? maxLength);
|
|
18420
18389
|
const tokensMapPath = path.join(modelDir.toString(), "special_tokens_map.json");
|
|
18421
18390
|
if (!fs.existsSync(tokensMapPath)) throw new Error(`Tokens map file not found at ${tokensMapPath}`);
|
|
18422
18391
|
const tokensMap = JSON.parse(fs.readFileSync(tokensMapPath, "utf-8"));
|
|
@@ -18442,6 +18411,13 @@ function loadTokenizerFromDir(modelDir, maxLength) {
|
|
|
18442
18411
|
function assertValidBatchSize(batchSize) {
|
|
18443
18412
|
if (!Number.isSafeInteger(batchSize) || batchSize <= 0) throw new RangeError(`batchSize must be a positive safe integer, received ${String(batchSize)}`);
|
|
18444
18413
|
}
|
|
18414
|
+
function assertValidMaxLength(maxLength) {
|
|
18415
|
+
if (!Number.isSafeInteger(maxLength) || maxLength <= 0) throw new RangeError(`maxLength must be a positive safe integer, received ${String(maxLength)}`);
|
|
18416
|
+
}
|
|
18417
|
+
function getOutputDimensions(outputName, tensor) {
|
|
18418
|
+
if (tensor.dims.length !== 3) throw new Error(`Expected model output "${outputName}" to have 3 dimensions, received [${tensor.dims.join(", ")}]`);
|
|
18419
|
+
return tensor.dims;
|
|
18420
|
+
}
|
|
18445
18421
|
var FlagEmbedding = class FlagEmbedding extends Embedding {
|
|
18446
18422
|
constructor(tokenizer, session, model) {
|
|
18447
18423
|
super();
|
|
@@ -18450,6 +18426,7 @@ var FlagEmbedding = class FlagEmbedding extends Embedding {
|
|
|
18450
18426
|
this.model = model;
|
|
18451
18427
|
}
|
|
18452
18428
|
static async init({ model = "fast-bge-small-en-v1.5", executionProviders = ["cpu"], maxLength = 512, cacheDir = "local_cache", showDownloadProgress = true, modelAbsoluteDirPath = "", modelName = "" } = {}) {
|
|
18429
|
+
assertValidMaxLength(maxLength);
|
|
18453
18430
|
if (model === "custom") {
|
|
18454
18431
|
if (!modelAbsoluteDirPath) throw new Error("For custom model, modelAbsoluteDirPath is required in FlagEmbedding.init");
|
|
18455
18432
|
if (!modelName) throw new Error("For custom model, modelName is required in FlagEmbedding.init");
|
|
@@ -18551,7 +18528,7 @@ var FlagEmbedding = class FlagEmbedding extends Embedding {
|
|
|
18551
18528
|
};
|
|
18552
18529
|
if (this.model === "fast-multilingual-e5-large") delete inputs.token_type_ids;
|
|
18553
18530
|
const lastHiddenState = (await this.session.run(inputs)).last_hidden_state;
|
|
18554
|
-
yield getEmbeddings(lastHiddenState.data, lastHiddenState
|
|
18531
|
+
yield getEmbeddings(lastHiddenState.data, getOutputDimensions("last_hidden_state", lastHiddenState), this.model === "fast-all-MiniLM-L6-v2" || this.model === "fast-multilingual-e5-large" ? maskArray : void 0).map(normalize);
|
|
18555
18532
|
}
|
|
18556
18533
|
}
|
|
18557
18534
|
passageEmbed(texts, batchSize = 256) {
|
|
@@ -18608,6 +18585,7 @@ var SparseTextEmbedding = class SparseTextEmbedding extends SparseEmbedding {
|
|
|
18608
18585
|
this.session = session;
|
|
18609
18586
|
}
|
|
18610
18587
|
static async init({ model = "prithivida/Splade_PP_en_v1", executionProviders = ["cpu"], maxLength = 512, cacheDir = "local_cache", showDownloadProgress = true, modelAbsoluteDirPath = "", modelName = "" } = {}) {
|
|
18588
|
+
assertValidMaxLength(maxLength);
|
|
18611
18589
|
if (model === "custom") {
|
|
18612
18590
|
if (!modelAbsoluteDirPath) throw new Error("For custom model, modelAbsoluteDirPath is required in SparseTextEmbedding.init");
|
|
18613
18591
|
if (!modelName) throw new Error("For custom model, modelName is required in SparseTextEmbedding.init");
|
|
@@ -18626,7 +18604,10 @@ var SparseTextEmbedding = class SparseTextEmbedding extends SparseEmbedding {
|
|
|
18626
18604
|
return { tokenizer: loadTokenizerFromDir(modelDir, maxLength) };
|
|
18627
18605
|
}
|
|
18628
18606
|
static async retrieveModel(model, cacheDir, _showDownloadProgress = true) {
|
|
18629
|
-
if (!fs.existsSync(cacheDir)) fs.mkdirSync(cacheDir, {
|
|
18607
|
+
if (!fs.existsSync(cacheDir)) fs.mkdirSync(cacheDir, {
|
|
18608
|
+
recursive: true,
|
|
18609
|
+
mode: 493
|
|
18610
|
+
});
|
|
18630
18611
|
const modelDir = path.join(cacheDir.toString(), model.replace("/", "_"));
|
|
18631
18612
|
if (fs.existsSync(modelDir)) return modelDir;
|
|
18632
18613
|
const filesToDownload = [
|
|
@@ -18690,7 +18671,7 @@ var SparseTextEmbedding = class SparseTextEmbedding extends SparseEmbedding {
|
|
|
18690
18671
|
};
|
|
18691
18672
|
const outputTensor = (await this.session.run(inputs)).output;
|
|
18692
18673
|
const logits = outputTensor.cpuData;
|
|
18693
|
-
const [currentBatchSize, seqLen, currentVocabSize] = outputTensor
|
|
18674
|
+
const [currentBatchSize, seqLen, currentVocabSize] = getOutputDimensions("output", outputTensor);
|
|
18694
18675
|
const sparseVectors = [];
|
|
18695
18676
|
for (let batchIdx = 0; batchIdx < currentBatchSize; batchIdx++) {
|
|
18696
18677
|
const valuesArr = new Float32Array(currentVocabSize).fill(0);
|
|
@@ -18726,8 +18707,7 @@ var SparseTextEmbedding = class SparseTextEmbedding extends SparseEmbedding {
|
|
|
18726
18707
|
}];
|
|
18727
18708
|
}
|
|
18728
18709
|
};
|
|
18729
|
-
|
|
18730
|
-
//#region src/model-cache.ts
|
|
18710
|
+
// src/model-cache.ts
|
|
18731
18711
|
async function getModelCachePath() {
|
|
18732
18712
|
const cachePath = path.join(os.homedir(), ".cache", "mastra", "fastembed-models");
|
|
18733
18713
|
await fsp.mkdir(cachePath, { recursive: true });
|
|
@@ -18753,8 +18733,7 @@ async function warmupFastEmbedModels() {
|
|
|
18753
18733
|
await FlagEmbedding.retrieveModel("fast-bge-small-en-v1.5", cacheDir, false);
|
|
18754
18734
|
await FlagEmbedding.retrieveModel("fast-bge-base-en-v1.5", cacheDir, false);
|
|
18755
18735
|
}
|
|
18756
|
-
|
|
18757
|
-
//#region src/index.ts
|
|
18736
|
+
// src/index.ts
|
|
18758
18737
|
/**
|
|
18759
18738
|
* Pre-download fastembed models without creating ONNX sessions.
|
|
18760
18739
|
* Call this before running tests in parallel to avoid concurrent download races.
|
|
@@ -18882,7 +18861,6 @@ const fastembed = Object.assign(fastEmbedProviderV3.embeddingModel(`bge-small-en
|
|
|
18882
18861
|
smallLegacy: fastEmbedLegacyProvider.textEmbeddingModel(`bge-small-en-v1.5`),
|
|
18883
18862
|
baseLegacy: fastEmbedLegacyProvider.textEmbeddingModel(`bge-base-en-v1.5`)
|
|
18884
18863
|
});
|
|
18885
|
-
//#endregion
|
|
18886
18864
|
export { EmbeddingModel, ExecutionProvider, FlagEmbedding, SparseEmbeddingModel, SparseTextEmbedding, fastembed, warmup };
|
|
18887
18865
|
|
|
18888
18866
|
//# sourceMappingURL=index.js.map
|