gityo 1.0.9 → 1.0.10
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/index.js +796 -791
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,25 +37,25 @@ var InvalidArgumentError$9 = class extends CommanderError {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
var Argument = class {
|
|
40
|
-
constructor(name$
|
|
40
|
+
constructor(name$16, description) {
|
|
41
41
|
this.description = description || "";
|
|
42
42
|
this.variadic = false;
|
|
43
43
|
this.parseArg = void 0;
|
|
44
44
|
this.defaultValue = void 0;
|
|
45
45
|
this.defaultValueDescription = void 0;
|
|
46
46
|
this.argChoices = void 0;
|
|
47
|
-
switch (name$
|
|
47
|
+
switch (name$16[0]) {
|
|
48
48
|
case "<":
|
|
49
49
|
this.required = true;
|
|
50
|
-
this._name = name$
|
|
50
|
+
this._name = name$16.slice(1, -1);
|
|
51
51
|
break;
|
|
52
52
|
case "[":
|
|
53
53
|
this.required = false;
|
|
54
|
-
this._name = name$
|
|
54
|
+
this._name = name$16.slice(1, -1);
|
|
55
55
|
break;
|
|
56
56
|
default:
|
|
57
57
|
this.required = true;
|
|
58
|
-
this._name = name$
|
|
58
|
+
this._name = name$16;
|
|
59
59
|
break;
|
|
60
60
|
}
|
|
61
61
|
if (this._name.endsWith("...")) {
|
|
@@ -426,8 +426,8 @@ var Option = class {
|
|
|
426
426
|
this.implied = Object.assign(this.implied || {}, newImplied);
|
|
427
427
|
return this;
|
|
428
428
|
}
|
|
429
|
-
env(name$
|
|
430
|
-
this.envVar = name$
|
|
429
|
+
env(name$16) {
|
|
430
|
+
this.envVar = name$16;
|
|
431
431
|
return this;
|
|
432
432
|
}
|
|
433
433
|
argParser(fn$1) {
|
|
@@ -578,7 +578,7 @@ function suggestSimilar(word, candidates) {
|
|
|
578
578
|
return "";
|
|
579
579
|
}
|
|
580
580
|
var Command = class Command extends EventEmitter {
|
|
581
|
-
constructor(name$
|
|
581
|
+
constructor(name$16) {
|
|
582
582
|
super();
|
|
583
583
|
this.commands = [];
|
|
584
584
|
this.options = [];
|
|
@@ -591,7 +591,7 @@ var Command = class Command extends EventEmitter {
|
|
|
591
591
|
this.rawArgs = [];
|
|
592
592
|
this.processedArgs = [];
|
|
593
593
|
this._scriptPath = null;
|
|
594
|
-
this._name = name$
|
|
594
|
+
this._name = name$16 || "";
|
|
595
595
|
this._optionValues = {};
|
|
596
596
|
this._optionValueSources = {};
|
|
597
597
|
this._storeOptionsAsProperties = false;
|
|
@@ -658,8 +658,8 @@ var Command = class Command extends EventEmitter {
|
|
|
658
658
|
desc = null;
|
|
659
659
|
}
|
|
660
660
|
opts = opts || {};
|
|
661
|
-
const [, name$
|
|
662
|
-
const cmd = this.createCommand(name$
|
|
661
|
+
const [, name$16, args] = nameAndArgs.match(/([^ ]+) *(.*)/);
|
|
662
|
+
const cmd = this.createCommand(name$16);
|
|
663
663
|
if (desc) {
|
|
664
664
|
cmd.description(desc);
|
|
665
665
|
cmd._executableHandler = true;
|
|
@@ -674,8 +674,8 @@ var Command = class Command extends EventEmitter {
|
|
|
674
674
|
if (desc) return this;
|
|
675
675
|
return cmd;
|
|
676
676
|
}
|
|
677
|
-
createCommand(name$
|
|
678
|
-
return new Command(name$
|
|
677
|
+
createCommand(name$16) {
|
|
678
|
+
return new Command(name$16);
|
|
679
679
|
}
|
|
680
680
|
createHelp() {
|
|
681
681
|
return Object.assign(new Help(), this.configureHelp());
|
|
@@ -713,11 +713,11 @@ var Command = class Command extends EventEmitter {
|
|
|
713
713
|
cmd._checkForBrokenPassThrough();
|
|
714
714
|
return this;
|
|
715
715
|
}
|
|
716
|
-
createArgument(name$
|
|
717
|
-
return new Argument(name$
|
|
716
|
+
createArgument(name$16, description) {
|
|
717
|
+
return new Argument(name$16, description);
|
|
718
718
|
}
|
|
719
|
-
argument(name$
|
|
720
|
-
const argument = this.createArgument(name$
|
|
719
|
+
argument(name$16, description, parseArg, defaultValue) {
|
|
720
|
+
const argument = this.createArgument(name$16, description);
|
|
721
721
|
if (typeof parseArg === "function") argument.default(defaultValue).argParser(parseArg);
|
|
722
722
|
else argument.default(parseArg);
|
|
723
723
|
this.addArgument(argument);
|
|
@@ -836,7 +836,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
836
836
|
const knownBy = (cmd) => {
|
|
837
837
|
return [cmd.name()].concat(cmd.aliases());
|
|
838
838
|
};
|
|
839
|
-
const alreadyUsed = knownBy(command).find((name$
|
|
839
|
+
const alreadyUsed = knownBy(command).find((name$16) => this._findCommand(name$16));
|
|
840
840
|
if (alreadyUsed) {
|
|
841
841
|
const existingCmd = knownBy(this._findCommand(alreadyUsed)).join("|");
|
|
842
842
|
const newCmd = knownBy(command).join("|");
|
|
@@ -848,17 +848,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
848
848
|
addOption(option) {
|
|
849
849
|
this._registerOption(option);
|
|
850
850
|
const oname = option.name();
|
|
851
|
-
const name$
|
|
852
|
-
if (option.defaultValue !== void 0) this.setOptionValueWithSource(name$
|
|
851
|
+
const name$16 = option.attributeName();
|
|
852
|
+
if (option.defaultValue !== void 0) this.setOptionValueWithSource(name$16, option.defaultValue, "default");
|
|
853
853
|
const handleOptionValue = (val, invalidValueMessage, valueSource) => {
|
|
854
854
|
if (val == null && option.presetArg !== void 0) val = option.presetArg;
|
|
855
|
-
const oldValue = this.getOptionValue(name$
|
|
855
|
+
const oldValue = this.getOptionValue(name$16);
|
|
856
856
|
if (val !== null && option.parseArg) val = this._callParseArg(option, val, oldValue, invalidValueMessage);
|
|
857
857
|
else if (val !== null && option.variadic) val = option._collectValue(val, oldValue);
|
|
858
858
|
if (val == null) if (option.negate) val = false;
|
|
859
859
|
else if (option.isBoolean() || option.optional) val = true;
|
|
860
860
|
else val = "";
|
|
861
|
-
this.setOptionValueWithSource(name$
|
|
861
|
+
this.setOptionValueWithSource(name$16, val, valueSource);
|
|
862
862
|
};
|
|
863
863
|
this.on("option:" + oname, (val) => {
|
|
864
864
|
handleOptionValue(val, `error: option '${option.flags}' argument '${val}' is invalid.`, "cli");
|
|
@@ -1241,9 +1241,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1241
1241
|
this._processArguments();
|
|
1242
1242
|
}
|
|
1243
1243
|
}
|
|
1244
|
-
_findCommand(name$
|
|
1245
|
-
if (!name$
|
|
1246
|
-
return this.commands.find((cmd) => cmd._name === name$
|
|
1244
|
+
_findCommand(name$16) {
|
|
1245
|
+
if (!name$16) return void 0;
|
|
1246
|
+
return this.commands.find((cmd) => cmd._name === name$16 || cmd._aliases.includes(name$16));
|
|
1247
1247
|
}
|
|
1248
1248
|
_findOption(arg) {
|
|
1249
1249
|
return this.options.find((option) => option.is(arg));
|
|
@@ -1409,8 +1409,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1409
1409
|
});
|
|
1410
1410
|
});
|
|
1411
1411
|
}
|
|
1412
|
-
missingArgument(name$
|
|
1413
|
-
const message = `error: missing required argument '${name$
|
|
1412
|
+
missingArgument(name$16) {
|
|
1413
|
+
const message = `error: missing required argument '${name$16}'`;
|
|
1414
1414
|
this.error(message, { code: "commander.missingArgument" });
|
|
1415
1415
|
}
|
|
1416
1416
|
optionMissingArgument(option) {
|
|
@@ -1710,8 +1710,9 @@ function useColor() {
|
|
|
1710
1710
|
if (process$1.env.FORCE_COLOR || process$1.env.CLICOLOR_FORCE !== void 0) return true;
|
|
1711
1711
|
}
|
|
1712
1712
|
new Command();
|
|
1713
|
+
var version$4 = "1.0.10";
|
|
1713
1714
|
Object.freeze({ status: "aborted" });
|
|
1714
|
-
function $constructor$3(name$
|
|
1715
|
+
function $constructor$3(name$16, initializer$6, params) {
|
|
1715
1716
|
function init$1(inst, def) {
|
|
1716
1717
|
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
1717
1718
|
value: {
|
|
@@ -1721,8 +1722,8 @@ function $constructor$3(name$15, initializer$6, params) {
|
|
|
1721
1722
|
},
|
|
1722
1723
|
enumerable: false
|
|
1723
1724
|
});
|
|
1724
|
-
if (inst._zod.traits.has(name$
|
|
1725
|
-
inst._zod.traits.add(name$
|
|
1725
|
+
if (inst._zod.traits.has(name$16)) return;
|
|
1726
|
+
inst._zod.traits.add(name$16);
|
|
1726
1727
|
initializer$6(inst, def);
|
|
1727
1728
|
const proto$1 = _$1.prototype;
|
|
1728
1729
|
const keys = Object.keys(proto$1);
|
|
@@ -1733,7 +1734,7 @@ function $constructor$3(name$15, initializer$6, params) {
|
|
|
1733
1734
|
}
|
|
1734
1735
|
const Parent = params?.Parent ?? Object;
|
|
1735
1736
|
class Definition extends Parent {}
|
|
1736
|
-
Object.defineProperty(Definition, "name", { value: name$
|
|
1737
|
+
Object.defineProperty(Definition, "name", { value: name$16 });
|
|
1737
1738
|
function _$1(def) {
|
|
1738
1739
|
var _a$21;
|
|
1739
1740
|
const inst = params?.Parent ? new Definition() : this;
|
|
@@ -1745,9 +1746,9 @@ function $constructor$3(name$15, initializer$6, params) {
|
|
|
1745
1746
|
Object.defineProperty(_$1, "init", { value: init$1 });
|
|
1746
1747
|
Object.defineProperty(_$1, Symbol.hasInstance, { value: (inst) => {
|
|
1747
1748
|
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
1748
|
-
return inst?._zod?.traits?.has(name$
|
|
1749
|
+
return inst?._zod?.traits?.has(name$16);
|
|
1749
1750
|
} });
|
|
1750
|
-
Object.defineProperty(_$1, "name", { value: name$
|
|
1751
|
+
Object.defineProperty(_$1, "name", { value: name$16 });
|
|
1751
1752
|
return _$1;
|
|
1752
1753
|
}
|
|
1753
1754
|
var $ZodAsyncError$3 = class extends Error {
|
|
@@ -1756,8 +1757,8 @@ var $ZodAsyncError$3 = class extends Error {
|
|
|
1756
1757
|
}
|
|
1757
1758
|
};
|
|
1758
1759
|
var $ZodEncodeError$3 = class extends Error {
|
|
1759
|
-
constructor(name$
|
|
1760
|
-
super(`Encountered unidirectional transform during encode: ${name$
|
|
1760
|
+
constructor(name$16) {
|
|
1761
|
+
super(`Encountered unidirectional transform during encode: ${name$16}`);
|
|
1761
1762
|
this.name = "ZodEncodeError";
|
|
1762
1763
|
}
|
|
1763
1764
|
};
|
|
@@ -2333,9 +2334,9 @@ const nanoid$4 = /^[a-zA-Z0-9_-]{21}$/;
|
|
|
2333
2334
|
const duration$4 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
2334
2335
|
const extendedDuration$2 = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
2335
2336
|
const guid$4 = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
2336
|
-
const uuid$5 = (version$
|
|
2337
|
-
if (!version$
|
|
2338
|
-
return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$
|
|
2337
|
+
const uuid$5 = (version$5) => {
|
|
2338
|
+
if (!version$5) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
2339
|
+
return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$5}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
2339
2340
|
};
|
|
2340
2341
|
const uuid4$2 = /* @__PURE__ */ uuid$5(4);
|
|
2341
2342
|
const uuid6$2 = /* @__PURE__ */ uuid$5(6);
|
|
@@ -7806,9 +7807,9 @@ function convertBaseSchema$3(schema, ctx) {
|
|
|
7806
7807
|
]);
|
|
7807
7808
|
}
|
|
7808
7809
|
if (schema.const !== void 0) return z$6.literal(schema.const);
|
|
7809
|
-
const type = schema.type;
|
|
7810
|
-
if (Array.isArray(type)) {
|
|
7811
|
-
const typeSchemas = type.map((t$1) => {
|
|
7810
|
+
const type$1 = schema.type;
|
|
7811
|
+
if (Array.isArray(type$1)) {
|
|
7812
|
+
const typeSchemas = type$1.map((t$1) => {
|
|
7812
7813
|
return convertBaseSchema$3({
|
|
7813
7814
|
...schema,
|
|
7814
7815
|
type: t$1
|
|
@@ -7818,9 +7819,9 @@ function convertBaseSchema$3(schema, ctx) {
|
|
|
7818
7819
|
if (typeSchemas.length === 1) return typeSchemas[0];
|
|
7819
7820
|
return z$6.union(typeSchemas);
|
|
7820
7821
|
}
|
|
7821
|
-
if (!type) return z$6.any();
|
|
7822
|
+
if (!type$1) return z$6.any();
|
|
7822
7823
|
let zodSchema$7;
|
|
7823
|
-
switch (type) {
|
|
7824
|
+
switch (type$1) {
|
|
7824
7825
|
case "string": {
|
|
7825
7826
|
let stringSchema = z$6.string();
|
|
7826
7827
|
if (schema.format) {
|
|
@@ -7857,7 +7858,7 @@ function convertBaseSchema$3(schema, ctx) {
|
|
|
7857
7858
|
}
|
|
7858
7859
|
case "number":
|
|
7859
7860
|
case "integer": {
|
|
7860
|
-
let numberSchema = type === "integer" ? z$6.number().int() : z$6.number();
|
|
7861
|
+
let numberSchema = type$1 === "integer" ? z$6.number().int() : z$6.number();
|
|
7861
7862
|
if (typeof schema.minimum === "number") numberSchema = numberSchema.min(schema.minimum);
|
|
7862
7863
|
if (typeof schema.maximum === "number") numberSchema = numberSchema.max(schema.maximum);
|
|
7863
7864
|
if (typeof schema.exclusiveMinimum === "number") numberSchema = numberSchema.gt(schema.exclusiveMinimum);
|
|
@@ -7947,7 +7948,7 @@ function convertBaseSchema$3(schema, ctx) {
|
|
|
7947
7948
|
} else zodSchema$7 = z$6.array(z$6.any());
|
|
7948
7949
|
break;
|
|
7949
7950
|
}
|
|
7950
|
-
default: throw new Error(`Unsupported type: ${type}`);
|
|
7951
|
+
default: throw new Error(`Unsupported type: ${type$1}`);
|
|
7951
7952
|
}
|
|
7952
7953
|
if (schema.description) zodSchema$7 = zodSchema$7.describe(schema.description);
|
|
7953
7954
|
if (schema.default !== void 0) zodSchema$7 = zodSchema$7.default(schema.default);
|
|
@@ -9025,9 +9026,9 @@ function datetimeRegex$1(args) {
|
|
|
9025
9026
|
regex = `${regex}(${opts.join("|")})`;
|
|
9026
9027
|
return /* @__PURE__ */ new RegExp(`^${regex}$`);
|
|
9027
9028
|
}
|
|
9028
|
-
function isValidIP$1(ip, version$
|
|
9029
|
-
if ((version$
|
|
9030
|
-
if ((version$
|
|
9029
|
+
function isValidIP$1(ip, version$5) {
|
|
9030
|
+
if ((version$5 === "v4" || !version$5) && ipv4Regex$1.test(ip)) return true;
|
|
9031
|
+
if ((version$5 === "v6" || !version$5) && ipv6Regex$1.test(ip)) return true;
|
|
9031
9032
|
return false;
|
|
9032
9033
|
}
|
|
9033
9034
|
function isValidJWT$4(jwt$4, alg) {
|
|
@@ -9046,9 +9047,9 @@ function isValidJWT$4(jwt$4, alg) {
|
|
|
9046
9047
|
return false;
|
|
9047
9048
|
}
|
|
9048
9049
|
}
|
|
9049
|
-
function isValidCidr$1(ip, version$
|
|
9050
|
-
if ((version$
|
|
9051
|
-
if ((version$
|
|
9050
|
+
function isValidCidr$1(ip, version$5) {
|
|
9051
|
+
if ((version$5 === "v4" || !version$5) && ipv4CidrRegex$1.test(ip)) return true;
|
|
9052
|
+
if ((version$5 === "v6" || !version$5) && ipv6CidrRegex$1.test(ip)) return true;
|
|
9052
9053
|
return false;
|
|
9053
9054
|
}
|
|
9054
9055
|
var ZodString$3 = class ZodString$3 extends ZodType$3 {
|
|
@@ -10665,20 +10666,20 @@ ZodUnion$3.create = (types, params) => {
|
|
|
10665
10666
|
...processCreateParams$1(params)
|
|
10666
10667
|
});
|
|
10667
10668
|
};
|
|
10668
|
-
const getDiscriminator$1 = (type) => {
|
|
10669
|
-
if (type instanceof ZodLazy$3) return getDiscriminator$1(type.schema);
|
|
10670
|
-
else if (type instanceof ZodEffects$1) return getDiscriminator$1(type.innerType());
|
|
10671
|
-
else if (type instanceof ZodLiteral$3) return [type.value];
|
|
10672
|
-
else if (type instanceof ZodEnum$3) return type.options;
|
|
10673
|
-
else if (type instanceof ZodNativeEnum$1) return util$61.objectValues(type.enum);
|
|
10674
|
-
else if (type instanceof ZodDefault$3) return getDiscriminator$1(type._def.innerType);
|
|
10675
|
-
else if (type instanceof ZodUndefined$3) return [void 0];
|
|
10676
|
-
else if (type instanceof ZodNull$3) return [null];
|
|
10677
|
-
else if (type instanceof ZodOptional$3) return [void 0, ...getDiscriminator$1(type.unwrap())];
|
|
10678
|
-
else if (type instanceof ZodNullable$3) return [null, ...getDiscriminator$1(type.unwrap())];
|
|
10679
|
-
else if (type instanceof ZodBranded$1) return getDiscriminator$1(type.unwrap());
|
|
10680
|
-
else if (type instanceof ZodReadonly$3) return getDiscriminator$1(type.unwrap());
|
|
10681
|
-
else if (type instanceof ZodCatch$3) return getDiscriminator$1(type._def.innerType);
|
|
10669
|
+
const getDiscriminator$1 = (type$1) => {
|
|
10670
|
+
if (type$1 instanceof ZodLazy$3) return getDiscriminator$1(type$1.schema);
|
|
10671
|
+
else if (type$1 instanceof ZodEffects$1) return getDiscriminator$1(type$1.innerType());
|
|
10672
|
+
else if (type$1 instanceof ZodLiteral$3) return [type$1.value];
|
|
10673
|
+
else if (type$1 instanceof ZodEnum$3) return type$1.options;
|
|
10674
|
+
else if (type$1 instanceof ZodNativeEnum$1) return util$61.objectValues(type$1.enum);
|
|
10675
|
+
else if (type$1 instanceof ZodDefault$3) return getDiscriminator$1(type$1._def.innerType);
|
|
10676
|
+
else if (type$1 instanceof ZodUndefined$3) return [void 0];
|
|
10677
|
+
else if (type$1 instanceof ZodNull$3) return [null];
|
|
10678
|
+
else if (type$1 instanceof ZodOptional$3) return [void 0, ...getDiscriminator$1(type$1.unwrap())];
|
|
10679
|
+
else if (type$1 instanceof ZodNullable$3) return [null, ...getDiscriminator$1(type$1.unwrap())];
|
|
10680
|
+
else if (type$1 instanceof ZodBranded$1) return getDiscriminator$1(type$1.unwrap());
|
|
10681
|
+
else if (type$1 instanceof ZodReadonly$3) return getDiscriminator$1(type$1.unwrap());
|
|
10682
|
+
else if (type$1 instanceof ZodCatch$3) return getDiscriminator$1(type$1._def.innerType);
|
|
10682
10683
|
else return [];
|
|
10683
10684
|
};
|
|
10684
10685
|
var ZodDiscriminatedUnion$3 = class ZodDiscriminatedUnion$3 extends ZodType$3 {
|
|
@@ -10725,12 +10726,12 @@ var ZodDiscriminatedUnion$3 = class ZodDiscriminatedUnion$3 extends ZodType$3 {
|
|
|
10725
10726
|
}
|
|
10726
10727
|
static create(discriminator, options, params) {
|
|
10727
10728
|
const optionsMap = /* @__PURE__ */ new Map();
|
|
10728
|
-
for (const type of options) {
|
|
10729
|
-
const discriminatorValues = getDiscriminator$1(type.shape[discriminator]);
|
|
10729
|
+
for (const type$1 of options) {
|
|
10730
|
+
const discriminatorValues = getDiscriminator$1(type$1.shape[discriminator]);
|
|
10730
10731
|
if (!discriminatorValues.length) throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
10731
10732
|
for (const value of discriminatorValues) {
|
|
10732
10733
|
if (optionsMap.has(value)) throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
|
|
10733
|
-
optionsMap.set(value, type);
|
|
10734
|
+
optionsMap.set(value, type$1);
|
|
10734
10735
|
}
|
|
10735
10736
|
}
|
|
10736
10737
|
return new ZodDiscriminatedUnion$3({
|
|
@@ -11510,9 +11511,9 @@ var ZodOptional$3 = class extends ZodType$3 {
|
|
|
11510
11511
|
return this._def.innerType;
|
|
11511
11512
|
}
|
|
11512
11513
|
};
|
|
11513
|
-
ZodOptional$3.create = (type, params) => {
|
|
11514
|
+
ZodOptional$3.create = (type$1, params) => {
|
|
11514
11515
|
return new ZodOptional$3({
|
|
11515
|
-
innerType: type,
|
|
11516
|
+
innerType: type$1,
|
|
11516
11517
|
typeName: ZodFirstPartyTypeKind$1.ZodOptional,
|
|
11517
11518
|
...processCreateParams$1(params)
|
|
11518
11519
|
});
|
|
@@ -11526,9 +11527,9 @@ var ZodNullable$3 = class extends ZodType$3 {
|
|
|
11526
11527
|
return this._def.innerType;
|
|
11527
11528
|
}
|
|
11528
11529
|
};
|
|
11529
|
-
ZodNullable$3.create = (type, params) => {
|
|
11530
|
+
ZodNullable$3.create = (type$1, params) => {
|
|
11530
11531
|
return new ZodNullable$3({
|
|
11531
|
-
innerType: type,
|
|
11532
|
+
innerType: type$1,
|
|
11532
11533
|
typeName: ZodFirstPartyTypeKind$1.ZodNullable,
|
|
11533
11534
|
...processCreateParams$1(params)
|
|
11534
11535
|
});
|
|
@@ -11548,9 +11549,9 @@ var ZodDefault$3 = class extends ZodType$3 {
|
|
|
11548
11549
|
return this._def.innerType;
|
|
11549
11550
|
}
|
|
11550
11551
|
};
|
|
11551
|
-
ZodDefault$3.create = (type, params) => {
|
|
11552
|
+
ZodDefault$3.create = (type$1, params) => {
|
|
11552
11553
|
return new ZodDefault$3({
|
|
11553
|
-
innerType: type,
|
|
11554
|
+
innerType: type$1,
|
|
11554
11555
|
typeName: ZodFirstPartyTypeKind$1.ZodDefault,
|
|
11555
11556
|
defaultValue: typeof params.default === "function" ? params.default : () => params.default,
|
|
11556
11557
|
...processCreateParams$1(params)
|
|
@@ -11596,9 +11597,9 @@ var ZodCatch$3 = class extends ZodType$3 {
|
|
|
11596
11597
|
return this._def.innerType;
|
|
11597
11598
|
}
|
|
11598
11599
|
};
|
|
11599
|
-
ZodCatch$3.create = (type, params) => {
|
|
11600
|
+
ZodCatch$3.create = (type$1, params) => {
|
|
11600
11601
|
return new ZodCatch$3({
|
|
11601
|
-
innerType: type,
|
|
11602
|
+
innerType: type$1,
|
|
11602
11603
|
typeName: ZodFirstPartyTypeKind$1.ZodCatch,
|
|
11603
11604
|
catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
|
|
11604
11605
|
...processCreateParams$1(params)
|
|
@@ -11703,9 +11704,9 @@ var ZodReadonly$3 = class extends ZodType$3 {
|
|
|
11703
11704
|
return this._def.innerType;
|
|
11704
11705
|
}
|
|
11705
11706
|
};
|
|
11706
|
-
ZodReadonly$3.create = (type, params) => {
|
|
11707
|
+
ZodReadonly$3.create = (type$1, params) => {
|
|
11707
11708
|
return new ZodReadonly$3({
|
|
11708
|
-
innerType: type,
|
|
11709
|
+
innerType: type$1,
|
|
11709
11710
|
typeName: ZodFirstPartyTypeKind$1.ZodReadonly,
|
|
11710
11711
|
...processCreateParams$1(params)
|
|
11711
11712
|
});
|
|
@@ -13328,9 +13329,9 @@ function parseEnumDef$6(def) {
|
|
|
13328
13329
|
enum: Array.from(def.values)
|
|
13329
13330
|
};
|
|
13330
13331
|
}
|
|
13331
|
-
var isJsonSchema7AllOfType$6 = (type) => {
|
|
13332
|
-
if ("type" in type && type.type === "string") return false;
|
|
13333
|
-
return "allOf" in type;
|
|
13332
|
+
var isJsonSchema7AllOfType$6 = (type$1) => {
|
|
13333
|
+
if ("type" in type$1 && type$1.type === "string") return false;
|
|
13334
|
+
return "allOf" in type$1;
|
|
13334
13335
|
};
|
|
13335
13336
|
function parseIntersectionDef$6(def, refs) {
|
|
13336
13337
|
const allOf = [parseDef$6(def.left._def, {
|
|
@@ -13685,17 +13686,17 @@ function parseUnionDef$6(def, refs) {
|
|
|
13685
13686
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
13686
13687
|
if (options.every((x$2) => x$2._def.typeName in primitiveMappings$5 && (!x$2._def.checks || !x$2._def.checks.length))) {
|
|
13687
13688
|
const types = options.reduce((types2, x$2) => {
|
|
13688
|
-
const type = primitiveMappings$5[x$2._def.typeName];
|
|
13689
|
-
return type && !types2.includes(type) ? [...types2, type] : types2;
|
|
13689
|
+
const type$1 = primitiveMappings$5[x$2._def.typeName];
|
|
13690
|
+
return type$1 && !types2.includes(type$1) ? [...types2, type$1] : types2;
|
|
13690
13691
|
}, []);
|
|
13691
13692
|
return { type: types.length > 1 ? types : types[0] };
|
|
13692
13693
|
} else if (options.every((x$2) => x$2._def.typeName === "ZodLiteral" && !x$2.description)) {
|
|
13693
13694
|
const types = options.reduce((acc, x$2) => {
|
|
13694
|
-
const type = typeof x$2._def.value;
|
|
13695
|
-
switch (type) {
|
|
13695
|
+
const type$1 = typeof x$2._def.value;
|
|
13696
|
+
switch (type$1) {
|
|
13696
13697
|
case "string":
|
|
13697
13698
|
case "number":
|
|
13698
|
-
case "boolean": return [...acc, type];
|
|
13699
|
+
case "boolean": return [...acc, type$1];
|
|
13699
13700
|
case "bigint": return [...acc, "integer"];
|
|
13700
13701
|
case "object": if (x$2._def.value === null) return [...acc, "null"];
|
|
13701
13702
|
case "symbol":
|
|
@@ -14611,9 +14612,9 @@ var createStatusCodeErrorResponseHandler$5 = () => async ({ response, url: url$4
|
|
|
14611
14612
|
};
|
|
14612
14613
|
function isJSONSerializable$1(value) {
|
|
14613
14614
|
if (value === null || value === void 0) return true;
|
|
14614
|
-
const type = typeof value;
|
|
14615
|
-
if (type === "string" || type === "number" || type === "boolean") return true;
|
|
14616
|
-
if (type === "function" || type === "symbol" || type === "bigint") return false;
|
|
14615
|
+
const type$1 = typeof value;
|
|
14616
|
+
if (type$1 === "string" || type$1 === "number" || type$1 === "boolean") return true;
|
|
14617
|
+
if (type$1 === "function" || type$1 === "symbol" || type$1 === "bigint") return false;
|
|
14617
14618
|
if (Array.isArray(value)) return value.every(isJSONSerializable$1);
|
|
14618
14619
|
if (Object.getPrototypeOf(value) === Object.prototype) return Object.values(value).every(isJSONSerializable$1);
|
|
14619
14620
|
return false;
|
|
@@ -16144,8 +16145,8 @@ async function prepareTools$20({ tools, toolChoice, disableParallelToolUse, cach
|
|
|
16144
16145
|
toolWarnings,
|
|
16145
16146
|
betas
|
|
16146
16147
|
};
|
|
16147
|
-
const type = toolChoice.type;
|
|
16148
|
-
switch (type) {
|
|
16148
|
+
const type$1 = toolChoice.type;
|
|
16149
|
+
switch (type$1) {
|
|
16149
16150
|
case "auto": return {
|
|
16150
16151
|
tools: anthropicTools2,
|
|
16151
16152
|
toolChoice: {
|
|
@@ -16180,7 +16181,7 @@ async function prepareTools$20({ tools, toolChoice, disableParallelToolUse, cach
|
|
|
16180
16181
|
toolWarnings,
|
|
16181
16182
|
betas
|
|
16182
16183
|
};
|
|
16183
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
16184
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
16184
16185
|
}
|
|
16185
16186
|
}
|
|
16186
16187
|
var codeExecution_20250522OutputSchema$3 = lazySchema$2(() => zodSchema$3(object$4({
|
|
@@ -16479,13 +16480,13 @@ function sanitizeSchema$2(schema) {
|
|
|
16479
16480
|
if (schema.anyOf != null) result.anyOf = schema.anyOf.map(sanitizeDefinition$2);
|
|
16480
16481
|
else if (schema.oneOf != null) result.anyOf = schema.oneOf.map(sanitizeDefinition$2);
|
|
16481
16482
|
if (schema.allOf != null) result.allOf = schema.allOf.map(sanitizeDefinition$2);
|
|
16482
|
-
if (schema.definitions != null) result.definitions = Object.fromEntries(Object.entries(schema.definitions).map(([name$
|
|
16483
|
+
if (schema.definitions != null) result.definitions = Object.fromEntries(Object.entries(schema.definitions).map(([name$16, definition]) => [name$16, sanitizeDefinition$2(definition)]));
|
|
16483
16484
|
if (schemaWithDefs.$defs != null) {
|
|
16484
16485
|
const resultWithDefs = result;
|
|
16485
|
-
resultWithDefs.$defs = Object.fromEntries(Object.entries(schemaWithDefs.$defs).map(([name$
|
|
16486
|
+
resultWithDefs.$defs = Object.fromEntries(Object.entries(schemaWithDefs.$defs).map(([name$16, definition]) => [name$16, sanitizeDefinition$2(definition)]));
|
|
16486
16487
|
}
|
|
16487
16488
|
if (schema.type === "object" || schema.properties != null) {
|
|
16488
|
-
if (schema.properties != null) result.properties = Object.fromEntries(Object.entries(schema.properties).map(([name$
|
|
16489
|
+
if (schema.properties != null) result.properties = Object.fromEntries(Object.entries(schema.properties).map(([name$16, definition]) => [name$16, sanitizeDefinition$2(definition)]));
|
|
16489
16490
|
result.additionalProperties = false;
|
|
16490
16491
|
if (schema.required != null) result.required = schema.required;
|
|
16491
16492
|
}
|
|
@@ -17323,9 +17324,9 @@ var init_date_utils = __esmMin((() => {
|
|
|
17323
17324
|
isLeapYear = (year$1) => {
|
|
17324
17325
|
return year$1 % 4 === 0 && (year$1 % 100 !== 0 || year$1 % 400 === 0);
|
|
17325
17326
|
};
|
|
17326
|
-
parseDateValue = (value, type, lower, upper) => {
|
|
17327
|
+
parseDateValue = (value, type$1, lower, upper) => {
|
|
17327
17328
|
const dateVal = strictParseByte(stripLeadingZeroes(value));
|
|
17328
|
-
if (dateVal < lower || dateVal > upper) throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
|
|
17329
|
+
if (dateVal < lower || dateVal > upper) throw new TypeError(`${type$1} must be between ${lower} and ${upper}, inclusive`);
|
|
17329
17330
|
return dateVal;
|
|
17330
17331
|
};
|
|
17331
17332
|
parseMilliseconds = (value) => {
|
|
@@ -17531,11 +17532,11 @@ var init_NumericValue = __esmMin((() => {
|
|
|
17531
17532
|
format = /^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;
|
|
17532
17533
|
_Symbol$hasInstance$4 = Symbol.hasInstance;
|
|
17533
17534
|
NumericValue = class NumericValue {
|
|
17534
|
-
constructor(string$8, type) {
|
|
17535
|
+
constructor(string$8, type$1) {
|
|
17535
17536
|
_defineProperty(this, "string", void 0);
|
|
17536
17537
|
_defineProperty(this, "type", void 0);
|
|
17537
17538
|
this.string = string$8;
|
|
17538
|
-
this.type = type;
|
|
17539
|
+
this.type = type$1;
|
|
17539
17540
|
if (!format.test(string$8)) throw new Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${string$8}"`);
|
|
17540
17541
|
}
|
|
17541
17542
|
toString() {
|
|
@@ -17786,7 +17787,7 @@ var init_toEndpointV1$1 = __esmMin((() => {
|
|
|
17786
17787
|
const v1Endpoint = parseUrl(endpoint.url);
|
|
17787
17788
|
if (endpoint.headers) {
|
|
17788
17789
|
v1Endpoint.headers = {};
|
|
17789
|
-
for (const name$
|
|
17790
|
+
for (const name$16 in endpoint.headers) v1Endpoint.headers[name$16.toLowerCase()] = endpoint.headers[name$16].join(", ");
|
|
17790
17791
|
}
|
|
17791
17792
|
return v1Endpoint;
|
|
17792
17793
|
}
|
|
@@ -17957,11 +17958,11 @@ var init_memoize = __esmMin((() => {
|
|
|
17957
17958
|
}));
|
|
17958
17959
|
var booleanSelector;
|
|
17959
17960
|
var init_booleanSelector = __esmMin((() => {
|
|
17960
|
-
booleanSelector = (obj, key$1, type) => {
|
|
17961
|
+
booleanSelector = (obj, key$1, type$1) => {
|
|
17961
17962
|
if (!(key$1 in obj)) return void 0;
|
|
17962
17963
|
if (obj[key$1] === "true") return true;
|
|
17963
17964
|
if (obj[key$1] === "false") return false;
|
|
17964
|
-
throw new Error(`Cannot load ${type} "${key$1}". Expected "true" or "false", got ${obj[key$1]}.`);
|
|
17965
|
+
throw new Error(`Cannot load ${type$1} "${key$1}". Expected "true" or "false", got ${obj[key$1]}.`);
|
|
17965
17966
|
};
|
|
17966
17967
|
}));
|
|
17967
17968
|
var init_numberSelector = __esmMin((() => {}));
|
|
@@ -18049,19 +18050,19 @@ var init_parseIni = __esmMin((() => {
|
|
|
18049
18050
|
const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);
|
|
18050
18051
|
const matches = prefixKeyRegex.exec(sectionName);
|
|
18051
18052
|
if (matches) {
|
|
18052
|
-
const [, prefix, , name$
|
|
18053
|
-
if (Object.values(import_dist_cjs$6.IniSectionType).includes(prefix)) currentSection = [prefix, name$
|
|
18053
|
+
const [, prefix, , name$16] = matches;
|
|
18054
|
+
if (Object.values(import_dist_cjs$6.IniSectionType).includes(prefix)) currentSection = [prefix, name$16].join(CONFIG_PREFIX_SEPARATOR);
|
|
18054
18055
|
} else currentSection = sectionName;
|
|
18055
18056
|
if (profileNameBlockList.includes(sectionName)) throw new Error(`Found invalid profile name "${sectionName}"`);
|
|
18056
18057
|
} else if (currentSection) {
|
|
18057
18058
|
const indexOfEqualsSign = trimmedLine.indexOf("=");
|
|
18058
18059
|
if (![0, -1].includes(indexOfEqualsSign)) {
|
|
18059
|
-
const [name$
|
|
18060
|
-
if (value === "") currentSubSection = name$
|
|
18060
|
+
const [name$16, value] = [trimmedLine.substring(0, indexOfEqualsSign).trim(), trimmedLine.substring(indexOfEqualsSign + 1).trim()];
|
|
18061
|
+
if (value === "") currentSubSection = name$16;
|
|
18061
18062
|
else {
|
|
18062
18063
|
if (currentSubSection && iniLine.trimStart() === iniLine) currentSubSection = void 0;
|
|
18063
18064
|
map$6[currentSection] = map$6[currentSection] || {};
|
|
18064
|
-
const key$1 = currentSubSection ? [currentSubSection, name$
|
|
18065
|
+
const key$1 = currentSubSection ? [currentSubSection, name$16].join(CONFIG_PREFIX_SEPARATOR) : name$16;
|
|
18065
18066
|
map$6[currentSection][key$1] = value;
|
|
18066
18067
|
}
|
|
18067
18068
|
}
|
|
@@ -18204,14 +18205,14 @@ var init_NodeUseFipsEndpointConfigOptions = __esmMin((() => {
|
|
|
18204
18205
|
}));
|
|
18205
18206
|
var getAllAliases, getMiddlewareNameWithAliases, constructStack, stepWeights, priorityWeights;
|
|
18206
18207
|
var init_MiddlewareStack = __esmMin((() => {
|
|
18207
|
-
getAllAliases = (name$
|
|
18208
|
+
getAllAliases = (name$16, aliases) => {
|
|
18208
18209
|
const _aliases = [];
|
|
18209
|
-
if (name$
|
|
18210
|
+
if (name$16) _aliases.push(name$16);
|
|
18210
18211
|
if (aliases) for (const alias of aliases) _aliases.push(alias);
|
|
18211
18212
|
return _aliases;
|
|
18212
18213
|
};
|
|
18213
|
-
getMiddlewareNameWithAliases = (name$
|
|
18214
|
-
return `${name$
|
|
18214
|
+
getMiddlewareNameWithAliases = (name$16, aliases) => {
|
|
18215
|
+
return `${name$16 || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`;
|
|
18215
18216
|
};
|
|
18216
18217
|
constructStack = () => {
|
|
18217
18218
|
let absoluteEntries = [];
|
|
@@ -18311,22 +18312,22 @@ var init_MiddlewareStack = __esmMin((() => {
|
|
|
18311
18312
|
};
|
|
18312
18313
|
const stack = {
|
|
18313
18314
|
add: (middleware, options = {}) => {
|
|
18314
|
-
const { name: name$
|
|
18315
|
+
const { name: name$16, override, aliases: _aliases } = options;
|
|
18315
18316
|
const entry = {
|
|
18316
18317
|
step: "initialize",
|
|
18317
18318
|
priority: "normal",
|
|
18318
18319
|
middleware,
|
|
18319
18320
|
...options
|
|
18320
18321
|
};
|
|
18321
|
-
const aliases = getAllAliases(name$
|
|
18322
|
+
const aliases = getAllAliases(name$16, _aliases);
|
|
18322
18323
|
if (aliases.length > 0) {
|
|
18323
18324
|
if (aliases.some((alias) => entriesNameSet.has(alias))) {
|
|
18324
|
-
if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name$
|
|
18325
|
+
if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name$16, _aliases)}'`);
|
|
18325
18326
|
for (const alias of aliases) {
|
|
18326
18327
|
const toOverrideIndex = absoluteEntries.findIndex((entry$1) => entry$1.name === alias || entry$1.aliases?.some((a) => a === alias));
|
|
18327
18328
|
if (toOverrideIndex === -1) continue;
|
|
18328
18329
|
const toOverride = absoluteEntries[toOverrideIndex];
|
|
18329
|
-
if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name$
|
|
18330
|
+
if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name$16, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.`);
|
|
18330
18331
|
absoluteEntries.splice(toOverrideIndex, 1);
|
|
18331
18332
|
}
|
|
18332
18333
|
}
|
|
@@ -18335,20 +18336,20 @@ var init_MiddlewareStack = __esmMin((() => {
|
|
|
18335
18336
|
absoluteEntries.push(entry);
|
|
18336
18337
|
},
|
|
18337
18338
|
addRelativeTo: (middleware, options) => {
|
|
18338
|
-
const { name: name$
|
|
18339
|
+
const { name: name$16, override, aliases: _aliases } = options;
|
|
18339
18340
|
const entry = {
|
|
18340
18341
|
middleware,
|
|
18341
18342
|
...options
|
|
18342
18343
|
};
|
|
18343
|
-
const aliases = getAllAliases(name$
|
|
18344
|
+
const aliases = getAllAliases(name$16, _aliases);
|
|
18344
18345
|
if (aliases.length > 0) {
|
|
18345
18346
|
if (aliases.some((alias) => entriesNameSet.has(alias))) {
|
|
18346
|
-
if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name$
|
|
18347
|
+
if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name$16, _aliases)}'`);
|
|
18347
18348
|
for (const alias of aliases) {
|
|
18348
18349
|
const toOverrideIndex = relativeEntries.findIndex((entry$1) => entry$1.name === alias || entry$1.aliases?.some((a) => a === alias));
|
|
18349
18350
|
if (toOverrideIndex === -1) continue;
|
|
18350
18351
|
const toOverride = relativeEntries[toOverrideIndex];
|
|
18351
|
-
if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name$
|
|
18352
|
+
if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name$16, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.`);
|
|
18352
18353
|
relativeEntries.splice(toOverrideIndex, 1);
|
|
18353
18354
|
}
|
|
18354
18355
|
}
|
|
@@ -18367,9 +18368,9 @@ var init_MiddlewareStack = __esmMin((() => {
|
|
|
18367
18368
|
removeByTag: (toRemove) => {
|
|
18368
18369
|
let isRemoved = false;
|
|
18369
18370
|
const filterCb = (entry) => {
|
|
18370
|
-
const { tags, name: name$
|
|
18371
|
+
const { tags, name: name$16, aliases: _aliases } = entry;
|
|
18371
18372
|
if (tags && tags.includes(toRemove)) {
|
|
18372
|
-
const aliases = getAllAliases(name$
|
|
18373
|
+
const aliases = getAllAliases(name$16, _aliases);
|
|
18373
18374
|
for (const alias of aliases) entriesNameSet.delete(alias);
|
|
18374
18375
|
isRemoved = true;
|
|
18375
18376
|
return false;
|
|
@@ -18681,8 +18682,8 @@ var init_NormalizedSchema = __esmMin((() => {
|
|
|
18681
18682
|
return sc;
|
|
18682
18683
|
}
|
|
18683
18684
|
getName(withNamespace = false) {
|
|
18684
|
-
const { name: name$
|
|
18685
|
-
return !withNamespace && name$
|
|
18685
|
+
const { name: name$16 } = this;
|
|
18686
|
+
return !withNamespace && name$16 && name$16.includes("#") ? name$16.split("#")[1] : name$16 || void 0;
|
|
18686
18687
|
}
|
|
18687
18688
|
getMemberName() {
|
|
18688
18689
|
return this.memberName;
|
|
@@ -18887,8 +18888,8 @@ var init_TypeRegistry = __esmMin((() => {
|
|
|
18887
18888
|
}
|
|
18888
18889
|
getBaseException() {
|
|
18889
18890
|
for (const exceptionKey of this.exceptions.keys()) if (Array.isArray(exceptionKey)) {
|
|
18890
|
-
const [, ns, name$
|
|
18891
|
-
const id = ns + "#" + name$
|
|
18891
|
+
const [, ns, name$16] = exceptionKey;
|
|
18892
|
+
const id = ns + "#" + name$16;
|
|
18892
18893
|
if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) return exceptionKey;
|
|
18893
18894
|
}
|
|
18894
18895
|
}
|
|
@@ -19408,7 +19409,7 @@ function bindGetEndpointFromInstructions(getEndpointFromConfig$1) {
|
|
|
19408
19409
|
const customEndpoint = await clientConfig.endpoint();
|
|
19409
19410
|
if (customEndpoint?.headers) {
|
|
19410
19411
|
endpoint.headers ?? (endpoint.headers = {});
|
|
19411
|
-
for (const [name$
|
|
19412
|
+
for (const [name$16, value] of Object.entries(customEndpoint.headers)) endpoint.headers[name$16] = Array.isArray(value) ? value : [value];
|
|
19412
19413
|
}
|
|
19413
19414
|
}
|
|
19414
19415
|
return endpoint;
|
|
@@ -19422,19 +19423,19 @@ var init_getEndpointFromInstructions = __esmMin((() => {
|
|
|
19422
19423
|
resolveParams = async (commandInput, instructionsSupplier, clientConfig) => {
|
|
19423
19424
|
const endpointParams = {};
|
|
19424
19425
|
const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};
|
|
19425
|
-
for (const [name$
|
|
19426
|
+
for (const [name$16, instruction] of Object.entries(instructions)) switch (instruction.type) {
|
|
19426
19427
|
case "staticContextParams":
|
|
19427
|
-
endpointParams[name$
|
|
19428
|
+
endpointParams[name$16] = instruction.value;
|
|
19428
19429
|
break;
|
|
19429
19430
|
case "contextParams":
|
|
19430
|
-
endpointParams[name$
|
|
19431
|
+
endpointParams[name$16] = commandInput[instruction.name];
|
|
19431
19432
|
break;
|
|
19432
19433
|
case "clientContextParams":
|
|
19433
19434
|
case "builtInParams":
|
|
19434
|
-
endpointParams[name$
|
|
19435
|
+
endpointParams[name$16] = await createConfigValueProvider(instruction.name, name$16, clientConfig, instruction.type !== "builtInParams")();
|
|
19435
19436
|
break;
|
|
19436
19437
|
case "operationContextParams":
|
|
19437
|
-
endpointParams[name$
|
|
19438
|
+
endpointParams[name$16] = instruction.get(commandInput);
|
|
19438
19439
|
break;
|
|
19439
19440
|
default: throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
|
|
19440
19441
|
}
|
|
@@ -20580,8 +20581,8 @@ var init_sdk_stream_mixin_browser = __esmMin((() => {
|
|
|
20580
20581
|
ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1 = "The stream has already been transformed.";
|
|
20581
20582
|
sdkStreamMixin$1 = (stream$4) => {
|
|
20582
20583
|
if (!isBlobInstance(stream$4) && !isReadableStream(stream$4)) {
|
|
20583
|
-
const name$
|
|
20584
|
-
throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name$
|
|
20584
|
+
const name$16 = stream$4?.__proto__?.constructor?.name || stream$4;
|
|
20585
|
+
throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name$16}`);
|
|
20585
20586
|
}
|
|
20586
20587
|
let transformed = false;
|
|
20587
20588
|
const transformToByteArray = async () => {
|
|
@@ -20658,8 +20659,8 @@ var init_sdk_stream_mixin = __esmMin((() => {
|
|
|
20658
20659
|
if (!(stream$4 instanceof Readable)) try {
|
|
20659
20660
|
return sdkStreamMixin$1(stream$4);
|
|
20660
20661
|
} catch (ignored) {
|
|
20661
|
-
const name$
|
|
20662
|
-
throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name$
|
|
20662
|
+
const name$16 = stream$4?.__proto__?.constructor?.name || stream$4;
|
|
20663
|
+
throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name$16}`);
|
|
20663
20664
|
}
|
|
20664
20665
|
let transformed = false;
|
|
20665
20666
|
const transformToByteArray = async () => {
|
|
@@ -21185,43 +21186,43 @@ var init_HeaderMarshaller = __esmMin((() => {
|
|
|
21185
21186
|
let position = 0;
|
|
21186
21187
|
while (position < headers.byteLength) {
|
|
21187
21188
|
const nameLength = headers.getUint8(position++);
|
|
21188
|
-
const name$
|
|
21189
|
+
const name$16 = this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, nameLength));
|
|
21189
21190
|
position += nameLength;
|
|
21190
21191
|
switch (headers.getUint8(position++)) {
|
|
21191
21192
|
case HEADER_VALUE_TYPE.boolTrue:
|
|
21192
|
-
out[name$
|
|
21193
|
+
out[name$16] = {
|
|
21193
21194
|
type: BOOLEAN_TAG,
|
|
21194
21195
|
value: true
|
|
21195
21196
|
};
|
|
21196
21197
|
break;
|
|
21197
21198
|
case HEADER_VALUE_TYPE.boolFalse:
|
|
21198
|
-
out[name$
|
|
21199
|
+
out[name$16] = {
|
|
21199
21200
|
type: BOOLEAN_TAG,
|
|
21200
21201
|
value: false
|
|
21201
21202
|
};
|
|
21202
21203
|
break;
|
|
21203
21204
|
case HEADER_VALUE_TYPE.byte:
|
|
21204
|
-
out[name$
|
|
21205
|
+
out[name$16] = {
|
|
21205
21206
|
type: BYTE_TAG,
|
|
21206
21207
|
value: headers.getInt8(position++)
|
|
21207
21208
|
};
|
|
21208
21209
|
break;
|
|
21209
21210
|
case HEADER_VALUE_TYPE.short:
|
|
21210
|
-
out[name$
|
|
21211
|
+
out[name$16] = {
|
|
21211
21212
|
type: SHORT_TAG,
|
|
21212
21213
|
value: headers.getInt16(position, false)
|
|
21213
21214
|
};
|
|
21214
21215
|
position += 2;
|
|
21215
21216
|
break;
|
|
21216
21217
|
case HEADER_VALUE_TYPE.integer:
|
|
21217
|
-
out[name$
|
|
21218
|
+
out[name$16] = {
|
|
21218
21219
|
type: INT_TAG,
|
|
21219
21220
|
value: headers.getInt32(position, false)
|
|
21220
21221
|
};
|
|
21221
21222
|
position += 4;
|
|
21222
21223
|
break;
|
|
21223
21224
|
case HEADER_VALUE_TYPE.long:
|
|
21224
|
-
out[name$
|
|
21225
|
+
out[name$16] = {
|
|
21225
21226
|
type: LONG_TAG,
|
|
21226
21227
|
value: new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8))
|
|
21227
21228
|
};
|
|
@@ -21230,7 +21231,7 @@ var init_HeaderMarshaller = __esmMin((() => {
|
|
|
21230
21231
|
case HEADER_VALUE_TYPE.byteArray:
|
|
21231
21232
|
const binaryLength = headers.getUint16(position, false);
|
|
21232
21233
|
position += 2;
|
|
21233
|
-
out[name$
|
|
21234
|
+
out[name$16] = {
|
|
21234
21235
|
type: BINARY_TAG,
|
|
21235
21236
|
value: new Uint8Array(headers.buffer, headers.byteOffset + position, binaryLength)
|
|
21236
21237
|
};
|
|
@@ -21239,14 +21240,14 @@ var init_HeaderMarshaller = __esmMin((() => {
|
|
|
21239
21240
|
case HEADER_VALUE_TYPE.string:
|
|
21240
21241
|
const stringLength = headers.getUint16(position, false);
|
|
21241
21242
|
position += 2;
|
|
21242
|
-
out[name$
|
|
21243
|
+
out[name$16] = {
|
|
21243
21244
|
type: STRING_TAG,
|
|
21244
21245
|
value: this.toUtf8(new Uint8Array(headers.buffer, headers.byteOffset + position, stringLength))
|
|
21245
21246
|
};
|
|
21246
21247
|
position += stringLength;
|
|
21247
21248
|
break;
|
|
21248
21249
|
case HEADER_VALUE_TYPE.timestamp:
|
|
21249
|
-
out[name$
|
|
21250
|
+
out[name$16] = {
|
|
21250
21251
|
type: TIMESTAMP_TAG,
|
|
21251
21252
|
value: new Date(new Int64(new Uint8Array(headers.buffer, headers.byteOffset + position, 8)).valueOf())
|
|
21252
21253
|
};
|
|
@@ -21255,7 +21256,7 @@ var init_HeaderMarshaller = __esmMin((() => {
|
|
|
21255
21256
|
case HEADER_VALUE_TYPE.uuid:
|
|
21256
21257
|
const uuidBytes = new Uint8Array(headers.buffer, headers.byteOffset + position, 16);
|
|
21257
21258
|
position += 16;
|
|
21258
|
-
out[name$
|
|
21259
|
+
out[name$16] = {
|
|
21259
21260
|
type: UUID_TAG,
|
|
21260
21261
|
value: `${toHex(uuidBytes.subarray(0, 4))}-${toHex(uuidBytes.subarray(4, 6))}-${toHex(uuidBytes.subarray(6, 8))}-${toHex(uuidBytes.subarray(8, 10))}-${toHex(uuidBytes.subarray(10))}`
|
|
21261
21262
|
};
|
|
@@ -21518,9 +21519,9 @@ function getUnmarshalledStream(source, options) {
|
|
|
21518
21519
|
const messageUnmarshaller = getMessageUnmarshaller(options.deserializer, options.toUtf8);
|
|
21519
21520
|
return { [Symbol.asyncIterator]: async function* () {
|
|
21520
21521
|
for await (const chunk$1 of source) {
|
|
21521
|
-
const type = await messageUnmarshaller(options.eventStreamCodec.decode(chunk$1));
|
|
21522
|
-
if (type === void 0) continue;
|
|
21523
|
-
yield type;
|
|
21522
|
+
const type$1 = await messageUnmarshaller(options.eventStreamCodec.decode(chunk$1));
|
|
21523
|
+
if (type$1 === void 0) continue;
|
|
21524
|
+
yield type$1;
|
|
21524
21525
|
}
|
|
21525
21526
|
} };
|
|
21526
21527
|
}
|
|
@@ -21765,18 +21766,18 @@ var init_EventStreamSerde = __esmMin((() => {
|
|
|
21765
21766
|
if (eventStreamSchema.isStructSchema()) {
|
|
21766
21767
|
const out = {};
|
|
21767
21768
|
let hasBindings = false;
|
|
21768
|
-
for (const [name$
|
|
21769
|
+
for (const [name$16, member$1] of eventStreamSchema.structIterator()) {
|
|
21769
21770
|
const { eventHeader, eventPayload } = member$1.getMergedTraits();
|
|
21770
21771
|
hasBindings = hasBindings || Boolean(eventHeader || eventPayload);
|
|
21771
21772
|
if (eventPayload) {
|
|
21772
|
-
if (member$1.isBlobSchema()) out[name$
|
|
21773
|
-
else if (member$1.isStringSchema()) out[name$
|
|
21774
|
-
else if (member$1.isStructSchema()) out[name$
|
|
21773
|
+
if (member$1.isBlobSchema()) out[name$16] = body;
|
|
21774
|
+
else if (member$1.isStringSchema()) out[name$16] = (this.serdeContext?.utf8Encoder ?? toUtf8$1)(body);
|
|
21775
|
+
else if (member$1.isStructSchema()) out[name$16] = await this.deserializer.read(member$1, body);
|
|
21775
21776
|
} else if (eventHeader) {
|
|
21776
|
-
const value = event[unionMember].headers[name$
|
|
21777
|
-
if (value != null) if (member$1.isNumericSchema()) if (value && typeof value === "object" && "bytes" in value) out[name$
|
|
21778
|
-
else out[name$
|
|
21779
|
-
else out[name$
|
|
21777
|
+
const value = event[unionMember].headers[name$16]?.value;
|
|
21778
|
+
if (value != null) if (member$1.isNumericSchema()) if (value && typeof value === "object" && "bytes" in value) out[name$16] = BigInt(value.toString());
|
|
21779
|
+
else out[name$16] = Number(value);
|
|
21780
|
+
else out[name$16] = value;
|
|
21780
21781
|
}
|
|
21781
21782
|
}
|
|
21782
21783
|
return { [unionMember]: await this.readEventMember(eventStreamSchema, body, hasBindings, out) };
|
|
@@ -21829,8 +21830,8 @@ var init_EventStreamSerde = __esmMin((() => {
|
|
|
21829
21830
|
})();
|
|
21830
21831
|
const additionalHeaders = {};
|
|
21831
21832
|
if (!isKnownSchema) {
|
|
21832
|
-
const [type, value] = event[unionMember];
|
|
21833
|
-
eventType = type;
|
|
21833
|
+
const [type$1, value] = event[unionMember];
|
|
21834
|
+
eventType = type$1;
|
|
21834
21835
|
serializer.write(15, value);
|
|
21835
21836
|
} else {
|
|
21836
21837
|
const eventSchema = unionSchema.getMemberSchema(unionMember);
|
|
@@ -21840,15 +21841,15 @@ var init_EventStreamSerde = __esmMin((() => {
|
|
|
21840
21841
|
if (eventPayload) explicitPayloadMember = memberName;
|
|
21841
21842
|
else if (eventHeader) {
|
|
21842
21843
|
const value = event[unionMember][memberName];
|
|
21843
|
-
let type = "binary";
|
|
21844
|
-
if (memberSchema.isNumericSchema()) if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) type = "integer";
|
|
21845
|
-
else type = "long";
|
|
21846
|
-
else if (memberSchema.isTimestampSchema()) type = "timestamp";
|
|
21847
|
-
else if (memberSchema.isStringSchema()) type = "string";
|
|
21848
|
-
else if (memberSchema.isBooleanSchema()) type = "boolean";
|
|
21844
|
+
let type$1 = "binary";
|
|
21845
|
+
if (memberSchema.isNumericSchema()) if ((-2) ** 31 <= value && value <= 2 ** 31 - 1) type$1 = "integer";
|
|
21846
|
+
else type$1 = "long";
|
|
21847
|
+
else if (memberSchema.isTimestampSchema()) type$1 = "timestamp";
|
|
21848
|
+
else if (memberSchema.isStringSchema()) type$1 = "string";
|
|
21849
|
+
else if (memberSchema.isBooleanSchema()) type$1 = "boolean";
|
|
21849
21850
|
if (value != null) {
|
|
21850
21851
|
additionalHeaders[memberName] = {
|
|
21851
|
-
type,
|
|
21852
|
+
type: type$1,
|
|
21852
21853
|
value
|
|
21853
21854
|
};
|
|
21854
21855
|
delete event[unionMember][memberName];
|
|
@@ -22424,8 +22425,8 @@ async function prepareTools$21({ tools, toolChoice, modelId }) {
|
|
|
22424
22425
|
}
|
|
22425
22426
|
let amazonBedrockToolChoice = void 0;
|
|
22426
22427
|
if (!usingAnthropicTools && amazonBedrockTools.length > 0 && toolChoice) {
|
|
22427
|
-
const type = toolChoice.type;
|
|
22428
|
-
switch (type) {
|
|
22428
|
+
const type$1 = toolChoice.type;
|
|
22429
|
+
switch (type$1) {
|
|
22429
22430
|
case "auto":
|
|
22430
22431
|
amazonBedrockToolChoice = { auto: {} };
|
|
22431
22432
|
break;
|
|
@@ -22439,7 +22440,7 @@ async function prepareTools$21({ tools, toolChoice, modelId }) {
|
|
|
22439
22440
|
case "tool":
|
|
22440
22441
|
amazonBedrockToolChoice = { tool: { name: toolChoice.toolName } };
|
|
22441
22442
|
break;
|
|
22442
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
22443
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
22443
22444
|
}
|
|
22444
22445
|
}
|
|
22445
22446
|
return {
|
|
@@ -22529,8 +22530,8 @@ async function convertToAmazonBedrockChatMessages(prompt, isMistral = false) {
|
|
|
22529
22530
|
for (let i$5 = 0; i$5 < blocks.length; i$5++) {
|
|
22530
22531
|
const block = blocks[i$5];
|
|
22531
22532
|
const isLastBlock = i$5 === blocks.length - 1;
|
|
22532
|
-
const type = block.type;
|
|
22533
|
-
switch (type) {
|
|
22533
|
+
const type$1 = block.type;
|
|
22534
|
+
switch (type$1) {
|
|
22534
22535
|
case "system":
|
|
22535
22536
|
if (messages.length > 0) throw new UnsupportedFunctionalityError$1({ functionality: "Multiple system messages that are separated by user/assistant messages" });
|
|
22536
22537
|
for (const message of block.messages) {
|
|
@@ -22758,7 +22759,7 @@ async function convertToAmazonBedrockChatMessages(prompt, isMistral = false) {
|
|
|
22758
22759
|
break;
|
|
22759
22760
|
}
|
|
22760
22761
|
default: {
|
|
22761
|
-
const _exhaustiveCheck = type;
|
|
22762
|
+
const _exhaustiveCheck = type$1;
|
|
22762
22763
|
throw new Error(`Unsupported type: ${_exhaustiveCheck}`);
|
|
22763
22764
|
}
|
|
22764
22765
|
}
|
|
@@ -25602,8 +25603,8 @@ async function prepareTools$19({ tools, toolChoice, disableParallelToolUse, cach
|
|
|
25602
25603
|
toolWarnings,
|
|
25603
25604
|
betas
|
|
25604
25605
|
};
|
|
25605
|
-
const type = toolChoice.type;
|
|
25606
|
-
switch (type) {
|
|
25606
|
+
const type$1 = toolChoice.type;
|
|
25607
|
+
switch (type$1) {
|
|
25607
25608
|
case "auto": return {
|
|
25608
25609
|
tools: anthropicTools2,
|
|
25609
25610
|
toolChoice: {
|
|
@@ -25638,7 +25639,7 @@ async function prepareTools$19({ tools, toolChoice, disableParallelToolUse, cach
|
|
|
25638
25639
|
toolWarnings,
|
|
25639
25640
|
betas
|
|
25640
25641
|
};
|
|
25641
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
25642
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
25642
25643
|
}
|
|
25643
25644
|
}
|
|
25644
25645
|
function convertAnthropicUsage({ usage, rawUsage }) {
|
|
@@ -25983,8 +25984,8 @@ async function convertToAnthropicPrompt({ prompt, sendReasoning, warnings, cache
|
|
|
25983
25984
|
for (let i$5 = 0; i$5 < blocks.length; i$5++) {
|
|
25984
25985
|
const block = blocks[i$5];
|
|
25985
25986
|
const isLastBlock = i$5 === blocks.length - 1;
|
|
25986
|
-
const type = block.type;
|
|
25987
|
-
switch (type) {
|
|
25987
|
+
const type$1 = block.type;
|
|
25988
|
+
switch (type$1) {
|
|
25988
25989
|
case "system": {
|
|
25989
25990
|
const content = [];
|
|
25990
25991
|
let toolChangeCount = 0;
|
|
@@ -26741,7 +26742,7 @@ async function convertToAnthropicPrompt({ prompt, sendReasoning, warnings, cache
|
|
|
26741
26742
|
break;
|
|
26742
26743
|
}
|
|
26743
26744
|
default: {
|
|
26744
|
-
const _exhaustiveCheck = type;
|
|
26745
|
+
const _exhaustiveCheck = type$1;
|
|
26745
26746
|
throw new Error(`content type: ${_exhaustiveCheck}`);
|
|
26746
26747
|
}
|
|
26747
26748
|
}
|
|
@@ -26888,13 +26889,13 @@ function sanitizeSchema$1(schema) {
|
|
|
26888
26889
|
if (schema.anyOf != null) result.anyOf = schema.anyOf.map(sanitizeDefinition$1);
|
|
26889
26890
|
else if (schema.oneOf != null) result.anyOf = schema.oneOf.map(sanitizeDefinition$1);
|
|
26890
26891
|
if (schema.allOf != null) result.allOf = schema.allOf.map(sanitizeDefinition$1);
|
|
26891
|
-
if (schema.definitions != null) result.definitions = Object.fromEntries(Object.entries(schema.definitions).map(([name$
|
|
26892
|
+
if (schema.definitions != null) result.definitions = Object.fromEntries(Object.entries(schema.definitions).map(([name$16, definition]) => [name$16, sanitizeDefinition$1(definition)]));
|
|
26892
26893
|
if (schemaWithDefs.$defs != null) {
|
|
26893
26894
|
const resultWithDefs = result;
|
|
26894
|
-
resultWithDefs.$defs = Object.fromEntries(Object.entries(schemaWithDefs.$defs).map(([name$
|
|
26895
|
+
resultWithDefs.$defs = Object.fromEntries(Object.entries(schemaWithDefs.$defs).map(([name$16, definition]) => [name$16, sanitizeDefinition$1(definition)]));
|
|
26895
26896
|
}
|
|
26896
26897
|
if (schema.type === "object" || schema.properties != null) {
|
|
26897
|
-
if (schema.properties != null) result.properties = Object.fromEntries(Object.entries(schema.properties).map(([name$
|
|
26898
|
+
if (schema.properties != null) result.properties = Object.fromEntries(Object.entries(schema.properties).map(([name$16, definition]) => [name$16, sanitizeDefinition$1(definition)]));
|
|
26898
26899
|
result.additionalProperties = false;
|
|
26899
26900
|
if (schema.required != null) result.required = schema.required;
|
|
26900
26901
|
}
|
|
@@ -28936,9 +28937,9 @@ var AnthropicSkills = class {
|
|
|
28936
28937
|
async getHeaders() {
|
|
28937
28938
|
return combineHeaders$4(await resolve$4(this.config.headers), { "anthropic-beta": "skills-2025-10-02" });
|
|
28938
28939
|
}
|
|
28939
|
-
async fetchVersionMetadata({ skillId, version: version$
|
|
28940
|
+
async fetchVersionMetadata({ skillId, version: version$5, headers }) {
|
|
28940
28941
|
const { value: versionResponse$1 } = await getFromApi$3({
|
|
28941
|
-
url: `${this.config.baseURL}/skills/${skillId}/versions/${version$
|
|
28942
|
+
url: `${this.config.baseURL}/skills/${skillId}/versions/${version$5}`,
|
|
28942
28943
|
validateUrl: false,
|
|
28943
28944
|
headers,
|
|
28944
28945
|
failedResponseHandler: anthropicFailedResponseHandler$2,
|
|
@@ -28973,12 +28974,12 @@ var AnthropicSkills = class {
|
|
|
28973
28974
|
version: response.latest_version,
|
|
28974
28975
|
headers
|
|
28975
28976
|
}) : {};
|
|
28976
|
-
const name$
|
|
28977
|
+
const name$16 = (_a$21 = versionMetadata.name) != null ? _a$21 : response.name;
|
|
28977
28978
|
const description = (_b$13 = versionMetadata.description) != null ? _b$13 : response.description;
|
|
28978
28979
|
return {
|
|
28979
28980
|
providerReference: { anthropic: response.id },
|
|
28980
28981
|
...response.display_title != null ? { displayTitle: response.display_title } : {},
|
|
28981
|
-
...name$
|
|
28982
|
+
...name$16 != null ? { name: name$16 } : {},
|
|
28982
28983
|
...description != null ? { description } : {},
|
|
28983
28984
|
...response.latest_version != null ? { latestVersion: response.latest_version } : {},
|
|
28984
28985
|
providerMetadata: { anthropic: {
|
|
@@ -29674,13 +29675,13 @@ function prepareChatTools$2({ tools, toolChoice }) {
|
|
|
29674
29675
|
toolChoice: void 0,
|
|
29675
29676
|
toolWarnings
|
|
29676
29677
|
};
|
|
29677
|
-
const type = toolChoice.type;
|
|
29678
|
-
switch (type) {
|
|
29678
|
+
const type$1 = toolChoice.type;
|
|
29679
|
+
switch (type$1) {
|
|
29679
29680
|
case "auto":
|
|
29680
29681
|
case "none":
|
|
29681
29682
|
case "required": return {
|
|
29682
29683
|
tools: openaiTools$1,
|
|
29683
|
-
toolChoice: type,
|
|
29684
|
+
toolChoice: type$1,
|
|
29684
29685
|
toolWarnings
|
|
29685
29686
|
};
|
|
29686
29687
|
case "tool": return {
|
|
@@ -29691,7 +29692,7 @@ function prepareChatTools$2({ tools, toolChoice }) {
|
|
|
29691
29692
|
},
|
|
29692
29693
|
toolWarnings
|
|
29693
29694
|
};
|
|
29694
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
29695
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
29695
29696
|
}
|
|
29696
29697
|
}
|
|
29697
29698
|
var OpenAIChatLanguageModel$2 = class _OpenAIChatLanguageModel {
|
|
@@ -33765,11 +33766,11 @@ async function prepareResponsesTools$4({ tools, toolChoice, allowedTools, toolNa
|
|
|
33765
33766
|
toolChoice: {
|
|
33766
33767
|
type: "allowed_tools",
|
|
33767
33768
|
mode: (_b$13 = allowedTools.mode) != null ? _b$13 : "auto",
|
|
33768
|
-
tools: allowedTools.toolNames.map((name$
|
|
33769
|
+
tools: allowedTools.toolNames.map((name$16) => {
|
|
33769
33770
|
var _a2$13;
|
|
33770
33771
|
return {
|
|
33771
33772
|
type: "function",
|
|
33772
|
-
name: (_a2$13 = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name$
|
|
33773
|
+
name: (_a2$13 = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name$16)) != null ? _a2$13 : name$16
|
|
33773
33774
|
};
|
|
33774
33775
|
})
|
|
33775
33776
|
},
|
|
@@ -33780,13 +33781,13 @@ async function prepareResponsesTools$4({ tools, toolChoice, allowedTools, toolNa
|
|
|
33780
33781
|
toolChoice: void 0,
|
|
33781
33782
|
toolWarnings
|
|
33782
33783
|
};
|
|
33783
|
-
const type = toolChoice.type;
|
|
33784
|
-
switch (type) {
|
|
33784
|
+
const type$1 = toolChoice.type;
|
|
33785
|
+
switch (type$1) {
|
|
33785
33786
|
case "auto":
|
|
33786
33787
|
case "none":
|
|
33787
33788
|
case "required": return {
|
|
33788
33789
|
tools: openaiTools$1,
|
|
33789
|
-
toolChoice: type,
|
|
33790
|
+
toolChoice: type$1,
|
|
33790
33791
|
toolWarnings
|
|
33791
33792
|
};
|
|
33792
33793
|
case "tool": {
|
|
@@ -33803,7 +33804,7 @@ async function prepareResponsesTools$4({ tools, toolChoice, allowedTools, toolNa
|
|
|
33803
33804
|
toolWarnings
|
|
33804
33805
|
};
|
|
33805
33806
|
}
|
|
33806
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
33807
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
33807
33808
|
}
|
|
33808
33809
|
}
|
|
33809
33810
|
function prepareFunctionTool$2({ tool: tool$7, options }) {
|
|
@@ -35766,13 +35767,13 @@ function prepareTools$18({ tools, toolChoice }) {
|
|
|
35766
35767
|
toolChoice: void 0,
|
|
35767
35768
|
toolWarnings
|
|
35768
35769
|
};
|
|
35769
|
-
const type = toolChoice == null ? void 0 : toolChoice.type;
|
|
35770
|
-
switch (type) {
|
|
35770
|
+
const type$1 = toolChoice == null ? void 0 : toolChoice.type;
|
|
35771
|
+
switch (type$1) {
|
|
35771
35772
|
case "auto":
|
|
35772
35773
|
case "none":
|
|
35773
35774
|
case "required": return {
|
|
35774
35775
|
tools: deepseekTools,
|
|
35775
|
-
toolChoice: type,
|
|
35776
|
+
toolChoice: type$1,
|
|
35776
35777
|
toolWarnings
|
|
35777
35778
|
};
|
|
35778
35779
|
case "tool": return {
|
|
@@ -35788,7 +35789,7 @@ function prepareTools$18({ tools, toolChoice }) {
|
|
|
35788
35789
|
toolChoice: void 0,
|
|
35789
35790
|
toolWarnings: [...toolWarnings, {
|
|
35790
35791
|
type: "unsupported",
|
|
35791
|
-
feature: `tool choice type: ${type}`
|
|
35792
|
+
feature: `tool choice type: ${type$1}`
|
|
35792
35793
|
}]
|
|
35793
35794
|
};
|
|
35794
35795
|
}
|
|
@@ -36492,13 +36493,13 @@ function prepareTools$17({ tools, toolChoice }) {
|
|
|
36492
36493
|
toolChoice: void 0,
|
|
36493
36494
|
toolWarnings
|
|
36494
36495
|
};
|
|
36495
|
-
const type = toolChoice.type;
|
|
36496
|
-
switch (type) {
|
|
36496
|
+
const type$1 = toolChoice.type;
|
|
36497
|
+
switch (type$1) {
|
|
36497
36498
|
case "auto":
|
|
36498
36499
|
case "none":
|
|
36499
36500
|
case "required": return {
|
|
36500
36501
|
tools: openaiCompatTools,
|
|
36501
|
-
toolChoice: type,
|
|
36502
|
+
toolChoice: type$1,
|
|
36502
36503
|
toolWarnings
|
|
36503
36504
|
};
|
|
36504
36505
|
case "tool": return {
|
|
@@ -36509,7 +36510,7 @@ function prepareTools$17({ tools, toolChoice }) {
|
|
|
36509
36510
|
},
|
|
36510
36511
|
toolWarnings
|
|
36511
36512
|
};
|
|
36512
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
36513
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
36513
36514
|
}
|
|
36514
36515
|
}
|
|
36515
36516
|
var OpenAICompatibleChatLanguageModel$3 = class _OpenAICompatibleChatLanguageModel {
|
|
@@ -36738,13 +36739,13 @@ var OpenAICompatibleChatLanguageModel$3 = class _OpenAICompatibleChatLanguageMod
|
|
|
36738
36739
|
}
|
|
36739
36740
|
const argumentsDelta = (_c2 = toolCallDelta.function) == null ? void 0 : _c2.arguments;
|
|
36740
36741
|
if (argumentsDelta != null) pending.bufferedArguments += argumentsDelta;
|
|
36741
|
-
const name$
|
|
36742
|
-
if (name$
|
|
36742
|
+
const name$16 = (_d = toolCallDelta.function) == null ? void 0 : _d.name;
|
|
36743
|
+
if (name$16 != null) {
|
|
36743
36744
|
const forwardDelta = {
|
|
36744
36745
|
index: index$2,
|
|
36745
36746
|
id: pending.id,
|
|
36746
36747
|
function: {
|
|
36747
|
-
name: name$
|
|
36748
|
+
name: name$16,
|
|
36748
36749
|
arguments: pending.bufferedArguments
|
|
36749
36750
|
},
|
|
36750
36751
|
extra_content: (_e$1 = pending.extraContent) != null ? _e$1 : void 0
|
|
@@ -37728,8 +37729,8 @@ function prepareTools$16({ tools, toolChoice }) {
|
|
|
37728
37729
|
toolChoice: void 0,
|
|
37729
37730
|
toolWarnings
|
|
37730
37731
|
};
|
|
37731
|
-
const type = toolChoice.type;
|
|
37732
|
-
switch (type) {
|
|
37732
|
+
const type$1 = toolChoice.type;
|
|
37733
|
+
switch (type$1) {
|
|
37733
37734
|
case "auto": return {
|
|
37734
37735
|
tools: cohereTools,
|
|
37735
37736
|
toolChoice: void 0,
|
|
@@ -37750,7 +37751,7 @@ function prepareTools$16({ tools, toolChoice }) {
|
|
|
37750
37751
|
toolChoice: "REQUIRED",
|
|
37751
37752
|
toolWarnings
|
|
37752
37753
|
};
|
|
37753
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
37754
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
37754
37755
|
}
|
|
37755
37756
|
}
|
|
37756
37757
|
function convertCohereUsage(tokens) {
|
|
@@ -39058,13 +39059,13 @@ function prepareTools$15({ tools, toolChoice }) {
|
|
|
39058
39059
|
toolChoice: void 0,
|
|
39059
39060
|
toolWarnings
|
|
39060
39061
|
};
|
|
39061
|
-
const type = toolChoice == null ? void 0 : toolChoice.type;
|
|
39062
|
-
switch (type) {
|
|
39062
|
+
const type$1 = toolChoice == null ? void 0 : toolChoice.type;
|
|
39063
|
+
switch (type$1) {
|
|
39063
39064
|
case "auto":
|
|
39064
39065
|
case "none":
|
|
39065
39066
|
case "required": return {
|
|
39066
39067
|
tools: deepseekTools,
|
|
39067
|
-
toolChoice: type,
|
|
39068
|
+
toolChoice: type$1,
|
|
39068
39069
|
toolWarnings
|
|
39069
39070
|
};
|
|
39070
39071
|
case "tool": return {
|
|
@@ -39080,7 +39081,7 @@ function prepareTools$15({ tools, toolChoice }) {
|
|
|
39080
39081
|
toolChoice: void 0,
|
|
39081
39082
|
toolWarnings: [...toolWarnings, {
|
|
39082
39083
|
type: "unsupported",
|
|
39083
|
-
feature: `tool choice type: ${type}`
|
|
39084
|
+
feature: `tool choice type: ${type$1}`
|
|
39084
39085
|
}]
|
|
39085
39086
|
};
|
|
39086
39087
|
}
|
|
@@ -40741,21 +40742,21 @@ function convertJSONSchemaToOpenAPISchema$2(jsonSchema$7, isRoot = true) {
|
|
|
40741
40742
|
type: "boolean",
|
|
40742
40743
|
properties: {}
|
|
40743
40744
|
};
|
|
40744
|
-
const { type, description, required: required$4, properties, items, allOf, anyOf, oneOf, format: format$1, const: constValue, minLength, enum: enumValues } = jsonSchema$7;
|
|
40745
|
+
const { type: type$1, description, required: required$4, properties, items, allOf, anyOf, oneOf, format: format$1, const: constValue, minLength, enum: enumValues } = jsonSchema$7;
|
|
40745
40746
|
const result = {};
|
|
40746
40747
|
if (description) result.description = description;
|
|
40747
40748
|
if (required$4) result.required = required$4;
|
|
40748
40749
|
if (format$1) result.format = format$1;
|
|
40749
40750
|
if (constValue !== void 0) result.enum = [constValue];
|
|
40750
|
-
if (type) if (Array.isArray(type)) {
|
|
40751
|
-
const hasNull = type.includes("null");
|
|
40752
|
-
const nonNullTypes = type.filter((t$1) => t$1 !== "null");
|
|
40751
|
+
if (type$1) if (Array.isArray(type$1)) {
|
|
40752
|
+
const hasNull = type$1.includes("null");
|
|
40753
|
+
const nonNullTypes = type$1.filter((t$1) => t$1 !== "null");
|
|
40753
40754
|
if (nonNullTypes.length === 0) result.type = "null";
|
|
40754
40755
|
else {
|
|
40755
40756
|
result.anyOf = nonNullTypes.map((t$1) => ({ type: t$1 }));
|
|
40756
40757
|
if (hasNull) result.nullable = true;
|
|
40757
40758
|
}
|
|
40758
|
-
} else result.type = type;
|
|
40759
|
+
} else result.type = type$1;
|
|
40759
40760
|
if (enumValues !== void 0) result.enum = enumValues;
|
|
40760
40761
|
if (properties != null) result.properties = Object.entries(properties).reduce((acc, [key$1, value]) => {
|
|
40761
40762
|
acc[key$1] = convertJSONSchemaToOpenAPISchema$2(value, false);
|
|
@@ -40880,8 +40881,8 @@ function convertToGoogleMessages$1(prompt, options) {
|
|
|
40880
40881
|
};
|
|
40881
40882
|
const readProviderOpts = (part) => {
|
|
40882
40883
|
var _a2$13, _b2$9, _c2, _d2, _e2;
|
|
40883
|
-
for (const name$
|
|
40884
|
-
const v$1 = (_a2$13 = part.providerOptions) == null ? void 0 : _a2$13[name$
|
|
40884
|
+
for (const name$16 of providerOptionsNames) {
|
|
40885
|
+
const v$1 = (_a2$13 = part.providerOptions) == null ? void 0 : _a2$13[name$16];
|
|
40885
40886
|
if (v$1 != null) return v$1;
|
|
40886
40887
|
}
|
|
40887
40888
|
if (isVertexLike) return (_b2$9 = part.providerOptions) == null ? void 0 : _b2$9.google;
|
|
@@ -41096,7 +41097,7 @@ function convertToGoogleMessages$1(prompt, options) {
|
|
|
41096
41097
|
const uniqueToolNames = Array.from(new Set(missingSignatureToolNames));
|
|
41097
41098
|
onWarning({
|
|
41098
41099
|
type: "other",
|
|
41099
|
-
message: `Replayed ${missingSignatureToolNames.length} \`functionCall\` part(s) for a Gemini 3 model without a \`thoughtSignature\` (tools: ${uniqueToolNames.map((name$
|
|
41100
|
+
message: `Replayed ${missingSignatureToolNames.length} \`functionCall\` part(s) for a Gemini 3 model without a \`thoughtSignature\` (tools: ${uniqueToolNames.map((name$16) => `\`${name$16}\``).join(", ")}). Injected the documented \`skip_thought_signature_validator\` sentinel to keep the request from failing with HTTP 400. The likely cause is application code that drops \`providerOptions.google.thoughtSignature\` when persisting or serializing assistant tool-call messages. See https://ai.google.dev/gemini-api/docs/thought-signatures.`
|
|
41100
41101
|
});
|
|
41101
41102
|
}
|
|
41102
41103
|
return {
|
|
@@ -41377,8 +41378,8 @@ function prepareTools$14({ tools, toolChoice, modelId, isVertexProvider = false
|
|
|
41377
41378
|
toolConfig: hasStrictTools ? { functionCallingConfig: { mode: "VALIDATED" } } : void 0,
|
|
41378
41379
|
toolWarnings
|
|
41379
41380
|
};
|
|
41380
|
-
const type = toolChoice.type;
|
|
41381
|
-
switch (type) {
|
|
41381
|
+
const type$1 = toolChoice.type;
|
|
41382
|
+
switch (type$1) {
|
|
41382
41383
|
case "auto": return {
|
|
41383
41384
|
tools: [{ functionDeclarations }],
|
|
41384
41385
|
toolConfig: { functionCallingConfig: { mode: hasStrictTools ? "VALIDATED" : "AUTO" } },
|
|
@@ -41402,7 +41403,7 @@ function prepareTools$14({ tools, toolChoice, modelId, isVertexProvider = false
|
|
|
41402
41403
|
} },
|
|
41403
41404
|
toolWarnings
|
|
41404
41405
|
};
|
|
41405
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
41406
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
41406
41407
|
}
|
|
41407
41408
|
}
|
|
41408
41409
|
var GoogleJSONAccumulator$2 = class {
|
|
@@ -41623,9 +41624,9 @@ var GoogleLanguageModel$1 = class _GoogleLanguageModel {
|
|
|
41623
41624
|
const warnings = [];
|
|
41624
41625
|
const providerOptionsNames = this.config.provider.includes("vertex") ? ["googleVertex", "vertex"] : ["google"];
|
|
41625
41626
|
let googleOptions;
|
|
41626
|
-
for (const name$
|
|
41627
|
+
for (const name$16 of providerOptionsNames) {
|
|
41627
41628
|
googleOptions = await parseProviderOptions$3({
|
|
41628
|
-
provider: name$
|
|
41629
|
+
provider: name$16,
|
|
41629
41630
|
providerOptions,
|
|
41630
41631
|
schema: googleLanguageModelOptions$2
|
|
41631
41632
|
});
|
|
@@ -41749,7 +41750,7 @@ var GoogleLanguageModel$1 = class _GoogleLanguageModel {
|
|
|
41749
41750
|
async doGenerate(options) {
|
|
41750
41751
|
var _a$21, _b$13, _c, _d, _e$1, _f, _g, _h, _i, _j, _k, _l, _m, _n$1, _o, _p, _q, _r, _s;
|
|
41751
41752
|
const { args, warnings, providerOptionsNames, extraHeaders } = await this.getArgs(options);
|
|
41752
|
-
const wrapProviderMetadata = (payload) => Object.fromEntries(providerOptionsNames.map((name$
|
|
41753
|
+
const wrapProviderMetadata = (payload) => Object.fromEntries(providerOptionsNames.map((name$16) => [name$16, payload]));
|
|
41753
41754
|
const mergedHeaders = combineHeaders$4(this.config.headers ? await resolve$4(this.config.headers) : void 0, options.headers, extraHeaders);
|
|
41754
41755
|
const { responseHeaders, value: response, rawValue: rawResponse } = await postJsonToApi$4({
|
|
41755
41756
|
url: `${this.config.baseURL}/${getModelPath$2(this.modelId)}:generateContent`,
|
|
@@ -41888,7 +41889,7 @@ var GoogleLanguageModel$1 = class _GoogleLanguageModel {
|
|
|
41888
41889
|
}
|
|
41889
41890
|
async doStream(options) {
|
|
41890
41891
|
const { args, warnings, providerOptionsNames, extraHeaders } = await this.getArgs(options, { isStreaming: true });
|
|
41891
|
-
const wrapProviderMetadata = (payload) => Object.fromEntries(providerOptionsNames.map((name$
|
|
41892
|
+
const wrapProviderMetadata = (payload) => Object.fromEntries(providerOptionsNames.map((name$16) => [name$16, payload]));
|
|
41892
41893
|
const headers = combineHeaders$4(this.config.headers ? await resolve$4(this.config.headers) : void 0, options.headers, extraHeaders);
|
|
41893
41894
|
const { responseHeaders, value: response } = await postJsonToApi$4({
|
|
41894
41895
|
url: `${this.config.baseURL}/${getModelPath$2(this.modelId)}:streamGenerateContent?alt=sse`,
|
|
@@ -43186,9 +43187,9 @@ var GoogleSpeechModel$1 = class _GoogleSpeechModel {
|
|
|
43186
43187
|
const warnings = [];
|
|
43187
43188
|
const providerOptionsNames = this.config.provider.includes("vertex") ? ["googleVertex", "vertex"] : ["google"];
|
|
43188
43189
|
let googleOptions;
|
|
43189
|
-
for (const name$
|
|
43190
|
+
for (const name$16 of providerOptionsNames) {
|
|
43190
43191
|
googleOptions = await parseProviderOptions$3({
|
|
43191
|
-
provider: name$
|
|
43192
|
+
provider: name$16,
|
|
43192
43193
|
providerOptions,
|
|
43193
43194
|
schema: googleSpeechProviderOptionsSchema$1
|
|
43194
43195
|
});
|
|
@@ -43544,11 +43545,11 @@ var BUILTIN_TOOL_RESULT_TYPES$2 = /* @__PURE__ */ new Set([
|
|
|
43544
43545
|
"google_maps_result",
|
|
43545
43546
|
"mcp_server_tool_result"
|
|
43546
43547
|
]);
|
|
43547
|
-
function builtinToolNameFromCallType$2(type) {
|
|
43548
|
-
return type.replace(/_call$/, "");
|
|
43548
|
+
function builtinToolNameFromCallType$2(type$1) {
|
|
43549
|
+
return type$1.replace(/_call$/, "");
|
|
43549
43550
|
}
|
|
43550
|
-
function builtinToolNameFromResultType$2(type) {
|
|
43551
|
-
return type.replace(/_result$/, "");
|
|
43551
|
+
function builtinToolNameFromResultType$2(type$1) {
|
|
43552
|
+
return type$1.replace(/_result$/, "");
|
|
43552
43553
|
}
|
|
43553
43554
|
function buildGoogleInteractionsStreamTransform$2({ warnings, generateId: generateId3, includeRawChunks, serviceTier: headerServiceTier }) {
|
|
43554
43555
|
let interactionId;
|
|
@@ -44785,11 +44786,11 @@ var BUILTIN_TOOL_RESULT_TYPES2$2 = /* @__PURE__ */ new Set([
|
|
|
44785
44786
|
"google_maps_result",
|
|
44786
44787
|
"mcp_server_tool_result"
|
|
44787
44788
|
]);
|
|
44788
|
-
function builtinToolNameFromCallType2$2(type) {
|
|
44789
|
-
return type.replace(/_call$/, "");
|
|
44789
|
+
function builtinToolNameFromCallType2$2(type$1) {
|
|
44790
|
+
return type$1.replace(/_call$/, "");
|
|
44790
44791
|
}
|
|
44791
|
-
function builtinToolNameFromResultType2$2(type) {
|
|
44792
|
-
return type.replace(/_result$/, "");
|
|
44792
|
+
function builtinToolNameFromResultType2$2(type$1) {
|
|
44793
|
+
return type$1.replace(/_result$/, "");
|
|
44793
44794
|
}
|
|
44794
44795
|
function parseGoogleInteractionsOutputs$2({ steps, generateId: generateId3, interactionId }) {
|
|
44795
44796
|
var _a$21, _b$13, _c, _d, _e$1, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
@@ -44801,9 +44802,9 @@ function parseGoogleInteractionsOutputs$2({ steps, generateId: generateId3, inte
|
|
|
44801
44802
|
};
|
|
44802
44803
|
for (const step of steps) {
|
|
44803
44804
|
if (step == null || typeof step !== "object") continue;
|
|
44804
|
-
const type = step.type;
|
|
44805
|
-
if (typeof type !== "string") continue;
|
|
44806
|
-
switch (type) {
|
|
44805
|
+
const type$1 = step.type;
|
|
44806
|
+
if (typeof type$1 !== "string") continue;
|
|
44807
|
+
switch (type$1) {
|
|
44807
44808
|
case "user_input": break;
|
|
44808
44809
|
case "model_output": {
|
|
44809
44810
|
const blocks = (_a$21 = step.content) != null ? _a$21 : [];
|
|
@@ -44896,9 +44897,9 @@ function parseGoogleInteractionsOutputs$2({ steps, generateId: generateId3, inte
|
|
|
44896
44897
|
break;
|
|
44897
44898
|
}
|
|
44898
44899
|
default:
|
|
44899
|
-
if (BUILTIN_TOOL_CALL_TYPES2$2.has(type)) {
|
|
44900
|
+
if (BUILTIN_TOOL_CALL_TYPES2$2.has(type$1)) {
|
|
44900
44901
|
const call = step;
|
|
44901
|
-
const toolName = type === "mcp_server_tool_call" ? (_h = call.name) != null ? _h : "mcp_server_tool" : builtinToolNameFromCallType2$2(type);
|
|
44902
|
+
const toolName = type$1 === "mcp_server_tool_call" ? (_h = call.name) != null ? _h : "mcp_server_tool" : builtinToolNameFromCallType2$2(type$1);
|
|
44902
44903
|
const input = JSON.stringify((_i = call.arguments) != null ? _i : {});
|
|
44903
44904
|
content.push({
|
|
44904
44905
|
type: "tool-call",
|
|
@@ -44907,9 +44908,9 @@ function parseGoogleInteractionsOutputs$2({ steps, generateId: generateId3, inte
|
|
|
44907
44908
|
input,
|
|
44908
44909
|
providerExecuted: true
|
|
44909
44910
|
});
|
|
44910
|
-
} else if (BUILTIN_TOOL_RESULT_TYPES2$2.has(type)) {
|
|
44911
|
+
} else if (BUILTIN_TOOL_RESULT_TYPES2$2.has(type$1)) {
|
|
44911
44912
|
const result = step;
|
|
44912
|
-
const toolName = type === "mcp_server_tool_result" ? (_k = result.name) != null ? _k : "mcp_server_tool" : builtinToolNameFromResultType2$2(type);
|
|
44913
|
+
const toolName = type$1 === "mcp_server_tool_result" ? (_k = result.name) != null ? _k : "mcp_server_tool" : builtinToolNameFromResultType2$2(type$1);
|
|
44913
44914
|
content.push({
|
|
44914
44915
|
type: "tool-result",
|
|
44915
44916
|
toolCallId: (_l = result.call_id) != null ? _l : generateId3(),
|
|
@@ -45764,8 +45765,8 @@ function pruneUndefined$2(obj) {
|
|
|
45764
45765
|
function getRealtimeBaseURL(baseURL) {
|
|
45765
45766
|
const url$4 = new URL(baseURL);
|
|
45766
45767
|
const pathSegments = url$4.pathname.split("/");
|
|
45767
|
-
const version$
|
|
45768
|
-
if (version$
|
|
45768
|
+
const version$5 = pathSegments.at(-1);
|
|
45769
|
+
if (version$5 === "v1beta" || version$5 === "v1alpha") {
|
|
45769
45770
|
pathSegments.pop();
|
|
45770
45771
|
url$4.pathname = pathSegments.join("/") || "/";
|
|
45771
45772
|
}
|
|
@@ -46612,15 +46613,15 @@ var require_extend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
46612
46613
|
});
|
|
46613
46614
|
else target[options.name] = options.newValue;
|
|
46614
46615
|
};
|
|
46615
|
-
var getProperty = function getProperty$1(obj, name$
|
|
46616
|
-
if (name$
|
|
46617
|
-
if (!hasOwn$3.call(obj, name$
|
|
46618
|
-
else if (gOPD) return gOPD(obj, name$
|
|
46616
|
+
var getProperty = function getProperty$1(obj, name$16) {
|
|
46617
|
+
if (name$16 === "__proto__") {
|
|
46618
|
+
if (!hasOwn$3.call(obj, name$16)) return;
|
|
46619
|
+
else if (gOPD) return gOPD(obj, name$16).value;
|
|
46619
46620
|
}
|
|
46620
|
-
return obj[name$
|
|
46621
|
+
return obj[name$16];
|
|
46621
46622
|
};
|
|
46622
46623
|
module.exports = function extend$4() {
|
|
46623
|
-
var options, name$
|
|
46624
|
+
var options, name$16, src, copy, copyIsArray, clone$5;
|
|
46624
46625
|
var target = arguments[0];
|
|
46625
46626
|
var i$5 = 1;
|
|
46626
46627
|
var length = arguments.length;
|
|
@@ -46633,9 +46634,9 @@ var require_extend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
46633
46634
|
if (target == null || typeof target !== "object" && typeof target !== "function") target = {};
|
|
46634
46635
|
for (; i$5 < length; ++i$5) {
|
|
46635
46636
|
options = arguments[i$5];
|
|
46636
|
-
if (options != null) for (name$
|
|
46637
|
-
src = getProperty(target, name$
|
|
46638
|
-
copy = getProperty(options, name$
|
|
46637
|
+
if (options != null) for (name$16 in options) {
|
|
46638
|
+
src = getProperty(target, name$16);
|
|
46639
|
+
copy = getProperty(options, name$16);
|
|
46639
46640
|
if (target !== copy) {
|
|
46640
46641
|
if (deep && copy && (isPlainObject$8(copy) || (copyIsArray = isArray$1(copy)))) {
|
|
46641
46642
|
if (copyIsArray) {
|
|
@@ -46643,11 +46644,11 @@ var require_extend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
46643
46644
|
clone$5 = src && isArray$1(src) ? src : [];
|
|
46644
46645
|
} else clone$5 = src && isPlainObject$8(src) ? src : {};
|
|
46645
46646
|
setProperty(target, {
|
|
46646
|
-
name: name$
|
|
46647
|
+
name: name$16,
|
|
46647
46648
|
newValue: extend$4(deep, clone$5, copy)
|
|
46648
46649
|
});
|
|
46649
46650
|
} else if (typeof copy !== "undefined") setProperty(target, {
|
|
46650
|
-
name: name$
|
|
46651
|
+
name: name$16,
|
|
46651
46652
|
newValue: copy
|
|
46652
46653
|
});
|
|
46653
46654
|
}
|
|
@@ -48457,8 +48458,8 @@ var require_bignumber = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
48457
48458
|
for (i$5 = 0; i$5 < j$2; i$5++) if (xc[i$5] != yc[i$5]) return xc[i$5] > yc[i$5] ^ a ? 1 : -1;
|
|
48458
48459
|
return k$2 == l ? 0 : k$2 > l ^ a ? 1 : -1;
|
|
48459
48460
|
}
|
|
48460
|
-
function intCheck(n, min, max, name$
|
|
48461
|
-
if (n < min || n > max || n !== mathfloor(n)) throw Error(bignumberError + (name$
|
|
48461
|
+
function intCheck(n, min, max, name$16) {
|
|
48462
|
+
if (n < min || n > max || n !== mathfloor(n)) throw Error(bignumberError + (name$16 || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
48462
48463
|
}
|
|
48463
48464
|
function isOdd(n) {
|
|
48464
48465
|
var k$2 = n.c.length - 1;
|
|
@@ -49237,18 +49238,18 @@ var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
49237
49238
|
}
|
|
49238
49239
|
});
|
|
49239
49240
|
}
|
|
49240
|
-
async function metadataAccessor(type, options = {}, noResponseRetries = 3, fastFail = false) {
|
|
49241
|
+
async function metadataAccessor(type$1, options = {}, noResponseRetries = 3, fastFail = false) {
|
|
49241
49242
|
const headers = new Headers(exports.HEADERS);
|
|
49242
49243
|
let metadataKey = "";
|
|
49243
49244
|
let params = {};
|
|
49244
|
-
if (typeof type === "object") {
|
|
49245
|
-
const metadataAccessor$1 = type;
|
|
49245
|
+
if (typeof type$1 === "object") {
|
|
49246
|
+
const metadataAccessor$1 = type$1;
|
|
49246
49247
|
new Headers(metadataAccessor$1.headers).forEach((value, key$1) => headers.set(key$1, value));
|
|
49247
49248
|
metadataKey = metadataAccessor$1.metadataKey;
|
|
49248
49249
|
params = metadataAccessor$1.params || params;
|
|
49249
49250
|
noResponseRetries = metadataAccessor$1.noResponseRetries || noResponseRetries;
|
|
49250
49251
|
fastFail = metadataAccessor$1.fastFail || fastFail;
|
|
49251
|
-
} else metadataKey = type;
|
|
49252
|
+
} else metadataKey = type$1;
|
|
49252
49253
|
if (typeof options === "string") metadataKey += `/${options}`;
|
|
49253
49254
|
else {
|
|
49254
49255
|
validate(options);
|
|
@@ -51857,8 +51858,8 @@ var require_impersonated = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
51857
51858
|
}
|
|
51858
51859
|
async sign(blobToSign) {
|
|
51859
51860
|
await this.sourceClient.getAccessToken();
|
|
51860
|
-
const name$
|
|
51861
|
-
const u = `${this.endpoint}/v1/${name$
|
|
51861
|
+
const name$16 = `projects/-/serviceAccounts/${this.targetPrincipal}`;
|
|
51862
|
+
const u = `${this.endpoint}/v1/${name$16}:signBlob`;
|
|
51862
51863
|
const body = {
|
|
51863
51864
|
delegates: this.delegates,
|
|
51864
51865
|
payload: Buffer.from(blobToSign).toString("base64")
|
|
@@ -51876,8 +51877,8 @@ var require_impersonated = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
51876
51877
|
async refreshToken() {
|
|
51877
51878
|
try {
|
|
51878
51879
|
await this.sourceClient.getAccessToken();
|
|
51879
|
-
const name$
|
|
51880
|
-
const u = `${this.endpoint}/v1/${name$
|
|
51880
|
+
const name$16 = "projects/-/serviceAccounts/" + this.targetPrincipal;
|
|
51881
|
+
const u = `${this.endpoint}/v1/${name$16}:generateAccessToken`;
|
|
51881
51882
|
const body = {
|
|
51882
51883
|
delegates: this.delegates,
|
|
51883
51884
|
scope: this.targetScopes,
|
|
@@ -51915,8 +51916,8 @@ var require_impersonated = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
51915
51916
|
}
|
|
51916
51917
|
async fetchIdToken(targetAudience, options) {
|
|
51917
51918
|
await this.sourceClient.getAccessToken();
|
|
51918
|
-
const name$
|
|
51919
|
-
const u = `${this.endpoint}/v1/${name$
|
|
51919
|
+
const name$16 = `projects/-/serviceAccounts/${this.targetPrincipal}`;
|
|
51920
|
+
const u = `${this.endpoint}/v1/${name$16}:generateIdToken`;
|
|
51920
51921
|
const body = {
|
|
51921
51922
|
delegates: this.delegates,
|
|
51922
51923
|
audience: targetAudience,
|
|
@@ -52136,8 +52137,8 @@ var require_baseexternalclient = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
52136
52137
|
_defineProperty(this, "supplierContext", void 0);
|
|
52137
52138
|
_classPrivateFieldInitSpec(this, _pendingAccessToken, null);
|
|
52138
52139
|
const opts = (0, util_1$5.originalOrCamelOptions)(options);
|
|
52139
|
-
const type = opts.get("type");
|
|
52140
|
-
if (type && type !== exports.EXTERNAL_ACCOUNT_TYPE) throw new Error(`Expected "${exports.EXTERNAL_ACCOUNT_TYPE}" type but received "${options.type}"`);
|
|
52140
|
+
const type$1 = opts.get("type");
|
|
52141
|
+
if (type$1 && type$1 !== exports.EXTERNAL_ACCOUNT_TYPE) throw new Error(`Expected "${exports.EXTERNAL_ACCOUNT_TYPE}" type but received "${options.type}"`);
|
|
52141
52142
|
const clientId = opts.get("client_id");
|
|
52142
52143
|
const clientSecret = opts.get("client_secret");
|
|
52143
52144
|
this.tokenUrl = opts.get("token_url") ?? DEFAULT_TOKEN_URL$1.replace("{universeDomain}", this.universeDomain);
|
|
@@ -54332,21 +54333,21 @@ function convertJSONSchemaToOpenAPISchema$1(jsonSchema$7, isRoot = true) {
|
|
|
54332
54333
|
type: "boolean",
|
|
54333
54334
|
properties: {}
|
|
54334
54335
|
};
|
|
54335
|
-
const { type, description, required: required$4, properties, items, allOf, anyOf, oneOf, format: format$1, const: constValue, minLength, enum: enumValues } = jsonSchema$7;
|
|
54336
|
+
const { type: type$1, description, required: required$4, properties, items, allOf, anyOf, oneOf, format: format$1, const: constValue, minLength, enum: enumValues } = jsonSchema$7;
|
|
54336
54337
|
const result = {};
|
|
54337
54338
|
if (description) result.description = description;
|
|
54338
54339
|
if (required$4) result.required = required$4;
|
|
54339
54340
|
if (format$1) result.format = format$1;
|
|
54340
54341
|
if (constValue !== void 0) result.enum = [constValue];
|
|
54341
|
-
if (type) if (Array.isArray(type)) {
|
|
54342
|
-
const hasNull = type.includes("null");
|
|
54343
|
-
const nonNullTypes = type.filter((t$1) => t$1 !== "null");
|
|
54342
|
+
if (type$1) if (Array.isArray(type$1)) {
|
|
54343
|
+
const hasNull = type$1.includes("null");
|
|
54344
|
+
const nonNullTypes = type$1.filter((t$1) => t$1 !== "null");
|
|
54344
54345
|
if (nonNullTypes.length === 0) result.type = "null";
|
|
54345
54346
|
else {
|
|
54346
54347
|
result.anyOf = nonNullTypes.map((t$1) => ({ type: t$1 }));
|
|
54347
54348
|
if (hasNull) result.nullable = true;
|
|
54348
54349
|
}
|
|
54349
|
-
} else result.type = type;
|
|
54350
|
+
} else result.type = type$1;
|
|
54350
54351
|
if (enumValues !== void 0) result.enum = enumValues;
|
|
54351
54352
|
if (properties != null) result.properties = Object.entries(properties).reduce((acc, [key$1, value]) => {
|
|
54352
54353
|
acc[key$1] = convertJSONSchemaToOpenAPISchema$1(value, false);
|
|
@@ -54471,8 +54472,8 @@ function convertToGoogleMessages(prompt, options) {
|
|
|
54471
54472
|
};
|
|
54472
54473
|
const readProviderOpts = (part) => {
|
|
54473
54474
|
var _a2$13, _b2$9, _c2, _d2, _e2;
|
|
54474
|
-
for (const name$
|
|
54475
|
-
const v$1 = (_a2$13 = part.providerOptions) == null ? void 0 : _a2$13[name$
|
|
54475
|
+
for (const name$16 of providerOptionsNames) {
|
|
54476
|
+
const v$1 = (_a2$13 = part.providerOptions) == null ? void 0 : _a2$13[name$16];
|
|
54476
54477
|
if (v$1 != null) return v$1;
|
|
54477
54478
|
}
|
|
54478
54479
|
if (isVertexLike) return (_b2$9 = part.providerOptions) == null ? void 0 : _b2$9.google;
|
|
@@ -54687,7 +54688,7 @@ function convertToGoogleMessages(prompt, options) {
|
|
|
54687
54688
|
const uniqueToolNames = Array.from(new Set(missingSignatureToolNames));
|
|
54688
54689
|
onWarning({
|
|
54689
54690
|
type: "other",
|
|
54690
|
-
message: `Replayed ${missingSignatureToolNames.length} \`functionCall\` part(s) for a Gemini 3 model without a \`thoughtSignature\` (tools: ${uniqueToolNames.map((name$
|
|
54691
|
+
message: `Replayed ${missingSignatureToolNames.length} \`functionCall\` part(s) for a Gemini 3 model without a \`thoughtSignature\` (tools: ${uniqueToolNames.map((name$16) => `\`${name$16}\``).join(", ")}). Injected the documented \`skip_thought_signature_validator\` sentinel to keep the request from failing with HTTP 400. The likely cause is application code that drops \`providerOptions.google.thoughtSignature\` when persisting or serializing assistant tool-call messages. See https://ai.google.dev/gemini-api/docs/thought-signatures.`
|
|
54691
54692
|
});
|
|
54692
54693
|
}
|
|
54693
54694
|
return {
|
|
@@ -54976,8 +54977,8 @@ function prepareTools$13({ tools, toolChoice, modelId, isVertexProvider = false
|
|
|
54976
54977
|
toolConfig: hasStrictTools ? { functionCallingConfig: { mode: "VALIDATED" } } : void 0,
|
|
54977
54978
|
toolWarnings
|
|
54978
54979
|
};
|
|
54979
|
-
const type = toolChoice.type;
|
|
54980
|
-
switch (type) {
|
|
54980
|
+
const type$1 = toolChoice.type;
|
|
54981
|
+
switch (type$1) {
|
|
54981
54982
|
case "auto": return {
|
|
54982
54983
|
tools: [{ functionDeclarations }],
|
|
54983
54984
|
toolConfig: { functionCallingConfig: { mode: hasStrictTools ? "VALIDATED" : "AUTO" } },
|
|
@@ -55001,7 +55002,7 @@ function prepareTools$13({ tools, toolChoice, modelId, isVertexProvider = false
|
|
|
55001
55002
|
} },
|
|
55002
55003
|
toolWarnings
|
|
55003
55004
|
};
|
|
55004
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
55005
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
55005
55006
|
}
|
|
55006
55007
|
}
|
|
55007
55008
|
var GoogleJSONAccumulator$1 = class {
|
|
@@ -55222,9 +55223,9 @@ var GoogleLanguageModel = class _GoogleLanguageModel {
|
|
|
55222
55223
|
const warnings = [];
|
|
55223
55224
|
const providerOptionsNames = this.config.provider.includes("vertex") ? ["googleVertex", "vertex"] : ["google"];
|
|
55224
55225
|
let googleOptions;
|
|
55225
|
-
for (const name$
|
|
55226
|
+
for (const name$16 of providerOptionsNames) {
|
|
55226
55227
|
googleOptions = await parseProviderOptions$3({
|
|
55227
|
-
provider: name$
|
|
55228
|
+
provider: name$16,
|
|
55228
55229
|
providerOptions,
|
|
55229
55230
|
schema: googleLanguageModelOptions$1
|
|
55230
55231
|
});
|
|
@@ -55348,7 +55349,7 @@ var GoogleLanguageModel = class _GoogleLanguageModel {
|
|
|
55348
55349
|
async doGenerate(options) {
|
|
55349
55350
|
var _a$21, _b$13, _c, _d, _e$1, _f, _g, _h, _i, _j, _k, _l, _m, _n$1, _o, _p, _q, _r, _s;
|
|
55350
55351
|
const { args, warnings, providerOptionsNames, extraHeaders } = await this.getArgs(options);
|
|
55351
|
-
const wrapProviderMetadata = (payload) => Object.fromEntries(providerOptionsNames.map((name$
|
|
55352
|
+
const wrapProviderMetadata = (payload) => Object.fromEntries(providerOptionsNames.map((name$16) => [name$16, payload]));
|
|
55352
55353
|
const mergedHeaders = combineHeaders$4(this.config.headers ? await resolve$4(this.config.headers) : void 0, options.headers, extraHeaders);
|
|
55353
55354
|
const { responseHeaders, value: response, rawValue: rawResponse } = await postJsonToApi$4({
|
|
55354
55355
|
url: `${this.config.baseURL}/${getModelPath$1(this.modelId)}:generateContent`,
|
|
@@ -55487,7 +55488,7 @@ var GoogleLanguageModel = class _GoogleLanguageModel {
|
|
|
55487
55488
|
}
|
|
55488
55489
|
async doStream(options) {
|
|
55489
55490
|
const { args, warnings, providerOptionsNames, extraHeaders } = await this.getArgs(options, { isStreaming: true });
|
|
55490
|
-
const wrapProviderMetadata = (payload) => Object.fromEntries(providerOptionsNames.map((name$
|
|
55491
|
+
const wrapProviderMetadata = (payload) => Object.fromEntries(providerOptionsNames.map((name$16) => [name$16, payload]));
|
|
55491
55492
|
const headers = combineHeaders$4(this.config.headers ? await resolve$4(this.config.headers) : void 0, options.headers, extraHeaders);
|
|
55492
55493
|
const { responseHeaders, value: response } = await postJsonToApi$4({
|
|
55493
55494
|
url: `${this.config.baseURL}/${getModelPath$1(this.modelId)}:streamGenerateContent?alt=sse`,
|
|
@@ -56182,9 +56183,9 @@ var GoogleSpeechModel = class _GoogleSpeechModel {
|
|
|
56182
56183
|
const warnings = [];
|
|
56183
56184
|
const providerOptionsNames = this.config.provider.includes("vertex") ? ["googleVertex", "vertex"] : ["google"];
|
|
56184
56185
|
let googleOptions;
|
|
56185
|
-
for (const name$
|
|
56186
|
+
for (const name$16 of providerOptionsNames) {
|
|
56186
56187
|
googleOptions = await parseProviderOptions$3({
|
|
56187
|
-
provider: name$
|
|
56188
|
+
provider: name$16,
|
|
56188
56189
|
providerOptions,
|
|
56189
56190
|
schema: googleSpeechProviderOptionsSchema
|
|
56190
56191
|
});
|
|
@@ -56602,11 +56603,11 @@ var BUILTIN_TOOL_RESULT_TYPES$1 = /* @__PURE__ */ new Set([
|
|
|
56602
56603
|
"google_maps_result",
|
|
56603
56604
|
"mcp_server_tool_result"
|
|
56604
56605
|
]);
|
|
56605
|
-
function builtinToolNameFromCallType$1(type) {
|
|
56606
|
-
return type.replace(/_call$/, "");
|
|
56606
|
+
function builtinToolNameFromCallType$1(type$1) {
|
|
56607
|
+
return type$1.replace(/_call$/, "");
|
|
56607
56608
|
}
|
|
56608
|
-
function builtinToolNameFromResultType$1(type) {
|
|
56609
|
-
return type.replace(/_result$/, "");
|
|
56609
|
+
function builtinToolNameFromResultType$1(type$1) {
|
|
56610
|
+
return type$1.replace(/_result$/, "");
|
|
56610
56611
|
}
|
|
56611
56612
|
function buildGoogleInteractionsStreamTransform$1({ warnings, generateId: generateId2, includeRawChunks, serviceTier: headerServiceTier }) {
|
|
56612
56613
|
let interactionId;
|
|
@@ -57843,11 +57844,11 @@ var BUILTIN_TOOL_RESULT_TYPES2$1 = /* @__PURE__ */ new Set([
|
|
|
57843
57844
|
"google_maps_result",
|
|
57844
57845
|
"mcp_server_tool_result"
|
|
57845
57846
|
]);
|
|
57846
|
-
function builtinToolNameFromCallType2$1(type) {
|
|
57847
|
-
return type.replace(/_call$/, "");
|
|
57847
|
+
function builtinToolNameFromCallType2$1(type$1) {
|
|
57848
|
+
return type$1.replace(/_call$/, "");
|
|
57848
57849
|
}
|
|
57849
|
-
function builtinToolNameFromResultType2$1(type) {
|
|
57850
|
-
return type.replace(/_result$/, "");
|
|
57850
|
+
function builtinToolNameFromResultType2$1(type$1) {
|
|
57851
|
+
return type$1.replace(/_result$/, "");
|
|
57851
57852
|
}
|
|
57852
57853
|
function parseGoogleInteractionsOutputs$1({ steps, generateId: generateId2, interactionId }) {
|
|
57853
57854
|
var _a$21, _b$13, _c, _d, _e$1, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
@@ -57859,9 +57860,9 @@ function parseGoogleInteractionsOutputs$1({ steps, generateId: generateId2, inte
|
|
|
57859
57860
|
};
|
|
57860
57861
|
for (const step of steps) {
|
|
57861
57862
|
if (step == null || typeof step !== "object") continue;
|
|
57862
|
-
const type = step.type;
|
|
57863
|
-
if (typeof type !== "string") continue;
|
|
57864
|
-
switch (type) {
|
|
57863
|
+
const type$1 = step.type;
|
|
57864
|
+
if (typeof type$1 !== "string") continue;
|
|
57865
|
+
switch (type$1) {
|
|
57865
57866
|
case "user_input": break;
|
|
57866
57867
|
case "model_output": {
|
|
57867
57868
|
const blocks = (_a$21 = step.content) != null ? _a$21 : [];
|
|
@@ -57954,9 +57955,9 @@ function parseGoogleInteractionsOutputs$1({ steps, generateId: generateId2, inte
|
|
|
57954
57955
|
break;
|
|
57955
57956
|
}
|
|
57956
57957
|
default:
|
|
57957
|
-
if (BUILTIN_TOOL_CALL_TYPES2$1.has(type)) {
|
|
57958
|
+
if (BUILTIN_TOOL_CALL_TYPES2$1.has(type$1)) {
|
|
57958
57959
|
const call = step;
|
|
57959
|
-
const toolName = type === "mcp_server_tool_call" ? (_h = call.name) != null ? _h : "mcp_server_tool" : builtinToolNameFromCallType2$1(type);
|
|
57960
|
+
const toolName = type$1 === "mcp_server_tool_call" ? (_h = call.name) != null ? _h : "mcp_server_tool" : builtinToolNameFromCallType2$1(type$1);
|
|
57960
57961
|
const input = JSON.stringify((_i = call.arguments) != null ? _i : {});
|
|
57961
57962
|
content.push({
|
|
57962
57963
|
type: "tool-call",
|
|
@@ -57965,9 +57966,9 @@ function parseGoogleInteractionsOutputs$1({ steps, generateId: generateId2, inte
|
|
|
57965
57966
|
input,
|
|
57966
57967
|
providerExecuted: true
|
|
57967
57968
|
});
|
|
57968
|
-
} else if (BUILTIN_TOOL_RESULT_TYPES2$1.has(type)) {
|
|
57969
|
+
} else if (BUILTIN_TOOL_RESULT_TYPES2$1.has(type$1)) {
|
|
57969
57970
|
const result = step;
|
|
57970
|
-
const toolName = type === "mcp_server_tool_result" ? (_k = result.name) != null ? _k : "mcp_server_tool" : builtinToolNameFromResultType2$1(type);
|
|
57971
|
+
const toolName = type$1 === "mcp_server_tool_result" ? (_k = result.name) != null ? _k : "mcp_server_tool" : builtinToolNameFromResultType2$1(type$1);
|
|
57971
57972
|
content.push({
|
|
57972
57973
|
type: "tool-result",
|
|
57973
57974
|
toolCallId: (_l = result.call_id) != null ? _l : generateId2(),
|
|
@@ -59640,13 +59641,13 @@ function createGoogleVertex(options = {}) {
|
|
|
59640
59641
|
};
|
|
59641
59642
|
return (_b$13 = withoutTrailingSlash$4(options.baseURL)) != null ? _b$13 : `https://${getHost()}/v1beta1/projects/${project$1}/locations/${region}${endpoint ? "" : "/publishers/google"}`;
|
|
59642
59643
|
};
|
|
59643
|
-
const createConfig = (name$
|
|
59644
|
+
const createConfig = (name$16, { endpoint = false } = {}) => {
|
|
59644
59645
|
const getHeaders = async () => {
|
|
59645
59646
|
var _a$21;
|
|
59646
59647
|
return withUserAgentSuffix$2(await resolve$4((_a$21 = options.headers) != null ? _a$21 : {}), `ai-sdk/google-vertex/${VERSION$16}`);
|
|
59647
59648
|
};
|
|
59648
59649
|
return {
|
|
59649
|
-
provider: `google.vertex.${name$
|
|
59650
|
+
provider: `google.vertex.${name$16}`,
|
|
59650
59651
|
headers: getHeaders,
|
|
59651
59652
|
fetch: apiKey ? createExpressModeFetch(apiKey, options.fetch) : options.fetch,
|
|
59652
59653
|
baseURL: loadBaseURL({ endpoint })
|
|
@@ -59934,13 +59935,13 @@ function prepareTools$12({ tools, toolChoice, modelId }) {
|
|
|
59934
59935
|
toolChoice: void 0,
|
|
59935
59936
|
toolWarnings
|
|
59936
59937
|
};
|
|
59937
|
-
const type = toolChoice.type;
|
|
59938
|
-
switch (type) {
|
|
59938
|
+
const type$1 = toolChoice.type;
|
|
59939
|
+
switch (type$1) {
|
|
59939
59940
|
case "auto":
|
|
59940
59941
|
case "none":
|
|
59941
59942
|
case "required": return {
|
|
59942
59943
|
tools: groqTools2,
|
|
59943
|
-
toolChoice: type,
|
|
59944
|
+
toolChoice: type$1,
|
|
59944
59945
|
toolWarnings
|
|
59945
59946
|
};
|
|
59946
59947
|
case "tool": return {
|
|
@@ -59951,7 +59952,7 @@ function prepareTools$12({ tools, toolChoice, modelId }) {
|
|
|
59951
59952
|
},
|
|
59952
59953
|
toolWarnings
|
|
59953
59954
|
};
|
|
59954
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
59955
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
59955
59956
|
}
|
|
59956
59957
|
}
|
|
59957
59958
|
function mapGroqFinishReason(finishReason) {
|
|
@@ -60962,12 +60963,12 @@ function prepareTools$11({ tools, toolChoice }) {
|
|
|
60962
60963
|
toolChoice: void 0,
|
|
60963
60964
|
toolWarnings
|
|
60964
60965
|
};
|
|
60965
|
-
const type = toolChoice.type;
|
|
60966
|
-
switch (type) {
|
|
60966
|
+
const type$1 = toolChoice.type;
|
|
60967
|
+
switch (type$1) {
|
|
60967
60968
|
case "auto":
|
|
60968
60969
|
case "none": return {
|
|
60969
60970
|
tools: mistralTools,
|
|
60970
|
-
toolChoice: type,
|
|
60971
|
+
toolChoice: type$1,
|
|
60971
60972
|
toolWarnings
|
|
60972
60973
|
};
|
|
60973
60974
|
case "required": return {
|
|
@@ -60980,7 +60981,7 @@ function prepareTools$11({ tools, toolChoice }) {
|
|
|
60980
60981
|
toolChoice: "any",
|
|
60981
60982
|
toolWarnings
|
|
60982
60983
|
};
|
|
60983
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
60984
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
60984
60985
|
}
|
|
60985
60986
|
}
|
|
60986
60987
|
var MistralChatLanguageModel = class _MistralChatLanguageModel {
|
|
@@ -61297,8 +61298,8 @@ function extractTextContent$1(content) {
|
|
|
61297
61298
|
if (content == null) return;
|
|
61298
61299
|
const textContent = [];
|
|
61299
61300
|
for (const chunk$1 of content) {
|
|
61300
|
-
const { type } = chunk$1;
|
|
61301
|
-
switch (type) {
|
|
61301
|
+
const { type: type$1 } = chunk$1;
|
|
61302
|
+
switch (type$1) {
|
|
61302
61303
|
case "text":
|
|
61303
61304
|
textContent.push(chunk$1.text);
|
|
61304
61305
|
break;
|
|
@@ -61306,7 +61307,7 @@ function extractTextContent$1(content) {
|
|
|
61306
61307
|
case "image_url":
|
|
61307
61308
|
case "reference": break;
|
|
61308
61309
|
default: {
|
|
61309
|
-
const _exhaustiveCheck = type;
|
|
61310
|
+
const _exhaustiveCheck = type$1;
|
|
61310
61311
|
throw new Error(`Unsupported type: ${_exhaustiveCheck}`);
|
|
61311
61312
|
}
|
|
61312
61313
|
}
|
|
@@ -62359,13 +62360,13 @@ function prepareChatTools$1({ tools, toolChoice }) {
|
|
|
62359
62360
|
toolChoice: void 0,
|
|
62360
62361
|
toolWarnings
|
|
62361
62362
|
};
|
|
62362
|
-
const type = toolChoice.type;
|
|
62363
|
-
switch (type) {
|
|
62363
|
+
const type$1 = toolChoice.type;
|
|
62364
|
+
switch (type$1) {
|
|
62364
62365
|
case "auto":
|
|
62365
62366
|
case "none":
|
|
62366
62367
|
case "required": return {
|
|
62367
62368
|
tools: openaiTools2,
|
|
62368
|
-
toolChoice: type,
|
|
62369
|
+
toolChoice: type$1,
|
|
62369
62370
|
toolWarnings
|
|
62370
62371
|
};
|
|
62371
62372
|
case "tool": return {
|
|
@@ -62376,7 +62377,7 @@ function prepareChatTools$1({ tools, toolChoice }) {
|
|
|
62376
62377
|
},
|
|
62377
62378
|
toolWarnings
|
|
62378
62379
|
};
|
|
62379
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
62380
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
62380
62381
|
}
|
|
62381
62382
|
}
|
|
62382
62383
|
var OpenAIChatLanguageModel$1 = class _OpenAIChatLanguageModel {
|
|
@@ -63994,8 +63995,8 @@ var openaiTools = {
|
|
|
63994
63995
|
function parseOpenAIRealtimeServerEvent(raw) {
|
|
63995
63996
|
var _a$21, _b$13, _c, _d, _e$1, _f, _g, _h, _i, _j, _k, _l, _m, _n$1, _o, _p, _q, _r, _s;
|
|
63996
63997
|
const event = raw;
|
|
63997
|
-
const type = event.type;
|
|
63998
|
-
switch (type) {
|
|
63998
|
+
const type$1 = event.type;
|
|
63999
|
+
switch (type$1) {
|
|
63999
64000
|
case "session.created": return {
|
|
64000
64001
|
type: "session-created",
|
|
64001
64002
|
sessionId: (_a$21 = event.session) == null ? void 0 : _a$21.id,
|
|
@@ -64134,7 +64135,7 @@ function parseOpenAIRealtimeServerEvent(raw) {
|
|
|
64134
64135
|
};
|
|
64135
64136
|
default: return {
|
|
64136
64137
|
type: "custom",
|
|
64137
|
-
rawType: type,
|
|
64138
|
+
rawType: type$1,
|
|
64138
64139
|
raw
|
|
64139
64140
|
};
|
|
64140
64141
|
}
|
|
@@ -66382,11 +66383,11 @@ async function prepareResponsesTools$3({ tools, toolChoice, allowedTools, toolNa
|
|
|
66382
66383
|
toolChoice: {
|
|
66383
66384
|
type: "allowed_tools",
|
|
66384
66385
|
mode: (_b$13 = allowedTools.mode) != null ? _b$13 : "auto",
|
|
66385
|
-
tools: allowedTools.toolNames.map((name$
|
|
66386
|
+
tools: allowedTools.toolNames.map((name$16) => {
|
|
66386
66387
|
var _a2$13;
|
|
66387
66388
|
return {
|
|
66388
66389
|
type: "function",
|
|
66389
|
-
name: (_a2$13 = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name$
|
|
66390
|
+
name: (_a2$13 = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name$16)) != null ? _a2$13 : name$16
|
|
66390
66391
|
};
|
|
66391
66392
|
})
|
|
66392
66393
|
},
|
|
@@ -66397,13 +66398,13 @@ async function prepareResponsesTools$3({ tools, toolChoice, allowedTools, toolNa
|
|
|
66397
66398
|
toolChoice: void 0,
|
|
66398
66399
|
toolWarnings
|
|
66399
66400
|
};
|
|
66400
|
-
const type = toolChoice.type;
|
|
66401
|
-
switch (type) {
|
|
66401
|
+
const type$1 = toolChoice.type;
|
|
66402
|
+
switch (type$1) {
|
|
66402
66403
|
case "auto":
|
|
66403
66404
|
case "none":
|
|
66404
66405
|
case "required": return {
|
|
66405
66406
|
tools: openaiTools2,
|
|
66406
|
-
toolChoice: type,
|
|
66407
|
+
toolChoice: type$1,
|
|
66407
66408
|
toolWarnings
|
|
66408
66409
|
};
|
|
66409
66410
|
case "tool": {
|
|
@@ -66420,7 +66421,7 @@ async function prepareResponsesTools$3({ tools, toolChoice, allowedTools, toolNa
|
|
|
66420
66421
|
toolWarnings
|
|
66421
66422
|
};
|
|
66422
66423
|
}
|
|
66423
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
66424
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
66424
66425
|
}
|
|
66425
66426
|
}
|
|
66426
66427
|
function prepareFunctionTool$1({ tool: tool$7, options }) {
|
|
@@ -70121,12 +70122,12 @@ function prepareTools$10({ tools, toolChoice }) {
|
|
|
70121
70122
|
toolChoice: void 0,
|
|
70122
70123
|
toolWarnings
|
|
70123
70124
|
};
|
|
70124
|
-
const type = toolChoice.type;
|
|
70125
|
-
switch (type) {
|
|
70125
|
+
const type$1 = toolChoice.type;
|
|
70126
|
+
switch (type$1) {
|
|
70126
70127
|
case "auto":
|
|
70127
70128
|
case "none": return {
|
|
70128
70129
|
tools: xaiTools2,
|
|
70129
|
-
toolChoice: type,
|
|
70130
|
+
toolChoice: type$1,
|
|
70130
70131
|
toolWarnings
|
|
70131
70132
|
};
|
|
70132
70133
|
case "required": return {
|
|
@@ -70142,7 +70143,7 @@ function prepareTools$10({ tools, toolChoice }) {
|
|
|
70142
70143
|
},
|
|
70143
70144
|
toolWarnings
|
|
70144
70145
|
};
|
|
70145
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
70146
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
70146
70147
|
}
|
|
70147
70148
|
}
|
|
70148
70149
|
var XaiChatLanguageModel = class _XaiChatLanguageModel {
|
|
@@ -71591,12 +71592,12 @@ async function prepareResponsesTools$2({ tools, toolChoice }) {
|
|
|
71591
71592
|
toolChoice: void 0,
|
|
71592
71593
|
toolWarnings
|
|
71593
71594
|
};
|
|
71594
|
-
const type = toolChoice.type;
|
|
71595
|
-
switch (type) {
|
|
71595
|
+
const type$1 = toolChoice.type;
|
|
71596
|
+
switch (type$1) {
|
|
71596
71597
|
case "auto":
|
|
71597
71598
|
case "none": return {
|
|
71598
71599
|
tools: xaiTools2,
|
|
71599
|
-
toolChoice: type,
|
|
71600
|
+
toolChoice: type$1,
|
|
71600
71601
|
toolWarnings
|
|
71601
71602
|
};
|
|
71602
71603
|
case "required": return {
|
|
@@ -71631,7 +71632,7 @@ async function prepareResponsesTools$2({ tools, toolChoice }) {
|
|
|
71631
71632
|
toolWarnings
|
|
71632
71633
|
};
|
|
71633
71634
|
}
|
|
71634
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
71635
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
71635
71636
|
}
|
|
71636
71637
|
}
|
|
71637
71638
|
var XaiResponsesLanguageModel = class _XaiResponsesLanguageModel {
|
|
@@ -72284,8 +72285,8 @@ var XaiResponsesLanguageModel = class _XaiResponsesLanguageModel {
|
|
|
72284
72285
|
function parseXaiRealtimeServerEvent(raw) {
|
|
72285
72286
|
var _a$21, _b$13, _c, _d, _e$1, _f, _g, _h, _i, _j, _k, _l, _m, _n$1, _o, _p, _q, _r, _s;
|
|
72286
72287
|
const event = raw;
|
|
72287
|
-
const type = event.type;
|
|
72288
|
-
switch (type) {
|
|
72288
|
+
const type$1 = event.type;
|
|
72289
|
+
switch (type$1) {
|
|
72289
72290
|
case "session.created": return {
|
|
72290
72291
|
type: "session-created",
|
|
72291
72292
|
sessionId: (_a$21 = event.session) == null ? void 0 : _a$21.id,
|
|
@@ -72297,7 +72298,7 @@ function parseXaiRealtimeServerEvent(raw) {
|
|
|
72297
72298
|
};
|
|
72298
72299
|
case "conversation.created": return {
|
|
72299
72300
|
type: "custom",
|
|
72300
|
-
rawType: type,
|
|
72301
|
+
rawType: type$1,
|
|
72301
72302
|
raw
|
|
72302
72303
|
};
|
|
72303
72304
|
case "input_audio_buffer.speech_started": return {
|
|
@@ -72430,7 +72431,7 @@ function parseXaiRealtimeServerEvent(raw) {
|
|
|
72430
72431
|
case "response.mcp_call.completed":
|
|
72431
72432
|
case "response.mcp_call.failed": return {
|
|
72432
72433
|
type: "custom",
|
|
72433
|
-
rawType: type,
|
|
72434
|
+
rawType: type$1,
|
|
72434
72435
|
raw
|
|
72435
72436
|
};
|
|
72436
72437
|
case "error": return {
|
|
@@ -72441,7 +72442,7 @@ function parseXaiRealtimeServerEvent(raw) {
|
|
|
72441
72442
|
};
|
|
72442
72443
|
default: return {
|
|
72443
72444
|
type: "custom",
|
|
72444
|
-
rawType: type,
|
|
72445
|
+
rawType: type$1,
|
|
72445
72446
|
raw
|
|
72446
72447
|
};
|
|
72447
72448
|
}
|
|
@@ -73479,11 +73480,11 @@ function buildXaiStreamingTranscriptionUrl({ baseURL, inputAudioFormat, provider
|
|
|
73479
73480
|
function appendSearchParam(url$4, key$1, value) {
|
|
73480
73481
|
if (value != null) url$4.searchParams.set(key$1, String(value));
|
|
73481
73482
|
}
|
|
73482
|
-
function isKnownInputAudioFormat(type) {
|
|
73483
|
-
return type === "audio/pcm" || type === "audio/pcmu" || type === "audio/pcma";
|
|
73483
|
+
function isKnownInputAudioFormat(type$1) {
|
|
73484
|
+
return type$1 === "audio/pcm" || type$1 === "audio/pcmu" || type$1 === "audio/pcma";
|
|
73484
73485
|
}
|
|
73485
|
-
function encodingFromInputAudioFormat(type) {
|
|
73486
|
-
switch (type) {
|
|
73486
|
+
function encodingFromInputAudioFormat(type$1) {
|
|
73487
|
+
switch (type$1) {
|
|
73487
73488
|
case "audio/pcmu": return "mulaw";
|
|
73488
73489
|
case "audio/pcma": return "alaw";
|
|
73489
73490
|
default: return "pcm";
|
|
@@ -74578,9 +74579,9 @@ function parseEnumDef$5(def) {
|
|
|
74578
74579
|
enum: Array.from(def.values)
|
|
74579
74580
|
};
|
|
74580
74581
|
}
|
|
74581
|
-
var isJsonSchema7AllOfType$5 = (type) => {
|
|
74582
|
-
if ("type" in type && type.type === "string") return false;
|
|
74583
|
-
return "allOf" in type;
|
|
74582
|
+
var isJsonSchema7AllOfType$5 = (type$1) => {
|
|
74583
|
+
if ("type" in type$1 && type$1.type === "string") return false;
|
|
74584
|
+
return "allOf" in type$1;
|
|
74584
74585
|
};
|
|
74585
74586
|
function parseIntersectionDef$5(def, refs) {
|
|
74586
74587
|
const allOf = [parseDef$5(def.left._def, {
|
|
@@ -74860,7 +74861,7 @@ function parseRecordDef$5(def, refs) {
|
|
|
74860
74861
|
})) != null ? _a2$13 : refs.allowedAdditionalProperties
|
|
74861
74862
|
};
|
|
74862
74863
|
if (((_b2$9 = def.keyType) == null ? void 0 : _b2$9._def.typeName) === ZodFirstPartyTypeKind$1.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) {
|
|
74863
|
-
const { type,...keyType } = parseStringDef$5(def.keyType._def, refs);
|
|
74864
|
+
const { type: type$1,...keyType } = parseStringDef$5(def.keyType._def, refs);
|
|
74864
74865
|
return {
|
|
74865
74866
|
...schema,
|
|
74866
74867
|
propertyNames: keyType
|
|
@@ -74870,7 +74871,7 @@ function parseRecordDef$5(def, refs) {
|
|
|
74870
74871
|
propertyNames: { enum: def.keyType._def.values }
|
|
74871
74872
|
};
|
|
74872
74873
|
else if (((_e$1 = def.keyType) == null ? void 0 : _e$1._def.typeName) === ZodFirstPartyTypeKind$1.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind$1.ZodString && ((_f = def.keyType._def.type._def.checks) == null ? void 0 : _f.length)) {
|
|
74873
|
-
const { type,...keyType } = parseBrandedDef$5(def.keyType._def, refs);
|
|
74874
|
+
const { type: type$1,...keyType } = parseBrandedDef$5(def.keyType._def, refs);
|
|
74874
74875
|
return {
|
|
74875
74876
|
...schema,
|
|
74876
74877
|
propertyNames: keyType
|
|
@@ -74935,17 +74936,17 @@ function parseUnionDef$5(def, refs) {
|
|
|
74935
74936
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
74936
74937
|
if (options.every((x$2) => x$2._def.typeName in primitiveMappings$4 && (!x$2._def.checks || !x$2._def.checks.length))) {
|
|
74937
74938
|
const types = options.reduce((types2, x$2) => {
|
|
74938
|
-
const type = primitiveMappings$4[x$2._def.typeName];
|
|
74939
|
-
return type && !types2.includes(type) ? [...types2, type] : types2;
|
|
74939
|
+
const type$1 = primitiveMappings$4[x$2._def.typeName];
|
|
74940
|
+
return type$1 && !types2.includes(type$1) ? [...types2, type$1] : types2;
|
|
74940
74941
|
}, []);
|
|
74941
74942
|
return { type: types.length > 1 ? types : types[0] };
|
|
74942
74943
|
} else if (options.every((x$2) => x$2._def.typeName === "ZodLiteral" && !x$2.description)) {
|
|
74943
74944
|
const types = options.reduce((acc, x$2) => {
|
|
74944
|
-
const type = typeof x$2._def.value;
|
|
74945
|
-
switch (type) {
|
|
74945
|
+
const type$1 = typeof x$2._def.value;
|
|
74946
|
+
switch (type$1) {
|
|
74946
74947
|
case "string":
|
|
74947
74948
|
case "number":
|
|
74948
|
-
case "boolean": return [...acc, type];
|
|
74949
|
+
case "boolean": return [...acc, type$1];
|
|
74949
74950
|
case "bigint": return [...acc, "integer"];
|
|
74950
74951
|
case "object": if (x$2._def.value === null) return [...acc, "null"];
|
|
74951
74952
|
case "symbol":
|
|
@@ -76073,13 +76074,13 @@ function prepareTools$9({ tools, toolChoice }) {
|
|
|
76073
76074
|
toolChoice: void 0,
|
|
76074
76075
|
toolWarnings
|
|
76075
76076
|
};
|
|
76076
|
-
const type = toolChoice.type;
|
|
76077
|
-
switch (type) {
|
|
76077
|
+
const type$1 = toolChoice.type;
|
|
76078
|
+
switch (type$1) {
|
|
76078
76079
|
case "auto":
|
|
76079
76080
|
case "none":
|
|
76080
76081
|
case "required": return {
|
|
76081
76082
|
tools: openaiCompatTools,
|
|
76082
|
-
toolChoice: type,
|
|
76083
|
+
toolChoice: type$1,
|
|
76083
76084
|
toolWarnings
|
|
76084
76085
|
};
|
|
76085
76086
|
case "tool": return {
|
|
@@ -76090,7 +76091,7 @@ function prepareTools$9({ tools, toolChoice }) {
|
|
|
76090
76091
|
},
|
|
76091
76092
|
toolWarnings
|
|
76092
76093
|
};
|
|
76093
|
-
default: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type}` });
|
|
76094
|
+
default: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type$1}` });
|
|
76094
76095
|
}
|
|
76095
76096
|
}
|
|
76096
76097
|
var OpenAICompatibleChatLanguageModel$2 = class {
|
|
@@ -76406,8 +76407,8 @@ var OpenAICompatibleChatLanguageModel$2 = class {
|
|
|
76406
76407
|
}
|
|
76407
76408
|
const argumentsDelta = (_j = toolCallDelta.function) == null ? void 0 : _j.arguments;
|
|
76408
76409
|
if (argumentsDelta != null) pending.bufferedArguments += argumentsDelta;
|
|
76409
|
-
const name$
|
|
76410
|
-
if (name$
|
|
76410
|
+
const name$16 = (_k = toolCallDelta.function) == null ? void 0 : _k.name;
|
|
76411
|
+
if (name$16 == null) continue;
|
|
76411
76412
|
pendingToolCalls.delete(index$2);
|
|
76412
76413
|
if (pending.id == null) throw new InvalidResponseDataError({
|
|
76413
76414
|
data: toolCallDelta,
|
|
@@ -76416,13 +76417,13 @@ var OpenAICompatibleChatLanguageModel$2 = class {
|
|
|
76416
76417
|
controller.enqueue({
|
|
76417
76418
|
type: "tool-input-start",
|
|
76418
76419
|
id: pending.id,
|
|
76419
|
-
toolName: name$
|
|
76420
|
+
toolName: name$16
|
|
76420
76421
|
});
|
|
76421
76422
|
toolCalls[index$2] = {
|
|
76422
76423
|
id: pending.id,
|
|
76423
76424
|
type: "function",
|
|
76424
76425
|
function: {
|
|
76425
|
-
name: name$
|
|
76426
|
+
name: name$16,
|
|
76426
76427
|
arguments: pending.bufferedArguments
|
|
76427
76428
|
},
|
|
76428
76429
|
hasFinished: false,
|
|
@@ -79874,11 +79875,11 @@ async function prepareResponsesTools$1({ tools, toolChoice, allowedTools, toolNa
|
|
|
79874
79875
|
toolChoice: {
|
|
79875
79876
|
type: "allowed_tools",
|
|
79876
79877
|
mode: (_b$13 = allowedTools.mode) != null ? _b$13 : "auto",
|
|
79877
|
-
tools: allowedTools.toolNames.map((name$
|
|
79878
|
+
tools: allowedTools.toolNames.map((name$16) => {
|
|
79878
79879
|
var _a2$13;
|
|
79879
79880
|
return {
|
|
79880
79881
|
type: "function",
|
|
79881
|
-
name: (_a2$13 = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name$
|
|
79882
|
+
name: (_a2$13 = toolNameMapping == null ? void 0 : toolNameMapping.toProviderToolName(name$16)) != null ? _a2$13 : name$16
|
|
79882
79883
|
};
|
|
79883
79884
|
})
|
|
79884
79885
|
},
|
|
@@ -79889,13 +79890,13 @@ async function prepareResponsesTools$1({ tools, toolChoice, allowedTools, toolNa
|
|
|
79889
79890
|
toolChoice: void 0,
|
|
79890
79891
|
toolWarnings
|
|
79891
79892
|
};
|
|
79892
|
-
const type = toolChoice.type;
|
|
79893
|
-
switch (type) {
|
|
79893
|
+
const type$1 = toolChoice.type;
|
|
79894
|
+
switch (type$1) {
|
|
79894
79895
|
case "auto":
|
|
79895
79896
|
case "none":
|
|
79896
79897
|
case "required": return {
|
|
79897
79898
|
tools: openaiTools$1,
|
|
79898
|
-
toolChoice: type,
|
|
79899
|
+
toolChoice: type$1,
|
|
79899
79900
|
toolWarnings
|
|
79900
79901
|
};
|
|
79901
79902
|
case "tool": {
|
|
@@ -79912,7 +79913,7 @@ async function prepareResponsesTools$1({ tools, toolChoice, allowedTools, toolNa
|
|
|
79912
79913
|
toolWarnings
|
|
79913
79914
|
};
|
|
79914
79915
|
}
|
|
79915
|
-
default: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type}` });
|
|
79916
|
+
default: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type$1}` });
|
|
79916
79917
|
}
|
|
79917
79918
|
}
|
|
79918
79919
|
function prepareFunctionTool({ tool: tool$7, options }) {
|
|
@@ -82701,8 +82702,8 @@ async function prepareTools$8({ tools, toolChoice, disableParallelToolUse, cache
|
|
|
82701
82702
|
toolWarnings,
|
|
82702
82703
|
betas
|
|
82703
82704
|
};
|
|
82704
|
-
const type = toolChoice.type;
|
|
82705
|
-
switch (type) {
|
|
82705
|
+
const type$1 = toolChoice.type;
|
|
82706
|
+
switch (type$1) {
|
|
82706
82707
|
case "auto": return {
|
|
82707
82708
|
tools: anthropicTools2,
|
|
82708
82709
|
toolChoice: {
|
|
@@ -82737,7 +82738,7 @@ async function prepareTools$8({ tools, toolChoice, disableParallelToolUse, cache
|
|
|
82737
82738
|
toolWarnings,
|
|
82738
82739
|
betas
|
|
82739
82740
|
};
|
|
82740
|
-
default: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type}` });
|
|
82741
|
+
default: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type$1}` });
|
|
82741
82742
|
}
|
|
82742
82743
|
}
|
|
82743
82744
|
function convertAnthropicMessagesUsage$1({ usage, rawUsage }) {
|
|
@@ -83045,8 +83046,8 @@ async function convertToAnthropicMessagesPrompt$1({ prompt, sendReasoning, warni
|
|
|
83045
83046
|
for (let i$5 = 0; i$5 < blocks.length; i$5++) {
|
|
83046
83047
|
const block = blocks[i$5];
|
|
83047
83048
|
const isLastBlock = i$5 === blocks.length - 1;
|
|
83048
|
-
const type = block.type;
|
|
83049
|
-
switch (type) {
|
|
83049
|
+
const type$1 = block.type;
|
|
83050
|
+
switch (type$1) {
|
|
83050
83051
|
case "system": {
|
|
83051
83052
|
const content = [];
|
|
83052
83053
|
let toolChangeCount = 0;
|
|
@@ -83740,7 +83741,7 @@ async function convertToAnthropicMessagesPrompt$1({ prompt, sendReasoning, warni
|
|
|
83740
83741
|
break;
|
|
83741
83742
|
}
|
|
83742
83743
|
default: {
|
|
83743
|
-
const _exhaustiveCheck = type;
|
|
83744
|
+
const _exhaustiveCheck = type$1;
|
|
83744
83745
|
throw new Error(`content type: ${_exhaustiveCheck}`);
|
|
83745
83746
|
}
|
|
83746
83747
|
}
|
|
@@ -83884,13 +83885,13 @@ function sanitizeSchema(schema) {
|
|
|
83884
83885
|
if (schema.anyOf != null) result.anyOf = schema.anyOf.map(sanitizeDefinition);
|
|
83885
83886
|
else if (schema.oneOf != null) result.anyOf = schema.oneOf.map(sanitizeDefinition);
|
|
83886
83887
|
if (schema.allOf != null) result.allOf = schema.allOf.map(sanitizeDefinition);
|
|
83887
|
-
if (schema.definitions != null) result.definitions = Object.fromEntries(Object.entries(schema.definitions).map(([name$
|
|
83888
|
+
if (schema.definitions != null) result.definitions = Object.fromEntries(Object.entries(schema.definitions).map(([name$16, definition]) => [name$16, sanitizeDefinition(definition)]));
|
|
83888
83889
|
if (schemaWithDefs.$defs != null) {
|
|
83889
83890
|
const resultWithDefs = result;
|
|
83890
|
-
resultWithDefs.$defs = Object.fromEntries(Object.entries(schemaWithDefs.$defs).map(([name$
|
|
83891
|
+
resultWithDefs.$defs = Object.fromEntries(Object.entries(schemaWithDefs.$defs).map(([name$16, definition]) => [name$16, sanitizeDefinition(definition)]));
|
|
83891
83892
|
}
|
|
83892
83893
|
if (schema.type === "object" || schema.properties != null) {
|
|
83893
|
-
if (schema.properties != null) result.properties = Object.fromEntries(Object.entries(schema.properties).map(([name$
|
|
83894
|
+
if (schema.properties != null) result.properties = Object.fromEntries(Object.entries(schema.properties).map(([name$16, definition]) => [name$16, sanitizeDefinition(definition)]));
|
|
83894
83895
|
result.additionalProperties = false;
|
|
83895
83896
|
if (schema.required != null) result.required = schema.required;
|
|
83896
83897
|
}
|
|
@@ -85823,21 +85824,21 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema$7, isRoot = true) {
|
|
|
85823
85824
|
type: "boolean",
|
|
85824
85825
|
properties: {}
|
|
85825
85826
|
};
|
|
85826
|
-
const { type, description, required: required$4, properties, items, allOf, anyOf, oneOf, format: format$1, const: constValue, minLength, enum: enumValues } = jsonSchema$7;
|
|
85827
|
+
const { type: type$1, description, required: required$4, properties, items, allOf, anyOf, oneOf, format: format$1, const: constValue, minLength, enum: enumValues } = jsonSchema$7;
|
|
85827
85828
|
const result = {};
|
|
85828
85829
|
if (description) result.description = description;
|
|
85829
85830
|
if (required$4) result.required = required$4;
|
|
85830
85831
|
if (format$1) result.format = format$1;
|
|
85831
85832
|
if (constValue !== void 0) result.enum = [constValue];
|
|
85832
|
-
if (type) if (Array.isArray(type)) {
|
|
85833
|
-
const hasNull = type.includes("null");
|
|
85834
|
-
const nonNullTypes = type.filter((t$1) => t$1 !== "null");
|
|
85833
|
+
if (type$1) if (Array.isArray(type$1)) {
|
|
85834
|
+
const hasNull = type$1.includes("null");
|
|
85835
|
+
const nonNullTypes = type$1.filter((t$1) => t$1 !== "null");
|
|
85835
85836
|
if (nonNullTypes.length === 0) result.type = "null";
|
|
85836
85837
|
else {
|
|
85837
85838
|
result.anyOf = nonNullTypes.map((t$1) => ({ type: t$1 }));
|
|
85838
85839
|
if (hasNull) result.nullable = true;
|
|
85839
85840
|
}
|
|
85840
|
-
} else result.type = type;
|
|
85841
|
+
} else result.type = type$1;
|
|
85841
85842
|
if (enumValues !== void 0) result.enum = enumValues;
|
|
85842
85843
|
if (properties != null) result.properties = Object.entries(properties).reduce((acc, [key$1, value]) => {
|
|
85843
85844
|
acc[key$1] = convertJSONSchemaToOpenAPISchema(value, false);
|
|
@@ -86127,7 +86128,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
86127
86128
|
const uniqueToolNames = Array.from(new Set(missingSignatureToolNames));
|
|
86128
86129
|
onWarning({
|
|
86129
86130
|
type: "other",
|
|
86130
|
-
message: `Replayed ${missingSignatureToolNames.length} \`functionCall\` part(s) for a Gemini 3 model without a \`thoughtSignature\` (tools: ${uniqueToolNames.map((name$
|
|
86131
|
+
message: `Replayed ${missingSignatureToolNames.length} \`functionCall\` part(s) for a Gemini 3 model without a \`thoughtSignature\` (tools: ${uniqueToolNames.map((name$16) => `\`${name$16}\``).join(", ")}). Injected the documented \`skip_thought_signature_validator\` sentinel to keep the request from failing with HTTP 400. The likely cause is application code that drops \`providerOptions.google.thoughtSignature\` when persisting or serializing assistant tool-call messages. See https://ai.google.dev/gemini-api/docs/thought-signatures.`
|
|
86131
86132
|
});
|
|
86132
86133
|
}
|
|
86133
86134
|
return {
|
|
@@ -86416,8 +86417,8 @@ function prepareTools$7({ tools, toolChoice, modelId, isVertexProvider = false }
|
|
|
86416
86417
|
toolConfig: hasStrictTools ? { functionCallingConfig: { mode: "VALIDATED" } } : void 0,
|
|
86417
86418
|
toolWarnings
|
|
86418
86419
|
};
|
|
86419
|
-
const type = toolChoice.type;
|
|
86420
|
-
switch (type) {
|
|
86420
|
+
const type$1 = toolChoice.type;
|
|
86421
|
+
switch (type$1) {
|
|
86421
86422
|
case "auto": return {
|
|
86422
86423
|
tools: [{ functionDeclarations }],
|
|
86423
86424
|
toolConfig: { functionCallingConfig: { mode: hasStrictTools ? "VALIDATED" : "AUTO" } },
|
|
@@ -86441,7 +86442,7 @@ function prepareTools$7({ tools, toolChoice, modelId, isVertexProvider = false }
|
|
|
86441
86442
|
} },
|
|
86442
86443
|
toolWarnings
|
|
86443
86444
|
};
|
|
86444
|
-
default: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type}` });
|
|
86445
|
+
default: throw new UnsupportedFunctionalityError({ functionality: `tool choice type: ${type$1}` });
|
|
86445
86446
|
}
|
|
86446
86447
|
}
|
|
86447
86448
|
var GoogleJSONAccumulator = class {
|
|
@@ -89263,9 +89264,9 @@ function parseEnumDef$4(def) {
|
|
|
89263
89264
|
enum: Array.from(def.values)
|
|
89264
89265
|
};
|
|
89265
89266
|
}
|
|
89266
|
-
var isJsonSchema7AllOfType$4 = (type) => {
|
|
89267
|
-
if ("type" in type && type.type === "string") return false;
|
|
89268
|
-
return "allOf" in type;
|
|
89267
|
+
var isJsonSchema7AllOfType$4 = (type$1) => {
|
|
89268
|
+
if ("type" in type$1 && type$1.type === "string") return false;
|
|
89269
|
+
return "allOf" in type$1;
|
|
89269
89270
|
};
|
|
89270
89271
|
function parseIntersectionDef$4(def, refs) {
|
|
89271
89272
|
const allOf = [parseDef$4(def.left._def, {
|
|
@@ -89620,17 +89621,17 @@ function parseUnionDef$4(def, refs) {
|
|
|
89620
89621
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
89621
89622
|
if (options.every((x$2) => x$2._def.typeName in primitiveMappings$3 && (!x$2._def.checks || !x$2._def.checks.length))) {
|
|
89622
89623
|
const types = options.reduce((types2, x$2) => {
|
|
89623
|
-
const type = primitiveMappings$3[x$2._def.typeName];
|
|
89624
|
-
return type && !types2.includes(type) ? [...types2, type] : types2;
|
|
89624
|
+
const type$1 = primitiveMappings$3[x$2._def.typeName];
|
|
89625
|
+
return type$1 && !types2.includes(type$1) ? [...types2, type$1] : types2;
|
|
89625
89626
|
}, []);
|
|
89626
89627
|
return { type: types.length > 1 ? types : types[0] };
|
|
89627
89628
|
} else if (options.every((x$2) => x$2._def.typeName === "ZodLiteral" && !x$2.description)) {
|
|
89628
89629
|
const types = options.reduce((acc, x$2) => {
|
|
89629
|
-
const type = typeof x$2._def.value;
|
|
89630
|
-
switch (type) {
|
|
89630
|
+
const type$1 = typeof x$2._def.value;
|
|
89631
|
+
switch (type$1) {
|
|
89631
89632
|
case "string":
|
|
89632
89633
|
case "number":
|
|
89633
|
-
case "boolean": return [...acc, type];
|
|
89634
|
+
case "boolean": return [...acc, type$1];
|
|
89634
89635
|
case "bigint": return [...acc, "integer"];
|
|
89635
89636
|
case "object": if (x$2._def.value === null) return [...acc, "null"];
|
|
89636
89637
|
case "symbol":
|
|
@@ -90438,9 +90439,9 @@ var createJsonResponseHandler$6 = (responseSchema$3) => async ({ response, url:
|
|
|
90438
90439
|
};
|
|
90439
90440
|
function isJSONSerializable(value) {
|
|
90440
90441
|
if (value === null || value === void 0) return true;
|
|
90441
|
-
const type = typeof value;
|
|
90442
|
-
if (type === "string" || type === "number" || type === "boolean") return true;
|
|
90443
|
-
if (type === "function" || type === "symbol" || type === "bigint") return false;
|
|
90442
|
+
const type$1 = typeof value;
|
|
90443
|
+
if (type$1 === "string" || type$1 === "number" || type$1 === "boolean") return true;
|
|
90444
|
+
if (type$1 === "function" || type$1 === "symbol" || type$1 === "bigint") return false;
|
|
90444
90445
|
if (Array.isArray(value)) return value.every(isJSONSerializable);
|
|
90445
90446
|
if (Object.getPrototypeOf(value) === Object.prototype) return Object.values(value).every(isJSONSerializable);
|
|
90446
90447
|
return false;
|
|
@@ -91731,13 +91732,13 @@ function prepareTools$4({ tools, toolChoice }) {
|
|
|
91731
91732
|
toolChoice: void 0,
|
|
91732
91733
|
toolWarnings
|
|
91733
91734
|
};
|
|
91734
|
-
const type = toolChoice.type;
|
|
91735
|
-
switch (type) {
|
|
91735
|
+
const type$1 = toolChoice.type;
|
|
91736
|
+
switch (type$1) {
|
|
91736
91737
|
case "auto":
|
|
91737
91738
|
case "none":
|
|
91738
91739
|
case "required": return {
|
|
91739
91740
|
tools: openaiCompatTools,
|
|
91740
|
-
toolChoice: type,
|
|
91741
|
+
toolChoice: type$1,
|
|
91741
91742
|
toolWarnings
|
|
91742
91743
|
};
|
|
91743
91744
|
case "tool": return {
|
|
@@ -91748,7 +91749,7 @@ function prepareTools$4({ tools, toolChoice }) {
|
|
|
91748
91749
|
},
|
|
91749
91750
|
toolWarnings
|
|
91750
91751
|
};
|
|
91751
|
-
default: throw new UnsupportedFunctionalityError$7({ functionality: `tool choice type: ${type}` });
|
|
91752
|
+
default: throw new UnsupportedFunctionalityError$7({ functionality: `tool choice type: ${type$1}` });
|
|
91752
91753
|
}
|
|
91753
91754
|
}
|
|
91754
91755
|
function isRecord(value) {
|
|
@@ -92599,9 +92600,9 @@ function createFriendli(options = {}) {
|
|
|
92599
92600
|
}
|
|
92600
92601
|
};
|
|
92601
92602
|
const createLanguageModel = (modelId) => {
|
|
92602
|
-
const { baseURL, type } = baseURLAutoSelect(modelId, options.baseURL);
|
|
92603
|
+
const { baseURL, type: type$1 } = baseURLAutoSelect(modelId, options.baseURL);
|
|
92603
92604
|
return new FriendliAIChatLanguageModel(modelId, {
|
|
92604
|
-
provider: `friendliai.${type}.chat`,
|
|
92605
|
+
provider: `friendliai.${type$1}.chat`,
|
|
92605
92606
|
url: ({ path: path$4 }) => `${baseURL}${path$4}`,
|
|
92606
92607
|
headers: getHeaders,
|
|
92607
92608
|
fetch: options.fetch,
|
|
@@ -92609,9 +92610,9 @@ function createFriendli(options = {}) {
|
|
|
92609
92610
|
});
|
|
92610
92611
|
};
|
|
92611
92612
|
const createCompletionModel = (modelId) => {
|
|
92612
|
-
const { baseURL, type } = baseURLAutoSelect(modelId, options.baseURL);
|
|
92613
|
+
const { baseURL, type: type$1 } = baseURLAutoSelect(modelId, options.baseURL);
|
|
92613
92614
|
return new OpenAICompatibleCompletionLanguageModel$1(modelId, {
|
|
92614
|
-
provider: `friendliai.${type}.completion`,
|
|
92615
|
+
provider: `friendliai.${type$1}.completion`,
|
|
92615
92616
|
url: ({ path: path$4 }) => `${baseURL}${path$4}`,
|
|
92616
92617
|
headers: getHeaders,
|
|
92617
92618
|
fetch: options.fetch,
|
|
@@ -98250,9 +98251,9 @@ function parseEnumDef$3(def) {
|
|
|
98250
98251
|
enum: Array.from(def.values)
|
|
98251
98252
|
};
|
|
98252
98253
|
}
|
|
98253
|
-
var isJsonSchema7AllOfType$3 = (type) => {
|
|
98254
|
-
if ("type" in type && type.type === "string") return false;
|
|
98255
|
-
return "allOf" in type;
|
|
98254
|
+
var isJsonSchema7AllOfType$3 = (type$1) => {
|
|
98255
|
+
if ("type" in type$1 && type$1.type === "string") return false;
|
|
98256
|
+
return "allOf" in type$1;
|
|
98256
98257
|
};
|
|
98257
98258
|
function parseIntersectionDef$3(def, refs) {
|
|
98258
98259
|
const allOf = [parseDef$3(def.left._def, __spreadProps(__spreadValues({}, refs), { currentPath: [
|
|
@@ -98577,17 +98578,17 @@ function parseUnionDef$3(def, refs) {
|
|
|
98577
98578
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
98578
98579
|
if (options.every((x$2) => x$2._def.typeName in primitiveMappings$2 && (!x$2._def.checks || !x$2._def.checks.length))) {
|
|
98579
98580
|
const types = options.reduce((types2, x$2) => {
|
|
98580
|
-
const type = primitiveMappings$2[x$2._def.typeName];
|
|
98581
|
-
return type && !types2.includes(type) ? [...types2, type] : types2;
|
|
98581
|
+
const type$1 = primitiveMappings$2[x$2._def.typeName];
|
|
98582
|
+
return type$1 && !types2.includes(type$1) ? [...types2, type$1] : types2;
|
|
98582
98583
|
}, []);
|
|
98583
98584
|
return { type: types.length > 1 ? types : types[0] };
|
|
98584
98585
|
} else if (options.every((x$2) => x$2._def.typeName === "ZodLiteral" && !x$2.description)) {
|
|
98585
98586
|
const types = options.reduce((acc, x$2) => {
|
|
98586
|
-
const type = typeof x$2._def.value;
|
|
98587
|
-
switch (type) {
|
|
98587
|
+
const type$1 = typeof x$2._def.value;
|
|
98588
|
+
switch (type$1) {
|
|
98588
98589
|
case "string":
|
|
98589
98590
|
case "number":
|
|
98590
|
-
case "boolean": return [...acc, type];
|
|
98591
|
+
case "boolean": return [...acc, type$1];
|
|
98591
98592
|
case "bigint": return [...acc, "integer"];
|
|
98592
98593
|
case "object": if (x$2._def.value === null) return [...acc, "null"];
|
|
98593
98594
|
case "symbol":
|
|
@@ -101979,10 +101980,10 @@ var require_fetch_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
101979
101980
|
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
|
|
101980
101981
|
};
|
|
101981
101982
|
}
|
|
101982
|
-
function normalizeName(name$
|
|
101983
|
-
if (typeof name$
|
|
101984
|
-
if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name$
|
|
101985
|
-
return name$
|
|
101983
|
+
function normalizeName(name$16) {
|
|
101984
|
+
if (typeof name$16 !== "string") name$16 = String(name$16);
|
|
101985
|
+
if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name$16) || name$16 === "") throw new TypeError("Invalid character in header field name: \"" + name$16 + "\"");
|
|
101986
|
+
return name$16.toLowerCase();
|
|
101986
101987
|
}
|
|
101987
101988
|
function normalizeValue(value) {
|
|
101988
101989
|
if (typeof value !== "string") value = String(value);
|
|
@@ -102003,43 +102004,43 @@ var require_fetch_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
102003
102004
|
}
|
|
102004
102005
|
function Headers$1(headers) {
|
|
102005
102006
|
this.map = {};
|
|
102006
|
-
if (headers instanceof Headers$1) headers.forEach(function(value, name$
|
|
102007
|
-
this.append(name$
|
|
102007
|
+
if (headers instanceof Headers$1) headers.forEach(function(value, name$16) {
|
|
102008
|
+
this.append(name$16, value);
|
|
102008
102009
|
}, this);
|
|
102009
102010
|
else if (Array.isArray(headers)) headers.forEach(function(header) {
|
|
102010
102011
|
if (header.length != 2) throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + header.length);
|
|
102011
102012
|
this.append(header[0], header[1]);
|
|
102012
102013
|
}, this);
|
|
102013
|
-
else if (headers) Object.getOwnPropertyNames(headers).forEach(function(name$
|
|
102014
|
-
this.append(name$
|
|
102014
|
+
else if (headers) Object.getOwnPropertyNames(headers).forEach(function(name$16) {
|
|
102015
|
+
this.append(name$16, headers[name$16]);
|
|
102015
102016
|
}, this);
|
|
102016
102017
|
}
|
|
102017
|
-
Headers$1.prototype.append = function(name$
|
|
102018
|
-
name$
|
|
102018
|
+
Headers$1.prototype.append = function(name$16, value) {
|
|
102019
|
+
name$16 = normalizeName(name$16);
|
|
102019
102020
|
value = normalizeValue(value);
|
|
102020
|
-
var oldValue = this.map[name$
|
|
102021
|
-
this.map[name$
|
|
102021
|
+
var oldValue = this.map[name$16];
|
|
102022
|
+
this.map[name$16] = oldValue ? oldValue + ", " + value : value;
|
|
102022
102023
|
};
|
|
102023
|
-
Headers$1.prototype["delete"] = function(name$
|
|
102024
|
-
delete this.map[normalizeName(name$
|
|
102024
|
+
Headers$1.prototype["delete"] = function(name$16) {
|
|
102025
|
+
delete this.map[normalizeName(name$16)];
|
|
102025
102026
|
};
|
|
102026
|
-
Headers$1.prototype.get = function(name$
|
|
102027
|
-
name$
|
|
102028
|
-
return this.has(name$
|
|
102027
|
+
Headers$1.prototype.get = function(name$16) {
|
|
102028
|
+
name$16 = normalizeName(name$16);
|
|
102029
|
+
return this.has(name$16) ? this.map[name$16] : null;
|
|
102029
102030
|
};
|
|
102030
|
-
Headers$1.prototype.has = function(name$
|
|
102031
|
-
return this.map.hasOwnProperty(normalizeName(name$
|
|
102031
|
+
Headers$1.prototype.has = function(name$16) {
|
|
102032
|
+
return this.map.hasOwnProperty(normalizeName(name$16));
|
|
102032
102033
|
};
|
|
102033
|
-
Headers$1.prototype.set = function(name$
|
|
102034
|
-
this.map[normalizeName(name$
|
|
102034
|
+
Headers$1.prototype.set = function(name$16, value) {
|
|
102035
|
+
this.map[normalizeName(name$16)] = normalizeValue(value);
|
|
102035
102036
|
};
|
|
102036
102037
|
Headers$1.prototype.forEach = function(callback, thisArg) {
|
|
102037
|
-
for (var name$
|
|
102038
|
+
for (var name$16 in this.map) if (this.map.hasOwnProperty(name$16)) callback.call(thisArg, this.map[name$16], name$16, this);
|
|
102038
102039
|
};
|
|
102039
102040
|
Headers$1.prototype.keys = function() {
|
|
102040
102041
|
var items = [];
|
|
102041
|
-
this.forEach(function(value, name$
|
|
102042
|
-
items.push(name$
|
|
102042
|
+
this.forEach(function(value, name$16) {
|
|
102043
|
+
items.push(name$16);
|
|
102043
102044
|
});
|
|
102044
102045
|
return iteratorFor(items);
|
|
102045
102046
|
};
|
|
@@ -102052,8 +102053,8 @@ var require_fetch_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
102052
102053
|
};
|
|
102053
102054
|
Headers$1.prototype.entries = function() {
|
|
102054
102055
|
var items = [];
|
|
102055
|
-
this.forEach(function(value, name$
|
|
102056
|
-
items.push([name$
|
|
102056
|
+
this.forEach(function(value, name$16) {
|
|
102057
|
+
items.push([name$16, value]);
|
|
102057
102058
|
});
|
|
102058
102059
|
return iteratorFor(items);
|
|
102059
102060
|
};
|
|
@@ -102215,9 +102216,9 @@ var require_fetch_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
102215
102216
|
body.trim().split("&").forEach(function(bytes) {
|
|
102216
102217
|
if (bytes) {
|
|
102217
102218
|
var split$1 = bytes.split("=");
|
|
102218
|
-
var name$
|
|
102219
|
+
var name$16 = split$1.shift().replace(/\+/g, " ");
|
|
102219
102220
|
var value = split$1.join("=").replace(/\+/g, " ");
|
|
102220
|
-
form.append(decodeURIComponent(name$
|
|
102221
|
+
form.append(decodeURIComponent(name$16), decodeURIComponent(value));
|
|
102221
102222
|
}
|
|
102222
102223
|
});
|
|
102223
102224
|
return form;
|
|
@@ -102290,9 +102291,9 @@ var require_fetch_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
102290
102291
|
try {
|
|
102291
102292
|
new exports$1.DOMException();
|
|
102292
102293
|
} catch (err) {
|
|
102293
|
-
exports$1.DOMException = function(message, name$
|
|
102294
|
+
exports$1.DOMException = function(message, name$16) {
|
|
102294
102295
|
this.message = message;
|
|
102295
|
-
this.name = name$
|
|
102296
|
+
this.name = name$16;
|
|
102296
102297
|
this.stack = Error(message).stack;
|
|
102297
102298
|
};
|
|
102298
102299
|
exports$1.DOMException.prototype = Object.create(Error.prototype);
|
|
@@ -102350,15 +102351,15 @@ var require_fetch_umd = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
102350
102351
|
}
|
|
102351
102352
|
if (init$1 && typeof init$1.headers === "object" && !(init$1.headers instanceof Headers$1 || g$1.Headers && init$1.headers instanceof g$1.Headers)) {
|
|
102352
102353
|
var names = [];
|
|
102353
|
-
Object.getOwnPropertyNames(init$1.headers).forEach(function(name$
|
|
102354
|
-
names.push(normalizeName(name$
|
|
102355
|
-
xhr.setRequestHeader(name$
|
|
102354
|
+
Object.getOwnPropertyNames(init$1.headers).forEach(function(name$16) {
|
|
102355
|
+
names.push(normalizeName(name$16));
|
|
102356
|
+
xhr.setRequestHeader(name$16, normalizeValue(init$1.headers[name$16]));
|
|
102356
102357
|
});
|
|
102357
|
-
request$1.headers.forEach(function(value, name$
|
|
102358
|
-
if (names.indexOf(name$
|
|
102358
|
+
request$1.headers.forEach(function(value, name$16) {
|
|
102359
|
+
if (names.indexOf(name$16) === -1) xhr.setRequestHeader(name$16, value);
|
|
102359
102360
|
});
|
|
102360
|
-
} else request$1.headers.forEach(function(value, name$
|
|
102361
|
-
xhr.setRequestHeader(name$
|
|
102361
|
+
} else request$1.headers.forEach(function(value, name$16) {
|
|
102362
|
+
xhr.setRequestHeader(name$16, value);
|
|
102362
102363
|
});
|
|
102363
102364
|
if (request$1.signal) {
|
|
102364
102365
|
request$1.signal.addEventListener("abort", abortXhr);
|
|
@@ -103245,10 +103246,10 @@ function jsonrepair(text$1) {
|
|
|
103245
103246
|
function parseKeywords() {
|
|
103246
103247
|
return parseKeyword("true", "true") || parseKeyword("false", "false") || parseKeyword("null", "null") || parseKeyword("True", "true") || parseKeyword("False", "false") || parseKeyword("None", "null");
|
|
103247
103248
|
}
|
|
103248
|
-
function parseKeyword(name$
|
|
103249
|
-
if (text$1.slice(i$5, i$5 + name$
|
|
103249
|
+
function parseKeyword(name$16, value) {
|
|
103250
|
+
if (text$1.slice(i$5, i$5 + name$16.length) === name$16 && !isFunctionNameChar(text$1[i$5 + name$16.length])) {
|
|
103250
103251
|
output += value;
|
|
103251
|
-
i$5 += name$
|
|
103252
|
+
i$5 += name$16.length;
|
|
103252
103253
|
return true;
|
|
103253
103254
|
}
|
|
103254
103255
|
return false;
|
|
@@ -103330,8 +103331,8 @@ var require_get_context = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
103330
103331
|
var __getOwnPropNames$8 = Object.getOwnPropertyNames;
|
|
103331
103332
|
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
103332
103333
|
var __export$11 = (target, all) => {
|
|
103333
|
-
for (var name$
|
|
103334
|
-
get: all[name$
|
|
103334
|
+
for (var name$16 in all) __defProp$11(target, name$16, {
|
|
103335
|
+
get: all[name$16],
|
|
103335
103336
|
enumerable: true
|
|
103336
103337
|
});
|
|
103337
103338
|
};
|
|
@@ -103364,8 +103365,8 @@ var require_get_vercel_oidc_token = /* @__PURE__ */ __commonJSMin(((exports, mod
|
|
|
103364
103365
|
Object.getPrototypeOf;
|
|
103365
103366
|
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
103366
103367
|
var __export$10 = (target, all) => {
|
|
103367
|
-
for (var name$
|
|
103368
|
-
get: all[name$
|
|
103368
|
+
for (var name$16 in all) __defProp$10(target, name$16, {
|
|
103369
|
+
get: all[name$16],
|
|
103369
103370
|
enumerable: true
|
|
103370
103371
|
});
|
|
103371
103372
|
};
|
|
@@ -103422,8 +103423,8 @@ var require_dist$8 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
103422
103423
|
var __getOwnPropNames$6 = Object.getOwnPropertyNames;
|
|
103423
103424
|
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
103424
103425
|
var __export$9 = (target, all) => {
|
|
103425
|
-
for (var name$
|
|
103426
|
-
get: all[name$
|
|
103426
|
+
for (var name$16 in all) __defProp$9(target, name$16, {
|
|
103427
|
+
get: all[name$16],
|
|
103427
103428
|
enumerable: true
|
|
103428
103429
|
});
|
|
103429
103430
|
};
|
|
@@ -105800,8 +105801,8 @@ function formatWarning({ warning, provider, model }) {
|
|
|
105800
105801
|
}
|
|
105801
105802
|
var FIRST_WARNING_INFO_MESSAGE = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.";
|
|
105802
105803
|
var hasLoggedBefore = false;
|
|
105803
|
-
function emitWarning({ message, type }) {
|
|
105804
|
-
if (typeof process !== "undefined" && typeof process.emitWarning === "function") process.emitWarning(message, { type });
|
|
105804
|
+
function emitWarning({ message, type: type$1 }) {
|
|
105805
|
+
if (typeof process !== "undefined" && typeof process.emitWarning === "function") process.emitWarning(message, { type: type$1 });
|
|
105805
105806
|
else console.warn(message);
|
|
105806
105807
|
}
|
|
105807
105808
|
var logWarnings = (options) => {
|
|
@@ -106123,8 +106124,8 @@ function splitDataUrl(dataUrl) {
|
|
|
106123
106124
|
}
|
|
106124
106125
|
function isTaggedFileData(value) {
|
|
106125
106126
|
if (typeof value !== "object" || value === null) return false;
|
|
106126
|
-
const type = value.type;
|
|
106127
|
-
return type === "data" || type === "url" || type === "reference" || type === "text";
|
|
106127
|
+
const type$1 = value.type;
|
|
106128
|
+
return type$1 === "data" || type$1 === "url" || type$1 === "reference" || type$1 === "text";
|
|
106128
106129
|
}
|
|
106129
106130
|
function convertUrlToFilePartData(url$4) {
|
|
106130
106131
|
if (url$4.protocol === "data:") {
|
|
@@ -108366,13 +108367,13 @@ function createTelemetryDispatcher({ telemetry }) {
|
|
|
108366
108367
|
return (_a23 = integration.executeTool) == null ? void 0 : _a23.bind(integration);
|
|
108367
108368
|
}).filter(Boolean);
|
|
108368
108369
|
return {
|
|
108369
|
-
runInTracingChannelSpan: async ({ type, event, execute }) => await runWithTracingChannelSpan({
|
|
108370
|
-
type,
|
|
108370
|
+
runInTracingChannelSpan: async ({ type: type$1, event, execute }) => await runWithTracingChannelSpan({
|
|
108371
|
+
type: type$1,
|
|
108371
108372
|
event: augmentEvent(event, telemetryMetadata)
|
|
108372
108373
|
}, execute),
|
|
108373
|
-
startTracingChannelContext: ({ type, event, completion }) => openTelemetryChannelSpanContext({
|
|
108374
|
+
startTracingChannelContext: ({ type: type$1, event, completion }) => openTelemetryChannelSpanContext({
|
|
108374
108375
|
message: {
|
|
108375
|
-
type,
|
|
108376
|
+
type: type$1,
|
|
108376
108377
|
event: augmentEvent(event, telemetryMetadata)
|
|
108377
108378
|
},
|
|
108378
108379
|
completion
|
|
@@ -110441,8 +110442,8 @@ createDownload();
|
|
|
110441
110442
|
init_defineProperty();
|
|
110442
110443
|
var __defProp$7 = Object.defineProperty;
|
|
110443
110444
|
var __export$7 = (target, all) => {
|
|
110444
|
-
for (var name$
|
|
110445
|
-
get: all[name$
|
|
110445
|
+
for (var name$16 in all) __defProp$7(target, name$16, {
|
|
110446
|
+
get: all[name$16],
|
|
110446
110447
|
enumerable: true
|
|
110447
110448
|
});
|
|
110448
110449
|
};
|
|
@@ -110967,7 +110968,7 @@ __export$7(core_exports2$1, {
|
|
|
110967
110968
|
var _a$8;
|
|
110968
110969
|
var NEVER$1 = /* @__PURE__ */ Object.freeze({ status: "aborted" });
|
|
110969
110970
|
/* @__NO_SIDE_EFFECTS__ */
|
|
110970
|
-
function $constructor$2(name$
|
|
110971
|
+
function $constructor$2(name$16, initializer3, params) {
|
|
110971
110972
|
function init$1(inst, def) {
|
|
110972
110973
|
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
110973
110974
|
value: {
|
|
@@ -110977,8 +110978,8 @@ function $constructor$2(name$15, initializer3, params) {
|
|
|
110977
110978
|
},
|
|
110978
110979
|
enumerable: false
|
|
110979
110980
|
});
|
|
110980
|
-
if (inst._zod.traits.has(name$
|
|
110981
|
-
inst._zod.traits.add(name$
|
|
110981
|
+
if (inst._zod.traits.has(name$16)) return;
|
|
110982
|
+
inst._zod.traits.add(name$16);
|
|
110982
110983
|
initializer3(inst, def);
|
|
110983
110984
|
const proto$1 = _$1.prototype;
|
|
110984
110985
|
const keys = Object.keys(proto$1);
|
|
@@ -110989,7 +110990,7 @@ function $constructor$2(name$15, initializer3, params) {
|
|
|
110989
110990
|
}
|
|
110990
110991
|
const Parent = params?.Parent ?? Object;
|
|
110991
110992
|
class Definition extends Parent {}
|
|
110992
|
-
Object.defineProperty(Definition, "name", { value: name$
|
|
110993
|
+
Object.defineProperty(Definition, "name", { value: name$16 });
|
|
110993
110994
|
function _$1(def) {
|
|
110994
110995
|
var _a3$10;
|
|
110995
110996
|
const inst = params?.Parent ? new Definition() : this;
|
|
@@ -111001,9 +111002,9 @@ function $constructor$2(name$15, initializer3, params) {
|
|
|
111001
111002
|
Object.defineProperty(_$1, "init", { value: init$1 });
|
|
111002
111003
|
Object.defineProperty(_$1, Symbol.hasInstance, { value: (inst) => {
|
|
111003
111004
|
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
111004
|
-
return inst?._zod?.traits?.has(name$
|
|
111005
|
+
return inst?._zod?.traits?.has(name$16);
|
|
111005
111006
|
} });
|
|
111006
|
-
Object.defineProperty(_$1, "name", { value: name$
|
|
111007
|
+
Object.defineProperty(_$1, "name", { value: name$16 });
|
|
111007
111008
|
return _$1;
|
|
111008
111009
|
}
|
|
111009
111010
|
var $brand$1 = /* @__PURE__ */ Symbol("zod_brand");
|
|
@@ -111013,8 +111014,8 @@ var $ZodAsyncError$2 = class extends Error {
|
|
|
111013
111014
|
}
|
|
111014
111015
|
};
|
|
111015
111016
|
var $ZodEncodeError$2 = class extends Error {
|
|
111016
|
-
constructor(name$
|
|
111017
|
-
super(`Encountered unidirectional transform during encode: ${name$
|
|
111017
|
+
constructor(name$16) {
|
|
111018
|
+
super(`Encountered unidirectional transform during encode: ${name$16}`);
|
|
111018
111019
|
this.name = "ZodEncodeError";
|
|
111019
111020
|
}
|
|
111020
111021
|
};
|
|
@@ -123463,9 +123464,9 @@ function convertBaseSchema$2(schema, ctx) {
|
|
|
123463
123464
|
]);
|
|
123464
123465
|
}
|
|
123465
123466
|
if (schema.const !== void 0) return z$5.literal(schema.const);
|
|
123466
|
-
const type = schema.type;
|
|
123467
|
-
if (Array.isArray(type)) {
|
|
123468
|
-
const typeSchemas = type.map((t$1) => {
|
|
123467
|
+
const type$1 = schema.type;
|
|
123468
|
+
if (Array.isArray(type$1)) {
|
|
123469
|
+
const typeSchemas = type$1.map((t$1) => {
|
|
123469
123470
|
return convertBaseSchema$2({
|
|
123470
123471
|
...schema,
|
|
123471
123472
|
type: t$1
|
|
@@ -123475,9 +123476,9 @@ function convertBaseSchema$2(schema, ctx) {
|
|
|
123475
123476
|
if (typeSchemas.length === 1) return typeSchemas[0];
|
|
123476
123477
|
return z$5.union(typeSchemas);
|
|
123477
123478
|
}
|
|
123478
|
-
if (!type) return z$5.any();
|
|
123479
|
+
if (!type$1) return z$5.any();
|
|
123479
123480
|
let zodSchema$7;
|
|
123480
|
-
switch (type) {
|
|
123481
|
+
switch (type$1) {
|
|
123481
123482
|
case "string": {
|
|
123482
123483
|
let stringSchema = z$5.string();
|
|
123483
123484
|
if (schema.format) {
|
|
@@ -123514,7 +123515,7 @@ function convertBaseSchema$2(schema, ctx) {
|
|
|
123514
123515
|
}
|
|
123515
123516
|
case "number":
|
|
123516
123517
|
case "integer": {
|
|
123517
|
-
let numberSchema = type === "integer" ? z$5.number().int() : z$5.number();
|
|
123518
|
+
let numberSchema = type$1 === "integer" ? z$5.number().int() : z$5.number();
|
|
123518
123519
|
if (typeof schema.minimum === "number") numberSchema = numberSchema.min(schema.minimum);
|
|
123519
123520
|
if (typeof schema.maximum === "number") numberSchema = numberSchema.max(schema.maximum);
|
|
123520
123521
|
if (typeof schema.exclusiveMinimum === "number") numberSchema = numberSchema.gt(schema.exclusiveMinimum);
|
|
@@ -123604,7 +123605,7 @@ function convertBaseSchema$2(schema, ctx) {
|
|
|
123604
123605
|
} else zodSchema$7 = z$5.array(z$5.any());
|
|
123605
123606
|
break;
|
|
123606
123607
|
}
|
|
123607
|
-
default: throw new Error(`Unsupported type: ${type}`);
|
|
123608
|
+
default: throw new Error(`Unsupported type: ${type$1}`);
|
|
123608
123609
|
}
|
|
123609
123610
|
return zodSchema$7;
|
|
123610
123611
|
}
|
|
@@ -124927,11 +124928,11 @@ function toOllamaTool(tool3) {
|
|
|
124927
124928
|
const isJsonSchema = "properties" in inputSchema$1 || "type" in inputSchema$1;
|
|
124928
124929
|
return functionTool(tool3.name, tool3.description, isJsonSchema ? inputSchema$1 : EMPTY_OBJECT_SCHEMA);
|
|
124929
124930
|
}
|
|
124930
|
-
function functionTool(name$
|
|
124931
|
+
function functionTool(name$16, description, parameters) {
|
|
124931
124932
|
return {
|
|
124932
124933
|
type: "function",
|
|
124933
124934
|
function: {
|
|
124934
|
-
name: name$
|
|
124935
|
+
name: name$16,
|
|
124935
124936
|
description,
|
|
124936
124937
|
parameters
|
|
124937
124938
|
}
|
|
@@ -126566,33 +126567,33 @@ function mapOpencodeFinishReason(message) {
|
|
|
126566
126567
|
};
|
|
126567
126568
|
}
|
|
126568
126569
|
function mapErrorToFinishReason(error$97) {
|
|
126569
|
-
const { name: name$
|
|
126570
|
-
switch (name$
|
|
126570
|
+
const { name: name$16 } = error$97;
|
|
126571
|
+
switch (name$16) {
|
|
126571
126572
|
case "MessageAbortedError": return {
|
|
126572
126573
|
unified: "stop",
|
|
126573
|
-
raw: name$
|
|
126574
|
+
raw: name$16
|
|
126574
126575
|
};
|
|
126575
126576
|
case "MessageOutputLengthError": return {
|
|
126576
126577
|
unified: "length",
|
|
126577
|
-
raw: name$
|
|
126578
|
+
raw: name$16
|
|
126578
126579
|
};
|
|
126579
126580
|
case "ContextOverflowError": return {
|
|
126580
126581
|
unified: "length",
|
|
126581
|
-
raw: name$
|
|
126582
|
+
raw: name$16
|
|
126582
126583
|
};
|
|
126583
126584
|
case "StructuredOutputError": return {
|
|
126584
126585
|
unified: "error",
|
|
126585
|
-
raw: name$
|
|
126586
|
+
raw: name$16
|
|
126586
126587
|
};
|
|
126587
126588
|
case "ProviderAuthError":
|
|
126588
126589
|
case "APIError":
|
|
126589
126590
|
case "UnknownError": return {
|
|
126590
126591
|
unified: "error",
|
|
126591
|
-
raw: name$
|
|
126592
|
+
raw: name$16
|
|
126592
126593
|
};
|
|
126593
126594
|
default: return {
|
|
126594
126595
|
unified: "error",
|
|
126595
|
-
raw: name$
|
|
126596
|
+
raw: name$16
|
|
126596
126597
|
};
|
|
126597
126598
|
}
|
|
126598
126599
|
}
|
|
@@ -129345,13 +129346,13 @@ function prepareResponsesTools({ tools, toolChoice }) {
|
|
|
129345
129346
|
toolChoice: void 0,
|
|
129346
129347
|
toolWarnings
|
|
129347
129348
|
};
|
|
129348
|
-
const type = toolChoice.type;
|
|
129349
|
-
switch (type) {
|
|
129349
|
+
const type$1 = toolChoice.type;
|
|
129350
|
+
switch (type$1) {
|
|
129350
129351
|
case "auto":
|
|
129351
129352
|
case "none":
|
|
129352
129353
|
case "required": return {
|
|
129353
129354
|
tools: ollamaTools$1,
|
|
129354
|
-
toolChoice: type,
|
|
129355
|
+
toolChoice: type$1,
|
|
129355
129356
|
toolWarnings
|
|
129356
129357
|
};
|
|
129357
129358
|
case "tool": return {
|
|
@@ -129362,7 +129363,7 @@ function prepareResponsesTools({ tools, toolChoice }) {
|
|
|
129362
129363
|
},
|
|
129363
129364
|
toolWarnings
|
|
129364
129365
|
};
|
|
129365
|
-
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type}` });
|
|
129366
|
+
default: throw new UnsupportedFunctionalityError$1({ functionality: `tool choice type: ${type$1}` });
|
|
129366
129367
|
}
|
|
129367
129368
|
}
|
|
129368
129369
|
var OllamaRequestBuilder = class {
|
|
@@ -129428,10 +129429,10 @@ var OllamaRequestBuilder = class {
|
|
|
129428
129429
|
name: "stopSequences"
|
|
129429
129430
|
}
|
|
129430
129431
|
];
|
|
129431
|
-
for (const { value, name: name$
|
|
129432
|
+
for (const { value, name: name$16 } of unsupportedSettings) if (value != null) warnings.push({
|
|
129432
129433
|
type: "unsupported",
|
|
129433
129434
|
feature: "setting",
|
|
129434
|
-
details: name$
|
|
129435
|
+
details: name$16
|
|
129435
129436
|
});
|
|
129436
129437
|
return warnings;
|
|
129437
129438
|
}
|
|
@@ -130353,7 +130354,7 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
130353
130354
|
exports.$constructor = $constructor$1;
|
|
130354
130355
|
exports.config = config$1;
|
|
130355
130356
|
exports.NEVER = Object.freeze({ status: "aborted" });
|
|
130356
|
-
function $constructor$1(name$
|
|
130357
|
+
function $constructor$1(name$16, initializer$6, params) {
|
|
130357
130358
|
function init$1(inst, def) {
|
|
130358
130359
|
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
130359
130360
|
value: {
|
|
@@ -130363,8 +130364,8 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
130363
130364
|
},
|
|
130364
130365
|
enumerable: false
|
|
130365
130366
|
});
|
|
130366
|
-
if (inst._zod.traits.has(name$
|
|
130367
|
-
inst._zod.traits.add(name$
|
|
130367
|
+
if (inst._zod.traits.has(name$16)) return;
|
|
130368
|
+
inst._zod.traits.add(name$16);
|
|
130368
130369
|
initializer$6(inst, def);
|
|
130369
130370
|
const proto$1 = _$1.prototype;
|
|
130370
130371
|
const keys = Object.keys(proto$1);
|
|
@@ -130375,7 +130376,7 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
130375
130376
|
}
|
|
130376
130377
|
const Parent = params?.Parent ?? Object;
|
|
130377
130378
|
class Definition extends Parent {}
|
|
130378
|
-
Object.defineProperty(Definition, "name", { value: name$
|
|
130379
|
+
Object.defineProperty(Definition, "name", { value: name$16 });
|
|
130379
130380
|
function _$1(def) {
|
|
130380
130381
|
var _a$21;
|
|
130381
130382
|
const inst = params?.Parent ? new Definition() : this;
|
|
@@ -130387,9 +130388,9 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
130387
130388
|
Object.defineProperty(_$1, "init", { value: init$1 });
|
|
130388
130389
|
Object.defineProperty(_$1, Symbol.hasInstance, { value: (inst) => {
|
|
130389
130390
|
if (params?.Parent && inst instanceof params.Parent) return true;
|
|
130390
|
-
return inst?._zod?.traits?.has(name$
|
|
130391
|
+
return inst?._zod?.traits?.has(name$16);
|
|
130391
130392
|
} });
|
|
130392
|
-
Object.defineProperty(_$1, "name", { value: name$
|
|
130393
|
+
Object.defineProperty(_$1, "name", { value: name$16 });
|
|
130393
130394
|
return _$1;
|
|
130394
130395
|
}
|
|
130395
130396
|
exports.$brand = Symbol("zod_brand");
|
|
@@ -130400,8 +130401,8 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
130400
130401
|
};
|
|
130401
130402
|
exports.$ZodAsyncError = $ZodAsyncError$1;
|
|
130402
130403
|
var $ZodEncodeError$1 = class extends Error {
|
|
130403
|
-
constructor(name$
|
|
130404
|
-
super(`Encountered unidirectional transform during encode: ${name$
|
|
130404
|
+
constructor(name$16) {
|
|
130405
|
+
super(`Encountered unidirectional transform during encode: ${name$16}`);
|
|
130405
130406
|
this.name = "ZodEncodeError";
|
|
130406
130407
|
}
|
|
130407
130408
|
};
|
|
@@ -131306,9 +131307,9 @@ var require_regexes = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
131306
131307
|
exports.duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
|
|
131307
131308
|
exports.extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
131308
131309
|
exports.guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
|
|
131309
|
-
const uuid$2 = (version$
|
|
131310
|
-
if (!version$
|
|
131311
|
-
return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$
|
|
131310
|
+
const uuid$2 = (version$5) => {
|
|
131311
|
+
if (!version$5) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
|
|
131312
|
+
return /* @__PURE__ */ new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version$5}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
131312
131313
|
};
|
|
131313
131314
|
exports.uuid = uuid$2;
|
|
131314
131315
|
exports.uuid4 = (0, exports.uuid)(4);
|
|
@@ -144977,9 +144978,9 @@ var require_from_json_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
144977
144978
|
]);
|
|
144978
144979
|
}
|
|
144979
144980
|
if (schema.const !== void 0) return z$4.literal(schema.const);
|
|
144980
|
-
const type = schema.type;
|
|
144981
|
-
if (Array.isArray(type)) {
|
|
144982
|
-
const typeSchemas = type.map((t$1) => {
|
|
144981
|
+
const type$1 = schema.type;
|
|
144982
|
+
if (Array.isArray(type$1)) {
|
|
144983
|
+
const typeSchemas = type$1.map((t$1) => {
|
|
144983
144984
|
return convertBaseSchema$1({
|
|
144984
144985
|
...schema,
|
|
144985
144986
|
type: t$1
|
|
@@ -144989,9 +144990,9 @@ var require_from_json_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
144989
144990
|
if (typeSchemas.length === 1) return typeSchemas[0];
|
|
144990
144991
|
return z$4.union(typeSchemas);
|
|
144991
144992
|
}
|
|
144992
|
-
if (!type) return z$4.any();
|
|
144993
|
+
if (!type$1) return z$4.any();
|
|
144993
144994
|
let zodSchema$7;
|
|
144994
|
-
switch (type) {
|
|
144995
|
+
switch (type$1) {
|
|
144995
144996
|
case "string": {
|
|
144996
144997
|
let stringSchema = z$4.string();
|
|
144997
144998
|
if (schema.format) {
|
|
@@ -145028,7 +145029,7 @@ var require_from_json_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
145028
145029
|
}
|
|
145029
145030
|
case "number":
|
|
145030
145031
|
case "integer": {
|
|
145031
|
-
let numberSchema = type === "integer" ? z$4.number().int() : z$4.number();
|
|
145032
|
+
let numberSchema = type$1 === "integer" ? z$4.number().int() : z$4.number();
|
|
145032
145033
|
if (typeof schema.minimum === "number") numberSchema = numberSchema.min(schema.minimum);
|
|
145033
145034
|
if (typeof schema.maximum === "number") numberSchema = numberSchema.max(schema.maximum);
|
|
145034
145035
|
if (typeof schema.exclusiveMinimum === "number") numberSchema = numberSchema.gt(schema.exclusiveMinimum);
|
|
@@ -145118,7 +145119,7 @@ var require_from_json_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
145118
145119
|
} else zodSchema$7 = z$4.array(z$4.any());
|
|
145119
145120
|
break;
|
|
145120
145121
|
}
|
|
145121
|
-
default: throw new Error(`Unsupported type: ${type}`);
|
|
145122
|
+
default: throw new Error(`Unsupported type: ${type$1}`);
|
|
145122
145123
|
}
|
|
145123
145124
|
if (schema.description) zodSchema$7 = zodSchema$7.describe(schema.description);
|
|
145124
145125
|
if (schema.default !== void 0) zodSchema$7 = zodSchema$7.default(schema.default);
|
|
@@ -145548,12 +145549,12 @@ var require_Refs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
145548
145549
|
flags: { hasReferencedOpenAiAnyType: false },
|
|
145549
145550
|
currentPath,
|
|
145550
145551
|
propertyPath: void 0,
|
|
145551
|
-
seen: new Map(Object.entries(_options.definitions).map(([name$
|
|
145552
|
+
seen: new Map(Object.entries(_options.definitions).map(([name$16, def]) => [def._def, {
|
|
145552
145553
|
def: def._def,
|
|
145553
145554
|
path: [
|
|
145554
145555
|
..._options.basePath,
|
|
145555
145556
|
_options.definitionPath,
|
|
145556
|
-
name$
|
|
145557
|
+
name$16
|
|
145557
145558
|
],
|
|
145558
145559
|
jsonSchema: void 0
|
|
145559
145560
|
}]))
|
|
@@ -146402,9 +146403,9 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
146402
146403
|
regex = `${regex}(${opts.join("|")})`;
|
|
146403
146404
|
return /* @__PURE__ */ new RegExp(`^${regex}$`);
|
|
146404
146405
|
}
|
|
146405
|
-
function isValidIP(ip, version$
|
|
146406
|
-
if ((version$
|
|
146407
|
-
if ((version$
|
|
146406
|
+
function isValidIP(ip, version$5) {
|
|
146407
|
+
if ((version$5 === "v4" || !version$5) && ipv4Regex.test(ip)) return true;
|
|
146408
|
+
if ((version$5 === "v6" || !version$5) && ipv6Regex.test(ip)) return true;
|
|
146408
146409
|
return false;
|
|
146409
146410
|
}
|
|
146410
146411
|
function isValidJWT$1(jwt$4, alg) {
|
|
@@ -146423,9 +146424,9 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
146423
146424
|
return false;
|
|
146424
146425
|
}
|
|
146425
146426
|
}
|
|
146426
|
-
function isValidCidr(ip, version$
|
|
146427
|
-
if ((version$
|
|
146428
|
-
if ((version$
|
|
146427
|
+
function isValidCidr(ip, version$5) {
|
|
146428
|
+
if ((version$5 === "v4" || !version$5) && ipv4CidrRegex.test(ip)) return true;
|
|
146429
|
+
if ((version$5 === "v6" || !version$5) && ipv6CidrRegex.test(ip)) return true;
|
|
146429
146430
|
return false;
|
|
146430
146431
|
}
|
|
146431
146432
|
var ZodString$1 = class ZodString$1 extends ZodType$1 {
|
|
@@ -148058,20 +148059,20 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
148058
148059
|
...processCreateParams(params)
|
|
148059
148060
|
});
|
|
148060
148061
|
};
|
|
148061
|
-
const getDiscriminator = (type) => {
|
|
148062
|
-
if (type instanceof ZodLazy$1) return getDiscriminator(type.schema);
|
|
148063
|
-
else if (type instanceof ZodEffects) return getDiscriminator(type.innerType());
|
|
148064
|
-
else if (type instanceof ZodLiteral$1) return [type.value];
|
|
148065
|
-
else if (type instanceof ZodEnum$1) return type.options;
|
|
148066
|
-
else if (type instanceof ZodNativeEnum) return util_js_1.util.objectValues(type.enum);
|
|
148067
|
-
else if (type instanceof ZodDefault$1) return getDiscriminator(type._def.innerType);
|
|
148068
|
-
else if (type instanceof ZodUndefined$1) return [void 0];
|
|
148069
|
-
else if (type instanceof ZodNull$1) return [null];
|
|
148070
|
-
else if (type instanceof ZodOptional$1) return [void 0, ...getDiscriminator(type.unwrap())];
|
|
148071
|
-
else if (type instanceof ZodNullable$1) return [null, ...getDiscriminator(type.unwrap())];
|
|
148072
|
-
else if (type instanceof ZodBranded) return getDiscriminator(type.unwrap());
|
|
148073
|
-
else if (type instanceof ZodReadonly$1) return getDiscriminator(type.unwrap());
|
|
148074
|
-
else if (type instanceof ZodCatch$1) return getDiscriminator(type._def.innerType);
|
|
148062
|
+
const getDiscriminator = (type$1) => {
|
|
148063
|
+
if (type$1 instanceof ZodLazy$1) return getDiscriminator(type$1.schema);
|
|
148064
|
+
else if (type$1 instanceof ZodEffects) return getDiscriminator(type$1.innerType());
|
|
148065
|
+
else if (type$1 instanceof ZodLiteral$1) return [type$1.value];
|
|
148066
|
+
else if (type$1 instanceof ZodEnum$1) return type$1.options;
|
|
148067
|
+
else if (type$1 instanceof ZodNativeEnum) return util_js_1.util.objectValues(type$1.enum);
|
|
148068
|
+
else if (type$1 instanceof ZodDefault$1) return getDiscriminator(type$1._def.innerType);
|
|
148069
|
+
else if (type$1 instanceof ZodUndefined$1) return [void 0];
|
|
148070
|
+
else if (type$1 instanceof ZodNull$1) return [null];
|
|
148071
|
+
else if (type$1 instanceof ZodOptional$1) return [void 0, ...getDiscriminator(type$1.unwrap())];
|
|
148072
|
+
else if (type$1 instanceof ZodNullable$1) return [null, ...getDiscriminator(type$1.unwrap())];
|
|
148073
|
+
else if (type$1 instanceof ZodBranded) return getDiscriminator(type$1.unwrap());
|
|
148074
|
+
else if (type$1 instanceof ZodReadonly$1) return getDiscriminator(type$1.unwrap());
|
|
148075
|
+
else if (type$1 instanceof ZodCatch$1) return getDiscriminator(type$1._def.innerType);
|
|
148075
148076
|
else return [];
|
|
148076
148077
|
};
|
|
148077
148078
|
var ZodDiscriminatedUnion$1 = class ZodDiscriminatedUnion$1 extends ZodType$1 {
|
|
@@ -148118,12 +148119,12 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
148118
148119
|
}
|
|
148119
148120
|
static create(discriminator, options, params) {
|
|
148120
148121
|
const optionsMap = /* @__PURE__ */ new Map();
|
|
148121
|
-
for (const type of options) {
|
|
148122
|
-
const discriminatorValues = getDiscriminator(type.shape[discriminator]);
|
|
148122
|
+
for (const type$1 of options) {
|
|
148123
|
+
const discriminatorValues = getDiscriminator(type$1.shape[discriminator]);
|
|
148123
148124
|
if (!discriminatorValues.length) throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
|
|
148124
148125
|
for (const value of discriminatorValues) {
|
|
148125
148126
|
if (optionsMap.has(value)) throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
|
|
148126
|
-
optionsMap.set(value, type);
|
|
148127
|
+
optionsMap.set(value, type$1);
|
|
148127
148128
|
}
|
|
148128
148129
|
}
|
|
148129
148130
|
return new ZodDiscriminatedUnion$1({
|
|
@@ -148919,9 +148920,9 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
148919
148920
|
}
|
|
148920
148921
|
};
|
|
148921
148922
|
exports.ZodOptional = ZodOptional$1;
|
|
148922
|
-
ZodOptional$1.create = (type, params) => {
|
|
148923
|
+
ZodOptional$1.create = (type$1, params) => {
|
|
148923
148924
|
return new ZodOptional$1({
|
|
148924
|
-
innerType: type,
|
|
148925
|
+
innerType: type$1,
|
|
148925
148926
|
typeName: ZodFirstPartyTypeKind$2.ZodOptional,
|
|
148926
148927
|
...processCreateParams(params)
|
|
148927
148928
|
});
|
|
@@ -148936,9 +148937,9 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
148936
148937
|
}
|
|
148937
148938
|
};
|
|
148938
148939
|
exports.ZodNullable = ZodNullable$1;
|
|
148939
|
-
ZodNullable$1.create = (type, params) => {
|
|
148940
|
+
ZodNullable$1.create = (type$1, params) => {
|
|
148940
148941
|
return new ZodNullable$1({
|
|
148941
|
-
innerType: type,
|
|
148942
|
+
innerType: type$1,
|
|
148942
148943
|
typeName: ZodFirstPartyTypeKind$2.ZodNullable,
|
|
148943
148944
|
...processCreateParams(params)
|
|
148944
148945
|
});
|
|
@@ -148959,9 +148960,9 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
148959
148960
|
}
|
|
148960
148961
|
};
|
|
148961
148962
|
exports.ZodDefault = ZodDefault$1;
|
|
148962
|
-
ZodDefault$1.create = (type, params) => {
|
|
148963
|
+
ZodDefault$1.create = (type$1, params) => {
|
|
148963
148964
|
return new ZodDefault$1({
|
|
148964
|
-
innerType: type,
|
|
148965
|
+
innerType: type$1,
|
|
148965
148966
|
typeName: ZodFirstPartyTypeKind$2.ZodDefault,
|
|
148966
148967
|
defaultValue: typeof params.default === "function" ? params.default : () => params.default,
|
|
148967
148968
|
...processCreateParams(params)
|
|
@@ -149008,9 +149009,9 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
149008
149009
|
}
|
|
149009
149010
|
};
|
|
149010
149011
|
exports.ZodCatch = ZodCatch$1;
|
|
149011
|
-
ZodCatch$1.create = (type, params) => {
|
|
149012
|
+
ZodCatch$1.create = (type$1, params) => {
|
|
149012
149013
|
return new ZodCatch$1({
|
|
149013
|
-
innerType: type,
|
|
149014
|
+
innerType: type$1,
|
|
149014
149015
|
typeName: ZodFirstPartyTypeKind$2.ZodCatch,
|
|
149015
149016
|
catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
|
|
149016
149017
|
...processCreateParams(params)
|
|
@@ -149120,9 +149121,9 @@ var require_types = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
149120
149121
|
}
|
|
149121
149122
|
};
|
|
149122
149123
|
exports.ZodReadonly = ZodReadonly$1;
|
|
149123
|
-
ZodReadonly$1.create = (type, params) => {
|
|
149124
|
+
ZodReadonly$1.create = (type$1, params) => {
|
|
149124
149125
|
return new ZodReadonly$1({
|
|
149125
|
-
innerType: type,
|
|
149126
|
+
innerType: type$1,
|
|
149126
149127
|
typeName: ZodFirstPartyTypeKind$2.ZodReadonly,
|
|
149127
149128
|
...processCreateParams(params)
|
|
149128
149129
|
});
|
|
@@ -149510,9 +149511,9 @@ var require_intersection = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
149510
149511
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
149511
149512
|
exports.parseIntersectionDef = void 0;
|
|
149512
149513
|
const parseDef_js_1$12 = require_parseDef();
|
|
149513
|
-
const isJsonSchema7AllOfType$2 = (type) => {
|
|
149514
|
-
if ("type" in type && type.type === "string") return false;
|
|
149515
|
-
return "allOf" in type;
|
|
149514
|
+
const isJsonSchema7AllOfType$2 = (type$1) => {
|
|
149515
|
+
if ("type" in type$1 && type$1.type === "string") return false;
|
|
149516
|
+
return "allOf" in type$1;
|
|
149516
149517
|
};
|
|
149517
149518
|
function parseIntersectionDef$2(def, refs) {
|
|
149518
149519
|
const allOf = [(0, parseDef_js_1$12.parseDef)(def.left._def, {
|
|
@@ -149847,7 +149848,7 @@ var require_record = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
149847
149848
|
};
|
|
149848
149849
|
if (refs.target === "openApi3") return schema;
|
|
149849
149850
|
if (def.keyType?._def.typeName === v3_1$1.ZodFirstPartyTypeKind.ZodString && def.keyType._def.checks?.length) {
|
|
149850
|
-
const { type,...keyType } = (0, string_js_1$1.parseStringDef)(def.keyType._def, refs);
|
|
149851
|
+
const { type: type$1,...keyType } = (0, string_js_1$1.parseStringDef)(def.keyType._def, refs);
|
|
149851
149852
|
return {
|
|
149852
149853
|
...schema,
|
|
149853
149854
|
propertyNames: keyType
|
|
@@ -149857,7 +149858,7 @@ var require_record = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
149857
149858
|
propertyNames: { enum: def.keyType._def.values }
|
|
149858
149859
|
};
|
|
149859
149860
|
else if (def.keyType?._def.typeName === v3_1$1.ZodFirstPartyTypeKind.ZodBranded && def.keyType._def.type._def.typeName === v3_1$1.ZodFirstPartyTypeKind.ZodString && def.keyType._def.type._def.checks?.length) {
|
|
149860
|
-
const { type,...keyType } = (0, branded_js_1$1.parseBrandedDef)(def.keyType._def, refs);
|
|
149861
|
+
const { type: type$1,...keyType } = (0, branded_js_1$1.parseBrandedDef)(def.keyType._def, refs);
|
|
149861
149862
|
return {
|
|
149862
149863
|
...schema,
|
|
149863
149864
|
propertyNames: keyType
|
|
@@ -149959,17 +149960,17 @@ var require_union = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
149959
149960
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
149960
149961
|
if (options.every((x$2) => x$2._def.typeName in exports.primitiveMappings && (!x$2._def.checks || !x$2._def.checks.length))) {
|
|
149961
149962
|
const types = options.reduce((types$1, x$2) => {
|
|
149962
|
-
const type = exports.primitiveMappings[x$2._def.typeName];
|
|
149963
|
-
return type && !types$1.includes(type) ? [...types$1, type] : types$1;
|
|
149963
|
+
const type$1 = exports.primitiveMappings[x$2._def.typeName];
|
|
149964
|
+
return type$1 && !types$1.includes(type$1) ? [...types$1, type$1] : types$1;
|
|
149964
149965
|
}, []);
|
|
149965
149966
|
return { type: types.length > 1 ? types : types[0] };
|
|
149966
149967
|
} else if (options.every((x$2) => x$2._def.typeName === "ZodLiteral" && !x$2.description)) {
|
|
149967
149968
|
const types = options.reduce((acc, x$2) => {
|
|
149968
|
-
const type = typeof x$2._def.value;
|
|
149969
|
-
switch (type) {
|
|
149969
|
+
const type$1 = typeof x$2._def.value;
|
|
149970
|
+
switch (type$1) {
|
|
149970
149971
|
case "string":
|
|
149971
149972
|
case "number":
|
|
149972
|
-
case "boolean": return [...acc, type];
|
|
149973
|
+
case "boolean": return [...acc, type$1];
|
|
149973
149974
|
case "bigint": return [...acc, "integer"];
|
|
149974
149975
|
case "object": if (x$2._def.value === null) return [...acc, "null"];
|
|
149975
149976
|
case "symbol":
|
|
@@ -150432,24 +150433,24 @@ var require_zodToJsonSchema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
150432
150433
|
const any_js_1 = require_any();
|
|
150433
150434
|
const zodToJsonSchema = (schema, options) => {
|
|
150434
150435
|
const refs = (0, Refs_js_1.getRefs)(options);
|
|
150435
|
-
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name$
|
|
150436
|
+
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce((acc, [name$17, schema$1]) => ({
|
|
150436
150437
|
...acc,
|
|
150437
|
-
[name$
|
|
150438
|
+
[name$17]: (0, parseDef_js_1.parseDef)(schema$1._def, {
|
|
150438
150439
|
...refs,
|
|
150439
150440
|
currentPath: [
|
|
150440
150441
|
...refs.basePath,
|
|
150441
150442
|
refs.definitionPath,
|
|
150442
|
-
name$
|
|
150443
|
+
name$17
|
|
150443
150444
|
]
|
|
150444
150445
|
}, true) ?? (0, any_js_1.parseAnyDef)(refs)
|
|
150445
150446
|
}), {}) : void 0;
|
|
150446
|
-
const name$
|
|
150447
|
-
const main = (0, parseDef_js_1.parseDef)(schema._def, name$
|
|
150447
|
+
const name$16 = typeof options === "string" ? options : options?.nameStrategy === "title" ? void 0 : options?.name;
|
|
150448
|
+
const main = (0, parseDef_js_1.parseDef)(schema._def, name$16 === void 0 ? refs : {
|
|
150448
150449
|
...refs,
|
|
150449
150450
|
currentPath: [
|
|
150450
150451
|
...refs.basePath,
|
|
150451
150452
|
refs.definitionPath,
|
|
150452
|
-
name$
|
|
150453
|
+
name$16
|
|
150453
150454
|
]
|
|
150454
150455
|
}, false) ?? (0, any_js_1.parseAnyDef)(refs);
|
|
150455
150456
|
const title = typeof options === "object" && options.name !== void 0 && options.nameStrategy === "title" ? options.name : void 0;
|
|
@@ -150472,18 +150473,18 @@ var require_zodToJsonSchema = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
150472
150473
|
].join("/") }
|
|
150473
150474
|
};
|
|
150474
150475
|
}
|
|
150475
|
-
const combined = name$
|
|
150476
|
+
const combined = name$16 === void 0 ? definitions ? {
|
|
150476
150477
|
...main,
|
|
150477
150478
|
[refs.definitionPath]: definitions
|
|
150478
150479
|
} : main : {
|
|
150479
150480
|
$ref: [
|
|
150480
150481
|
...refs.$refStrategy === "relative" ? [] : refs.basePath,
|
|
150481
150482
|
refs.definitionPath,
|
|
150482
|
-
name$
|
|
150483
|
+
name$16
|
|
150483
150484
|
].join("/"),
|
|
150484
150485
|
[refs.definitionPath]: {
|
|
150485
150486
|
...definitions,
|
|
150486
|
-
[name$
|
|
150487
|
+
[name$16]: main
|
|
150487
150488
|
}
|
|
150488
150489
|
};
|
|
150489
150490
|
if (refs.target === "jsonSchema7") combined.$schema = "http://json-schema.org/draft-07/schema#";
|
|
@@ -150577,8 +150578,8 @@ var require_dist$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
150577
150578
|
var __getProtoOf = Object.getPrototypeOf;
|
|
150578
150579
|
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
150579
150580
|
var __export$5 = (target, all) => {
|
|
150580
|
-
for (var name$
|
|
150581
|
-
get: all[name$
|
|
150581
|
+
for (var name$16 in all) __defProp$4(target, name$16, {
|
|
150582
|
+
get: all[name$16],
|
|
150582
150583
|
enumerable: true
|
|
150583
150584
|
});
|
|
150584
150585
|
};
|
|
@@ -151155,11 +151156,11 @@ var require_dist$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
151155
151156
|
type: "dynamic"
|
|
151156
151157
|
};
|
|
151157
151158
|
}
|
|
151158
|
-
function createProviderDefinedToolFactory({ id, name: name$
|
|
151159
|
+
function createProviderDefinedToolFactory({ id, name: name$16, inputSchema: inputSchema$1 }) {
|
|
151159
151160
|
return ({ execute, outputSchema: outputSchema$2, toModelOutput, onInputStart, onInputDelta, onInputAvailable,...args }) => tool$2({
|
|
151160
151161
|
type: "provider-defined",
|
|
151161
151162
|
id,
|
|
151162
|
-
name: name$
|
|
151163
|
+
name: name$16,
|
|
151163
151164
|
args,
|
|
151164
151165
|
inputSchema: inputSchema$1,
|
|
151165
151166
|
outputSchema: outputSchema$2,
|
|
@@ -151170,11 +151171,11 @@ var require_dist$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
151170
151171
|
onInputAvailable
|
|
151171
151172
|
});
|
|
151172
151173
|
}
|
|
151173
|
-
function createProviderDefinedToolFactoryWithOutputSchema({ id, name: name$
|
|
151174
|
+
function createProviderDefinedToolFactoryWithOutputSchema({ id, name: name$16, inputSchema: inputSchema$1, outputSchema: outputSchema$2 }) {
|
|
151174
151175
|
return ({ execute, toModelOutput, onInputStart, onInputDelta, onInputAvailable,...args }) => tool$2({
|
|
151175
151176
|
type: "provider-defined",
|
|
151176
151177
|
id,
|
|
151177
|
-
name: name$
|
|
151178
|
+
name: name$16,
|
|
151178
151179
|
args,
|
|
151179
151180
|
inputSchema: inputSchema$1,
|
|
151180
151181
|
outputSchema: outputSchema$2,
|
|
@@ -151442,8 +151443,8 @@ var require_dist$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
151442
151443
|
var __getOwnPropNames$2 = Object.getOwnPropertyNames;
|
|
151443
151444
|
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
151444
151445
|
var __export$4 = (target, all) => {
|
|
151445
|
-
for (var name$
|
|
151446
|
-
get: all[name$
|
|
151446
|
+
for (var name$16 in all) __defProp$3(target, name$16, {
|
|
151447
|
+
get: all[name$16],
|
|
151447
151448
|
enumerable: true
|
|
151448
151449
|
});
|
|
151449
151450
|
};
|
|
@@ -151640,13 +151641,13 @@ var require_dist$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
151640
151641
|
toolChoice: void 0,
|
|
151641
151642
|
toolWarnings
|
|
151642
151643
|
};
|
|
151643
|
-
const type = toolChoice.type;
|
|
151644
|
-
switch (type) {
|
|
151644
|
+
const type$1 = toolChoice.type;
|
|
151645
|
+
switch (type$1) {
|
|
151645
151646
|
case "auto":
|
|
151646
151647
|
case "none":
|
|
151647
151648
|
case "required": return {
|
|
151648
151649
|
tools: openaiCompatTools,
|
|
151649
|
-
toolChoice: type,
|
|
151650
|
+
toolChoice: type$1,
|
|
151650
151651
|
toolWarnings
|
|
151651
151652
|
};
|
|
151652
151653
|
case "tool": return {
|
|
@@ -151658,7 +151659,7 @@ var require_dist$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
151658
151659
|
toolWarnings
|
|
151659
151660
|
};
|
|
151660
151661
|
default: {
|
|
151661
|
-
const _exhaustiveCheck = type;
|
|
151662
|
+
const _exhaustiveCheck = type$1;
|
|
151662
151663
|
throw new import_provider2.UnsupportedFunctionalityError({ functionality: `tool choice type: ${_exhaustiveCheck}` });
|
|
151663
151664
|
}
|
|
151664
151665
|
}
|
|
@@ -152579,8 +152580,8 @@ var import_dist$3 = /* @__PURE__ */ __toESM$2((/* @__PURE__ */ __commonJSMin(((e
|
|
|
152579
152580
|
var __getOwnPropNames$1 = Object.getOwnPropertyNames;
|
|
152580
152581
|
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
152581
152582
|
var __export$3 = (target, all) => {
|
|
152582
|
-
for (var name$
|
|
152583
|
-
get: all[name$
|
|
152583
|
+
for (var name$16 in all) __defProp$2(target, name$16, {
|
|
152584
|
+
get: all[name$16],
|
|
152584
152585
|
enumerable: true
|
|
152585
152586
|
});
|
|
152586
152587
|
};
|
|
@@ -153066,9 +153067,9 @@ function parseEnumDef$1(def) {
|
|
|
153066
153067
|
enum: Array.from(def.values)
|
|
153067
153068
|
};
|
|
153068
153069
|
}
|
|
153069
|
-
var isJsonSchema7AllOfType$1 = (type) => {
|
|
153070
|
-
if ("type" in type && type.type === "string") return false;
|
|
153071
|
-
return "allOf" in type;
|
|
153070
|
+
var isJsonSchema7AllOfType$1 = (type$1) => {
|
|
153071
|
+
if ("type" in type$1 && type$1.type === "string") return false;
|
|
153072
|
+
return "allOf" in type$1;
|
|
153072
153073
|
};
|
|
153073
153074
|
function parseIntersectionDef$1(def, refs) {
|
|
153074
153075
|
const allOf = [parseDef$1(def.left._def, {
|
|
@@ -153348,7 +153349,7 @@ function parseRecordDef$1(def, refs) {
|
|
|
153348
153349
|
})) != null ? _a2$13 : refs.allowedAdditionalProperties
|
|
153349
153350
|
};
|
|
153350
153351
|
if (((_b2$9 = def.keyType) == null ? void 0 : _b2$9._def.typeName) === ZodFirstPartyTypeKind$1.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) {
|
|
153351
|
-
const { type,...keyType } = parseStringDef$1(def.keyType._def, refs);
|
|
153352
|
+
const { type: type$1,...keyType } = parseStringDef$1(def.keyType._def, refs);
|
|
153352
153353
|
return {
|
|
153353
153354
|
...schema,
|
|
153354
153355
|
propertyNames: keyType
|
|
@@ -153358,7 +153359,7 @@ function parseRecordDef$1(def, refs) {
|
|
|
153358
153359
|
propertyNames: { enum: def.keyType._def.values }
|
|
153359
153360
|
};
|
|
153360
153361
|
else if (((_e$1 = def.keyType) == null ? void 0 : _e$1._def.typeName) === ZodFirstPartyTypeKind$1.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind$1.ZodString && ((_f = def.keyType._def.type._def.checks) == null ? void 0 : _f.length)) {
|
|
153361
|
-
const { type,...keyType } = parseBrandedDef$1(def.keyType._def, refs);
|
|
153362
|
+
const { type: type$1,...keyType } = parseBrandedDef$1(def.keyType._def, refs);
|
|
153362
153363
|
return {
|
|
153363
153364
|
...schema,
|
|
153364
153365
|
propertyNames: keyType
|
|
@@ -153423,17 +153424,17 @@ function parseUnionDef$1(def, refs) {
|
|
|
153423
153424
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
153424
153425
|
if (options.every((x$2) => x$2._def.typeName in primitiveMappings$1 && (!x$2._def.checks || !x$2._def.checks.length))) {
|
|
153425
153426
|
const types = options.reduce((types2, x$2) => {
|
|
153426
|
-
const type = primitiveMappings$1[x$2._def.typeName];
|
|
153427
|
-
return type && !types2.includes(type) ? [...types2, type] : types2;
|
|
153427
|
+
const type$1 = primitiveMappings$1[x$2._def.typeName];
|
|
153428
|
+
return type$1 && !types2.includes(type$1) ? [...types2, type$1] : types2;
|
|
153428
153429
|
}, []);
|
|
153429
153430
|
return { type: types.length > 1 ? types : types[0] };
|
|
153430
153431
|
} else if (options.every((x$2) => x$2._def.typeName === "ZodLiteral" && !x$2.description)) {
|
|
153431
153432
|
const types = options.reduce((acc, x$2) => {
|
|
153432
|
-
const type = typeof x$2._def.value;
|
|
153433
|
-
switch (type) {
|
|
153433
|
+
const type$1 = typeof x$2._def.value;
|
|
153434
|
+
switch (type$1) {
|
|
153434
153435
|
case "string":
|
|
153435
153436
|
case "number":
|
|
153436
|
-
case "boolean": return [...acc, type];
|
|
153437
|
+
case "boolean": return [...acc, type$1];
|
|
153437
153438
|
case "bigint": return [...acc, "integer"];
|
|
153438
153439
|
case "object": if (x$2._def.value === null) return [...acc, "null"];
|
|
153439
153440
|
case "symbol":
|
|
@@ -155100,8 +155101,8 @@ async function prepareTools$1({ tools, toolChoice, disableParallelToolUse, cache
|
|
|
155100
155101
|
toolWarnings,
|
|
155101
155102
|
betas
|
|
155102
155103
|
};
|
|
155103
|
-
const type = toolChoice.type;
|
|
155104
|
-
switch (type) {
|
|
155104
|
+
const type$1 = toolChoice.type;
|
|
155105
|
+
switch (type$1) {
|
|
155105
155106
|
case "auto": return {
|
|
155106
155107
|
tools: anthropicTools2,
|
|
155107
155108
|
toolChoice: {
|
|
@@ -155136,7 +155137,7 @@ async function prepareTools$1({ tools, toolChoice, disableParallelToolUse, cache
|
|
|
155136
155137
|
toolWarnings,
|
|
155137
155138
|
betas
|
|
155138
155139
|
};
|
|
155139
|
-
default: throw new UnsupportedFunctionalityError$3({ functionality: `tool choice type: ${type}` });
|
|
155140
|
+
default: throw new UnsupportedFunctionalityError$3({ functionality: `tool choice type: ${type$1}` });
|
|
155140
155141
|
}
|
|
155141
155142
|
}
|
|
155142
155143
|
function convertAnthropicMessagesUsage(usage) {
|
|
@@ -155308,8 +155309,8 @@ async function convertToAnthropicMessagesPrompt({ prompt, sendReasoning, warning
|
|
|
155308
155309
|
for (let i$5 = 0; i$5 < blocks.length; i$5++) {
|
|
155309
155310
|
const block = blocks[i$5];
|
|
155310
155311
|
const isLastBlock = i$5 === blocks.length - 1;
|
|
155311
|
-
const type = block.type;
|
|
155312
|
-
switch (type) {
|
|
155312
|
+
const type$1 = block.type;
|
|
155313
|
+
switch (type$1) {
|
|
155313
155314
|
case "system":
|
|
155314
155315
|
if (system != null) throw new UnsupportedFunctionalityError$3({ functionality: "Multiple system messages that are separated by user/assistant messages" });
|
|
155315
155316
|
system = block.messages.map(({ content, providerOptions }) => ({
|
|
@@ -155867,7 +155868,7 @@ async function convertToAnthropicMessagesPrompt({ prompt, sendReasoning, warning
|
|
|
155867
155868
|
break;
|
|
155868
155869
|
}
|
|
155869
155870
|
default: {
|
|
155870
|
-
const _exhaustiveCheck = type;
|
|
155871
|
+
const _exhaustiveCheck = type$1;
|
|
155871
155872
|
throw new Error(`content type: ${_exhaustiveCheck}`);
|
|
155872
155873
|
}
|
|
155873
155874
|
}
|
|
@@ -157816,9 +157817,9 @@ function parseEnumDef(def) {
|
|
|
157816
157817
|
enum: Array.from(def.values)
|
|
157817
157818
|
};
|
|
157818
157819
|
}
|
|
157819
|
-
var isJsonSchema7AllOfType = (type) => {
|
|
157820
|
-
if ("type" in type && type.type === "string") return false;
|
|
157821
|
-
return "allOf" in type;
|
|
157820
|
+
var isJsonSchema7AllOfType = (type$1) => {
|
|
157821
|
+
if ("type" in type$1 && type$1.type === "string") return false;
|
|
157822
|
+
return "allOf" in type$1;
|
|
157822
157823
|
};
|
|
157823
157824
|
function parseIntersectionDef(def, refs) {
|
|
157824
157825
|
const allOf = [parseDef(def.left._def, {
|
|
@@ -158098,7 +158099,7 @@ function parseRecordDef(def, refs) {
|
|
|
158098
158099
|
})) != null ? _a2$13 : refs.allowedAdditionalProperties
|
|
158099
158100
|
};
|
|
158100
158101
|
if (((_b2$9 = def.keyType) == null ? void 0 : _b2$9._def.typeName) === ZodFirstPartyTypeKind$1.ZodString && ((_c = def.keyType._def.checks) == null ? void 0 : _c.length)) {
|
|
158101
|
-
const { type,...keyType } = parseStringDef(def.keyType._def, refs);
|
|
158102
|
+
const { type: type$1,...keyType } = parseStringDef(def.keyType._def, refs);
|
|
158102
158103
|
return {
|
|
158103
158104
|
...schema,
|
|
158104
158105
|
propertyNames: keyType
|
|
@@ -158108,7 +158109,7 @@ function parseRecordDef(def, refs) {
|
|
|
158108
158109
|
propertyNames: { enum: def.keyType._def.values }
|
|
158109
158110
|
};
|
|
158110
158111
|
else if (((_e$1 = def.keyType) == null ? void 0 : _e$1._def.typeName) === ZodFirstPartyTypeKind$1.ZodBranded && def.keyType._def.type._def.typeName === ZodFirstPartyTypeKind$1.ZodString && ((_f = def.keyType._def.type._def.checks) == null ? void 0 : _f.length)) {
|
|
158111
|
-
const { type,...keyType } = parseBrandedDef(def.keyType._def, refs);
|
|
158112
|
+
const { type: type$1,...keyType } = parseBrandedDef(def.keyType._def, refs);
|
|
158112
158113
|
return {
|
|
158113
158114
|
...schema,
|
|
158114
158115
|
propertyNames: keyType
|
|
@@ -158173,17 +158174,17 @@ function parseUnionDef(def, refs) {
|
|
|
158173
158174
|
const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
|
|
158174
158175
|
if (options.every((x$2) => x$2._def.typeName in primitiveMappings && (!x$2._def.checks || !x$2._def.checks.length))) {
|
|
158175
158176
|
const types = options.reduce((types2, x$2) => {
|
|
158176
|
-
const type = primitiveMappings[x$2._def.typeName];
|
|
158177
|
-
return type && !types2.includes(type) ? [...types2, type] : types2;
|
|
158177
|
+
const type$1 = primitiveMappings[x$2._def.typeName];
|
|
158178
|
+
return type$1 && !types2.includes(type$1) ? [...types2, type$1] : types2;
|
|
158178
158179
|
}, []);
|
|
158179
158180
|
return { type: types.length > 1 ? types : types[0] };
|
|
158180
158181
|
} else if (options.every((x$2) => x$2._def.typeName === "ZodLiteral" && !x$2.description)) {
|
|
158181
158182
|
const types = options.reduce((acc, x$2) => {
|
|
158182
|
-
const type = typeof x$2._def.value;
|
|
158183
|
-
switch (type) {
|
|
158183
|
+
const type$1 = typeof x$2._def.value;
|
|
158184
|
+
switch (type$1) {
|
|
158184
158185
|
case "string":
|
|
158185
158186
|
case "number":
|
|
158186
|
-
case "boolean": return [...acc, type];
|
|
158187
|
+
case "boolean": return [...acc, type$1];
|
|
158187
158188
|
case "bigint": return [...acc, "integer"];
|
|
158188
158189
|
case "object": if (x$2._def.value === null) return [...acc, "null"];
|
|
158189
158190
|
case "symbol":
|
|
@@ -159148,13 +159149,13 @@ function prepareTools({ tools, toolChoice }) {
|
|
|
159148
159149
|
toolChoice: void 0,
|
|
159149
159150
|
toolWarnings
|
|
159150
159151
|
};
|
|
159151
|
-
const type = toolChoice.type;
|
|
159152
|
-
switch (type) {
|
|
159152
|
+
const type$1 = toolChoice.type;
|
|
159153
|
+
switch (type$1) {
|
|
159153
159154
|
case "auto":
|
|
159154
159155
|
case "none":
|
|
159155
159156
|
case "required": return {
|
|
159156
159157
|
tools: openaiCompatTools,
|
|
159157
|
-
toolChoice: type,
|
|
159158
|
+
toolChoice: type$1,
|
|
159158
159159
|
toolWarnings
|
|
159159
159160
|
};
|
|
159160
159161
|
case "tool": return {
|
|
@@ -159165,7 +159166,7 @@ function prepareTools({ tools, toolChoice }) {
|
|
|
159165
159166
|
},
|
|
159166
159167
|
toolWarnings
|
|
159167
159168
|
};
|
|
159168
|
-
default: throw new UnsupportedFunctionalityError$2({ functionality: `tool choice type: ${type}` });
|
|
159169
|
+
default: throw new UnsupportedFunctionalityError$2({ functionality: `tool choice type: ${type$1}` });
|
|
159169
159170
|
}
|
|
159170
159171
|
}
|
|
159171
159172
|
function getResponseMetadata$1({ id, model, created }) {
|
|
@@ -160188,7 +160189,7 @@ function isForcedToolChoice(toolChoice) {
|
|
|
160188
160189
|
return typeof toolChoice === "object" && toolChoice !== null && toolChoice.type === "function";
|
|
160189
160190
|
}
|
|
160190
160191
|
function getToolNames(tools) {
|
|
160191
|
-
return new Set((tools ?? []).map((tool$7) => tool$7.function?.name).filter((name$
|
|
160192
|
+
return new Set((tools ?? []).map((tool$7) => tool$7.function?.name).filter((name$16) => typeof name$16 === "string"));
|
|
160192
160193
|
}
|
|
160193
160194
|
function parseLeakedToolCalls(text$1, knownToolNames) {
|
|
160194
160195
|
let parsed;
|
|
@@ -160202,8 +160203,8 @@ function parseLeakedToolCalls(text$1, knownToolNames) {
|
|
|
160202
160203
|
for (const candidate of candidates) {
|
|
160203
160204
|
if (typeof candidate !== "object" || candidate === null) continue;
|
|
160204
160205
|
const obj = candidate;
|
|
160205
|
-
const name$
|
|
160206
|
-
if (typeof name$
|
|
160206
|
+
const name$16 = obj.name;
|
|
160207
|
+
if (typeof name$16 !== "string" || !knownToolNames.has(name$16)) continue;
|
|
160207
160208
|
let args;
|
|
160208
160209
|
if ("arguments" in obj) args = obj.arguments;
|
|
160209
160210
|
else if ("parameters" in obj) args = obj.parameters;
|
|
@@ -160212,7 +160213,7 @@ function parseLeakedToolCalls(text$1, knownToolNames) {
|
|
|
160212
160213
|
args = rest$1;
|
|
160213
160214
|
}
|
|
160214
160215
|
salvaged.push({
|
|
160215
|
-
toolName: name$
|
|
160216
|
+
toolName: name$16,
|
|
160216
160217
|
input: typeof args === "string" ? args : JSON.stringify(args ?? {})
|
|
160217
160218
|
});
|
|
160218
160219
|
}
|
|
@@ -160526,15 +160527,15 @@ async function createRunBinary(config$4, model, audioBytes, contentType, signal)
|
|
|
160526
160527
|
const data = await response.json();
|
|
160527
160528
|
return data.result ?? data;
|
|
160528
160529
|
}
|
|
160529
|
-
function buildJsonSchemaPayload(schema, name$
|
|
160530
|
+
function buildJsonSchemaPayload(schema, name$16, description) {
|
|
160530
160531
|
if (typeof schema !== "object" || schema === null || Array.isArray(schema)) return schema;
|
|
160531
160532
|
const record$4 = schema;
|
|
160532
|
-
const addTitle = !!name$
|
|
160533
|
+
const addTitle = !!name$16 && record$4.title === void 0;
|
|
160533
160534
|
const addDescription = !!description && record$4.description === void 0;
|
|
160534
160535
|
if (!addTitle && !addDescription) return schema;
|
|
160535
160536
|
return {
|
|
160536
160537
|
...record$4,
|
|
160537
|
-
...addTitle ? { title: name$
|
|
160538
|
+
...addTitle ? { title: name$16 } : {},
|
|
160538
160539
|
...addDescription ? { description } : {}
|
|
160539
160540
|
};
|
|
160540
160541
|
}
|
|
@@ -160555,14 +160556,14 @@ function prepareToolsAndToolChoice(tools, toolChoice) {
|
|
|
160555
160556
|
tool_choice: void 0,
|
|
160556
160557
|
tools: mappedTools
|
|
160557
160558
|
};
|
|
160558
|
-
const type = toolChoice.type;
|
|
160559
|
-
switch (type) {
|
|
160559
|
+
const type$1 = toolChoice.type;
|
|
160560
|
+
switch (type$1) {
|
|
160560
160561
|
case "auto": return {
|
|
160561
|
-
tool_choice: type,
|
|
160562
|
+
tool_choice: type$1,
|
|
160562
160563
|
tools: mappedTools
|
|
160563
160564
|
};
|
|
160564
160565
|
case "none": return {
|
|
160565
|
-
tool_choice: type,
|
|
160566
|
+
tool_choice: type$1,
|
|
160566
160567
|
tools: mappedTools
|
|
160567
160568
|
};
|
|
160568
160569
|
case "required": return {
|
|
@@ -160576,7 +160577,7 @@ function prepareToolsAndToolChoice(tools, toolChoice) {
|
|
|
160576
160577
|
},
|
|
160577
160578
|
tools: mappedTools
|
|
160578
160579
|
};
|
|
160579
|
-
default: throw new Error(`Unsupported tool choice type: ${type}`);
|
|
160580
|
+
default: throw new Error(`Unsupported tool choice type: ${type$1}`);
|
|
160580
160581
|
}
|
|
160581
160582
|
}
|
|
160582
160583
|
const TOOL_CALL_ID_MARKER = "::cf-wai-tool-call::";
|
|
@@ -160756,10 +160757,10 @@ function convertToWorkersAIChatMessages(prompt) {
|
|
|
160756
160757
|
content: text$1,
|
|
160757
160758
|
role: "assistant",
|
|
160758
160759
|
...reasoning ? { reasoning } : {},
|
|
160759
|
-
tool_calls: toolCalls.length > 0 ? toolCalls.map(({ function: { name: name$
|
|
160760
|
+
tool_calls: toolCalls.length > 0 ? toolCalls.map(({ function: { name: name$16, arguments: args }, id }) => ({
|
|
160760
160761
|
function: {
|
|
160761
160762
|
arguments: args,
|
|
160762
|
-
name: name$
|
|
160763
|
+
name: name$16
|
|
160763
160764
|
},
|
|
160764
160765
|
id,
|
|
160765
160766
|
type: "function"
|
|
@@ -160889,9 +160890,9 @@ function prependStreamStart(source, warnings) {
|
|
|
160889
160890
|
}
|
|
160890
160891
|
function isNullFinalizationChunk(tc) {
|
|
160891
160892
|
const fn$1 = tc.function;
|
|
160892
|
-
const name$
|
|
160893
|
+
const name$16 = fn$1?.name ?? tc.name ?? null;
|
|
160893
160894
|
const args = fn$1?.arguments ?? tc.arguments ?? null;
|
|
160894
|
-
return !(tc.id ?? null) && !name$
|
|
160895
|
+
return !(tc.id ?? null) && !name$16 && (!args || args === "");
|
|
160895
160896
|
}
|
|
160896
160897
|
function getMappedStream(response, salvageContext) {
|
|
160897
160898
|
const rawStream = response instanceof ReadableStream ? response : response.body;
|
|
@@ -161255,7 +161256,7 @@ var WorkersAIChatLanguageModel = class {
|
|
|
161255
161256
|
return this.config.provider;
|
|
161256
161257
|
}
|
|
161257
161258
|
getArgs({ responseFormat, tools, toolChoice, maxOutputTokens, temperature, topP, frequencyPenalty, presencePenalty, seed, reasoning }) {
|
|
161258
|
-
const type = responseFormat?.type ?? "text";
|
|
161259
|
+
const type$1 = responseFormat?.type ?? "text";
|
|
161259
161260
|
const warnings = [];
|
|
161260
161261
|
if (frequencyPenalty != null) warnings.push({
|
|
161261
161262
|
feature: "frequencyPenalty",
|
|
@@ -161278,7 +161279,7 @@ var WorkersAIChatLanguageModel = class {
|
|
|
161278
161279
|
temperature,
|
|
161279
161280
|
top_p: topP
|
|
161280
161281
|
};
|
|
161281
|
-
switch (type) {
|
|
161282
|
+
switch (type$1) {
|
|
161282
161283
|
case "text": return {
|
|
161283
161284
|
args: {
|
|
161284
161285
|
...baseArgs,
|
|
@@ -161302,7 +161303,7 @@ var WorkersAIChatLanguageModel = class {
|
|
|
161302
161303
|
warnings
|
|
161303
161304
|
};
|
|
161304
161305
|
}
|
|
161305
|
-
default: throw new Error(`Unsupported type: ${type}`);
|
|
161306
|
+
default: throw new Error(`Unsupported type: ${type$1}`);
|
|
161306
161307
|
}
|
|
161307
161308
|
}
|
|
161308
161309
|
buildRunInputs(args, messages, options) {
|
|
@@ -162344,8 +162345,8 @@ A gateway defaults to "default" but can be set via \`gateway\`. Otherwise use a
|
|
|
162344
162345
|
}
|
|
162345
162346
|
var __defProp$1 = Object.defineProperty;
|
|
162346
162347
|
var __export$2 = (target, all) => {
|
|
162347
|
-
for (var name$
|
|
162348
|
-
get: all[name$
|
|
162348
|
+
for (var name$16 in all) __defProp$1(target, name$16, {
|
|
162349
|
+
get: all[name$16],
|
|
162349
162350
|
enumerable: true
|
|
162350
162351
|
});
|
|
162351
162352
|
};
|
|
@@ -162866,7 +162867,7 @@ __export$2(core_exports2, {
|
|
|
162866
162867
|
});
|
|
162867
162868
|
var NEVER = Object.freeze({ status: "aborted" });
|
|
162868
162869
|
/* @__NO_SIDE_EFFECTS__ */
|
|
162869
|
-
function $constructor(name$
|
|
162870
|
+
function $constructor(name$16, initializer3, params) {
|
|
162870
162871
|
var _a3$10;
|
|
162871
162872
|
function init$1(inst, def) {
|
|
162872
162873
|
if (!inst._zod) Object.defineProperty(inst, "_zod", {
|
|
@@ -162877,8 +162878,8 @@ function $constructor(name$15, initializer3, params) {
|
|
|
162877
162878
|
},
|
|
162878
162879
|
enumerable: false
|
|
162879
162880
|
});
|
|
162880
|
-
if (inst._zod.traits.has(name$
|
|
162881
|
-
inst._zod.traits.add(name$
|
|
162881
|
+
if (inst._zod.traits.has(name$16)) return;
|
|
162882
|
+
inst._zod.traits.add(name$16);
|
|
162882
162883
|
initializer3(inst, def);
|
|
162883
162884
|
const proto$1 = _$1.prototype;
|
|
162884
162885
|
const keys = Object.keys(proto$1);
|
|
@@ -162889,7 +162890,7 @@ function $constructor(name$15, initializer3, params) {
|
|
|
162889
162890
|
}
|
|
162890
162891
|
const Parent = (_a3$10 = params == null ? void 0 : params.Parent) != null ? _a3$10 : Object;
|
|
162891
162892
|
class Definition extends Parent {}
|
|
162892
|
-
Object.defineProperty(Definition, "name", { value: name$
|
|
162893
|
+
Object.defineProperty(Definition, "name", { value: name$16 });
|
|
162893
162894
|
function _$1(def) {
|
|
162894
162895
|
var _a4$10;
|
|
162895
162896
|
const inst = (params == null ? void 0 : params.Parent) ? new Definition() : this;
|
|
@@ -162902,9 +162903,9 @@ function $constructor(name$15, initializer3, params) {
|
|
|
162902
162903
|
Object.defineProperty(_$1, Symbol.hasInstance, { value: (inst) => {
|
|
162903
162904
|
var _a4$10, _b$13;
|
|
162904
162905
|
if ((params == null ? void 0 : params.Parent) && inst instanceof params.Parent) return true;
|
|
162905
|
-
return (_b$13 = (_a4$10 = inst == null ? void 0 : inst._zod) == null ? void 0 : _a4$10.traits) == null ? void 0 : _b$13.has(name$
|
|
162906
|
+
return (_b$13 = (_a4$10 = inst == null ? void 0 : inst._zod) == null ? void 0 : _a4$10.traits) == null ? void 0 : _b$13.has(name$16);
|
|
162906
162907
|
} });
|
|
162907
|
-
Object.defineProperty(_$1, "name", { value: name$
|
|
162908
|
+
Object.defineProperty(_$1, "name", { value: name$16 });
|
|
162908
162909
|
return _$1;
|
|
162909
162910
|
}
|
|
162910
162911
|
var $brand = Symbol("zod_brand");
|
|
@@ -162914,8 +162915,8 @@ var $ZodAsyncError = class extends Error {
|
|
|
162914
162915
|
}
|
|
162915
162916
|
};
|
|
162916
162917
|
var $ZodEncodeError = class extends Error {
|
|
162917
|
-
constructor(name$
|
|
162918
|
-
super(`Encountered unidirectional transform during encode: ${name$
|
|
162918
|
+
constructor(name$16) {
|
|
162919
|
+
super(`Encountered unidirectional transform during encode: ${name$16}`);
|
|
162919
162920
|
this.name = "ZodEncodeError";
|
|
162920
162921
|
}
|
|
162921
162922
|
};
|
|
@@ -174823,9 +174824,9 @@ function convertBaseSchema(schema, ctx) {
|
|
|
174823
174824
|
]);
|
|
174824
174825
|
}
|
|
174825
174826
|
if (schema.const !== void 0) return z$1.literal(schema.const);
|
|
174826
|
-
const type = schema.type;
|
|
174827
|
-
if (Array.isArray(type)) {
|
|
174828
|
-
const typeSchemas = type.map((t$1) => {
|
|
174827
|
+
const type$1 = schema.type;
|
|
174828
|
+
if (Array.isArray(type$1)) {
|
|
174829
|
+
const typeSchemas = type$1.map((t$1) => {
|
|
174829
174830
|
return convertBaseSchema({
|
|
174830
174831
|
...schema,
|
|
174831
174832
|
type: t$1
|
|
@@ -174835,9 +174836,9 @@ function convertBaseSchema(schema, ctx) {
|
|
|
174835
174836
|
if (typeSchemas.length === 1) return typeSchemas[0];
|
|
174836
174837
|
return z$1.union(typeSchemas);
|
|
174837
174838
|
}
|
|
174838
|
-
if (!type) return z$1.any();
|
|
174839
|
+
if (!type$1) return z$1.any();
|
|
174839
174840
|
let zodSchema$7;
|
|
174840
|
-
switch (type) {
|
|
174841
|
+
switch (type$1) {
|
|
174841
174842
|
case "string": {
|
|
174842
174843
|
let stringSchema = z$1.string();
|
|
174843
174844
|
if (schema.format) {
|
|
@@ -174874,7 +174875,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
174874
174875
|
}
|
|
174875
174876
|
case "number":
|
|
174876
174877
|
case "integer": {
|
|
174877
|
-
let numberSchema = type === "integer" ? z$1.number().int() : z$1.number();
|
|
174878
|
+
let numberSchema = type$1 === "integer" ? z$1.number().int() : z$1.number();
|
|
174878
174879
|
if (typeof schema.minimum === "number") numberSchema = numberSchema.min(schema.minimum);
|
|
174879
174880
|
if (typeof schema.maximum === "number") numberSchema = numberSchema.max(schema.maximum);
|
|
174880
174881
|
if (typeof schema.exclusiveMinimum === "number") numberSchema = numberSchema.gt(schema.exclusiveMinimum);
|
|
@@ -174964,7 +174965,7 @@ function convertBaseSchema(schema, ctx) {
|
|
|
174964
174965
|
} else zodSchema$7 = z$1.array(z$1.any());
|
|
174965
174966
|
break;
|
|
174966
174967
|
}
|
|
174967
|
-
default: throw new Error(`Unsupported type: ${type}`);
|
|
174968
|
+
default: throw new Error(`Unsupported type: ${type$1}`);
|
|
174968
174969
|
}
|
|
174969
174970
|
if (schema.description) zodSchema$7 = zodSchema$7.describe(schema.description);
|
|
174970
174971
|
if (schema.default !== void 0) zodSchema$7 = zodSchema$7.default(schema.default);
|
|
@@ -176239,9 +176240,9 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
176239
176240
|
if (env$1.TERM === "xterm-ghostty") return 3;
|
|
176240
176241
|
if (env$1.TERM === "wezterm") return 3;
|
|
176241
176242
|
if ("TERM_PROGRAM" in env$1) {
|
|
176242
|
-
const version$
|
|
176243
|
+
const version$5 = Number.parseInt((env$1.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
176243
176244
|
switch (env$1.TERM_PROGRAM) {
|
|
176244
|
-
case "iTerm.app": return version$
|
|
176245
|
+
case "iTerm.app": return version$5 >= 3 ? 3 : 2;
|
|
176245
176246
|
case "Apple_Terminal": return 2;
|
|
176246
176247
|
}
|
|
176247
176248
|
}
|
|
@@ -176322,14 +176323,14 @@ styles.visible = { get() {
|
|
|
176322
176323
|
Object.defineProperty(this, "visible", { value: builder });
|
|
176323
176324
|
return builder;
|
|
176324
176325
|
} };
|
|
176325
|
-
const getModelAnsi = (model, level, type, ...arguments_) => {
|
|
176326
|
+
const getModelAnsi = (model, level, type$1, ...arguments_) => {
|
|
176326
176327
|
if (model === "rgb") {
|
|
176327
|
-
if (level === "ansi16m") return ansi_styles_default[type].ansi16m(...arguments_);
|
|
176328
|
-
if (level === "ansi256") return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
176329
|
-
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
176328
|
+
if (level === "ansi16m") return ansi_styles_default[type$1].ansi16m(...arguments_);
|
|
176329
|
+
if (level === "ansi256") return ansi_styles_default[type$1].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
176330
|
+
return ansi_styles_default[type$1].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
176330
176331
|
}
|
|
176331
|
-
if (model === "hex") return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
176332
|
-
return ansi_styles_default[type][model](...arguments_);
|
|
176332
|
+
if (model === "hex") return getModelAnsi("rgb", level, type$1, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
176333
|
+
return ansi_styles_default[type$1][model](...arguments_);
|
|
176333
176334
|
};
|
|
176334
176335
|
for (const model of [
|
|
176335
176336
|
"rgb",
|
|
@@ -176416,9 +176417,9 @@ var require_ms = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
176416
176417
|
var y$1 = d * 365.25;
|
|
176417
176418
|
module.exports = function(val, options) {
|
|
176418
176419
|
options = options || {};
|
|
176419
|
-
var type = typeof val;
|
|
176420
|
-
if (type === "string" && val.length > 0) return parse(val);
|
|
176421
|
-
else if (type === "number" && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
|
|
176420
|
+
var type$1 = typeof val;
|
|
176421
|
+
if (type$1 === "string" && val.length > 0) return parse(val);
|
|
176422
|
+
else if (type$1 === "number" && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
|
|
176422
176423
|
throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
|
|
176423
176424
|
};
|
|
176424
176425
|
function parse(str) {
|
|
@@ -176478,9 +176479,9 @@ var require_ms = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
176478
176479
|
if (msAbs >= s) return plural(ms, msAbs, s, "second");
|
|
176479
176480
|
return ms + " ms";
|
|
176480
176481
|
}
|
|
176481
|
-
function plural(ms, msAbs, n, name$
|
|
176482
|
+
function plural(ms, msAbs, n, name$16) {
|
|
176482
176483
|
var isPlural = msAbs >= n * 1.5;
|
|
176483
|
-
return Math.round(ms / n) + " " + name$
|
|
176484
|
+
return Math.round(ms / n) + " " + name$16 + (isPlural ? "s" : "");
|
|
176484
176485
|
}
|
|
176485
176486
|
}));
|
|
176486
176487
|
var require_common = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -176602,9 +176603,9 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
176602
176603
|
createDebug.enable("");
|
|
176603
176604
|
return namespaces;
|
|
176604
176605
|
}
|
|
176605
|
-
function enabled(name$
|
|
176606
|
-
for (const skip of createDebug.skips) if (matchesTemplate(name$
|
|
176607
|
-
for (const ns of createDebug.names) if (matchesTemplate(name$
|
|
176606
|
+
function enabled(name$16) {
|
|
176607
|
+
for (const skip of createDebug.skips) if (matchesTemplate(name$16, skip)) return false;
|
|
176608
|
+
for (const ns of createDebug.names) if (matchesTemplate(name$16, ns)) return true;
|
|
176608
176609
|
return false;
|
|
176609
176610
|
}
|
|
176610
176611
|
function coerce$1(val) {
|
|
@@ -176826,9 +176827,9 @@ var require_supports_color = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
176826
176827
|
if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
176827
176828
|
if (env.COLORTERM === "truecolor") return 3;
|
|
176828
176829
|
if ("TERM_PROGRAM" in env) {
|
|
176829
|
-
const version$
|
|
176830
|
+
const version$5 = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
176830
176831
|
switch (env.TERM_PROGRAM) {
|
|
176831
|
-
case "iTerm.app": return version$
|
|
176832
|
+
case "iTerm.app": return version$5 >= 3 ? 3 : 2;
|
|
176832
176833
|
case "Apple_Terminal": return 2;
|
|
176833
176834
|
}
|
|
176834
176835
|
}
|
|
@@ -176966,14 +176967,14 @@ var require_node$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
176966
176967
|
return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty$1.isatty(process.stderr.fd);
|
|
176967
176968
|
}
|
|
176968
176969
|
function formatArgs(args) {
|
|
176969
|
-
const { namespace: name$
|
|
176970
|
+
const { namespace: name$16, useColors: useColors$2 } = this;
|
|
176970
176971
|
if (useColors$2) {
|
|
176971
176972
|
const c$2 = this.color;
|
|
176972
176973
|
const colorCode = "\x1B[3" + (c$2 < 8 ? c$2 : "8;5;" + c$2);
|
|
176973
|
-
const prefix = ` ${colorCode};1m${name$
|
|
176974
|
+
const prefix = ` ${colorCode};1m${name$16} \u001B[0m`;
|
|
176974
176975
|
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
176975
176976
|
args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
|
|
176976
|
-
} else args[0] = getDate() + name$
|
|
176977
|
+
} else args[0] = getDate() + name$16 + " " + args[0];
|
|
176977
176978
|
}
|
|
176978
176979
|
function getDate() {
|
|
176979
176980
|
if (exports.inspectOpts.hideDate) return "";
|
|
@@ -177039,8 +177040,8 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
177039
177040
|
throw e;
|
|
177040
177041
|
}
|
|
177041
177042
|
}
|
|
177042
|
-
function exists$1(path$4, type = exports.READABLE) {
|
|
177043
|
-
return check$1(path$4, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
|
|
177043
|
+
function exists$1(path$4, type$1 = exports.READABLE) {
|
|
177044
|
+
return check$1(path$4, (type$1 & exports.FILE) > 0, (type$1 & exports.FOLDER) > 0);
|
|
177044
177045
|
}
|
|
177045
177046
|
exports.exists = exists$1;
|
|
177046
177047
|
exports.FILE = 1;
|
|
@@ -177578,8 +177579,8 @@ var __commonJS = (cb, mod) => function __require$1() {
|
|
|
177578
177579
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
177579
177580
|
};
|
|
177580
177581
|
var __export = (target, all) => {
|
|
177581
|
-
for (var name$
|
|
177582
|
-
get: all[name$
|
|
177582
|
+
for (var name$16 in all) __defProp(target, name$16, {
|
|
177583
|
+
get: all[name$16],
|
|
177583
177584
|
enumerable: true
|
|
177584
177585
|
});
|
|
177585
177586
|
};
|
|
@@ -177725,8 +177726,8 @@ function filterType(input, filter$7, def) {
|
|
|
177725
177726
|
return arguments.length > 2 ? def : void 0;
|
|
177726
177727
|
}
|
|
177727
177728
|
function filterPrimitives(input, omit$5) {
|
|
177728
|
-
const type = r(input) ? "string" : typeof input;
|
|
177729
|
-
return /number|string|boolean/.test(type) && (!omit$5 || !omit$5.includes(type));
|
|
177729
|
+
const type$1 = r(input) ? "string" : typeof input;
|
|
177730
|
+
return /number|string|boolean/.test(type$1) && (!omit$5 || !omit$5.includes(type$1));
|
|
177730
177731
|
}
|
|
177731
177732
|
function filterPlainObject(input) {
|
|
177732
177733
|
return !!input && objectToString(input) === "[object Object]";
|
|
@@ -178446,8 +178447,8 @@ function prefixedLogger(to, prefix, forward) {
|
|
|
178446
178447
|
if (forward) forward(message, ...args);
|
|
178447
178448
|
};
|
|
178448
178449
|
}
|
|
178449
|
-
function childLoggerName(name$
|
|
178450
|
-
if (typeof name$
|
|
178450
|
+
function childLoggerName(name$16, childDebugger, { namespace: parentNamespace }) {
|
|
178451
|
+
if (typeof name$16 === "string") return name$16;
|
|
178451
178452
|
const childNamespace = childDebugger && childDebugger.namespace || "";
|
|
178452
178453
|
if (childNamespace.startsWith(parentNamespace)) return childNamespace.substr(parentNamespace.length + 1);
|
|
178453
178454
|
return childNamespace || parentNamespace;
|
|
@@ -178458,8 +178459,8 @@ function createLogger(label, verbose, initialStep, infoDebugger = createLog()) {
|
|
|
178458
178459
|
const debugDebugger = typeof verbose === "string" ? infoDebugger.extend(verbose) : verbose;
|
|
178459
178460
|
const key$1 = childLoggerName(filterType(verbose, filterString), debugDebugger, infoDebugger);
|
|
178460
178461
|
return step(initialStep);
|
|
178461
|
-
function sibling(name$
|
|
178462
|
-
return append(spawned, createLogger(label, key$1.replace(/^[^:]+/, name$
|
|
178462
|
+
function sibling(name$16, initial$1) {
|
|
178463
|
+
return append(spawned, createLogger(label, key$1.replace(/^[^:]+/, name$16), initial$1, infoDebugger));
|
|
178463
178464
|
}
|
|
178464
178465
|
function step(phase) {
|
|
178465
178466
|
const stepPrefix = phase && `[${phase}]` || "";
|
|
@@ -178495,11 +178496,11 @@ var init_tasks_pending_queue = __esm({ "src/lib/runners/tasks-pending-queue.ts"(
|
|
|
178495
178496
|
return this._queue.get(task);
|
|
178496
178497
|
}
|
|
178497
178498
|
createProgress(task) {
|
|
178498
|
-
const name$
|
|
178499
|
+
const name$16 = _TasksPendingQueue.getName(task.commands[0]);
|
|
178499
178500
|
return {
|
|
178500
178501
|
task,
|
|
178501
|
-
logger: createLogger(this.logLabel, name$
|
|
178502
|
-
name: name$
|
|
178502
|
+
logger: createLogger(this.logLabel, name$16),
|
|
178503
|
+
name: name$16
|
|
178503
178504
|
};
|
|
178504
178505
|
}
|
|
178505
178506
|
push(task) {
|
|
@@ -178527,8 +178528,8 @@ var init_tasks_pending_queue = __esm({ "src/lib/runners/tasks-pending-queue.ts"(
|
|
|
178527
178528
|
progress.logger("Starting task");
|
|
178528
178529
|
return progress;
|
|
178529
178530
|
}
|
|
178530
|
-
static getName(name$
|
|
178531
|
-
return `task:${name$
|
|
178531
|
+
static getName(name$16 = "empty") {
|
|
178532
|
+
return `task:${name$16}:${++_TasksPendingQueue.counter}`;
|
|
178532
178533
|
}
|
|
178533
178534
|
}, _TasksPendingQueue2.counter = 0, _TasksPendingQueue2);
|
|
178534
178535
|
} });
|
|
@@ -178544,9 +178545,9 @@ function onErrorReceived(target, logger$2) {
|
|
|
178544
178545
|
target.push(Buffer.from(String(err.stack), "ascii"));
|
|
178545
178546
|
};
|
|
178546
178547
|
}
|
|
178547
|
-
function onDataReceived(target, name$
|
|
178548
|
+
function onDataReceived(target, name$16, logger$2, output) {
|
|
178548
178549
|
return (buffer$2) => {
|
|
178549
|
-
logger$2(`%s received %L bytes`, name$
|
|
178550
|
+
logger$2(`%s received %L bytes`, name$16, buffer$2);
|
|
178550
178551
|
output(`%B`, buffer$2);
|
|
178551
178552
|
target.push(buffer$2);
|
|
178552
178553
|
};
|
|
@@ -178737,19 +178738,19 @@ function taskCallback(task, response, callback = NOOP) {
|
|
|
178737
178738
|
response.then(onSuccess, onError2);
|
|
178738
178739
|
}
|
|
178739
178740
|
function addDeprecationNoticeToError(err) {
|
|
178740
|
-
let log$4 = (name$
|
|
178741
|
-
console.warn(`simple-git deprecation notice: accessing GitResponseError.${name$
|
|
178741
|
+
let log$4 = (name$16) => {
|
|
178742
|
+
console.warn(`simple-git deprecation notice: accessing GitResponseError.${name$16} should be GitResponseError.git.${name$16}, this will no longer be available in version 3`);
|
|
178742
178743
|
log$4 = NOOP;
|
|
178743
178744
|
};
|
|
178744
178745
|
return Object.create(err, Object.getOwnPropertyNames(err.git).reduce(descriptorReducer, {}));
|
|
178745
|
-
function descriptorReducer(all, name$
|
|
178746
|
-
if (name$
|
|
178747
|
-
all[name$
|
|
178746
|
+
function descriptorReducer(all, name$16) {
|
|
178747
|
+
if (name$16 in err) return all;
|
|
178748
|
+
all[name$16] = {
|
|
178748
178749
|
enumerable: false,
|
|
178749
178750
|
configurable: false,
|
|
178750
178751
|
get() {
|
|
178751
|
-
log$4(name$
|
|
178752
|
-
return err.git[name$
|
|
178752
|
+
log$4(name$16);
|
|
178753
|
+
return err.git[name$16];
|
|
178753
178754
|
}
|
|
178754
178755
|
};
|
|
178755
178756
|
return all;
|
|
@@ -179504,8 +179505,8 @@ var init_parse_push = __esm({ "src/lib/parsers/parse-push.ts"() {
|
|
|
179504
179505
|
local
|
|
179505
179506
|
};
|
|
179506
179507
|
}),
|
|
179507
|
-
new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => {
|
|
179508
|
-
result.pushed.push(pushResultPushedItem(local, remote, type));
|
|
179508
|
+
new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type$1]) => {
|
|
179509
|
+
result.pushed.push(pushResultPushedItem(local, remote, type$1));
|
|
179509
179510
|
}),
|
|
179510
179511
|
new LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/, (result, [local, remote, remoteName]) => {
|
|
179511
179512
|
result.branch = {
|
|
@@ -180022,16 +180023,16 @@ var init_BranchSummary = __esm({ "src/lib/responses/BranchSummary.ts"() {
|
|
|
180022
180023
|
this.current = "";
|
|
180023
180024
|
this.detached = false;
|
|
180024
180025
|
}
|
|
180025
|
-
push(status, detached, name$
|
|
180026
|
+
push(status, detached, name$16, commit, label) {
|
|
180026
180027
|
if (status === "*") {
|
|
180027
180028
|
this.detached = detached;
|
|
180028
|
-
this.current = name$
|
|
180029
|
+
this.current = name$16;
|
|
180029
180030
|
}
|
|
180030
|
-
this.all.push(name$
|
|
180031
|
-
this.branches[name$
|
|
180031
|
+
this.all.push(name$16);
|
|
180032
|
+
this.branches[name$16] = {
|
|
180032
180033
|
current: status === "*",
|
|
180033
180034
|
linkedWorkTree: status === "+",
|
|
180034
|
-
name: name$
|
|
180035
|
+
name: name$16,
|
|
180035
180036
|
commit,
|
|
180036
180037
|
label
|
|
180037
180038
|
};
|
|
@@ -180048,13 +180049,13 @@ var parsers9, currentBranchParser;
|
|
|
180048
180049
|
var init_parse_branch = __esm({ "src/lib/parsers/parse-branch.ts"() {
|
|
180049
180050
|
init_BranchSummary();
|
|
180050
180051
|
init_utils();
|
|
180051
|
-
parsers9 = [new LineParser(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/, (result, [current, name$
|
|
180052
|
-
result.push(branchStatus(current), true, name$
|
|
180053
|
-
}), new LineParser(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s, (result, [current, name$
|
|
180054
|
-
result.push(branchStatus(current), false, name$
|
|
180052
|
+
parsers9 = [new LineParser(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/, (result, [current, name$16, commit, label]) => {
|
|
180053
|
+
result.push(branchStatus(current), true, name$16, commit, label);
|
|
180054
|
+
}), new LineParser(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s, (result, [current, name$16, commit, label]) => {
|
|
180055
|
+
result.push(branchStatus(current), false, name$16, commit, label);
|
|
180055
180056
|
})];
|
|
180056
|
-
currentBranchParser = new LineParser(/^(\S+)$/s, (result, [name$
|
|
180057
|
-
result.push("*", false, name$
|
|
180057
|
+
currentBranchParser = new LineParser(/^(\S+)$/s, (result, [name$16]) => {
|
|
180058
|
+
result.push("*", false, name$16, "", "");
|
|
180058
180059
|
});
|
|
180059
180060
|
} });
|
|
180060
180061
|
var branch_exports = {};
|
|
@@ -180179,24 +180180,24 @@ var init_parse_fetch = __esm({ "src/lib/parsers/parse-fetch.ts"() {
|
|
|
180179
180180
|
new LineParser(/From (.+)$/, (result, [remote]) => {
|
|
180180
180181
|
result.remote = remote;
|
|
180181
180182
|
}),
|
|
180182
|
-
new LineParser(/\* \[new branch]\s+(\S+)\s*-> (.+)$/, (result, [name$
|
|
180183
|
+
new LineParser(/\* \[new branch]\s+(\S+)\s*-> (.+)$/, (result, [name$16, tracking]) => {
|
|
180183
180184
|
result.branches.push({
|
|
180184
|
-
name: name$
|
|
180185
|
+
name: name$16,
|
|
180185
180186
|
tracking
|
|
180186
180187
|
});
|
|
180187
180188
|
}),
|
|
180188
|
-
new LineParser(/\* \[new tag]\s+(\S+)\s*-> (.+)$/, (result, [name$
|
|
180189
|
+
new LineParser(/\* \[new tag]\s+(\S+)\s*-> (.+)$/, (result, [name$16, tracking]) => {
|
|
180189
180190
|
result.tags.push({
|
|
180190
|
-
name: name$
|
|
180191
|
+
name: name$16,
|
|
180191
180192
|
tracking
|
|
180192
180193
|
});
|
|
180193
180194
|
}),
|
|
180194
180195
|
new LineParser(/- \[deleted]\s+\S+\s*-> (.+)$/, (result, [tracking]) => {
|
|
180195
180196
|
result.deleted.push({ tracking });
|
|
180196
180197
|
}),
|
|
180197
|
-
new LineParser(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/, (result, [from, to, name$
|
|
180198
|
+
new LineParser(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/, (result, [from, to, name$16, tracking]) => {
|
|
180198
180199
|
result.updated.push({
|
|
180199
|
-
name: name$
|
|
180200
|
+
name: name$16,
|
|
180200
180201
|
tracking,
|
|
180201
180202
|
to,
|
|
180202
180203
|
from
|
|
@@ -180279,20 +180280,20 @@ var init_pull = __esm({ "src/lib/tasks/pull.ts"() {
|
|
|
180279
180280
|
} });
|
|
180280
180281
|
function parseGetRemotes(text$1) {
|
|
180281
180282
|
const remotes = {};
|
|
180282
|
-
forEach(text$1, ([name$
|
|
180283
|
+
forEach(text$1, ([name$16]) => remotes[name$16] = { name: name$16 });
|
|
180283
180284
|
return Object.values(remotes);
|
|
180284
180285
|
}
|
|
180285
180286
|
function parseGetRemotesVerbose(text$1) {
|
|
180286
180287
|
const remotes = {};
|
|
180287
|
-
forEach(text$1, ([name$
|
|
180288
|
-
if (!Object.hasOwn(remotes, name$
|
|
180289
|
-
name: name$
|
|
180288
|
+
forEach(text$1, ([name$16, url$4, purpose]) => {
|
|
180289
|
+
if (!Object.hasOwn(remotes, name$16)) remotes[name$16] = {
|
|
180290
|
+
name: name$16,
|
|
180290
180291
|
refs: {
|
|
180291
180292
|
fetch: "",
|
|
180292
180293
|
push: ""
|
|
180293
180294
|
}
|
|
180294
180295
|
};
|
|
180295
|
-
if (purpose && url$4) remotes[name$
|
|
180296
|
+
if (purpose && url$4) remotes[name$16].refs[purpose.replace(/[^a-z]/g, "")] = url$4;
|
|
180296
180297
|
});
|
|
180297
180298
|
return Object.values(remotes);
|
|
180298
180299
|
}
|
|
@@ -180459,16 +180460,16 @@ function tagListTask(customArgs = []) {
|
|
|
180459
180460
|
}
|
|
180460
180461
|
};
|
|
180461
180462
|
}
|
|
180462
|
-
function addTagTask(name$
|
|
180463
|
+
function addTagTask(name$16) {
|
|
180463
180464
|
return {
|
|
180464
180465
|
format: "utf-8",
|
|
180465
|
-
commands: ["tag", name$
|
|
180466
|
+
commands: ["tag", name$16],
|
|
180466
180467
|
parser() {
|
|
180467
|
-
return { name: name$
|
|
180468
|
+
return { name: name$16 };
|
|
180468
180469
|
}
|
|
180469
180470
|
};
|
|
180470
180471
|
}
|
|
180471
|
-
function addAnnotatedTagTask(name$
|
|
180472
|
+
function addAnnotatedTagTask(name$16, tagMessage) {
|
|
180472
180473
|
return {
|
|
180473
180474
|
format: "utf-8",
|
|
180474
180475
|
commands: [
|
|
@@ -180476,10 +180477,10 @@ function addAnnotatedTagTask(name$15, tagMessage) {
|
|
|
180476
180477
|
"-a",
|
|
180477
180478
|
"-m",
|
|
180478
180479
|
tagMessage,
|
|
180479
|
-
name$
|
|
180480
|
+
name$16
|
|
180480
180481
|
],
|
|
180481
180482
|
parser() {
|
|
180482
|
-
return { name: name$
|
|
180483
|
+
return { name: name$16 };
|
|
180483
180484
|
}
|
|
180484
180485
|
};
|
|
180485
180486
|
}
|
|
@@ -180518,9 +180519,9 @@ var require_git = __commonJS({ "src/git.js"(exports$1, module$2) {
|
|
|
180518
180519
|
this._plugins.reconfigure("binary", command);
|
|
180519
180520
|
return this;
|
|
180520
180521
|
};
|
|
180521
|
-
Git2.prototype.env = function(name$
|
|
180522
|
-
if (arguments.length === 1 && typeof name$
|
|
180523
|
-
else (this._executor.env = this._executor.env || {})[name$
|
|
180522
|
+
Git2.prototype.env = function(name$16, value) {
|
|
180523
|
+
if (arguments.length === 1 && typeof name$16 === "object") this._executor.env = name$16;
|
|
180524
|
+
else (this._executor.env = this._executor.env || {})[name$16] = value;
|
|
180524
180525
|
return this;
|
|
180525
180526
|
};
|
|
180526
180527
|
Git2.prototype.stashList = function(options) {
|
|
@@ -180564,8 +180565,8 @@ var require_git = __commonJS({ "src/git.js"(exports$1, module$2) {
|
|
|
180564
180565
|
commit
|
|
180565
180566
|
]), next);
|
|
180566
180567
|
};
|
|
180567
|
-
Git2.prototype.addTag = function(name$
|
|
180568
|
-
const task = typeof name$
|
|
180568
|
+
Git2.prototype.addTag = function(name$16) {
|
|
180569
|
+
const task = typeof name$16 === "string" ? addTagTask2(name$16) : configurationErrorTask2("Git.addTag requires a tag name");
|
|
180569
180570
|
return this._runTask(task, trailingFunctionArgument2(arguments));
|
|
180570
180571
|
};
|
|
180571
180572
|
Git2.prototype.addAnnotatedTag = function(tagName, tagMessage) {
|
|
@@ -180881,15 +180882,15 @@ var PluginStore = class {
|
|
|
180881
180882
|
this.plugins = /* @__PURE__ */ new Set();
|
|
180882
180883
|
this.events = new EventEmitter();
|
|
180883
180884
|
}
|
|
180884
|
-
on(type, listener) {
|
|
180885
|
-
this.events.on(type, listener);
|
|
180885
|
+
on(type$1, listener) {
|
|
180886
|
+
this.events.on(type$1, listener);
|
|
180886
180887
|
}
|
|
180887
|
-
reconfigure(type, data) {
|
|
180888
|
-
this.events.emit(type, data);
|
|
180888
|
+
reconfigure(type$1, data) {
|
|
180889
|
+
this.events.emit(type$1, data);
|
|
180889
180890
|
}
|
|
180890
|
-
append(type, action) {
|
|
180891
|
+
append(type$1, action) {
|
|
180891
180892
|
const plugin = append(this.plugins, {
|
|
180892
|
-
type,
|
|
180893
|
+
type: type$1,
|
|
180893
180894
|
action
|
|
180894
180895
|
});
|
|
180895
180896
|
return () => this.plugins.delete(plugin);
|
|
@@ -180901,10 +180902,10 @@ var PluginStore = class {
|
|
|
180901
180902
|
plugins.forEach((plugin2) => this.plugins.delete(plugin2));
|
|
180902
180903
|
};
|
|
180903
180904
|
}
|
|
180904
|
-
exec(type, data, context) {
|
|
180905
|
+
exec(type$1, data, context) {
|
|
180905
180906
|
let output = data;
|
|
180906
180907
|
const contextual = Object.freeze(Object.create(context));
|
|
180907
|
-
for (const plugin of this.plugins) if (plugin.type === type) output = plugin.action(output, contextual);
|
|
180908
|
+
for (const plugin of this.plugins) if (plugin.type === type$1) output = plugin.action(output, contextual);
|
|
180908
180909
|
return output;
|
|
180909
180910
|
}
|
|
180910
180911
|
};
|
|
@@ -181128,8 +181129,8 @@ async function generateCommitMessage(languageModel, instructions, diff) {
|
|
|
181128
181129
|
function resolveLanguageModel(modelConfig) {
|
|
181129
181130
|
const envVarNames = Array.isArray(modelConfig.apiKeyEnv) ? modelConfig.apiKeyEnv : [modelConfig.apiKeyEnv];
|
|
181130
181131
|
let apiKey = null;
|
|
181131
|
-
for (const name$
|
|
181132
|
-
const value = process.env[name$
|
|
181132
|
+
for (const name$16 of envVarNames) {
|
|
181133
|
+
const value = process.env[name$16];
|
|
181133
181134
|
if (value !== void 0 && value.length > 0) {
|
|
181134
181135
|
apiKey = value;
|
|
181135
181136
|
break;
|
|
@@ -182580,12 +182581,12 @@ function normalizeChoices$4(choices) {
|
|
|
182580
182581
|
disabled: false,
|
|
182581
182582
|
checked: false
|
|
182582
182583
|
};
|
|
182583
|
-
const name$
|
|
182584
|
+
const name$16 = choice$1.name ?? String(choice$1.value);
|
|
182584
182585
|
const normalizedChoice = {
|
|
182585
182586
|
value: choice$1.value,
|
|
182586
|
-
name: name$
|
|
182587
|
-
short: choice$1.short ?? name$
|
|
182588
|
-
checkedName: choice$1.checkedName ?? name$
|
|
182587
|
+
name: name$16,
|
|
182588
|
+
short: choice$1.short ?? name$16,
|
|
182589
|
+
checkedName: choice$1.checkedName ?? name$16,
|
|
182589
182590
|
disabled: choice$1.disabled ?? false,
|
|
182590
182591
|
checked: choice$1.checked ?? false
|
|
182591
182592
|
};
|
|
@@ -182679,8 +182680,8 @@ createPrompt((config$4, done) => {
|
|
|
182679
182680
|
}
|
|
182680
182681
|
if (isActive) description = item.description;
|
|
182681
182682
|
const checkbox = item.checked ? theme.icon.checked : theme.icon.unchecked;
|
|
182682
|
-
const name$
|
|
182683
|
-
return (isActive ? theme.style.highlight : (x$2) => x$2)(`${cursor}${checkbox} ${name$
|
|
182683
|
+
const name$16 = item.checked ? item.checkedName : item.name;
|
|
182684
|
+
return (isActive ? theme.style.highlight : (x$2) => x$2)(`${cursor}${checkbox} ${name$16}`);
|
|
182684
182685
|
},
|
|
182685
182686
|
pageSize,
|
|
182686
182687
|
loop
|
|
@@ -197352,10 +197353,10 @@ createPrompt((config$4, done) => {
|
|
|
197352
197353
|
function normalizeChoices$3(choices) {
|
|
197353
197354
|
return choices.map((choice$1) => {
|
|
197354
197355
|
if (Separator.isSeparator(choice$1)) return choice$1;
|
|
197355
|
-
const name$
|
|
197356
|
+
const name$16 = "name" in choice$1 ? choice$1.name : String(choice$1.value);
|
|
197356
197357
|
return {
|
|
197357
|
-
value: "value" in choice$1 ? choice$1.value : name$
|
|
197358
|
-
name: name$
|
|
197358
|
+
value: "value" in choice$1 ? choice$1.value : name$16,
|
|
197359
|
+
name: name$16,
|
|
197359
197360
|
key: choice$1.key.toLowerCase()
|
|
197360
197361
|
};
|
|
197361
197362
|
});
|
|
@@ -197439,19 +197440,19 @@ function normalizeChoices$2(choices) {
|
|
|
197439
197440
|
if (Separator.isSeparator(choice$1)) return choice$1;
|
|
197440
197441
|
index$2 += 1;
|
|
197441
197442
|
if (typeof choice$1 !== "object" || choice$1 === null || !("value" in choice$1)) {
|
|
197442
|
-
const name$
|
|
197443
|
+
const name$17 = String(choice$1);
|
|
197443
197444
|
return {
|
|
197444
197445
|
value: choice$1,
|
|
197445
|
-
name: name$
|
|
197446
|
-
short: name$
|
|
197446
|
+
name: name$17,
|
|
197447
|
+
short: name$17,
|
|
197447
197448
|
key: String(index$2)
|
|
197448
197449
|
};
|
|
197449
197450
|
}
|
|
197450
|
-
const name$
|
|
197451
|
+
const name$16 = choice$1.name ?? String(choice$1.value);
|
|
197451
197452
|
return {
|
|
197452
197453
|
value: choice$1.value,
|
|
197453
|
-
name: name$
|
|
197454
|
-
short: choice$1.short ?? name$
|
|
197454
|
+
name: name$16,
|
|
197455
|
+
short: choice$1.short ?? name$16,
|
|
197455
197456
|
key: choice$1.key ?? String(index$2),
|
|
197456
197457
|
description: choice$1.description
|
|
197457
197458
|
};
|
|
@@ -197597,11 +197598,11 @@ function normalizeChoices$1(choices) {
|
|
|
197597
197598
|
short: choice$1,
|
|
197598
197599
|
disabled: false
|
|
197599
197600
|
};
|
|
197600
|
-
const name$
|
|
197601
|
+
const name$16 = choice$1.name ?? String(choice$1.value);
|
|
197601
197602
|
const normalizedChoice = {
|
|
197602
197603
|
value: choice$1.value,
|
|
197603
|
-
name: name$
|
|
197604
|
-
short: choice$1.short ?? name$
|
|
197604
|
+
name: name$16,
|
|
197605
|
+
short: choice$1.short ?? name$16,
|
|
197605
197606
|
disabled: choice$1.disabled ?? false
|
|
197606
197607
|
};
|
|
197607
197608
|
if (choice$1.description) normalizedChoice.description = choice$1.description;
|
|
@@ -197746,19 +197747,19 @@ function normalizeChoices(choices) {
|
|
|
197746
197747
|
return choices.map((choice$1) => {
|
|
197747
197748
|
if (Separator.isSeparator(choice$1)) return choice$1;
|
|
197748
197749
|
if (typeof choice$1 !== "object" || choice$1 === null || !("value" in choice$1)) {
|
|
197749
|
-
const name$
|
|
197750
|
+
const name$17 = String(choice$1);
|
|
197750
197751
|
return {
|
|
197751
197752
|
value: choice$1,
|
|
197752
|
-
name: name$
|
|
197753
|
-
short: name$
|
|
197753
|
+
name: name$17,
|
|
197754
|
+
short: name$17,
|
|
197754
197755
|
disabled: false
|
|
197755
197756
|
};
|
|
197756
197757
|
}
|
|
197757
|
-
const name$
|
|
197758
|
+
const name$16 = choice$1.name ?? String(choice$1.value);
|
|
197758
197759
|
const normalizedChoice = {
|
|
197759
197760
|
value: choice$1.value,
|
|
197760
|
-
name: name$
|
|
197761
|
-
short: choice$1.short ?? name$
|
|
197761
|
+
name: name$16,
|
|
197762
|
+
short: choice$1.short ?? name$16,
|
|
197762
197763
|
disabled: choice$1.disabled ?? false
|
|
197763
197764
|
};
|
|
197764
197765
|
if (choice$1.description) normalizedChoice.description = choice$1.description;
|
|
@@ -197901,23 +197902,21 @@ const commitMessageInputPrompt = createPrompt((config$4, done) => {
|
|
|
197901
197902
|
done(answer);
|
|
197902
197903
|
});
|
|
197903
197904
|
const header = `${status === "done" ? source_default.green("✓") : source_default.blue("?")} ${(status === "done" ? source_default.green : source_default.blue)(config$4.message)}`;
|
|
197904
|
-
if (status === "done")
|
|
197905
|
-
if (value.length === 0) return header;
|
|
197906
|
-
return `${header}\n${source_default.cyan.dim(value)}`;
|
|
197907
|
-
}
|
|
197905
|
+
if (status === "done") return header;
|
|
197908
197906
|
return `${header}\n${inputPrefix}${value}`;
|
|
197909
197907
|
});
|
|
197910
|
-
async function
|
|
197911
|
-
|
|
197912
|
-
|
|
197913
|
-
|
|
197914
|
-
|
|
197915
|
-
|
|
197916
|
-
|
|
197917
|
-
|
|
197918
|
-
|
|
197919
|
-
|
|
197920
|
-
|
|
197908
|
+
async function acceptGeneratedCommitMessage() {
|
|
197909
|
+
const normalized = (await dist_default$1({
|
|
197910
|
+
message: `Accept generated commit message? ${source_default.reset.dim("[Y/r]")}`,
|
|
197911
|
+
theme: selectionTheme,
|
|
197912
|
+
validate: (v$1) => {
|
|
197913
|
+
const normalized$1 = v$1.trim();
|
|
197914
|
+
if (normalized$1 === "Y" || normalized$1 === "y" || normalized$1 === "r" || normalized$1 === "") return true;
|
|
197915
|
+
return "Press Enter for yes, or type r to generate a new commit message.";
|
|
197916
|
+
}
|
|
197917
|
+
})).trim().toLowerCase();
|
|
197918
|
+
if (normalized === "" || normalized === "y") return true;
|
|
197919
|
+
return false;
|
|
197921
197920
|
}
|
|
197922
197921
|
async function promptForCommitMessageInput(model) {
|
|
197923
197922
|
return (await commitMessageInputPrompt({
|
|
@@ -197983,7 +197982,14 @@ async function mainController(options = {}) {
|
|
|
197983
197982
|
console.log(source_default.cyan.dim(finalCommitMessage));
|
|
197984
197983
|
console.log("");
|
|
197985
197984
|
}
|
|
197986
|
-
if (finalCommitMessage.length === 0 && !forceLLMGenerate)
|
|
197985
|
+
if (finalCommitMessage.length === 0 && !forceLLMGenerate) {
|
|
197986
|
+
finalCommitMessage = await promptForCommitMessageInput(modelConfig.model);
|
|
197987
|
+
if (finalCommitMessage.length > 0) {
|
|
197988
|
+
console.log(source_default.yellow("✓ Using manual commit message"));
|
|
197989
|
+
console.log(source_default.cyan.dim(finalCommitMessage));
|
|
197990
|
+
console.log("");
|
|
197991
|
+
}
|
|
197992
|
+
}
|
|
197987
197993
|
if (finalCommitMessage.length === 0) while (true) {
|
|
197988
197994
|
if (forceLLMGenerate) console.log(source_default.yellow("• Using LLM to generate message"));
|
|
197989
197995
|
finalCommitMessage = (await runWithLoading("Generating commit message", () => generateCommitMessage(languageModel, config$4.instructions ?? null, diff))).trim();
|
|
@@ -197991,18 +197997,17 @@ async function mainController(options = {}) {
|
|
|
197991
197997
|
console.log(source_default.cyan.dim(finalCommitMessage));
|
|
197992
197998
|
console.log("");
|
|
197993
197999
|
if (forceLLMGenerate || config$4.autoAcceptCommitMessage) break;
|
|
197994
|
-
|
|
197995
|
-
if (action === "accept" || action === "cancel") break;
|
|
198000
|
+
if (await acceptGeneratedCommitMessage()) break;
|
|
197996
198001
|
}
|
|
197997
198002
|
if (finalCommitMessage.length === 0) throw new Error("Commit message cannot be empty.");
|
|
197998
|
-
console.log(source_default.green("✓ Committing changes"));
|
|
198003
|
+
if (forceLLMGenerate) console.log(source_default.green("✓ Committing changes"));
|
|
197999
198004
|
if (!hasStaged) await git.add(["-A"]);
|
|
198000
198005
|
console.log(files.join("\n"));
|
|
198001
198006
|
console.log("");
|
|
198002
198007
|
await liveGit.commit(finalCommitMessage);
|
|
198003
198008
|
console.log("");
|
|
198004
198009
|
if (!config$4.postCommand) return;
|
|
198005
|
-
if (forceExecPostCommand || config$4.autoRunPostCommand) console.log(source_default.yellow
|
|
198010
|
+
if (forceExecPostCommand || config$4.autoRunPostCommand) console.log(source_default.yellow(`✓ Executing: ${config$4.postCommand}`));
|
|
198006
198011
|
else if (!await promptForPostCommand(config$4.postCommand)) return;
|
|
198007
198012
|
await liveGit.push();
|
|
198008
198013
|
if (config$4.postCommand === "push-and-pull") await liveGit.pull();
|
|
@@ -198012,12 +198017,12 @@ function handleError(fn$1) {
|
|
|
198012
198017
|
Promise.resolve().then(fn$1).catch((err) => {
|
|
198013
198018
|
if (err instanceof AppUserCanceledError) return console.log("Cancelled.");
|
|
198014
198019
|
if (err instanceof Error) {
|
|
198015
|
-
console.error("ERROR:", err.message);
|
|
198020
|
+
console.error(source_default.red("ERROR:"), err.message);
|
|
198016
198021
|
process.exit(1);
|
|
198017
198022
|
}
|
|
198018
198023
|
});
|
|
198019
198024
|
}
|
|
198020
|
-
const app = new Command().name("gityo").description("Stage changes, generate or enter a commit message, create a commit, and run a post-commit git command.").option("-g, --generate", "Generate a commit message and commit without asking.").option("-m, --message <message>", "Use the provided message as the commit message.").option("-p, --post", "Run the post-commit git command without asking.").option("--model <model>", "Model key from config to use (defaults to \"default\").").option("-y, --yolo", "Skip all questions, and generate message, commit, run post command. [Will fail if no model available]").action((options) => {
|
|
198025
|
+
const app = new Command().name("gityo").version(`v${version$4}`, "-v, --version", "Show the current version.").description("Stage changes, generate or enter a commit message, create a commit, and run a post-commit git command.").option("-g, --generate", "Generate a commit message and commit without asking.").option("-m, --message <message>", "Use the provided message as the commit message.").option("-p, --post", "Run the post-commit git command without asking.").option("--model <model>", "Model key from config to use (defaults to \"default\").").option("-y, --yolo", "Skip all questions, and generate message, commit, run post command. [Will fail if no model available]").action((options) => {
|
|
198021
198026
|
if (options.generate && options.message) {
|
|
198022
198027
|
console.error("Cannot use --generate and --message together.");
|
|
198023
198028
|
process.exit(1);
|