@qwen-code/qwen-code 0.18.1 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/bundled/qc-helper/docs/common-workflow.md +4 -4
- package/bundled/qc-helper/docs/configuration/model-providers.md +1 -1
- package/bundled/qc-helper/docs/configuration/settings.md +77 -77
- package/bundled/qc-helper/docs/features/channels/feishu.md +16 -0
- package/bundled/qc-helper/docs/features/mcp.md +1 -1
- package/bundled/qc-helper/docs/features/sub-agents.md +3 -3
- package/bundled/qc-helper/docs/qwen-serve.md +24 -12
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +30 -30
- package/bundled/review/SKILL.md +10 -4
- package/bundled/simplify/SKILL.md +1 -1
- package/chunks/{agent-XT7NHZ5H.js → agent-P5U6QLWL.js} +5 -5
- package/chunks/{agent-headless-LNRE63ZL.js → agent-headless-24356DC7.js} +5 -5
- package/chunks/{anthropicContentGenerator-DCI26OQF.js → anthropicContentGenerator-KLBHYGH6.js} +1 -1
- package/chunks/{askUserQuestion-ITYUTWLR.js → askUserQuestion-QPZXR3UO.js} +1 -1
- package/chunks/{chunk-RON7LFNH.js → chunk-25FFAMED.js} +6 -6
- package/chunks/{chunk-7KPZFE5A.js → chunk-C64WAJOC.js} +1 -1
- package/chunks/{chunk-6T7Y7USE.js → chunk-EQ5NHJBY.js} +1354 -1028
- package/chunks/{chunk-IS7UA4W3.js → chunk-JZEKEWO5.js} +4 -4
- package/chunks/{chunk-XZTNBSMW.js → chunk-M7OBURJM.js} +1 -1
- package/chunks/{chunk-3NRO6NHX.js → chunk-MN5RAXVB.js} +3 -3
- package/chunks/{chunk-WJ3SND6W.js → chunk-NGDXHX3A.js} +2 -2
- package/chunks/{chunk-BXYRCW2C.js → chunk-QFJ67S5R.js} +10 -5
- package/chunks/{chunk-Y7KMDUEP.js → chunk-QP4R5FTG.js} +1 -1
- package/chunks/{chunk-QILTEBWS.js → chunk-RTTAC5VW.js} +1 -1
- package/chunks/{chunk-HQUWWSSP.js → chunk-VIEIRAK3.js} +1 -1
- package/chunks/{chunk-HED55F43.js → chunk-VU6A2OBJ.js} +15 -5
- package/chunks/{chunk-DHZREJTG.js → chunk-YJDVHAGL.js} +1 -1
- package/chunks/{chunk-A2ZIEEGJ.js → chunk-ZNUMXPNK.js} +592 -43
- package/chunks/{computer-use-4YX3JGBV.js → computer-use-EGW2I2HZ.js} +5 -5
- package/chunks/{contextCommand-KS2H7MW5.js → contextCommand-HI2X2Y7I.js} +7 -7
- package/chunks/{cron-create-CAPUKK7I.js → cron-create-DQKRQMCP.js} +1 -1
- package/chunks/{cron-delete-G3KAR26Q.js → cron-delete-DOFPHFTI.js} +1 -1
- package/chunks/{cron-list-ZA4ZIUS5.js → cron-list-RCVOO3CB.js} +1 -1
- package/chunks/{dist-VEGFONCF.js → dist-2UCAYOX7.js} +2 -2
- package/chunks/{dist-X4EXN7W6.js → dist-33LHH26D.js} +1 -1
- package/chunks/{dist-YLS6NI7H.js → dist-KF43SZZV.js} +1 -1
- package/chunks/{dist-7YWFWOCJ.js → dist-UH7CYT7F.js} +2 -2
- package/chunks/{edit-2ARPEO4B.js → edit-FJSOCDO2.js} +7 -9
- package/chunks/{enter-worktree-IXNXNAW5.js → enter-worktree-X6MVFDLR.js} +5 -5
- package/chunks/{enterPlanMode-TAKAGAYP.js → enterPlanMode-MZAEQZH3.js} +5 -5
- package/chunks/{exit-worktree-LHTRV7ML.js → exit-worktree-RM2UPOYQ.js} +5 -5
- package/chunks/{exitPlanMode-MK5UAITL.js → exitPlanMode-7BVY3CWJ.js} +7 -6
- package/chunks/{geminiContentGenerator-HFJIGO77.js → geminiContentGenerator-A6JHLUHK.js} +1 -1
- package/chunks/{glob-I2USLUSC.js → glob-L3AZLCV6.js} +5 -5
- package/chunks/{grep-WBIF7THR.js → grep-SNCPCXIP.js} +5 -5
- package/chunks/{ls-2R5RHLX5.js → ls-TRD77UTS.js} +1 -1
- package/chunks/{lsp-XKH6ZIAN.js → lsp-2VFWQPZS.js} +1 -1
- package/chunks/{monitor-WU7UFATU.js → monitor-TS6WL6DN.js} +5 -5
- package/chunks/{notebook-edit-KUHYPXEM.js → notebook-edit-26RNH24J.js} +6 -6
- package/chunks/{openaiContentGenerator-5PLHYJQL.js → openaiContentGenerator-7CA63X5G.js} +5 -5
- package/chunks/{qwenContentGenerator-TSKW73KY.js → qwenContentGenerator-4WJTJXFZ.js} +7 -7
- package/chunks/{read-file-VIPF2PS6.js → read-file-EUIHK6HD.js} +3 -3
- package/chunks/{ripGrep-XLIZTYE7.js → ripGrep-7J5B22W2.js} +5 -5
- package/chunks/{scheduler-O66SLJGU.js → scheduler-J3OUGTTS.js} +5 -5
- package/chunks/{send-message-CTME7DXD.js → send-message-QZOC5GA2.js} +1 -1
- package/chunks/{serve-BWOLYT62.js → serve-VF4ZNUJP.js} +709 -26
- package/chunks/{shell-XE7UYKOO.js → shell-G6XCJAG3.js} +5 -5
- package/chunks/{skill-RZWM6XMC.js → skill-7OVC6JIH.js} +3 -3
- package/chunks/{src-L5P7K4MH.js → src-XV5MLRND.js} +11 -5
- package/chunks/{syntheticOutput-ZJGSU7OQ.js → syntheticOutput-WJSUK4SZ.js} +2 -2
- package/chunks/{task-create-EE6JEM7G.js → task-create-GGSC27HO.js} +2 -2
- package/chunks/{task-list-EESYAC65.js → task-list-EDHHHSK4.js} +1 -1
- package/chunks/{task-stop-XZVCFFYY.js → task-stop-WR5PDVZY.js} +1 -1
- package/chunks/{task-update-EIO4HNE3.js → task-update-UR7NUHBV.js} +2 -2
- package/chunks/{team-create-R2H7Y3SG.js → team-create-JXSC7ROC.js} +5 -5
- package/chunks/{team-delete-A7LXPGV7.js → team-delete-FC33URJK.js} +1 -1
- package/chunks/{todoWrite-VRKSGAWM.js → todoWrite-GO2ME7ZV.js} +1 -1
- package/chunks/{tool-search-USSQMTMS.js → tool-search-YRWSWA2H.js} +3 -3
- package/chunks/{web-fetch-GHAZUA54.js → web-fetch-NLLATYIL.js} +2 -2
- package/chunks/{workflow-5LNNLNUR.js → workflow-ZN3DYFMU.js} +249 -24
- package/chunks/{write-file-2I7HP24C.js → write-file-355M4V7Z.js} +6 -6
- package/cli.js +1092 -491
- package/package.json +2 -2
|
@@ -3231,7 +3231,7 @@ var require_compile = __commonJS({
|
|
|
3231
3231
|
}
|
|
3232
3232
|
__name(compileSchema, "compileSchema");
|
|
3233
3233
|
exports.compileSchema = compileSchema;
|
|
3234
|
-
function
|
|
3234
|
+
function resolveRef2(root, baseId, ref) {
|
|
3235
3235
|
var _a;
|
|
3236
3236
|
ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
|
|
3237
3237
|
const schOrFunc = root.refs[ref];
|
|
@@ -3248,8 +3248,8 @@ var require_compile = __commonJS({
|
|
|
3248
3248
|
return;
|
|
3249
3249
|
return root.refs[ref] = inlineOrCompile.call(this, _sch);
|
|
3250
3250
|
}
|
|
3251
|
-
__name(
|
|
3252
|
-
exports.resolveRef =
|
|
3251
|
+
__name(resolveRef2, "resolveRef");
|
|
3252
|
+
exports.resolveRef = resolveRef2;
|
|
3253
3253
|
function inlineOrCompile(sch) {
|
|
3254
3254
|
if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
|
|
3255
3255
|
return sch.schema;
|
|
@@ -11098,7 +11098,7 @@ var require_compile2 = __commonJS({
|
|
|
11098
11098
|
}
|
|
11099
11099
|
__name(compileSchema, "compileSchema");
|
|
11100
11100
|
exports.compileSchema = compileSchema;
|
|
11101
|
-
function
|
|
11101
|
+
function resolveRef2(root, baseId, ref) {
|
|
11102
11102
|
var _a;
|
|
11103
11103
|
ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
|
|
11104
11104
|
const schOrFunc = root.refs[ref];
|
|
@@ -11115,8 +11115,8 @@ var require_compile2 = __commonJS({
|
|
|
11115
11115
|
return;
|
|
11116
11116
|
return root.refs[ref] = inlineOrCompile.call(this, _sch);
|
|
11117
11117
|
}
|
|
11118
|
-
__name(
|
|
11119
|
-
exports.resolveRef =
|
|
11118
|
+
__name(resolveRef2, "resolveRef");
|
|
11119
|
+
exports.resolveRef = resolveRef2;
|
|
11120
11120
|
function inlineOrCompile(sch) {
|
|
11121
11121
|
if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
|
|
11122
11122
|
return sch.schema;
|
|
@@ -14284,9 +14284,20 @@ var SchemaValidator = class {
|
|
|
14284
14284
|
if (!valid && validate.errors) {
|
|
14285
14285
|
fixBooleanValues(
|
|
14286
14286
|
data,
|
|
14287
|
+
anySchema,
|
|
14288
|
+
anySchema
|
|
14289
|
+
);
|
|
14290
|
+
fixStringValues(
|
|
14291
|
+
data,
|
|
14292
|
+
anySchema,
|
|
14287
14293
|
anySchema
|
|
14288
14294
|
);
|
|
14289
14295
|
fixStringifiedJsonValues(
|
|
14296
|
+
data,
|
|
14297
|
+
anySchema,
|
|
14298
|
+
anySchema
|
|
14299
|
+
);
|
|
14300
|
+
fixNumericValues(
|
|
14290
14301
|
data,
|
|
14291
14302
|
anySchema
|
|
14292
14303
|
);
|
|
@@ -14298,49 +14309,371 @@ var SchemaValidator = class {
|
|
|
14298
14309
|
return null;
|
|
14299
14310
|
}
|
|
14300
14311
|
};
|
|
14301
|
-
function
|
|
14302
|
-
|
|
14303
|
-
|
|
14304
|
-
|
|
14305
|
-
|
|
14306
|
-
|
|
14307
|
-
|
|
14312
|
+
function resolveRef(ref, rootSchema) {
|
|
14313
|
+
if (!ref.startsWith("#/")) return null;
|
|
14314
|
+
const parts = ref.slice(2).split("/");
|
|
14315
|
+
let current = rootSchema;
|
|
14316
|
+
for (const rawPart of parts) {
|
|
14317
|
+
if (current == null || typeof current !== "object") return null;
|
|
14318
|
+
const part = rawPart.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
14319
|
+
if (!Object.hasOwn(current, part)) return null;
|
|
14320
|
+
current = current[part];
|
|
14321
|
+
}
|
|
14322
|
+
if (current != null && typeof current === "object" && !Array.isArray(current)) {
|
|
14323
|
+
return current;
|
|
14324
|
+
}
|
|
14325
|
+
return null;
|
|
14326
|
+
}
|
|
14327
|
+
__name(resolveRef, "resolveRef");
|
|
14328
|
+
function resolvePropSchema(propSchema, rootSchema) {
|
|
14329
|
+
if (!propSchema) return void 0;
|
|
14330
|
+
let schema = propSchema;
|
|
14331
|
+
let depth = 0;
|
|
14332
|
+
while (typeof schema["$ref"] === "string" && depth < 64) {
|
|
14333
|
+
depth++;
|
|
14334
|
+
const resolved = resolveRef(schema["$ref"], rootSchema);
|
|
14335
|
+
if (!resolved) return propSchema;
|
|
14336
|
+
schema = resolved;
|
|
14337
|
+
}
|
|
14338
|
+
return schema;
|
|
14339
|
+
}
|
|
14340
|
+
__name(resolvePropSchema, "resolvePropSchema");
|
|
14341
|
+
function resolveArrayElementSchema(parentSchema, rootSchema, index) {
|
|
14342
|
+
const prefixItems = parentSchema["prefixItems"];
|
|
14343
|
+
if (prefixItems && index < prefixItems.length) {
|
|
14344
|
+
const entry = prefixItems[index];
|
|
14345
|
+
if (typeof entry === "object" && entry !== null && !Array.isArray(entry)) {
|
|
14346
|
+
return resolvePropSchema(entry, rootSchema);
|
|
14347
|
+
}
|
|
14348
|
+
return void 0;
|
|
14349
|
+
}
|
|
14350
|
+
const itemsSchema = parentSchema["items"];
|
|
14351
|
+
if (itemsSchema) {
|
|
14352
|
+
return resolvePropSchema(itemsSchema, rootSchema);
|
|
14353
|
+
}
|
|
14354
|
+
return void 0;
|
|
14355
|
+
}
|
|
14356
|
+
__name(resolveArrayElementSchema, "resolveArrayElementSchema");
|
|
14357
|
+
function getCompositionVariants(schema, rootSchema) {
|
|
14358
|
+
const variants = [];
|
|
14359
|
+
for (const keyword of ["allOf", "anyOf", "oneOf"]) {
|
|
14360
|
+
const val = schema[keyword];
|
|
14361
|
+
if (Array.isArray(val)) {
|
|
14362
|
+
for (const item of val) {
|
|
14363
|
+
if (typeof item === "object" && item != null && !Array.isArray(item)) {
|
|
14364
|
+
const resolved = rootSchema ? resolvePropSchema(item, rootSchema) : item;
|
|
14365
|
+
if (resolved) variants.push(resolved);
|
|
14366
|
+
}
|
|
14367
|
+
}
|
|
14368
|
+
}
|
|
14369
|
+
}
|
|
14370
|
+
return variants;
|
|
14371
|
+
}
|
|
14372
|
+
__name(getCompositionVariants, "getCompositionVariants");
|
|
14373
|
+
function schemaHasObjectShape(schema, rootSchema) {
|
|
14374
|
+
if (schema["properties"] || schema["additionalProperties"]) return true;
|
|
14375
|
+
for (const variant of getCompositionVariants(schema, rootSchema)) {
|
|
14376
|
+
if (variant["properties"] || variant["additionalProperties"]) return true;
|
|
14377
|
+
}
|
|
14378
|
+
return false;
|
|
14379
|
+
}
|
|
14380
|
+
__name(schemaHasObjectShape, "schemaHasObjectShape");
|
|
14381
|
+
var DANGEROUS_PROP_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
14382
|
+
function getEffectiveProperties(schema, rootSchema) {
|
|
14383
|
+
const merged = /* @__PURE__ */ Object.create(null);
|
|
14384
|
+
for (const variant of getCompositionVariants(schema, rootSchema)) {
|
|
14385
|
+
const variantProps = variant["properties"];
|
|
14386
|
+
if (variantProps) {
|
|
14387
|
+
for (const [k, v] of Object.entries(variantProps)) {
|
|
14388
|
+
if (DANGEROUS_PROP_KEYS.has(k)) continue;
|
|
14389
|
+
if (!Object.hasOwn(merged, k)) merged[k] = v;
|
|
14390
|
+
}
|
|
14308
14391
|
}
|
|
14309
14392
|
}
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14393
|
+
const topProps = schema["properties"];
|
|
14394
|
+
if (topProps) {
|
|
14395
|
+
for (const [k, v] of Object.entries(topProps)) {
|
|
14396
|
+
if (DANGEROUS_PROP_KEYS.has(k)) continue;
|
|
14397
|
+
merged[k] = v;
|
|
14398
|
+
}
|
|
14399
|
+
}
|
|
14400
|
+
return Object.keys(merged).length > 0 ? merged : void 0;
|
|
14401
|
+
}
|
|
14402
|
+
__name(getEffectiveProperties, "getEffectiveProperties");
|
|
14403
|
+
function getAcceptedTypes(propSchema, rootSchema, depth = 0, cache = /* @__PURE__ */ new WeakMap()) {
|
|
14404
|
+
if (depth > 64) return null;
|
|
14405
|
+
let schema = propSchema;
|
|
14406
|
+
if (typeof schema["$ref"] === "string" && rootSchema) {
|
|
14407
|
+
const resolved = resolvePropSchema(propSchema, rootSchema);
|
|
14408
|
+
if (!resolved || typeof resolved["$ref"] === "string") {
|
|
14409
|
+
return null;
|
|
14410
|
+
}
|
|
14411
|
+
schema = resolved;
|
|
14412
|
+
}
|
|
14413
|
+
const cacheable = typeof schema === "object" && schema !== null;
|
|
14414
|
+
if (cacheable) {
|
|
14415
|
+
const cached = cache.get(schema);
|
|
14416
|
+
if (cached !== void 0) return cached;
|
|
14417
|
+
}
|
|
14418
|
+
const types = /* @__PURE__ */ new Set();
|
|
14419
|
+
if (typeof schema === "object" && schema !== null) {
|
|
14420
|
+
if (typeof schema["type"] === "string") {
|
|
14421
|
+
types.add(schema["type"]);
|
|
14422
|
+
} else if (Array.isArray(schema["type"])) {
|
|
14423
|
+
for (const t of schema["type"]) {
|
|
14424
|
+
types.add(t);
|
|
14425
|
+
}
|
|
14426
|
+
}
|
|
14427
|
+
for (const keyword of ["anyOf", "oneOf", "allOf"]) {
|
|
14428
|
+
const variants = schema[keyword];
|
|
14429
|
+
if (Array.isArray(variants)) {
|
|
14430
|
+
for (const variant of variants) {
|
|
14431
|
+
const nested = getAcceptedTypes(
|
|
14432
|
+
variant,
|
|
14433
|
+
rootSchema,
|
|
14434
|
+
depth + 1,
|
|
14435
|
+
cache
|
|
14436
|
+
);
|
|
14437
|
+
if (nested) {
|
|
14438
|
+
for (const t of nested) {
|
|
14439
|
+
types.add(t);
|
|
14440
|
+
}
|
|
14319
14441
|
}
|
|
14320
14442
|
}
|
|
14321
14443
|
}
|
|
14322
14444
|
}
|
|
14323
14445
|
}
|
|
14324
|
-
|
|
14446
|
+
const result = types.size > 0 ? types : null;
|
|
14447
|
+
if (cacheable) cache.set(schema, result);
|
|
14448
|
+
return result;
|
|
14325
14449
|
}
|
|
14326
14450
|
__name(getAcceptedTypes, "getAcceptedTypes");
|
|
14327
|
-
function
|
|
14328
|
-
|
|
14329
|
-
if (
|
|
14451
|
+
function valueToSchemaType(value) {
|
|
14452
|
+
if (value === null) return "null";
|
|
14453
|
+
if (typeof value === "boolean") return "boolean";
|
|
14454
|
+
if (typeof value === "bigint") return "integer";
|
|
14455
|
+
if (typeof value === "number") {
|
|
14456
|
+
if (!Number.isFinite(value)) return null;
|
|
14457
|
+
return Number.isInteger(value) ? "integer" : "number";
|
|
14458
|
+
}
|
|
14459
|
+
if (typeof value === "string") return "string";
|
|
14460
|
+
if (Array.isArray(value)) return "array";
|
|
14461
|
+
if (typeof value === "object") return "object";
|
|
14462
|
+
return null;
|
|
14463
|
+
}
|
|
14464
|
+
__name(valueToSchemaType, "valueToSchemaType");
|
|
14465
|
+
function typeIsAccepted(valueType, accepted) {
|
|
14466
|
+
if (accepted.has(valueType)) return true;
|
|
14467
|
+
if (valueType === "integer" && accepted.has("number")) return true;
|
|
14468
|
+
return false;
|
|
14469
|
+
}
|
|
14470
|
+
__name(typeIsAccepted, "typeIsAccepted");
|
|
14471
|
+
function fixStringifiedJsonValuesInArray(array, itemsSchema, root, key) {
|
|
14472
|
+
if (Array.isArray(itemsSchema["prefixItems"])) {
|
|
14473
|
+
for (let i = 0; i < array.length; i++) {
|
|
14474
|
+
const elSchema = resolveArrayElementSchema(itemsSchema, root, i);
|
|
14475
|
+
if (!elSchema) continue;
|
|
14476
|
+
const item = array[i];
|
|
14477
|
+
if (typeof item !== "string") continue;
|
|
14478
|
+
const trimmed = item.trim();
|
|
14479
|
+
if (trimmed.startsWith("[") && trimmed.endsWith("]") || trimmed.startsWith("{") && trimmed.endsWith("}")) {
|
|
14480
|
+
const elAccepted = getAcceptedTypes(elSchema, root);
|
|
14481
|
+
if (elAccepted && !elAccepted.has("string")) {
|
|
14482
|
+
try {
|
|
14483
|
+
const parsed = JSON.parse(trimmed);
|
|
14484
|
+
const parsedType = Array.isArray(parsed) ? "array" : typeof parsed;
|
|
14485
|
+
if (elAccepted.has(parsedType)) {
|
|
14486
|
+
debugLogger.debug(
|
|
14487
|
+
`coercion: ${key}[${i}] = ${String(item)} \u2192 ${JSON.stringify(parsed)} (accepted: ${[...elAccepted].join("|")})`
|
|
14488
|
+
);
|
|
14489
|
+
array[i] = parsed;
|
|
14490
|
+
}
|
|
14491
|
+
} catch {
|
|
14492
|
+
}
|
|
14493
|
+
}
|
|
14494
|
+
}
|
|
14495
|
+
}
|
|
14496
|
+
return;
|
|
14497
|
+
}
|
|
14498
|
+
const resolvedItems = resolvePropSchema(itemsSchema, root);
|
|
14499
|
+
if (!resolvedItems) return;
|
|
14500
|
+
const innerItems = resolvedItems["items"];
|
|
14501
|
+
const resolvedInner = innerItems ? resolvePropSchema(innerItems, root) : void 0;
|
|
14502
|
+
const itemsAccepted = resolvedInner ? getAcceptedTypes(resolvedInner, root) : null;
|
|
14503
|
+
if (!itemsAccepted || itemsAccepted.has("string")) return;
|
|
14504
|
+
for (let i = 0; i < array.length; i++) {
|
|
14505
|
+
const item = array[i];
|
|
14506
|
+
if (typeof item !== "string") continue;
|
|
14507
|
+
const trimmed = item.trim();
|
|
14508
|
+
if (trimmed.startsWith("[") && trimmed.endsWith("]") || trimmed.startsWith("{") && trimmed.endsWith("}")) {
|
|
14509
|
+
try {
|
|
14510
|
+
const parsed = JSON.parse(trimmed);
|
|
14511
|
+
const parsedType = Array.isArray(parsed) ? "array" : typeof parsed;
|
|
14512
|
+
if (itemsAccepted.has(parsedType)) {
|
|
14513
|
+
debugLogger.debug(
|
|
14514
|
+
`coercion: ${key}[${i}] = ${String(item)} \u2192 ${JSON.stringify(parsed)} (accepted: ${[...itemsAccepted].join("|")})`
|
|
14515
|
+
);
|
|
14516
|
+
array[i] = parsed;
|
|
14517
|
+
}
|
|
14518
|
+
} catch {
|
|
14519
|
+
}
|
|
14520
|
+
}
|
|
14521
|
+
}
|
|
14522
|
+
}
|
|
14523
|
+
__name(fixStringifiedJsonValuesInArray, "fixStringifiedJsonValuesInArray");
|
|
14524
|
+
function fixStringifiedJsonValues(data, schema, rootSchema, depth = 0) {
|
|
14525
|
+
if (depth > 64) return;
|
|
14526
|
+
const root = rootSchema ?? schema;
|
|
14527
|
+
const properties = getEffectiveProperties(schema, root);
|
|
14528
|
+
if (!properties && !schema["additionalProperties"]) return;
|
|
14330
14529
|
for (const key of Object.keys(data)) {
|
|
14331
14530
|
const value = data[key];
|
|
14332
|
-
const
|
|
14333
|
-
|
|
14531
|
+
const additionalProps = schema["additionalProperties"];
|
|
14532
|
+
const propSchema = properties?.[key] ?? (typeof additionalProps === "object" && additionalProps !== null ? additionalProps : void 0);
|
|
14533
|
+
if (!propSchema) continue;
|
|
14534
|
+
const resolved = resolvePropSchema(
|
|
14535
|
+
propSchema,
|
|
14536
|
+
root
|
|
14537
|
+
);
|
|
14538
|
+
if (!resolved) continue;
|
|
14539
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
14540
|
+
if (schemaHasObjectShape(resolved, root)) {
|
|
14541
|
+
fixStringifiedJsonValues(
|
|
14542
|
+
value,
|
|
14543
|
+
resolved,
|
|
14544
|
+
root,
|
|
14545
|
+
depth + 1
|
|
14546
|
+
);
|
|
14547
|
+
}
|
|
14548
|
+
continue;
|
|
14549
|
+
}
|
|
14550
|
+
if (Array.isArray(value)) {
|
|
14551
|
+
if (Array.isArray(resolved["prefixItems"])) {
|
|
14552
|
+
for (let i = 0; i < value.length; i++) {
|
|
14553
|
+
const elSchema = resolveArrayElementSchema(resolved, root, i);
|
|
14554
|
+
if (!elSchema) continue;
|
|
14555
|
+
const item = value[i];
|
|
14556
|
+
if (typeof item === "object" && item !== null && !Array.isArray(item)) {
|
|
14557
|
+
if (schemaHasObjectShape(elSchema, root)) {
|
|
14558
|
+
fixStringifiedJsonValues(
|
|
14559
|
+
item,
|
|
14560
|
+
elSchema,
|
|
14561
|
+
root,
|
|
14562
|
+
depth + 1
|
|
14563
|
+
);
|
|
14564
|
+
}
|
|
14565
|
+
} else if (Array.isArray(item)) {
|
|
14566
|
+
if (elSchema["type"] === "array" || elSchema["items"] || elSchema["prefixItems"]) {
|
|
14567
|
+
fixStringifiedJsonValuesInArray(item, elSchema, root, key);
|
|
14568
|
+
}
|
|
14569
|
+
} else if (typeof item === "string") {
|
|
14570
|
+
const elAccepted = getAcceptedTypes(elSchema, root);
|
|
14571
|
+
if (elAccepted && !elAccepted.has("string")) {
|
|
14572
|
+
const trimmed2 = item.trim();
|
|
14573
|
+
if (trimmed2.startsWith("[") && trimmed2.endsWith("]") || trimmed2.startsWith("{") && trimmed2.endsWith("}")) {
|
|
14574
|
+
try {
|
|
14575
|
+
const parsed = JSON.parse(trimmed2);
|
|
14576
|
+
const parsedType = Array.isArray(parsed) ? "array" : typeof parsed;
|
|
14577
|
+
if (elAccepted.has(parsedType)) {
|
|
14578
|
+
debugLogger.debug(
|
|
14579
|
+
`coercion: ${key}[${i}] = ${String(item)} \u2192 ${JSON.stringify(parsed)} (accepted: ${[...elAccepted].join("|")})`
|
|
14580
|
+
);
|
|
14581
|
+
value[i] = parsed;
|
|
14582
|
+
}
|
|
14583
|
+
} catch {
|
|
14584
|
+
}
|
|
14585
|
+
}
|
|
14586
|
+
}
|
|
14587
|
+
}
|
|
14588
|
+
}
|
|
14589
|
+
} else {
|
|
14590
|
+
const itemsSchema = resolved["items"];
|
|
14591
|
+
if (itemsSchema) {
|
|
14592
|
+
const resolvedItems = resolvePropSchema(itemsSchema, root);
|
|
14593
|
+
if (!resolvedItems) continue;
|
|
14594
|
+
if (schemaHasObjectShape(resolvedItems, root)) {
|
|
14595
|
+
const itemsAccepted = getAcceptedTypes(resolvedItems, root);
|
|
14596
|
+
for (let i = 0; i < value.length; i++) {
|
|
14597
|
+
const item = value[i];
|
|
14598
|
+
if (typeof item === "object" && item !== null && !Array.isArray(item)) {
|
|
14599
|
+
fixStringifiedJsonValues(
|
|
14600
|
+
item,
|
|
14601
|
+
resolvedItems,
|
|
14602
|
+
root,
|
|
14603
|
+
depth + 1
|
|
14604
|
+
);
|
|
14605
|
+
} else if (typeof item === "string" && itemsAccepted && !itemsAccepted.has("string")) {
|
|
14606
|
+
const trimmed2 = item.trim();
|
|
14607
|
+
if (trimmed2.startsWith("{") && trimmed2.endsWith("}") || trimmed2.startsWith("[") && trimmed2.endsWith("]")) {
|
|
14608
|
+
try {
|
|
14609
|
+
const parsed = JSON.parse(trimmed2);
|
|
14610
|
+
if (itemsAccepted.has(
|
|
14611
|
+
Array.isArray(parsed) ? "array" : typeof parsed
|
|
14612
|
+
)) {
|
|
14613
|
+
debugLogger.debug(
|
|
14614
|
+
`coercion: ${key}[${i}] = ${String(item)} \u2192 ${JSON.stringify(parsed)} (accepted: ${[...itemsAccepted].join("|")})`
|
|
14615
|
+
);
|
|
14616
|
+
value[i] = parsed;
|
|
14617
|
+
}
|
|
14618
|
+
} catch {
|
|
14619
|
+
}
|
|
14620
|
+
}
|
|
14621
|
+
}
|
|
14622
|
+
}
|
|
14623
|
+
} else if (resolvedItems["type"] === "array" || resolvedItems["items"] || resolvedItems["prefixItems"]) {
|
|
14624
|
+
for (const subArray of value) {
|
|
14625
|
+
if (Array.isArray(subArray)) {
|
|
14626
|
+
fixStringifiedJsonValuesInArray(
|
|
14627
|
+
subArray,
|
|
14628
|
+
resolvedItems,
|
|
14629
|
+
root,
|
|
14630
|
+
key
|
|
14631
|
+
);
|
|
14632
|
+
}
|
|
14633
|
+
}
|
|
14634
|
+
} else {
|
|
14635
|
+
const itemsAccepted = getAcceptedTypes(resolvedItems, root);
|
|
14636
|
+
if (itemsAccepted && !itemsAccepted.has("string")) {
|
|
14637
|
+
for (let i = 0; i < value.length; i++) {
|
|
14638
|
+
const item = value[i];
|
|
14639
|
+
if (typeof item !== "string") continue;
|
|
14640
|
+
const trimmed2 = item.trim();
|
|
14641
|
+
if (trimmed2.startsWith("[") && trimmed2.endsWith("]") || trimmed2.startsWith("{") && trimmed2.endsWith("}")) {
|
|
14642
|
+
try {
|
|
14643
|
+
const parsed = JSON.parse(trimmed2);
|
|
14644
|
+
const parsedType = Array.isArray(parsed) ? "array" : typeof parsed;
|
|
14645
|
+
if (itemsAccepted.has(parsedType)) {
|
|
14646
|
+
debugLogger.debug(
|
|
14647
|
+
`coercion: ${key}[${i}] = ${String(item)} \u2192 ${JSON.stringify(parsed)} (accepted: ${[...itemsAccepted].join("|")})`
|
|
14648
|
+
);
|
|
14649
|
+
value[i] = parsed;
|
|
14650
|
+
}
|
|
14651
|
+
} catch {
|
|
14652
|
+
}
|
|
14653
|
+
}
|
|
14654
|
+
}
|
|
14655
|
+
}
|
|
14656
|
+
}
|
|
14657
|
+
}
|
|
14658
|
+
}
|
|
14659
|
+
continue;
|
|
14660
|
+
}
|
|
14661
|
+
if (typeof value !== "string") continue;
|
|
14334
14662
|
const trimmed = value.trim();
|
|
14335
14663
|
if (trimmed.startsWith("[") && trimmed.endsWith("]") || trimmed.startsWith("{") && trimmed.endsWith("}")) {
|
|
14336
|
-
const accepted = getAcceptedTypes(
|
|
14664
|
+
const accepted = getAcceptedTypes(resolved, root);
|
|
14337
14665
|
if (!accepted) continue;
|
|
14338
14666
|
if (accepted.has("string")) continue;
|
|
14339
|
-
if (!accepted.has("array") && !accepted.has("object"))
|
|
14667
|
+
if (!accepted.has("array") && !accepted.has("object")) {
|
|
14668
|
+
continue;
|
|
14669
|
+
}
|
|
14340
14670
|
try {
|
|
14341
14671
|
const parsed = JSON.parse(trimmed);
|
|
14342
14672
|
const parsedType = Array.isArray(parsed) ? "array" : typeof parsed;
|
|
14343
14673
|
if (accepted.has(parsedType)) {
|
|
14674
|
+
debugLogger.debug(
|
|
14675
|
+
`coercion: ${key} = ${String(value)} \u2192 ${JSON.stringify(parsed)} (accepted: ${[...accepted].join("|")})`
|
|
14676
|
+
);
|
|
14344
14677
|
data[key] = parsed;
|
|
14345
14678
|
}
|
|
14346
14679
|
} catch {
|
|
@@ -14349,31 +14682,247 @@ function fixStringifiedJsonValues(data, schema) {
|
|
|
14349
14682
|
}
|
|
14350
14683
|
}
|
|
14351
14684
|
__name(fixStringifiedJsonValues, "fixStringifiedJsonValues");
|
|
14352
|
-
function
|
|
14353
|
-
const properties = schema
|
|
14354
|
-
const items = schema
|
|
14685
|
+
function fixNumericValues(data, schema) {
|
|
14686
|
+
const properties = schema["properties"];
|
|
14687
|
+
const items = schema["items"];
|
|
14355
14688
|
for (const key of Object.keys(data)) {
|
|
14356
14689
|
if (!(key in data)) continue;
|
|
14357
14690
|
const value = data[key];
|
|
14358
14691
|
const childSchema = Array.isArray(data) ? items : properties?.[key];
|
|
14359
14692
|
if (typeof value === "object" && value !== null) {
|
|
14360
|
-
|
|
14693
|
+
fixNumericValues(value, childSchema ?? {});
|
|
14361
14694
|
continue;
|
|
14362
14695
|
}
|
|
14363
14696
|
if (typeof value !== "string") continue;
|
|
14364
14697
|
const accepted = childSchema ? getAcceptedTypes(childSchema) : null;
|
|
14365
|
-
if (!accepted || accepted.has("string")
|
|
14698
|
+
if (!accepted || accepted.has("string")) continue;
|
|
14699
|
+
const wantsInteger = accepted.has("integer");
|
|
14700
|
+
const wantsNumber = accepted.has("number");
|
|
14701
|
+
if (!wantsInteger && !wantsNumber) continue;
|
|
14702
|
+
const trimmed = value.trim();
|
|
14703
|
+
if (!/^-?\d+(\.\d+)?$/.test(trimmed)) continue;
|
|
14704
|
+
const num = parseFloat(trimmed);
|
|
14705
|
+
if (wantsInteger && !wantsNumber && num % 1 !== 0) continue;
|
|
14706
|
+
const parsed = wantsNumber ? num : parseInt(trimmed, 10);
|
|
14707
|
+
if (Number.isFinite(parsed)) {
|
|
14708
|
+
data[key] = parsed;
|
|
14709
|
+
}
|
|
14710
|
+
}
|
|
14711
|
+
}
|
|
14712
|
+
__name(fixNumericValues, "fixNumericValues");
|
|
14713
|
+
function fixBooleanValues(data, schema, rootSchema, depth = 0) {
|
|
14714
|
+
if (depth > 64) return;
|
|
14715
|
+
const root = rootSchema ?? schema;
|
|
14716
|
+
const properties = getEffectiveProperties(schema, root);
|
|
14717
|
+
if (!properties && !schema["additionalProperties"]) return;
|
|
14718
|
+
for (const key of Object.keys(data)) {
|
|
14719
|
+
const value = data[key];
|
|
14720
|
+
const additionalProps = schema["additionalProperties"];
|
|
14721
|
+
const propSchema = properties?.[key] ?? (typeof additionalProps === "object" && additionalProps !== null ? additionalProps : void 0);
|
|
14722
|
+
const resolved = propSchema ? resolvePropSchema(propSchema, root) : void 0;
|
|
14723
|
+
if (typeof value === "object" && value !== null) {
|
|
14724
|
+
if (Array.isArray(value)) {
|
|
14725
|
+
if (Array.isArray(resolved?.["prefixItems"])) {
|
|
14726
|
+
for (let i = 0; i < value.length; i++) {
|
|
14727
|
+
const elSchema = resolveArrayElementSchema(resolved, root, i);
|
|
14728
|
+
if (!elSchema) continue;
|
|
14729
|
+
const item = value[i];
|
|
14730
|
+
if (typeof item === "object" && item !== null && !Array.isArray(item)) {
|
|
14731
|
+
if (schemaHasObjectShape(elSchema, root)) {
|
|
14732
|
+
fixBooleanValues(
|
|
14733
|
+
item,
|
|
14734
|
+
elSchema,
|
|
14735
|
+
root,
|
|
14736
|
+
depth + 1
|
|
14737
|
+
);
|
|
14738
|
+
}
|
|
14739
|
+
} else if (typeof item === "string") {
|
|
14740
|
+
const elAccepted = getAcceptedTypes(elSchema, root);
|
|
14741
|
+
if (elAccepted?.has("boolean") && !elAccepted.has("string")) {
|
|
14742
|
+
const lower = item.toLowerCase();
|
|
14743
|
+
if (lower === "true" || lower === "false") {
|
|
14744
|
+
debugLogger.debug(
|
|
14745
|
+
`coercion: ${key}[${i}] = ${JSON.stringify(item)} \u2192 ${lower === "true"} (accepted: ${[...elAccepted].join("|")})`
|
|
14746
|
+
);
|
|
14747
|
+
value[i] = lower === "true";
|
|
14748
|
+
}
|
|
14749
|
+
}
|
|
14750
|
+
}
|
|
14751
|
+
}
|
|
14752
|
+
} else {
|
|
14753
|
+
const itemsSchema = resolved?.["items"];
|
|
14754
|
+
if (itemsSchema) {
|
|
14755
|
+
const resolvedItems = resolvePropSchema(itemsSchema, root);
|
|
14756
|
+
if (!resolvedItems) continue;
|
|
14757
|
+
if (schemaHasObjectShape(resolvedItems, root)) {
|
|
14758
|
+
for (const item of value) {
|
|
14759
|
+
if (typeof item === "object" && item !== null && !Array.isArray(item)) {
|
|
14760
|
+
fixBooleanValues(
|
|
14761
|
+
item,
|
|
14762
|
+
resolvedItems,
|
|
14763
|
+
root,
|
|
14764
|
+
depth + 1
|
|
14765
|
+
);
|
|
14766
|
+
}
|
|
14767
|
+
}
|
|
14768
|
+
} else {
|
|
14769
|
+
const itemsAccepted = getAcceptedTypes(resolvedItems, root);
|
|
14770
|
+
if (itemsAccepted?.has("boolean") && !itemsAccepted.has("string")) {
|
|
14771
|
+
for (let i = 0; i < value.length; i++) {
|
|
14772
|
+
const item = value[i];
|
|
14773
|
+
if (typeof item === "string") {
|
|
14774
|
+
const lower = item.toLowerCase();
|
|
14775
|
+
if (lower === "true" || lower === "false") {
|
|
14776
|
+
debugLogger.debug(
|
|
14777
|
+
`coercion: ${key}[${i}] = ${JSON.stringify(item)} \u2192 ${lower === "true"} (accepted: ${[...itemsAccepted].join("|")})`
|
|
14778
|
+
);
|
|
14779
|
+
value[i] = lower === "true";
|
|
14780
|
+
}
|
|
14781
|
+
}
|
|
14782
|
+
}
|
|
14783
|
+
}
|
|
14784
|
+
}
|
|
14785
|
+
}
|
|
14786
|
+
}
|
|
14787
|
+
} else {
|
|
14788
|
+
if (resolved && schemaHasObjectShape(resolved, root)) {
|
|
14789
|
+
fixBooleanValues(
|
|
14790
|
+
value,
|
|
14791
|
+
resolved,
|
|
14792
|
+
root,
|
|
14793
|
+
depth + 1
|
|
14794
|
+
);
|
|
14795
|
+
}
|
|
14796
|
+
}
|
|
14366
14797
|
continue;
|
|
14367
14798
|
}
|
|
14368
|
-
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14799
|
+
if (typeof value === "string") {
|
|
14800
|
+
const lower = value.toLowerCase();
|
|
14801
|
+
if (lower !== "true" && lower !== "false") continue;
|
|
14802
|
+
const accepted = resolved ? getAcceptedTypes(resolved, root) : null;
|
|
14803
|
+
if (accepted?.has("boolean") && !accepted.has("string")) {
|
|
14804
|
+
debugLogger.debug(
|
|
14805
|
+
`coercion: ${key} = ${JSON.stringify(value)} \u2192 ${lower === "true"} (accepted: ${[...accepted].join("|")})`
|
|
14806
|
+
);
|
|
14807
|
+
data[key] = lower === "true";
|
|
14808
|
+
}
|
|
14373
14809
|
}
|
|
14374
14810
|
}
|
|
14375
14811
|
}
|
|
14376
14812
|
__name(fixBooleanValues, "fixBooleanValues");
|
|
14813
|
+
function fixStringValues(data, schema, rootSchema, depth = 0) {
|
|
14814
|
+
if (depth > 64) return;
|
|
14815
|
+
const root = rootSchema ?? schema;
|
|
14816
|
+
const properties = getEffectiveProperties(schema, root);
|
|
14817
|
+
if (!properties && !schema["additionalProperties"]) return;
|
|
14818
|
+
for (const key of Object.keys(data)) {
|
|
14819
|
+
const value = data[key];
|
|
14820
|
+
const additionalProps = schema["additionalProperties"];
|
|
14821
|
+
const propSchema = properties?.[key] ?? (typeof additionalProps === "object" && additionalProps !== null ? additionalProps : void 0);
|
|
14822
|
+
if (!propSchema) continue;
|
|
14823
|
+
const resolved = resolvePropSchema(
|
|
14824
|
+
propSchema,
|
|
14825
|
+
root
|
|
14826
|
+
);
|
|
14827
|
+
if (!resolved) continue;
|
|
14828
|
+
if (typeof value === "object" && value !== null) {
|
|
14829
|
+
if (Array.isArray(value)) {
|
|
14830
|
+
if (Array.isArray(resolved["prefixItems"])) {
|
|
14831
|
+
let coerced;
|
|
14832
|
+
for (let i = 0; i < value.length; i++) {
|
|
14833
|
+
const elSchema = resolveArrayElementSchema(resolved, root, i);
|
|
14834
|
+
if (!elSchema) continue;
|
|
14835
|
+
const item = value[i];
|
|
14836
|
+
if (typeof item === "object" && item !== null && !Array.isArray(item)) {
|
|
14837
|
+
if (schemaHasObjectShape(elSchema, root)) {
|
|
14838
|
+
fixStringValues(
|
|
14839
|
+
item,
|
|
14840
|
+
elSchema,
|
|
14841
|
+
root,
|
|
14842
|
+
depth + 1
|
|
14843
|
+
);
|
|
14844
|
+
}
|
|
14845
|
+
} else if (item !== null && item !== void 0 && (typeof item === "number" || typeof item === "boolean" || typeof item === "bigint")) {
|
|
14846
|
+
const elAccepted = getAcceptedTypes(elSchema, root);
|
|
14847
|
+
if (elAccepted?.has("string")) {
|
|
14848
|
+
const currentType = valueToSchemaType(item);
|
|
14849
|
+
if (currentType && !typeIsAccepted(currentType, elAccepted)) {
|
|
14850
|
+
coerced ??= [...value];
|
|
14851
|
+
debugLogger.debug(
|
|
14852
|
+
`coercion: ${key}[${i}] = ${String(item)} \u2192 ${JSON.stringify(String(item))} (accepted: ${[...elAccepted].join("|")})`
|
|
14853
|
+
);
|
|
14854
|
+
coerced[i] = String(item);
|
|
14855
|
+
}
|
|
14856
|
+
}
|
|
14857
|
+
}
|
|
14858
|
+
}
|
|
14859
|
+
if (coerced) data[key] = coerced;
|
|
14860
|
+
} else {
|
|
14861
|
+
const itemsSchema = resolved["items"];
|
|
14862
|
+
if (itemsSchema) {
|
|
14863
|
+
const resolvedItems = resolvePropSchema(itemsSchema, root);
|
|
14864
|
+
if (resolvedItems) {
|
|
14865
|
+
if (schemaHasObjectShape(resolvedItems, root)) {
|
|
14866
|
+
for (const item of value) {
|
|
14867
|
+
if (typeof item === "object" && item !== null && !Array.isArray(item)) {
|
|
14868
|
+
fixStringValues(
|
|
14869
|
+
item,
|
|
14870
|
+
resolvedItems,
|
|
14871
|
+
root,
|
|
14872
|
+
depth + 1
|
|
14873
|
+
);
|
|
14874
|
+
}
|
|
14875
|
+
}
|
|
14876
|
+
} else {
|
|
14877
|
+
const itemsAccepted = getAcceptedTypes(resolvedItems, root);
|
|
14878
|
+
if (itemsAccepted?.has("string")) {
|
|
14879
|
+
let coerced;
|
|
14880
|
+
for (let i = 0; i < value.length; i++) {
|
|
14881
|
+
const item = value[i];
|
|
14882
|
+
if (item !== null && item !== void 0 && (typeof item === "number" || typeof item === "boolean" || typeof item === "bigint")) {
|
|
14883
|
+
const currentType = valueToSchemaType(item);
|
|
14884
|
+
if (currentType && !typeIsAccepted(currentType, itemsAccepted)) {
|
|
14885
|
+
coerced ??= [...value];
|
|
14886
|
+
debugLogger.debug(
|
|
14887
|
+
`coercion: ${key}[${i}] = ${String(item)} \u2192 ${JSON.stringify(String(item))} (accepted: ${[...itemsAccepted].join("|")})`
|
|
14888
|
+
);
|
|
14889
|
+
coerced[i] = String(item);
|
|
14890
|
+
}
|
|
14891
|
+
}
|
|
14892
|
+
}
|
|
14893
|
+
if (coerced) data[key] = coerced;
|
|
14894
|
+
}
|
|
14895
|
+
}
|
|
14896
|
+
}
|
|
14897
|
+
}
|
|
14898
|
+
}
|
|
14899
|
+
} else {
|
|
14900
|
+
if (schemaHasObjectShape(resolved, root)) {
|
|
14901
|
+
fixStringValues(
|
|
14902
|
+
value,
|
|
14903
|
+
resolved,
|
|
14904
|
+
root,
|
|
14905
|
+
depth + 1
|
|
14906
|
+
);
|
|
14907
|
+
}
|
|
14908
|
+
}
|
|
14909
|
+
continue;
|
|
14910
|
+
}
|
|
14911
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
14912
|
+
const accepted = getAcceptedTypes(resolved, root);
|
|
14913
|
+
if (accepted?.has("string")) {
|
|
14914
|
+
const currentType = valueToSchemaType(value);
|
|
14915
|
+
if (currentType && !typeIsAccepted(currentType, accepted)) {
|
|
14916
|
+
debugLogger.debug(
|
|
14917
|
+
`coercion: ${key} = ${String(value)} \u2192 ${JSON.stringify(String(value))} (accepted: ${[...accepted].join("|")})`
|
|
14918
|
+
);
|
|
14919
|
+
data[key] = String(value);
|
|
14920
|
+
}
|
|
14921
|
+
}
|
|
14922
|
+
}
|
|
14923
|
+
}
|
|
14924
|
+
}
|
|
14925
|
+
__name(fixStringValues, "fixStringValues");
|
|
14377
14926
|
|
|
14378
14927
|
// packages/core/src/agents/runtime/agent-statistics.ts
|
|
14379
14928
|
init_esbuild_shims();
|
|
@@ -14769,7 +15318,7 @@ function isTool(obj) {
|
|
|
14769
15318
|
}
|
|
14770
15319
|
__name(isTool, "isTool");
|
|
14771
15320
|
function hasCycleInSchema(schema) {
|
|
14772
|
-
function
|
|
15321
|
+
function resolveRef2(ref) {
|
|
14773
15322
|
if (!ref.startsWith("#/")) {
|
|
14774
15323
|
return null;
|
|
14775
15324
|
}
|
|
@@ -14783,7 +15332,7 @@ function hasCycleInSchema(schema) {
|
|
|
14783
15332
|
}
|
|
14784
15333
|
return current;
|
|
14785
15334
|
}
|
|
14786
|
-
__name(
|
|
15335
|
+
__name(resolveRef2, "resolveRef");
|
|
14787
15336
|
function traverse(node, visitedRefs, pathRefs) {
|
|
14788
15337
|
if (typeof node !== "object" || node === null) {
|
|
14789
15338
|
return false;
|
|
@@ -14804,7 +15353,7 @@ function hasCycleInSchema(schema) {
|
|
|
14804
15353
|
if (visitedRefs.has(ref)) {
|
|
14805
15354
|
return false;
|
|
14806
15355
|
}
|
|
14807
|
-
const resolvedNode =
|
|
15356
|
+
const resolvedNode = resolveRef2(ref);
|
|
14808
15357
|
if (resolvedNode) {
|
|
14809
15358
|
visitedRefs.add(ref);
|
|
14810
15359
|
pathRefs.add(ref);
|