@chosengeneration/light-code 0.182.0 → 0.184.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/cli.cjs +930 -631
  2. package/dist/server.cjs +860 -628
  3. 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, schema11) {
17825
- if (typeof schema11 == "boolean")
17826
- return schema11;
17827
- if (Object.keys(schema11).length === 0)
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, schema11);
17830
- return !schemaHasRules(schema11, it.self.RULES.all);
17829
+ checkUnknownRules(it, schema12);
17830
+ return !schemaHasRules(schema12, it.self.RULES.all);
17831
17831
  }
17832
17832
  exports2.alwaysValidSchema = alwaysValidSchema;
17833
- function checkUnknownRules(it, schema11 = it.schema) {
17833
+ function checkUnknownRules(it, schema12 = it.schema) {
17834
17834
  const { opts, self } = it;
17835
17835
  if (!opts.strictSchema)
17836
17836
  return;
17837
- if (typeof schema11 === "boolean")
17837
+ if (typeof schema12 === "boolean")
17838
17838
  return;
17839
17839
  const rules = self.RULES.keywords;
17840
- for (const key3 in schema11) {
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(schema11, rules) {
17847
- if (typeof schema11 == "boolean")
17848
- return !schema11;
17849
- for (const key3 in schema11)
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(schema11, RULES) {
17856
- if (typeof schema11 == "boolean")
17857
- return !schema11;
17858
- for (const key3 in schema11)
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 }, schema11, keyword, $data) {
17864
+ function schemaRefOrVal({ topSchemaRef, schemaPath }, schema12, keyword, $data) {
17865
17865
  if (!$data) {
17866
- if (typeof schema11 == "number" || typeof schema11 == "boolean")
17867
- return schema11;
17868
- if (typeof schema11 == "string")
17869
- return (0, codegen_1._)`${schema11}`;
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: schema11, validateName } = it;
18151
- if (schema11 === false) {
18150
+ const { gen, schema: schema12, validateName } = it;
18151
+ if (schema12 === false) {
18152
18152
  falseSchemaError(it, false);
18153
- } else if (typeof schema11 == "object" && schema11.$async === true) {
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: schema11 } = it;
18163
- if (schema11 === false) {
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: schema11, self }, type) {
18225
+ function schemaHasRulesForType({ schema: schema12, self }, type) {
18226
18226
  const group = self.RULES.types[type];
18227
- return group && group !== true && shouldUseGroup(schema11, group);
18227
+ return group && group !== true && shouldUseGroup(schema12, group);
18228
18228
  }
18229
18229
  exports2.schemaHasRulesForType = schemaHasRulesForType;
18230
- function shouldUseGroup(schema11, group) {
18231
- return group.rules.some((rule) => shouldUseRule(schema11, rule));
18230
+ function shouldUseGroup(schema12, group) {
18231
+ return group.rules.some((rule) => shouldUseRule(schema12, rule));
18232
18232
  }
18233
18233
  exports2.shouldUseGroup = shouldUseGroup;
18234
- function shouldUseRule(schema11, rule) {
18234
+ function shouldUseRule(schema12, rule) {
18235
18235
  var _a3;
18236
- return schema11[rule.keyword] !== void 0 || ((_a3 = rule.definition.implements) === null || _a3 === void 0 ? void 0 : _a3.some((kwd) => schema11[kwd] !== void 0));
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(schema11) {
18259
- const types = getJSONTypes(schema11.type);
18258
+ function getSchemaTypes(schema12) {
18259
+ const types = getJSONTypes(schema12.type);
18260
18260
  const hasNull = types.includes("null");
18261
18261
  if (hasNull) {
18262
- if (schema11.nullable === false)
18262
+ if (schema12.nullable === false)
18263
18263
  throw new Error("type: null contradicts nullable: false");
18264
18264
  } else {
18265
- if (!types.length && schema11.nullable !== void 0) {
18265
+ if (!types.length && schema12.nullable !== void 0) {
18266
18266
  throw new Error('"nullable" cannot be used without "type"');
18267
18267
  }
18268
- if (schema11.nullable === true)
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: schema11 }) => `must be ${schema11}`,
18401
- params: ({ schema: schema11, schemaValue }) => typeof schema11 == "string" ? (0, codegen_1._)`{type: ${schema11}}` : (0, codegen_1._)`{type: ${schemaValue}}`
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: schema11 } = it;
18410
- const schemaCode = (0, util_1.schemaRefOrVal)(it, schema11, "type");
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: schema11.type,
18415
+ schema: schema12.type,
18416
18416
  schemaCode,
18417
18417
  schemaValue: schemaCode,
18418
- parentSchema: schema11,
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: schema11, keyword, it } = cxt;
18572
- if (!Array.isArray(schema11))
18571
+ const { gen, schema: schema12, keyword, it } = cxt;
18572
+ if (!Array.isArray(schema12))
18573
18573
  throw new Error("ajv implementation error");
18574
- const alwaysValid = schema11.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
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(() => schema11.forEach((_sch, i) => {
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: schema11, parentSchema, it } = cxt;
18608
- const macroSchema2 = def.macro.call(it.self, schema11, parentSchema, it);
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: schema11, parentSchema, $data, it } = cxt;
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, schema11, parentSchema, it) : def.validate;
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(schema11, schemaType, allowUndefined = false) {
18688
- return !schemaType.length || schemaType.some((st) => st === "array" ? Array.isArray(schema11) : st === "object" ? schema11 && typeof schema11 == "object" && !Array.isArray(schema11) : typeof schema11 == st || allowUndefined && typeof schema11 == "undefined");
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: schema11, opts, self, errSchemaPath }, def, keyword) {
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(schema11, kwd))) {
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(schema11[keyword]);
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: schema11, schemaPath, errSchemaPath, topSchemaRef }) {
18723
- if (keyword !== void 0 && schema11 !== 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 (schema11 !== void 0) {
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: schema11,
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(schema11, opts, cb) {
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, schema11, "", schema11);
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, schema11, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
18893
- if (schema11 && typeof schema11 == "object" && !Array.isArray(schema11)) {
18894
- pre(schema11, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
18895
- for (var key3 in schema11) {
18896
- var sch = schema11[key3];
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, schema11, i);
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, schema11, prop);
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, schema11);
18908
+ _traverse(opts, pre, post, sch, jsonPtr + "/" + key3, rootSchema, jsonPtr, key3, schema12);
18909
18909
  }
18910
18910
  }
18911
- post(schema11, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
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(schema11, limit = true) {
18948
- if (typeof schema11 == "boolean")
18947
+ function inlineRef(schema12, limit = true) {
18948
+ if (typeof schema12 == "boolean")
18949
18949
  return true;
18950
18950
  if (limit === true)
18951
- return !hasRef(schema11);
18951
+ return !hasRef(schema12);
18952
18952
  if (!limit)
18953
18953
  return false;
18954
- return countKeys(schema11) <= limit;
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(schema11) {
18965
- for (const key3 in schema11) {
18964
+ function hasRef(schema12) {
18965
+ for (const key3 in schema12) {
18966
18966
  if (REF_KEYWORDS.has(key3))
18967
18967
  return true;
18968
- const sch = schema11[key3];
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(schema11) {
18976
+ function countKeys(schema12) {
18977
18977
  let count3 = 0;
18978
- for (const key3 in schema11) {
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 schema11[key3] == "object") {
18985
- (0, util_1.eachItem)(schema11[key3], (sch) => count3 += countKeys(sch));
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(schema11, baseId) {
19016
- if (typeof schema11 == "boolean")
19015
+ function getSchemaRefs(schema12, baseId) {
19016
+ if (typeof schema12 == "boolean")
19017
19017
  return {};
19018
19018
  const { schemaId, uriResolver } = this.opts;
19019
- const schId = normalizeId(schema11[schemaId] || baseId);
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(schema11, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
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: schema11, schemaEnv, opts }, body) {
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(schema11, opts)}`);
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(schema11, opts)).code(body));
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: schema11, opts, gen } = it;
19137
+ const { schema: schema12, opts, gen } = it;
19138
19138
  validateFunction(it, () => {
19139
- if (opts.$comment && schema11.$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(schema11, opts) {
19158
- const schId = typeof schema11 == "object" && schema11[opts.schemaId];
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: schema11, self }) {
19172
- if (typeof schema11 == "boolean")
19173
- return !schema11;
19174
- for (const key3 in schema11)
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: schema11, gen, opts } = it;
19184
- if (opts.$comment && schema11.$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: schema11, errSchemaPath, opts, self } = it;
19205
- if (schema11.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema11, self.RULES)) {
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: schema11, opts } = it;
19211
- if (schema11.default !== void 0 && opts.useDefaults && opts.strictSchema) {
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: schema11, errSchemaPath, opts }) {
19225
- const msg = schema11.$comment;
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: schema11, data, allErrors, opts, self } = it;
19252
+ const { gen, schema: schema12, data, allErrors, opts, self } = it;
19253
19253
  const { RULES } = self;
19254
- if (schema11.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema11, RULES))) {
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)(schema11, group))
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: schema11, opts: { useDefaults } } = it;
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)(schema11, rule)) {
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 schema11;
19634
+ let schema12;
19635
19635
  if (typeof env2.schema == "object")
19636
- schema11 = env2.schema;
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)(schema11 === null || schema11 === void 0 ? void 0 : schema11[env2.schemaId || "$id"]);
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 = schema11 === null || schema11 === void 0 ? void 0 : schema11.$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 schema11 = (_a3 = root.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref];
19743
+ const schema12 = (_a3 = root.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref];
19744
19744
  const { schemaId } = this.opts;
19745
- if (schema11)
19746
- _sch = new SchemaEnv({ schema: schema11, schemaId, root, baseId });
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: schema11 } = schOrRef;
19794
+ const { schema: schema12 } = schOrRef;
19795
19795
  const { schemaId } = this.opts;
19796
- const schId = schema11[schemaId];
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: schema11, schemaId, root, baseId });
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: schema11, root }) {
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 schema11 === "boolean")
19816
+ if (typeof schema12 === "boolean")
19817
19817
  return;
19818
- const partSchema = schema11[(0, util_1.unescapeFragment)(part)];
19818
+ const partSchema = schema12[(0, util_1.unescapeFragment)(part)];
19819
19819
  if (partSchema === void 0)
19820
19820
  return;
19821
- schema11 = partSchema;
19822
- const schId = typeof schema11 === "object" && schema11[this.opts.schemaId];
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 schema11 != "boolean" && schema11.$ref && !(0, util_1.schemaHasRulesButRef)(schema11, this.RULES)) {
19829
- const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema11.$ref);
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: schema11, schemaId, root, baseId });
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(schema11, _meta) {
20856
- const sch = this._addSchema(schema11, _meta);
20855
+ compile(schema12, _meta) {
20856
+ const sch = this._addSchema(schema12, _meta);
20857
20857
  return sch.validate || this._compileSchemaEnv(sch);
20858
20858
  }
20859
- compileAsync(schema11, meta3) {
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, schema11, meta3);
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(schema11, key3, _meta, _validateSchema = this.opts.validateSchema) {
20911
- if (Array.isArray(schema11)) {
20912
- for (const sch of schema11)
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 schema11 === "object") {
20917
+ if (typeof schema12 === "object") {
20918
20918
  const { schemaId } = this.opts;
20919
- id = schema11[schemaId];
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(schema11, _meta, key3, _validateSchema, true);
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(schema11, key3, _validateSchema = this.opts.validateSchema) {
20932
- this.addSchema(schema11, key3, true, _validateSchema);
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(schema11, throwOrLogError) {
20937
- if (typeof schema11 == "boolean")
20936
+ validateSchema(schema12, throwOrLogError) {
20937
+ if (typeof schema12 == "boolean")
20938
20938
  return true;
20939
20939
  let $schema;
20940
- $schema = schema11.$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, schema11);
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 schema11 = keywords[key3];
21094
- if ($data && schema11)
21095
- keywords[key3] = schemaOrData(schema11);
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(schema11, meta3, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
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 schema11 == "object") {
21117
- id = schema11[schemaId];
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 schema11 != "boolean")
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(schema11);
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, schema11, baseId);
21129
- sch = new compile_1.SchemaEnv({ schema: schema11, schemaId, meta: meta3, baseId, localRefs });
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(schema11, true);
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(schema11) {
21292
- return { anyOf: [schema11, $dataRef] };
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: schema11, schemaCode, it } = cxt;
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, schema11);
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: schema11, schemaCode, data, $data, it } = cxt;
21658
+ const { gen, schema: schema12, schemaCode, data, $data, it } = cxt;
21659
21659
  const { opts } = it;
21660
- if (!$data && schema11.length === 0)
21660
+ if (!$data && schema12.length === 0)
21661
21661
  return;
21662
- const useLoop = schema11.length >= opts.loopRequired;
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 schema11) {
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 schema11) {
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, schema11, missing));
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: schema11, parentSchema, schemaCode, it } = cxt;
21782
- if (!$data && !schema11)
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: schema11 } = cxt;
21846
- if ($data || schema11 && typeof schema11 == "object") {
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._)`${schema11} !== ${data}`);
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: schema11, schemaCode, it } = cxt;
21876
- if (!$data && schema11.length === 0)
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 = schema11.length >= it.opts.loopEnum;
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(schema11))
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)(...schema11.map((_x, i) => equalCode(vSchema, i)));
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 = schema11[i];
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: schema11, data, keyword, it } = cxt;
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 (schema11 === false) {
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 schema11 == "object" && !(0, util_1.alwaysValidSchema)(it, schema11)) {
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: schema11, it } = cxt;
22013
- if (Array.isArray(schema11))
22014
- return validateTuple(cxt, "additionalItems", schema11);
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, schema11))
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: schema11, parentSchema, it } = cxt;
22091
+ const { schema: schema12, parentSchema, it } = cxt;
22092
22092
  const { prefixItems } = parentSchema;
22093
22093
  it.items = true;
22094
- if ((0, util_1.alwaysValidSchema)(it, schema11))
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: schema11, parentSchema, data, it } = cxt;
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, schema11)) {
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: schema11 }) {
22231
+ function splitDependencies({ schema: schema12 }) {
22232
22232
  const propertyDeps = {};
22233
22233
  const schemaDeps = {};
22234
- for (const key3 in schema11) {
22234
+ for (const key3 in schema12) {
22235
22235
  if (key3 === "__proto__")
22236
22236
  continue;
22237
- const deps = Array.isArray(schema11[key3]) ? propertyDeps : schemaDeps;
22238
- deps[key3] = schema11[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: schema11, data, it } = cxt;
22312
- if ((0, util_1.alwaysValidSchema)(it, schema11))
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: schema11, parentSchema, data, errsCount, it } = cxt;
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, schema11))
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 && schema11 === false) {
22396
+ if (opts.removeAdditional === "all" || opts.removeAdditional && schema12 === false) {
22397
22397
  deleteAdditional(key3);
22398
22398
  return;
22399
22399
  }
22400
- if (schema11 === false) {
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 schema11 == "object" && !(0, util_1.alwaysValidSchema)(it, schema11)) {
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: schema11, parentSchema, data, it } = cxt;
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)(schema11);
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, schema11[p]));
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 && schema11[prop].default !== void 0;
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: schema11, data, parentSchema, it } = cxt;
22515
+ const { gen, schema: schema12, data, parentSchema, it } = cxt;
22516
22516
  const { opts } = it;
22517
- const patterns = (0, code_1.allSchemaProperties)(schema11);
22518
- const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema11[p]));
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: schema11, it } = cxt;
22587
- if ((0, util_1.alwaysValidSchema)(it, schema11)) {
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: schema11, parentSchema, it } = cxt;
22641
- if (!Array.isArray(schema11))
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 = schema11;
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: schema11, it } = cxt;
22692
- if (!Array.isArray(schema11))
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
- schema11.forEach((sch, i) => {
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 schema11 = it.schema[keyword];
22771
- return schema11 !== void 0 && !(0, util_1.alwaysValidSchema)(it, schema11);
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: schema11, schemaCode, it } = cxt;
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[schema11];
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 "${schema11}" ignored in schema at path "${errSchemaPath}"`;
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)(schema11)}` : void 0;
22912
- const fmt = gen.scopeValue("formats", { key: schema11, ref: fmtDef, code });
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: schema11, parentSchema, it } = cxt;
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 = schema11.propertyName;
23028
+ const tagName = schema12.propertyName;
23029
23029
  if (typeof tagName != "string")
23030
23030
  throw new Error("discriminator: requires propertyName");
23031
- if (schema11.mapping)
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(schema11) {
25422
- return mergeDefs(schema11._zod.def);
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(schema11, mask) {
25645
- const currDef = schema11._zod.def;
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(schema11._zod.def, {
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(schema11, def);
25667
+ return clone(schema12, def);
25668
25668
  }
25669
- function omit(schema11, mask) {
25670
- const currDef = schema11._zod.def;
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(schema11._zod.def, {
25676
+ const def = mergeDefs(schema12._zod.def, {
25677
25677
  get shape() {
25678
- const newShape = { ...schema11._zod.def.shape };
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(schema11, def);
25692
+ return clone(schema12, def);
25693
25693
  }
25694
- function extend(schema11, shape) {
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 = schema11._zod.def.checks;
25698
+ const checks = schema12._zod.def.checks;
25699
25699
  const hasChecks = checks && checks.length > 0;
25700
25700
  if (hasChecks) {
25701
- const existingShape = schema11._zod.def.shape;
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(schema11._zod.def, {
25708
+ const def = mergeDefs(schema12._zod.def, {
25709
25709
  get shape() {
25710
- const _shape = { ...schema11._zod.def.shape, ...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(schema11, def);
25715
+ return clone(schema12, def);
25716
25716
  }
25717
- function safeExtend(schema11, shape) {
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(schema11._zod.def, {
25721
+ const def = mergeDefs(schema12._zod.def, {
25722
25722
  get shape() {
25723
- const _shape = { ...schema11._zod.def.shape, ...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(schema11, def);
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, schema11, mask) {
25748
- const currDef = schema11._zod.def;
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(schema11._zod.def, {
25754
+ const def = mergeDefs(schema12._zod.def, {
25755
25755
  get shape() {
25756
- const oldShape = schema11._zod.def.shape;
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(schema11, def);
25783
+ return clone(schema12, def);
25784
25784
  }
25785
- function required(Class2, schema11, mask) {
25786
- const def = mergeDefs(schema11._zod.def, {
25785
+ function required(Class2, schema12, mask) {
25786
+ const def = mergeDefs(schema12._zod.def, {
25787
25787
  get shape() {
25788
- const oldShape = schema11._zod.def.shape;
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(schema11, def);
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) => (schema11, value, _ctx, _params) => {
26093
+ var _parse = (_Err) => (schema12, value, _ctx, _params) => {
26094
26094
  const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
26095
- const result = schema11._zod.run({ value, issues: [] }, ctx);
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 (schema11, value, _ctx, params3) => {
26107
+ var _parseAsync = (_Err) => async (schema12, value, _ctx, params3) => {
26108
26108
  const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
26109
- let result = schema11._zod.run({ value, issues: [] }, ctx);
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) => (schema11, value, _ctx) => {
26120
+ var _safeParse = (_Err) => (schema12, value, _ctx) => {
26121
26121
  const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
26122
- const result = schema11._zod.run({ value, issues: [] }, ctx);
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 (schema11, value, _ctx) => {
26132
+ var _safeParseAsync = (_Err) => async (schema12, value, _ctx) => {
26133
26133
  const ctx = _ctx ? { ..._ctx, async: true } : { async: true };
26134
- let result = schema11._zod.run({ value, issues: [] }, ctx);
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) => (schema11, value, _ctx) => {
26143
+ var _encode = (_Err) => (schema12, value, _ctx) => {
26144
26144
  const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
26145
- return _parse(_Err)(schema11, value, ctx);
26145
+ return _parse(_Err)(schema12, value, ctx);
26146
26146
  };
26147
26147
  var encode = /* @__PURE__ */ _encode($ZodRealError);
26148
- var _decode = (_Err) => (schema11, value, _ctx) => {
26149
- return _parse(_Err)(schema11, value, _ctx);
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 (schema11, value, _ctx) => {
26152
+ var _encodeAsync = (_Err) => async (schema12, value, _ctx) => {
26153
26153
  const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
26154
- return _parseAsync(_Err)(schema11, value, ctx);
26154
+ return _parseAsync(_Err)(schema12, value, ctx);
26155
26155
  };
26156
26156
  var encodeAsync = /* @__PURE__ */ _encodeAsync($ZodRealError);
26157
- var _decodeAsync = (_Err) => async (schema11, value, _ctx) => {
26158
- return _parseAsync(_Err)(schema11, value, _ctx);
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) => (schema11, value, _ctx) => {
26161
+ var _safeEncode = (_Err) => (schema12, value, _ctx) => {
26162
26162
  const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
26163
- return _safeParse(_Err)(schema11, value, ctx);
26163
+ return _safeParse(_Err)(schema12, value, ctx);
26164
26164
  };
26165
26165
  var safeEncode = /* @__PURE__ */ _safeEncode($ZodRealError);
26166
- var _safeDecode = (_Err) => (schema11, value, _ctx) => {
26167
- return _safeParse(_Err)(schema11, value, _ctx);
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 (schema11, value, _ctx) => {
26170
+ var _safeEncodeAsync = (_Err) => async (schema12, value, _ctx) => {
26171
26171
  const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
26172
- return _safeParseAsync(_Err)(schema11, value, ctx);
26172
+ return _safeParseAsync(_Err)(schema12, value, ctx);
26173
26173
  };
26174
26174
  var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync($ZodRealError);
26175
- var _safeDecodeAsync = (_Err) => async (schema11, value, _ctx) => {
26176
- return _safeParseAsync(_Err)(schema11, value, _ctx);
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 schema11 = shape[key3];
27753
- const isOptionalIn = schema11?._zod?.optin === "optional";
27754
- const isOptionalOut = schema11?._zod?.optout === "optional";
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(schema11, ..._meta) {
34987
+ add(schema12, ..._meta) {
34988
34988
  const meta3 = _meta[0];
34989
- this._map.set(schema11, meta3);
34989
+ this._map.set(schema12, meta3);
34990
34990
  if (meta3 && typeof meta3 === "object" && "id" in meta3) {
34991
- this._idmap.set(meta3.id, schema11);
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(schema11) {
35001
- const meta3 = this._map.get(schema11);
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(schema11);
35005
+ this._map.delete(schema12);
35006
35006
  return this;
35007
35007
  }
35008
- get(schema11) {
35009
- const p = schema11._zod.parent;
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(schema11) };
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(schema11);
35016
+ return this._map.get(schema12);
35017
35017
  }
35018
- has(schema11) {
35019
- return this._map.has(schema11);
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, schema11, params3) {
35672
+ function _property(property, schema12, params3) {
35673
35673
  return new $ZodCheckProperty({
35674
35674
  check: "property",
35675
35675
  property,
35676
- schema: schema11,
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 schema11 = new Class2({
35924
+ const schema12 = new Class2({
35925
35925
  type: "custom",
35926
35926
  check: "custom",
35927
35927
  fn,
35928
35928
  ...norm2
35929
35929
  });
35930
- return schema11;
35930
+ return schema12;
35931
35931
  }
35932
35932
  // @__NO_SIDE_EFFECTS__
35933
35933
  function _refine(Class2, fn, _params) {
35934
- const schema11 = new Class2({
35934
+ const schema12 = new Class2({
35935
35935
  type: "custom",
35936
35936
  check: "custom",
35937
35937
  fn,
35938
35938
  ...normalizeParams(_params)
35939
35939
  });
35940
- return schema11;
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(schema11, ctx, _params = { path: [], schemaPath: [] }) {
36089
+ function process2(schema12, ctx, _params = { path: [], schemaPath: [] }) {
36090
36090
  var _a3;
36091
- const def = schema11._zod.def;
36092
- const seen = ctx.seen.get(schema11);
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(schema11);
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(schema11, result);
36103
- const overrideSchema = schema11._zod.toJSONSchema?.();
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, schema11],
36109
+ schemaPath: [..._params.schemaPath, schema12],
36110
36110
  path: _params.path
36111
36111
  };
36112
- if (schema11._zod.processJSONSchema) {
36113
- schema11._zod.processJSONSchema(ctx, result.schema, params3);
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(schema11, ctx, _json, params3);
36120
+ processor(schema12, ctx, _json, params3);
36121
36121
  }
36122
- const parent = schema11._zod.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(schema11);
36130
+ const meta3 = ctx.metadataRegistry.get(schema12);
36131
36131
  if (meta3)
36132
36132
  Object.assign(result.schema, meta3);
36133
- if (ctx.io === "input" && isTransforming(schema11)) {
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(schema11);
36140
+ const _result = ctx.seen.get(schema12);
36141
36141
  return _result.schema;
36142
36142
  }
36143
- function extractDefs(ctx, schema11) {
36144
- const root = ctx.seen.get(schema11);
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 schema12 = seen.schema;
36188
- for (const key3 in schema12) {
36189
- delete schema12[key3];
36187
+ const schema13 = seen.schema;
36188
+ for (const key3 in schema13) {
36189
+ delete schema13[key3];
36190
36190
  }
36191
- schema12.$ref = ref;
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 (schema11 === entry[0]) {
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 (schema11 !== entry[0] && ext) {
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, schema11) {
36234
- const root = ctx.seen.get(schema11);
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 schema12 = seen.def ?? seen.schema;
36242
- const _cached = { ...schema12 };
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
- schema12.allOf = schema12.allOf ?? [];
36251
- schema12.allOf.push(refSchema);
36250
+ schema13.allOf = schema13.allOf ?? [];
36251
+ schema13.allOf.push(refSchema);
36252
36252
  } else {
36253
- Object.assign(schema12, refSchema);
36253
+ Object.assign(schema13, refSchema);
36254
36254
  }
36255
- Object.assign(schema12, _cached);
36255
+ Object.assign(schema13, _cached);
36256
36256
  const isParentRef = zodSchema._zod.parent === ref;
36257
36257
  if (isParentRef) {
36258
- for (const key3 in schema12) {
36258
+ for (const key3 in schema13) {
36259
36259
  if (key3 === "$ref" || key3 === "allOf")
36260
36260
  continue;
36261
36261
  if (!(key3 in _cached)) {
36262
- delete schema12[key3];
36262
+ delete schema13[key3];
36263
36263
  }
36264
36264
  }
36265
36265
  }
36266
36266
  if (refSchema.$ref && refSeen.def) {
36267
- for (const key3 in schema12) {
36267
+ for (const key3 in schema13) {
36268
36268
  if (key3 === "$ref" || key3 === "allOf")
36269
36269
  continue;
36270
- if (key3 in refSeen.def && JSON.stringify(schema12[key3]) === JSON.stringify(refSeen.def[key3])) {
36271
- delete schema12[key3];
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
- schema12.$ref = parentSeen.schema.$ref;
36281
+ schema13.$ref = parentSeen.schema.$ref;
36282
36282
  if (parentSeen.def) {
36283
- for (const key3 in schema12) {
36283
+ for (const key3 in schema13) {
36284
36284
  if (key3 === "$ref" || key3 === "allOf")
36285
36285
  continue;
36286
- if (key3 in parentSeen.def && JSON.stringify(schema12[key3]) === JSON.stringify(parentSeen.def[key3])) {
36287
- delete schema12[key3];
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: schema12,
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(schema11)?.id;
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(schema11)?.id;
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
- ...schema11["~standard"],
36345
+ ...schema12["~standard"],
36346
36346
  jsonSchema: {
36347
- input: createStandardJSONSchemaMethod(schema11, "input", ctx.processors),
36348
- output: createStandardJSONSchemaMethod(schema11, "output", ctx.processors)
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 = (schema11, processors = {}) => (params3) => {
36412
+ var createToJSONSchemaMethod = (schema12, processors = {}) => (params3) => {
36413
36413
  const ctx = initializeContext({ ...params3, processors });
36414
- process2(schema11, ctx);
36415
- extractDefs(ctx, schema11);
36416
- return finalize(ctx, schema11);
36414
+ process2(schema12, ctx);
36415
+ extractDefs(ctx, schema12);
36416
+ return finalize(ctx, schema12);
36417
36417
  };
36418
- var createStandardJSONSchemaMethod = (schema11, io, processors = {}) => (params3) => {
36418
+ var createStandardJSONSchemaMethod = (schema12, io, processors = {}) => (params3) => {
36419
36419
  const { libraryOptions, target } = params3 ?? {};
36420
36420
  const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
36421
- process2(schema11, ctx);
36422
- extractDefs(ctx, schema11);
36423
- return finalize(ctx, schema11);
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 = (schema11, ctx, _json, _params) => {
36435
+ var stringProcessor = (schema12, ctx, _json, _params) => {
36436
36436
  const json2 = _json;
36437
36437
  json2.type = "string";
36438
- const { minimum, maximum, format, patterns, contentEncoding } = schema11._zod.bag;
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 = (schema11, ctx, _json, _params) => {
36467
+ var numberProcessor = (schema12, ctx, _json, _params) => {
36468
36468
  const json2 = _json;
36469
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema11._zod.bag;
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 = (schema11, _ctx, json2, _params) => {
36545
- const def = schema11._zod.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 = (schema11, ctx, json2, _params) => {
36554
- const def = schema11._zod.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 = (schema11, _ctx, json2, _params) => {
36598
+ var templateLiteralProcessor = (schema12, _ctx, json2, _params) => {
36599
36599
  const _json = json2;
36600
- const pattern = schema11._zod.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 = (schema11, _ctx, json2, _params) => {
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 } = schema11._zod.bag;
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 = (schema11, ctx, _json, params3) => {
36658
+ var arrayProcessor = (schema12, ctx, _json, params3) => {
36659
36659
  const json2 = _json;
36660
- const def = schema11._zod.def;
36661
- const { minimum, maximum } = schema11._zod.bag;
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 = (schema11, ctx, _json, params3) => {
36672
+ var objectProcessor = (schema12, ctx, _json, params3) => {
36673
36673
  const json2 = _json;
36674
- const def = schema11._zod.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 = (schema11, ctx, json2, params3) => {
36709
- const def = schema11._zod.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 = (schema11, ctx, json2, params3) => {
36722
- const def = schema11._zod.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 = (schema11, ctx, _json, params3) => {
36738
+ var tupleProcessor = (schema12, ctx, _json, params3) => {
36739
36739
  const json2 = _json;
36740
- const def = schema11._zod.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 } = schema11._zod.bag;
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 = (schema11, ctx, _json, params3) => {
36780
+ var recordProcessor = (schema12, ctx, _json, params3) => {
36781
36781
  const json2 = _json;
36782
- const def = schema11._zod.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 = (schema11, ctx, json2, params3) => {
36817
- const def = schema11._zod.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(schema11);
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 = (schema11, ctx, _json, params3) => {
36828
- const def = schema11._zod.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(schema11);
36830
+ const seen = ctx.seen.get(schema12);
36831
36831
  seen.ref = def.innerType;
36832
36832
  };
36833
- var defaultProcessor = (schema11, ctx, json2, params3) => {
36834
- const def = schema11._zod.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(schema11);
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 = (schema11, ctx, json2, params3) => {
36841
- const def = schema11._zod.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(schema11);
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 = (schema11, ctx, json2, params3) => {
36849
- const def = schema11._zod.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(schema11);
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 = (schema11, ctx, _json, params3) => {
36862
- const def = schema11._zod.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(schema11);
36866
+ const seen = ctx.seen.get(schema12);
36867
36867
  seen.ref = innerType;
36868
36868
  };
36869
- var readonlyProcessor = (schema11, ctx, json2, params3) => {
36870
- const def = schema11._zod.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(schema11);
36872
+ const seen = ctx.seen.get(schema12);
36873
36873
  seen.ref = def.innerType;
36874
36874
  json2.readOnly = true;
36875
36875
  };
36876
- var promiseProcessor = (schema11, ctx, _json, params3) => {
36877
- const def = schema11._zod.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(schema11);
36879
+ const seen = ctx.seen.get(schema12);
36880
36880
  seen.ref = def.innerType;
36881
36881
  };
36882
- var optionalProcessor = (schema11, ctx, _json, params3) => {
36883
- const def = schema11._zod.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(schema11);
36885
+ const seen = ctx.seen.get(schema12);
36886
36886
  seen.ref = def.innerType;
36887
36887
  };
36888
- var lazyProcessor = (schema11, ctx, _json, params3) => {
36889
- const innerType = schema11._zod.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(schema11);
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 [_, schema11] = entry;
36942
- process2(schema11, ctx2);
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, schema11] = entry;
36953
- extractDefs(ctx2, schema11);
36954
- schemas[key3] = finalize(ctx2, schema11);
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(schema11, _params = { path: [], schemaPath: [] }) {
37023
- return process2(schema11, this.ctx, _params);
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(schema11, _params) {
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, schema11);
37039
- const result = finalize(this.ctx, schema11);
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(schema11) {
38005
- const shape = schema11._zod.def.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, schema11) {
38630
+ function preprocess(fn, schema12) {
38631
38631
  return new ZodPreprocess({
38632
38632
  type: "pipe",
38633
38633
  in: transform(fn),
38634
- out: schema11
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(schema11, defaultTarget) {
38742
- const $schema = schema11.$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(schema11, ctx) {
38773
- if (schema11.not !== void 0) {
38774
- if (typeof schema11.not === "object" && Object.keys(schema11.not).length === 0) {
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 (schema11.unevaluatedItems !== void 0) {
38779
+ if (schema12.unevaluatedItems !== void 0) {
38780
38780
  throw new Error("unevaluatedItems is not supported");
38781
38781
  }
38782
- if (schema11.unevaluatedProperties !== void 0) {
38782
+ if (schema12.unevaluatedProperties !== void 0) {
38783
38783
  throw new Error("unevaluatedProperties is not supported");
38784
38784
  }
38785
- if (schema11.if !== void 0 || schema11.then !== void 0 || schema11.else !== void 0) {
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 (schema11.dependentSchemas !== void 0 || schema11.dependentRequired !== void 0) {
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 (schema11.$ref) {
38792
- const refPath = schema11.$ref;
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 (schema11.enum !== void 0) {
38812
- const enumValues = schema11.enum;
38813
- if (ctx.version === "openapi-3.0" && schema11.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
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 (schema11.const !== void 0) {
38832
- return z.literal(schema11.const);
38831
+ if (schema12.const !== void 0) {
38832
+ return z.literal(schema12.const);
38833
38833
  }
38834
- const type = schema11.type;
38834
+ const type = schema12.type;
38835
38835
  if (Array.isArray(type)) {
38836
38836
  const typeSchemas = type.map((t) => {
38837
- const typeSchema = { ...schema11, type: t };
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 (schema11.format) {
38856
- const format = schema11.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 schema11.minLength === "number") {
38906
- stringSchema = stringSchema.min(schema11.minLength);
38905
+ if (typeof schema12.minLength === "number") {
38906
+ stringSchema = stringSchema.min(schema12.minLength);
38907
38907
  }
38908
- if (typeof schema11.maxLength === "number") {
38909
- stringSchema = stringSchema.max(schema11.maxLength);
38908
+ if (typeof schema12.maxLength === "number") {
38909
+ stringSchema = stringSchema.max(schema12.maxLength);
38910
38910
  }
38911
- if (schema11.pattern) {
38912
- stringSchema = stringSchema.regex(new RegExp(schema11.pattern));
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 schema11.minimum === "number") {
38921
- numberSchema = numberSchema.min(schema11.minimum);
38920
+ if (typeof schema12.minimum === "number") {
38921
+ numberSchema = numberSchema.min(schema12.minimum);
38922
38922
  }
38923
- if (typeof schema11.maximum === "number") {
38924
- numberSchema = numberSchema.max(schema11.maximum);
38923
+ if (typeof schema12.maximum === "number") {
38924
+ numberSchema = numberSchema.max(schema12.maximum);
38925
38925
  }
38926
- if (typeof schema11.exclusiveMinimum === "number") {
38927
- numberSchema = numberSchema.gt(schema11.exclusiveMinimum);
38928
- } else if (schema11.exclusiveMinimum === true && typeof schema11.minimum === "number") {
38929
- numberSchema = numberSchema.gt(schema11.minimum);
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 schema11.exclusiveMaximum === "number") {
38932
- numberSchema = numberSchema.lt(schema11.exclusiveMaximum);
38933
- } else if (schema11.exclusiveMaximum === true && typeof schema11.maximum === "number") {
38934
- numberSchema = numberSchema.lt(schema11.maximum);
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 schema11.multipleOf === "number") {
38937
- numberSchema = numberSchema.multipleOf(schema11.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 = schema11.properties || {};
38953
- const requiredSet = new Set(schema11.required || []);
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 (schema11.propertyNames) {
38959
- const keySchema2 = convertSchema(schema11.propertyNames, ctx);
38960
- const valueSchema = schema11.additionalProperties && typeof schema11.additionalProperties === "object" ? convertSchema(schema11.additionalProperties, ctx) : z.any();
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 (schema11.patternProperties) {
38971
- const patternProps = schema11.patternProperties;
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 (schema11.additionalProperties === false) {
38998
+ if (schema12.additionalProperties === false) {
38999
38999
  zodSchema = objectSchema.strict();
39000
- } else if (typeof schema11.additionalProperties === "object") {
39001
- zodSchema = objectSchema.catchall(convertSchema(schema11.additionalProperties, ctx));
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 = schema11.prefixItems;
39009
- const items = schema11.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 schema11.minItems === "number") {
39019
- zodSchema = zodSchema.check(z.minLength(schema11.minItems));
39018
+ if (typeof schema12.minItems === "number") {
39019
+ zodSchema = zodSchema.check(z.minLength(schema12.minItems));
39020
39020
  }
39021
- if (typeof schema11.maxItems === "number") {
39022
- zodSchema = zodSchema.check(z.maxLength(schema11.maxItems));
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 = schema11.additionalItems && typeof schema11.additionalItems === "object" ? convertSchema(schema11.additionalItems, ctx) : void 0;
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 schema11.minItems === "number") {
39033
- zodSchema = zodSchema.check(z.minLength(schema11.minItems));
39032
+ if (typeof schema12.minItems === "number") {
39033
+ zodSchema = zodSchema.check(z.minLength(schema12.minItems));
39034
39034
  }
39035
- if (typeof schema11.maxItems === "number") {
39036
- zodSchema = zodSchema.check(z.maxLength(schema11.maxItems));
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 schema11.minItems === "number") {
39042
- arraySchema = arraySchema.min(schema11.minItems);
39041
+ if (typeof schema12.minItems === "number") {
39042
+ arraySchema = arraySchema.min(schema12.minItems);
39043
39043
  }
39044
- if (typeof schema11.maxItems === "number") {
39045
- arraySchema = arraySchema.max(schema11.maxItems);
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(schema11, ctx) {
39059
- if (typeof schema11 === "boolean") {
39060
- return schema11 ? z.any() : z.never();
39058
+ function convertSchema(schema12, ctx) {
39059
+ if (typeof schema12 === "boolean") {
39060
+ return schema12 ? z.any() : z.never();
39061
39061
  }
39062
- let baseSchema = convertBaseSchema(schema11, ctx);
39063
- const hasExplicitType = schema11.type || schema11.enum !== void 0 || schema11.const !== void 0;
39064
- if (schema11.anyOf && Array.isArray(schema11.anyOf)) {
39065
- const options = schema11.anyOf.map((s) => convertSchema(s, ctx));
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 (schema11.oneOf && Array.isArray(schema11.oneOf)) {
39070
- const options = schema11.oneOf.map((s) => convertSchema(s, ctx));
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 (schema11.allOf && Array.isArray(schema11.allOf)) {
39075
- if (schema11.allOf.length === 0) {
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(schema11.allOf[0], ctx);
39078
+ let result = hasExplicitType ? baseSchema : convertSchema(schema12.allOf[0], ctx);
39079
39079
  const startIdx = hasExplicitType ? 0 : 1;
39080
- for (let i = startIdx; i < schema11.allOf.length; i++) {
39081
- result = z.intersection(result, convertSchema(schema11.allOf[i], ctx));
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 (schema11.nullable === true && ctx.version === "openapi-3.0") {
39086
+ if (schema12.nullable === true && ctx.version === "openapi-3.0") {
39087
39087
  baseSchema = z.nullable(baseSchema);
39088
39088
  }
39089
- if (schema11.readOnly === true) {
39089
+ if (schema12.readOnly === true) {
39090
39090
  baseSchema = z.readonly(baseSchema);
39091
39091
  }
39092
- if (schema11.default !== void 0) {
39093
- baseSchema = baseSchema.default(schema11.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 schema11) {
39099
- extraMeta[key3] = schema11[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 schema11) {
39105
- extraMeta[key3] = schema11[key3];
39104
+ if (key3 in schema12) {
39105
+ extraMeta[key3] = schema12[key3];
39106
39106
  }
39107
39107
  }
39108
- for (const key3 of Object.keys(schema11)) {
39108
+ for (const key3 of Object.keys(schema12)) {
39109
39109
  if (!RECOGNIZED_KEYS.has(key3)) {
39110
- extraMeta[key3] = schema11[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 (schema11.description) {
39117
- baseSchema = baseSchema.describe(schema11.description);
39116
+ if (schema12.description) {
39117
+ baseSchema = baseSchema.describe(schema12.description);
39118
39118
  }
39119
39119
  return baseSchema;
39120
39120
  }
39121
- function fromJSONSchema(schema11, params3) {
39122
- if (typeof schema11 === "boolean") {
39123
- return schema11 ? z.any() : z.never();
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(schema11));
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
  }
@@ -43337,13 +43337,13 @@ var GEMINI_UNSUPPORTED = /* @__PURE__ */ new Set([
43337
43337
  function isRecord(value) {
43338
43338
  return typeof value === "object" && value !== null && !Array.isArray(value);
43339
43339
  }
43340
- function pruneSchema(schema11, keep) {
43341
- if (Array.isArray(schema11))
43342
- return schema11.map((entry) => pruneSchema(entry, keep));
43343
- if (!isRecord(schema11))
43344
- return schema11;
43340
+ function pruneSchema(schema12, keep) {
43341
+ if (Array.isArray(schema12))
43342
+ return schema12.map((entry) => pruneSchema(entry, keep));
43343
+ if (!isRecord(schema12))
43344
+ return schema12;
43345
43345
  const result = {};
43346
- for (const [key3, value] of Object.entries(schema11)) {
43346
+ for (const [key3, value] of Object.entries(schema12)) {
43347
43347
  if (!keep(key3))
43348
43348
  continue;
43349
43349
  if (key3 === "properties" && isRecord(value)) {
@@ -43460,12 +43460,12 @@ function restoreAt(value, path65, kind) {
43460
43460
  }
43461
43461
  var SCALARS = /* @__PURE__ */ new Set(["string", "number", "integer", "boolean"]);
43462
43462
  var MAX_DEPTH = 12;
43463
- function convert(schema11, root, path65, found2, depth, isRoot = false) {
43464
- if (!isRecord2(schema11))
43463
+ function convert(schema12, root, path65, found2, depth, isRoot = false) {
43464
+ if (!isRecord2(schema12))
43465
43465
  return { type: "string" };
43466
43466
  if (depth > MAX_DEPTH)
43467
- return asJsonString(schema11, path65, found2, "nested too deeply to describe here");
43468
- let node = { ...schema11 };
43467
+ return asJsonString(schema12, path65, found2, "nested too deeply to describe here");
43468
+ let node = { ...schema12 };
43469
43469
  if (typeof node.$ref === "string") {
43470
43470
  const target = resolveRef2(node.$ref, root);
43471
43471
  if (target === void 0)
@@ -46876,6 +46876,101 @@ ${BUDGET_ADVICE}` : base;
46876
46876
  ].join("\n");
46877
46877
  }
46878
46878
 
46879
+ // ../../packages/core/dist/agents/codebaseAgents.js
46880
+ var MAX_DEPTH2 = 3;
46881
+ var DEFAULT_MINUTES = 30;
46882
+ var schema = external_exports.object({
46883
+ codebase: external_exports.string().min(1).describe("The other codebase, by its name as listed in this tool's description."),
46884
+ 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."),
46885
+ timeoutMinutes: external_exports.number().int().min(1).max(120).optional().describe(`How long to wait for the answer (default ${String(DEFAULT_MINUTES)}).`)
46886
+ });
46887
+ function createAskCodebaseAgentTool(options) {
46888
+ const names = options.codebases.map((codebase) => `"${codebase.name}"`).join(", ");
46889
+ return {
46890
+ name: "ask_codebase_agent",
46891
+ group: "command",
46892
+ 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.`,
46893
+ parametersSchema: schema,
46894
+ async preview(params3) {
46895
+ return {
46896
+ kind: "text",
46897
+ 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:
46898
+
46899
+ ${params3.request}`
46900
+ };
46901
+ },
46902
+ async execute(params3, context) {
46903
+ const depth = options.depth() + 1;
46904
+ if (depth > MAX_DEPTH2) {
46905
+ return {
46906
+ 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.`,
46907
+ isError: true
46908
+ };
46909
+ }
46910
+ try {
46911
+ const reply = await options.channel.ask(params3.codebase, params3.request, {
46912
+ timeoutMs: (params3.timeoutMinutes ?? DEFAULT_MINUTES) * 6e4,
46913
+ depth,
46914
+ ...context.signal !== void 0 ? { signal: context.signal } : {}
46915
+ });
46916
+ const where = reply.chat !== void 0 ? ` (its chat "${reply.chat}")` : "";
46917
+ if (!reply.ok)
46918
+ return { content: `The agent in "${params3.codebase}"${where} could not answer: ${reply.text}`, isError: true };
46919
+ return { content: `The agent in "${params3.codebase}"${where} answered:
46920
+
46921
+ ${reply.text}` };
46922
+ } catch (error51) {
46923
+ const message5 = error51 instanceof Error ? error51.message : String(error51);
46924
+ return { content: `No answer from "${params3.codebase}": ${message5}`, isError: true };
46925
+ }
46926
+ }
46927
+ };
46928
+ }
46929
+ function composeTaskMessage(task) {
46930
+ return [
46931
+ `**A request from the agent working in codebase "${task.from}".** It is waiting for your answer; the user can see this chat.`,
46932
+ "",
46933
+ task.message,
46934
+ "",
46935
+ "---",
46936
+ "Work on it here with your own tools, as you would for the user. When you are done, call attempt_completion: its result",
46937
+ "is sent back to that agent, so make it the complete answer - what you found or changed, and anything it must do on its",
46938
+ "side. If you need the user's decision, ask with ask_followup_question; the other agent is told you are waiting."
46939
+ ].join("\n");
46940
+ }
46941
+ function answerFromConversation(messages) {
46942
+ for (let i = messages.length - 1; i >= 0; i -= 1) {
46943
+ const message5 = messages[i];
46944
+ if (message5 === void 0 || message5.role !== "assistant")
46945
+ continue;
46946
+ for (const call of message5.toolCalls ?? []) {
46947
+ const args = parseArgs(call.arguments);
46948
+ if (call.name === "attempt_completion" && typeof args.result === "string")
46949
+ return { ok: true, text: args.result };
46950
+ if (call.name === "ask_followup_question" && typeof args.question === "string") {
46951
+ return {
46952
+ ok: true,
46953
+ text: `It stopped to ask the user: ${args.question}
46954
+
46955
+ (It is waiting for an answer in its tab; the user can reply there, and that work continues there - not here.)`,
46956
+ waiting: true
46957
+ };
46958
+ }
46959
+ }
46960
+ if (message5.content.trim().length > 0)
46961
+ return { ok: true, text: message5.content.trim() };
46962
+ }
46963
+ return { ok: false, text: "Its turn ended without an answer (stopped, or it failed - see its tab)." };
46964
+ }
46965
+ function parseArgs(raw) {
46966
+ try {
46967
+ const parsed = JSON.parse(raw.length > 0 ? raw : "{}");
46968
+ return typeof parsed === "object" && parsed !== null ? parsed : {};
46969
+ } catch {
46970
+ return {};
46971
+ }
46972
+ }
46973
+
46879
46974
  // ../../packages/core/dist/agents/briefing.js
46880
46975
  var DESCRIPTION_LIMIT = 110;
46881
46976
  function firstLine2(text2, limit = DESCRIPTION_LIMIT) {
@@ -53517,17 +53612,17 @@ var WHY_SCHEMA = {
53517
53612
  type: "string",
53518
53613
  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
53614
  };
53520
- function withWhy(schema11) {
53521
- if (typeof schema11 !== "object" || schema11 === null || Array.isArray(schema11))
53522
- return schema11;
53523
- const record2 = schema11;
53615
+ function withWhy(schema12) {
53616
+ if (typeof schema12 !== "object" || schema12 === null || Array.isArray(schema12))
53617
+ return schema12;
53618
+ const record2 = schema12;
53524
53619
  if (record2.type !== "object")
53525
- return schema11;
53620
+ return schema12;
53526
53621
  const properties = record2.properties;
53527
53622
  if (properties !== void 0 && (typeof properties !== "object" || properties === null))
53528
- return schema11;
53623
+ return schema12;
53529
53624
  if (properties !== void 0 && WHY_PARAMETER in properties)
53530
- return schema11;
53625
+ return schema12;
53531
53626
  return {
53532
53627
  ...record2,
53533
53628
  properties: { ...properties ?? {}, [WHY_PARAMETER]: WHY_SCHEMA }
@@ -53550,6 +53645,8 @@ function toToolDefinitions(tools) {
53550
53645
 
53551
53646
  // ../../packages/core/dist/schedule/runner.js
53552
53647
  var NEVER_AVAILABLE_TO_SCHEDULES = [
53648
+ // Another codebase's agent asks for its own approvals in its own tab - nobody is there to give them at 3am.
53649
+ "ask_codebase_agent",
53553
53650
  // A run rewriting the contracts it is checked against would be bound by nothing (the plan's reasoning).
53554
53651
  "set_strategy_contracts",
53555
53652
  // Mass copies and moves need a person reading the plan; an unattended run has none.
@@ -54365,27 +54462,27 @@ function createPlanProgressTool(access) {
54365
54462
 
54366
54463
  // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1_ed45788dfbfe808cc09dd7daea6bd385/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
54367
54464
  function isZ4Schema(s) {
54368
- const schema11 = s;
54369
- return !!schema11._zod;
54465
+ const schema12 = s;
54466
+ return !!schema12._zod;
54370
54467
  }
54371
- function safeParse3(schema11, data) {
54372
- if (isZ4Schema(schema11)) {
54373
- const result2 = safeParse(schema11, data);
54468
+ function safeParse3(schema12, data) {
54469
+ if (isZ4Schema(schema12)) {
54470
+ const result2 = safeParse(schema12, data);
54374
54471
  return result2;
54375
54472
  }
54376
- const v3Schema = schema11;
54473
+ const v3Schema = schema12;
54377
54474
  const result = v3Schema.safeParse(data);
54378
54475
  return result;
54379
54476
  }
54380
- function getObjectShape(schema11) {
54381
- if (!schema11)
54477
+ function getObjectShape(schema12) {
54478
+ if (!schema12)
54382
54479
  return void 0;
54383
54480
  let rawShape;
54384
- if (isZ4Schema(schema11)) {
54385
- const v4Schema = schema11;
54481
+ if (isZ4Schema(schema12)) {
54482
+ const v4Schema = schema12;
54386
54483
  rawShape = v4Schema._zod?.def?.shape;
54387
54484
  } else {
54388
- const v3Schema = schema11;
54485
+ const v3Schema = schema12;
54389
54486
  rawShape = v3Schema.shape;
54390
54487
  }
54391
54488
  if (!rawShape)
@@ -54399,9 +54496,9 @@ function getObjectShape(schema11) {
54399
54496
  }
54400
54497
  return rawShape;
54401
54498
  }
54402
- function getLiteralValue(schema11) {
54403
- if (isZ4Schema(schema11)) {
54404
- const v4Schema = schema11;
54499
+ function getLiteralValue(schema12) {
54500
+ if (isZ4Schema(schema12)) {
54501
+ const v4Schema = schema12;
54405
54502
  const def2 = v4Schema._zod?.def;
54406
54503
  if (def2) {
54407
54504
  if (def2.value !== void 0)
@@ -54411,7 +54508,7 @@ function getLiteralValue(schema11) {
54411
54508
  }
54412
54509
  }
54413
54510
  }
54414
- const v3Schema = schema11;
54511
+ const v3Schema = schema12;
54415
54512
  const def = v3Schema._def;
54416
54513
  if (def) {
54417
54514
  if (def.value !== void 0)
@@ -54420,7 +54517,7 @@ function getLiteralValue(schema11) {
54420
54517
  return def.values[0];
54421
54518
  }
54422
54519
  }
54423
- const directValue = schema11.value;
54520
+ const directValue = schema12.value;
54424
54521
  if (directValue !== void 0)
54425
54522
  return directValue;
54426
54523
  return void 0;
@@ -55955,8 +56052,8 @@ function isTerminal(status2) {
55955
56052
  var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
55956
56053
 
55957
56054
  // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1_ed45788dfbfe808cc09dd7daea6bd385/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
55958
- function getMethodLiteral(schema11) {
55959
- const shape = getObjectShape(schema11);
56055
+ function getMethodLiteral(schema12) {
56056
+ const shape = getObjectShape(schema12);
55960
56057
  const methodSchema = shape?.method;
55961
56058
  if (!methodSchema) {
55962
56059
  throw new Error("Schema is missing a method literal");
@@ -55967,8 +56064,8 @@ function getMethodLiteral(schema11) {
55967
56064
  }
55968
56065
  return value;
55969
56066
  }
55970
- function parseWithCompat(schema11, data) {
55971
- const result = safeParse3(schema11, data);
56067
+ function parseWithCompat(schema12, data) {
56068
+ const result = safeParse3(schema12, data);
55972
56069
  if (!result.success) {
55973
56070
  throw result.error;
55974
56071
  }
@@ -56976,8 +57073,8 @@ var AjvJsonSchemaValidator = class {
56976
57073
  * @param schema - Standard JSON Schema object
56977
57074
  * @returns A validator function that validates input data
56978
57075
  */
56979
- getValidator(schema11) {
56980
- const ajvValidator = "$id" in schema11 && typeof schema11.$id === "string" ? this._ajv.getSchema(schema11.$id) ?? this._ajv.compile(schema11) : this._ajv.compile(schema11);
57076
+ getValidator(schema12) {
57077
+ const ajvValidator = "$id" in schema12 && typeof schema12.$id === "string" ? this._ajv.getSchema(schema12.$id) ?? this._ajv.compile(schema12) : this._ajv.compile(schema12);
56981
57078
  return (input) => {
56982
57079
  const valid = ajvValidator(input);
56983
57080
  if (valid) {
@@ -57187,12 +57284,12 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
57187
57284
  }
57188
57285
 
57189
57286
  // ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1_ed45788dfbfe808cc09dd7daea6bd385/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js
57190
- function applyElicitationDefaults(schema11, data) {
57191
- if (!schema11 || data === null || typeof data !== "object")
57287
+ function applyElicitationDefaults(schema12, data) {
57288
+ if (!schema12 || data === null || typeof data !== "object")
57192
57289
  return;
57193
- if (schema11.type === "object" && schema11.properties && typeof schema11.properties === "object") {
57290
+ if (schema12.type === "object" && schema12.properties && typeof schema12.properties === "object") {
57194
57291
  const obj = data;
57195
- const props = schema11.properties;
57292
+ const props = schema12.properties;
57196
57293
  for (const key3 of Object.keys(props)) {
57197
57294
  const propSchema = props[key3];
57198
57295
  if (obj[key3] === void 0 && Object.prototype.hasOwnProperty.call(propSchema, "default")) {
@@ -57203,15 +57300,15 @@ function applyElicitationDefaults(schema11, data) {
57203
57300
  }
57204
57301
  }
57205
57302
  }
57206
- if (Array.isArray(schema11.anyOf)) {
57207
- for (const sub of schema11.anyOf) {
57303
+ if (Array.isArray(schema12.anyOf)) {
57304
+ for (const sub of schema12.anyOf) {
57208
57305
  if (typeof sub !== "boolean") {
57209
57306
  applyElicitationDefaults(sub, data);
57210
57307
  }
57211
57308
  }
57212
57309
  }
57213
- if (Array.isArray(schema11.oneOf)) {
57214
- for (const sub of schema11.oneOf) {
57310
+ if (Array.isArray(schema12.oneOf)) {
57311
+ for (const sub of schema12.oneOf) {
57215
57312
  if (typeof sub !== "boolean") {
57216
57313
  applyElicitationDefaults(sub, data);
57217
57314
  }
@@ -66781,6 +66878,21 @@ function skillDefaultsReadNote(skillName, values) {
66781
66878
  // ../../packages/core/dist/jupyter/tools.js
66782
66879
  var import_promises21 = __toESM(require("node:fs/promises"), 1);
66783
66880
  var import_node_path36 = __toESM(require("node:path"), 1);
66881
+ function targetFor(runtime, others, hub) {
66882
+ const names = others.map((other2) => `"${other2.name}"`).join(", ");
66883
+ if (hub === void 0 || hub.trim().length === 0) {
66884
+ if (runtime !== void 0)
66885
+ return { kind: "own", runtime, label: runtime.label, kernel: runtime.kernel };
66886
+ return { error: `Say which hub with "hub": ${names}.` };
66887
+ }
66888
+ const wanted = hub.trim().toLowerCase();
66889
+ const other = others.find((candidate) => candidate.name.toLowerCase() === wanted);
66890
+ if (other !== void 0)
66891
+ return { kind: "other", hub: other, label: other.label, kernel: other.kernel };
66892
+ if (runtime !== void 0 && (wanted === "this" || wanted === "own"))
66893
+ return { kind: "own", runtime, label: runtime.label, kernel: runtime.kernel };
66894
+ 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." : ""}` };
66895
+ }
66784
66896
  var RUN_DEFAULT_SECONDS = 300;
66785
66897
  var SCRIPT_PREVIEW_CHARS = 6e3;
66786
66898
  var runSchema = external_exports.object({
@@ -66789,12 +66901,14 @@ var runSchema = external_exports.object({
66789
66901
  args: external_exports.array(external_exports.string()).optional().describe("Command-line arguments for file (sys.argv[1:])."),
66790
66902
  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
66903
  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.")
66904
+ timeoutSeconds: external_exports.number().int().min(5).max(3600).optional().describe("How long the run may take before it is interrupted."),
66905
+ 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
66906
  });
66794
66907
  var inspectSchema = external_exports.object({
66795
66908
  name: external_exports.string().optional().describe('A module, class or function on the hub, e.g. "pandas.read_csv" or "acme_risk.pricing".'),
66796
66909
  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).')
66910
+ packages: external_exports.string().optional().describe('Instead of name: list installed packages whose name contains this ("" for all).'),
66911
+ 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
66912
  });
66799
66913
  var syncSchema = external_exports.object({
66800
66914
  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 +66979,32 @@ ${excerpt2}`,
66865
66979
  ].join("\n");
66866
66980
  return { ok: true, code, shown: params3.shell ?? "", where: `the hub, in ${folder || "the top folder"}` };
66867
66981
  }
66868
- function describeRun(runtime, output, where) {
66982
+ function planElsewhere(params3) {
66983
+ const given = [params3.code, params3.file, params3.shell].filter((v) => v !== void 0).length;
66984
+ if (given !== 1)
66985
+ return { ok: false, message: "Give exactly one of code or shell." };
66986
+ if (params3.file !== void 0) {
66987
+ 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." };
66988
+ }
66989
+ if (params3.code !== void 0)
66990
+ return { ok: true, code: params3.code, shown: params3.code, where: "its kernel" };
66991
+ const folder = (params3.cwd ?? "").replace(/\\/g, "/").replace(/^\/+|\/+$/g, "");
66992
+ if (folder.split("/").includes(".."))
66993
+ return { ok: false, message: 'cwd must be a folder on that server, without "..".' };
66994
+ const code = [
66995
+ "import os as _lc_os, subprocess as _lc_sp, sys as _lc_sys",
66996
+ `_lc_home = globals().setdefault('_lc_home', _lc_os.getcwd())`,
66997
+ `_lc_r = _lc_sp.run(${py(params3.shell)}, shell=True, cwd=_lc_os.path.join(_lc_home, ${py(folder)}), capture_output=True, text=True)`,
66998
+ 'print(_lc_r.stdout, end="")',
66999
+ 'print(_lc_r.stderr, end="", file=_lc_sys.stderr)',
67000
+ 'print(f"\\n[exit code {_lc_r.returncode}]")'
67001
+ ].join("\n");
67002
+ return { ok: true, code, shown: params3.shell ?? "", where: folder || "the top folder" };
67003
+ }
67004
+ function describeRun(label, output, where) {
66869
67005
  const parts = [];
66870
67006
  if (output.freshKernel)
66871
- parts.push(`(A new ${output.kernelName} kernel was started on ${runtime.label}; variables from earlier runs are gone.)`);
67007
+ parts.push(`(A new ${output.kernelName} kernel was started on ${label}; variables from earlier runs are gone.)`);
66872
67008
  parts.push(output.text.trim().length > 0 ? output.text.replace(/\s+$/, "") : "(no output)");
66873
67009
  if (output.error !== void 0)
66874
67010
  parts.push(`${output.error.name}: ${output.error.value}
@@ -66898,41 +67034,64 @@ function describePull(result) {
66898
67034
  lines2.push(`Up to date (${String(result.unchanged)} file(s) unchanged).`);
66899
67035
  return lines2.join("\n");
66900
67036
  }
66901
- function createHubTools(runtime) {
67037
+ function createHubTools(runtime, others = []) {
67038
+ const elsewhere = others.length === 0 ? "" : ` Other codebases' JupyterHub servers, by "hub": ${others.map((other) => `"${other.name}" (${other.label})`).join(", ")}.`;
67039
+ const here = runtime !== void 0 ? `ON THE JUPYTERHUB SERVER (${runtime.label})` : `ON ANOTHER CODEBASE'S JUPYTERHUB SERVER (name it with "hub")`;
66902
67040
  const runTool = {
66903
67041
  name: "hub_run",
66904
67042
  group: "command",
66905
- description: `Run Python, a script or a shell command ON THE JUPYTERHUB SERVER (${runtime.label}), 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.`,
67043
+ 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
67044
  parametersSchema: runSchema,
66907
67045
  async preview(params3, context) {
66908
- const planned = await plan(runtime, context, params3);
67046
+ const target = targetFor(runtime, others, params3.hub);
67047
+ if ("error" in target)
67048
+ return { kind: "text", text: target.error };
67049
+ const planned = target.kind === "own" ? await plan(target.runtime, context, params3) : planElsewhere(params3);
66909
67050
  if (!planned.ok)
66910
67051
  return { kind: "text", text: planned.message };
66911
- return { kind: "command", command: planned.shown, cwd: `JupyterHub: ${planned.where}` };
67052
+ const where = target.kind === "own" ? planned.where : `${target.label}, ${planned.where} (codebase "${target.hub.name}")`;
67053
+ return { kind: "command", command: planned.shown, cwd: `JupyterHub: ${where}` };
66912
67054
  },
66913
67055
  async execute(params3, context) {
66914
- const planned = await plan(runtime, context, params3);
67056
+ const target = targetFor(runtime, others, params3.hub);
67057
+ if ("error" in target)
67058
+ return { content: target.error, isError: true };
67059
+ if (target.kind === "other") {
67060
+ const planned2 = planElsewhere(params3);
67061
+ if (!planned2.ok)
67062
+ return { content: planned2.message, isError: true };
67063
+ const output2 = await target.kernel.run(planned2.code, {
67064
+ timeoutMs: (params3.timeoutSeconds ?? RUN_DEFAULT_SECONDS) * 1e3,
67065
+ ...context.signal !== void 0 ? { signal: context.signal } : {}
67066
+ });
67067
+ return {
67068
+ content: describeRun(target.label, output2, `${target.label}, ${planned2.where}`),
67069
+ ...output2.error !== void 0 || output2.timedOut === true ? { isError: true } : {}
67070
+ };
67071
+ }
67072
+ const own = target.runtime;
67073
+ const planned = await plan(own, context, params3);
66915
67074
  if (!planned.ok)
66916
67075
  return { content: planned.message, isError: true };
66917
67076
  const notes = [];
66918
67077
  if (planned.local !== void 0) {
66919
- const saved = await runtime.mirror.push(planned.local, context.signal);
67078
+ const saved = await own.mirror.push(planned.local, context.signal);
66920
67079
  if (!saved.saved)
66921
67080
  return { content: `Not run: ${params3.file ?? ""} could not be saved to the hub first - ${saved.message}`, isError: true };
66922
67081
  }
66923
- const output = await runtime.kernel.run(planned.code, {
67082
+ const output = await own.kernel.run(planned.code, {
66924
67083
  timeoutMs: (params3.timeoutSeconds ?? RUN_DEFAULT_SECONDS) * 1e3,
66925
67084
  ...context.signal !== void 0 ? { signal: context.signal } : {}
66926
67085
  });
66927
67086
  try {
66928
- const pulled = await runtime.mirror.pull(context.signal);
67087
+ const pulled = await own.mirror.pull(context.signal);
66929
67088
  if (pulled.fetched.length + pulled.removed.length + pulled.conflicts.length > 0)
66930
67089
  notes.push(describePull(pulled));
66931
67090
  } catch (error51) {
66932
67091
  notes.push(`(Could not fetch changes from the hub afterwards: ${error51 instanceof Error ? error51.message : String(error51)})`);
66933
67092
  }
66934
67093
  return {
66935
- content: [describeRun(runtime, output, planned.where), ...notes].join("\n\n"),
67094
+ content: [describeRun(own.label, output, planned.where), ...notes].join("\n\n"),
66936
67095
  ...output.error !== void 0 || output.timedOut === true ? { isError: true } : {}
66937
67096
  };
66938
67097
  }
@@ -66940,14 +67099,21 @@ function createHubTools(runtime) {
66940
67099
  const inspectTool = {
66941
67100
  name: "hub_inspect",
66942
67101
  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.",
67102
+ 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
67103
  parametersSchema: inspectSchema,
66945
67104
  async preview(params3) {
67105
+ const target = targetFor(runtime, others, params3.hub);
67106
+ if ("error" in target)
67107
+ return { kind: "text", text: target.error };
67108
+ const where = target.kind === "own" ? "JupyterHub kernel" : `JupyterHub kernel on ${target.label} (codebase "${target.hub.name}")`;
66946
67109
  if (params3.packages !== void 0)
66947
- return { kind: "command", command: `list installed packages matching ${py(params3.packages)}`, cwd: "JupyterHub kernel" };
66948
- return { kind: "command", command: `inspect ${params3.name ?? "?"}${params3.source === true ? " (with source)" : ""}`, cwd: "JupyterHub kernel (imports the module)" };
67110
+ return { kind: "command", command: `list installed packages matching ${py(params3.packages)}`, cwd: where };
67111
+ return { kind: "command", command: `inspect ${params3.name ?? "?"}${params3.source === true ? " (with source)" : ""}`, cwd: `${where} (imports the module)` };
66949
67112
  },
66950
67113
  async execute(params3, context) {
67114
+ const target = targetFor(runtime, others, params3.hub);
67115
+ if ("error" in target)
67116
+ return { content: target.error, isError: true };
66951
67117
  let code;
66952
67118
  if (params3.packages !== void 0) {
66953
67119
  code = [
@@ -66961,10 +67127,13 @@ function createHubTools(runtime) {
66961
67127
  } else {
66962
67128
  return { content: 'Give name (a dotted module path, e.g. "pkg.module.func") or packages.', isError: true };
66963
67129
  }
66964
- const output = await runtime.kernel.run(code, { timeoutMs: 12e4, ...context.signal !== void 0 ? { signal: context.signal } : {} });
66965
- return { content: describeRun(runtime, output, "the hub kernel"), ...output.error !== void 0 ? { isError: true } : {} };
67130
+ const output = await target.kernel.run(code, { timeoutMs: 12e4, ...context.signal !== void 0 ? { signal: context.signal } : {} });
67131
+ const where = target.kind === "own" ? "the hub kernel" : `the kernel on ${target.label}`;
67132
+ return { content: describeRun(target.label, output, where), ...output.error !== void 0 ? { isError: true } : {} };
66966
67133
  }
66967
67134
  };
67135
+ if (runtime === void 0)
67136
+ return [runTool, inspectTool];
66968
67137
  const syncTool = {
66969
67138
  name: "hub_sync",
66970
67139
  group: "edit",
@@ -67307,7 +67476,7 @@ var MAX_FOUND = 200;
67307
67476
  var READ_LINES = 2e3;
67308
67477
  var READ_CHARS = 2e5;
67309
67478
  var SKIPPED = /* @__PURE__ */ new Set(["node_modules", ".git", "__pycache__", ".ipynb_checkpoints", ".venv", "venv", ".cache", ".local", ".conda"]);
67310
- var schema = external_exports.object({
67479
+ var schema2 = external_exports.object({
67311
67480
  action: external_exports.enum(["list", "find", "read"]),
67312
67481
  hub: external_exports.string().optional().describe("Which hub, when there are several: its codebase name as listed in the description."),
67313
67482
  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 +67516,7 @@ function createHubBrowseTool(hubs) {
67347
67516
  name: "hub_browse",
67348
67517
  group: "read",
67349
67518
  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: schema,
67519
+ parametersSchema: schema2,
67351
67520
  async preview(params3) {
67352
67521
  const p = params3;
67353
67522
  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 +68792,7 @@ var callSchema = external_exports.object({
68623
68792
  args: external_exports.array(external_exports.unknown()).optional().describe("Positional arguments."),
68624
68793
  kwargs: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe("Keyword arguments.")
68625
68794
  });
68626
- var schema2 = external_exports.object({
68795
+ var schema3 = external_exports.object({
68627
68796
  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
68797
  module: external_exports.string().min(1).describe('The module to import, e.g. "pricinglib" or "pricinglib.bonds".'),
68629
68798
  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 +68816,7 @@ function createPythonLibraryTool(options) {
68647
68816
  name: "python_library",
68648
68817
  group: "command",
68649
68818
  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: schema2,
68819
+ parametersSchema: schema3,
68651
68820
  async preview(params3) {
68652
68821
  const launch = await options.launch(params3.python);
68653
68822
  const lines2 = [
@@ -68833,7 +69002,7 @@ function offloadedCatalogue(hidden, otherHidden = 0) {
68833
69002
  }
68834
69003
 
68835
69004
  // ../../packages/core/dist/tools/http.js
68836
- var schema3 = external_exports.object({
69005
+ var schema4 = external_exports.object({
68837
69006
  method: external_exports.enum(["GET", "POST"]).default("GET").describe("GET to read, POST to send a body."),
68838
69007
  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
69008
  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 +69159,7 @@ function createHttpTool(options) {
68990
69159
  name: "http_request",
68991
69160
  group: "command",
68992
69161
  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: schema3,
69162
+ parametersSchema: schema4,
68994
69163
  async preview(params3, context) {
68995
69164
  let url2;
68996
69165
  let problem;
@@ -72212,7 +72381,7 @@ var OfficeBridge = class {
72212
72381
  var import_node_child_process12 = require("node:child_process");
72213
72382
  var MAX_LINK_LENGTH = 2e3;
72214
72383
  var EMAIL = /^[^\s@,;<>"]+@[^\s@,;<>"]+\.[^\s@,;<>"]+$/;
72215
- var schema4 = external_exports.object({
72384
+ var schema5 = external_exports.object({
72216
72385
  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
72386
  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
72387
  topic: external_exports.string().optional().describe("Group chats only: a name for a new group chat."),
@@ -72336,7 +72505,7 @@ function createTeamsOpenChatTool(options = {}) {
72336
72505
  name: "teams_open_chat",
72337
72506
  group: "command",
72338
72507
  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: schema4,
72508
+ parametersSchema: schema5,
72340
72509
  async preview(params3) {
72341
72510
  const built = teamsChatLink(params3);
72342
72511
  return {
@@ -73343,7 +73512,7 @@ function diagramSvg(layout, palette = DEFAULT_PALETTE) {
73343
73512
 
73344
73513
  // ../../packages/core/dist/display/size.js
73345
73514
  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, and small or medium for something beside a paragraph of text rather than the point of the answer.";
73515
+ 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
73516
 
73348
73517
  // ../../packages/core/dist/diagrams/types.js
73349
73518
  var DIAGRAM_MAX_NODES = 40;
@@ -74859,12 +75028,12 @@ function createJenkinsFindJobsTool(options) {
74859
75028
  };
74860
75029
  }
74861
75030
  function createJenkinsJobTool(options) {
74862
- const schema11 = external_exports.object({ job: jobParam(options) });
75031
+ const schema12 = external_exports.object({ job: jobParam(options) });
74863
75032
  const tool = {
74864
75033
  name: "jenkins_job",
74865
75034
  group: "read",
74866
75035
  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: schema11,
75036
+ parametersSchema: schema12,
74868
75037
  async execute(params3) {
74869
75038
  try {
74870
75039
  const client = await options.client();
@@ -74897,12 +75066,12 @@ function createJenkinsJobTool(options) {
74897
75066
  return tool;
74898
75067
  }
74899
75068
  function createJenkinsBuildTool(options) {
74900
- const schema11 = external_exports.object({ job: jobParam(options), build: buildParam });
75069
+ const schema12 = external_exports.object({ job: jobParam(options), build: buildParam });
74901
75070
  const tool = {
74902
75071
  name: "jenkins_build",
74903
75072
  group: "read",
74904
75073
  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: schema11,
75074
+ parametersSchema: schema12,
74906
75075
  async execute(params3) {
74907
75076
  try {
74908
75077
  const client = await options.client();
@@ -74940,7 +75109,7 @@ function createJenkinsBuildTool(options) {
74940
75109
  return tool;
74941
75110
  }
74942
75111
  function createJenkinsBuildLogTool(options) {
74943
- const schema11 = external_exports.object({
75112
+ const schema12 = external_exports.object({
74944
75113
  job: jobParam(options),
74945
75114
  build: buildParam,
74946
75115
  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 +75120,7 @@ function createJenkinsBuildLogTool(options) {
74951
75120
  name: "jenkins_build_log",
74952
75121
  group: "read",
74953
75122
  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: schema11,
75123
+ parametersSchema: schema12,
74955
75124
  async execute(params3) {
74956
75125
  try {
74957
75126
  const client = await options.client();
@@ -75022,7 +75191,7 @@ function createJenkinsQueueTool(options) {
75022
75191
  };
75023
75192
  }
75024
75193
  function createJenkinsStartBuildTool(options) {
75025
- const schema11 = external_exports.object({
75194
+ const schema12 = external_exports.object({
75026
75195
  job: jobParam(options),
75027
75196
  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
75197
  });
@@ -75031,7 +75200,7 @@ function createJenkinsStartBuildTool(options) {
75031
75200
  name: "jenkins_start_build",
75032
75201
  group: "command",
75033
75202
  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: schema11,
75203
+ parametersSchema: schema12,
75035
75204
  async preview(params3) {
75036
75205
  const client = await options.client();
75037
75206
  const job = jobOf(options, params3.job);
@@ -75069,12 +75238,12 @@ Link: ${client.base}${jobPath(job, client.base)}/${String(started.number)}/` };
75069
75238
  return tool;
75070
75239
  }
75071
75240
  function createJenkinsStopBuildTool(options) {
75072
- const schema11 = external_exports.object({ job: jobParam(options), build: external_exports.union([external_exports.number().int().positive(), external_exports.string()]).describe("The build number to stop.") });
75241
+ 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
75242
  const tool = {
75074
75243
  name: "jenkins_stop_build",
75075
75244
  group: "command",
75076
75245
  description: "Abort a running Jenkins build. Always shown to the user first.",
75077
- parametersSchema: schema11,
75246
+ parametersSchema: schema12,
75078
75247
  async preview(params3) {
75079
75248
  const client = await options.client();
75080
75249
  const job = jobOf(options, params3.job);
@@ -75135,7 +75304,7 @@ function createJenkinsCheckJenkinsfileTool(options) {
75135
75304
  };
75136
75305
  }
75137
75306
  function createJenkinsTryJenkinsfileTool(options) {
75138
- const schema11 = external_exports.object({
75307
+ const schema12 = external_exports.object({
75139
75308
  job: jobParam(options),
75140
75309
  path: external_exports.string().optional().describe("The local Jenkinsfile to run. Default Jenkinsfile."),
75141
75310
  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 +75314,7 @@ function createJenkinsTryJenkinsfileTool(options) {
75145
75314
  name: "jenkins_try_jenkinsfile",
75146
75315
  group: "command",
75147
75316
  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: schema11,
75317
+ parametersSchema: schema12,
75149
75318
  async preview(params3, context) {
75150
75319
  const client = await options.client();
75151
75320
  const job = jobOf(options, params3.job);
@@ -75243,7 +75412,7 @@ var parameterInput = external_exports.object({
75243
75412
  choices: external_exports.array(external_exports.string()).optional().describe("For a choice parameter: every choice.")
75244
75413
  });
75245
75414
  function createJenkinsWriteJobTool(options) {
75246
- const schema11 = external_exports.object({
75415
+ const schema12 = external_exports.object({
75247
75416
  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
75417
  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
75418
  from: external_exports.string().optional().describe("copy: the existing job to copy, as folder/name or its URL."),
@@ -75292,7 +75461,7 @@ function createJenkinsWriteJobTool(options) {
75292
75461
  name: "jenkins_write_job",
75293
75462
  group: "command",
75294
75463
  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: schema11,
75464
+ parametersSchema: schema12,
75296
75465
  async preview(params3) {
75297
75466
  try {
75298
75467
  const client = await options.client();
@@ -79015,8 +79184,8 @@ var JiraClient = class {
79015
79184
  }
79016
79185
  };
79017
79186
  function fieldInfo(id, field2) {
79018
- const schema11 = field2.schema ?? {};
79019
- const type = schema11.type === "array" ? `array of ${schema11.items ?? "?"}` : schema11.type ?? "?";
79187
+ const schema12 = field2.schema ?? {};
79188
+ const type = schema12.type === "array" ? `array of ${schema12.items ?? "?"}` : schema12.type ?? "?";
79020
79189
  return {
79021
79190
  id,
79022
79191
  name: field2.name ?? id,
@@ -83550,7 +83719,7 @@ function guardPrompt(context) {
83550
83719
 
83551
83720
  // ../../packages/core/dist/observers/tool.js
83552
83721
  var TYPES = ["event", "finding", "alert", "note", "status"];
83553
- var schema5 = external_exports.object({
83722
+ var schema6 = external_exports.object({
83554
83723
  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
83724
  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
83725
  hours: external_exports.number().positive().max(24 * 3650).optional().describe("Only the last N hours. Overridden by from/until."),
@@ -83653,7 +83822,7 @@ function createReadAuditTool(deps) {
83653
83822
  name: "read_audit_log",
83654
83823
  group: "read",
83655
83824
  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: schema5,
83825
+ parametersSchema: schema6,
83657
83826
  async execute(params3) {
83658
83827
  const until = time3(params3.until, true);
83659
83828
  const from = time3(params3.from, false) ?? (params3.hours !== void 0 ? Date.now() - params3.hours * 36e5 : void 0);
@@ -83889,7 +84058,7 @@ var RoleProcess = class {
83889
84058
  };
83890
84059
 
83891
84060
  // ../../packages/core/dist/strategy/historyTool.js
83892
- var schema6 = external_exports.object({
84061
+ var schema7 = external_exports.object({
83893
84062
  role: external_exports.string().optional().describe("Only exchanges with this role."),
83894
84063
  last: external_exports.number().int().min(1).max(50).optional().describe("The newest N exchanges (default 20)."),
83895
84064
  full: external_exports.boolean().optional().describe("Questions and answers in full; otherwise the first lines of each.")
@@ -83899,7 +84068,7 @@ function createStrategyHistoryTool(deps) {
83899
84068
  name: "strategy_history",
83900
84069
  group: "read",
83901
84070
  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: schema6,
84071
+ parametersSchema: schema7,
83903
84072
  async execute(params3) {
83904
84073
  const { strategy, progress, exchanges } = deps.current();
83905
84074
  if (strategy === void 0)
@@ -83933,7 +84102,7 @@ var item = external_exports.object({
83933
84102
  contract: external_exports.string().max(1e3).optional().describe("What passes along this connector, in a sentence."),
83934
84103
  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
84104
  });
83936
- var schema7 = external_exports.object({
84105
+ var schema8 = external_exports.object({
83937
84106
  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
84107
  });
83939
84108
  function findEdge(strategy, from, to) {
@@ -83967,7 +84136,7 @@ function createSetStrategyContractsTool(deps) {
83967
84136
  name: "set_strategy_contracts",
83968
84137
  group: "edit",
83969
84138
  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: schema7,
84139
+ parametersSchema: schema8,
83971
84140
  async preview(params3) {
83972
84141
  const strategy = deps.current();
83973
84142
  if (strategy === void 0)
@@ -85478,14 +85647,17 @@ ${preview.text}` } : {}
85478
85647
  token: () => secrets.get(services.jupyterHub?.tokenRef ?? ""),
85479
85648
  tls: () => hubTls(services.jupyterHub)
85480
85649
  }) : void 0;
85650
+ const siblingHubClients = (services.siblingHubs ?? []).map(({ name, spec }) => ({
85651
+ name,
85652
+ spec,
85653
+ label: `${name}'s hub (${spec.user}@${hostLabel(spec.url)}${spec.server !== void 0 ? `, server ${spec.server}` : ""})`,
85654
+ client: new JupyterClient(httpClient, spec, () => secrets.get(spec.tokenRef), () => hubTls(spec))
85655
+ }));
85481
85656
  const browsableHubs = [
85482
85657
  ...hub !== void 0 ? [{ name: "this", label: `${hub.label}, this codebase's hub`, client: hub.client }] : [],
85483
- ...(services.siblingHubs ?? []).map(({ name, spec }) => ({
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
- }))
85658
+ ...siblingHubClients.map(({ name, label, client }) => ({ name, label, client }))
85488
85659
  ];
85660
+ const otherHubs = siblingHubClients.map(({ name, label, client, spec }) => ({ name, label, kernel: new KernelSession(client, spec.kernel) }));
85489
85661
  const diagnosticsProvider = hub !== void 0 && anyDiagnostics !== void 0 ? withoutMissingImports(anyDiagnostics) : anyDiagnostics;
85490
85662
  let hubSyncTimer;
85491
85663
  let hubSyncStartup;
@@ -86111,10 +86283,13 @@ ${preview.text}` } : {}
86111
86283
  }));
86112
86284
  }
86113
86285
  }
86114
- if (hub !== void 0) {
86115
- for (const tool of createHubTools(hub))
86286
+ if (hub !== void 0 || otherHubs.length > 0) {
86287
+ for (const tool of createHubTools(hub, otherHubs))
86116
86288
  combined.register(tool);
86117
86289
  }
86290
+ if (services.codebaseAgents !== void 0 && (services.siblings?.length ?? 0) > 0) {
86291
+ combined.register(createAskCodebaseAgentTool({ channel: services.codebaseAgents, codebases: services.siblings ?? [], depth: () => workingForDepth }));
86292
+ }
86118
86293
  const hubBrowse = createHubBrowseTool(browsableHubs);
86119
86294
  if (hubBrowse !== void 0)
86120
86295
  combined.register(hubBrowse);
@@ -87488,7 +87663,7 @@ ${error51.stack.split("\n").slice(1, 6).join("\n")}`;
87488
87663
  await postTasks();
87489
87664
  }
87490
87665
  let handoffAbort;
87491
- function startUserTurn(text2, images) {
87666
+ function startUserTurn(text2, images, onSettled) {
87492
87667
  void (async () => {
87493
87668
  if (scheduledRunInFlight !== void 0) {
87494
87669
  logger.info("holding the message until the scheduled run finishes");
@@ -87503,9 +87678,25 @@ ${error51.stack.split("\n").slice(1, 6).join("\n")}`;
87503
87678
  } finally {
87504
87679
  userTurnRunning = false;
87505
87680
  userTurnWindingDown = false;
87681
+ onSettled?.();
87506
87682
  }
87507
87683
  })();
87508
87684
  }
87685
+ let workingForDepth = 0;
87686
+ services.codebaseAgents?.onTask((task) => {
87687
+ const channel = services.codebaseAgents;
87688
+ if (channel === void 0)
87689
+ return;
87690
+ if (userTurnRunning || activeAbortController !== void 0 || scheduledRunInFlight !== void 0) {
87691
+ channel.done(task.id, { ok: false, text: "That chat was busy with another turn. Ask again." });
87692
+ return;
87693
+ }
87694
+ workingForDepth = task.depth;
87695
+ const text2 = composeTaskMessage(task);
87696
+ post({ type: "taskRestored", taskId: activeTaskId, entries: toTranscript([...conversation.toArray(), { role: "user", content: text2 }]) });
87697
+ post({ type: "hostTurnStarted" });
87698
+ startUserTurn(text2, void 0, () => channel.done(task.id, answerFromConversation(conversation.toArray())));
87699
+ });
87509
87700
  async function handleHandoff() {
87510
87701
  if (handoffAbort !== void 0)
87511
87702
  return;
@@ -95738,6 +95929,8 @@ ${contents}
95738
95929
  if (hubSyncStartup !== void 0)
95739
95930
  clearTimeout(hubSyncStartup);
95740
95931
  void hub?.kernel.dispose();
95932
+ for (const other of otherHubs)
95933
+ void other.kernel.dispose();
95741
95934
  stopKeepAlive();
95742
95935
  void observerHub.dispose();
95743
95936
  stopRoleProcesses();
@@ -96473,14 +96666,14 @@ ${lines2.join("\n")}${relevant.length > cap3 ? `
96473
96666
  }
96474
96667
 
96475
96668
  // ../../packages/core/dist/tools/diagnostics.js
96476
- var schema8 = external_exports.object({
96669
+ var schema9 = external_exports.object({
96477
96670
  paths: external_exports.array(external_exports.string().min(1)).min(1).max(20).describe("Files to check.")
96478
96671
  });
96479
96672
  var getDiagnosticsTool = {
96480
96673
  name: "get_diagnostics",
96481
96674
  group: "read",
96482
96675
  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: schema8,
96676
+ parametersSchema: schema9,
96484
96677
  async execute(params3, context) {
96485
96678
  if (context.diagnostics === void 0)
96486
96679
  return { content: "No language support is available here.", isError: true };
@@ -98974,6 +99167,11 @@ desktops of the same person; importing the file is how a second machine is set u
98974
99167
  "browse the hub",
98975
99168
  "other codebase hub",
98976
99169
  "files on the hub",
99170
+ "named server",
99171
+ "named jupyterhub server",
99172
+ "another server",
99173
+ "libraries on another hub",
99174
+ "inspect libraries",
98977
99175
  "hubignore",
98978
99176
  ".hubignore",
98979
99177
  "ignore files",
@@ -99041,6 +99239,11 @@ anywhere your hub user can see - read only, nothing copied or changed. It is off
99041
99239
  codebase for its own hub, and in **every other Fire Code codebase** for each hub codebase, named by
99042
99240
  its @name - so a local codebase can look at the hub's files without its own token. Only the added
99043
99241
  folders are copied here and searched with the fast tools; editing stays in the hub codebase.
99242
+ **Another codebase's libraries**: \`hub_inspect\` and \`hub_run\` take \`hub\` - another JupyterHub codebase's name,
99243
+ a named server included - and then run in that server's own kernel: what is installed there, a function's
99244
+ signature and source, or code and shell commands from a folder on that server. That kernel is this chat's own,
99245
+ started on first use and shut down with the chat; the other codebase's chat is not touched. Each call is approved,
99246
+ and the approval names the server. A local workspace script cannot run there - use shell (\`python path/to/x.py\`).
99044
99247
 
99045
99248
  **Not done for you**: a file deleted here is not deleted on the hub (\`hub_sync\` "status" lists it);
99046
99249
  edits made outside the agent (in VS Code, say) are saved with \`hub_sync\` "push".
@@ -99369,6 +99572,12 @@ always asks you).
99369
99572
  "several codebases",
99370
99573
  "multiple codebases",
99371
99574
  "multiple projects",
99575
+ "agent to agent",
99576
+ "ask another agent",
99577
+ "other codebase agent",
99578
+ "ask_codebase_agent",
99579
+ "agents talk",
99580
+ "another codebase's agent",
99372
99581
  "many projects",
99373
99582
  "one window",
99374
99583
  "parallel",
@@ -99449,6 +99658,16 @@ always asks you).
99449
99658
  "review python tools once"
99450
99659
  ],
99451
99660
  body: `
99661
+ **Agents asking each other**: the agent in one codebase can ask the agent in another for help, or to do something
99662
+ there, with \`ask_codebase_agent\` - you approve it, seeing the exact request and which codebase it goes to. Fire Code
99663
+ opens a new tab on that codebase ("From <codebase>: ...") without switching to it, and that agent starts on the
99664
+ request by itself, with its own files, tools, skills and instructions; **its approvals are asked in its own tab**, where
99665
+ you can watch or step in. When it finishes, its answer goes back to the first agent. If it stops to ask you something,
99666
+ the first agent is told it is waiting in that tab. **Once it has answered, the tab archives itself** (it stays in
99667
+ History) - unless it stopped to ask you something, it failed, or you are looking at it (then it goes when you leave
99668
+ it). Chains stop three asks deep, scheduled runs cannot ask, and closing the tab tells the first agent there will be
99669
+ no answer.
99670
+
99452
99671
  **Editing skills, tools and the standing instructions in Fire Code.** Fire Code has no code editor, so
99453
99672
  *Open* on a skill or tool (and the standing-instructions button in the Skills tab) opens Light Code's own
99454
99673
  editor: a full-panel text box with Save (Ctrl+S), Close (Esc) and a Markdown preview. A save is refused if
@@ -99784,7 +100003,13 @@ codebases and a whole team. Fire Code's dialog has a button that opens them too.
99784
100003
  "export diagram",
99785
100004
  "download diagram",
99786
100005
  "diagram as image",
99787
- "show_diagram"
100006
+ "show_diagram",
100007
+ "table too wide",
100008
+ "wide table",
100009
+ "chart too wide",
100010
+ "compact table",
100011
+ "chart size",
100012
+ "full width"
99788
100013
  ],
99789
100014
  body: `
99790
100015
  Ask for a diagram ("draw the request flow", "show the architecture") and the assistant draws one in the
@@ -99794,6 +100019,11 @@ Under each diagram: **Copy SVG** copies the markup to paste into a document or e
99794
100019
  **Save PNG** open a Save dialog - VS Code's own, or a Windows one in Fire Code starting in Downloads - and
99795
100020
  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
100021
  the file downloads instead. If a save fails, the reason is shown under the buttons.
100022
+
100023
+ **How wide pictures and tables are**: diagrams and charts are drawn at most "large" (680 pixels) unless the
100024
+ assistant is asked otherwise - say "make it smaller" or "show it full width" - and tables are as wide as their
100025
+ content, wrapping long cells. So in a wide window, such as Fire Code's, they stay compact while the text around
100026
+ them uses the full width; in VS Code's narrow panel nothing changes.
99797
100027
  `
99798
100028
  },
99799
100029
  {
@@ -101173,7 +101403,7 @@ var writeToFileTool = {
101173
101403
 
101174
101404
  // ../../packages/core/dist/tools/wait.js
101175
101405
  var MAX_WAIT_SECONDS = 900;
101176
- var schema9 = external_exports.object({
101406
+ var schema10 = external_exports.object({
101177
101407
  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
101408
  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
101409
  });
@@ -101184,7 +101414,7 @@ function createWaitTool(options = {}) {
101184
101414
  name: "wait",
101185
101415
  group: "always",
101186
101416
  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: schema9,
101417
+ parametersSchema: schema10,
101188
101418
  async execute(params3, context) {
101189
101419
  const started = now();
101190
101420
  const until = started + params3.seconds * 1e3;
@@ -101589,7 +101819,7 @@ function describeNestedCall(caller, callee) {
101589
101819
  }
101590
101820
 
101591
101821
  // ../../packages/core/dist/tools/checkCollectorTool.js
101592
- var schema10 = external_exports.object({
101822
+ var schema11 = external_exports.object({
101593
101823
  name: external_exports.string().min(1).describe("The Python tool to examine, with or without the `py__` prefix."),
101594
101824
  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
101825
  });
@@ -101616,7 +101846,7 @@ function createCheckCollectorTool(options) {
101616
101846
  name: "check_collector",
101617
101847
  group: "read",
101618
101848
  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: schema10,
101849
+ parametersSchema: schema11,
101620
101850
  execute: async (params3) => {
101621
101851
  const bare = params3.name.replace(/^py__/, "");
101622
101852
  const full = `py__${bare}`;
@@ -103691,6 +103921,7 @@ async function createSession(options) {
103691
103921
  ...options.sharedWorkspace === true ? { sharedWorkspace: true } : {},
103692
103922
  // Fire Code's monitoring - one person's own machine only, like the rest of what Fire Code passes.
103693
103923
  ...options.monitoring !== void 0 && options.shared !== true ? { monitoring: options.monitoring } : {},
103924
+ ...options.codebaseAgents !== void 0 && options.shared !== true ? { codebaseAgents: options.codebaseAgents } : {},
103694
103925
  ...options.monitorExecutor !== void 0 && options.shared !== true ? { monitorExecutor: options.monitorExecutor } : {},
103695
103926
  ...options.extraToolDirs !== void 0 && options.extraToolDirs.length > 0 ? { extraToolDirs: options.extraToolDirs } : {},
103696
103927
  ...options.noSchedules === true ? { runsSchedules: false } : {},
@@ -103955,6 +104186,7 @@ async function startServer(options) {
103955
104186
  ...options.secretsFile !== void 0 ? { secretsFile: options.secretsFile } : {},
103956
104187
  ...options.desktopNotify === true ? { desktopNotify: true } : {},
103957
104188
  ...options.monitoring !== void 0 ? { monitoring: options.monitoring } : {},
104189
+ ...options.codebaseAgents !== void 0 ? { codebaseAgents: options.codebaseAgents } : {},
103958
104190
  ...options.monitorExecutor !== void 0 ? { monitorExecutor: options.monitorExecutor } : {},
103959
104191
  ...options.extraToolDirs !== void 0 ? { extraToolDirs: options.extraToolDirs } : {},
103960
104192
  ...options.secretsKey !== void 0 ? { secretsKey: options.secretsKey } : {},