@chosengeneration/light-code 0.182.0 → 0.185.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +988 -691
- package/dist/server.cjs +918 -688
- package/package.json +1 -1
package/dist/server.cjs
CHANGED
|
@@ -17821,52 +17821,52 @@ var require_util8 = __commonJS({
|
|
|
17821
17821
|
return hash3;
|
|
17822
17822
|
}
|
|
17823
17823
|
exports2.toHash = toHash;
|
|
17824
|
-
function alwaysValidSchema(it,
|
|
17825
|
-
if (typeof
|
|
17826
|
-
return
|
|
17827
|
-
if (Object.keys(
|
|
17824
|
+
function alwaysValidSchema(it, schema12) {
|
|
17825
|
+
if (typeof schema12 == "boolean")
|
|
17826
|
+
return schema12;
|
|
17827
|
+
if (Object.keys(schema12).length === 0)
|
|
17828
17828
|
return true;
|
|
17829
|
-
checkUnknownRules(it,
|
|
17830
|
-
return !schemaHasRules(
|
|
17829
|
+
checkUnknownRules(it, schema12);
|
|
17830
|
+
return !schemaHasRules(schema12, it.self.RULES.all);
|
|
17831
17831
|
}
|
|
17832
17832
|
exports2.alwaysValidSchema = alwaysValidSchema;
|
|
17833
|
-
function checkUnknownRules(it,
|
|
17833
|
+
function checkUnknownRules(it, schema12 = it.schema) {
|
|
17834
17834
|
const { opts, self } = it;
|
|
17835
17835
|
if (!opts.strictSchema)
|
|
17836
17836
|
return;
|
|
17837
|
-
if (typeof
|
|
17837
|
+
if (typeof schema12 === "boolean")
|
|
17838
17838
|
return;
|
|
17839
17839
|
const rules = self.RULES.keywords;
|
|
17840
|
-
for (const key3 in
|
|
17840
|
+
for (const key3 in schema12) {
|
|
17841
17841
|
if (!rules[key3])
|
|
17842
17842
|
checkStrictMode(it, `unknown keyword: "${key3}"`);
|
|
17843
17843
|
}
|
|
17844
17844
|
}
|
|
17845
17845
|
exports2.checkUnknownRules = checkUnknownRules;
|
|
17846
|
-
function schemaHasRules(
|
|
17847
|
-
if (typeof
|
|
17848
|
-
return !
|
|
17849
|
-
for (const key3 in
|
|
17846
|
+
function schemaHasRules(schema12, rules) {
|
|
17847
|
+
if (typeof schema12 == "boolean")
|
|
17848
|
+
return !schema12;
|
|
17849
|
+
for (const key3 in schema12)
|
|
17850
17850
|
if (rules[key3])
|
|
17851
17851
|
return true;
|
|
17852
17852
|
return false;
|
|
17853
17853
|
}
|
|
17854
17854
|
exports2.schemaHasRules = schemaHasRules;
|
|
17855
|
-
function schemaHasRulesButRef(
|
|
17856
|
-
if (typeof
|
|
17857
|
-
return !
|
|
17858
|
-
for (const key3 in
|
|
17855
|
+
function schemaHasRulesButRef(schema12, RULES) {
|
|
17856
|
+
if (typeof schema12 == "boolean")
|
|
17857
|
+
return !schema12;
|
|
17858
|
+
for (const key3 in schema12)
|
|
17859
17859
|
if (key3 !== "$ref" && RULES.all[key3])
|
|
17860
17860
|
return true;
|
|
17861
17861
|
return false;
|
|
17862
17862
|
}
|
|
17863
17863
|
exports2.schemaHasRulesButRef = schemaHasRulesButRef;
|
|
17864
|
-
function schemaRefOrVal({ topSchemaRef, schemaPath },
|
|
17864
|
+
function schemaRefOrVal({ topSchemaRef, schemaPath }, schema12, keyword, $data) {
|
|
17865
17865
|
if (!$data) {
|
|
17866
|
-
if (typeof
|
|
17867
|
-
return
|
|
17868
|
-
if (typeof
|
|
17869
|
-
return (0, codegen_1._)`${
|
|
17866
|
+
if (typeof schema12 == "number" || typeof schema12 == "boolean")
|
|
17867
|
+
return schema12;
|
|
17868
|
+
if (typeof schema12 == "string")
|
|
17869
|
+
return (0, codegen_1._)`${schema12}`;
|
|
17870
17870
|
}
|
|
17871
17871
|
return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
|
|
17872
17872
|
}
|
|
@@ -18147,10 +18147,10 @@ var require_boolSchema = __commonJS({
|
|
|
18147
18147
|
message: "boolean schema is false"
|
|
18148
18148
|
};
|
|
18149
18149
|
function topBoolOrEmptySchema(it) {
|
|
18150
|
-
const { gen, schema:
|
|
18151
|
-
if (
|
|
18150
|
+
const { gen, schema: schema12, validateName } = it;
|
|
18151
|
+
if (schema12 === false) {
|
|
18152
18152
|
falseSchemaError(it, false);
|
|
18153
|
-
} else if (typeof
|
|
18153
|
+
} else if (typeof schema12 == "object" && schema12.$async === true) {
|
|
18154
18154
|
gen.return(names_1.default.data);
|
|
18155
18155
|
} else {
|
|
18156
18156
|
gen.assign((0, codegen_1._)`${validateName}.errors`, null);
|
|
@@ -18159,8 +18159,8 @@ var require_boolSchema = __commonJS({
|
|
|
18159
18159
|
}
|
|
18160
18160
|
exports2.topBoolOrEmptySchema = topBoolOrEmptySchema;
|
|
18161
18161
|
function boolOrEmptySchema(it, valid) {
|
|
18162
|
-
const { gen, schema:
|
|
18163
|
-
if (
|
|
18162
|
+
const { gen, schema: schema12 } = it;
|
|
18163
|
+
if (schema12 === false) {
|
|
18164
18164
|
gen.var(valid, false);
|
|
18165
18165
|
falseSchemaError(it);
|
|
18166
18166
|
} else {
|
|
@@ -18222,18 +18222,18 @@ var require_applicability = __commonJS({
|
|
|
18222
18222
|
"use strict";
|
|
18223
18223
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
18224
18224
|
exports2.shouldUseRule = exports2.shouldUseGroup = exports2.schemaHasRulesForType = void 0;
|
|
18225
|
-
function schemaHasRulesForType({ schema:
|
|
18225
|
+
function schemaHasRulesForType({ schema: schema12, self }, type) {
|
|
18226
18226
|
const group = self.RULES.types[type];
|
|
18227
|
-
return group && group !== true && shouldUseGroup(
|
|
18227
|
+
return group && group !== true && shouldUseGroup(schema12, group);
|
|
18228
18228
|
}
|
|
18229
18229
|
exports2.schemaHasRulesForType = schemaHasRulesForType;
|
|
18230
|
-
function shouldUseGroup(
|
|
18231
|
-
return group.rules.some((rule) => shouldUseRule(
|
|
18230
|
+
function shouldUseGroup(schema12, group) {
|
|
18231
|
+
return group.rules.some((rule) => shouldUseRule(schema12, rule));
|
|
18232
18232
|
}
|
|
18233
18233
|
exports2.shouldUseGroup = shouldUseGroup;
|
|
18234
|
-
function shouldUseRule(
|
|
18234
|
+
function shouldUseRule(schema12, rule) {
|
|
18235
18235
|
var _a3;
|
|
18236
|
-
return
|
|
18236
|
+
return schema12[rule.keyword] !== void 0 || ((_a3 = rule.definition.implements) === null || _a3 === void 0 ? void 0 : _a3.some((kwd) => schema12[kwd] !== void 0));
|
|
18237
18237
|
}
|
|
18238
18238
|
exports2.shouldUseRule = shouldUseRule;
|
|
18239
18239
|
}
|
|
@@ -18255,17 +18255,17 @@ var require_dataType = __commonJS({
|
|
|
18255
18255
|
DataType2[DataType2["Correct"] = 0] = "Correct";
|
|
18256
18256
|
DataType2[DataType2["Wrong"] = 1] = "Wrong";
|
|
18257
18257
|
})(DataType || (exports2.DataType = DataType = {}));
|
|
18258
|
-
function getSchemaTypes(
|
|
18259
|
-
const types = getJSONTypes(
|
|
18258
|
+
function getSchemaTypes(schema12) {
|
|
18259
|
+
const types = getJSONTypes(schema12.type);
|
|
18260
18260
|
const hasNull = types.includes("null");
|
|
18261
18261
|
if (hasNull) {
|
|
18262
|
-
if (
|
|
18262
|
+
if (schema12.nullable === false)
|
|
18263
18263
|
throw new Error("type: null contradicts nullable: false");
|
|
18264
18264
|
} else {
|
|
18265
|
-
if (!types.length &&
|
|
18265
|
+
if (!types.length && schema12.nullable !== void 0) {
|
|
18266
18266
|
throw new Error('"nullable" cannot be used without "type"');
|
|
18267
18267
|
}
|
|
18268
|
-
if (
|
|
18268
|
+
if (schema12.nullable === true)
|
|
18269
18269
|
types.push("null");
|
|
18270
18270
|
}
|
|
18271
18271
|
return types;
|
|
@@ -18397,8 +18397,8 @@ var require_dataType = __commonJS({
|
|
|
18397
18397
|
}
|
|
18398
18398
|
exports2.checkDataTypes = checkDataTypes;
|
|
18399
18399
|
var typeError = {
|
|
18400
|
-
message: ({ schema:
|
|
18401
|
-
params: ({ schema:
|
|
18400
|
+
message: ({ schema: schema12 }) => `must be ${schema12}`,
|
|
18401
|
+
params: ({ schema: schema12, schemaValue }) => typeof schema12 == "string" ? (0, codegen_1._)`{type: ${schema12}}` : (0, codegen_1._)`{type: ${schemaValue}}`
|
|
18402
18402
|
};
|
|
18403
18403
|
function reportTypeError(it) {
|
|
18404
18404
|
const cxt = getTypeErrorContext(it);
|
|
@@ -18406,16 +18406,16 @@ var require_dataType = __commonJS({
|
|
|
18406
18406
|
}
|
|
18407
18407
|
exports2.reportTypeError = reportTypeError;
|
|
18408
18408
|
function getTypeErrorContext(it) {
|
|
18409
|
-
const { gen, data, schema:
|
|
18410
|
-
const schemaCode = (0, util_1.schemaRefOrVal)(it,
|
|
18409
|
+
const { gen, data, schema: schema12 } = it;
|
|
18410
|
+
const schemaCode = (0, util_1.schemaRefOrVal)(it, schema12, "type");
|
|
18411
18411
|
return {
|
|
18412
18412
|
gen,
|
|
18413
18413
|
keyword: "type",
|
|
18414
18414
|
data,
|
|
18415
|
-
schema:
|
|
18415
|
+
schema: schema12.type,
|
|
18416
18416
|
schemaCode,
|
|
18417
18417
|
schemaValue: schemaCode,
|
|
18418
|
-
parentSchema:
|
|
18418
|
+
parentSchema: schema12,
|
|
18419
18419
|
params: {},
|
|
18420
18420
|
it
|
|
18421
18421
|
};
|
|
@@ -18568,15 +18568,15 @@ var require_code2 = __commonJS({
|
|
|
18568
18568
|
}
|
|
18569
18569
|
exports2.validateArray = validateArray;
|
|
18570
18570
|
function validateUnion(cxt) {
|
|
18571
|
-
const { gen, schema:
|
|
18572
|
-
if (!Array.isArray(
|
|
18571
|
+
const { gen, schema: schema12, keyword, it } = cxt;
|
|
18572
|
+
if (!Array.isArray(schema12))
|
|
18573
18573
|
throw new Error("ajv implementation error");
|
|
18574
|
-
const alwaysValid =
|
|
18574
|
+
const alwaysValid = schema12.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
|
|
18575
18575
|
if (alwaysValid && !it.opts.unevaluated)
|
|
18576
18576
|
return;
|
|
18577
18577
|
const valid = gen.let("valid", false);
|
|
18578
18578
|
const schValid = gen.name("_valid");
|
|
18579
|
-
gen.block(() =>
|
|
18579
|
+
gen.block(() => schema12.forEach((_sch, i) => {
|
|
18580
18580
|
const schCxt = cxt.subschema({
|
|
18581
18581
|
keyword,
|
|
18582
18582
|
schemaProp: i,
|
|
@@ -18604,8 +18604,8 @@ var require_keyword = __commonJS({
|
|
|
18604
18604
|
var code_1 = require_code2();
|
|
18605
18605
|
var errors_1 = require_errors2();
|
|
18606
18606
|
function macroKeywordCode(cxt, def) {
|
|
18607
|
-
const { gen, keyword, schema:
|
|
18608
|
-
const macroSchema2 = def.macro.call(it.self,
|
|
18607
|
+
const { gen, keyword, schema: schema12, parentSchema, it } = cxt;
|
|
18608
|
+
const macroSchema2 = def.macro.call(it.self, schema12, parentSchema, it);
|
|
18609
18609
|
const schemaRef = useKeyword(gen, keyword, macroSchema2);
|
|
18610
18610
|
if (it.opts.validateSchema !== false)
|
|
18611
18611
|
it.self.validateSchema(macroSchema2, true);
|
|
@@ -18622,9 +18622,9 @@ var require_keyword = __commonJS({
|
|
|
18622
18622
|
exports2.macroKeywordCode = macroKeywordCode;
|
|
18623
18623
|
function funcKeywordCode(cxt, def) {
|
|
18624
18624
|
var _a3;
|
|
18625
|
-
const { gen, keyword, schema:
|
|
18625
|
+
const { gen, keyword, schema: schema12, parentSchema, $data, it } = cxt;
|
|
18626
18626
|
checkAsyncKeyword(it, def);
|
|
18627
|
-
const validate = !$data && def.compile ? def.compile.call(it.self,
|
|
18627
|
+
const validate = !$data && def.compile ? def.compile.call(it.self, schema12, parentSchema, it) : def.validate;
|
|
18628
18628
|
const validateRef = useKeyword(gen, keyword, validate);
|
|
18629
18629
|
const valid = gen.let("valid");
|
|
18630
18630
|
cxt.block$data(valid, validateKeyword);
|
|
@@ -18684,20 +18684,20 @@ var require_keyword = __commonJS({
|
|
|
18684
18684
|
throw new Error(`keyword "${keyword}" failed to compile`);
|
|
18685
18685
|
return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
|
|
18686
18686
|
}
|
|
18687
|
-
function validSchemaType(
|
|
18688
|
-
return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(
|
|
18687
|
+
function validSchemaType(schema12, schemaType, allowUndefined = false) {
|
|
18688
|
+
return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema12) : st === "object" ? schema12 && typeof schema12 == "object" && !Array.isArray(schema12) : typeof schema12 == st || allowUndefined && typeof schema12 == "undefined");
|
|
18689
18689
|
}
|
|
18690
18690
|
exports2.validSchemaType = validSchemaType;
|
|
18691
|
-
function validateKeywordUsage({ schema:
|
|
18691
|
+
function validateKeywordUsage({ schema: schema12, opts, self, errSchemaPath }, def, keyword) {
|
|
18692
18692
|
if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
|
|
18693
18693
|
throw new Error("ajv implementation error");
|
|
18694
18694
|
}
|
|
18695
18695
|
const deps = def.dependencies;
|
|
18696
|
-
if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(
|
|
18696
|
+
if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema12, kwd))) {
|
|
18697
18697
|
throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`);
|
|
18698
18698
|
}
|
|
18699
18699
|
if (def.validateSchema) {
|
|
18700
|
-
const valid = def.validateSchema(
|
|
18700
|
+
const valid = def.validateSchema(schema12[keyword]);
|
|
18701
18701
|
if (!valid) {
|
|
18702
18702
|
const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + self.errorsText(def.validateSchema.errors);
|
|
18703
18703
|
if (opts.validateSchema === "log")
|
|
@@ -18719,8 +18719,8 @@ var require_subschema = __commonJS({
|
|
|
18719
18719
|
exports2.extendSubschemaMode = exports2.extendSubschemaData = exports2.getSubschema = void 0;
|
|
18720
18720
|
var codegen_1 = require_codegen();
|
|
18721
18721
|
var util_1 = require_util8();
|
|
18722
|
-
function getSubschema(it, { keyword, schemaProp, schema:
|
|
18723
|
-
if (keyword !== void 0 &&
|
|
18722
|
+
function getSubschema(it, { keyword, schemaProp, schema: schema12, schemaPath, errSchemaPath, topSchemaRef }) {
|
|
18723
|
+
if (keyword !== void 0 && schema12 !== void 0) {
|
|
18724
18724
|
throw new Error('both "keyword" and "schema" passed, only one allowed');
|
|
18725
18725
|
}
|
|
18726
18726
|
if (keyword !== void 0) {
|
|
@@ -18735,12 +18735,12 @@ var require_subschema = __commonJS({
|
|
|
18735
18735
|
errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`
|
|
18736
18736
|
};
|
|
18737
18737
|
}
|
|
18738
|
-
if (
|
|
18738
|
+
if (schema12 !== void 0) {
|
|
18739
18739
|
if (schemaPath === void 0 || errSchemaPath === void 0 || topSchemaRef === void 0) {
|
|
18740
18740
|
throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
|
|
18741
18741
|
}
|
|
18742
18742
|
return {
|
|
18743
|
-
schema:
|
|
18743
|
+
schema: schema12,
|
|
18744
18744
|
schemaPath,
|
|
18745
18745
|
topSchemaRef,
|
|
18746
18746
|
errSchemaPath
|
|
@@ -18833,7 +18833,7 @@ var require_fast_deep_equal = __commonJS({
|
|
|
18833
18833
|
var require_json_schema_traverse = __commonJS({
|
|
18834
18834
|
"../../node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js"(exports2, module2) {
|
|
18835
18835
|
"use strict";
|
|
18836
|
-
var traverse = module2.exports = function(
|
|
18836
|
+
var traverse = module2.exports = function(schema12, opts, cb) {
|
|
18837
18837
|
if (typeof opts == "function") {
|
|
18838
18838
|
cb = opts;
|
|
18839
18839
|
opts = {};
|
|
@@ -18843,7 +18843,7 @@ var require_json_schema_traverse = __commonJS({
|
|
|
18843
18843
|
};
|
|
18844
18844
|
var post = cb.post || function() {
|
|
18845
18845
|
};
|
|
18846
|
-
_traverse(opts, pre, post,
|
|
18846
|
+
_traverse(opts, pre, post, schema12, "", schema12);
|
|
18847
18847
|
};
|
|
18848
18848
|
traverse.keywords = {
|
|
18849
18849
|
additionalItems: true,
|
|
@@ -18889,26 +18889,26 @@ var require_json_schema_traverse = __commonJS({
|
|
|
18889
18889
|
maxProperties: true,
|
|
18890
18890
|
minProperties: true
|
|
18891
18891
|
};
|
|
18892
|
-
function _traverse(opts, pre, post,
|
|
18893
|
-
if (
|
|
18894
|
-
pre(
|
|
18895
|
-
for (var key3 in
|
|
18896
|
-
var sch =
|
|
18892
|
+
function _traverse(opts, pre, post, schema12, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
18893
|
+
if (schema12 && typeof schema12 == "object" && !Array.isArray(schema12)) {
|
|
18894
|
+
pre(schema12, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
18895
|
+
for (var key3 in schema12) {
|
|
18896
|
+
var sch = schema12[key3];
|
|
18897
18897
|
if (Array.isArray(sch)) {
|
|
18898
18898
|
if (key3 in traverse.arrayKeywords) {
|
|
18899
18899
|
for (var i = 0; i < sch.length; i++)
|
|
18900
|
-
_traverse(opts, pre, post, sch[i], jsonPtr + "/" + key3 + "/" + i, rootSchema, jsonPtr, key3,
|
|
18900
|
+
_traverse(opts, pre, post, sch[i], jsonPtr + "/" + key3 + "/" + i, rootSchema, jsonPtr, key3, schema12, i);
|
|
18901
18901
|
}
|
|
18902
18902
|
} else if (key3 in traverse.propsKeywords) {
|
|
18903
18903
|
if (sch && typeof sch == "object") {
|
|
18904
18904
|
for (var prop in sch)
|
|
18905
|
-
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key3 + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key3,
|
|
18905
|
+
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key3 + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key3, schema12, prop);
|
|
18906
18906
|
}
|
|
18907
18907
|
} else if (key3 in traverse.keywords || opts.allKeys && !(key3 in traverse.skipKeywords)) {
|
|
18908
|
-
_traverse(opts, pre, post, sch, jsonPtr + "/" + key3, rootSchema, jsonPtr, key3,
|
|
18908
|
+
_traverse(opts, pre, post, sch, jsonPtr + "/" + key3, rootSchema, jsonPtr, key3, schema12);
|
|
18909
18909
|
}
|
|
18910
18910
|
}
|
|
18911
|
-
post(
|
|
18911
|
+
post(schema12, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
18912
18912
|
}
|
|
18913
18913
|
}
|
|
18914
18914
|
function escapeJsonPtr(str) {
|
|
@@ -18944,14 +18944,14 @@ var require_resolve = __commonJS({
|
|
|
18944
18944
|
"enum",
|
|
18945
18945
|
"const"
|
|
18946
18946
|
]);
|
|
18947
|
-
function inlineRef(
|
|
18948
|
-
if (typeof
|
|
18947
|
+
function inlineRef(schema12, limit = true) {
|
|
18948
|
+
if (typeof schema12 == "boolean")
|
|
18949
18949
|
return true;
|
|
18950
18950
|
if (limit === true)
|
|
18951
|
-
return !hasRef(
|
|
18951
|
+
return !hasRef(schema12);
|
|
18952
18952
|
if (!limit)
|
|
18953
18953
|
return false;
|
|
18954
|
-
return countKeys(
|
|
18954
|
+
return countKeys(schema12) <= limit;
|
|
18955
18955
|
}
|
|
18956
18956
|
exports2.inlineRef = inlineRef;
|
|
18957
18957
|
var REF_KEYWORDS = /* @__PURE__ */ new Set([
|
|
@@ -18961,11 +18961,11 @@ var require_resolve = __commonJS({
|
|
|
18961
18961
|
"$dynamicRef",
|
|
18962
18962
|
"$dynamicAnchor"
|
|
18963
18963
|
]);
|
|
18964
|
-
function hasRef(
|
|
18965
|
-
for (const key3 in
|
|
18964
|
+
function hasRef(schema12) {
|
|
18965
|
+
for (const key3 in schema12) {
|
|
18966
18966
|
if (REF_KEYWORDS.has(key3))
|
|
18967
18967
|
return true;
|
|
18968
|
-
const sch =
|
|
18968
|
+
const sch = schema12[key3];
|
|
18969
18969
|
if (Array.isArray(sch) && sch.some(hasRef))
|
|
18970
18970
|
return true;
|
|
18971
18971
|
if (typeof sch == "object" && hasRef(sch))
|
|
@@ -18973,16 +18973,16 @@ var require_resolve = __commonJS({
|
|
|
18973
18973
|
}
|
|
18974
18974
|
return false;
|
|
18975
18975
|
}
|
|
18976
|
-
function countKeys(
|
|
18976
|
+
function countKeys(schema12) {
|
|
18977
18977
|
let count3 = 0;
|
|
18978
|
-
for (const key3 in
|
|
18978
|
+
for (const key3 in schema12) {
|
|
18979
18979
|
if (key3 === "$ref")
|
|
18980
18980
|
return Infinity;
|
|
18981
18981
|
count3++;
|
|
18982
18982
|
if (SIMPLE_INLINED.has(key3))
|
|
18983
18983
|
continue;
|
|
18984
|
-
if (typeof
|
|
18985
|
-
(0, util_1.eachItem)(
|
|
18984
|
+
if (typeof schema12[key3] == "object") {
|
|
18985
|
+
(0, util_1.eachItem)(schema12[key3], (sch) => count3 += countKeys(sch));
|
|
18986
18986
|
}
|
|
18987
18987
|
if (count3 === Infinity)
|
|
18988
18988
|
return Infinity;
|
|
@@ -19012,16 +19012,16 @@ var require_resolve = __commonJS({
|
|
|
19012
19012
|
}
|
|
19013
19013
|
exports2.resolveUrl = resolveUrl;
|
|
19014
19014
|
var ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
|
|
19015
|
-
function getSchemaRefs(
|
|
19016
|
-
if (typeof
|
|
19015
|
+
function getSchemaRefs(schema12, baseId) {
|
|
19016
|
+
if (typeof schema12 == "boolean")
|
|
19017
19017
|
return {};
|
|
19018
19018
|
const { schemaId, uriResolver } = this.opts;
|
|
19019
|
-
const schId = normalizeId(
|
|
19019
|
+
const schId = normalizeId(schema12[schemaId] || baseId);
|
|
19020
19020
|
const baseIds = { "": schId };
|
|
19021
19021
|
const pathPrefix = getFullPath(uriResolver, schId, false);
|
|
19022
19022
|
const localRefs = {};
|
|
19023
19023
|
const schemaRefs = /* @__PURE__ */ new Set();
|
|
19024
|
-
traverse(
|
|
19024
|
+
traverse(schema12, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
|
|
19025
19025
|
if (parentJsonPtr === void 0)
|
|
19026
19026
|
return;
|
|
19027
19027
|
const fullPath = pathPrefix + jsonPtr;
|
|
@@ -19102,15 +19102,15 @@ var require_validate = __commonJS({
|
|
|
19102
19102
|
validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
|
|
19103
19103
|
}
|
|
19104
19104
|
exports2.validateFunctionCode = validateFunctionCode;
|
|
19105
|
-
function validateFunction({ gen, validateName, schema:
|
|
19105
|
+
function validateFunction({ gen, validateName, schema: schema12, schemaEnv, opts }, body) {
|
|
19106
19106
|
if (opts.code.es5) {
|
|
19107
19107
|
gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
|
|
19108
|
-
gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(
|
|
19108
|
+
gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema12, opts)}`);
|
|
19109
19109
|
destructureValCxtES5(gen, opts);
|
|
19110
19110
|
gen.code(body);
|
|
19111
19111
|
});
|
|
19112
19112
|
} else {
|
|
19113
|
-
gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(
|
|
19113
|
+
gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema12, opts)).code(body));
|
|
19114
19114
|
}
|
|
19115
19115
|
}
|
|
19116
19116
|
function destructureValCxt(opts) {
|
|
@@ -19134,9 +19134,9 @@ var require_validate = __commonJS({
|
|
|
19134
19134
|
});
|
|
19135
19135
|
}
|
|
19136
19136
|
function topSchemaObjCode(it) {
|
|
19137
|
-
const { schema:
|
|
19137
|
+
const { schema: schema12, opts, gen } = it;
|
|
19138
19138
|
validateFunction(it, () => {
|
|
19139
|
-
if (opts.$comment &&
|
|
19139
|
+
if (opts.$comment && schema12.$comment)
|
|
19140
19140
|
commentKeyword(it);
|
|
19141
19141
|
checkNoDefault(it);
|
|
19142
19142
|
gen.let(names_1.default.vErrors, null);
|
|
@@ -19154,8 +19154,8 @@ var require_validate = __commonJS({
|
|
|
19154
19154
|
gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`));
|
|
19155
19155
|
gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`));
|
|
19156
19156
|
}
|
|
19157
|
-
function funcSourceUrl(
|
|
19158
|
-
const schId = typeof
|
|
19157
|
+
function funcSourceUrl(schema12, opts) {
|
|
19158
|
+
const schId = typeof schema12 == "object" && schema12[opts.schemaId];
|
|
19159
19159
|
return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil;
|
|
19160
19160
|
}
|
|
19161
19161
|
function subschemaCode(it, valid) {
|
|
@@ -19168,10 +19168,10 @@ var require_validate = __commonJS({
|
|
|
19168
19168
|
}
|
|
19169
19169
|
(0, boolSchema_1.boolOrEmptySchema)(it, valid);
|
|
19170
19170
|
}
|
|
19171
|
-
function schemaCxtHasRules({ schema:
|
|
19172
|
-
if (typeof
|
|
19173
|
-
return !
|
|
19174
|
-
for (const key3 in
|
|
19171
|
+
function schemaCxtHasRules({ schema: schema12, self }) {
|
|
19172
|
+
if (typeof schema12 == "boolean")
|
|
19173
|
+
return !schema12;
|
|
19174
|
+
for (const key3 in schema12)
|
|
19175
19175
|
if (self.RULES.all[key3])
|
|
19176
19176
|
return true;
|
|
19177
19177
|
return false;
|
|
@@ -19180,8 +19180,8 @@ var require_validate = __commonJS({
|
|
|
19180
19180
|
return typeof it.schema != "boolean";
|
|
19181
19181
|
}
|
|
19182
19182
|
function subSchemaObjCode(it, valid) {
|
|
19183
|
-
const { schema:
|
|
19184
|
-
if (opts.$comment &&
|
|
19183
|
+
const { schema: schema12, gen, opts } = it;
|
|
19184
|
+
if (opts.$comment && schema12.$comment)
|
|
19185
19185
|
commentKeyword(it);
|
|
19186
19186
|
updateContext(it);
|
|
19187
19187
|
checkAsyncSchema(it);
|
|
@@ -19201,14 +19201,14 @@ var require_validate = __commonJS({
|
|
|
19201
19201
|
schemaKeywords(it, types, !checkedTypes, errsCount);
|
|
19202
19202
|
}
|
|
19203
19203
|
function checkRefsAndKeywords(it) {
|
|
19204
|
-
const { schema:
|
|
19205
|
-
if (
|
|
19204
|
+
const { schema: schema12, errSchemaPath, opts, self } = it;
|
|
19205
|
+
if (schema12.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema12, self.RULES)) {
|
|
19206
19206
|
self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
|
|
19207
19207
|
}
|
|
19208
19208
|
}
|
|
19209
19209
|
function checkNoDefault(it) {
|
|
19210
|
-
const { schema:
|
|
19211
|
-
if (
|
|
19210
|
+
const { schema: schema12, opts } = it;
|
|
19211
|
+
if (schema12.default !== void 0 && opts.useDefaults && opts.strictSchema) {
|
|
19212
19212
|
(0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
|
|
19213
19213
|
}
|
|
19214
19214
|
}
|
|
@@ -19221,8 +19221,8 @@ var require_validate = __commonJS({
|
|
|
19221
19221
|
if (it.schema.$async && !it.schemaEnv.$async)
|
|
19222
19222
|
throw new Error("async schema in sync schema");
|
|
19223
19223
|
}
|
|
19224
|
-
function commentKeyword({ gen, schemaEnv, schema:
|
|
19225
|
-
const msg =
|
|
19224
|
+
function commentKeyword({ gen, schemaEnv, schema: schema12, errSchemaPath, opts }) {
|
|
19225
|
+
const msg = schema12.$comment;
|
|
19226
19226
|
if (opts.$comment === true) {
|
|
19227
19227
|
gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`);
|
|
19228
19228
|
} else if (typeof opts.$comment == "function") {
|
|
@@ -19249,9 +19249,9 @@ var require_validate = __commonJS({
|
|
|
19249
19249
|
gen.assign((0, codegen_1._)`${evaluated}.items`, items);
|
|
19250
19250
|
}
|
|
19251
19251
|
function schemaKeywords(it, types, typeErrors, errsCount) {
|
|
19252
|
-
const { gen, schema:
|
|
19252
|
+
const { gen, schema: schema12, data, allErrors, opts, self } = it;
|
|
19253
19253
|
const { RULES } = self;
|
|
19254
|
-
if (
|
|
19254
|
+
if (schema12.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema12, RULES))) {
|
|
19255
19255
|
gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition));
|
|
19256
19256
|
return;
|
|
19257
19257
|
}
|
|
@@ -19263,7 +19263,7 @@ var require_validate = __commonJS({
|
|
|
19263
19263
|
groupKeywords(RULES.post);
|
|
19264
19264
|
});
|
|
19265
19265
|
function groupKeywords(group) {
|
|
19266
|
-
if (!(0, applicability_1.shouldUseGroup)(
|
|
19266
|
+
if (!(0, applicability_1.shouldUseGroup)(schema12, group))
|
|
19267
19267
|
return;
|
|
19268
19268
|
if (group.type) {
|
|
19269
19269
|
gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
|
|
@@ -19281,12 +19281,12 @@ var require_validate = __commonJS({
|
|
|
19281
19281
|
}
|
|
19282
19282
|
}
|
|
19283
19283
|
function iterateKeywords(it, group) {
|
|
19284
|
-
const { gen, schema:
|
|
19284
|
+
const { gen, schema: schema12, opts: { useDefaults } } = it;
|
|
19285
19285
|
if (useDefaults)
|
|
19286
19286
|
(0, defaults_1.assignDefaults)(it, group.type);
|
|
19287
19287
|
gen.block(() => {
|
|
19288
19288
|
for (const rule of group.rules) {
|
|
19289
|
-
if ((0, applicability_1.shouldUseRule)(
|
|
19289
|
+
if ((0, applicability_1.shouldUseRule)(schema12, rule)) {
|
|
19290
19290
|
keywordCode(it, rule.keyword, rule.definition, group.type);
|
|
19291
19291
|
}
|
|
19292
19292
|
}
|
|
@@ -19631,17 +19631,17 @@ var require_compile = __commonJS({
|
|
|
19631
19631
|
var _a3;
|
|
19632
19632
|
this.refs = {};
|
|
19633
19633
|
this.dynamicAnchors = {};
|
|
19634
|
-
let
|
|
19634
|
+
let schema12;
|
|
19635
19635
|
if (typeof env2.schema == "object")
|
|
19636
|
-
|
|
19636
|
+
schema12 = env2.schema;
|
|
19637
19637
|
this.schema = env2.schema;
|
|
19638
19638
|
this.schemaId = env2.schemaId;
|
|
19639
19639
|
this.root = env2.root || this;
|
|
19640
|
-
this.baseId = (_a3 = env2.baseId) !== null && _a3 !== void 0 ? _a3 : (0, resolve_1.normalizeId)(
|
|
19640
|
+
this.baseId = (_a3 = env2.baseId) !== null && _a3 !== void 0 ? _a3 : (0, resolve_1.normalizeId)(schema12 === null || schema12 === void 0 ? void 0 : schema12[env2.schemaId || "$id"]);
|
|
19641
19641
|
this.schemaPath = env2.schemaPath;
|
|
19642
19642
|
this.localRefs = env2.localRefs;
|
|
19643
19643
|
this.meta = env2.meta;
|
|
19644
|
-
this.$async =
|
|
19644
|
+
this.$async = schema12 === null || schema12 === void 0 ? void 0 : schema12.$async;
|
|
19645
19645
|
this.refs = {};
|
|
19646
19646
|
}
|
|
19647
19647
|
};
|
|
@@ -19740,10 +19740,10 @@ var require_compile = __commonJS({
|
|
|
19740
19740
|
return schOrFunc;
|
|
19741
19741
|
let _sch = resolve.call(this, root, ref);
|
|
19742
19742
|
if (_sch === void 0) {
|
|
19743
|
-
const
|
|
19743
|
+
const schema12 = (_a3 = root.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref];
|
|
19744
19744
|
const { schemaId } = this.opts;
|
|
19745
|
-
if (
|
|
19746
|
-
_sch = new SchemaEnv({ schema:
|
|
19745
|
+
if (schema12)
|
|
19746
|
+
_sch = new SchemaEnv({ schema: schema12, schemaId, root, baseId });
|
|
19747
19747
|
}
|
|
19748
19748
|
if (_sch === void 0)
|
|
19749
19749
|
return;
|
|
@@ -19791,12 +19791,12 @@ var require_compile = __commonJS({
|
|
|
19791
19791
|
if (!schOrRef.validate)
|
|
19792
19792
|
compileSchema.call(this, schOrRef);
|
|
19793
19793
|
if (id === (0, resolve_1.normalizeId)(ref)) {
|
|
19794
|
-
const { schema:
|
|
19794
|
+
const { schema: schema12 } = schOrRef;
|
|
19795
19795
|
const { schemaId } = this.opts;
|
|
19796
|
-
const schId =
|
|
19796
|
+
const schId = schema12[schemaId];
|
|
19797
19797
|
if (schId)
|
|
19798
19798
|
baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
|
|
19799
|
-
return new SchemaEnv({ schema:
|
|
19799
|
+
return new SchemaEnv({ schema: schema12, schemaId, root, baseId });
|
|
19800
19800
|
}
|
|
19801
19801
|
return getJsonPointer.call(this, p, schOrRef);
|
|
19802
19802
|
}
|
|
@@ -19808,29 +19808,29 @@ var require_compile = __commonJS({
|
|
|
19808
19808
|
"dependencies",
|
|
19809
19809
|
"definitions"
|
|
19810
19810
|
]);
|
|
19811
|
-
function getJsonPointer(parsedRef, { baseId, schema:
|
|
19811
|
+
function getJsonPointer(parsedRef, { baseId, schema: schema12, root }) {
|
|
19812
19812
|
var _a3;
|
|
19813
19813
|
if (((_a3 = parsedRef.fragment) === null || _a3 === void 0 ? void 0 : _a3[0]) !== "/")
|
|
19814
19814
|
return;
|
|
19815
19815
|
for (const part of parsedRef.fragment.slice(1).split("/")) {
|
|
19816
|
-
if (typeof
|
|
19816
|
+
if (typeof schema12 === "boolean")
|
|
19817
19817
|
return;
|
|
19818
|
-
const partSchema =
|
|
19818
|
+
const partSchema = schema12[(0, util_1.unescapeFragment)(part)];
|
|
19819
19819
|
if (partSchema === void 0)
|
|
19820
19820
|
return;
|
|
19821
|
-
|
|
19822
|
-
const schId = typeof
|
|
19821
|
+
schema12 = partSchema;
|
|
19822
|
+
const schId = typeof schema12 === "object" && schema12[this.opts.schemaId];
|
|
19823
19823
|
if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
|
|
19824
19824
|
baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
|
|
19825
19825
|
}
|
|
19826
19826
|
}
|
|
19827
19827
|
let env2;
|
|
19828
|
-
if (typeof
|
|
19829
|
-
const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId,
|
|
19828
|
+
if (typeof schema12 != "boolean" && schema12.$ref && !(0, util_1.schemaHasRulesButRef)(schema12, this.RULES)) {
|
|
19829
|
+
const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema12.$ref);
|
|
19830
19830
|
env2 = resolveSchema.call(this, root, $ref);
|
|
19831
19831
|
}
|
|
19832
19832
|
const { schemaId } = this.opts;
|
|
19833
|
-
env2 = env2 || new SchemaEnv({ schema:
|
|
19833
|
+
env2 = env2 || new SchemaEnv({ schema: schema12, schemaId, root, baseId });
|
|
19834
19834
|
if (env2.schema !== env2.root.schema)
|
|
19835
19835
|
return env2;
|
|
19836
19836
|
return void 0;
|
|
@@ -20852,16 +20852,16 @@ var require_core = __commonJS({
|
|
|
20852
20852
|
this.errors = v.errors;
|
|
20853
20853
|
return valid;
|
|
20854
20854
|
}
|
|
20855
|
-
compile(
|
|
20856
|
-
const sch = this._addSchema(
|
|
20855
|
+
compile(schema12, _meta) {
|
|
20856
|
+
const sch = this._addSchema(schema12, _meta);
|
|
20857
20857
|
return sch.validate || this._compileSchemaEnv(sch);
|
|
20858
20858
|
}
|
|
20859
|
-
compileAsync(
|
|
20859
|
+
compileAsync(schema12, meta3) {
|
|
20860
20860
|
if (typeof this.opts.loadSchema != "function") {
|
|
20861
20861
|
throw new Error("options.loadSchema should be a function");
|
|
20862
20862
|
}
|
|
20863
20863
|
const { loadSchema } = this.opts;
|
|
20864
|
-
return runCompileAsync.call(this,
|
|
20864
|
+
return runCompileAsync.call(this, schema12, meta3);
|
|
20865
20865
|
async function runCompileAsync(_schema, _meta) {
|
|
20866
20866
|
await loadMetaSchema.call(this, _schema.$schema);
|
|
20867
20867
|
const sch = this._addSchema(_schema, _meta);
|
|
@@ -20907,37 +20907,37 @@ var require_core = __commonJS({
|
|
|
20907
20907
|
}
|
|
20908
20908
|
}
|
|
20909
20909
|
// Adds schema to the instance
|
|
20910
|
-
addSchema(
|
|
20911
|
-
if (Array.isArray(
|
|
20912
|
-
for (const sch of
|
|
20910
|
+
addSchema(schema12, key3, _meta, _validateSchema = this.opts.validateSchema) {
|
|
20911
|
+
if (Array.isArray(schema12)) {
|
|
20912
|
+
for (const sch of schema12)
|
|
20913
20913
|
this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
20914
20914
|
return this;
|
|
20915
20915
|
}
|
|
20916
20916
|
let id;
|
|
20917
|
-
if (typeof
|
|
20917
|
+
if (typeof schema12 === "object") {
|
|
20918
20918
|
const { schemaId } = this.opts;
|
|
20919
|
-
id =
|
|
20919
|
+
id = schema12[schemaId];
|
|
20920
20920
|
if (id !== void 0 && typeof id != "string") {
|
|
20921
20921
|
throw new Error(`schema ${schemaId} must be string`);
|
|
20922
20922
|
}
|
|
20923
20923
|
}
|
|
20924
20924
|
key3 = (0, resolve_1.normalizeId)(key3 || id);
|
|
20925
20925
|
this._checkUnique(key3);
|
|
20926
|
-
this.schemas[key3] = this._addSchema(
|
|
20926
|
+
this.schemas[key3] = this._addSchema(schema12, _meta, key3, _validateSchema, true);
|
|
20927
20927
|
return this;
|
|
20928
20928
|
}
|
|
20929
20929
|
// Add schema that will be used to validate other schemas
|
|
20930
20930
|
// options in META_IGNORE_OPTIONS are alway set to false
|
|
20931
|
-
addMetaSchema(
|
|
20932
|
-
this.addSchema(
|
|
20931
|
+
addMetaSchema(schema12, key3, _validateSchema = this.opts.validateSchema) {
|
|
20932
|
+
this.addSchema(schema12, key3, true, _validateSchema);
|
|
20933
20933
|
return this;
|
|
20934
20934
|
}
|
|
20935
20935
|
// Validate schema against its meta-schema
|
|
20936
|
-
validateSchema(
|
|
20937
|
-
if (typeof
|
|
20936
|
+
validateSchema(schema12, throwOrLogError) {
|
|
20937
|
+
if (typeof schema12 == "boolean")
|
|
20938
20938
|
return true;
|
|
20939
20939
|
let $schema;
|
|
20940
|
-
$schema =
|
|
20940
|
+
$schema = schema12.$schema;
|
|
20941
20941
|
if ($schema !== void 0 && typeof $schema != "string") {
|
|
20942
20942
|
throw new Error("$schema must be a string");
|
|
20943
20943
|
}
|
|
@@ -20947,7 +20947,7 @@ var require_core = __commonJS({
|
|
|
20947
20947
|
this.errors = null;
|
|
20948
20948
|
return true;
|
|
20949
20949
|
}
|
|
20950
|
-
const valid = this.validate($schema,
|
|
20950
|
+
const valid = this.validate($schema, schema12);
|
|
20951
20951
|
if (!valid && throwOrLogError) {
|
|
20952
20952
|
const message5 = "schema is invalid: " + this.errorsText();
|
|
20953
20953
|
if (this.opts.validateSchema === "log")
|
|
@@ -21090,9 +21090,9 @@ var require_core = __commonJS({
|
|
|
21090
21090
|
if (typeof rule != "object")
|
|
21091
21091
|
continue;
|
|
21092
21092
|
const { $data } = rule.definition;
|
|
21093
|
-
const
|
|
21094
|
-
if ($data &&
|
|
21095
|
-
keywords[key3] = schemaOrData(
|
|
21093
|
+
const schema12 = keywords[key3];
|
|
21094
|
+
if ($data && schema12)
|
|
21095
|
+
keywords[key3] = schemaOrData(schema12);
|
|
21096
21096
|
}
|
|
21097
21097
|
}
|
|
21098
21098
|
return metaSchema;
|
|
@@ -21110,23 +21110,23 @@ var require_core = __commonJS({
|
|
|
21110
21110
|
}
|
|
21111
21111
|
}
|
|
21112
21112
|
}
|
|
21113
|
-
_addSchema(
|
|
21113
|
+
_addSchema(schema12, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
|
|
21114
21114
|
let id;
|
|
21115
21115
|
const { schemaId } = this.opts;
|
|
21116
|
-
if (typeof
|
|
21117
|
-
id =
|
|
21116
|
+
if (typeof schema12 == "object") {
|
|
21117
|
+
id = schema12[schemaId];
|
|
21118
21118
|
} else {
|
|
21119
21119
|
if (this.opts.jtd)
|
|
21120
21120
|
throw new Error("schema must be object");
|
|
21121
|
-
else if (typeof
|
|
21121
|
+
else if (typeof schema12 != "boolean")
|
|
21122
21122
|
throw new Error("schema must be object or boolean");
|
|
21123
21123
|
}
|
|
21124
|
-
let sch = this._cache.get(
|
|
21124
|
+
let sch = this._cache.get(schema12);
|
|
21125
21125
|
if (sch !== void 0)
|
|
21126
21126
|
return sch;
|
|
21127
21127
|
baseId = (0, resolve_1.normalizeId)(id || baseId);
|
|
21128
|
-
const localRefs = resolve_1.getSchemaRefs.call(this,
|
|
21129
|
-
sch = new compile_1.SchemaEnv({ schema:
|
|
21128
|
+
const localRefs = resolve_1.getSchemaRefs.call(this, schema12, baseId);
|
|
21129
|
+
sch = new compile_1.SchemaEnv({ schema: schema12, schemaId, meta: meta3, baseId, localRefs });
|
|
21130
21130
|
this._cache.set(sch.schema, sch);
|
|
21131
21131
|
if (addSchema && !baseId.startsWith("#")) {
|
|
21132
21132
|
if (baseId)
|
|
@@ -21134,7 +21134,7 @@ var require_core = __commonJS({
|
|
|
21134
21134
|
this.refs[baseId] = sch;
|
|
21135
21135
|
}
|
|
21136
21136
|
if (validateSchema)
|
|
21137
|
-
this.validateSchema(
|
|
21137
|
+
this.validateSchema(schema12, true);
|
|
21138
21138
|
return sch;
|
|
21139
21139
|
}
|
|
21140
21140
|
_checkUnique(id) {
|
|
@@ -21288,8 +21288,8 @@ var require_core = __commonJS({
|
|
|
21288
21288
|
var $dataRef = {
|
|
21289
21289
|
$ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"
|
|
21290
21290
|
};
|
|
21291
|
-
function schemaOrData(
|
|
21292
|
-
return { anyOf: [
|
|
21291
|
+
function schemaOrData(schema12) {
|
|
21292
|
+
return { anyOf: [schema12, $dataRef] };
|
|
21293
21293
|
}
|
|
21294
21294
|
}
|
|
21295
21295
|
});
|
|
@@ -21589,7 +21589,7 @@ var require_pattern = __commonJS({
|
|
|
21589
21589
|
$data: true,
|
|
21590
21590
|
error: error51,
|
|
21591
21591
|
code(cxt) {
|
|
21592
|
-
const { gen, data, $data, schema:
|
|
21592
|
+
const { gen, data, $data, schema: schema12, schemaCode, it } = cxt;
|
|
21593
21593
|
const u = it.opts.unicodeRegExp ? "u" : "";
|
|
21594
21594
|
if ($data) {
|
|
21595
21595
|
const { regExp } = it.opts.code;
|
|
@@ -21598,7 +21598,7 @@ var require_pattern = __commonJS({
|
|
|
21598
21598
|
gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
|
|
21599
21599
|
cxt.fail$data((0, codegen_1._)`!${valid}`);
|
|
21600
21600
|
} else {
|
|
21601
|
-
const regExp = (0, code_1.usePattern)(cxt,
|
|
21601
|
+
const regExp = (0, code_1.usePattern)(cxt, schema12);
|
|
21602
21602
|
cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
|
|
21603
21603
|
}
|
|
21604
21604
|
}
|
|
@@ -21655,11 +21655,11 @@ var require_required = __commonJS({
|
|
|
21655
21655
|
$data: true,
|
|
21656
21656
|
error: error51,
|
|
21657
21657
|
code(cxt) {
|
|
21658
|
-
const { gen, schema:
|
|
21658
|
+
const { gen, schema: schema12, schemaCode, data, $data, it } = cxt;
|
|
21659
21659
|
const { opts } = it;
|
|
21660
|
-
if (!$data &&
|
|
21660
|
+
if (!$data && schema12.length === 0)
|
|
21661
21661
|
return;
|
|
21662
|
-
const useLoop =
|
|
21662
|
+
const useLoop = schema12.length >= opts.loopRequired;
|
|
21663
21663
|
if (it.allErrors)
|
|
21664
21664
|
allErrorsMode();
|
|
21665
21665
|
else
|
|
@@ -21667,7 +21667,7 @@ var require_required = __commonJS({
|
|
|
21667
21667
|
if (opts.strictRequired) {
|
|
21668
21668
|
const props = cxt.parentSchema.properties;
|
|
21669
21669
|
const { definedProperties } = cxt.it;
|
|
21670
|
-
for (const requiredKey of
|
|
21670
|
+
for (const requiredKey of schema12) {
|
|
21671
21671
|
if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === void 0 && !definedProperties.has(requiredKey)) {
|
|
21672
21672
|
const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
|
|
21673
21673
|
const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
|
|
@@ -21679,7 +21679,7 @@ var require_required = __commonJS({
|
|
|
21679
21679
|
if (useLoop || $data) {
|
|
21680
21680
|
cxt.block$data(codegen_1.nil, loopAllRequired);
|
|
21681
21681
|
} else {
|
|
21682
|
-
for (const prop of
|
|
21682
|
+
for (const prop of schema12) {
|
|
21683
21683
|
(0, code_1.checkReportMissingProp)(cxt, prop);
|
|
21684
21684
|
}
|
|
21685
21685
|
}
|
|
@@ -21691,7 +21691,7 @@ var require_required = __commonJS({
|
|
|
21691
21691
|
cxt.block$data(valid, () => loopUntilMissing(missing, valid));
|
|
21692
21692
|
cxt.ok(valid);
|
|
21693
21693
|
} else {
|
|
21694
|
-
gen.if((0, code_1.checkMissingProp)(cxt,
|
|
21694
|
+
gen.if((0, code_1.checkMissingProp)(cxt, schema12, missing));
|
|
21695
21695
|
(0, code_1.reportMissingProp)(cxt, missing);
|
|
21696
21696
|
gen.else();
|
|
21697
21697
|
}
|
|
@@ -21778,8 +21778,8 @@ var require_uniqueItems = __commonJS({
|
|
|
21778
21778
|
$data: true,
|
|
21779
21779
|
error: error51,
|
|
21780
21780
|
code(cxt) {
|
|
21781
|
-
const { gen, data, $data, schema:
|
|
21782
|
-
if (!$data && !
|
|
21781
|
+
const { gen, data, $data, schema: schema12, parentSchema, schemaCode, it } = cxt;
|
|
21782
|
+
if (!$data && !schema12)
|
|
21783
21783
|
return;
|
|
21784
21784
|
const valid = gen.let("valid");
|
|
21785
21785
|
const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];
|
|
@@ -21842,11 +21842,11 @@ var require_const = __commonJS({
|
|
|
21842
21842
|
$data: true,
|
|
21843
21843
|
error: error51,
|
|
21844
21844
|
code(cxt) {
|
|
21845
|
-
const { gen, data, $data, schemaCode, schema:
|
|
21846
|
-
if ($data ||
|
|
21845
|
+
const { gen, data, $data, schemaCode, schema: schema12 } = cxt;
|
|
21846
|
+
if ($data || schema12 && typeof schema12 == "object") {
|
|
21847
21847
|
cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);
|
|
21848
21848
|
} else {
|
|
21849
|
-
cxt.fail((0, codegen_1._)`${
|
|
21849
|
+
cxt.fail((0, codegen_1._)`${schema12} !== ${data}`);
|
|
21850
21850
|
}
|
|
21851
21851
|
}
|
|
21852
21852
|
};
|
|
@@ -21872,10 +21872,10 @@ var require_enum = __commonJS({
|
|
|
21872
21872
|
$data: true,
|
|
21873
21873
|
error: error51,
|
|
21874
21874
|
code(cxt) {
|
|
21875
|
-
const { gen, data, $data, schema:
|
|
21876
|
-
if (!$data &&
|
|
21875
|
+
const { gen, data, $data, schema: schema12, schemaCode, it } = cxt;
|
|
21876
|
+
if (!$data && schema12.length === 0)
|
|
21877
21877
|
throw new Error("enum must have non-empty array");
|
|
21878
|
-
const useLoop =
|
|
21878
|
+
const useLoop = schema12.length >= it.opts.loopEnum;
|
|
21879
21879
|
let eql;
|
|
21880
21880
|
const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default);
|
|
21881
21881
|
let valid;
|
|
@@ -21883,10 +21883,10 @@ var require_enum = __commonJS({
|
|
|
21883
21883
|
valid = gen.let("valid");
|
|
21884
21884
|
cxt.block$data(valid, loopEnum);
|
|
21885
21885
|
} else {
|
|
21886
|
-
if (!Array.isArray(
|
|
21886
|
+
if (!Array.isArray(schema12))
|
|
21887
21887
|
throw new Error("ajv implementation error");
|
|
21888
21888
|
const vSchema = gen.const("vSchema", schemaCode);
|
|
21889
|
-
valid = (0, codegen_1.or)(...
|
|
21889
|
+
valid = (0, codegen_1.or)(...schema12.map((_x, i) => equalCode(vSchema, i)));
|
|
21890
21890
|
}
|
|
21891
21891
|
cxt.pass(valid);
|
|
21892
21892
|
function loopEnum() {
|
|
@@ -21894,7 +21894,7 @@ var require_enum = __commonJS({
|
|
|
21894
21894
|
gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
|
|
21895
21895
|
}
|
|
21896
21896
|
function equalCode(vSchema, i) {
|
|
21897
|
-
const sch =
|
|
21897
|
+
const sch = schema12[i];
|
|
21898
21898
|
return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`;
|
|
21899
21899
|
}
|
|
21900
21900
|
}
|
|
@@ -21970,13 +21970,13 @@ var require_additionalItems = __commonJS({
|
|
|
21970
21970
|
}
|
|
21971
21971
|
};
|
|
21972
21972
|
function validateAdditionalItems(cxt, items) {
|
|
21973
|
-
const { gen, schema:
|
|
21973
|
+
const { gen, schema: schema12, data, keyword, it } = cxt;
|
|
21974
21974
|
it.items = true;
|
|
21975
21975
|
const len = gen.const("len", (0, codegen_1._)`${data}.length`);
|
|
21976
|
-
if (
|
|
21976
|
+
if (schema12 === false) {
|
|
21977
21977
|
cxt.setParams({ len: items.length });
|
|
21978
21978
|
cxt.pass((0, codegen_1._)`${len} <= ${items.length}`);
|
|
21979
|
-
} else if (typeof
|
|
21979
|
+
} else if (typeof schema12 == "object" && !(0, util_1.alwaysValidSchema)(it, schema12)) {
|
|
21980
21980
|
const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`);
|
|
21981
21981
|
gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
|
|
21982
21982
|
cxt.ok(valid);
|
|
@@ -22009,11 +22009,11 @@ var require_items = __commonJS({
|
|
|
22009
22009
|
schemaType: ["object", "array", "boolean"],
|
|
22010
22010
|
before: "uniqueItems",
|
|
22011
22011
|
code(cxt) {
|
|
22012
|
-
const { schema:
|
|
22013
|
-
if (Array.isArray(
|
|
22014
|
-
return validateTuple(cxt, "additionalItems",
|
|
22012
|
+
const { schema: schema12, it } = cxt;
|
|
22013
|
+
if (Array.isArray(schema12))
|
|
22014
|
+
return validateTuple(cxt, "additionalItems", schema12);
|
|
22015
22015
|
it.items = true;
|
|
22016
|
-
if ((0, util_1.alwaysValidSchema)(it,
|
|
22016
|
+
if ((0, util_1.alwaysValidSchema)(it, schema12))
|
|
22017
22017
|
return;
|
|
22018
22018
|
cxt.ok((0, code_1.validateArray)(cxt));
|
|
22019
22019
|
}
|
|
@@ -22088,10 +22088,10 @@ var require_items2020 = __commonJS({
|
|
|
22088
22088
|
before: "uniqueItems",
|
|
22089
22089
|
error: error51,
|
|
22090
22090
|
code(cxt) {
|
|
22091
|
-
const { schema:
|
|
22091
|
+
const { schema: schema12, parentSchema, it } = cxt;
|
|
22092
22092
|
const { prefixItems } = parentSchema;
|
|
22093
22093
|
it.items = true;
|
|
22094
|
-
if ((0, util_1.alwaysValidSchema)(it,
|
|
22094
|
+
if ((0, util_1.alwaysValidSchema)(it, schema12))
|
|
22095
22095
|
return;
|
|
22096
22096
|
if (prefixItems)
|
|
22097
22097
|
(0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
|
|
@@ -22122,7 +22122,7 @@ var require_contains = __commonJS({
|
|
|
22122
22122
|
trackErrors: true,
|
|
22123
22123
|
error: error51,
|
|
22124
22124
|
code(cxt) {
|
|
22125
|
-
const { gen, schema:
|
|
22125
|
+
const { gen, schema: schema12, parentSchema, data, it } = cxt;
|
|
22126
22126
|
let min;
|
|
22127
22127
|
let max;
|
|
22128
22128
|
const { minContains, maxContains } = parentSchema;
|
|
@@ -22143,7 +22143,7 @@ var require_contains = __commonJS({
|
|
|
22143
22143
|
cxt.fail();
|
|
22144
22144
|
return;
|
|
22145
22145
|
}
|
|
22146
|
-
if ((0, util_1.alwaysValidSchema)(it,
|
|
22146
|
+
if ((0, util_1.alwaysValidSchema)(it, schema12)) {
|
|
22147
22147
|
let cond = (0, codegen_1._)`${len} >= ${min}`;
|
|
22148
22148
|
if (max !== void 0)
|
|
22149
22149
|
cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`;
|
|
@@ -22228,14 +22228,14 @@ var require_dependencies = __commonJS({
|
|
|
22228
22228
|
validateSchemaDeps(cxt, schDeps);
|
|
22229
22229
|
}
|
|
22230
22230
|
};
|
|
22231
|
-
function splitDependencies({ schema:
|
|
22231
|
+
function splitDependencies({ schema: schema12 }) {
|
|
22232
22232
|
const propertyDeps = {};
|
|
22233
22233
|
const schemaDeps = {};
|
|
22234
|
-
for (const key3 in
|
|
22234
|
+
for (const key3 in schema12) {
|
|
22235
22235
|
if (key3 === "__proto__")
|
|
22236
22236
|
continue;
|
|
22237
|
-
const deps = Array.isArray(
|
|
22238
|
-
deps[key3] =
|
|
22237
|
+
const deps = Array.isArray(schema12[key3]) ? propertyDeps : schemaDeps;
|
|
22238
|
+
deps[key3] = schema12[key3];
|
|
22239
22239
|
}
|
|
22240
22240
|
return [propertyDeps, schemaDeps];
|
|
22241
22241
|
}
|
|
@@ -22308,8 +22308,8 @@ var require_propertyNames = __commonJS({
|
|
|
22308
22308
|
schemaType: ["object", "boolean"],
|
|
22309
22309
|
error: error51,
|
|
22310
22310
|
code(cxt) {
|
|
22311
|
-
const { gen, schema:
|
|
22312
|
-
if ((0, util_1.alwaysValidSchema)(it,
|
|
22311
|
+
const { gen, schema: schema12, data, it } = cxt;
|
|
22312
|
+
if ((0, util_1.alwaysValidSchema)(it, schema12))
|
|
22313
22313
|
return;
|
|
22314
22314
|
const valid = gen.name("valid");
|
|
22315
22315
|
gen.forIn("key", data, (key3) => {
|
|
@@ -22355,12 +22355,12 @@ var require_additionalProperties = __commonJS({
|
|
|
22355
22355
|
trackErrors: true,
|
|
22356
22356
|
error: error51,
|
|
22357
22357
|
code(cxt) {
|
|
22358
|
-
const { gen, schema:
|
|
22358
|
+
const { gen, schema: schema12, parentSchema, data, errsCount, it } = cxt;
|
|
22359
22359
|
if (!errsCount)
|
|
22360
22360
|
throw new Error("ajv implementation error");
|
|
22361
22361
|
const { allErrors, opts } = it;
|
|
22362
22362
|
it.props = true;
|
|
22363
|
-
if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it,
|
|
22363
|
+
if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema12))
|
|
22364
22364
|
return;
|
|
22365
22365
|
const props = (0, code_1.allSchemaProperties)(parentSchema.properties);
|
|
22366
22366
|
const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);
|
|
@@ -22393,18 +22393,18 @@ var require_additionalProperties = __commonJS({
|
|
|
22393
22393
|
gen.code((0, codegen_1._)`delete ${data}[${key3}]`);
|
|
22394
22394
|
}
|
|
22395
22395
|
function additionalPropertyCode(key3) {
|
|
22396
|
-
if (opts.removeAdditional === "all" || opts.removeAdditional &&
|
|
22396
|
+
if (opts.removeAdditional === "all" || opts.removeAdditional && schema12 === false) {
|
|
22397
22397
|
deleteAdditional(key3);
|
|
22398
22398
|
return;
|
|
22399
22399
|
}
|
|
22400
|
-
if (
|
|
22400
|
+
if (schema12 === false) {
|
|
22401
22401
|
cxt.setParams({ additionalProperty: key3 });
|
|
22402
22402
|
cxt.error();
|
|
22403
22403
|
if (!allErrors)
|
|
22404
22404
|
gen.break();
|
|
22405
22405
|
return;
|
|
22406
22406
|
}
|
|
22407
|
-
if (typeof
|
|
22407
|
+
if (typeof schema12 == "object" && !(0, util_1.alwaysValidSchema)(it, schema12)) {
|
|
22408
22408
|
const valid = gen.name("valid");
|
|
22409
22409
|
if (opts.removeAdditional === "failing") {
|
|
22410
22410
|
applyAdditionalSchema(key3, valid, false);
|
|
@@ -22454,18 +22454,18 @@ var require_properties = __commonJS({
|
|
|
22454
22454
|
type: "object",
|
|
22455
22455
|
schemaType: "object",
|
|
22456
22456
|
code(cxt) {
|
|
22457
|
-
const { gen, schema:
|
|
22457
|
+
const { gen, schema: schema12, parentSchema, data, it } = cxt;
|
|
22458
22458
|
if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === void 0) {
|
|
22459
22459
|
additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties"));
|
|
22460
22460
|
}
|
|
22461
|
-
const allProps = (0, code_1.allSchemaProperties)(
|
|
22461
|
+
const allProps = (0, code_1.allSchemaProperties)(schema12);
|
|
22462
22462
|
for (const prop of allProps) {
|
|
22463
22463
|
it.definedProperties.add(prop);
|
|
22464
22464
|
}
|
|
22465
22465
|
if (it.opts.unevaluated && allProps.length && it.props !== true) {
|
|
22466
22466
|
it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
|
|
22467
22467
|
}
|
|
22468
|
-
const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it,
|
|
22468
|
+
const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema12[p]));
|
|
22469
22469
|
if (properties.length === 0)
|
|
22470
22470
|
return;
|
|
22471
22471
|
const valid = gen.name("valid");
|
|
@@ -22483,7 +22483,7 @@ var require_properties = __commonJS({
|
|
|
22483
22483
|
cxt.ok(valid);
|
|
22484
22484
|
}
|
|
22485
22485
|
function hasDefault(prop) {
|
|
22486
|
-
return it.opts.useDefaults && !it.compositeRule &&
|
|
22486
|
+
return it.opts.useDefaults && !it.compositeRule && schema12[prop].default !== void 0;
|
|
22487
22487
|
}
|
|
22488
22488
|
function applyPropertySchema(prop) {
|
|
22489
22489
|
cxt.subschema({
|
|
@@ -22512,10 +22512,10 @@ var require_patternProperties = __commonJS({
|
|
|
22512
22512
|
type: "object",
|
|
22513
22513
|
schemaType: "object",
|
|
22514
22514
|
code(cxt) {
|
|
22515
|
-
const { gen, schema:
|
|
22515
|
+
const { gen, schema: schema12, data, parentSchema, it } = cxt;
|
|
22516
22516
|
const { opts } = it;
|
|
22517
|
-
const patterns = (0, code_1.allSchemaProperties)(
|
|
22518
|
-
const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it,
|
|
22517
|
+
const patterns = (0, code_1.allSchemaProperties)(schema12);
|
|
22518
|
+
const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema12[p]));
|
|
22519
22519
|
if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) {
|
|
22520
22520
|
return;
|
|
22521
22521
|
}
|
|
@@ -22583,8 +22583,8 @@ var require_not = __commonJS({
|
|
|
22583
22583
|
schemaType: ["object", "boolean"],
|
|
22584
22584
|
trackErrors: true,
|
|
22585
22585
|
code(cxt) {
|
|
22586
|
-
const { gen, schema:
|
|
22587
|
-
if ((0, util_1.alwaysValidSchema)(it,
|
|
22586
|
+
const { gen, schema: schema12, it } = cxt;
|
|
22587
|
+
if ((0, util_1.alwaysValidSchema)(it, schema12)) {
|
|
22588
22588
|
cxt.fail();
|
|
22589
22589
|
return;
|
|
22590
22590
|
}
|
|
@@ -22637,12 +22637,12 @@ var require_oneOf = __commonJS({
|
|
|
22637
22637
|
trackErrors: true,
|
|
22638
22638
|
error: error51,
|
|
22639
22639
|
code(cxt) {
|
|
22640
|
-
const { gen, schema:
|
|
22641
|
-
if (!Array.isArray(
|
|
22640
|
+
const { gen, schema: schema12, parentSchema, it } = cxt;
|
|
22641
|
+
if (!Array.isArray(schema12))
|
|
22642
22642
|
throw new Error("ajv implementation error");
|
|
22643
22643
|
if (it.opts.discriminator && parentSchema.discriminator)
|
|
22644
22644
|
return;
|
|
22645
|
-
const schArr =
|
|
22645
|
+
const schArr = schema12;
|
|
22646
22646
|
const valid = gen.let("valid", false);
|
|
22647
22647
|
const passing = gen.let("passing", null);
|
|
22648
22648
|
const schValid = gen.name("_valid");
|
|
@@ -22688,11 +22688,11 @@ var require_allOf = __commonJS({
|
|
|
22688
22688
|
keyword: "allOf",
|
|
22689
22689
|
schemaType: "array",
|
|
22690
22690
|
code(cxt) {
|
|
22691
|
-
const { gen, schema:
|
|
22692
|
-
if (!Array.isArray(
|
|
22691
|
+
const { gen, schema: schema12, it } = cxt;
|
|
22692
|
+
if (!Array.isArray(schema12))
|
|
22693
22693
|
throw new Error("ajv implementation error");
|
|
22694
22694
|
const valid = gen.name("valid");
|
|
22695
|
-
|
|
22695
|
+
schema12.forEach((sch, i) => {
|
|
22696
22696
|
if ((0, util_1.alwaysValidSchema)(it, sch))
|
|
22697
22697
|
return;
|
|
22698
22698
|
const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
|
|
@@ -22767,8 +22767,8 @@ var require_if = __commonJS({
|
|
|
22767
22767
|
}
|
|
22768
22768
|
};
|
|
22769
22769
|
function hasSchema(it, keyword) {
|
|
22770
|
-
const
|
|
22771
|
-
return
|
|
22770
|
+
const schema12 = it.schema[keyword];
|
|
22771
|
+
return schema12 !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema12);
|
|
22772
22772
|
}
|
|
22773
22773
|
exports2.default = def;
|
|
22774
22774
|
}
|
|
@@ -22857,7 +22857,7 @@ var require_format = __commonJS({
|
|
|
22857
22857
|
$data: true,
|
|
22858
22858
|
error: error51,
|
|
22859
22859
|
code(cxt, ruleType) {
|
|
22860
|
-
const { gen, data, $data, schema:
|
|
22860
|
+
const { gen, data, $data, schema: schema12, schemaCode, it } = cxt;
|
|
22861
22861
|
const { opts, errSchemaPath, schemaEnv, self } = it;
|
|
22862
22862
|
if (!opts.validateFormats)
|
|
22863
22863
|
return;
|
|
@@ -22887,7 +22887,7 @@ var require_format = __commonJS({
|
|
|
22887
22887
|
}
|
|
22888
22888
|
}
|
|
22889
22889
|
function validateFormat() {
|
|
22890
|
-
const formatDef = self.formats[
|
|
22890
|
+
const formatDef = self.formats[schema12];
|
|
22891
22891
|
if (!formatDef) {
|
|
22892
22892
|
unknownFormat();
|
|
22893
22893
|
return;
|
|
@@ -22904,12 +22904,12 @@ var require_format = __commonJS({
|
|
|
22904
22904
|
}
|
|
22905
22905
|
throw new Error(unknownMsg());
|
|
22906
22906
|
function unknownMsg() {
|
|
22907
|
-
return `unknown format "${
|
|
22907
|
+
return `unknown format "${schema12}" ignored in schema at path "${errSchemaPath}"`;
|
|
22908
22908
|
}
|
|
22909
22909
|
}
|
|
22910
22910
|
function getFormat(fmtDef) {
|
|
22911
|
-
const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(
|
|
22912
|
-
const fmt = gen.scopeValue("formats", { key:
|
|
22911
|
+
const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema12)}` : void 0;
|
|
22912
|
+
const fmt = gen.scopeValue("formats", { key: schema12, ref: fmtDef, code });
|
|
22913
22913
|
if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
|
|
22914
22914
|
return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
|
|
22915
22915
|
}
|
|
@@ -23020,15 +23020,15 @@ var require_discriminator = __commonJS({
|
|
|
23020
23020
|
schemaType: "object",
|
|
23021
23021
|
error: error51,
|
|
23022
23022
|
code(cxt) {
|
|
23023
|
-
const { gen, data, schema:
|
|
23023
|
+
const { gen, data, schema: schema12, parentSchema, it } = cxt;
|
|
23024
23024
|
const { oneOf } = parentSchema;
|
|
23025
23025
|
if (!it.opts.discriminator) {
|
|
23026
23026
|
throw new Error("discriminator: requires discriminator option");
|
|
23027
23027
|
}
|
|
23028
|
-
const tagName =
|
|
23028
|
+
const tagName = schema12.propertyName;
|
|
23029
23029
|
if (typeof tagName != "string")
|
|
23030
23030
|
throw new Error("discriminator: requires propertyName");
|
|
23031
|
-
if (
|
|
23031
|
+
if (schema12.mapping)
|
|
23032
23032
|
throw new Error("discriminator: mapping is not supported");
|
|
23033
23033
|
if (!oneOf)
|
|
23034
23034
|
throw new Error("discriminator: requires oneOf keyword");
|
|
@@ -25418,8 +25418,8 @@ function mergeDefs(...defs) {
|
|
|
25418
25418
|
}
|
|
25419
25419
|
return Object.defineProperties({}, mergedDescriptors);
|
|
25420
25420
|
}
|
|
25421
|
-
function cloneDef(
|
|
25422
|
-
return mergeDefs(
|
|
25421
|
+
function cloneDef(schema12) {
|
|
25422
|
+
return mergeDefs(schema12._zod.def);
|
|
25423
25423
|
}
|
|
25424
25424
|
function getElementAtPath(obj, path65) {
|
|
25425
25425
|
if (!path65)
|
|
@@ -25641,14 +25641,14 @@ var BIGINT_FORMAT_RANGES = {
|
|
|
25641
25641
|
int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
|
|
25642
25642
|
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
|
|
25643
25643
|
};
|
|
25644
|
-
function pick(
|
|
25645
|
-
const currDef =
|
|
25644
|
+
function pick(schema12, mask) {
|
|
25645
|
+
const currDef = schema12._zod.def;
|
|
25646
25646
|
const checks = currDef.checks;
|
|
25647
25647
|
const hasChecks = checks && checks.length > 0;
|
|
25648
25648
|
if (hasChecks) {
|
|
25649
25649
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
25650
25650
|
}
|
|
25651
|
-
const def = mergeDefs(
|
|
25651
|
+
const def = mergeDefs(schema12._zod.def, {
|
|
25652
25652
|
get shape() {
|
|
25653
25653
|
const newShape = {};
|
|
25654
25654
|
for (const key3 in mask) {
|
|
@@ -25664,18 +25664,18 @@ function pick(schema11, mask) {
|
|
|
25664
25664
|
},
|
|
25665
25665
|
checks: []
|
|
25666
25666
|
});
|
|
25667
|
-
return clone(
|
|
25667
|
+
return clone(schema12, def);
|
|
25668
25668
|
}
|
|
25669
|
-
function omit(
|
|
25670
|
-
const currDef =
|
|
25669
|
+
function omit(schema12, mask) {
|
|
25670
|
+
const currDef = schema12._zod.def;
|
|
25671
25671
|
const checks = currDef.checks;
|
|
25672
25672
|
const hasChecks = checks && checks.length > 0;
|
|
25673
25673
|
if (hasChecks) {
|
|
25674
25674
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
25675
25675
|
}
|
|
25676
|
-
const def = mergeDefs(
|
|
25676
|
+
const def = mergeDefs(schema12._zod.def, {
|
|
25677
25677
|
get shape() {
|
|
25678
|
-
const newShape = { ...
|
|
25678
|
+
const newShape = { ...schema12._zod.def.shape };
|
|
25679
25679
|
for (const key3 in mask) {
|
|
25680
25680
|
if (!(key3 in currDef.shape)) {
|
|
25681
25681
|
throw new Error(`Unrecognized key: "${key3}"`);
|
|
@@ -25689,43 +25689,43 @@ function omit(schema11, mask) {
|
|
|
25689
25689
|
},
|
|
25690
25690
|
checks: []
|
|
25691
25691
|
});
|
|
25692
|
-
return clone(
|
|
25692
|
+
return clone(schema12, def);
|
|
25693
25693
|
}
|
|
25694
|
-
function extend(
|
|
25694
|
+
function extend(schema12, shape) {
|
|
25695
25695
|
if (!isPlainObject(shape)) {
|
|
25696
25696
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
25697
25697
|
}
|
|
25698
|
-
const checks =
|
|
25698
|
+
const checks = schema12._zod.def.checks;
|
|
25699
25699
|
const hasChecks = checks && checks.length > 0;
|
|
25700
25700
|
if (hasChecks) {
|
|
25701
|
-
const existingShape =
|
|
25701
|
+
const existingShape = schema12._zod.def.shape;
|
|
25702
25702
|
for (const key3 in shape) {
|
|
25703
25703
|
if (Object.getOwnPropertyDescriptor(existingShape, key3) !== void 0) {
|
|
25704
25704
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
25705
25705
|
}
|
|
25706
25706
|
}
|
|
25707
25707
|
}
|
|
25708
|
-
const def = mergeDefs(
|
|
25708
|
+
const def = mergeDefs(schema12._zod.def, {
|
|
25709
25709
|
get shape() {
|
|
25710
|
-
const _shape = { ...
|
|
25710
|
+
const _shape = { ...schema12._zod.def.shape, ...shape };
|
|
25711
25711
|
assignProp(this, "shape", _shape);
|
|
25712
25712
|
return _shape;
|
|
25713
25713
|
}
|
|
25714
25714
|
});
|
|
25715
|
-
return clone(
|
|
25715
|
+
return clone(schema12, def);
|
|
25716
25716
|
}
|
|
25717
|
-
function safeExtend(
|
|
25717
|
+
function safeExtend(schema12, shape) {
|
|
25718
25718
|
if (!isPlainObject(shape)) {
|
|
25719
25719
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
25720
25720
|
}
|
|
25721
|
-
const def = mergeDefs(
|
|
25721
|
+
const def = mergeDefs(schema12._zod.def, {
|
|
25722
25722
|
get shape() {
|
|
25723
|
-
const _shape = { ...
|
|
25723
|
+
const _shape = { ...schema12._zod.def.shape, ...shape };
|
|
25724
25724
|
assignProp(this, "shape", _shape);
|
|
25725
25725
|
return _shape;
|
|
25726
25726
|
}
|
|
25727
25727
|
});
|
|
25728
|
-
return clone(
|
|
25728
|
+
return clone(schema12, def);
|
|
25729
25729
|
}
|
|
25730
25730
|
function merge(a, b) {
|
|
25731
25731
|
if (a._zod.def.checks?.length) {
|
|
@@ -25744,16 +25744,16 @@ function merge(a, b) {
|
|
|
25744
25744
|
});
|
|
25745
25745
|
return clone(a, def);
|
|
25746
25746
|
}
|
|
25747
|
-
function partial(Class2,
|
|
25748
|
-
const currDef =
|
|
25747
|
+
function partial(Class2, schema12, mask) {
|
|
25748
|
+
const currDef = schema12._zod.def;
|
|
25749
25749
|
const checks = currDef.checks;
|
|
25750
25750
|
const hasChecks = checks && checks.length > 0;
|
|
25751
25751
|
if (hasChecks) {
|
|
25752
25752
|
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
25753
25753
|
}
|
|
25754
|
-
const def = mergeDefs(
|
|
25754
|
+
const def = mergeDefs(schema12._zod.def, {
|
|
25755
25755
|
get shape() {
|
|
25756
|
-
const oldShape =
|
|
25756
|
+
const oldShape = schema12._zod.def.shape;
|
|
25757
25757
|
const shape = { ...oldShape };
|
|
25758
25758
|
if (mask) {
|
|
25759
25759
|
for (const key3 in mask) {
|
|
@@ -25780,12 +25780,12 @@ function partial(Class2, schema11, mask) {
|
|
|
25780
25780
|
},
|
|
25781
25781
|
checks: []
|
|
25782
25782
|
});
|
|
25783
|
-
return clone(
|
|
25783
|
+
return clone(schema12, def);
|
|
25784
25784
|
}
|
|
25785
|
-
function required(Class2,
|
|
25786
|
-
const def = mergeDefs(
|
|
25785
|
+
function required(Class2, schema12, mask) {
|
|
25786
|
+
const def = mergeDefs(schema12._zod.def, {
|
|
25787
25787
|
get shape() {
|
|
25788
|
-
const oldShape =
|
|
25788
|
+
const oldShape = schema12._zod.def.shape;
|
|
25789
25789
|
const shape = { ...oldShape };
|
|
25790
25790
|
if (mask) {
|
|
25791
25791
|
for (const key3 in mask) {
|
|
@@ -25811,7 +25811,7 @@ function required(Class2, schema11, mask) {
|
|
|
25811
25811
|
return shape;
|
|
25812
25812
|
}
|
|
25813
25813
|
});
|
|
25814
|
-
return clone(
|
|
25814
|
+
return clone(schema12, def);
|
|
25815
25815
|
}
|
|
25816
25816
|
function aborted(x, startIndex = 0) {
|
|
25817
25817
|
if (x.aborted === true)
|
|
@@ -26090,9 +26090,9 @@ function prettifyError(error51) {
|
|
|
26090
26090
|
}
|
|
26091
26091
|
|
|
26092
26092
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
|
|
26093
|
-
var _parse = (_Err) => (
|
|
26093
|
+
var _parse = (_Err) => (schema12, value, _ctx, _params) => {
|
|
26094
26094
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
26095
|
-
const result =
|
|
26095
|
+
const result = schema12._zod.run({ value, issues: [] }, ctx);
|
|
26096
26096
|
if (result instanceof Promise) {
|
|
26097
26097
|
throw new $ZodAsyncError();
|
|
26098
26098
|
}
|
|
@@ -26104,9 +26104,9 @@ var _parse = (_Err) => (schema11, value, _ctx, _params) => {
|
|
|
26104
26104
|
return result.value;
|
|
26105
26105
|
};
|
|
26106
26106
|
var parse = /* @__PURE__ */ _parse($ZodRealError);
|
|
26107
|
-
var _parseAsync = (_Err) => async (
|
|
26107
|
+
var _parseAsync = (_Err) => async (schema12, value, _ctx, params3) => {
|
|
26108
26108
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
26109
|
-
let result =
|
|
26109
|
+
let result = schema12._zod.run({ value, issues: [] }, ctx);
|
|
26110
26110
|
if (result instanceof Promise)
|
|
26111
26111
|
result = await result;
|
|
26112
26112
|
if (result.issues.length) {
|
|
@@ -26117,9 +26117,9 @@ var _parseAsync = (_Err) => async (schema11, value, _ctx, params3) => {
|
|
|
26117
26117
|
return result.value;
|
|
26118
26118
|
};
|
|
26119
26119
|
var parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
|
|
26120
|
-
var _safeParse = (_Err) => (
|
|
26120
|
+
var _safeParse = (_Err) => (schema12, value, _ctx) => {
|
|
26121
26121
|
const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
|
|
26122
|
-
const result =
|
|
26122
|
+
const result = schema12._zod.run({ value, issues: [] }, ctx);
|
|
26123
26123
|
if (result instanceof Promise) {
|
|
26124
26124
|
throw new $ZodAsyncError();
|
|
26125
26125
|
}
|
|
@@ -26129,9 +26129,9 @@ var _safeParse = (_Err) => (schema11, value, _ctx) => {
|
|
|
26129
26129
|
} : { success: true, data: result.value };
|
|
26130
26130
|
};
|
|
26131
26131
|
var safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
|
|
26132
|
-
var _safeParseAsync = (_Err) => async (
|
|
26132
|
+
var _safeParseAsync = (_Err) => async (schema12, value, _ctx) => {
|
|
26133
26133
|
const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
|
|
26134
|
-
let result =
|
|
26134
|
+
let result = schema12._zod.run({ value, issues: [] }, ctx);
|
|
26135
26135
|
if (result instanceof Promise)
|
|
26136
26136
|
result = await result;
|
|
26137
26137
|
return result.issues.length ? {
|
|
@@ -26140,40 +26140,40 @@ var _safeParseAsync = (_Err) => async (schema11, value, _ctx) => {
|
|
|
26140
26140
|
} : { success: true, data: result.value };
|
|
26141
26141
|
};
|
|
26142
26142
|
var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
|
|
26143
|
-
var _encode = (_Err) => (
|
|
26143
|
+
var _encode = (_Err) => (schema12, value, _ctx) => {
|
|
26144
26144
|
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
26145
|
-
return _parse(_Err)(
|
|
26145
|
+
return _parse(_Err)(schema12, value, ctx);
|
|
26146
26146
|
};
|
|
26147
26147
|
var encode = /* @__PURE__ */ _encode($ZodRealError);
|
|
26148
|
-
var _decode = (_Err) => (
|
|
26149
|
-
return _parse(_Err)(
|
|
26148
|
+
var _decode = (_Err) => (schema12, value, _ctx) => {
|
|
26149
|
+
return _parse(_Err)(schema12, value, _ctx);
|
|
26150
26150
|
};
|
|
26151
26151
|
var decode = /* @__PURE__ */ _decode($ZodRealError);
|
|
26152
|
-
var _encodeAsync = (_Err) => async (
|
|
26152
|
+
var _encodeAsync = (_Err) => async (schema12, value, _ctx) => {
|
|
26153
26153
|
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
26154
|
-
return _parseAsync(_Err)(
|
|
26154
|
+
return _parseAsync(_Err)(schema12, value, ctx);
|
|
26155
26155
|
};
|
|
26156
26156
|
var encodeAsync = /* @__PURE__ */ _encodeAsync($ZodRealError);
|
|
26157
|
-
var _decodeAsync = (_Err) => async (
|
|
26158
|
-
return _parseAsync(_Err)(
|
|
26157
|
+
var _decodeAsync = (_Err) => async (schema12, value, _ctx) => {
|
|
26158
|
+
return _parseAsync(_Err)(schema12, value, _ctx);
|
|
26159
26159
|
};
|
|
26160
26160
|
var decodeAsync = /* @__PURE__ */ _decodeAsync($ZodRealError);
|
|
26161
|
-
var _safeEncode = (_Err) => (
|
|
26161
|
+
var _safeEncode = (_Err) => (schema12, value, _ctx) => {
|
|
26162
26162
|
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
26163
|
-
return _safeParse(_Err)(
|
|
26163
|
+
return _safeParse(_Err)(schema12, value, ctx);
|
|
26164
26164
|
};
|
|
26165
26165
|
var safeEncode = /* @__PURE__ */ _safeEncode($ZodRealError);
|
|
26166
|
-
var _safeDecode = (_Err) => (
|
|
26167
|
-
return _safeParse(_Err)(
|
|
26166
|
+
var _safeDecode = (_Err) => (schema12, value, _ctx) => {
|
|
26167
|
+
return _safeParse(_Err)(schema12, value, _ctx);
|
|
26168
26168
|
};
|
|
26169
26169
|
var safeDecode = /* @__PURE__ */ _safeDecode($ZodRealError);
|
|
26170
|
-
var _safeEncodeAsync = (_Err) => async (
|
|
26170
|
+
var _safeEncodeAsync = (_Err) => async (schema12, value, _ctx) => {
|
|
26171
26171
|
const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
|
|
26172
|
-
return _safeParseAsync(_Err)(
|
|
26172
|
+
return _safeParseAsync(_Err)(schema12, value, ctx);
|
|
26173
26173
|
};
|
|
26174
26174
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
|
|
26175
|
-
var _safeDecodeAsync = (_Err) => async (
|
|
26176
|
-
return _safeParseAsync(_Err)(
|
|
26175
|
+
var _safeDecodeAsync = (_Err) => async (schema12, value, _ctx) => {
|
|
26176
|
+
return _safeParseAsync(_Err)(schema12, value, _ctx);
|
|
26177
26177
|
};
|
|
26178
26178
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
|
|
26179
26179
|
|
|
@@ -27749,9 +27749,9 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
27749
27749
|
for (const key3 of normalized.keys) {
|
|
27750
27750
|
const id = ids[key3];
|
|
27751
27751
|
const k = esc(key3);
|
|
27752
|
-
const
|
|
27753
|
-
const isOptionalIn =
|
|
27754
|
-
const isOptionalOut =
|
|
27752
|
+
const schema12 = shape[key3];
|
|
27753
|
+
const isOptionalIn = schema12?._zod?.optin === "optional";
|
|
27754
|
+
const isOptionalOut = schema12?._zod?.optout === "optional";
|
|
27755
27755
|
doc.write(`const ${id} = ${parseStr(key3)};`);
|
|
27756
27756
|
if (isOptionalIn && isOptionalOut) {
|
|
27757
27757
|
doc.write(`
|
|
@@ -34984,11 +34984,11 @@ var $ZodRegistry = class {
|
|
|
34984
34984
|
this._map = /* @__PURE__ */ new WeakMap();
|
|
34985
34985
|
this._idmap = /* @__PURE__ */ new Map();
|
|
34986
34986
|
}
|
|
34987
|
-
add(
|
|
34987
|
+
add(schema12, ..._meta) {
|
|
34988
34988
|
const meta3 = _meta[0];
|
|
34989
|
-
this._map.set(
|
|
34989
|
+
this._map.set(schema12, meta3);
|
|
34990
34990
|
if (meta3 && typeof meta3 === "object" && "id" in meta3) {
|
|
34991
|
-
this._idmap.set(meta3.id,
|
|
34991
|
+
this._idmap.set(meta3.id, schema12);
|
|
34992
34992
|
}
|
|
34993
34993
|
return this;
|
|
34994
34994
|
}
|
|
@@ -34997,26 +34997,26 @@ var $ZodRegistry = class {
|
|
|
34997
34997
|
this._idmap = /* @__PURE__ */ new Map();
|
|
34998
34998
|
return this;
|
|
34999
34999
|
}
|
|
35000
|
-
remove(
|
|
35001
|
-
const meta3 = this._map.get(
|
|
35000
|
+
remove(schema12) {
|
|
35001
|
+
const meta3 = this._map.get(schema12);
|
|
35002
35002
|
if (meta3 && typeof meta3 === "object" && "id" in meta3) {
|
|
35003
35003
|
this._idmap.delete(meta3.id);
|
|
35004
35004
|
}
|
|
35005
|
-
this._map.delete(
|
|
35005
|
+
this._map.delete(schema12);
|
|
35006
35006
|
return this;
|
|
35007
35007
|
}
|
|
35008
|
-
get(
|
|
35009
|
-
const p =
|
|
35008
|
+
get(schema12) {
|
|
35009
|
+
const p = schema12._zod.parent;
|
|
35010
35010
|
if (p) {
|
|
35011
35011
|
const pm = { ...this.get(p) ?? {} };
|
|
35012
35012
|
delete pm.id;
|
|
35013
|
-
const f = { ...pm, ...this._map.get(
|
|
35013
|
+
const f = { ...pm, ...this._map.get(schema12) };
|
|
35014
35014
|
return Object.keys(f).length ? f : void 0;
|
|
35015
35015
|
}
|
|
35016
|
-
return this._map.get(
|
|
35016
|
+
return this._map.get(schema12);
|
|
35017
35017
|
}
|
|
35018
|
-
has(
|
|
35019
|
-
return this._map.has(
|
|
35018
|
+
has(schema12) {
|
|
35019
|
+
return this._map.has(schema12);
|
|
35020
35020
|
}
|
|
35021
35021
|
};
|
|
35022
35022
|
function registry() {
|
|
@@ -35669,11 +35669,11 @@ function _endsWith(suffix, params3) {
|
|
|
35669
35669
|
});
|
|
35670
35670
|
}
|
|
35671
35671
|
// @__NO_SIDE_EFFECTS__
|
|
35672
|
-
function _property(property,
|
|
35672
|
+
function _property(property, schema12, params3) {
|
|
35673
35673
|
return new $ZodCheckProperty({
|
|
35674
35674
|
check: "property",
|
|
35675
35675
|
property,
|
|
35676
|
-
schema:
|
|
35676
|
+
schema: schema12,
|
|
35677
35677
|
...normalizeParams(params3)
|
|
35678
35678
|
});
|
|
35679
35679
|
}
|
|
@@ -35921,23 +35921,23 @@ function _promise(Class2, innerType) {
|
|
|
35921
35921
|
function _custom(Class2, fn, _params) {
|
|
35922
35922
|
const norm2 = normalizeParams(_params);
|
|
35923
35923
|
norm2.abort ?? (norm2.abort = true);
|
|
35924
|
-
const
|
|
35924
|
+
const schema12 = new Class2({
|
|
35925
35925
|
type: "custom",
|
|
35926
35926
|
check: "custom",
|
|
35927
35927
|
fn,
|
|
35928
35928
|
...norm2
|
|
35929
35929
|
});
|
|
35930
|
-
return
|
|
35930
|
+
return schema12;
|
|
35931
35931
|
}
|
|
35932
35932
|
// @__NO_SIDE_EFFECTS__
|
|
35933
35933
|
function _refine(Class2, fn, _params) {
|
|
35934
|
-
const
|
|
35934
|
+
const schema12 = new Class2({
|
|
35935
35935
|
type: "custom",
|
|
35936
35936
|
check: "custom",
|
|
35937
35937
|
fn,
|
|
35938
35938
|
...normalizeParams(_params)
|
|
35939
35939
|
});
|
|
35940
|
-
return
|
|
35940
|
+
return schema12;
|
|
35941
35941
|
}
|
|
35942
35942
|
// @__NO_SIDE_EFFECTS__
|
|
35943
35943
|
function _superRefine(fn, params3) {
|
|
@@ -36086,40 +36086,40 @@ function initializeContext(params3) {
|
|
|
36086
36086
|
external: params3?.external ?? void 0
|
|
36087
36087
|
};
|
|
36088
36088
|
}
|
|
36089
|
-
function process2(
|
|
36089
|
+
function process2(schema12, ctx, _params = { path: [], schemaPath: [] }) {
|
|
36090
36090
|
var _a3;
|
|
36091
|
-
const def =
|
|
36092
|
-
const seen = ctx.seen.get(
|
|
36091
|
+
const def = schema12._zod.def;
|
|
36092
|
+
const seen = ctx.seen.get(schema12);
|
|
36093
36093
|
if (seen) {
|
|
36094
36094
|
seen.count++;
|
|
36095
|
-
const isCycle = _params.schemaPath.includes(
|
|
36095
|
+
const isCycle = _params.schemaPath.includes(schema12);
|
|
36096
36096
|
if (isCycle) {
|
|
36097
36097
|
seen.cycle = _params.path;
|
|
36098
36098
|
}
|
|
36099
36099
|
return seen.schema;
|
|
36100
36100
|
}
|
|
36101
36101
|
const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
|
|
36102
|
-
ctx.seen.set(
|
|
36103
|
-
const overrideSchema =
|
|
36102
|
+
ctx.seen.set(schema12, result);
|
|
36103
|
+
const overrideSchema = schema12._zod.toJSONSchema?.();
|
|
36104
36104
|
if (overrideSchema) {
|
|
36105
36105
|
result.schema = overrideSchema;
|
|
36106
36106
|
} else {
|
|
36107
36107
|
const params3 = {
|
|
36108
36108
|
..._params,
|
|
36109
|
-
schemaPath: [..._params.schemaPath,
|
|
36109
|
+
schemaPath: [..._params.schemaPath, schema12],
|
|
36110
36110
|
path: _params.path
|
|
36111
36111
|
};
|
|
36112
|
-
if (
|
|
36113
|
-
|
|
36112
|
+
if (schema12._zod.processJSONSchema) {
|
|
36113
|
+
schema12._zod.processJSONSchema(ctx, result.schema, params3);
|
|
36114
36114
|
} else {
|
|
36115
36115
|
const _json = result.schema;
|
|
36116
36116
|
const processor = ctx.processors[def.type];
|
|
36117
36117
|
if (!processor) {
|
|
36118
36118
|
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
|
|
36119
36119
|
}
|
|
36120
|
-
processor(
|
|
36120
|
+
processor(schema12, ctx, _json, params3);
|
|
36121
36121
|
}
|
|
36122
|
-
const parent =
|
|
36122
|
+
const parent = schema12._zod.parent;
|
|
36123
36123
|
if (parent) {
|
|
36124
36124
|
if (!result.ref)
|
|
36125
36125
|
result.ref = parent;
|
|
@@ -36127,21 +36127,21 @@ function process2(schema11, ctx, _params = { path: [], schemaPath: [] }) {
|
|
|
36127
36127
|
ctx.seen.get(parent).isParent = true;
|
|
36128
36128
|
}
|
|
36129
36129
|
}
|
|
36130
|
-
const meta3 = ctx.metadataRegistry.get(
|
|
36130
|
+
const meta3 = ctx.metadataRegistry.get(schema12);
|
|
36131
36131
|
if (meta3)
|
|
36132
36132
|
Object.assign(result.schema, meta3);
|
|
36133
|
-
if (ctx.io === "input" && isTransforming(
|
|
36133
|
+
if (ctx.io === "input" && isTransforming(schema12)) {
|
|
36134
36134
|
delete result.schema.examples;
|
|
36135
36135
|
delete result.schema.default;
|
|
36136
36136
|
}
|
|
36137
36137
|
if (ctx.io === "input" && "_prefault" in result.schema)
|
|
36138
36138
|
(_a3 = result.schema).default ?? (_a3.default = result.schema._prefault);
|
|
36139
36139
|
delete result.schema._prefault;
|
|
36140
|
-
const _result = ctx.seen.get(
|
|
36140
|
+
const _result = ctx.seen.get(schema12);
|
|
36141
36141
|
return _result.schema;
|
|
36142
36142
|
}
|
|
36143
|
-
function extractDefs(ctx,
|
|
36144
|
-
const root = ctx.seen.get(
|
|
36143
|
+
function extractDefs(ctx, schema12) {
|
|
36144
|
+
const root = ctx.seen.get(schema12);
|
|
36145
36145
|
if (!root)
|
|
36146
36146
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
36147
36147
|
const idToSchema = /* @__PURE__ */ new Map();
|
|
@@ -36184,11 +36184,11 @@ function extractDefs(ctx, schema11) {
|
|
|
36184
36184
|
seen.def = { ...seen.schema };
|
|
36185
36185
|
if (defId)
|
|
36186
36186
|
seen.defId = defId;
|
|
36187
|
-
const
|
|
36188
|
-
for (const key3 in
|
|
36189
|
-
delete
|
|
36187
|
+
const schema13 = seen.schema;
|
|
36188
|
+
for (const key3 in schema13) {
|
|
36189
|
+
delete schema13[key3];
|
|
36190
36190
|
}
|
|
36191
|
-
|
|
36191
|
+
schema13.$ref = ref;
|
|
36192
36192
|
};
|
|
36193
36193
|
if (ctx.cycles === "throw") {
|
|
36194
36194
|
for (const entry of ctx.seen.entries()) {
|
|
@@ -36202,13 +36202,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
36202
36202
|
}
|
|
36203
36203
|
for (const entry of ctx.seen.entries()) {
|
|
36204
36204
|
const seen = entry[1];
|
|
36205
|
-
if (
|
|
36205
|
+
if (schema12 === entry[0]) {
|
|
36206
36206
|
extractToDef(entry);
|
|
36207
36207
|
continue;
|
|
36208
36208
|
}
|
|
36209
36209
|
if (ctx.external) {
|
|
36210
36210
|
const ext = ctx.external.registry.get(entry[0])?.id;
|
|
36211
|
-
if (
|
|
36211
|
+
if (schema12 !== entry[0] && ext) {
|
|
36212
36212
|
extractToDef(entry);
|
|
36213
36213
|
continue;
|
|
36214
36214
|
}
|
|
@@ -36230,16 +36230,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
36230
36230
|
}
|
|
36231
36231
|
}
|
|
36232
36232
|
}
|
|
36233
|
-
function finalize(ctx,
|
|
36234
|
-
const root = ctx.seen.get(
|
|
36233
|
+
function finalize(ctx, schema12) {
|
|
36234
|
+
const root = ctx.seen.get(schema12);
|
|
36235
36235
|
if (!root)
|
|
36236
36236
|
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
36237
36237
|
const flattenRef = (zodSchema) => {
|
|
36238
36238
|
const seen = ctx.seen.get(zodSchema);
|
|
36239
36239
|
if (seen.ref === null)
|
|
36240
36240
|
return;
|
|
36241
|
-
const
|
|
36242
|
-
const _cached = { ...
|
|
36241
|
+
const schema13 = seen.def ?? seen.schema;
|
|
36242
|
+
const _cached = { ...schema13 };
|
|
36243
36243
|
const ref = seen.ref;
|
|
36244
36244
|
seen.ref = null;
|
|
36245
36245
|
if (ref) {
|
|
@@ -36247,28 +36247,28 @@ function finalize(ctx, schema11) {
|
|
|
36247
36247
|
const refSeen = ctx.seen.get(ref);
|
|
36248
36248
|
const refSchema = refSeen.schema;
|
|
36249
36249
|
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
36250
|
-
|
|
36251
|
-
|
|
36250
|
+
schema13.allOf = schema13.allOf ?? [];
|
|
36251
|
+
schema13.allOf.push(refSchema);
|
|
36252
36252
|
} else {
|
|
36253
|
-
Object.assign(
|
|
36253
|
+
Object.assign(schema13, refSchema);
|
|
36254
36254
|
}
|
|
36255
|
-
Object.assign(
|
|
36255
|
+
Object.assign(schema13, _cached);
|
|
36256
36256
|
const isParentRef = zodSchema._zod.parent === ref;
|
|
36257
36257
|
if (isParentRef) {
|
|
36258
|
-
for (const key3 in
|
|
36258
|
+
for (const key3 in schema13) {
|
|
36259
36259
|
if (key3 === "$ref" || key3 === "allOf")
|
|
36260
36260
|
continue;
|
|
36261
36261
|
if (!(key3 in _cached)) {
|
|
36262
|
-
delete
|
|
36262
|
+
delete schema13[key3];
|
|
36263
36263
|
}
|
|
36264
36264
|
}
|
|
36265
36265
|
}
|
|
36266
36266
|
if (refSchema.$ref && refSeen.def) {
|
|
36267
|
-
for (const key3 in
|
|
36267
|
+
for (const key3 in schema13) {
|
|
36268
36268
|
if (key3 === "$ref" || key3 === "allOf")
|
|
36269
36269
|
continue;
|
|
36270
|
-
if (key3 in refSeen.def && JSON.stringify(
|
|
36271
|
-
delete
|
|
36270
|
+
if (key3 in refSeen.def && JSON.stringify(schema13[key3]) === JSON.stringify(refSeen.def[key3])) {
|
|
36271
|
+
delete schema13[key3];
|
|
36272
36272
|
}
|
|
36273
36273
|
}
|
|
36274
36274
|
}
|
|
@@ -36278,13 +36278,13 @@ function finalize(ctx, schema11) {
|
|
|
36278
36278
|
flattenRef(parent);
|
|
36279
36279
|
const parentSeen = ctx.seen.get(parent);
|
|
36280
36280
|
if (parentSeen?.schema.$ref) {
|
|
36281
|
-
|
|
36281
|
+
schema13.$ref = parentSeen.schema.$ref;
|
|
36282
36282
|
if (parentSeen.def) {
|
|
36283
|
-
for (const key3 in
|
|
36283
|
+
for (const key3 in schema13) {
|
|
36284
36284
|
if (key3 === "$ref" || key3 === "allOf")
|
|
36285
36285
|
continue;
|
|
36286
|
-
if (key3 in parentSeen.def && JSON.stringify(
|
|
36287
|
-
delete
|
|
36286
|
+
if (key3 in parentSeen.def && JSON.stringify(schema13[key3]) === JSON.stringify(parentSeen.def[key3])) {
|
|
36287
|
+
delete schema13[key3];
|
|
36288
36288
|
}
|
|
36289
36289
|
}
|
|
36290
36290
|
}
|
|
@@ -36292,7 +36292,7 @@ function finalize(ctx, schema11) {
|
|
|
36292
36292
|
}
|
|
36293
36293
|
ctx.override({
|
|
36294
36294
|
zodSchema,
|
|
36295
|
-
jsonSchema:
|
|
36295
|
+
jsonSchema: schema13,
|
|
36296
36296
|
path: seen.path ?? []
|
|
36297
36297
|
});
|
|
36298
36298
|
};
|
|
@@ -36310,13 +36310,13 @@ function finalize(ctx, schema11) {
|
|
|
36310
36310
|
} else {
|
|
36311
36311
|
}
|
|
36312
36312
|
if (ctx.external?.uri) {
|
|
36313
|
-
const id = ctx.external.registry.get(
|
|
36313
|
+
const id = ctx.external.registry.get(schema12)?.id;
|
|
36314
36314
|
if (!id)
|
|
36315
36315
|
throw new Error("Schema is missing an `id` property");
|
|
36316
36316
|
result.$id = ctx.external.uri(id);
|
|
36317
36317
|
}
|
|
36318
36318
|
Object.assign(result, root.def ?? root.schema);
|
|
36319
|
-
const rootMetaId = ctx.metadataRegistry.get(
|
|
36319
|
+
const rootMetaId = ctx.metadataRegistry.get(schema12)?.id;
|
|
36320
36320
|
if (rootMetaId !== void 0 && result.id === rootMetaId)
|
|
36321
36321
|
delete result.id;
|
|
36322
36322
|
const defs = ctx.external?.defs ?? {};
|
|
@@ -36342,10 +36342,10 @@ function finalize(ctx, schema11) {
|
|
|
36342
36342
|
const finalized = JSON.parse(JSON.stringify(result));
|
|
36343
36343
|
Object.defineProperty(finalized, "~standard", {
|
|
36344
36344
|
value: {
|
|
36345
|
-
...
|
|
36345
|
+
...schema12["~standard"],
|
|
36346
36346
|
jsonSchema: {
|
|
36347
|
-
input: createStandardJSONSchemaMethod(
|
|
36348
|
-
output: createStandardJSONSchemaMethod(
|
|
36347
|
+
input: createStandardJSONSchemaMethod(schema12, "input", ctx.processors),
|
|
36348
|
+
output: createStandardJSONSchemaMethod(schema12, "output", ctx.processors)
|
|
36349
36349
|
}
|
|
36350
36350
|
},
|
|
36351
36351
|
enumerable: false,
|
|
@@ -36409,18 +36409,18 @@ function isTransforming(_schema, _ctx) {
|
|
|
36409
36409
|
}
|
|
36410
36410
|
return false;
|
|
36411
36411
|
}
|
|
36412
|
-
var createToJSONSchemaMethod = (
|
|
36412
|
+
var createToJSONSchemaMethod = (schema12, processors = {}) => (params3) => {
|
|
36413
36413
|
const ctx = initializeContext({ ...params3, processors });
|
|
36414
|
-
process2(
|
|
36415
|
-
extractDefs(ctx,
|
|
36416
|
-
return finalize(ctx,
|
|
36414
|
+
process2(schema12, ctx);
|
|
36415
|
+
extractDefs(ctx, schema12);
|
|
36416
|
+
return finalize(ctx, schema12);
|
|
36417
36417
|
};
|
|
36418
|
-
var createStandardJSONSchemaMethod = (
|
|
36418
|
+
var createStandardJSONSchemaMethod = (schema12, io, processors = {}) => (params3) => {
|
|
36419
36419
|
const { libraryOptions, target } = params3 ?? {};
|
|
36420
36420
|
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
36421
|
-
process2(
|
|
36422
|
-
extractDefs(ctx,
|
|
36423
|
-
return finalize(ctx,
|
|
36421
|
+
process2(schema12, ctx);
|
|
36422
|
+
extractDefs(ctx, schema12);
|
|
36423
|
+
return finalize(ctx, schema12);
|
|
36424
36424
|
};
|
|
36425
36425
|
|
|
36426
36426
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
|
|
@@ -36432,10 +36432,10 @@ var formatMap = {
|
|
|
36432
36432
|
regex: ""
|
|
36433
36433
|
// do not set
|
|
36434
36434
|
};
|
|
36435
|
-
var stringProcessor = (
|
|
36435
|
+
var stringProcessor = (schema12, ctx, _json, _params) => {
|
|
36436
36436
|
const json2 = _json;
|
|
36437
36437
|
json2.type = "string";
|
|
36438
|
-
const { minimum, maximum, format, patterns, contentEncoding } =
|
|
36438
|
+
const { minimum, maximum, format, patterns, contentEncoding } = schema12._zod.bag;
|
|
36439
36439
|
if (typeof minimum === "number")
|
|
36440
36440
|
json2.minLength = minimum;
|
|
36441
36441
|
if (typeof maximum === "number")
|
|
@@ -36464,9 +36464,9 @@ var stringProcessor = (schema11, ctx, _json, _params) => {
|
|
|
36464
36464
|
}
|
|
36465
36465
|
}
|
|
36466
36466
|
};
|
|
36467
|
-
var numberProcessor = (
|
|
36467
|
+
var numberProcessor = (schema12, ctx, _json, _params) => {
|
|
36468
36468
|
const json2 = _json;
|
|
36469
|
-
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } =
|
|
36469
|
+
const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema12._zod.bag;
|
|
36470
36470
|
if (typeof format === "string" && format.includes("int"))
|
|
36471
36471
|
json2.type = "integer";
|
|
36472
36472
|
else
|
|
@@ -36541,8 +36541,8 @@ var dateProcessor = (_schema, ctx, _json, _params) => {
|
|
|
36541
36541
|
throw new Error("Date cannot be represented in JSON Schema");
|
|
36542
36542
|
}
|
|
36543
36543
|
};
|
|
36544
|
-
var enumProcessor = (
|
|
36545
|
-
const def =
|
|
36544
|
+
var enumProcessor = (schema12, _ctx, json2, _params) => {
|
|
36545
|
+
const def = schema12._zod.def;
|
|
36546
36546
|
const values = getEnumValues(def.entries);
|
|
36547
36547
|
if (values.every((v) => typeof v === "number"))
|
|
36548
36548
|
json2.type = "number";
|
|
@@ -36550,8 +36550,8 @@ var enumProcessor = (schema11, _ctx, json2, _params) => {
|
|
|
36550
36550
|
json2.type = "string";
|
|
36551
36551
|
json2.enum = values;
|
|
36552
36552
|
};
|
|
36553
|
-
var literalProcessor = (
|
|
36554
|
-
const def =
|
|
36553
|
+
var literalProcessor = (schema12, ctx, json2, _params) => {
|
|
36554
|
+
const def = schema12._zod.def;
|
|
36555
36555
|
const vals = [];
|
|
36556
36556
|
for (const val of def.values) {
|
|
36557
36557
|
if (val === void 0) {
|
|
@@ -36595,22 +36595,22 @@ var nanProcessor = (_schema, ctx, _json, _params) => {
|
|
|
36595
36595
|
throw new Error("NaN cannot be represented in JSON Schema");
|
|
36596
36596
|
}
|
|
36597
36597
|
};
|
|
36598
|
-
var templateLiteralProcessor = (
|
|
36598
|
+
var templateLiteralProcessor = (schema12, _ctx, json2, _params) => {
|
|
36599
36599
|
const _json = json2;
|
|
36600
|
-
const pattern =
|
|
36600
|
+
const pattern = schema12._zod.pattern;
|
|
36601
36601
|
if (!pattern)
|
|
36602
36602
|
throw new Error("Pattern not found in template literal");
|
|
36603
36603
|
_json.type = "string";
|
|
36604
36604
|
_json.pattern = pattern.source;
|
|
36605
36605
|
};
|
|
36606
|
-
var fileProcessor = (
|
|
36606
|
+
var fileProcessor = (schema12, _ctx, json2, _params) => {
|
|
36607
36607
|
const _json = json2;
|
|
36608
36608
|
const file2 = {
|
|
36609
36609
|
type: "string",
|
|
36610
36610
|
format: "binary",
|
|
36611
36611
|
contentEncoding: "binary"
|
|
36612
36612
|
};
|
|
36613
|
-
const { minimum, maximum, mime } =
|
|
36613
|
+
const { minimum, maximum, mime } = schema12._zod.bag;
|
|
36614
36614
|
if (minimum !== void 0)
|
|
36615
36615
|
file2.minLength = minimum;
|
|
36616
36616
|
if (maximum !== void 0)
|
|
@@ -36655,10 +36655,10 @@ var setProcessor = (_schema, ctx, _json, _params) => {
|
|
|
36655
36655
|
throw new Error("Set cannot be represented in JSON Schema");
|
|
36656
36656
|
}
|
|
36657
36657
|
};
|
|
36658
|
-
var arrayProcessor = (
|
|
36658
|
+
var arrayProcessor = (schema12, ctx, _json, params3) => {
|
|
36659
36659
|
const json2 = _json;
|
|
36660
|
-
const def =
|
|
36661
|
-
const { minimum, maximum } =
|
|
36660
|
+
const def = schema12._zod.def;
|
|
36661
|
+
const { minimum, maximum } = schema12._zod.bag;
|
|
36662
36662
|
if (typeof minimum === "number")
|
|
36663
36663
|
json2.minItems = minimum;
|
|
36664
36664
|
if (typeof maximum === "number")
|
|
@@ -36669,9 +36669,9 @@ var arrayProcessor = (schema11, ctx, _json, params3) => {
|
|
|
36669
36669
|
path: [...params3.path, "items"]
|
|
36670
36670
|
});
|
|
36671
36671
|
};
|
|
36672
|
-
var objectProcessor = (
|
|
36672
|
+
var objectProcessor = (schema12, ctx, _json, params3) => {
|
|
36673
36673
|
const json2 = _json;
|
|
36674
|
-
const def =
|
|
36674
|
+
const def = schema12._zod.def;
|
|
36675
36675
|
json2.type = "object";
|
|
36676
36676
|
json2.properties = {};
|
|
36677
36677
|
const shape = def.shape;
|
|
@@ -36705,8 +36705,8 @@ var objectProcessor = (schema11, ctx, _json, params3) => {
|
|
|
36705
36705
|
});
|
|
36706
36706
|
}
|
|
36707
36707
|
};
|
|
36708
|
-
var unionProcessor = (
|
|
36709
|
-
const def =
|
|
36708
|
+
var unionProcessor = (schema12, ctx, json2, params3) => {
|
|
36709
|
+
const def = schema12._zod.def;
|
|
36710
36710
|
const isExclusive = def.inclusive === false;
|
|
36711
36711
|
const options = def.options.map((x, i) => process2(x, ctx, {
|
|
36712
36712
|
...params3,
|
|
@@ -36718,8 +36718,8 @@ var unionProcessor = (schema11, ctx, json2, params3) => {
|
|
|
36718
36718
|
json2.anyOf = options;
|
|
36719
36719
|
}
|
|
36720
36720
|
};
|
|
36721
|
-
var intersectionProcessor = (
|
|
36722
|
-
const def =
|
|
36721
|
+
var intersectionProcessor = (schema12, ctx, json2, params3) => {
|
|
36722
|
+
const def = schema12._zod.def;
|
|
36723
36723
|
const a = process2(def.left, ctx, {
|
|
36724
36724
|
...params3,
|
|
36725
36725
|
path: [...params3.path, "allOf", 0]
|
|
@@ -36735,9 +36735,9 @@ var intersectionProcessor = (schema11, ctx, json2, params3) => {
|
|
|
36735
36735
|
];
|
|
36736
36736
|
json2.allOf = allOf;
|
|
36737
36737
|
};
|
|
36738
|
-
var tupleProcessor = (
|
|
36738
|
+
var tupleProcessor = (schema12, ctx, _json, params3) => {
|
|
36739
36739
|
const json2 = _json;
|
|
36740
|
-
const def =
|
|
36740
|
+
const def = schema12._zod.def;
|
|
36741
36741
|
json2.type = "array";
|
|
36742
36742
|
const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
36743
36743
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
@@ -36771,15 +36771,15 @@ var tupleProcessor = (schema11, ctx, _json, params3) => {
|
|
|
36771
36771
|
json2.additionalItems = rest;
|
|
36772
36772
|
}
|
|
36773
36773
|
}
|
|
36774
|
-
const { minimum, maximum } =
|
|
36774
|
+
const { minimum, maximum } = schema12._zod.bag;
|
|
36775
36775
|
if (typeof minimum === "number")
|
|
36776
36776
|
json2.minItems = minimum;
|
|
36777
36777
|
if (typeof maximum === "number")
|
|
36778
36778
|
json2.maxItems = maximum;
|
|
36779
36779
|
};
|
|
36780
|
-
var recordProcessor = (
|
|
36780
|
+
var recordProcessor = (schema12, ctx, _json, params3) => {
|
|
36781
36781
|
const json2 = _json;
|
|
36782
|
-
const def =
|
|
36782
|
+
const def = schema12._zod.def;
|
|
36783
36783
|
json2.type = "object";
|
|
36784
36784
|
const keyType = def.keyType;
|
|
36785
36785
|
const keyBag = keyType._zod.bag;
|
|
@@ -36813,10 +36813,10 @@ var recordProcessor = (schema11, ctx, _json, params3) => {
|
|
|
36813
36813
|
}
|
|
36814
36814
|
}
|
|
36815
36815
|
};
|
|
36816
|
-
var nullableProcessor = (
|
|
36817
|
-
const def =
|
|
36816
|
+
var nullableProcessor = (schema12, ctx, json2, params3) => {
|
|
36817
|
+
const def = schema12._zod.def;
|
|
36818
36818
|
const inner = process2(def.innerType, ctx, params3);
|
|
36819
|
-
const seen = ctx.seen.get(
|
|
36819
|
+
const seen = ctx.seen.get(schema12);
|
|
36820
36820
|
if (ctx.target === "openapi-3.0") {
|
|
36821
36821
|
seen.ref = def.innerType;
|
|
36822
36822
|
json2.nullable = true;
|
|
@@ -36824,31 +36824,31 @@ var nullableProcessor = (schema11, ctx, json2, params3) => {
|
|
|
36824
36824
|
json2.anyOf = [inner, { type: "null" }];
|
|
36825
36825
|
}
|
|
36826
36826
|
};
|
|
36827
|
-
var nonoptionalProcessor = (
|
|
36828
|
-
const def =
|
|
36827
|
+
var nonoptionalProcessor = (schema12, ctx, _json, params3) => {
|
|
36828
|
+
const def = schema12._zod.def;
|
|
36829
36829
|
process2(def.innerType, ctx, params3);
|
|
36830
|
-
const seen = ctx.seen.get(
|
|
36830
|
+
const seen = ctx.seen.get(schema12);
|
|
36831
36831
|
seen.ref = def.innerType;
|
|
36832
36832
|
};
|
|
36833
|
-
var defaultProcessor = (
|
|
36834
|
-
const def =
|
|
36833
|
+
var defaultProcessor = (schema12, ctx, json2, params3) => {
|
|
36834
|
+
const def = schema12._zod.def;
|
|
36835
36835
|
process2(def.innerType, ctx, params3);
|
|
36836
|
-
const seen = ctx.seen.get(
|
|
36836
|
+
const seen = ctx.seen.get(schema12);
|
|
36837
36837
|
seen.ref = def.innerType;
|
|
36838
36838
|
json2.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
36839
36839
|
};
|
|
36840
|
-
var prefaultProcessor = (
|
|
36841
|
-
const def =
|
|
36840
|
+
var prefaultProcessor = (schema12, ctx, json2, params3) => {
|
|
36841
|
+
const def = schema12._zod.def;
|
|
36842
36842
|
process2(def.innerType, ctx, params3);
|
|
36843
|
-
const seen = ctx.seen.get(
|
|
36843
|
+
const seen = ctx.seen.get(schema12);
|
|
36844
36844
|
seen.ref = def.innerType;
|
|
36845
36845
|
if (ctx.io === "input")
|
|
36846
36846
|
json2._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
36847
36847
|
};
|
|
36848
|
-
var catchProcessor = (
|
|
36849
|
-
const def =
|
|
36848
|
+
var catchProcessor = (schema12, ctx, json2, params3) => {
|
|
36849
|
+
const def = schema12._zod.def;
|
|
36850
36850
|
process2(def.innerType, ctx, params3);
|
|
36851
|
-
const seen = ctx.seen.get(
|
|
36851
|
+
const seen = ctx.seen.get(schema12);
|
|
36852
36852
|
seen.ref = def.innerType;
|
|
36853
36853
|
let catchValue;
|
|
36854
36854
|
try {
|
|
@@ -36858,37 +36858,37 @@ var catchProcessor = (schema11, ctx, json2, params3) => {
|
|
|
36858
36858
|
}
|
|
36859
36859
|
json2.default = catchValue;
|
|
36860
36860
|
};
|
|
36861
|
-
var pipeProcessor = (
|
|
36862
|
-
const def =
|
|
36861
|
+
var pipeProcessor = (schema12, ctx, _json, params3) => {
|
|
36862
|
+
const def = schema12._zod.def;
|
|
36863
36863
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
36864
36864
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
36865
36865
|
process2(innerType, ctx, params3);
|
|
36866
|
-
const seen = ctx.seen.get(
|
|
36866
|
+
const seen = ctx.seen.get(schema12);
|
|
36867
36867
|
seen.ref = innerType;
|
|
36868
36868
|
};
|
|
36869
|
-
var readonlyProcessor = (
|
|
36870
|
-
const def =
|
|
36869
|
+
var readonlyProcessor = (schema12, ctx, json2, params3) => {
|
|
36870
|
+
const def = schema12._zod.def;
|
|
36871
36871
|
process2(def.innerType, ctx, params3);
|
|
36872
|
-
const seen = ctx.seen.get(
|
|
36872
|
+
const seen = ctx.seen.get(schema12);
|
|
36873
36873
|
seen.ref = def.innerType;
|
|
36874
36874
|
json2.readOnly = true;
|
|
36875
36875
|
};
|
|
36876
|
-
var promiseProcessor = (
|
|
36877
|
-
const def =
|
|
36876
|
+
var promiseProcessor = (schema12, ctx, _json, params3) => {
|
|
36877
|
+
const def = schema12._zod.def;
|
|
36878
36878
|
process2(def.innerType, ctx, params3);
|
|
36879
|
-
const seen = ctx.seen.get(
|
|
36879
|
+
const seen = ctx.seen.get(schema12);
|
|
36880
36880
|
seen.ref = def.innerType;
|
|
36881
36881
|
};
|
|
36882
|
-
var optionalProcessor = (
|
|
36883
|
-
const def =
|
|
36882
|
+
var optionalProcessor = (schema12, ctx, _json, params3) => {
|
|
36883
|
+
const def = schema12._zod.def;
|
|
36884
36884
|
process2(def.innerType, ctx, params3);
|
|
36885
|
-
const seen = ctx.seen.get(
|
|
36885
|
+
const seen = ctx.seen.get(schema12);
|
|
36886
36886
|
seen.ref = def.innerType;
|
|
36887
36887
|
};
|
|
36888
|
-
var lazyProcessor = (
|
|
36889
|
-
const innerType =
|
|
36888
|
+
var lazyProcessor = (schema12, ctx, _json, params3) => {
|
|
36889
|
+
const innerType = schema12._zod.innerType;
|
|
36890
36890
|
process2(innerType, ctx, params3);
|
|
36891
|
-
const seen = ctx.seen.get(
|
|
36891
|
+
const seen = ctx.seen.get(schema12);
|
|
36892
36892
|
seen.ref = innerType;
|
|
36893
36893
|
};
|
|
36894
36894
|
var allProcessors = {
|
|
@@ -36938,8 +36938,8 @@ function toJSONSchema(input, params3) {
|
|
|
36938
36938
|
const ctx2 = initializeContext({ ...params3, processors: allProcessors });
|
|
36939
36939
|
const defs = {};
|
|
36940
36940
|
for (const entry of registry2._idmap.entries()) {
|
|
36941
|
-
const [_,
|
|
36942
|
-
process2(
|
|
36941
|
+
const [_, schema12] = entry;
|
|
36942
|
+
process2(schema12, ctx2);
|
|
36943
36943
|
}
|
|
36944
36944
|
const schemas = {};
|
|
36945
36945
|
const external = {
|
|
@@ -36949,9 +36949,9 @@ function toJSONSchema(input, params3) {
|
|
|
36949
36949
|
};
|
|
36950
36950
|
ctx2.external = external;
|
|
36951
36951
|
for (const entry of registry2._idmap.entries()) {
|
|
36952
|
-
const [key3,
|
|
36953
|
-
extractDefs(ctx2,
|
|
36954
|
-
schemas[key3] = finalize(ctx2,
|
|
36952
|
+
const [key3, schema12] = entry;
|
|
36953
|
+
extractDefs(ctx2, schema12);
|
|
36954
|
+
schemas[key3] = finalize(ctx2, schema12);
|
|
36955
36955
|
}
|
|
36956
36956
|
if (Object.keys(defs).length > 0) {
|
|
36957
36957
|
const defsSegment = ctx2.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
@@ -37019,14 +37019,14 @@ var JSONSchemaGenerator = class {
|
|
|
37019
37019
|
* Process a schema to prepare it for JSON Schema generation.
|
|
37020
37020
|
* This must be called before emit().
|
|
37021
37021
|
*/
|
|
37022
|
-
process(
|
|
37023
|
-
return process2(
|
|
37022
|
+
process(schema12, _params = { path: [], schemaPath: [] }) {
|
|
37023
|
+
return process2(schema12, this.ctx, _params);
|
|
37024
37024
|
}
|
|
37025
37025
|
/**
|
|
37026
37026
|
* Emit the final JSON Schema after processing.
|
|
37027
37027
|
* Must call process() first.
|
|
37028
37028
|
*/
|
|
37029
|
-
emit(
|
|
37029
|
+
emit(schema12, _params) {
|
|
37030
37030
|
if (_params) {
|
|
37031
37031
|
if (_params.cycles)
|
|
37032
37032
|
this.ctx.cycles = _params.cycles;
|
|
@@ -37035,8 +37035,8 @@ var JSONSchemaGenerator = class {
|
|
|
37035
37035
|
if (_params.external)
|
|
37036
37036
|
this.ctx.external = _params.external;
|
|
37037
37037
|
}
|
|
37038
|
-
extractDefs(this.ctx,
|
|
37039
|
-
const result = finalize(this.ctx,
|
|
37038
|
+
extractDefs(this.ctx, schema12);
|
|
37039
|
+
const result = finalize(this.ctx, schema12);
|
|
37040
37040
|
const { "~standard": _, ...plainResult } = result;
|
|
37041
37041
|
return plainResult;
|
|
37042
37042
|
}
|
|
@@ -38001,8 +38001,8 @@ var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
|
38001
38001
|
function array(element, params3) {
|
|
38002
38002
|
return _array(ZodArray, element, params3);
|
|
38003
38003
|
}
|
|
38004
|
-
function keyof(
|
|
38005
|
-
const shape =
|
|
38004
|
+
function keyof(schema12) {
|
|
38005
|
+
const shape = schema12._zod.def.shape;
|
|
38006
38006
|
return _enum2(Object.keys(shape));
|
|
38007
38007
|
}
|
|
38008
38008
|
var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
@@ -38627,11 +38627,11 @@ function json(params3) {
|
|
|
38627
38627
|
});
|
|
38628
38628
|
return jsonSchema;
|
|
38629
38629
|
}
|
|
38630
|
-
function preprocess(fn,
|
|
38630
|
+
function preprocess(fn, schema12) {
|
|
38631
38631
|
return new ZodPreprocess({
|
|
38632
38632
|
type: "pipe",
|
|
38633
38633
|
in: transform(fn),
|
|
38634
|
-
out:
|
|
38634
|
+
out: schema12
|
|
38635
38635
|
});
|
|
38636
38636
|
}
|
|
38637
38637
|
|
|
@@ -38738,8 +38738,8 @@ var RECOGNIZED_KEYS = /* @__PURE__ */ new Set([
|
|
|
38738
38738
|
"nullable",
|
|
38739
38739
|
"readOnly"
|
|
38740
38740
|
]);
|
|
38741
|
-
function detectVersion(
|
|
38742
|
-
const $schema =
|
|
38741
|
+
function detectVersion(schema12, defaultTarget) {
|
|
38742
|
+
const $schema = schema12.$schema;
|
|
38743
38743
|
if ($schema === "https://json-schema.org/draft/2020-12/schema") {
|
|
38744
38744
|
return "draft-2020-12";
|
|
38745
38745
|
}
|
|
@@ -38769,27 +38769,27 @@ function resolveRef(ref, ctx) {
|
|
|
38769
38769
|
}
|
|
38770
38770
|
throw new Error(`Reference not found: ${ref}`);
|
|
38771
38771
|
}
|
|
38772
|
-
function convertBaseSchema(
|
|
38773
|
-
if (
|
|
38774
|
-
if (typeof
|
|
38772
|
+
function convertBaseSchema(schema12, ctx) {
|
|
38773
|
+
if (schema12.not !== void 0) {
|
|
38774
|
+
if (typeof schema12.not === "object" && Object.keys(schema12.not).length === 0) {
|
|
38775
38775
|
return z.never();
|
|
38776
38776
|
}
|
|
38777
38777
|
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
38778
38778
|
}
|
|
38779
|
-
if (
|
|
38779
|
+
if (schema12.unevaluatedItems !== void 0) {
|
|
38780
38780
|
throw new Error("unevaluatedItems is not supported");
|
|
38781
38781
|
}
|
|
38782
|
-
if (
|
|
38782
|
+
if (schema12.unevaluatedProperties !== void 0) {
|
|
38783
38783
|
throw new Error("unevaluatedProperties is not supported");
|
|
38784
38784
|
}
|
|
38785
|
-
if (
|
|
38785
|
+
if (schema12.if !== void 0 || schema12.then !== void 0 || schema12.else !== void 0) {
|
|
38786
38786
|
throw new Error("Conditional schemas (if/then/else) are not supported");
|
|
38787
38787
|
}
|
|
38788
|
-
if (
|
|
38788
|
+
if (schema12.dependentSchemas !== void 0 || schema12.dependentRequired !== void 0) {
|
|
38789
38789
|
throw new Error("dependentSchemas and dependentRequired are not supported");
|
|
38790
38790
|
}
|
|
38791
|
-
if (
|
|
38792
|
-
const refPath =
|
|
38791
|
+
if (schema12.$ref) {
|
|
38792
|
+
const refPath = schema12.$ref;
|
|
38793
38793
|
if (ctx.refs.has(refPath)) {
|
|
38794
38794
|
return ctx.refs.get(refPath);
|
|
38795
38795
|
}
|
|
@@ -38808,9 +38808,9 @@ function convertBaseSchema(schema11, ctx) {
|
|
|
38808
38808
|
ctx.processing.delete(refPath);
|
|
38809
38809
|
return zodSchema2;
|
|
38810
38810
|
}
|
|
38811
|
-
if (
|
|
38812
|
-
const enumValues =
|
|
38813
|
-
if (ctx.version === "openapi-3.0" &&
|
|
38811
|
+
if (schema12.enum !== void 0) {
|
|
38812
|
+
const enumValues = schema12.enum;
|
|
38813
|
+
if (ctx.version === "openapi-3.0" && schema12.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
|
|
38814
38814
|
return z.null();
|
|
38815
38815
|
}
|
|
38816
38816
|
if (enumValues.length === 0) {
|
|
@@ -38828,13 +38828,13 @@ function convertBaseSchema(schema11, ctx) {
|
|
|
38828
38828
|
}
|
|
38829
38829
|
return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
|
|
38830
38830
|
}
|
|
38831
|
-
if (
|
|
38832
|
-
return z.literal(
|
|
38831
|
+
if (schema12.const !== void 0) {
|
|
38832
|
+
return z.literal(schema12.const);
|
|
38833
38833
|
}
|
|
38834
|
-
const type =
|
|
38834
|
+
const type = schema12.type;
|
|
38835
38835
|
if (Array.isArray(type)) {
|
|
38836
38836
|
const typeSchemas = type.map((t) => {
|
|
38837
|
-
const typeSchema = { ...
|
|
38837
|
+
const typeSchema = { ...schema12, type: t };
|
|
38838
38838
|
return convertBaseSchema(typeSchema, ctx);
|
|
38839
38839
|
});
|
|
38840
38840
|
if (typeSchemas.length === 0) {
|
|
@@ -38852,8 +38852,8 @@ function convertBaseSchema(schema11, ctx) {
|
|
|
38852
38852
|
switch (type) {
|
|
38853
38853
|
case "string": {
|
|
38854
38854
|
let stringSchema = z.string();
|
|
38855
|
-
if (
|
|
38856
|
-
const format =
|
|
38855
|
+
if (schema12.format) {
|
|
38856
|
+
const format = schema12.format;
|
|
38857
38857
|
if (format === "email") {
|
|
38858
38858
|
stringSchema = stringSchema.check(z.email());
|
|
38859
38859
|
} else if (format === "uri" || format === "uri-reference") {
|
|
@@ -38902,14 +38902,14 @@ function convertBaseSchema(schema11, ctx) {
|
|
|
38902
38902
|
stringSchema = stringSchema.check(z.ksuid());
|
|
38903
38903
|
}
|
|
38904
38904
|
}
|
|
38905
|
-
if (typeof
|
|
38906
|
-
stringSchema = stringSchema.min(
|
|
38905
|
+
if (typeof schema12.minLength === "number") {
|
|
38906
|
+
stringSchema = stringSchema.min(schema12.minLength);
|
|
38907
38907
|
}
|
|
38908
|
-
if (typeof
|
|
38909
|
-
stringSchema = stringSchema.max(
|
|
38908
|
+
if (typeof schema12.maxLength === "number") {
|
|
38909
|
+
stringSchema = stringSchema.max(schema12.maxLength);
|
|
38910
38910
|
}
|
|
38911
|
-
if (
|
|
38912
|
-
stringSchema = stringSchema.regex(new RegExp(
|
|
38911
|
+
if (schema12.pattern) {
|
|
38912
|
+
stringSchema = stringSchema.regex(new RegExp(schema12.pattern));
|
|
38913
38913
|
}
|
|
38914
38914
|
zodSchema = stringSchema;
|
|
38915
38915
|
break;
|
|
@@ -38917,24 +38917,24 @@ function convertBaseSchema(schema11, ctx) {
|
|
|
38917
38917
|
case "number":
|
|
38918
38918
|
case "integer": {
|
|
38919
38919
|
let numberSchema = type === "integer" ? z.number().int() : z.number();
|
|
38920
|
-
if (typeof
|
|
38921
|
-
numberSchema = numberSchema.min(
|
|
38920
|
+
if (typeof schema12.minimum === "number") {
|
|
38921
|
+
numberSchema = numberSchema.min(schema12.minimum);
|
|
38922
38922
|
}
|
|
38923
|
-
if (typeof
|
|
38924
|
-
numberSchema = numberSchema.max(
|
|
38923
|
+
if (typeof schema12.maximum === "number") {
|
|
38924
|
+
numberSchema = numberSchema.max(schema12.maximum);
|
|
38925
38925
|
}
|
|
38926
|
-
if (typeof
|
|
38927
|
-
numberSchema = numberSchema.gt(
|
|
38928
|
-
} else if (
|
|
38929
|
-
numberSchema = numberSchema.gt(
|
|
38926
|
+
if (typeof schema12.exclusiveMinimum === "number") {
|
|
38927
|
+
numberSchema = numberSchema.gt(schema12.exclusiveMinimum);
|
|
38928
|
+
} else if (schema12.exclusiveMinimum === true && typeof schema12.minimum === "number") {
|
|
38929
|
+
numberSchema = numberSchema.gt(schema12.minimum);
|
|
38930
38930
|
}
|
|
38931
|
-
if (typeof
|
|
38932
|
-
numberSchema = numberSchema.lt(
|
|
38933
|
-
} else if (
|
|
38934
|
-
numberSchema = numberSchema.lt(
|
|
38931
|
+
if (typeof schema12.exclusiveMaximum === "number") {
|
|
38932
|
+
numberSchema = numberSchema.lt(schema12.exclusiveMaximum);
|
|
38933
|
+
} else if (schema12.exclusiveMaximum === true && typeof schema12.maximum === "number") {
|
|
38934
|
+
numberSchema = numberSchema.lt(schema12.maximum);
|
|
38935
38935
|
}
|
|
38936
|
-
if (typeof
|
|
38937
|
-
numberSchema = numberSchema.multipleOf(
|
|
38936
|
+
if (typeof schema12.multipleOf === "number") {
|
|
38937
|
+
numberSchema = numberSchema.multipleOf(schema12.multipleOf);
|
|
38938
38938
|
}
|
|
38939
38939
|
zodSchema = numberSchema;
|
|
38940
38940
|
break;
|
|
@@ -38949,15 +38949,15 @@ function convertBaseSchema(schema11, ctx) {
|
|
|
38949
38949
|
}
|
|
38950
38950
|
case "object": {
|
|
38951
38951
|
const shape = {};
|
|
38952
|
-
const properties =
|
|
38953
|
-
const requiredSet = new Set(
|
|
38952
|
+
const properties = schema12.properties || {};
|
|
38953
|
+
const requiredSet = new Set(schema12.required || []);
|
|
38954
38954
|
for (const [key3, propSchema] of Object.entries(properties)) {
|
|
38955
38955
|
const propZodSchema = convertSchema(propSchema, ctx);
|
|
38956
38956
|
shape[key3] = requiredSet.has(key3) ? propZodSchema : propZodSchema.optional();
|
|
38957
38957
|
}
|
|
38958
|
-
if (
|
|
38959
|
-
const keySchema2 = convertSchema(
|
|
38960
|
-
const valueSchema =
|
|
38958
|
+
if (schema12.propertyNames) {
|
|
38959
|
+
const keySchema2 = convertSchema(schema12.propertyNames, ctx);
|
|
38960
|
+
const valueSchema = schema12.additionalProperties && typeof schema12.additionalProperties === "object" ? convertSchema(schema12.additionalProperties, ctx) : z.any();
|
|
38961
38961
|
if (Object.keys(shape).length === 0) {
|
|
38962
38962
|
zodSchema = z.record(keySchema2, valueSchema);
|
|
38963
38963
|
break;
|
|
@@ -38967,8 +38967,8 @@ function convertBaseSchema(schema11, ctx) {
|
|
|
38967
38967
|
zodSchema = z.intersection(objectSchema2, recordSchema);
|
|
38968
38968
|
break;
|
|
38969
38969
|
}
|
|
38970
|
-
if (
|
|
38971
|
-
const patternProps =
|
|
38970
|
+
if (schema12.patternProperties) {
|
|
38971
|
+
const patternProps = schema12.patternProperties;
|
|
38972
38972
|
const patternKeys = Object.keys(patternProps);
|
|
38973
38973
|
const looseRecords = [];
|
|
38974
38974
|
for (const pattern of patternKeys) {
|
|
@@ -38995,18 +38995,18 @@ function convertBaseSchema(schema11, ctx) {
|
|
|
38995
38995
|
break;
|
|
38996
38996
|
}
|
|
38997
38997
|
const objectSchema = z.object(shape);
|
|
38998
|
-
if (
|
|
38998
|
+
if (schema12.additionalProperties === false) {
|
|
38999
38999
|
zodSchema = objectSchema.strict();
|
|
39000
|
-
} else if (typeof
|
|
39001
|
-
zodSchema = objectSchema.catchall(convertSchema(
|
|
39000
|
+
} else if (typeof schema12.additionalProperties === "object") {
|
|
39001
|
+
zodSchema = objectSchema.catchall(convertSchema(schema12.additionalProperties, ctx));
|
|
39002
39002
|
} else {
|
|
39003
39003
|
zodSchema = objectSchema.passthrough();
|
|
39004
39004
|
}
|
|
39005
39005
|
break;
|
|
39006
39006
|
}
|
|
39007
39007
|
case "array": {
|
|
39008
|
-
const prefixItems =
|
|
39009
|
-
const items =
|
|
39008
|
+
const prefixItems = schema12.prefixItems;
|
|
39009
|
+
const items = schema12.items;
|
|
39010
39010
|
if (prefixItems && Array.isArray(prefixItems)) {
|
|
39011
39011
|
const tupleItems = prefixItems.map((item2) => convertSchema(item2, ctx));
|
|
39012
39012
|
const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
|
|
@@ -39015,34 +39015,34 @@ function convertBaseSchema(schema11, ctx) {
|
|
|
39015
39015
|
} else {
|
|
39016
39016
|
zodSchema = z.tuple(tupleItems);
|
|
39017
39017
|
}
|
|
39018
|
-
if (typeof
|
|
39019
|
-
zodSchema = zodSchema.check(z.minLength(
|
|
39018
|
+
if (typeof schema12.minItems === "number") {
|
|
39019
|
+
zodSchema = zodSchema.check(z.minLength(schema12.minItems));
|
|
39020
39020
|
}
|
|
39021
|
-
if (typeof
|
|
39022
|
-
zodSchema = zodSchema.check(z.maxLength(
|
|
39021
|
+
if (typeof schema12.maxItems === "number") {
|
|
39022
|
+
zodSchema = zodSchema.check(z.maxLength(schema12.maxItems));
|
|
39023
39023
|
}
|
|
39024
39024
|
} else if (Array.isArray(items)) {
|
|
39025
39025
|
const tupleItems = items.map((item2) => convertSchema(item2, ctx));
|
|
39026
|
-
const rest =
|
|
39026
|
+
const rest = schema12.additionalItems && typeof schema12.additionalItems === "object" ? convertSchema(schema12.additionalItems, ctx) : void 0;
|
|
39027
39027
|
if (rest) {
|
|
39028
39028
|
zodSchema = z.tuple(tupleItems).rest(rest);
|
|
39029
39029
|
} else {
|
|
39030
39030
|
zodSchema = z.tuple(tupleItems);
|
|
39031
39031
|
}
|
|
39032
|
-
if (typeof
|
|
39033
|
-
zodSchema = zodSchema.check(z.minLength(
|
|
39032
|
+
if (typeof schema12.minItems === "number") {
|
|
39033
|
+
zodSchema = zodSchema.check(z.minLength(schema12.minItems));
|
|
39034
39034
|
}
|
|
39035
|
-
if (typeof
|
|
39036
|
-
zodSchema = zodSchema.check(z.maxLength(
|
|
39035
|
+
if (typeof schema12.maxItems === "number") {
|
|
39036
|
+
zodSchema = zodSchema.check(z.maxLength(schema12.maxItems));
|
|
39037
39037
|
}
|
|
39038
39038
|
} else if (items !== void 0) {
|
|
39039
39039
|
const element = convertSchema(items, ctx);
|
|
39040
39040
|
let arraySchema = z.array(element);
|
|
39041
|
-
if (typeof
|
|
39042
|
-
arraySchema = arraySchema.min(
|
|
39041
|
+
if (typeof schema12.minItems === "number") {
|
|
39042
|
+
arraySchema = arraySchema.min(schema12.minItems);
|
|
39043
39043
|
}
|
|
39044
|
-
if (typeof
|
|
39045
|
-
arraySchema = arraySchema.max(
|
|
39044
|
+
if (typeof schema12.maxItems === "number") {
|
|
39045
|
+
arraySchema = arraySchema.max(schema12.maxItems);
|
|
39046
39046
|
}
|
|
39047
39047
|
zodSchema = arraySchema;
|
|
39048
39048
|
} else {
|
|
@@ -39055,76 +39055,76 @@ function convertBaseSchema(schema11, ctx) {
|
|
|
39055
39055
|
}
|
|
39056
39056
|
return zodSchema;
|
|
39057
39057
|
}
|
|
39058
|
-
function convertSchema(
|
|
39059
|
-
if (typeof
|
|
39060
|
-
return
|
|
39058
|
+
function convertSchema(schema12, ctx) {
|
|
39059
|
+
if (typeof schema12 === "boolean") {
|
|
39060
|
+
return schema12 ? z.any() : z.never();
|
|
39061
39061
|
}
|
|
39062
|
-
let baseSchema = convertBaseSchema(
|
|
39063
|
-
const hasExplicitType =
|
|
39064
|
-
if (
|
|
39065
|
-
const options =
|
|
39062
|
+
let baseSchema = convertBaseSchema(schema12, ctx);
|
|
39063
|
+
const hasExplicitType = schema12.type || schema12.enum !== void 0 || schema12.const !== void 0;
|
|
39064
|
+
if (schema12.anyOf && Array.isArray(schema12.anyOf)) {
|
|
39065
|
+
const options = schema12.anyOf.map((s) => convertSchema(s, ctx));
|
|
39066
39066
|
const anyOfUnion = z.union(options);
|
|
39067
39067
|
baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
|
|
39068
39068
|
}
|
|
39069
|
-
if (
|
|
39070
|
-
const options =
|
|
39069
|
+
if (schema12.oneOf && Array.isArray(schema12.oneOf)) {
|
|
39070
|
+
const options = schema12.oneOf.map((s) => convertSchema(s, ctx));
|
|
39071
39071
|
const oneOfUnion = z.xor(options);
|
|
39072
39072
|
baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
|
|
39073
39073
|
}
|
|
39074
|
-
if (
|
|
39075
|
-
if (
|
|
39074
|
+
if (schema12.allOf && Array.isArray(schema12.allOf)) {
|
|
39075
|
+
if (schema12.allOf.length === 0) {
|
|
39076
39076
|
baseSchema = hasExplicitType ? baseSchema : z.any();
|
|
39077
39077
|
} else {
|
|
39078
|
-
let result = hasExplicitType ? baseSchema : convertSchema(
|
|
39078
|
+
let result = hasExplicitType ? baseSchema : convertSchema(schema12.allOf[0], ctx);
|
|
39079
39079
|
const startIdx = hasExplicitType ? 0 : 1;
|
|
39080
|
-
for (let i = startIdx; i <
|
|
39081
|
-
result = z.intersection(result, convertSchema(
|
|
39080
|
+
for (let i = startIdx; i < schema12.allOf.length; i++) {
|
|
39081
|
+
result = z.intersection(result, convertSchema(schema12.allOf[i], ctx));
|
|
39082
39082
|
}
|
|
39083
39083
|
baseSchema = result;
|
|
39084
39084
|
}
|
|
39085
39085
|
}
|
|
39086
|
-
if (
|
|
39086
|
+
if (schema12.nullable === true && ctx.version === "openapi-3.0") {
|
|
39087
39087
|
baseSchema = z.nullable(baseSchema);
|
|
39088
39088
|
}
|
|
39089
|
-
if (
|
|
39089
|
+
if (schema12.readOnly === true) {
|
|
39090
39090
|
baseSchema = z.readonly(baseSchema);
|
|
39091
39091
|
}
|
|
39092
|
-
if (
|
|
39093
|
-
baseSchema = baseSchema.default(
|
|
39092
|
+
if (schema12.default !== void 0) {
|
|
39093
|
+
baseSchema = baseSchema.default(schema12.default);
|
|
39094
39094
|
}
|
|
39095
39095
|
const extraMeta = {};
|
|
39096
39096
|
const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
39097
39097
|
for (const key3 of coreMetadataKeys) {
|
|
39098
|
-
if (key3 in
|
|
39099
|
-
extraMeta[key3] =
|
|
39098
|
+
if (key3 in schema12) {
|
|
39099
|
+
extraMeta[key3] = schema12[key3];
|
|
39100
39100
|
}
|
|
39101
39101
|
}
|
|
39102
39102
|
const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
|
|
39103
39103
|
for (const key3 of contentMetadataKeys) {
|
|
39104
|
-
if (key3 in
|
|
39105
|
-
extraMeta[key3] =
|
|
39104
|
+
if (key3 in schema12) {
|
|
39105
|
+
extraMeta[key3] = schema12[key3];
|
|
39106
39106
|
}
|
|
39107
39107
|
}
|
|
39108
|
-
for (const key3 of Object.keys(
|
|
39108
|
+
for (const key3 of Object.keys(schema12)) {
|
|
39109
39109
|
if (!RECOGNIZED_KEYS.has(key3)) {
|
|
39110
|
-
extraMeta[key3] =
|
|
39110
|
+
extraMeta[key3] = schema12[key3];
|
|
39111
39111
|
}
|
|
39112
39112
|
}
|
|
39113
39113
|
if (Object.keys(extraMeta).length > 0) {
|
|
39114
39114
|
ctx.registry.add(baseSchema, extraMeta);
|
|
39115
39115
|
}
|
|
39116
|
-
if (
|
|
39117
|
-
baseSchema = baseSchema.describe(
|
|
39116
|
+
if (schema12.description) {
|
|
39117
|
+
baseSchema = baseSchema.describe(schema12.description);
|
|
39118
39118
|
}
|
|
39119
39119
|
return baseSchema;
|
|
39120
39120
|
}
|
|
39121
|
-
function fromJSONSchema(
|
|
39122
|
-
if (typeof
|
|
39123
|
-
return
|
|
39121
|
+
function fromJSONSchema(schema12, params3) {
|
|
39122
|
+
if (typeof schema12 === "boolean") {
|
|
39123
|
+
return schema12 ? z.any() : z.never();
|
|
39124
39124
|
}
|
|
39125
39125
|
let normalized;
|
|
39126
39126
|
try {
|
|
39127
|
-
normalized = JSON.parse(JSON.stringify(
|
|
39127
|
+
normalized = JSON.parse(JSON.stringify(schema12));
|
|
39128
39128
|
} catch {
|
|
39129
39129
|
throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas");
|
|
39130
39130
|
}
|
|
@@ -43175,6 +43175,8 @@ function extractModelIds(payload) {
|
|
|
43175
43175
|
continue;
|
|
43176
43176
|
}
|
|
43177
43177
|
const record2 = entry;
|
|
43178
|
+
if (Array.isArray(record2?.supportedGenerationMethods) && !record2.supportedGenerationMethods.includes("generateContent"))
|
|
43179
|
+
continue;
|
|
43178
43180
|
const id = typeof record2?.id === "string" ? record2.id : typeof record2?.name === "string" ? record2.name : void 0;
|
|
43179
43181
|
if (id !== void 0)
|
|
43180
43182
|
ids.push(id.replace(/^models\//, ""));
|
|
@@ -43191,25 +43193,36 @@ async function listModels(http, profile, auth2, signal) {
|
|
|
43191
43193
|
}
|
|
43192
43194
|
try {
|
|
43193
43195
|
const tls2 = await auth2.tls?.();
|
|
43194
|
-
const
|
|
43195
|
-
|
|
43196
|
-
|
|
43197
|
-
|
|
43198
|
-
|
|
43199
|
-
|
|
43200
|
-
|
|
43201
|
-
|
|
43202
|
-
|
|
43203
|
-
|
|
43204
|
-
|
|
43196
|
+
const gemini = profile.wireFormat === "gemini";
|
|
43197
|
+
const ids = [];
|
|
43198
|
+
const windows = {};
|
|
43199
|
+
let pageToken;
|
|
43200
|
+
for (let page = 0; page < 10; page += 1) {
|
|
43201
|
+
const query = gemini ? `?pageSize=1000${pageToken !== void 0 ? `&pageToken=${encodeURIComponent(pageToken)}` : ""}` : "";
|
|
43202
|
+
const response = await http.request(`${url2}${query}`, {
|
|
43203
|
+
method: "GET",
|
|
43204
|
+
headers: { ...authHeaders, ...profile.headers },
|
|
43205
|
+
...signal !== void 0 ? { signal } : {},
|
|
43206
|
+
...tls2 !== void 0 ? { tls: tls2 } : {}
|
|
43207
|
+
});
|
|
43208
|
+
if (response.status === 404) {
|
|
43209
|
+
return { ids: [], warning: `${url2} returned 404. This gateway does not publish a model list \u2014 type the model id.` };
|
|
43210
|
+
}
|
|
43211
|
+
if (response.status < 200 || response.status >= 300) {
|
|
43212
|
+
return { ids: [], warning: `${url2} returned HTTP ${response.status}. Type the model id instead.` };
|
|
43213
|
+
}
|
|
43214
|
+
const payload = await response.json();
|
|
43215
|
+
ids.push(...extractModelIds(payload));
|
|
43216
|
+
Object.assign(windows, extractContextWindows(payload));
|
|
43217
|
+
const next = payload?.nextPageToken;
|
|
43218
|
+
if (!gemini || typeof next !== "string" || next.length === 0 || next === pageToken)
|
|
43219
|
+
break;
|
|
43220
|
+
pageToken = next;
|
|
43205
43221
|
}
|
|
43206
|
-
const payload = await response.json();
|
|
43207
|
-
const ids = extractModelIds(payload);
|
|
43208
43222
|
if (ids.length === 0) {
|
|
43209
43223
|
return { ids: [], warning: `${url2} returned no models. Type the model id instead.` };
|
|
43210
43224
|
}
|
|
43211
|
-
|
|
43212
|
-
return { ids, ...Object.keys(windows).length > 0 ? { windows } : {} };
|
|
43225
|
+
return { ids: [...new Set(ids)].sort(), ...Object.keys(windows).length > 0 ? { windows } : {} };
|
|
43213
43226
|
} catch (error51) {
|
|
43214
43227
|
return { ids: [], warning: `Could not reach ${url2}: ${describeTlsError(error51)}` };
|
|
43215
43228
|
}
|
|
@@ -43307,43 +43320,26 @@ async function testConnection(profile, context, http, signal) {
|
|
|
43307
43320
|
}
|
|
43308
43321
|
|
|
43309
43322
|
// ../../packages/core/dist/providers/schema.js
|
|
43310
|
-
var
|
|
43311
|
-
"
|
|
43312
|
-
"
|
|
43313
|
-
"
|
|
43314
|
-
"
|
|
43315
|
-
"
|
|
43316
|
-
"
|
|
43317
|
-
"
|
|
43318
|
-
"allOf",
|
|
43319
|
-
"not",
|
|
43320
|
-
"const",
|
|
43321
|
-
"default",
|
|
43322
|
-
"examples",
|
|
43323
|
-
"patternProperties",
|
|
43324
|
-
"minLength",
|
|
43325
|
-
"maxLength",
|
|
43326
|
-
"pattern",
|
|
43327
|
-
"minimum",
|
|
43328
|
-
"maximum",
|
|
43329
|
-
"exclusiveMinimum",
|
|
43330
|
-
"exclusiveMaximum",
|
|
43331
|
-
"multipleOf",
|
|
43332
|
-
"minItems",
|
|
43333
|
-
"maxItems",
|
|
43334
|
-
"uniqueItems",
|
|
43335
|
-
"format"
|
|
43323
|
+
var PORTABLE_KEYWORDS = /* @__PURE__ */ new Set([
|
|
43324
|
+
"type",
|
|
43325
|
+
"description",
|
|
43326
|
+
"properties",
|
|
43327
|
+
"required",
|
|
43328
|
+
"items",
|
|
43329
|
+
"enum",
|
|
43330
|
+
"nullable"
|
|
43336
43331
|
]);
|
|
43332
|
+
var keepForGemini = (key3) => PORTABLE_KEYWORDS.has(key3);
|
|
43337
43333
|
function isRecord(value) {
|
|
43338
43334
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43339
43335
|
}
|
|
43340
|
-
function pruneSchema(
|
|
43341
|
-
if (Array.isArray(
|
|
43342
|
-
return
|
|
43343
|
-
if (!isRecord(
|
|
43344
|
-
return
|
|
43336
|
+
function pruneSchema(schema12, keep) {
|
|
43337
|
+
if (Array.isArray(schema12))
|
|
43338
|
+
return schema12.map((entry) => pruneSchema(entry, keep));
|
|
43339
|
+
if (!isRecord(schema12))
|
|
43340
|
+
return schema12;
|
|
43345
43341
|
const result = {};
|
|
43346
|
-
for (const [key3, value] of Object.entries(
|
|
43342
|
+
for (const [key3, value] of Object.entries(schema12)) {
|
|
43347
43343
|
if (!keep(key3))
|
|
43348
43344
|
continue;
|
|
43349
43345
|
if (key3 === "properties" && isRecord(value)) {
|
|
@@ -43381,7 +43377,7 @@ function toGeminiTools(tools) {
|
|
|
43381
43377
|
functionDeclarations: tools.map((tool) => ({
|
|
43382
43378
|
name: tool.name,
|
|
43383
43379
|
description: tool.description,
|
|
43384
|
-
parameters: pruneSchema(normalizeObjectSchema(tool.parameters),
|
|
43380
|
+
parameters: pruneSchema(normalizeObjectSchema(tool.parameters), keepForGemini)
|
|
43385
43381
|
}))
|
|
43386
43382
|
}
|
|
43387
43383
|
];
|
|
@@ -43460,12 +43456,12 @@ function restoreAt(value, path65, kind) {
|
|
|
43460
43456
|
}
|
|
43461
43457
|
var SCALARS = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean"]);
|
|
43462
43458
|
var MAX_DEPTH = 12;
|
|
43463
|
-
function convert(
|
|
43464
|
-
if (!isRecord2(
|
|
43459
|
+
function convert(schema12, root, path65, found2, depth, isRoot = false) {
|
|
43460
|
+
if (!isRecord2(schema12))
|
|
43465
43461
|
return { type: "string" };
|
|
43466
43462
|
if (depth > MAX_DEPTH)
|
|
43467
|
-
return asJsonString(
|
|
43468
|
-
let node = { ...
|
|
43463
|
+
return asJsonString(schema12, path65, found2, "nested too deeply to describe here");
|
|
43464
|
+
let node = { ...schema12 };
|
|
43469
43465
|
if (typeof node.$ref === "string") {
|
|
43470
43466
|
const target = resolveRef2(node.$ref, root);
|
|
43471
43467
|
if (target === void 0)
|
|
@@ -46876,6 +46872,101 @@ ${BUDGET_ADVICE}` : base;
|
|
|
46876
46872
|
].join("\n");
|
|
46877
46873
|
}
|
|
46878
46874
|
|
|
46875
|
+
// ../../packages/core/dist/agents/codebaseAgents.js
|
|
46876
|
+
var MAX_DEPTH2 = 3;
|
|
46877
|
+
var DEFAULT_MINUTES = 30;
|
|
46878
|
+
var schema = external_exports.object({
|
|
46879
|
+
codebase: external_exports.string().min(1).describe("The other codebase, by its name as listed in this tool's description."),
|
|
46880
|
+
request: external_exports.string().min(1).max(2e4).describe("What you need, written for an agent that knows nothing of this conversation: the question or the task, the context it needs (names, paths, versions, what you already tried) and what answer you want back."),
|
|
46881
|
+
timeoutMinutes: external_exports.number().int().min(1).max(120).optional().describe(`How long to wait for the answer (default ${String(DEFAULT_MINUTES)}).`)
|
|
46882
|
+
});
|
|
46883
|
+
function createAskCodebaseAgentTool(options) {
|
|
46884
|
+
const names = options.codebases.map((codebase) => `"${codebase.name}"`).join(", ");
|
|
46885
|
+
return {
|
|
46886
|
+
name: "ask_codebase_agent",
|
|
46887
|
+
group: "command",
|
|
46888
|
+
description: `Ask the agent of another codebase open in Fire Code for help, or to do something there: ${names}. It opens a new chat on that codebase and works on your request with its own files, tools and knowledge - its approvals are asked in its own tab - and its answer comes back here. Use it when the answer or the change lives in that codebase (how its API works, what it expects, a change to make there), not for files you can read yourself. Write the request so it stands alone. Waits for the answer.`,
|
|
46889
|
+
parametersSchema: schema,
|
|
46890
|
+
async preview(params3) {
|
|
46891
|
+
return {
|
|
46892
|
+
kind: "text",
|
|
46893
|
+
text: `Send to the agent in codebase "${params3.codebase}" - it opens a new chat there, works with that codebase's own tools and asks for its own approvals in that tab:
|
|
46894
|
+
|
|
46895
|
+
${params3.request}`
|
|
46896
|
+
};
|
|
46897
|
+
},
|
|
46898
|
+
async execute(params3, context) {
|
|
46899
|
+
const depth = options.depth() + 1;
|
|
46900
|
+
if (depth > MAX_DEPTH2) {
|
|
46901
|
+
return {
|
|
46902
|
+
content: `Not sent: this chat is already working for another agent ${String(depth - 1)} level(s) deep, and requests stop at ${String(MAX_DEPTH2)}. Answer with what you have, saying what is missing.`,
|
|
46903
|
+
isError: true
|
|
46904
|
+
};
|
|
46905
|
+
}
|
|
46906
|
+
try {
|
|
46907
|
+
const reply = await options.channel.ask(params3.codebase, params3.request, {
|
|
46908
|
+
timeoutMs: (params3.timeoutMinutes ?? DEFAULT_MINUTES) * 6e4,
|
|
46909
|
+
depth,
|
|
46910
|
+
...context.signal !== void 0 ? { signal: context.signal } : {}
|
|
46911
|
+
});
|
|
46912
|
+
const where = reply.chat !== void 0 ? ` (its chat "${reply.chat}")` : "";
|
|
46913
|
+
if (!reply.ok)
|
|
46914
|
+
return { content: `The agent in "${params3.codebase}"${where} could not answer: ${reply.text}`, isError: true };
|
|
46915
|
+
return { content: `The agent in "${params3.codebase}"${where} answered:
|
|
46916
|
+
|
|
46917
|
+
${reply.text}` };
|
|
46918
|
+
} catch (error51) {
|
|
46919
|
+
const message5 = error51 instanceof Error ? error51.message : String(error51);
|
|
46920
|
+
return { content: `No answer from "${params3.codebase}": ${message5}`, isError: true };
|
|
46921
|
+
}
|
|
46922
|
+
}
|
|
46923
|
+
};
|
|
46924
|
+
}
|
|
46925
|
+
function composeTaskMessage(task) {
|
|
46926
|
+
return [
|
|
46927
|
+
`**A request from the agent working in codebase "${task.from}".** It is waiting for your answer; the user can see this chat.`,
|
|
46928
|
+
"",
|
|
46929
|
+
task.message,
|
|
46930
|
+
"",
|
|
46931
|
+
"---",
|
|
46932
|
+
"Work on it here with your own tools, as you would for the user. When you are done, call attempt_completion: its result",
|
|
46933
|
+
"is sent back to that agent, so make it the complete answer - what you found or changed, and anything it must do on its",
|
|
46934
|
+
"side. If you need the user's decision, ask with ask_followup_question; the other agent is told you are waiting."
|
|
46935
|
+
].join("\n");
|
|
46936
|
+
}
|
|
46937
|
+
function answerFromConversation(messages) {
|
|
46938
|
+
for (let i = messages.length - 1; i >= 0; i -= 1) {
|
|
46939
|
+
const message5 = messages[i];
|
|
46940
|
+
if (message5 === void 0 || message5.role !== "assistant")
|
|
46941
|
+
continue;
|
|
46942
|
+
for (const call of message5.toolCalls ?? []) {
|
|
46943
|
+
const args = parseArgs(call.arguments);
|
|
46944
|
+
if (call.name === "attempt_completion" && typeof args.result === "string")
|
|
46945
|
+
return { ok: true, text: args.result };
|
|
46946
|
+
if (call.name === "ask_followup_question" && typeof args.question === "string") {
|
|
46947
|
+
return {
|
|
46948
|
+
ok: true,
|
|
46949
|
+
text: `It stopped to ask the user: ${args.question}
|
|
46950
|
+
|
|
46951
|
+
(It is waiting for an answer in its tab; the user can reply there, and that work continues there - not here.)`,
|
|
46952
|
+
waiting: true
|
|
46953
|
+
};
|
|
46954
|
+
}
|
|
46955
|
+
}
|
|
46956
|
+
if (message5.content.trim().length > 0)
|
|
46957
|
+
return { ok: true, text: message5.content.trim() };
|
|
46958
|
+
}
|
|
46959
|
+
return { ok: false, text: "Its turn ended without an answer (stopped, or it failed - see its tab)." };
|
|
46960
|
+
}
|
|
46961
|
+
function parseArgs(raw) {
|
|
46962
|
+
try {
|
|
46963
|
+
const parsed = JSON.parse(raw.length > 0 ? raw : "{}");
|
|
46964
|
+
return typeof parsed === "object" && parsed !== null ? parsed : {};
|
|
46965
|
+
} catch {
|
|
46966
|
+
return {};
|
|
46967
|
+
}
|
|
46968
|
+
}
|
|
46969
|
+
|
|
46879
46970
|
// ../../packages/core/dist/agents/briefing.js
|
|
46880
46971
|
var DESCRIPTION_LIMIT = 110;
|
|
46881
46972
|
function firstLine2(text2, limit = DESCRIPTION_LIMIT) {
|
|
@@ -53517,17 +53608,17 @@ var WHY_SCHEMA = {
|
|
|
53517
53608
|
type: "string",
|
|
53518
53609
|
description: "One short sentence, for the person watching: why you are making this call and what you expect to learn or change. Not a restatement of the tool name."
|
|
53519
53610
|
};
|
|
53520
|
-
function withWhy(
|
|
53521
|
-
if (typeof
|
|
53522
|
-
return
|
|
53523
|
-
const record2 =
|
|
53611
|
+
function withWhy(schema12) {
|
|
53612
|
+
if (typeof schema12 !== "object" || schema12 === null || Array.isArray(schema12))
|
|
53613
|
+
return schema12;
|
|
53614
|
+
const record2 = schema12;
|
|
53524
53615
|
if (record2.type !== "object")
|
|
53525
|
-
return
|
|
53616
|
+
return schema12;
|
|
53526
53617
|
const properties = record2.properties;
|
|
53527
53618
|
if (properties !== void 0 && (typeof properties !== "object" || properties === null))
|
|
53528
|
-
return
|
|
53619
|
+
return schema12;
|
|
53529
53620
|
if (properties !== void 0 && WHY_PARAMETER in properties)
|
|
53530
|
-
return
|
|
53621
|
+
return schema12;
|
|
53531
53622
|
return {
|
|
53532
53623
|
...record2,
|
|
53533
53624
|
properties: { ...properties ?? {}, [WHY_PARAMETER]: WHY_SCHEMA }
|
|
@@ -53550,6 +53641,8 @@ function toToolDefinitions(tools) {
|
|
|
53550
53641
|
|
|
53551
53642
|
// ../../packages/core/dist/schedule/runner.js
|
|
53552
53643
|
var NEVER_AVAILABLE_TO_SCHEDULES = [
|
|
53644
|
+
// Another codebase's agent asks for its own approvals in its own tab - nobody is there to give them at 3am.
|
|
53645
|
+
"ask_codebase_agent",
|
|
53553
53646
|
// A run rewriting the contracts it is checked against would be bound by nothing (the plan's reasoning).
|
|
53554
53647
|
"set_strategy_contracts",
|
|
53555
53648
|
// Mass copies and moves need a person reading the plan; an unattended run has none.
|
|
@@ -54365,27 +54458,27 @@ function createPlanProgressTool(access) {
|
|
|
54365
54458
|
|
|
54366
54459
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1_ed45788dfbfe808cc09dd7daea6bd385/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
54367
54460
|
function isZ4Schema(s) {
|
|
54368
|
-
const
|
|
54369
|
-
return !!
|
|
54461
|
+
const schema12 = s;
|
|
54462
|
+
return !!schema12._zod;
|
|
54370
54463
|
}
|
|
54371
|
-
function safeParse3(
|
|
54372
|
-
if (isZ4Schema(
|
|
54373
|
-
const result2 = safeParse(
|
|
54464
|
+
function safeParse3(schema12, data) {
|
|
54465
|
+
if (isZ4Schema(schema12)) {
|
|
54466
|
+
const result2 = safeParse(schema12, data);
|
|
54374
54467
|
return result2;
|
|
54375
54468
|
}
|
|
54376
|
-
const v3Schema =
|
|
54469
|
+
const v3Schema = schema12;
|
|
54377
54470
|
const result = v3Schema.safeParse(data);
|
|
54378
54471
|
return result;
|
|
54379
54472
|
}
|
|
54380
|
-
function getObjectShape(
|
|
54381
|
-
if (!
|
|
54473
|
+
function getObjectShape(schema12) {
|
|
54474
|
+
if (!schema12)
|
|
54382
54475
|
return void 0;
|
|
54383
54476
|
let rawShape;
|
|
54384
|
-
if (isZ4Schema(
|
|
54385
|
-
const v4Schema =
|
|
54477
|
+
if (isZ4Schema(schema12)) {
|
|
54478
|
+
const v4Schema = schema12;
|
|
54386
54479
|
rawShape = v4Schema._zod?.def?.shape;
|
|
54387
54480
|
} else {
|
|
54388
|
-
const v3Schema =
|
|
54481
|
+
const v3Schema = schema12;
|
|
54389
54482
|
rawShape = v3Schema.shape;
|
|
54390
54483
|
}
|
|
54391
54484
|
if (!rawShape)
|
|
@@ -54399,9 +54492,9 @@ function getObjectShape(schema11) {
|
|
|
54399
54492
|
}
|
|
54400
54493
|
return rawShape;
|
|
54401
54494
|
}
|
|
54402
|
-
function getLiteralValue(
|
|
54403
|
-
if (isZ4Schema(
|
|
54404
|
-
const v4Schema =
|
|
54495
|
+
function getLiteralValue(schema12) {
|
|
54496
|
+
if (isZ4Schema(schema12)) {
|
|
54497
|
+
const v4Schema = schema12;
|
|
54405
54498
|
const def2 = v4Schema._zod?.def;
|
|
54406
54499
|
if (def2) {
|
|
54407
54500
|
if (def2.value !== void 0)
|
|
@@ -54411,7 +54504,7 @@ function getLiteralValue(schema11) {
|
|
|
54411
54504
|
}
|
|
54412
54505
|
}
|
|
54413
54506
|
}
|
|
54414
|
-
const v3Schema =
|
|
54507
|
+
const v3Schema = schema12;
|
|
54415
54508
|
const def = v3Schema._def;
|
|
54416
54509
|
if (def) {
|
|
54417
54510
|
if (def.value !== void 0)
|
|
@@ -54420,7 +54513,7 @@ function getLiteralValue(schema11) {
|
|
|
54420
54513
|
return def.values[0];
|
|
54421
54514
|
}
|
|
54422
54515
|
}
|
|
54423
|
-
const directValue =
|
|
54516
|
+
const directValue = schema12.value;
|
|
54424
54517
|
if (directValue !== void 0)
|
|
54425
54518
|
return directValue;
|
|
54426
54519
|
return void 0;
|
|
@@ -55955,8 +56048,8 @@ function isTerminal(status2) {
|
|
|
55955
56048
|
var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
55956
56049
|
|
|
55957
56050
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1_ed45788dfbfe808cc09dd7daea6bd385/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
55958
|
-
function getMethodLiteral(
|
|
55959
|
-
const shape = getObjectShape(
|
|
56051
|
+
function getMethodLiteral(schema12) {
|
|
56052
|
+
const shape = getObjectShape(schema12);
|
|
55960
56053
|
const methodSchema = shape?.method;
|
|
55961
56054
|
if (!methodSchema) {
|
|
55962
56055
|
throw new Error("Schema is missing a method literal");
|
|
@@ -55967,8 +56060,8 @@ function getMethodLiteral(schema11) {
|
|
|
55967
56060
|
}
|
|
55968
56061
|
return value;
|
|
55969
56062
|
}
|
|
55970
|
-
function parseWithCompat(
|
|
55971
|
-
const result = safeParse3(
|
|
56063
|
+
function parseWithCompat(schema12, data) {
|
|
56064
|
+
const result = safeParse3(schema12, data);
|
|
55972
56065
|
if (!result.success) {
|
|
55973
56066
|
throw result.error;
|
|
55974
56067
|
}
|
|
@@ -56976,8 +57069,8 @@ var AjvJsonSchemaValidator = class {
|
|
|
56976
57069
|
* @param schema - Standard JSON Schema object
|
|
56977
57070
|
* @returns A validator function that validates input data
|
|
56978
57071
|
*/
|
|
56979
|
-
getValidator(
|
|
56980
|
-
const ajvValidator = "$id" in
|
|
57072
|
+
getValidator(schema12) {
|
|
57073
|
+
const ajvValidator = "$id" in schema12 && typeof schema12.$id === "string" ? this._ajv.getSchema(schema12.$id) ?? this._ajv.compile(schema12) : this._ajv.compile(schema12);
|
|
56981
57074
|
return (input) => {
|
|
56982
57075
|
const valid = ajvValidator(input);
|
|
56983
57076
|
if (valid) {
|
|
@@ -57187,12 +57280,12 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
57187
57280
|
}
|
|
57188
57281
|
|
|
57189
57282
|
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1_ed45788dfbfe808cc09dd7daea6bd385/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
|
|
57190
|
-
function applyElicitationDefaults(
|
|
57191
|
-
if (!
|
|
57283
|
+
function applyElicitationDefaults(schema12, data) {
|
|
57284
|
+
if (!schema12 || data === null || typeof data !== "object")
|
|
57192
57285
|
return;
|
|
57193
|
-
if (
|
|
57286
|
+
if (schema12.type === "object" && schema12.properties && typeof schema12.properties === "object") {
|
|
57194
57287
|
const obj = data;
|
|
57195
|
-
const props =
|
|
57288
|
+
const props = schema12.properties;
|
|
57196
57289
|
for (const key3 of Object.keys(props)) {
|
|
57197
57290
|
const propSchema = props[key3];
|
|
57198
57291
|
if (obj[key3] === void 0 && Object.prototype.hasOwnProperty.call(propSchema, "default")) {
|
|
@@ -57203,15 +57296,15 @@ function applyElicitationDefaults(schema11, data) {
|
|
|
57203
57296
|
}
|
|
57204
57297
|
}
|
|
57205
57298
|
}
|
|
57206
|
-
if (Array.isArray(
|
|
57207
|
-
for (const sub of
|
|
57299
|
+
if (Array.isArray(schema12.anyOf)) {
|
|
57300
|
+
for (const sub of schema12.anyOf) {
|
|
57208
57301
|
if (typeof sub !== "boolean") {
|
|
57209
57302
|
applyElicitationDefaults(sub, data);
|
|
57210
57303
|
}
|
|
57211
57304
|
}
|
|
57212
57305
|
}
|
|
57213
|
-
if (Array.isArray(
|
|
57214
|
-
for (const sub of
|
|
57306
|
+
if (Array.isArray(schema12.oneOf)) {
|
|
57307
|
+
for (const sub of schema12.oneOf) {
|
|
57215
57308
|
if (typeof sub !== "boolean") {
|
|
57216
57309
|
applyElicitationDefaults(sub, data);
|
|
57217
57310
|
}
|
|
@@ -64017,7 +64110,7 @@ async function truncateToolResult(content, store, maxChars = DEFAULT_MAX_CHARS,
|
|
|
64017
64110
|
var TRANSIENT_STATUS = /HTTP (408|409|425|429|500|502|503|504|520|521|522|523|524|529)\b/;
|
|
64018
64111
|
var TRANSIENT_TRANSPORT = /ECONNRESET|ECONNREFUSED|ETIMEDOUT|ECONNABORTED|EPIPE|EAI_AGAIN|ENETUNREACH|EHOSTUNREACH|socket hang up|other side closed|terminated|fetch failed|network error|UND_ERR_(SOCKET|CONNECT_TIMEOUT|HEADERS_TIMEOUT|BODY_TIMEOUT|CLOSED)|No reply from .* within/i;
|
|
64019
64112
|
var TRANSIENT_PROVIDER = /overloaded|rate.?limit|too many requests|temporarily unavailable|service unavailable|RESOURCE_EXHAUSTED|UNAVAILABLE|try again later|server_error|internal server error/i;
|
|
64020
|
-
var PERMANENT = /HTTP (400|401|403|404|405|413|422)\b|certificate|self[- ]signed|unable to verify|CERT_|key (does not|doesn't) match|passphrase|credential missing|context.{0,20}(length|window|limit)|too many tokens|prompt is too long/i;
|
|
64113
|
+
var PERMANENT = /HTTP (400|401|402|403|404|405|413|422)\b|credits? (are |is )?depleted|insufficient (credit|balance|funds)|billing|certificate|self[- ]signed|unable to verify|CERT_|key (does not|doesn't) match|passphrase|credential missing|context.{0,20}(length|window|limit)|too many tokens|prompt is too long/i;
|
|
64021
64114
|
function isTransientError(message5) {
|
|
64022
64115
|
if (PERMANENT.test(message5))
|
|
64023
64116
|
return false;
|
|
@@ -66781,6 +66874,21 @@ function skillDefaultsReadNote(skillName, values) {
|
|
|
66781
66874
|
// ../../packages/core/dist/jupyter/tools.js
|
|
66782
66875
|
var import_promises21 = __toESM(require("node:fs/promises"), 1);
|
|
66783
66876
|
var import_node_path36 = __toESM(require("node:path"), 1);
|
|
66877
|
+
function targetFor(runtime, others, hub) {
|
|
66878
|
+
const names = others.map((other2) => `"${other2.name}"`).join(", ");
|
|
66879
|
+
if (hub === void 0 || hub.trim().length === 0) {
|
|
66880
|
+
if (runtime !== void 0)
|
|
66881
|
+
return { kind: "own", runtime, label: runtime.label, kernel: runtime.kernel };
|
|
66882
|
+
return { error: `Say which hub with "hub": ${names}.` };
|
|
66883
|
+
}
|
|
66884
|
+
const wanted = hub.trim().toLowerCase();
|
|
66885
|
+
const other = others.find((candidate) => candidate.name.toLowerCase() === wanted);
|
|
66886
|
+
if (other !== void 0)
|
|
66887
|
+
return { kind: "other", hub: other, label: other.label, kernel: other.kernel };
|
|
66888
|
+
if (runtime !== void 0 && (wanted === "this" || wanted === "own"))
|
|
66889
|
+
return { kind: "own", runtime, label: runtime.label, kernel: runtime.kernel };
|
|
66890
|
+
return { error: `No hub called "${hub}". ${others.length > 0 ? `Other codebases' hubs: ${names}.` : "There are no other JupyterHub codebases."}${runtime !== void 0 ? " Leave hub out for this codebase's own." : ""}` };
|
|
66891
|
+
}
|
|
66784
66892
|
var RUN_DEFAULT_SECONDS = 300;
|
|
66785
66893
|
var SCRIPT_PREVIEW_CHARS = 6e3;
|
|
66786
66894
|
var runSchema = external_exports.object({
|
|
@@ -66789,12 +66897,14 @@ var runSchema = external_exports.object({
|
|
|
66789
66897
|
args: external_exports.array(external_exports.string()).optional().describe("Command-line arguments for file (sys.argv[1:])."),
|
|
66790
66898
|
shell: external_exports.string().optional().describe("A shell command to run on the hub server, from the folder given in cwd or the top folder."),
|
|
66791
66899
|
cwd: external_exports.string().optional().describe("For shell: a workspace folder (inside the hub folders) to run it in."),
|
|
66792
|
-
timeoutSeconds: external_exports.number().int().min(5).max(3600).optional().describe("How long the run may take before it is interrupted.")
|
|
66900
|
+
timeoutSeconds: external_exports.number().int().min(5).max(3600).optional().describe("How long the run may take before it is interrupted."),
|
|
66901
|
+
hub: external_exports.string().optional().describe("Run on another codebase's JupyterHub server instead, by its codebase name (listed in this tool's description). There, cwd is a folder on that server, and file is not available - use shell, e.g. python path/to/script.py.")
|
|
66793
66902
|
});
|
|
66794
66903
|
var inspectSchema = external_exports.object({
|
|
66795
66904
|
name: external_exports.string().optional().describe('A module, class or function on the hub, e.g. "pandas.read_csv" or "acme_risk.pricing".'),
|
|
66796
66905
|
source: external_exports.boolean().optional().describe("Include the source code when available."),
|
|
66797
|
-
packages: external_exports.string().optional().describe('Instead of name: list installed packages whose name contains this ("" for all).')
|
|
66906
|
+
packages: external_exports.string().optional().describe('Instead of name: list installed packages whose name contains this ("" for all).'),
|
|
66907
|
+
hub: external_exports.string().optional().describe("Look on another codebase's JupyterHub server instead, by its codebase name (listed in this tool's description).")
|
|
66798
66908
|
});
|
|
66799
66909
|
var syncSchema = external_exports.object({
|
|
66800
66910
|
action: external_exports.enum(["pull", "push", "status", "hub_version", "use_hub_version"]).describe("pull: fetch the hub's changes. push: save local changes to the hub. status: what differs. hub_version: show the hub's copy of a conflicting file. use_hub_version: replace the local copy with it."),
|
|
@@ -66865,10 +66975,32 @@ ${excerpt2}`,
|
|
|
66865
66975
|
].join("\n");
|
|
66866
66976
|
return { ok: true, code, shown: params3.shell ?? "", where: `the hub, in ${folder || "the top folder"}` };
|
|
66867
66977
|
}
|
|
66868
|
-
function
|
|
66978
|
+
function planElsewhere(params3) {
|
|
66979
|
+
const given = [params3.code, params3.file, params3.shell].filter((v) => v !== void 0).length;
|
|
66980
|
+
if (given !== 1)
|
|
66981
|
+
return { ok: false, message: "Give exactly one of code or shell." };
|
|
66982
|
+
if (params3.file !== void 0) {
|
|
66983
|
+
return { ok: false, message: "file runs a script from this workspace; on another codebase's hub use shell instead, e.g. python path/to/script.py with cwd." };
|
|
66984
|
+
}
|
|
66985
|
+
if (params3.code !== void 0)
|
|
66986
|
+
return { ok: true, code: params3.code, shown: params3.code, where: "its kernel" };
|
|
66987
|
+
const folder = (params3.cwd ?? "").replace(/\\/g, "/").replace(/^\/+|\/+$/g, "");
|
|
66988
|
+
if (folder.split("/").includes(".."))
|
|
66989
|
+
return { ok: false, message: 'cwd must be a folder on that server, without "..".' };
|
|
66990
|
+
const code = [
|
|
66991
|
+
"import os as _lc_os, subprocess as _lc_sp, sys as _lc_sys",
|
|
66992
|
+
`_lc_home = globals().setdefault('_lc_home', _lc_os.getcwd())`,
|
|
66993
|
+
`_lc_r = _lc_sp.run(${py(params3.shell)}, shell=True, cwd=_lc_os.path.join(_lc_home, ${py(folder)}), capture_output=True, text=True)`,
|
|
66994
|
+
'print(_lc_r.stdout, end="")',
|
|
66995
|
+
'print(_lc_r.stderr, end="", file=_lc_sys.stderr)',
|
|
66996
|
+
'print(f"\\n[exit code {_lc_r.returncode}]")'
|
|
66997
|
+
].join("\n");
|
|
66998
|
+
return { ok: true, code, shown: params3.shell ?? "", where: folder || "the top folder" };
|
|
66999
|
+
}
|
|
67000
|
+
function describeRun(label, output, where) {
|
|
66869
67001
|
const parts = [];
|
|
66870
67002
|
if (output.freshKernel)
|
|
66871
|
-
parts.push(`(A new ${output.kernelName} kernel was started on ${
|
|
67003
|
+
parts.push(`(A new ${output.kernelName} kernel was started on ${label}; variables from earlier runs are gone.)`);
|
|
66872
67004
|
parts.push(output.text.trim().length > 0 ? output.text.replace(/\s+$/, "") : "(no output)");
|
|
66873
67005
|
if (output.error !== void 0)
|
|
66874
67006
|
parts.push(`${output.error.name}: ${output.error.value}
|
|
@@ -66898,41 +67030,64 @@ function describePull(result) {
|
|
|
66898
67030
|
lines2.push(`Up to date (${String(result.unchanged)} file(s) unchanged).`);
|
|
66899
67031
|
return lines2.join("\n");
|
|
66900
67032
|
}
|
|
66901
|
-
function createHubTools(runtime) {
|
|
67033
|
+
function createHubTools(runtime, others = []) {
|
|
67034
|
+
const elsewhere = others.length === 0 ? "" : ` Other codebases' JupyterHub servers, by "hub": ${others.map((other) => `"${other.name}" (${other.label})`).join(", ")}.`;
|
|
67035
|
+
const here = runtime !== void 0 ? `ON THE JUPYTERHUB SERVER (${runtime.label})` : `ON ANOTHER CODEBASE'S JUPYTERHUB SERVER (name it with "hub")`;
|
|
66902
67036
|
const runTool = {
|
|
66903
67037
|
name: "hub_run",
|
|
66904
67038
|
group: "command",
|
|
66905
|
-
description: `Run Python, a script or a shell command
|
|
67039
|
+
description: `Run Python, a script or a shell command ${here}, in its environment - use this, not execute_command, for anything that needs the hub's libraries or data. \`code\` runs in one kernel kept for the session (variables persist); \`file\` runs a workspace script from its own folder on the hub (saved there first if edited); \`shell\` runs a command on the hub. Files it writes on the hub are fetched into the workspace afterwards.` + elsewhere,
|
|
66906
67040
|
parametersSchema: runSchema,
|
|
66907
67041
|
async preview(params3, context) {
|
|
66908
|
-
const
|
|
67042
|
+
const target = targetFor(runtime, others, params3.hub);
|
|
67043
|
+
if ("error" in target)
|
|
67044
|
+
return { kind: "text", text: target.error };
|
|
67045
|
+
const planned = target.kind === "own" ? await plan(target.runtime, context, params3) : planElsewhere(params3);
|
|
66909
67046
|
if (!planned.ok)
|
|
66910
67047
|
return { kind: "text", text: planned.message };
|
|
66911
|
-
|
|
67048
|
+
const where = target.kind === "own" ? planned.where : `${target.label}, ${planned.where} (codebase "${target.hub.name}")`;
|
|
67049
|
+
return { kind: "command", command: planned.shown, cwd: `JupyterHub: ${where}` };
|
|
66912
67050
|
},
|
|
66913
67051
|
async execute(params3, context) {
|
|
66914
|
-
const
|
|
67052
|
+
const target = targetFor(runtime, others, params3.hub);
|
|
67053
|
+
if ("error" in target)
|
|
67054
|
+
return { content: target.error, isError: true };
|
|
67055
|
+
if (target.kind === "other") {
|
|
67056
|
+
const planned2 = planElsewhere(params3);
|
|
67057
|
+
if (!planned2.ok)
|
|
67058
|
+
return { content: planned2.message, isError: true };
|
|
67059
|
+
const output2 = await target.kernel.run(planned2.code, {
|
|
67060
|
+
timeoutMs: (params3.timeoutSeconds ?? RUN_DEFAULT_SECONDS) * 1e3,
|
|
67061
|
+
...context.signal !== void 0 ? { signal: context.signal } : {}
|
|
67062
|
+
});
|
|
67063
|
+
return {
|
|
67064
|
+
content: describeRun(target.label, output2, `${target.label}, ${planned2.where}`),
|
|
67065
|
+
...output2.error !== void 0 || output2.timedOut === true ? { isError: true } : {}
|
|
67066
|
+
};
|
|
67067
|
+
}
|
|
67068
|
+
const own = target.runtime;
|
|
67069
|
+
const planned = await plan(own, context, params3);
|
|
66915
67070
|
if (!planned.ok)
|
|
66916
67071
|
return { content: planned.message, isError: true };
|
|
66917
67072
|
const notes = [];
|
|
66918
67073
|
if (planned.local !== void 0) {
|
|
66919
|
-
const saved = await
|
|
67074
|
+
const saved = await own.mirror.push(planned.local, context.signal);
|
|
66920
67075
|
if (!saved.saved)
|
|
66921
67076
|
return { content: `Not run: ${params3.file ?? ""} could not be saved to the hub first - ${saved.message}`, isError: true };
|
|
66922
67077
|
}
|
|
66923
|
-
const output = await
|
|
67078
|
+
const output = await own.kernel.run(planned.code, {
|
|
66924
67079
|
timeoutMs: (params3.timeoutSeconds ?? RUN_DEFAULT_SECONDS) * 1e3,
|
|
66925
67080
|
...context.signal !== void 0 ? { signal: context.signal } : {}
|
|
66926
67081
|
});
|
|
66927
67082
|
try {
|
|
66928
|
-
const pulled = await
|
|
67083
|
+
const pulled = await own.mirror.pull(context.signal);
|
|
66929
67084
|
if (pulled.fetched.length + pulled.removed.length + pulled.conflicts.length > 0)
|
|
66930
67085
|
notes.push(describePull(pulled));
|
|
66931
67086
|
} catch (error51) {
|
|
66932
67087
|
notes.push(`(Could not fetch changes from the hub afterwards: ${error51 instanceof Error ? error51.message : String(error51)})`);
|
|
66933
67088
|
}
|
|
66934
67089
|
return {
|
|
66935
|
-
content: [describeRun(
|
|
67090
|
+
content: [describeRun(own.label, output, planned.where), ...notes].join("\n\n"),
|
|
66936
67091
|
...output.error !== void 0 || output.timedOut === true ? { isError: true } : {}
|
|
66937
67092
|
};
|
|
66938
67093
|
}
|
|
@@ -66940,14 +67095,21 @@ function createHubTools(runtime) {
|
|
|
66940
67095
|
const inspectTool = {
|
|
66941
67096
|
name: "hub_inspect",
|
|
66942
67097
|
group: "command",
|
|
66943
|
-
description: "Look up a library that exists on the JupyterHub server - its signature, documentation, members and (with source) its code - or list the packages installed there. Use it instead of guessing at an API the local machine cannot see. Importing a module runs its top-level code, which is why this asks first.",
|
|
67098
|
+
description: "Look up a library that exists on the JupyterHub server - its signature, documentation, members and (with source) its code - or list the packages installed there. Use it instead of guessing at an API the local machine cannot see. Importing a module runs its top-level code, which is why this asks first." + elsewhere,
|
|
66944
67099
|
parametersSchema: inspectSchema,
|
|
66945
67100
|
async preview(params3) {
|
|
67101
|
+
const target = targetFor(runtime, others, params3.hub);
|
|
67102
|
+
if ("error" in target)
|
|
67103
|
+
return { kind: "text", text: target.error };
|
|
67104
|
+
const where = target.kind === "own" ? "JupyterHub kernel" : `JupyterHub kernel on ${target.label} (codebase "${target.hub.name}")`;
|
|
66946
67105
|
if (params3.packages !== void 0)
|
|
66947
|
-
return { kind: "command", command: `list installed packages matching ${py(params3.packages)}`, cwd:
|
|
66948
|
-
return { kind: "command", command: `inspect ${params3.name ?? "?"}${params3.source === true ? " (with source)" : ""}`, cwd:
|
|
67106
|
+
return { kind: "command", command: `list installed packages matching ${py(params3.packages)}`, cwd: where };
|
|
67107
|
+
return { kind: "command", command: `inspect ${params3.name ?? "?"}${params3.source === true ? " (with source)" : ""}`, cwd: `${where} (imports the module)` };
|
|
66949
67108
|
},
|
|
66950
67109
|
async execute(params3, context) {
|
|
67110
|
+
const target = targetFor(runtime, others, params3.hub);
|
|
67111
|
+
if ("error" in target)
|
|
67112
|
+
return { content: target.error, isError: true };
|
|
66951
67113
|
let code;
|
|
66952
67114
|
if (params3.packages !== void 0) {
|
|
66953
67115
|
code = [
|
|
@@ -66961,10 +67123,13 @@ function createHubTools(runtime) {
|
|
|
66961
67123
|
} else {
|
|
66962
67124
|
return { content: 'Give name (a dotted module path, e.g. "pkg.module.func") or packages.', isError: true };
|
|
66963
67125
|
}
|
|
66964
|
-
const output = await
|
|
66965
|
-
|
|
67126
|
+
const output = await target.kernel.run(code, { timeoutMs: 12e4, ...context.signal !== void 0 ? { signal: context.signal } : {} });
|
|
67127
|
+
const where = target.kind === "own" ? "the hub kernel" : `the kernel on ${target.label}`;
|
|
67128
|
+
return { content: describeRun(target.label, output, where), ...output.error !== void 0 ? { isError: true } : {} };
|
|
66966
67129
|
}
|
|
66967
67130
|
};
|
|
67131
|
+
if (runtime === void 0)
|
|
67132
|
+
return [runTool, inspectTool];
|
|
66968
67133
|
const syncTool = {
|
|
66969
67134
|
name: "hub_sync",
|
|
66970
67135
|
group: "edit",
|
|
@@ -67307,7 +67472,7 @@ var MAX_FOUND = 200;
|
|
|
67307
67472
|
var READ_LINES = 2e3;
|
|
67308
67473
|
var READ_CHARS = 2e5;
|
|
67309
67474
|
var SKIPPED = /* @__PURE__ */ new Set(["node_modules", ".git", "__pycache__", ".ipynb_checkpoints", ".venv", "venv", ".cache", ".local", ".conda"]);
|
|
67310
|
-
var
|
|
67475
|
+
var schema2 = external_exports.object({
|
|
67311
67476
|
action: external_exports.enum(["list", "find", "read"]),
|
|
67312
67477
|
hub: external_exports.string().optional().describe("Which hub, when there are several: its codebase name as listed in the description."),
|
|
67313
67478
|
path: external_exports.string().optional().describe('A path on the hub from your home folder there, "/"-separated; empty or "/" for the home folder itself.'),
|
|
@@ -67347,7 +67512,7 @@ function createHubBrowseTool(hubs) {
|
|
|
67347
67512
|
name: "hub_browse",
|
|
67348
67513
|
group: "read",
|
|
67349
67514
|
description: `Look around a JupyterHub server beyond the folders copied here, read only: "list" a folder, "find" files by name under a folder, or "read" a text file (line-numbered, with offset/limit). Paths are from your home folder on the hub. Nothing is copied or changed. Hubs: ${names}.` + (hubs.length > 1 ? " Name one with hub." : ""),
|
|
67350
|
-
parametersSchema:
|
|
67515
|
+
parametersSchema: schema2,
|
|
67351
67516
|
async preview(params3) {
|
|
67352
67517
|
const p = params3;
|
|
67353
67518
|
return { kind: "text", text: `${p.action} ${p.path ?? "/"}${p.name !== void 0 ? ` for "${p.name}"` : ""} on ${pick2(hubs, p.hub)?.label ?? "the hub"}` };
|
|
@@ -68623,7 +68788,7 @@ var callSchema = external_exports.object({
|
|
|
68623
68788
|
args: external_exports.array(external_exports.unknown()).optional().describe("Positional arguments."),
|
|
68624
68789
|
kwargs: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe("Keyword arguments.")
|
|
68625
68790
|
});
|
|
68626
|
-
var
|
|
68791
|
+
var schema3 = external_exports.object({
|
|
68627
68792
|
action: external_exports.enum(["list", "describe", "call"]).describe("list: the functions, classes and submodules of a module (filter narrows by name). describe: one function's signature and documentation. call: run a function - once (args/kwargs) or many times in parallel worker processes (calls)."),
|
|
68628
68793
|
module: external_exports.string().min(1).describe('The module to import, e.g. "pricinglib" or "pricinglib.bonds".'),
|
|
68629
68794
|
folders: external_exports.array(external_exports.string().min(1)).max(20).optional().describe("Folders holding the library and its DLLs; added to sys.path and the DLL search path."),
|
|
@@ -68647,7 +68812,7 @@ function createPythonLibraryTool(options) {
|
|
|
68647
68812
|
name: "python_library",
|
|
68648
68813
|
group: "command",
|
|
68649
68814
|
description: "Use an installed Python library (e.g. pricing libraries whose DLLs are in a folder): list its functions, describe one, or call one - once, or many times at once in parallel worker processes (each its own interpreter, so the GIL does not serialise them). Give the folder with the library/DLLs when it is not installed in Python. Prefer one call with `calls` over many separate calls. If the module will not import and the user has not said where it is, ASK the user for the folder holding the library and its DLLs - never search drives for it. Asks before running, as the library's code runs on this machine.",
|
|
68650
|
-
parametersSchema:
|
|
68815
|
+
parametersSchema: schema3,
|
|
68651
68816
|
async preview(params3) {
|
|
68652
68817
|
const launch = await options.launch(params3.python);
|
|
68653
68818
|
const lines2 = [
|
|
@@ -68833,7 +68998,7 @@ function offloadedCatalogue(hidden, otherHidden = 0) {
|
|
|
68833
68998
|
}
|
|
68834
68999
|
|
|
68835
69000
|
// ../../packages/core/dist/tools/http.js
|
|
68836
|
-
var
|
|
69001
|
+
var schema4 = external_exports.object({
|
|
68837
69002
|
method: external_exports.enum(["GET", "POST"]).default("GET").describe("GET to read, POST to send a body."),
|
|
68838
69003
|
url: external_exports.string().min(1).describe("The full URL, e.g. https://<host>/v1/items?limit=10. Its host must be one the user named in this chat."),
|
|
68839
69004
|
headers: external_exports.record(external_exports.string(), external_exports.string()).optional().describe("Request headers. Put credentials in as ${secret:NAME} (from secret storage) - never paste a token."),
|
|
@@ -68990,7 +69155,7 @@ function createHttpTool(options) {
|
|
|
68990
69155
|
name: "http_request",
|
|
68991
69156
|
group: "command",
|
|
68992
69157
|
description: "Call a REST API with GET or POST - to try an API the user has pointed you at. The host must be one the user named in this conversation; for any other, ask the user to confirm it first. Supports headers (credentials as ${secret:NAME}, never pasted), Kerberos/NTLM negotiate as the Windows user, a provider profile's auth (e.g. an Apigee gateway token), CA and client certificates, and polls a 202 Accepted until it completes. Every request is shown to the user before it is sent.",
|
|
68993
|
-
parametersSchema:
|
|
69158
|
+
parametersSchema: schema4,
|
|
68994
69159
|
async preview(params3, context) {
|
|
68995
69160
|
let url2;
|
|
68996
69161
|
let problem;
|
|
@@ -72212,7 +72377,7 @@ var OfficeBridge = class {
|
|
|
72212
72377
|
var import_node_child_process12 = require("node:child_process");
|
|
72213
72378
|
var MAX_LINK_LENGTH = 2e3;
|
|
72214
72379
|
var EMAIL = /^[^\s@,;<>"]+@[^\s@,;<>"]+\.[^\s@,;<>"]+$/;
|
|
72215
|
-
var
|
|
72380
|
+
var schema5 = external_exports.object({
|
|
72216
72381
|
to: external_exports.array(external_exports.string()).min(1).max(20).describe("Email addresses (their Teams sign-in names) of the people to message. One person opens a one-to-one chat; several open a group chat."),
|
|
72217
72382
|
message: external_exports.string().min(1).describe("The message to put in the compose box, e.g. the pull request title and link. Plain text."),
|
|
72218
72383
|
topic: external_exports.string().optional().describe("Group chats only: a name for a new group chat."),
|
|
@@ -72336,7 +72501,7 @@ function createTeamsOpenChatTool(options = {}) {
|
|
|
72336
72501
|
name: "teams_open_chat",
|
|
72337
72502
|
group: "command",
|
|
72338
72503
|
description: "Send a Microsoft Teams message to one or more colleagues - e.g. to tell a reviewer about a pull request. When the user asks you to message, send, tell, ping or inform someone, set send: true: the chat opens with the message typed and Enter is pressed once Teams is in front (it refuses to press anywhere else). Leave send out only when the user asked for a draft or to prepare/open the message for them to send. People are named by email address. Needs the Teams desktop app installed and signed in. Always shown to the user first.",
|
|
72339
|
-
parametersSchema:
|
|
72504
|
+
parametersSchema: schema5,
|
|
72340
72505
|
async preview(params3) {
|
|
72341
72506
|
const built = teamsChatLink(params3);
|
|
72342
72507
|
return {
|
|
@@ -73343,7 +73508,7 @@ function diagramSvg(layout, palette = DEFAULT_PALETTE) {
|
|
|
73343
73508
|
|
|
73344
73509
|
// ../../packages/core/dist/display/size.js
|
|
73345
73510
|
var DISPLAY_SIZES = ["small", "medium", "large", "full"];
|
|
73346
|
-
var DISPLAY_SIZE_DESCRIPTION = "How wide to draw it: small (an aside), medium (the ordinary case), large (worth studying), or full (the whole width available). Use a smaller one when the user says it is too big,
|
|
73511
|
+
var DISPLAY_SIZE_DESCRIPTION = "How wide to draw it: small (an aside), medium (the ordinary case), large (worth studying), or full (the whole width available). Omitted, it is drawn large. Use a smaller one when the user says it is too big, small or medium for something beside a paragraph of text rather than the point of the answer, and full only for a wide picture the user asked to see big.";
|
|
73347
73512
|
|
|
73348
73513
|
// ../../packages/core/dist/diagrams/types.js
|
|
73349
73514
|
var DIAGRAM_MAX_NODES = 40;
|
|
@@ -74859,12 +75024,12 @@ function createJenkinsFindJobsTool(options) {
|
|
|
74859
75024
|
};
|
|
74860
75025
|
}
|
|
74861
75026
|
function createJenkinsJobTool(options) {
|
|
74862
|
-
const
|
|
75027
|
+
const schema12 = external_exports.object({ job: jobParam(options) });
|
|
74863
75028
|
const tool = {
|
|
74864
75029
|
name: "jenkins_job",
|
|
74865
75030
|
group: "read",
|
|
74866
75031
|
description: "Read a Jenkins job: health, whether it is building or queued, its last ten builds with results and durations, the last good and last failed build, and the parameters it takes with their defaults and choices.",
|
|
74867
|
-
parametersSchema:
|
|
75032
|
+
parametersSchema: schema12,
|
|
74868
75033
|
async execute(params3) {
|
|
74869
75034
|
try {
|
|
74870
75035
|
const client = await options.client();
|
|
@@ -74897,12 +75062,12 @@ function createJenkinsJobTool(options) {
|
|
|
74897
75062
|
return tool;
|
|
74898
75063
|
}
|
|
74899
75064
|
function createJenkinsBuildTool(options) {
|
|
74900
|
-
const
|
|
75065
|
+
const schema12 = external_exports.object({ job: jobParam(options), build: buildParam });
|
|
74901
75066
|
const tool = {
|
|
74902
75067
|
name: "jenkins_build",
|
|
74903
75068
|
group: "read",
|
|
74904
75069
|
description: "Read one Jenkins build: result, what started it, its parameters, the commits in it, pipeline stages with their status, failed tests with their errors, and artifacts. Start here to find out why a build failed, then read the failing stage\u2019s log with jenkins_build_log.",
|
|
74905
|
-
parametersSchema:
|
|
75070
|
+
parametersSchema: schema12,
|
|
74906
75071
|
async execute(params3) {
|
|
74907
75072
|
try {
|
|
74908
75073
|
const client = await options.client();
|
|
@@ -74940,7 +75105,7 @@ function createJenkinsBuildTool(options) {
|
|
|
74940
75105
|
return tool;
|
|
74941
75106
|
}
|
|
74942
75107
|
function createJenkinsBuildLogTool(options) {
|
|
74943
|
-
const
|
|
75108
|
+
const schema12 = external_exports.object({
|
|
74944
75109
|
job: jobParam(options),
|
|
74945
75110
|
build: buildParam,
|
|
74946
75111
|
stage: external_exports.string().optional().describe("A pipeline stage name: returns the log of that stage\u2019s failed steps (or all its steps if none failed)."),
|
|
@@ -74951,7 +75116,7 @@ function createJenkinsBuildLogTool(options) {
|
|
|
74951
75116
|
name: "jenkins_build_log",
|
|
74952
75117
|
group: "read",
|
|
74953
75118
|
description: "Read a Jenkins build\u2019s console log without loading all of it: the end of it, only lines matching a pattern, or one pipeline stage\u2019s steps. Use jenkins_build first to see which stage failed.",
|
|
74954
|
-
parametersSchema:
|
|
75119
|
+
parametersSchema: schema12,
|
|
74955
75120
|
async execute(params3) {
|
|
74956
75121
|
try {
|
|
74957
75122
|
const client = await options.client();
|
|
@@ -75022,7 +75187,7 @@ function createJenkinsQueueTool(options) {
|
|
|
75022
75187
|
};
|
|
75023
75188
|
}
|
|
75024
75189
|
function createJenkinsStartBuildTool(options) {
|
|
75025
|
-
const
|
|
75190
|
+
const schema12 = external_exports.object({
|
|
75026
75191
|
job: jobParam(options),
|
|
75027
75192
|
parameters: external_exports.record(external_exports.string(), external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()])).optional().describe("Build parameters by name. Unset ones take the job\u2019s defaults. See jenkins_job for what it takes.")
|
|
75028
75193
|
});
|
|
@@ -75031,7 +75196,7 @@ function createJenkinsStartBuildTool(options) {
|
|
|
75031
75196
|
name: "jenkins_start_build",
|
|
75032
75197
|
group: "command",
|
|
75033
75198
|
description: "Start a Jenkins build now, with parameters if the job takes them. It runs on shared CI under the user\u2019s name, so it is always shown to the user first. Returns the build number when Jenkins starts it within a few seconds.",
|
|
75034
|
-
parametersSchema:
|
|
75199
|
+
parametersSchema: schema12,
|
|
75035
75200
|
async preview(params3) {
|
|
75036
75201
|
const client = await options.client();
|
|
75037
75202
|
const job = jobOf(options, params3.job);
|
|
@@ -75069,12 +75234,12 @@ Link: ${client.base}${jobPath(job, client.base)}/${String(started.number)}/` };
|
|
|
75069
75234
|
return tool;
|
|
75070
75235
|
}
|
|
75071
75236
|
function createJenkinsStopBuildTool(options) {
|
|
75072
|
-
const
|
|
75237
|
+
const schema12 = external_exports.object({ job: jobParam(options), build: external_exports.union([external_exports.number().int().positive(), external_exports.string()]).describe("The build number to stop.") });
|
|
75073
75238
|
const tool = {
|
|
75074
75239
|
name: "jenkins_stop_build",
|
|
75075
75240
|
group: "command",
|
|
75076
75241
|
description: "Abort a running Jenkins build. Always shown to the user first.",
|
|
75077
|
-
parametersSchema:
|
|
75242
|
+
parametersSchema: schema12,
|
|
75078
75243
|
async preview(params3) {
|
|
75079
75244
|
const client = await options.client();
|
|
75080
75245
|
const job = jobOf(options, params3.job);
|
|
@@ -75135,7 +75300,7 @@ function createJenkinsCheckJenkinsfileTool(options) {
|
|
|
75135
75300
|
};
|
|
75136
75301
|
}
|
|
75137
75302
|
function createJenkinsTryJenkinsfileTool(options) {
|
|
75138
|
-
const
|
|
75303
|
+
const schema12 = external_exports.object({
|
|
75139
75304
|
job: jobParam(options),
|
|
75140
75305
|
path: external_exports.string().optional().describe("The local Jenkinsfile to run. Default Jenkinsfile."),
|
|
75141
75306
|
build: external_exports.union([external_exports.number().int().positive(), external_exports.string()]).optional().describe("The build to replay \u2014 its parameters and revision are reused. Default last."),
|
|
@@ -75145,7 +75310,7 @@ function createJenkinsTryJenkinsfileTool(options) {
|
|
|
75145
75310
|
name: "jenkins_try_jenkinsfile",
|
|
75146
75311
|
group: "command",
|
|
75147
75312
|
description: "Find out whether a locally edited Jenkinsfile actually runs on Jenkins, without committing it: Jenkins Replay re-runs a recent build of a pipeline job with the local file as its script, on the job\u2019s own agents, parameters and credentials, and this waits for the result \u2014 success, or the failing stage and the end of its log. Check the file with jenkins_check_jenkinsfile first; this one really runs, so it is always shown to the user first, with the whole file. Needs an existing pipeline job that has run at least once, and the Replay permission.",
|
|
75148
|
-
parametersSchema:
|
|
75313
|
+
parametersSchema: schema12,
|
|
75149
75314
|
async preview(params3, context) {
|
|
75150
75315
|
const client = await options.client();
|
|
75151
75316
|
const job = jobOf(options, params3.job);
|
|
@@ -75243,7 +75408,7 @@ var parameterInput = external_exports.object({
|
|
|
75243
75408
|
choices: external_exports.array(external_exports.string()).optional().describe("For a choice parameter: every choice.")
|
|
75244
75409
|
});
|
|
75245
75410
|
function createJenkinsWriteJobTool(options) {
|
|
75246
|
-
const
|
|
75411
|
+
const schema12 = external_exports.object({
|
|
75247
75412
|
action: external_exports.enum(["create", "copy", "update"]).describe(`create: a new job from a whole config (or an existing job's config given as from). copy: a new job copied from "from", optionally changed. update: change an existing job.`),
|
|
75248
75413
|
job: external_exports.string().describe("The job to create (copy, create) or change (update), as folder/name. For create and copy it must not exist yet."),
|
|
75249
75414
|
from: external_exports.string().optional().describe("copy: the existing job to copy, as folder/name or its URL."),
|
|
@@ -75292,7 +75457,7 @@ function createJenkinsWriteJobTool(options) {
|
|
|
75292
75457
|
name: "jenkins_write_job",
|
|
75293
75458
|
group: "command",
|
|
75294
75459
|
description: `Create a Jenkins job, copy an existing job into a new one, or change a job's configuration - most often its parameters (add, change default/choices/description, remove), and anything else by exact text edits of its config.xml. To make a job "like X but with new parameters", use copy with from: X and parameters.set. Never deletes a job and never replaces an existing one by creating over it. Always shown to the user first as a diff of the configuration Jenkins will be sent; it cannot be set to always allow.`,
|
|
75295
|
-
parametersSchema:
|
|
75460
|
+
parametersSchema: schema12,
|
|
75296
75461
|
async preview(params3) {
|
|
75297
75462
|
try {
|
|
75298
75463
|
const client = await options.client();
|
|
@@ -79015,8 +79180,8 @@ var JiraClient = class {
|
|
|
79015
79180
|
}
|
|
79016
79181
|
};
|
|
79017
79182
|
function fieldInfo(id, field2) {
|
|
79018
|
-
const
|
|
79019
|
-
const type =
|
|
79183
|
+
const schema12 = field2.schema ?? {};
|
|
79184
|
+
const type = schema12.type === "array" ? `array of ${schema12.items ?? "?"}` : schema12.type ?? "?";
|
|
79020
79185
|
return {
|
|
79021
79186
|
id,
|
|
79022
79187
|
name: field2.name ?? id,
|
|
@@ -83550,7 +83715,7 @@ function guardPrompt(context) {
|
|
|
83550
83715
|
|
|
83551
83716
|
// ../../packages/core/dist/observers/tool.js
|
|
83552
83717
|
var TYPES = ["event", "finding", "alert", "note", "status"];
|
|
83553
|
-
var
|
|
83718
|
+
var schema6 = external_exports.object({
|
|
83554
83719
|
action: external_exports.enum(["records", "summary"]).default("summary").describe("summary: counts by type, tool and day, every alert, the sessions. records: the matching records themselves, newest first."),
|
|
83555
83720
|
source: external_exports.enum(["local", "index"]).default("local").describe("local: the journal on this machine (always there). index: your OpenSearch audit index, when one is configured - it also holds what your other machines recorded."),
|
|
83556
83721
|
hours: external_exports.number().positive().max(24 * 3650).optional().describe("Only the last N hours. Overridden by from/until."),
|
|
@@ -83653,7 +83818,7 @@ function createReadAuditTool(deps) {
|
|
|
83653
83818
|
name: "read_audit_log",
|
|
83654
83819
|
group: "read",
|
|
83655
83820
|
description: `Read the Auditor's record of what agents did in this project: every user request, reasoning step, tool call, approval (the literal action shown), result and turn end, plus the Auditor's findings, alerts about dangerous or refused actions, and the Anti Hallucinator's notes. Use action "summary" first (counts, alerts, sessions), then "records" with filters for detail. Rows are flat JSON, so a large answer can go to the dataframe tool.`,
|
|
83656
|
-
parametersSchema:
|
|
83821
|
+
parametersSchema: schema6,
|
|
83657
83822
|
async execute(params3) {
|
|
83658
83823
|
const until = time3(params3.until, true);
|
|
83659
83824
|
const from = time3(params3.from, false) ?? (params3.hours !== void 0 ? Date.now() - params3.hours * 36e5 : void 0);
|
|
@@ -83889,7 +84054,7 @@ var RoleProcess = class {
|
|
|
83889
84054
|
};
|
|
83890
84055
|
|
|
83891
84056
|
// ../../packages/core/dist/strategy/historyTool.js
|
|
83892
|
-
var
|
|
84057
|
+
var schema7 = external_exports.object({
|
|
83893
84058
|
role: external_exports.string().optional().describe("Only exchanges with this role."),
|
|
83894
84059
|
last: external_exports.number().int().min(1).max(50).optional().describe("The newest N exchanges (default 20)."),
|
|
83895
84060
|
full: external_exports.boolean().optional().describe("Questions and answers in full; otherwise the first lines of each.")
|
|
@@ -83899,7 +84064,7 @@ function createStrategyHistoryTool(deps) {
|
|
|
83899
84064
|
name: "strategy_history",
|
|
83900
84065
|
group: "read",
|
|
83901
84066
|
description: "What happened under this chat's strategy: each specialist consulted, what it was asked and answered, and for every back-and-forth its rounds, verdicts and why it went back. Use it to explain the strategy's progress when the user asks.",
|
|
83902
|
-
parametersSchema:
|
|
84067
|
+
parametersSchema: schema7,
|
|
83903
84068
|
async execute(params3) {
|
|
83904
84069
|
const { strategy, progress, exchanges } = deps.current();
|
|
83905
84070
|
if (strategy === void 0)
|
|
@@ -83933,7 +84098,7 @@ var item = external_exports.object({
|
|
|
83933
84098
|
contract: external_exports.string().max(1e3).optional().describe("What passes along this connector, in a sentence."),
|
|
83934
84099
|
requires: external_exports.array(external_exports.string().trim().min(1).max(80)).max(10).optional().describe('The items the hand-over must contain, each a short name ("Changed files", "Tests run"). Light Code checks every one.')
|
|
83935
84100
|
});
|
|
83936
|
-
var
|
|
84101
|
+
var schema8 = external_exports.object({
|
|
83937
84102
|
contracts: external_exports.array(item).min(1).max(20).describe("One entry per connector to set. A connector is named by the two roles it joins.")
|
|
83938
84103
|
});
|
|
83939
84104
|
function findEdge(strategy, from, to) {
|
|
@@ -83967,7 +84132,7 @@ function createSetStrategyContractsTool(deps) {
|
|
|
83967
84132
|
name: "set_strategy_contracts",
|
|
83968
84133
|
group: "edit",
|
|
83969
84134
|
description: "Propose what passes between steps of this chat's strategy: a contract and the items each hand-over must contain, for connectors that have none (or to sharpen one). The user approves the change; Light Code then checks every required item after each answer and asks the specialist again for what is missing.",
|
|
83970
|
-
parametersSchema:
|
|
84135
|
+
parametersSchema: schema8,
|
|
83971
84136
|
async preview(params3) {
|
|
83972
84137
|
const strategy = deps.current();
|
|
83973
84138
|
if (strategy === void 0)
|
|
@@ -85478,14 +85643,17 @@ ${preview.text}` } : {}
|
|
|
85478
85643
|
token: () => secrets.get(services.jupyterHub?.tokenRef ?? ""),
|
|
85479
85644
|
tls: () => hubTls(services.jupyterHub)
|
|
85480
85645
|
}) : void 0;
|
|
85646
|
+
const siblingHubClients = (services.siblingHubs ?? []).map(({ name, spec }) => ({
|
|
85647
|
+
name,
|
|
85648
|
+
spec,
|
|
85649
|
+
label: `${name}'s hub (${spec.user}@${hostLabel(spec.url)}${spec.server !== void 0 ? `, server ${spec.server}` : ""})`,
|
|
85650
|
+
client: new JupyterClient(httpClient, spec, () => secrets.get(spec.tokenRef), () => hubTls(spec))
|
|
85651
|
+
}));
|
|
85481
85652
|
const browsableHubs = [
|
|
85482
85653
|
...hub !== void 0 ? [{ name: "this", label: `${hub.label}, this codebase's hub`, client: hub.client }] : [],
|
|
85483
|
-
...
|
|
85484
|
-
name,
|
|
85485
|
-
label: `${name}'s hub (${spec.user}@${hostLabel(spec.url)})`,
|
|
85486
|
-
client: new JupyterClient(httpClient, spec, () => secrets.get(spec.tokenRef), () => hubTls(spec))
|
|
85487
|
-
}))
|
|
85654
|
+
...siblingHubClients.map(({ name, label, client }) => ({ name, label, client }))
|
|
85488
85655
|
];
|
|
85656
|
+
const otherHubs = siblingHubClients.map(({ name, label, client, spec }) => ({ name, label, kernel: new KernelSession(client, spec.kernel) }));
|
|
85489
85657
|
const diagnosticsProvider = hub !== void 0 && anyDiagnostics !== void 0 ? withoutMissingImports(anyDiagnostics) : anyDiagnostics;
|
|
85490
85658
|
let hubSyncTimer;
|
|
85491
85659
|
let hubSyncStartup;
|
|
@@ -86111,10 +86279,13 @@ ${preview.text}` } : {}
|
|
|
86111
86279
|
}));
|
|
86112
86280
|
}
|
|
86113
86281
|
}
|
|
86114
|
-
if (hub !== void 0) {
|
|
86115
|
-
for (const tool of createHubTools(hub))
|
|
86282
|
+
if (hub !== void 0 || otherHubs.length > 0) {
|
|
86283
|
+
for (const tool of createHubTools(hub, otherHubs))
|
|
86116
86284
|
combined.register(tool);
|
|
86117
86285
|
}
|
|
86286
|
+
if (services.codebaseAgents !== void 0 && (services.siblings?.length ?? 0) > 0) {
|
|
86287
|
+
combined.register(createAskCodebaseAgentTool({ channel: services.codebaseAgents, codebases: services.siblings ?? [], depth: () => workingForDepth }));
|
|
86288
|
+
}
|
|
86118
86289
|
const hubBrowse = createHubBrowseTool(browsableHubs);
|
|
86119
86290
|
if (hubBrowse !== void 0)
|
|
86120
86291
|
combined.register(hubBrowse);
|
|
@@ -87488,7 +87659,7 @@ ${error51.stack.split("\n").slice(1, 6).join("\n")}`;
|
|
|
87488
87659
|
await postTasks();
|
|
87489
87660
|
}
|
|
87490
87661
|
let handoffAbort;
|
|
87491
|
-
function startUserTurn(text2, images) {
|
|
87662
|
+
function startUserTurn(text2, images, onSettled) {
|
|
87492
87663
|
void (async () => {
|
|
87493
87664
|
if (scheduledRunInFlight !== void 0) {
|
|
87494
87665
|
logger.info("holding the message until the scheduled run finishes");
|
|
@@ -87503,9 +87674,25 @@ ${error51.stack.split("\n").slice(1, 6).join("\n")}`;
|
|
|
87503
87674
|
} finally {
|
|
87504
87675
|
userTurnRunning = false;
|
|
87505
87676
|
userTurnWindingDown = false;
|
|
87677
|
+
onSettled?.();
|
|
87506
87678
|
}
|
|
87507
87679
|
})();
|
|
87508
87680
|
}
|
|
87681
|
+
let workingForDepth = 0;
|
|
87682
|
+
services.codebaseAgents?.onTask((task) => {
|
|
87683
|
+
const channel = services.codebaseAgents;
|
|
87684
|
+
if (channel === void 0)
|
|
87685
|
+
return;
|
|
87686
|
+
if (userTurnRunning || activeAbortController !== void 0 || scheduledRunInFlight !== void 0) {
|
|
87687
|
+
channel.done(task.id, { ok: false, text: "That chat was busy with another turn. Ask again." });
|
|
87688
|
+
return;
|
|
87689
|
+
}
|
|
87690
|
+
workingForDepth = task.depth;
|
|
87691
|
+
const text2 = composeTaskMessage(task);
|
|
87692
|
+
post({ type: "taskRestored", taskId: activeTaskId, entries: toTranscript([...conversation.toArray(), { role: "user", content: text2 }]) });
|
|
87693
|
+
post({ type: "hostTurnStarted" });
|
|
87694
|
+
startUserTurn(text2, void 0, () => channel.done(task.id, answerFromConversation(conversation.toArray())));
|
|
87695
|
+
});
|
|
87509
87696
|
async function handleHandoff() {
|
|
87510
87697
|
if (handoffAbort !== void 0)
|
|
87511
87698
|
return;
|
|
@@ -88399,31 +88586,25 @@ ${direction}` : attachMentions(text2, mentions);
|
|
|
88399
88586
|
}
|
|
88400
88587
|
async function profileFromForm(input) {
|
|
88401
88588
|
const fieldErrors = validateProviderForm({
|
|
88402
|
-
label: input.label,
|
|
88589
|
+
label: typeof input.label === "string" && input.label.trim().length > 0 ? input.label : "Untitled",
|
|
88403
88590
|
wireFormat: input.wireFormat,
|
|
88404
88591
|
baseUrl: input.baseUrl,
|
|
88405
|
-
model: input.model
|
|
88592
|
+
model: typeof input.model === "string" && input.model.trim().length > 0 ? input.model : "unset"
|
|
88406
88593
|
});
|
|
88407
88594
|
if (fieldErrors.length > 0) {
|
|
88408
|
-
|
|
88409
|
-
type: "error",
|
|
88410
|
-
message: fieldErrors.map((issue2) => `${issue2.path}: ${issue2.message}`).join("; ")
|
|
88411
|
-
});
|
|
88412
|
-
return void 0;
|
|
88595
|
+
return { problem: fieldErrors.map((issue2) => `${issue2.path}: ${issue2.message}`).join("; ") };
|
|
88413
88596
|
}
|
|
88414
88597
|
const baseUrl = input.baseUrl.trim();
|
|
88415
|
-
if (baseUrl.length === 0)
|
|
88416
|
-
|
|
88417
|
-
return void 0;
|
|
88418
|
-
}
|
|
88598
|
+
if (baseUrl.length === 0)
|
|
88599
|
+
return { problem: "Enter a base URL first." };
|
|
88419
88600
|
const id = input.id ?? "__unsaved__";
|
|
88420
88601
|
const auth2 = await buildAuthFromInput(input, id);
|
|
88421
88602
|
const profile = {
|
|
88422
88603
|
id,
|
|
88423
|
-
label: input.label.trim().length > 0 ? input.label.trim() : "Untitled",
|
|
88604
|
+
label: typeof input.label === "string" && input.label.trim().length > 0 ? input.label.trim() : "Untitled",
|
|
88424
88605
|
wireFormat: input.wireFormat,
|
|
88425
88606
|
baseUrl,
|
|
88426
|
-
model: input.model.trim().length > 0 ? input.model.trim() : "unset",
|
|
88607
|
+
model: typeof input.model === "string" && input.model.trim().length > 0 ? input.model.trim() : "unset",
|
|
88427
88608
|
auth: auth2,
|
|
88428
88609
|
...input.connectionTls !== void 0 ? { tls: stripEmpty(input.connectionTls) } : {}
|
|
88429
88610
|
};
|
|
@@ -93572,8 +93753,10 @@ ${last}` : ""}`);
|
|
|
93572
93753
|
async function handleRequestModels(input) {
|
|
93573
93754
|
try {
|
|
93574
93755
|
const built = await profileFromForm(input);
|
|
93575
|
-
if (
|
|
93756
|
+
if ("problem" in built) {
|
|
93757
|
+
post({ type: "models", models: [], warning: built.problem });
|
|
93576
93758
|
return;
|
|
93759
|
+
}
|
|
93577
93760
|
const { config: config2 } = await configManager.load();
|
|
93578
93761
|
const result = await listModelsFor(config2, built.profile);
|
|
93579
93762
|
rememberWindows(built.profile.baseUrl, result.windows);
|
|
@@ -93593,8 +93776,10 @@ ${last}` : ""}`);
|
|
|
93593
93776
|
async function handleTestConnection(input) {
|
|
93594
93777
|
try {
|
|
93595
93778
|
const built = await profileFromForm(input);
|
|
93596
|
-
if (
|
|
93779
|
+
if ("problem" in built) {
|
|
93780
|
+
post({ type: "testConnectionResult", ok: false, steps: [{ step: "certificates", status: "failed", detail: built.problem }] });
|
|
93597
93781
|
return;
|
|
93782
|
+
}
|
|
93598
93783
|
const { config: config2 } = await configManager.load();
|
|
93599
93784
|
const result = built.profile.wireFormat === "vscode-lm" ? await testHostModels(services.languageModels, built.profile.model) : await testConnection(built.profile, buildAuthContext(config2, built.profile), httpClient);
|
|
93600
93785
|
post({ type: "testConnectionResult", ok: result.ok, steps: result.steps });
|
|
@@ -95738,6 +95923,8 @@ ${contents}
|
|
|
95738
95923
|
if (hubSyncStartup !== void 0)
|
|
95739
95924
|
clearTimeout(hubSyncStartup);
|
|
95740
95925
|
void hub?.kernel.dispose();
|
|
95926
|
+
for (const other of otherHubs)
|
|
95927
|
+
void other.kernel.dispose();
|
|
95741
95928
|
stopKeepAlive();
|
|
95742
95929
|
void observerHub.dispose();
|
|
95743
95930
|
stopRoleProcesses();
|
|
@@ -96473,14 +96660,14 @@ ${lines2.join("\n")}${relevant.length > cap3 ? `
|
|
|
96473
96660
|
}
|
|
96474
96661
|
|
|
96475
96662
|
// ../../packages/core/dist/tools/diagnostics.js
|
|
96476
|
-
var
|
|
96663
|
+
var schema9 = external_exports.object({
|
|
96477
96664
|
paths: external_exports.array(external_exports.string().min(1)).min(1).max(20).describe("Files to check.")
|
|
96478
96665
|
});
|
|
96479
96666
|
var getDiagnosticsTool = {
|
|
96480
96667
|
name: "get_diagnostics",
|
|
96481
96668
|
group: "read",
|
|
96482
96669
|
description: "Compile errors, type errors and warnings for files, from the language server (Python, TypeScript/JavaScript, Java, C#, Go, Rust, C/C++ and more, where installed) \u2014 without running a build. After edits, the edit result already lists new problems in that file; use this to check other files that depend on it.",
|
|
96483
|
-
parametersSchema:
|
|
96670
|
+
parametersSchema: schema9,
|
|
96484
96671
|
async execute(params3, context) {
|
|
96485
96672
|
if (context.diagnostics === void 0)
|
|
96486
96673
|
return { content: "No language support is available here.", isError: true };
|
|
@@ -97093,8 +97280,12 @@ only \u2014 a repository must never be able to repoint where your prompts and yo
|
|
|
97093
97280
|
|
|
97094
97281
|
**The model dropdown is never a hard dependency.** It is filled from the provider's models
|
|
97095
97282
|
endpoint, which gateways frequently answer with their own catalogue or a 404, so free-text entry
|
|
97096
|
-
is always available.
|
|
97097
|
-
|
|
97283
|
+
is always available. The list loads once a URL and a key are entered - no model needs choosing
|
|
97284
|
+
first - and if it cannot load, the reason is shown under the dropdown. For **Google Gemini** every
|
|
97285
|
+
page of Google's catalogue is read and only chat models are listed (embedding, image and video
|
|
97286
|
+
models are left out), so pick a new model such as Gemini 4 from the list rather than typing a guess:
|
|
97287
|
+
Google answers a retired or mistyped id with a 404. Context window, vision and tool support come
|
|
97288
|
+
from a local table and can be overridden per profile; an unknown id defaults conservatively.
|
|
97098
97289
|
|
|
97099
97290
|
**Auth is a separate axis from wire format**, so any strategy composes with any adapter:
|
|
97100
97291
|
|
|
@@ -98974,6 +99165,11 @@ desktops of the same person; importing the file is how a second machine is set u
|
|
|
98974
99165
|
"browse the hub",
|
|
98975
99166
|
"other codebase hub",
|
|
98976
99167
|
"files on the hub",
|
|
99168
|
+
"named server",
|
|
99169
|
+
"named jupyterhub server",
|
|
99170
|
+
"another server",
|
|
99171
|
+
"libraries on another hub",
|
|
99172
|
+
"inspect libraries",
|
|
98977
99173
|
"hubignore",
|
|
98978
99174
|
".hubignore",
|
|
98979
99175
|
"ignore files",
|
|
@@ -99041,6 +99237,11 @@ anywhere your hub user can see - read only, nothing copied or changed. It is off
|
|
|
99041
99237
|
codebase for its own hub, and in **every other Fire Code codebase** for each hub codebase, named by
|
|
99042
99238
|
its @name - so a local codebase can look at the hub's files without its own token. Only the added
|
|
99043
99239
|
folders are copied here and searched with the fast tools; editing stays in the hub codebase.
|
|
99240
|
+
**Another codebase's libraries**: \`hub_inspect\` and \`hub_run\` take \`hub\` - another JupyterHub codebase's name,
|
|
99241
|
+
a named server included - and then run in that server's own kernel: what is installed there, a function's
|
|
99242
|
+
signature and source, or code and shell commands from a folder on that server. That kernel is this chat's own,
|
|
99243
|
+
started on first use and shut down with the chat; the other codebase's chat is not touched. Each call is approved,
|
|
99244
|
+
and the approval names the server. A local workspace script cannot run there - use shell (\`python path/to/x.py\`).
|
|
99044
99245
|
|
|
99045
99246
|
**Not done for you**: a file deleted here is not deleted on the hub (\`hub_sync\` "status" lists it);
|
|
99046
99247
|
edits made outside the agent (in VS Code, say) are saved with \`hub_sync\` "push".
|
|
@@ -99369,6 +99570,12 @@ always asks you).
|
|
|
99369
99570
|
"several codebases",
|
|
99370
99571
|
"multiple codebases",
|
|
99371
99572
|
"multiple projects",
|
|
99573
|
+
"agent to agent",
|
|
99574
|
+
"ask another agent",
|
|
99575
|
+
"other codebase agent",
|
|
99576
|
+
"ask_codebase_agent",
|
|
99577
|
+
"agents talk",
|
|
99578
|
+
"another codebase's agent",
|
|
99372
99579
|
"many projects",
|
|
99373
99580
|
"one window",
|
|
99374
99581
|
"parallel",
|
|
@@ -99449,6 +99656,16 @@ always asks you).
|
|
|
99449
99656
|
"review python tools once"
|
|
99450
99657
|
],
|
|
99451
99658
|
body: `
|
|
99659
|
+
**Agents asking each other**: the agent in one codebase can ask the agent in another for help, or to do something
|
|
99660
|
+
there, with \`ask_codebase_agent\` - you approve it, seeing the exact request and which codebase it goes to. Fire Code
|
|
99661
|
+
opens a new tab on that codebase ("From <codebase>: ...") without switching to it, and that agent starts on the
|
|
99662
|
+
request by itself, with its own files, tools, skills and instructions; **its approvals are asked in its own tab**, where
|
|
99663
|
+
you can watch or step in. When it finishes, its answer goes back to the first agent. If it stops to ask you something,
|
|
99664
|
+
the first agent is told it is waiting in that tab. **Once it has answered, the tab archives itself** (it stays in
|
|
99665
|
+
History) - unless it stopped to ask you something, it failed, or you are looking at it (then it goes when you leave
|
|
99666
|
+
it). Chains stop three asks deep, scheduled runs cannot ask, and closing the tab tells the first agent there will be
|
|
99667
|
+
no answer.
|
|
99668
|
+
|
|
99452
99669
|
**Editing skills, tools and the standing instructions in Fire Code.** Fire Code has no code editor, so
|
|
99453
99670
|
*Open* on a skill or tool (and the standing-instructions button in the Skills tab) opens Light Code's own
|
|
99454
99671
|
editor: a full-panel text box with Save (Ctrl+S), Close (Esc) and a Markdown preview. A save is refused if
|
|
@@ -99784,7 +100001,13 @@ codebases and a whole team. Fire Code's dialog has a button that opens them too.
|
|
|
99784
100001
|
"export diagram",
|
|
99785
100002
|
"download diagram",
|
|
99786
100003
|
"diagram as image",
|
|
99787
|
-
"show_diagram"
|
|
100004
|
+
"show_diagram",
|
|
100005
|
+
"table too wide",
|
|
100006
|
+
"wide table",
|
|
100007
|
+
"chart too wide",
|
|
100008
|
+
"compact table",
|
|
100009
|
+
"chart size",
|
|
100010
|
+
"full width"
|
|
99788
100011
|
],
|
|
99789
100012
|
body: `
|
|
99790
100013
|
Ask for a diagram ("draw the request flow", "show the architecture") and the assistant draws one in the
|
|
@@ -99794,6 +100017,11 @@ Under each diagram: **Copy SVG** copies the markup to paste into a document or e
|
|
|
99794
100017
|
**Save PNG** open a Save dialog - VS Code's own, or a Windows one in Fire Code starting in Downloads - and
|
|
99795
100018
|
say where the file went. A PNG is drawn at twice the size so it stays sharp in a slide. In a plain browser
|
|
99796
100019
|
the file downloads instead. If a save fails, the reason is shown under the buttons.
|
|
100020
|
+
|
|
100021
|
+
**How wide pictures and tables are**: diagrams and charts are drawn at most "large" (680 pixels) unless the
|
|
100022
|
+
assistant is asked otherwise - say "make it smaller" or "show it full width" - and tables are as wide as their
|
|
100023
|
+
content, wrapping long cells. So in a wide window, such as Fire Code's, they stay compact while the text around
|
|
100024
|
+
them uses the full width; in VS Code's narrow panel nothing changes.
|
|
99797
100025
|
`
|
|
99798
100026
|
},
|
|
99799
100027
|
{
|
|
@@ -101173,7 +101401,7 @@ var writeToFileTool = {
|
|
|
101173
101401
|
|
|
101174
101402
|
// ../../packages/core/dist/tools/wait.js
|
|
101175
101403
|
var MAX_WAIT_SECONDS = 900;
|
|
101176
|
-
var
|
|
101404
|
+
var schema10 = external_exports.object({
|
|
101177
101405
|
seconds: external_exports.number().int().min(1).max(MAX_WAIT_SECONDS).describe(`How long to wait, 1\u2013${String(MAX_WAIT_SECONDS)} seconds. Prefer fewer, longer waits: every check and every wait is a step.`),
|
|
101178
101406
|
reason: external_exports.string().max(200).optional().describe('What you are waiting for, shown to the user \u2014 e.g. "PAY_EOD to finish".')
|
|
101179
101407
|
});
|
|
@@ -101184,7 +101412,7 @@ function createWaitTool(options = {}) {
|
|
|
101184
101412
|
name: "wait",
|
|
101185
101413
|
group: "always",
|
|
101186
101414
|
description: `Wait before looking again \u2014 for a job, build, deployment or file that is not ready yet. Check with the ordinary tool, wait, then check again; say what you are waiting for in \`reason\`. Ends early if the user sends a message. Up to ${String(MAX_WAIT_SECONDS)} seconds per call; for longer, wait again after checking.`,
|
|
101187
|
-
parametersSchema:
|
|
101415
|
+
parametersSchema: schema10,
|
|
101188
101416
|
async execute(params3, context) {
|
|
101189
101417
|
const started = now();
|
|
101190
101418
|
const until = started + params3.seconds * 1e3;
|
|
@@ -101589,7 +101817,7 @@ function describeNestedCall(caller, callee) {
|
|
|
101589
101817
|
}
|
|
101590
101818
|
|
|
101591
101819
|
// ../../packages/core/dist/tools/checkCollectorTool.js
|
|
101592
|
-
var
|
|
101820
|
+
var schema11 = external_exports.object({
|
|
101593
101821
|
name: external_exports.string().min(1).describe("The Python tool to examine, with or without the `py__` prefix."),
|
|
101594
101822
|
arguments: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe("Arguments to call it with, if it needs any. `since` is supplied automatically by a sync.")
|
|
101595
101823
|
});
|
|
@@ -101616,7 +101844,7 @@ function createCheckCollectorTool(options) {
|
|
|
101616
101844
|
name: "check_collector",
|
|
101617
101845
|
group: "read",
|
|
101618
101846
|
description: "Runs a Python tool and says whether its output can be indexed as a custom dataset, and if not, exactly what to change. Use it when a dataset sync reports that records are not usable, when adapting an existing tool into a collector, or after writing one to confirm it before the user configures a dataset around it. Changes nothing \u2014 it reports; fixing is an ordinary update_python_tool edit.",
|
|
101619
|
-
parametersSchema:
|
|
101847
|
+
parametersSchema: schema11,
|
|
101620
101848
|
execute: async (params3) => {
|
|
101621
101849
|
const bare = params3.name.replace(/^py__/, "");
|
|
101622
101850
|
const full = `py__${bare}`;
|
|
@@ -103691,6 +103919,7 @@ async function createSession(options) {
|
|
|
103691
103919
|
...options.sharedWorkspace === true ? { sharedWorkspace: true } : {},
|
|
103692
103920
|
// Fire Code's monitoring - one person's own machine only, like the rest of what Fire Code passes.
|
|
103693
103921
|
...options.monitoring !== void 0 && options.shared !== true ? { monitoring: options.monitoring } : {},
|
|
103922
|
+
...options.codebaseAgents !== void 0 && options.shared !== true ? { codebaseAgents: options.codebaseAgents } : {},
|
|
103694
103923
|
...options.monitorExecutor !== void 0 && options.shared !== true ? { monitorExecutor: options.monitorExecutor } : {},
|
|
103695
103924
|
...options.extraToolDirs !== void 0 && options.extraToolDirs.length > 0 ? { extraToolDirs: options.extraToolDirs } : {},
|
|
103696
103925
|
...options.noSchedules === true ? { runsSchedules: false } : {},
|
|
@@ -103955,6 +104184,7 @@ async function startServer(options) {
|
|
|
103955
104184
|
...options.secretsFile !== void 0 ? { secretsFile: options.secretsFile } : {},
|
|
103956
104185
|
...options.desktopNotify === true ? { desktopNotify: true } : {},
|
|
103957
104186
|
...options.monitoring !== void 0 ? { monitoring: options.monitoring } : {},
|
|
104187
|
+
...options.codebaseAgents !== void 0 ? { codebaseAgents: options.codebaseAgents } : {},
|
|
103958
104188
|
...options.monitorExecutor !== void 0 ? { monitorExecutor: options.monitorExecutor } : {},
|
|
103959
104189
|
...options.extraToolDirs !== void 0 ? { extraToolDirs: options.extraToolDirs } : {},
|
|
103960
104190
|
...options.secretsKey !== void 0 ? { secretsKey: options.secretsKey } : {},
|