@codexhost/cli-linux-arm64 0.24.0 → 0.25.1
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 +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +3166 -3040
- package/app/console-web.js +1156 -585
- package/app/desktop-controller.mjs +645 -264
- package/app/host-runtime.mjs +10906 -10282
- package/app/plugins/antigravity/plugin.mjs +515 -369
- package/app/plugins/claude-code/plugin.mjs +583 -438
- package/app/plugins/codebuddy/plugin.mjs +551 -429
- package/app/plugins/codex-usage/plugin.mjs +344 -224
- package/app/plugins/copilot/plugin.mjs +408 -286
- package/app/plugins/cursor-cli/plugin.mjs +499 -360
- package/app/plugins/deepseek-harness/plugin.mjs +759 -520
- package/app/plugins/devin/plugin.mjs +385 -265
- package/app/plugins/grok/plugin.mjs +638 -516
- package/app/plugins/hermes/plugin.mjs +456 -334
- package/app/plugins/kimi-code/plugin.mjs +454 -332
- package/app/plugins/kiro-cli/plugin.mjs +445 -325
- package/app/plugins/omp/plugin.mjs +707 -339
- package/app/plugins/opencode/plugin.mjs +873 -741
- package/app/plugins/pi/plugin.mjs +481 -359
- package/app/plugins/qoder/plugin.mjs +682 -560
- package/app/plugins/qoder-cn/plugin.mjs +682 -560
- package/app/plugins/qwen-code/plugin.mjs +475 -355
- package/app/plugins/workbuddy/plugin.mjs +549 -429
- package/app/plugins/zcode/plugin.mjs +352 -232
- package/app/renderer-extension.js +1706 -945
- package/app/web/assets/{index-IvFk9KT-.js → index-DUOvhHbV.js} +82 -82
- package/app/web/codexhost-settings.js +416 -51
- package/app/web/index.html +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +64 -64
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
- package/app/web/plugins/deepseek-ai__dsh-api-workspace-controller/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-shortcuts/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-brand-official/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +74 -74
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +72 -72
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +97 -97
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -8
- package/app/web-modules/server.mjs +2132 -1312
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -3315,27 +3315,27 @@ var require_utils = __commonJS({
|
|
|
3315
3315
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
3316
3316
|
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
3317
3317
|
var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
|
|
3318
|
-
function stringArrayToHexStripped(
|
|
3318
|
+
function stringArrayToHexStripped(input2) {
|
|
3319
3319
|
let acc = "";
|
|
3320
3320
|
let code = 0;
|
|
3321
3321
|
let i = 0;
|
|
3322
|
-
for (i = 0; i <
|
|
3323
|
-
code =
|
|
3322
|
+
for (i = 0; i < input2.length; i++) {
|
|
3323
|
+
code = input2[i].charCodeAt(0);
|
|
3324
3324
|
if (code === 48) {
|
|
3325
3325
|
continue;
|
|
3326
3326
|
}
|
|
3327
3327
|
if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
|
|
3328
3328
|
return "";
|
|
3329
3329
|
}
|
|
3330
|
-
acc +=
|
|
3330
|
+
acc += input2[i];
|
|
3331
3331
|
break;
|
|
3332
3332
|
}
|
|
3333
|
-
for (i += 1; i <
|
|
3334
|
-
code =
|
|
3333
|
+
for (i += 1; i < input2.length; i++) {
|
|
3334
|
+
code = input2[i].charCodeAt(0);
|
|
3335
3335
|
if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
|
|
3336
3336
|
return "";
|
|
3337
3337
|
}
|
|
3338
|
-
acc +=
|
|
3338
|
+
acc += input2[i];
|
|
3339
3339
|
}
|
|
3340
3340
|
return acc;
|
|
3341
3341
|
}
|
|
@@ -3357,7 +3357,7 @@ var require_utils = __commonJS({
|
|
|
3357
3357
|
}
|
|
3358
3358
|
return true;
|
|
3359
3359
|
}
|
|
3360
|
-
function getIPV6(
|
|
3360
|
+
function getIPV6(input2) {
|
|
3361
3361
|
let tokenCount = 0;
|
|
3362
3362
|
const output = { error: false, address: "", zone: "" };
|
|
3363
3363
|
const address = [];
|
|
@@ -3365,8 +3365,8 @@ var require_utils = __commonJS({
|
|
|
3365
3365
|
let endipv6Encountered = false;
|
|
3366
3366
|
let endIpv6 = false;
|
|
3367
3367
|
let consume = consumeHextets;
|
|
3368
|
-
for (let i = 0; i <
|
|
3369
|
-
const cursor =
|
|
3368
|
+
for (let i = 0; i < input2.length; i++) {
|
|
3369
|
+
const cursor = input2[i];
|
|
3370
3370
|
if (cursor === "[" || cursor === "]") {
|
|
3371
3371
|
continue;
|
|
3372
3372
|
}
|
|
@@ -3381,7 +3381,7 @@ var require_utils = __commonJS({
|
|
|
3381
3381
|
output.error = true;
|
|
3382
3382
|
break;
|
|
3383
3383
|
}
|
|
3384
|
-
if (i > 0 &&
|
|
3384
|
+
if (i > 0 && input2[i - 1] === ":") {
|
|
3385
3385
|
endipv6Encountered = true;
|
|
3386
3386
|
}
|
|
3387
3387
|
address.push(":");
|
|
@@ -3433,37 +3433,37 @@ var require_utils = __commonJS({
|
|
|
3433
3433
|
return ind;
|
|
3434
3434
|
}
|
|
3435
3435
|
function removeDotSegments(path6) {
|
|
3436
|
-
let
|
|
3436
|
+
let input2 = path6;
|
|
3437
3437
|
const output = [];
|
|
3438
3438
|
let nextSlash = -1;
|
|
3439
3439
|
let len = 0;
|
|
3440
|
-
while (len =
|
|
3440
|
+
while (len = input2.length) {
|
|
3441
3441
|
if (len === 1) {
|
|
3442
|
-
if (
|
|
3442
|
+
if (input2 === ".") {
|
|
3443
3443
|
break;
|
|
3444
|
-
} else if (
|
|
3444
|
+
} else if (input2 === "/") {
|
|
3445
3445
|
output.push("/");
|
|
3446
3446
|
break;
|
|
3447
3447
|
} else {
|
|
3448
|
-
output.push(
|
|
3448
|
+
output.push(input2);
|
|
3449
3449
|
break;
|
|
3450
3450
|
}
|
|
3451
3451
|
} else if (len === 2) {
|
|
3452
|
-
if (
|
|
3453
|
-
if (
|
|
3452
|
+
if (input2[0] === ".") {
|
|
3453
|
+
if (input2[1] === ".") {
|
|
3454
3454
|
break;
|
|
3455
|
-
} else if (
|
|
3456
|
-
|
|
3455
|
+
} else if (input2[1] === "/") {
|
|
3456
|
+
input2 = input2.slice(2);
|
|
3457
3457
|
continue;
|
|
3458
3458
|
}
|
|
3459
|
-
} else if (
|
|
3460
|
-
if (
|
|
3459
|
+
} else if (input2[0] === "/") {
|
|
3460
|
+
if (input2[1] === "." || input2[1] === "/") {
|
|
3461
3461
|
output.push("/");
|
|
3462
3462
|
break;
|
|
3463
3463
|
}
|
|
3464
3464
|
}
|
|
3465
3465
|
} else if (len === 3) {
|
|
3466
|
-
if (
|
|
3466
|
+
if (input2 === "/..") {
|
|
3467
3467
|
if (output.length !== 0) {
|
|
3468
3468
|
output.pop();
|
|
3469
3469
|
}
|
|
@@ -3471,24 +3471,24 @@ var require_utils = __commonJS({
|
|
|
3471
3471
|
break;
|
|
3472
3472
|
}
|
|
3473
3473
|
}
|
|
3474
|
-
if (
|
|
3475
|
-
if (
|
|
3476
|
-
if (
|
|
3477
|
-
|
|
3474
|
+
if (input2[0] === ".") {
|
|
3475
|
+
if (input2[1] === ".") {
|
|
3476
|
+
if (input2[2] === "/") {
|
|
3477
|
+
input2 = input2.slice(3);
|
|
3478
3478
|
continue;
|
|
3479
3479
|
}
|
|
3480
|
-
} else if (
|
|
3481
|
-
|
|
3480
|
+
} else if (input2[1] === "/") {
|
|
3481
|
+
input2 = input2.slice(2);
|
|
3482
3482
|
continue;
|
|
3483
3483
|
}
|
|
3484
|
-
} else if (
|
|
3485
|
-
if (
|
|
3486
|
-
if (
|
|
3487
|
-
|
|
3484
|
+
} else if (input2[0] === "/") {
|
|
3485
|
+
if (input2[1] === ".") {
|
|
3486
|
+
if (input2[2] === "/") {
|
|
3487
|
+
input2 = input2.slice(2);
|
|
3488
3488
|
continue;
|
|
3489
|
-
} else if (
|
|
3490
|
-
if (
|
|
3491
|
-
|
|
3489
|
+
} else if (input2[2] === ".") {
|
|
3490
|
+
if (input2[3] === "/") {
|
|
3491
|
+
input2 = input2.slice(3);
|
|
3492
3492
|
if (output.length !== 0) {
|
|
3493
3493
|
output.pop();
|
|
3494
3494
|
}
|
|
@@ -3497,12 +3497,12 @@ var require_utils = __commonJS({
|
|
|
3497
3497
|
}
|
|
3498
3498
|
}
|
|
3499
3499
|
}
|
|
3500
|
-
if ((nextSlash =
|
|
3501
|
-
output.push(
|
|
3500
|
+
if ((nextSlash = input2.indexOf("/", 1)) === -1) {
|
|
3501
|
+
output.push(input2);
|
|
3502
3502
|
break;
|
|
3503
3503
|
} else {
|
|
3504
|
-
output.push(
|
|
3505
|
-
|
|
3504
|
+
output.push(input2.slice(0, nextSlash));
|
|
3505
|
+
input2 = input2.slice(nextSlash);
|
|
3506
3506
|
}
|
|
3507
3507
|
}
|
|
3508
3508
|
return output.join("");
|
|
@@ -3515,14 +3515,14 @@ var require_utils = __commonJS({
|
|
|
3515
3515
|
re2.lastIndex = 0;
|
|
3516
3516
|
return host.replace(re2, (ch) => HOST_DELIMS[ch]);
|
|
3517
3517
|
}
|
|
3518
|
-
function normalizePercentEncoding(
|
|
3519
|
-
if (
|
|
3520
|
-
return
|
|
3518
|
+
function normalizePercentEncoding(input2, decodeUnreserved = false) {
|
|
3519
|
+
if (input2.indexOf("%") === -1) {
|
|
3520
|
+
return input2;
|
|
3521
3521
|
}
|
|
3522
3522
|
let output = "";
|
|
3523
|
-
for (let i = 0; i <
|
|
3524
|
-
if (
|
|
3525
|
-
const hex3 =
|
|
3523
|
+
for (let i = 0; i < input2.length; i++) {
|
|
3524
|
+
if (input2[i] === "%" && i + 2 < input2.length) {
|
|
3525
|
+
const hex3 = input2.slice(i + 1, i + 3);
|
|
3526
3526
|
if (isHexPair(hex3)) {
|
|
3527
3527
|
const normalizedHex = hex3.toUpperCase();
|
|
3528
3528
|
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
@@ -3535,15 +3535,15 @@ var require_utils = __commonJS({
|
|
|
3535
3535
|
continue;
|
|
3536
3536
|
}
|
|
3537
3537
|
}
|
|
3538
|
-
output +=
|
|
3538
|
+
output += input2[i];
|
|
3539
3539
|
}
|
|
3540
3540
|
return output;
|
|
3541
3541
|
}
|
|
3542
|
-
function normalizePathEncoding(
|
|
3542
|
+
function normalizePathEncoding(input2) {
|
|
3543
3543
|
let output = "";
|
|
3544
|
-
for (let i = 0; i <
|
|
3545
|
-
if (
|
|
3546
|
-
const hex3 =
|
|
3544
|
+
for (let i = 0; i < input2.length; i++) {
|
|
3545
|
+
if (input2[i] === "%" && i + 2 < input2.length) {
|
|
3546
|
+
const hex3 = input2.slice(i + 1, i + 3);
|
|
3547
3547
|
if (isHexPair(hex3)) {
|
|
3548
3548
|
const normalizedHex = hex3.toUpperCase();
|
|
3549
3549
|
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
@@ -3556,26 +3556,26 @@ var require_utils = __commonJS({
|
|
|
3556
3556
|
continue;
|
|
3557
3557
|
}
|
|
3558
3558
|
}
|
|
3559
|
-
if (isPathCharacter(
|
|
3560
|
-
output +=
|
|
3559
|
+
if (isPathCharacter(input2[i])) {
|
|
3560
|
+
output += input2[i];
|
|
3561
3561
|
} else {
|
|
3562
|
-
output += escape(
|
|
3562
|
+
output += escape(input2[i]);
|
|
3563
3563
|
}
|
|
3564
3564
|
}
|
|
3565
3565
|
return output;
|
|
3566
3566
|
}
|
|
3567
|
-
function escapePreservingEscapes(
|
|
3567
|
+
function escapePreservingEscapes(input2) {
|
|
3568
3568
|
let output = "";
|
|
3569
|
-
for (let i = 0; i <
|
|
3570
|
-
if (
|
|
3571
|
-
const hex3 =
|
|
3569
|
+
for (let i = 0; i < input2.length; i++) {
|
|
3570
|
+
if (input2[i] === "%" && i + 2 < input2.length) {
|
|
3571
|
+
const hex3 = input2.slice(i + 1, i + 3);
|
|
3572
3572
|
if (isHexPair(hex3)) {
|
|
3573
3573
|
output += "%" + hex3.toUpperCase();
|
|
3574
3574
|
i += 2;
|
|
3575
3575
|
continue;
|
|
3576
3576
|
}
|
|
3577
3577
|
}
|
|
3578
|
-
output += escape(
|
|
3578
|
+
output += escape(input2[i]);
|
|
3579
3579
|
}
|
|
3580
3580
|
return output;
|
|
3581
3581
|
}
|
|
@@ -4524,7 +4524,7 @@ var require_core = __commonJS({
|
|
|
4524
4524
|
errorsText(errors = this.errors, { separator = ", ", dataVar = "data" } = {}) {
|
|
4525
4525
|
if (!errors || errors.length === 0)
|
|
4526
4526
|
return "No errors";
|
|
4527
|
-
return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((
|
|
4527
|
+
return errors.map((e) => `${dataVar}${e.instancePath} ${e.message}`).reduce((text2, msg) => text2 + separator + msg);
|
|
4528
4528
|
}
|
|
4529
4529
|
$dataMetaSchema(metaSchema, keywordsJsonPointers) {
|
|
4530
4530
|
const rules = this.RULES.all;
|
|
@@ -7604,8 +7604,8 @@ function cached(getter) {
|
|
|
7604
7604
|
}
|
|
7605
7605
|
};
|
|
7606
7606
|
}
|
|
7607
|
-
function nullish(
|
|
7608
|
-
return
|
|
7607
|
+
function nullish(input2) {
|
|
7608
|
+
return input2 === null || input2 === void 0;
|
|
7609
7609
|
}
|
|
7610
7610
|
function cleanRegex(source) {
|
|
7611
7611
|
const start = source.startsWith("^") ? 1 : 0;
|
|
@@ -7692,8 +7692,8 @@ function randomString(length = 10) {
|
|
|
7692
7692
|
function esc(str) {
|
|
7693
7693
|
return JSON.stringify(str);
|
|
7694
7694
|
}
|
|
7695
|
-
function slugify(
|
|
7696
|
-
return
|
|
7695
|
+
function slugify(input2) {
|
|
7696
|
+
return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
7697
7697
|
}
|
|
7698
7698
|
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
7699
7699
|
};
|
|
@@ -8098,19 +8098,19 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
8098
8098
|
}
|
|
8099
8099
|
return rest;
|
|
8100
8100
|
}
|
|
8101
|
-
function getSizableOrigin(
|
|
8102
|
-
if (
|
|
8101
|
+
function getSizableOrigin(input2) {
|
|
8102
|
+
if (input2 instanceof Set)
|
|
8103
8103
|
return "set";
|
|
8104
|
-
if (
|
|
8104
|
+
if (input2 instanceof Map)
|
|
8105
8105
|
return "map";
|
|
8106
|
-
if (
|
|
8106
|
+
if (input2 instanceof File)
|
|
8107
8107
|
return "file";
|
|
8108
8108
|
return "unknown";
|
|
8109
8109
|
}
|
|
8110
|
-
function getLengthableOrigin(
|
|
8111
|
-
if (Array.isArray(
|
|
8110
|
+
function getLengthableOrigin(input2) {
|
|
8111
|
+
if (Array.isArray(input2))
|
|
8112
8112
|
return "array";
|
|
8113
|
-
if (typeof
|
|
8113
|
+
if (typeof input2 === "string")
|
|
8114
8114
|
return "string";
|
|
8115
8115
|
return "unknown";
|
|
8116
8116
|
}
|
|
@@ -8136,12 +8136,12 @@ function parsedType(data) {
|
|
|
8136
8136
|
return t;
|
|
8137
8137
|
}
|
|
8138
8138
|
function issue(...args) {
|
|
8139
|
-
const [iss,
|
|
8139
|
+
const [iss, input2, inst] = args;
|
|
8140
8140
|
if (typeof iss === "string") {
|
|
8141
8141
|
return {
|
|
8142
8142
|
message: iss,
|
|
8143
8143
|
code: "custom",
|
|
8144
|
-
input,
|
|
8144
|
+
input: input2,
|
|
8145
8145
|
inst
|
|
8146
8146
|
};
|
|
8147
8147
|
}
|
|
@@ -8685,23 +8685,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
8685
8685
|
bag.pattern = integer;
|
|
8686
8686
|
});
|
|
8687
8687
|
inst._zod.check = (payload) => {
|
|
8688
|
-
const
|
|
8688
|
+
const input2 = payload.value;
|
|
8689
8689
|
if (isInt) {
|
|
8690
|
-
if (!Number.isInteger(
|
|
8690
|
+
if (!Number.isInteger(input2)) {
|
|
8691
8691
|
payload.issues.push({
|
|
8692
8692
|
expected: origin,
|
|
8693
8693
|
format: def.format,
|
|
8694
8694
|
code: "invalid_type",
|
|
8695
8695
|
continue: false,
|
|
8696
|
-
input,
|
|
8696
|
+
input: input2,
|
|
8697
8697
|
inst
|
|
8698
8698
|
});
|
|
8699
8699
|
return;
|
|
8700
8700
|
}
|
|
8701
|
-
if (!Number.isSafeInteger(
|
|
8702
|
-
if (
|
|
8701
|
+
if (!Number.isSafeInteger(input2)) {
|
|
8702
|
+
if (input2 > 0) {
|
|
8703
8703
|
payload.issues.push({
|
|
8704
|
-
input,
|
|
8704
|
+
input: input2,
|
|
8705
8705
|
code: "too_big",
|
|
8706
8706
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
8707
8707
|
note: "Integers must be within the safe integer range.",
|
|
@@ -8712,7 +8712,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
8712
8712
|
});
|
|
8713
8713
|
} else {
|
|
8714
8714
|
payload.issues.push({
|
|
8715
|
-
input,
|
|
8715
|
+
input: input2,
|
|
8716
8716
|
code: "too_small",
|
|
8717
8717
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
8718
8718
|
note: "Integers must be within the safe integer range.",
|
|
@@ -8725,10 +8725,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
8725
8725
|
return;
|
|
8726
8726
|
}
|
|
8727
8727
|
}
|
|
8728
|
-
if (
|
|
8728
|
+
if (input2 < minimum) {
|
|
8729
8729
|
payload.issues.push({
|
|
8730
8730
|
origin: "number",
|
|
8731
|
-
input,
|
|
8731
|
+
input: input2,
|
|
8732
8732
|
code: "too_small",
|
|
8733
8733
|
minimum,
|
|
8734
8734
|
inclusive: true,
|
|
@@ -8736,10 +8736,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
8736
8736
|
continue: !def.abort
|
|
8737
8737
|
});
|
|
8738
8738
|
}
|
|
8739
|
-
if (
|
|
8739
|
+
if (input2 > maximum) {
|
|
8740
8740
|
payload.issues.push({
|
|
8741
8741
|
origin: "number",
|
|
8742
|
-
input,
|
|
8742
|
+
input: input2,
|
|
8743
8743
|
code: "too_big",
|
|
8744
8744
|
maximum,
|
|
8745
8745
|
inclusive: true,
|
|
@@ -8759,11 +8759,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
8759
8759
|
bag.maximum = maximum;
|
|
8760
8760
|
});
|
|
8761
8761
|
inst._zod.check = (payload) => {
|
|
8762
|
-
const
|
|
8763
|
-
if (
|
|
8762
|
+
const input2 = payload.value;
|
|
8763
|
+
if (input2 < minimum) {
|
|
8764
8764
|
payload.issues.push({
|
|
8765
8765
|
origin: "bigint",
|
|
8766
|
-
input,
|
|
8766
|
+
input: input2,
|
|
8767
8767
|
code: "too_small",
|
|
8768
8768
|
minimum,
|
|
8769
8769
|
inclusive: true,
|
|
@@ -8771,10 +8771,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
8771
8771
|
continue: !def.abort
|
|
8772
8772
|
});
|
|
8773
8773
|
}
|
|
8774
|
-
if (
|
|
8774
|
+
if (input2 > maximum) {
|
|
8775
8775
|
payload.issues.push({
|
|
8776
8776
|
origin: "bigint",
|
|
8777
|
-
input,
|
|
8777
|
+
input: input2,
|
|
8778
8778
|
code: "too_big",
|
|
8779
8779
|
maximum,
|
|
8780
8780
|
inclusive: true,
|
|
@@ -8797,16 +8797,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
8797
8797
|
inst2._zod.bag.maximum = def.maximum;
|
|
8798
8798
|
});
|
|
8799
8799
|
inst._zod.check = (payload) => {
|
|
8800
|
-
const
|
|
8801
|
-
const size =
|
|
8800
|
+
const input2 = payload.value;
|
|
8801
|
+
const size = input2.size;
|
|
8802
8802
|
if (size <= def.maximum)
|
|
8803
8803
|
return;
|
|
8804
8804
|
payload.issues.push({
|
|
8805
|
-
origin: getSizableOrigin(
|
|
8805
|
+
origin: getSizableOrigin(input2),
|
|
8806
8806
|
code: "too_big",
|
|
8807
8807
|
maximum: def.maximum,
|
|
8808
8808
|
inclusive: true,
|
|
8809
|
-
input,
|
|
8809
|
+
input: input2,
|
|
8810
8810
|
inst,
|
|
8811
8811
|
continue: !def.abort
|
|
8812
8812
|
});
|
|
@@ -8825,16 +8825,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
8825
8825
|
inst2._zod.bag.minimum = def.minimum;
|
|
8826
8826
|
});
|
|
8827
8827
|
inst._zod.check = (payload) => {
|
|
8828
|
-
const
|
|
8829
|
-
const size =
|
|
8828
|
+
const input2 = payload.value;
|
|
8829
|
+
const size = input2.size;
|
|
8830
8830
|
if (size >= def.minimum)
|
|
8831
8831
|
return;
|
|
8832
8832
|
payload.issues.push({
|
|
8833
|
-
origin: getSizableOrigin(
|
|
8833
|
+
origin: getSizableOrigin(input2),
|
|
8834
8834
|
code: "too_small",
|
|
8835
8835
|
minimum: def.minimum,
|
|
8836
8836
|
inclusive: true,
|
|
8837
|
-
input,
|
|
8837
|
+
input: input2,
|
|
8838
8838
|
inst,
|
|
8839
8839
|
continue: !def.abort
|
|
8840
8840
|
});
|
|
@@ -8854,13 +8854,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
8854
8854
|
bag.size = def.size;
|
|
8855
8855
|
});
|
|
8856
8856
|
inst._zod.check = (payload) => {
|
|
8857
|
-
const
|
|
8858
|
-
const size =
|
|
8857
|
+
const input2 = payload.value;
|
|
8858
|
+
const size = input2.size;
|
|
8859
8859
|
if (size === def.size)
|
|
8860
8860
|
return;
|
|
8861
8861
|
const tooBig = size > def.size;
|
|
8862
8862
|
payload.issues.push({
|
|
8863
|
-
origin: getSizableOrigin(
|
|
8863
|
+
origin: getSizableOrigin(input2),
|
|
8864
8864
|
...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
|
|
8865
8865
|
inclusive: true,
|
|
8866
8866
|
exact: true,
|
|
@@ -8883,17 +8883,17 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
8883
8883
|
inst2._zod.bag.maximum = def.maximum;
|
|
8884
8884
|
});
|
|
8885
8885
|
inst._zod.check = (payload) => {
|
|
8886
|
-
const
|
|
8887
|
-
const length =
|
|
8886
|
+
const input2 = payload.value;
|
|
8887
|
+
const length = input2.length;
|
|
8888
8888
|
if (length <= def.maximum)
|
|
8889
8889
|
return;
|
|
8890
|
-
const origin = getLengthableOrigin(
|
|
8890
|
+
const origin = getLengthableOrigin(input2);
|
|
8891
8891
|
payload.issues.push({
|
|
8892
8892
|
origin,
|
|
8893
8893
|
code: "too_big",
|
|
8894
8894
|
maximum: def.maximum,
|
|
8895
8895
|
inclusive: true,
|
|
8896
|
-
input,
|
|
8896
|
+
input: input2,
|
|
8897
8897
|
inst,
|
|
8898
8898
|
continue: !def.abort
|
|
8899
8899
|
});
|
|
@@ -8912,17 +8912,17 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
8912
8912
|
inst2._zod.bag.minimum = def.minimum;
|
|
8913
8913
|
});
|
|
8914
8914
|
inst._zod.check = (payload) => {
|
|
8915
|
-
const
|
|
8916
|
-
const length =
|
|
8915
|
+
const input2 = payload.value;
|
|
8916
|
+
const length = input2.length;
|
|
8917
8917
|
if (length >= def.minimum)
|
|
8918
8918
|
return;
|
|
8919
|
-
const origin = getLengthableOrigin(
|
|
8919
|
+
const origin = getLengthableOrigin(input2);
|
|
8920
8920
|
payload.issues.push({
|
|
8921
8921
|
origin,
|
|
8922
8922
|
code: "too_small",
|
|
8923
8923
|
minimum: def.minimum,
|
|
8924
8924
|
inclusive: true,
|
|
8925
|
-
input,
|
|
8925
|
+
input: input2,
|
|
8926
8926
|
inst,
|
|
8927
8927
|
continue: !def.abort
|
|
8928
8928
|
});
|
|
@@ -8942,11 +8942,11 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
8942
8942
|
bag.length = def.length;
|
|
8943
8943
|
});
|
|
8944
8944
|
inst._zod.check = (payload) => {
|
|
8945
|
-
const
|
|
8946
|
-
const length =
|
|
8945
|
+
const input2 = payload.value;
|
|
8946
|
+
const length = input2.length;
|
|
8947
8947
|
if (length === def.length)
|
|
8948
8948
|
return;
|
|
8949
|
-
const origin = getLengthableOrigin(
|
|
8949
|
+
const origin = getLengthableOrigin(input2);
|
|
8950
8950
|
const tooBig = length > def.length;
|
|
8951
8951
|
payload.issues.push({
|
|
8952
8952
|
origin,
|
|
@@ -9617,15 +9617,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
9617
9617
|
payload.value = Number(payload.value);
|
|
9618
9618
|
} catch (_) {
|
|
9619
9619
|
}
|
|
9620
|
-
const
|
|
9621
|
-
if (typeof
|
|
9620
|
+
const input2 = payload.value;
|
|
9621
|
+
if (typeof input2 === "number" && !Number.isNaN(input2) && Number.isFinite(input2)) {
|
|
9622
9622
|
return payload;
|
|
9623
9623
|
}
|
|
9624
|
-
const received = typeof
|
|
9624
|
+
const received = typeof input2 === "number" ? Number.isNaN(input2) ? "NaN" : !Number.isFinite(input2) ? "Infinity" : void 0 : void 0;
|
|
9625
9625
|
payload.issues.push({
|
|
9626
9626
|
expected: "number",
|
|
9627
9627
|
code: "invalid_type",
|
|
9628
|
-
input,
|
|
9628
|
+
input: input2,
|
|
9629
9629
|
inst,
|
|
9630
9630
|
...received ? { received } : {}
|
|
9631
9631
|
});
|
|
@@ -9645,13 +9645,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
9645
9645
|
payload.value = Boolean(payload.value);
|
|
9646
9646
|
} catch (_) {
|
|
9647
9647
|
}
|
|
9648
|
-
const
|
|
9649
|
-
if (typeof
|
|
9648
|
+
const input2 = payload.value;
|
|
9649
|
+
if (typeof input2 === "boolean")
|
|
9650
9650
|
return payload;
|
|
9651
9651
|
payload.issues.push({
|
|
9652
9652
|
expected: "boolean",
|
|
9653
9653
|
code: "invalid_type",
|
|
9654
|
-
input,
|
|
9654
|
+
input: input2,
|
|
9655
9655
|
inst
|
|
9656
9656
|
});
|
|
9657
9657
|
return payload;
|
|
@@ -9684,13 +9684,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
|
|
|
9684
9684
|
var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
|
|
9685
9685
|
$ZodType.init(inst, def);
|
|
9686
9686
|
inst._zod.parse = (payload, _ctx) => {
|
|
9687
|
-
const
|
|
9688
|
-
if (typeof
|
|
9687
|
+
const input2 = payload.value;
|
|
9688
|
+
if (typeof input2 === "symbol")
|
|
9689
9689
|
return payload;
|
|
9690
9690
|
payload.issues.push({
|
|
9691
9691
|
expected: "symbol",
|
|
9692
9692
|
code: "invalid_type",
|
|
9693
|
-
input,
|
|
9693
|
+
input: input2,
|
|
9694
9694
|
inst
|
|
9695
9695
|
});
|
|
9696
9696
|
return payload;
|
|
@@ -9701,13 +9701,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
|
|
|
9701
9701
|
inst._zod.pattern = _undefined;
|
|
9702
9702
|
inst._zod.values = /* @__PURE__ */ new Set([void 0]);
|
|
9703
9703
|
inst._zod.parse = (payload, _ctx) => {
|
|
9704
|
-
const
|
|
9705
|
-
if (typeof
|
|
9704
|
+
const input2 = payload.value;
|
|
9705
|
+
if (typeof input2 === "undefined")
|
|
9706
9706
|
return payload;
|
|
9707
9707
|
payload.issues.push({
|
|
9708
9708
|
expected: "undefined",
|
|
9709
9709
|
code: "invalid_type",
|
|
9710
|
-
input,
|
|
9710
|
+
input: input2,
|
|
9711
9711
|
inst
|
|
9712
9712
|
});
|
|
9713
9713
|
return payload;
|
|
@@ -9718,13 +9718,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
|
9718
9718
|
inst._zod.pattern = _null;
|
|
9719
9719
|
inst._zod.values = /* @__PURE__ */ new Set([null]);
|
|
9720
9720
|
inst._zod.parse = (payload, _ctx) => {
|
|
9721
|
-
const
|
|
9722
|
-
if (
|
|
9721
|
+
const input2 = payload.value;
|
|
9722
|
+
if (input2 === null)
|
|
9723
9723
|
return payload;
|
|
9724
9724
|
payload.issues.push({
|
|
9725
9725
|
expected: "null",
|
|
9726
9726
|
code: "invalid_type",
|
|
9727
|
-
input,
|
|
9727
|
+
input: input2,
|
|
9728
9728
|
inst
|
|
9729
9729
|
});
|
|
9730
9730
|
return payload;
|
|
@@ -9753,13 +9753,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
9753
9753
|
var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
|
|
9754
9754
|
$ZodType.init(inst, def);
|
|
9755
9755
|
inst._zod.parse = (payload, _ctx) => {
|
|
9756
|
-
const
|
|
9757
|
-
if (typeof
|
|
9756
|
+
const input2 = payload.value;
|
|
9757
|
+
if (typeof input2 === "undefined")
|
|
9758
9758
|
return payload;
|
|
9759
9759
|
payload.issues.push({
|
|
9760
9760
|
expected: "void",
|
|
9761
9761
|
code: "invalid_type",
|
|
9762
|
-
input,
|
|
9762
|
+
input: input2,
|
|
9763
9763
|
inst
|
|
9764
9764
|
});
|
|
9765
9765
|
return payload;
|
|
@@ -9774,15 +9774,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
9774
9774
|
} catch (_err) {
|
|
9775
9775
|
}
|
|
9776
9776
|
}
|
|
9777
|
-
const
|
|
9778
|
-
const isDate =
|
|
9779
|
-
const isValidDate = isDate && !Number.isNaN(
|
|
9777
|
+
const input2 = payload.value;
|
|
9778
|
+
const isDate = input2 instanceof Date;
|
|
9779
|
+
const isValidDate = isDate && !Number.isNaN(input2.getTime());
|
|
9780
9780
|
if (isValidDate)
|
|
9781
9781
|
return payload;
|
|
9782
9782
|
payload.issues.push({
|
|
9783
9783
|
expected: "date",
|
|
9784
9784
|
code: "invalid_type",
|
|
9785
|
-
input,
|
|
9785
|
+
input: input2,
|
|
9786
9786
|
...isDate ? { received: "Invalid Date" } : {},
|
|
9787
9787
|
inst
|
|
9788
9788
|
});
|
|
@@ -9798,20 +9798,20 @@ function handleArrayResult(result, final, index) {
|
|
|
9798
9798
|
var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
9799
9799
|
$ZodType.init(inst, def);
|
|
9800
9800
|
inst._zod.parse = (payload, ctx) => {
|
|
9801
|
-
const
|
|
9802
|
-
if (!Array.isArray(
|
|
9801
|
+
const input2 = payload.value;
|
|
9802
|
+
if (!Array.isArray(input2)) {
|
|
9803
9803
|
payload.issues.push({
|
|
9804
9804
|
expected: "array",
|
|
9805
9805
|
code: "invalid_type",
|
|
9806
|
-
input,
|
|
9806
|
+
input: input2,
|
|
9807
9807
|
inst
|
|
9808
9808
|
});
|
|
9809
9809
|
return payload;
|
|
9810
9810
|
}
|
|
9811
|
-
payload.value = Array(
|
|
9811
|
+
payload.value = Array(input2.length);
|
|
9812
9812
|
const proms = [];
|
|
9813
|
-
for (let i = 0; i <
|
|
9814
|
-
const item =
|
|
9813
|
+
for (let i = 0; i < input2.length; i++) {
|
|
9814
|
+
const item = input2[i];
|
|
9815
9815
|
const result = def.element._zod.run({
|
|
9816
9816
|
value: item,
|
|
9817
9817
|
issues: []
|
|
@@ -9828,8 +9828,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
9828
9828
|
return payload;
|
|
9829
9829
|
};
|
|
9830
9830
|
});
|
|
9831
|
-
function handlePropertyResult(result, final, key,
|
|
9832
|
-
const isPresent = key in
|
|
9831
|
+
function handlePropertyResult(result, final, key, input2, isOptionalIn, isOptionalOut) {
|
|
9832
|
+
const isPresent = key in input2;
|
|
9833
9833
|
if (result.issues.length) {
|
|
9834
9834
|
if (isOptionalIn && isOptionalOut && !isPresent) {
|
|
9835
9835
|
return;
|
|
@@ -9871,14 +9871,14 @@ function normalizeDef(def) {
|
|
|
9871
9871
|
optionalKeys: new Set(okeys)
|
|
9872
9872
|
};
|
|
9873
9873
|
}
|
|
9874
|
-
function handleCatchall(proms,
|
|
9874
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
9875
9875
|
const unrecognized = [];
|
|
9876
9876
|
const keySet = def.keySet;
|
|
9877
9877
|
const _catchall = def.catchall._zod;
|
|
9878
9878
|
const t = _catchall.def.type;
|
|
9879
9879
|
const isOptionalIn = _catchall.optin === "optional";
|
|
9880
9880
|
const isOptionalOut = _catchall.optout === "optional";
|
|
9881
|
-
for (const key in
|
|
9881
|
+
for (const key in input2) {
|
|
9882
9882
|
if (key === "__proto__")
|
|
9883
9883
|
continue;
|
|
9884
9884
|
if (keySet.has(key))
|
|
@@ -9887,18 +9887,18 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
9887
9887
|
unrecognized.push(key);
|
|
9888
9888
|
continue;
|
|
9889
9889
|
}
|
|
9890
|
-
const r = _catchall.run({ value:
|
|
9890
|
+
const r = _catchall.run({ value: input2[key], issues: [] }, ctx);
|
|
9891
9891
|
if (r instanceof Promise) {
|
|
9892
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
9892
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
|
|
9893
9893
|
} else {
|
|
9894
|
-
handlePropertyResult(r, payload, key,
|
|
9894
|
+
handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
|
|
9895
9895
|
}
|
|
9896
9896
|
}
|
|
9897
9897
|
if (unrecognized.length) {
|
|
9898
9898
|
payload.issues.push({
|
|
9899
9899
|
code: "unrecognized_keys",
|
|
9900
9900
|
keys: unrecognized,
|
|
9901
|
-
input,
|
|
9901
|
+
input: input2,
|
|
9902
9902
|
inst
|
|
9903
9903
|
});
|
|
9904
9904
|
}
|
|
@@ -9942,12 +9942,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
9942
9942
|
let value;
|
|
9943
9943
|
inst._zod.parse = (payload, ctx) => {
|
|
9944
9944
|
value ?? (value = _normalized.value);
|
|
9945
|
-
const
|
|
9946
|
-
if (!isObject2(
|
|
9945
|
+
const input2 = payload.value;
|
|
9946
|
+
if (!isObject2(input2)) {
|
|
9947
9947
|
payload.issues.push({
|
|
9948
9948
|
expected: "object",
|
|
9949
9949
|
code: "invalid_type",
|
|
9950
|
-
input,
|
|
9950
|
+
input: input2,
|
|
9951
9951
|
inst
|
|
9952
9952
|
});
|
|
9953
9953
|
return payload;
|
|
@@ -9959,17 +9959,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
9959
9959
|
const el = shape[key];
|
|
9960
9960
|
const isOptionalIn = el._zod.optin === "optional";
|
|
9961
9961
|
const isOptionalOut = el._zod.optout === "optional";
|
|
9962
|
-
const r = el._zod.run({ value:
|
|
9962
|
+
const r = el._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
9963
9963
|
if (r instanceof Promise) {
|
|
9964
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
9964
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
|
|
9965
9965
|
} else {
|
|
9966
|
-
handlePropertyResult(r, payload, key,
|
|
9966
|
+
handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
|
|
9967
9967
|
}
|
|
9968
9968
|
}
|
|
9969
9969
|
if (!catchall) {
|
|
9970
9970
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
9971
9971
|
}
|
|
9972
|
-
return handleCatchall(proms,
|
|
9972
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
9973
9973
|
};
|
|
9974
9974
|
});
|
|
9975
9975
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -10078,12 +10078,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
10078
10078
|
let value;
|
|
10079
10079
|
inst._zod.parse = (payload, ctx) => {
|
|
10080
10080
|
value ?? (value = _normalized.value);
|
|
10081
|
-
const
|
|
10082
|
-
if (!isObject2(
|
|
10081
|
+
const input2 = payload.value;
|
|
10082
|
+
if (!isObject2(input2)) {
|
|
10083
10083
|
payload.issues.push({
|
|
10084
10084
|
expected: "object",
|
|
10085
10085
|
code: "invalid_type",
|
|
10086
|
-
input,
|
|
10086
|
+
input: input2,
|
|
10087
10087
|
inst
|
|
10088
10088
|
});
|
|
10089
10089
|
return payload;
|
|
@@ -10094,7 +10094,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
10094
10094
|
payload = fastpass(payload, ctx);
|
|
10095
10095
|
if (!catchall)
|
|
10096
10096
|
return payload;
|
|
10097
|
-
return handleCatchall([],
|
|
10097
|
+
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
10098
10098
|
}
|
|
10099
10099
|
return superParse(payload, ctx);
|
|
10100
10100
|
};
|
|
@@ -10254,17 +10254,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
10254
10254
|
return map2;
|
|
10255
10255
|
});
|
|
10256
10256
|
inst._zod.parse = (payload, ctx) => {
|
|
10257
|
-
const
|
|
10258
|
-
if (!isObject(
|
|
10257
|
+
const input2 = payload.value;
|
|
10258
|
+
if (!isObject(input2)) {
|
|
10259
10259
|
payload.issues.push({
|
|
10260
10260
|
code: "invalid_type",
|
|
10261
10261
|
expected: "object",
|
|
10262
|
-
input,
|
|
10262
|
+
input: input2,
|
|
10263
10263
|
inst
|
|
10264
10264
|
});
|
|
10265
10265
|
return payload;
|
|
10266
10266
|
}
|
|
10267
|
-
const opt = disc.value.get(
|
|
10267
|
+
const opt = disc.value.get(input2?.[def.discriminator]);
|
|
10268
10268
|
if (opt) {
|
|
10269
10269
|
return opt._zod.run(payload, ctx);
|
|
10270
10270
|
}
|
|
@@ -10277,7 +10277,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
10277
10277
|
note: "No matching discriminator",
|
|
10278
10278
|
discriminator: def.discriminator,
|
|
10279
10279
|
options: Array.from(disc.value.keys()),
|
|
10280
|
-
input,
|
|
10280
|
+
input: input2,
|
|
10281
10281
|
path: [def.discriminator],
|
|
10282
10282
|
inst
|
|
10283
10283
|
});
|
|
@@ -10287,9 +10287,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
10287
10287
|
var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
|
|
10288
10288
|
$ZodType.init(inst, def);
|
|
10289
10289
|
inst._zod.parse = (payload, ctx) => {
|
|
10290
|
-
const
|
|
10291
|
-
const left = def.left._zod.run({ value:
|
|
10292
|
-
const right = def.right._zod.run({ value:
|
|
10290
|
+
const input2 = payload.value;
|
|
10291
|
+
const left = def.left._zod.run({ value: input2, issues: [] }, ctx);
|
|
10292
|
+
const right = def.right._zod.run({ value: input2, issues: [] }, ctx);
|
|
10293
10293
|
const async = left instanceof Promise || right instanceof Promise;
|
|
10294
10294
|
if (async) {
|
|
10295
10295
|
return Promise.all([left, right]).then(([left2, right2]) => {
|
|
@@ -10386,10 +10386,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
10386
10386
|
$ZodType.init(inst, def);
|
|
10387
10387
|
const items = def.items;
|
|
10388
10388
|
inst._zod.parse = (payload, ctx) => {
|
|
10389
|
-
const
|
|
10390
|
-
if (!Array.isArray(
|
|
10389
|
+
const input2 = payload.value;
|
|
10390
|
+
if (!Array.isArray(input2)) {
|
|
10391
10391
|
payload.issues.push({
|
|
10392
|
-
input,
|
|
10392
|
+
input: input2,
|
|
10393
10393
|
inst,
|
|
10394
10394
|
expected: "tuple",
|
|
10395
10395
|
code: "invalid_type"
|
|
@@ -10401,23 +10401,23 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
10401
10401
|
const optinStart = getTupleOptStart(items, "optin");
|
|
10402
10402
|
const optoutStart = getTupleOptStart(items, "optout");
|
|
10403
10403
|
if (!def.rest) {
|
|
10404
|
-
if (
|
|
10404
|
+
if (input2.length < optinStart) {
|
|
10405
10405
|
payload.issues.push({
|
|
10406
10406
|
code: "too_small",
|
|
10407
10407
|
minimum: optinStart,
|
|
10408
10408
|
inclusive: true,
|
|
10409
|
-
input,
|
|
10409
|
+
input: input2,
|
|
10410
10410
|
inst,
|
|
10411
10411
|
origin: "array"
|
|
10412
10412
|
});
|
|
10413
10413
|
return payload;
|
|
10414
10414
|
}
|
|
10415
|
-
if (
|
|
10415
|
+
if (input2.length > items.length) {
|
|
10416
10416
|
payload.issues.push({
|
|
10417
10417
|
code: "too_big",
|
|
10418
10418
|
maximum: items.length,
|
|
10419
10419
|
inclusive: true,
|
|
10420
|
-
input,
|
|
10420
|
+
input: input2,
|
|
10421
10421
|
inst,
|
|
10422
10422
|
origin: "array"
|
|
10423
10423
|
});
|
|
@@ -10425,7 +10425,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
10425
10425
|
}
|
|
10426
10426
|
const itemResults = new Array(items.length);
|
|
10427
10427
|
for (let i = 0; i < items.length; i++) {
|
|
10428
|
-
const r = items[i]._zod.run({ value:
|
|
10428
|
+
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
10429
10429
|
if (r instanceof Promise) {
|
|
10430
10430
|
proms.push(r.then((rr2) => {
|
|
10431
10431
|
itemResults[i] = rr2;
|
|
@@ -10436,7 +10436,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
10436
10436
|
}
|
|
10437
10437
|
if (def.rest) {
|
|
10438
10438
|
let i = items.length - 1;
|
|
10439
|
-
const rest =
|
|
10439
|
+
const rest = input2.slice(items.length);
|
|
10440
10440
|
for (const el of rest) {
|
|
10441
10441
|
i++;
|
|
10442
10442
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
@@ -10448,9 +10448,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
10448
10448
|
}
|
|
10449
10449
|
}
|
|
10450
10450
|
if (proms.length) {
|
|
10451
|
-
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items,
|
|
10451
|
+
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input2, optoutStart));
|
|
10452
10452
|
}
|
|
10453
|
-
return handleTupleResults(itemResults, payload, items,
|
|
10453
|
+
return handleTupleResults(itemResults, payload, items, input2, optoutStart);
|
|
10454
10454
|
};
|
|
10455
10455
|
});
|
|
10456
10456
|
function getTupleOptStart(items, key) {
|
|
@@ -10466,10 +10466,10 @@ function handleTupleResult(result, final, index) {
|
|
|
10466
10466
|
}
|
|
10467
10467
|
final.value[index] = result.value;
|
|
10468
10468
|
}
|
|
10469
|
-
function handleTupleResults(itemResults, final, items,
|
|
10469
|
+
function handleTupleResults(itemResults, final, items, input2, optoutStart) {
|
|
10470
10470
|
for (let i = 0; i < items.length; i++) {
|
|
10471
10471
|
const r = itemResults[i];
|
|
10472
|
-
const isPresent = i <
|
|
10472
|
+
const isPresent = i < input2.length;
|
|
10473
10473
|
if (r.issues.length) {
|
|
10474
10474
|
if (!isPresent && i >= optoutStart) {
|
|
10475
10475
|
final.value.length = i;
|
|
@@ -10479,7 +10479,7 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
10479
10479
|
}
|
|
10480
10480
|
final.value[i] = r.value;
|
|
10481
10481
|
}
|
|
10482
|
-
for (let i = final.value.length - 1; i >=
|
|
10482
|
+
for (let i = final.value.length - 1; i >= input2.length; i--) {
|
|
10483
10483
|
if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
|
|
10484
10484
|
final.value.length = i;
|
|
10485
10485
|
} else {
|
|
@@ -10491,12 +10491,12 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
10491
10491
|
var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
10492
10492
|
$ZodType.init(inst, def);
|
|
10493
10493
|
inst._zod.parse = (payload, ctx) => {
|
|
10494
|
-
const
|
|
10495
|
-
if (!isPlainObject(
|
|
10494
|
+
const input2 = payload.value;
|
|
10495
|
+
if (!isPlainObject(input2)) {
|
|
10496
10496
|
payload.issues.push({
|
|
10497
10497
|
expected: "record",
|
|
10498
10498
|
code: "invalid_type",
|
|
10499
|
-
input,
|
|
10499
|
+
input: input2,
|
|
10500
10500
|
inst
|
|
10501
10501
|
});
|
|
10502
10502
|
return payload;
|
|
@@ -10525,7 +10525,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10525
10525
|
continue;
|
|
10526
10526
|
}
|
|
10527
10527
|
const outKey = keyResult.value;
|
|
10528
|
-
const result = def.valueType._zod.run({ value:
|
|
10528
|
+
const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
10529
10529
|
if (result instanceof Promise) {
|
|
10530
10530
|
proms.push(result.then((result2) => {
|
|
10531
10531
|
if (result2.issues.length) {
|
|
@@ -10542,7 +10542,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10542
10542
|
}
|
|
10543
10543
|
}
|
|
10544
10544
|
let unrecognized;
|
|
10545
|
-
for (const key in
|
|
10545
|
+
for (const key in input2) {
|
|
10546
10546
|
if (!recordKeys.has(key)) {
|
|
10547
10547
|
unrecognized = unrecognized ?? [];
|
|
10548
10548
|
unrecognized.push(key);
|
|
@@ -10551,17 +10551,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10551
10551
|
if (unrecognized && unrecognized.length > 0) {
|
|
10552
10552
|
payload.issues.push({
|
|
10553
10553
|
code: "unrecognized_keys",
|
|
10554
|
-
input,
|
|
10554
|
+
input: input2,
|
|
10555
10555
|
inst,
|
|
10556
10556
|
keys: unrecognized
|
|
10557
10557
|
});
|
|
10558
10558
|
}
|
|
10559
10559
|
} else {
|
|
10560
10560
|
payload.value = {};
|
|
10561
|
-
for (const key of Reflect.ownKeys(
|
|
10561
|
+
for (const key of Reflect.ownKeys(input2)) {
|
|
10562
10562
|
if (key === "__proto__")
|
|
10563
10563
|
continue;
|
|
10564
|
-
if (!Object.prototype.propertyIsEnumerable.call(
|
|
10564
|
+
if (!Object.prototype.propertyIsEnumerable.call(input2, key))
|
|
10565
10565
|
continue;
|
|
10566
10566
|
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
10567
10567
|
if (keyResult instanceof Promise) {
|
|
@@ -10579,7 +10579,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10579
10579
|
}
|
|
10580
10580
|
if (keyResult.issues.length) {
|
|
10581
10581
|
if (def.mode === "loose") {
|
|
10582
|
-
payload.value[key] =
|
|
10582
|
+
payload.value[key] = input2[key];
|
|
10583
10583
|
} else {
|
|
10584
10584
|
payload.issues.push({
|
|
10585
10585
|
code: "invalid_key",
|
|
@@ -10592,7 +10592,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10592
10592
|
}
|
|
10593
10593
|
continue;
|
|
10594
10594
|
}
|
|
10595
|
-
const result = def.valueType._zod.run({ value:
|
|
10595
|
+
const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
10596
10596
|
if (result instanceof Promise) {
|
|
10597
10597
|
proms.push(result.then((result2) => {
|
|
10598
10598
|
if (result2.issues.length) {
|
|
@@ -10617,27 +10617,27 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10617
10617
|
var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
10618
10618
|
$ZodType.init(inst, def);
|
|
10619
10619
|
inst._zod.parse = (payload, ctx) => {
|
|
10620
|
-
const
|
|
10621
|
-
if (!(
|
|
10620
|
+
const input2 = payload.value;
|
|
10621
|
+
if (!(input2 instanceof Map)) {
|
|
10622
10622
|
payload.issues.push({
|
|
10623
10623
|
expected: "map",
|
|
10624
10624
|
code: "invalid_type",
|
|
10625
|
-
input,
|
|
10625
|
+
input: input2,
|
|
10626
10626
|
inst
|
|
10627
10627
|
});
|
|
10628
10628
|
return payload;
|
|
10629
10629
|
}
|
|
10630
10630
|
const proms = [];
|
|
10631
10631
|
payload.value = /* @__PURE__ */ new Map();
|
|
10632
|
-
for (const [key, value] of
|
|
10632
|
+
for (const [key, value] of input2) {
|
|
10633
10633
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
10634
10634
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
10635
10635
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
10636
10636
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
|
|
10637
|
-
handleMapResult(keyResult2, valueResult2, payload, key,
|
|
10637
|
+
handleMapResult(keyResult2, valueResult2, payload, key, input2, inst, ctx);
|
|
10638
10638
|
}));
|
|
10639
10639
|
} else {
|
|
10640
|
-
handleMapResult(keyResult, valueResult, payload, key,
|
|
10640
|
+
handleMapResult(keyResult, valueResult, payload, key, input2, inst, ctx);
|
|
10641
10641
|
}
|
|
10642
10642
|
}
|
|
10643
10643
|
if (proms.length)
|
|
@@ -10645,7 +10645,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
10645
10645
|
return payload;
|
|
10646
10646
|
};
|
|
10647
10647
|
});
|
|
10648
|
-
function handleMapResult(keyResult, valueResult, final, key,
|
|
10648
|
+
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
10649
10649
|
if (keyResult.issues.length) {
|
|
10650
10650
|
if (propertyKeyTypes.has(typeof key)) {
|
|
10651
10651
|
final.issues.push(...prefixIssues(key, keyResult.issues));
|
|
@@ -10653,7 +10653,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
10653
10653
|
final.issues.push({
|
|
10654
10654
|
code: "invalid_key",
|
|
10655
10655
|
origin: "map",
|
|
10656
|
-
input,
|
|
10656
|
+
input: input2,
|
|
10657
10657
|
inst,
|
|
10658
10658
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
10659
10659
|
});
|
|
@@ -10666,7 +10666,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
10666
10666
|
final.issues.push({
|
|
10667
10667
|
origin: "map",
|
|
10668
10668
|
code: "invalid_element",
|
|
10669
|
-
input,
|
|
10669
|
+
input: input2,
|
|
10670
10670
|
inst,
|
|
10671
10671
|
key,
|
|
10672
10672
|
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
@@ -10678,10 +10678,10 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
10678
10678
|
var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
10679
10679
|
$ZodType.init(inst, def);
|
|
10680
10680
|
inst._zod.parse = (payload, ctx) => {
|
|
10681
|
-
const
|
|
10682
|
-
if (!(
|
|
10681
|
+
const input2 = payload.value;
|
|
10682
|
+
if (!(input2 instanceof Set)) {
|
|
10683
10683
|
payload.issues.push({
|
|
10684
|
-
input,
|
|
10684
|
+
input: input2,
|
|
10685
10685
|
inst,
|
|
10686
10686
|
expected: "set",
|
|
10687
10687
|
code: "invalid_type"
|
|
@@ -10690,7 +10690,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
10690
10690
|
}
|
|
10691
10691
|
const proms = [];
|
|
10692
10692
|
payload.value = /* @__PURE__ */ new Set();
|
|
10693
|
-
for (const item of
|
|
10693
|
+
for (const item of input2) {
|
|
10694
10694
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
10695
10695
|
if (result instanceof Promise) {
|
|
10696
10696
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -10715,14 +10715,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
10715
10715
|
inst._zod.values = valuesSet;
|
|
10716
10716
|
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
10717
10717
|
inst._zod.parse = (payload, _ctx) => {
|
|
10718
|
-
const
|
|
10719
|
-
if (valuesSet.has(
|
|
10718
|
+
const input2 = payload.value;
|
|
10719
|
+
if (valuesSet.has(input2)) {
|
|
10720
10720
|
return payload;
|
|
10721
10721
|
}
|
|
10722
10722
|
payload.issues.push({
|
|
10723
10723
|
code: "invalid_value",
|
|
10724
10724
|
values,
|
|
10725
|
-
input,
|
|
10725
|
+
input: input2,
|
|
10726
10726
|
inst
|
|
10727
10727
|
});
|
|
10728
10728
|
return payload;
|
|
@@ -10737,14 +10737,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
10737
10737
|
inst._zod.values = values;
|
|
10738
10738
|
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
10739
10739
|
inst._zod.parse = (payload, _ctx) => {
|
|
10740
|
-
const
|
|
10741
|
-
if (values.has(
|
|
10740
|
+
const input2 = payload.value;
|
|
10741
|
+
if (values.has(input2)) {
|
|
10742
10742
|
return payload;
|
|
10743
10743
|
}
|
|
10744
10744
|
payload.issues.push({
|
|
10745
10745
|
code: "invalid_value",
|
|
10746
10746
|
values: def.values,
|
|
10747
|
-
input,
|
|
10747
|
+
input: input2,
|
|
10748
10748
|
inst
|
|
10749
10749
|
});
|
|
10750
10750
|
return payload;
|
|
@@ -10753,13 +10753,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
10753
10753
|
var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
|
|
10754
10754
|
$ZodType.init(inst, def);
|
|
10755
10755
|
inst._zod.parse = (payload, _ctx) => {
|
|
10756
|
-
const
|
|
10757
|
-
if (
|
|
10756
|
+
const input2 = payload.value;
|
|
10757
|
+
if (input2 instanceof File)
|
|
10758
10758
|
return payload;
|
|
10759
10759
|
payload.issues.push({
|
|
10760
10760
|
expected: "file",
|
|
10761
10761
|
code: "invalid_type",
|
|
10762
|
-
input,
|
|
10762
|
+
input: input2,
|
|
10763
10763
|
inst
|
|
10764
10764
|
});
|
|
10765
10765
|
return payload;
|
|
@@ -10789,8 +10789,8 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
|
|
|
10789
10789
|
return payload;
|
|
10790
10790
|
};
|
|
10791
10791
|
});
|
|
10792
|
-
function handleOptionalResult(result,
|
|
10793
|
-
if (
|
|
10792
|
+
function handleOptionalResult(result, input2) {
|
|
10793
|
+
if (input2 === void 0 && (result.issues.length || result.fallback)) {
|
|
10794
10794
|
return { issues: [], value: void 0 };
|
|
10795
10795
|
}
|
|
10796
10796
|
return result;
|
|
@@ -10808,11 +10808,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
10808
10808
|
});
|
|
10809
10809
|
inst._zod.parse = (payload, ctx) => {
|
|
10810
10810
|
if (def.innerType._zod.optin === "optional") {
|
|
10811
|
-
const
|
|
10811
|
+
const input2 = payload.value;
|
|
10812
10812
|
const result = def.innerType._zod.run(payload, ctx);
|
|
10813
10813
|
if (result instanceof Promise)
|
|
10814
|
-
return result.then((r) => handleOptionalResult(r,
|
|
10815
|
-
return handleOptionalResult(result,
|
|
10814
|
+
return result.then((r) => handleOptionalResult(r, input2));
|
|
10815
|
+
return handleOptionalResult(result, input2);
|
|
10816
10816
|
}
|
|
10817
10817
|
if (payload.value === void 0) {
|
|
10818
10818
|
return payload;
|
|
@@ -11237,20 +11237,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
11237
11237
|
return payload;
|
|
11238
11238
|
};
|
|
11239
11239
|
inst._zod.check = (payload) => {
|
|
11240
|
-
const
|
|
11241
|
-
const r = def.fn(
|
|
11240
|
+
const input2 = payload.value;
|
|
11241
|
+
const r = def.fn(input2);
|
|
11242
11242
|
if (r instanceof Promise) {
|
|
11243
|
-
return r.then((r2) => handleRefineResult(r2, payload,
|
|
11243
|
+
return r.then((r2) => handleRefineResult(r2, payload, input2, inst));
|
|
11244
11244
|
}
|
|
11245
|
-
handleRefineResult(r, payload,
|
|
11245
|
+
handleRefineResult(r, payload, input2, inst);
|
|
11246
11246
|
return;
|
|
11247
11247
|
};
|
|
11248
11248
|
});
|
|
11249
|
-
function handleRefineResult(result, payload,
|
|
11249
|
+
function handleRefineResult(result, payload, input2, inst) {
|
|
11250
11250
|
if (!result) {
|
|
11251
11251
|
const _iss = {
|
|
11252
11252
|
code: "custom",
|
|
11253
|
-
input,
|
|
11253
|
+
input: input2,
|
|
11254
11254
|
inst,
|
|
11255
11255
|
// incorporates params.error into issue reporting
|
|
11256
11256
|
path: [...inst._zod.def.path ?? []],
|
|
@@ -14537,8 +14537,8 @@ function ko_default() {
|
|
|
14537
14537
|
}
|
|
14538
14538
|
|
|
14539
14539
|
// ../../../node_modules/zod/v4/locales/lt.js
|
|
14540
|
-
var capitalizeFirstCharacter = (
|
|
14541
|
-
return
|
|
14540
|
+
var capitalizeFirstCharacter = (text2) => {
|
|
14541
|
+
return text2.charAt(0).toUpperCase() + text2.slice(1);
|
|
14542
14542
|
};
|
|
14543
14543
|
function getUnitTypeFromNumber(number4) {
|
|
14544
14544
|
const abs = Math.abs(number4);
|
|
@@ -17938,23 +17938,23 @@ function _overwrite(tx) {
|
|
|
17938
17938
|
}
|
|
17939
17939
|
// @__NO_SIDE_EFFECTS__
|
|
17940
17940
|
function _normalize(form) {
|
|
17941
|
-
return /* @__PURE__ */ _overwrite((
|
|
17941
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.normalize(form));
|
|
17942
17942
|
}
|
|
17943
17943
|
// @__NO_SIDE_EFFECTS__
|
|
17944
17944
|
function _trim() {
|
|
17945
|
-
return /* @__PURE__ */ _overwrite((
|
|
17945
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.trim());
|
|
17946
17946
|
}
|
|
17947
17947
|
// @__NO_SIDE_EFFECTS__
|
|
17948
17948
|
function _toLowerCase() {
|
|
17949
|
-
return /* @__PURE__ */ _overwrite((
|
|
17949
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toLowerCase());
|
|
17950
17950
|
}
|
|
17951
17951
|
// @__NO_SIDE_EFFECTS__
|
|
17952
17952
|
function _toUpperCase() {
|
|
17953
|
-
return /* @__PURE__ */ _overwrite((
|
|
17953
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toUpperCase());
|
|
17954
17954
|
}
|
|
17955
17955
|
// @__NO_SIDE_EFFECTS__
|
|
17956
17956
|
function _slugify() {
|
|
17957
|
-
return /* @__PURE__ */ _overwrite((
|
|
17957
|
+
return /* @__PURE__ */ _overwrite((input2) => slugify(input2));
|
|
17958
17958
|
}
|
|
17959
17959
|
// @__NO_SIDE_EFFECTS__
|
|
17960
17960
|
function _array(Class2, element, params) {
|
|
@@ -18259,8 +18259,8 @@ function _stringbool(Classes, _params) {
|
|
|
18259
18259
|
type: "pipe",
|
|
18260
18260
|
in: stringSchema,
|
|
18261
18261
|
out: booleanSchema,
|
|
18262
|
-
transform: ((
|
|
18263
|
-
let data =
|
|
18262
|
+
transform: ((input2, payload) => {
|
|
18263
|
+
let data = input2;
|
|
18264
18264
|
if (params.case !== "sensitive")
|
|
18265
18265
|
data = data.toLowerCase();
|
|
18266
18266
|
if (truthySet.has(data)) {
|
|
@@ -18279,8 +18279,8 @@ function _stringbool(Classes, _params) {
|
|
|
18279
18279
|
return {};
|
|
18280
18280
|
}
|
|
18281
18281
|
}),
|
|
18282
|
-
reverseTransform: ((
|
|
18283
|
-
if (
|
|
18282
|
+
reverseTransform: ((input2, _payload) => {
|
|
18283
|
+
if (input2 === true) {
|
|
18284
18284
|
return truthyArray[0] || "true";
|
|
18285
18285
|
} else {
|
|
18286
18286
|
return falsyArray[0] || "false";
|
|
@@ -19176,9 +19176,9 @@ var allProcessors = {
|
|
|
19176
19176
|
optional: optionalProcessor,
|
|
19177
19177
|
lazy: lazyProcessor
|
|
19178
19178
|
};
|
|
19179
|
-
function toJSONSchema(
|
|
19180
|
-
if ("_idmap" in
|
|
19181
|
-
const registry2 =
|
|
19179
|
+
function toJSONSchema(input2, params) {
|
|
19180
|
+
if ("_idmap" in input2) {
|
|
19181
|
+
const registry2 = input2;
|
|
19182
19182
|
const ctx2 = initializeContext({ ...params, processors: allProcessors });
|
|
19183
19183
|
const defs = {};
|
|
19184
19184
|
for (const entry of registry2._idmap.entries()) {
|
|
@@ -19206,9 +19206,9 @@ function toJSONSchema(input, params) {
|
|
|
19206
19206
|
return { schemas };
|
|
19207
19207
|
}
|
|
19208
19208
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
19209
|
-
process2(
|
|
19210
|
-
extractDefs(ctx,
|
|
19211
|
-
return finalize(ctx,
|
|
19209
|
+
process2(input2, ctx);
|
|
19210
|
+
extractDefs(ctx, input2);
|
|
19211
|
+
return finalize(ctx, input2);
|
|
19212
19212
|
}
|
|
19213
19213
|
|
|
19214
19214
|
// ../../../node_modules/zod/v4/core/json-schema-generator.js
|
|
@@ -21485,7 +21485,7 @@ var codexhostErrorSchema = external_exports.strictObject({
|
|
|
21485
21485
|
|
|
21486
21486
|
// ../../shared-contracts/dist/harness-presentation.js
|
|
21487
21487
|
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
21488
|
-
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((
|
|
21488
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
|
|
21489
21489
|
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
21490
21490
|
label: displayText(256).optional(),
|
|
21491
21491
|
description: displayText(1024).optional()
|
|
@@ -21574,7 +21574,7 @@ var usageMeasurementsSchema = external_exports.object({
|
|
|
21574
21574
|
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
21575
21575
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
21576
21576
|
}).strict();
|
|
21577
|
-
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((
|
|
21577
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
21578
21578
|
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
21579
21579
|
kind: external_exports.literal("countdown"),
|
|
21580
21580
|
id: external_exports.string().min(1).max(64),
|
|
@@ -21957,6 +21957,8 @@ var externalThreadInspectionSchema = external_exports.object({
|
|
|
21957
21957
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
21958
21958
|
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
21959
21959
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
21960
|
+
/** Live Session catalog when it, not the Adapter inspection, contains `effectiveModel`. */
|
|
21961
|
+
catalog: harnessModelCatalogSchema.optional(),
|
|
21960
21962
|
history: harnessHistoryCapabilitiesSchema,
|
|
21961
21963
|
usage: threadUsageSnapshotSchema.optional(),
|
|
21962
21964
|
locked: external_exports.literal(true)
|
|
@@ -22015,9 +22017,9 @@ var threadSteeringInspectParamsSchema = external_exports.object({
|
|
|
22015
22017
|
}).strict();
|
|
22016
22018
|
var threadSteeringContextSchema = external_exports.object({
|
|
22017
22019
|
kind: external_exports.literal("application"),
|
|
22018
|
-
value: external_exports.string().transform((
|
|
22020
|
+
value: external_exports.string().transform((text2, context) => {
|
|
22019
22021
|
try {
|
|
22020
|
-
return JSON.parse(
|
|
22022
|
+
return JSON.parse(text2);
|
|
22021
22023
|
} catch {
|
|
22022
22024
|
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
22023
22025
|
return external_exports.NEVER;
|
|
@@ -22152,8 +22154,8 @@ var desktopExtensionHttpUrlSchema = external_exports.string().trim().max(2048).r
|
|
|
22152
22154
|
const { username, password } = new URL(value);
|
|
22153
22155
|
return !username && !password && !/[\\\s]/u.test(value);
|
|
22154
22156
|
}, "URL must not contain credentials, backslashes, or whitespace");
|
|
22155
|
-
function localizedText(
|
|
22156
|
-
return external_exports.strictObject({ en:
|
|
22157
|
+
function localizedText(text2) {
|
|
22158
|
+
return external_exports.strictObject({ en: text2, "zh-CN": text2 });
|
|
22157
22159
|
}
|
|
22158
22160
|
var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
|
|
22159
22161
|
var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
|
|
@@ -22270,8 +22272,8 @@ var desktopExtensionTrustTierSchema = external_exports.enum(["official", "commun
|
|
|
22270
22272
|
function isGitHubDesktopExtensionZipballUrl(url2) {
|
|
22271
22273
|
return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
|
|
22272
22274
|
}
|
|
22273
|
-
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((
|
|
22274
|
-
const url2 = new URL(
|
|
22275
|
+
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input2) => {
|
|
22276
|
+
const url2 = new URL(input2);
|
|
22275
22277
|
return /\.zip$/iu.test(url2.pathname) || isGitHubDesktopExtensionZipballUrl(url2) || url2.origin === "https://github.com" && /^\/[\w-]+\/[\w.-]+\/zipball(?:\/.+)?\/?$/u.test(url2.pathname) || url2.origin === "https://codeload.github.com" && /^\/[\w-]+\/[\w.-]+\/(?:zip|zipball|legacy\.zip)\/.+$/u.test(url2.pathname);
|
|
22276
22278
|
}, "Expected a .zip download URL or a GitHub zipball URL");
|
|
22277
22279
|
var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
|
|
@@ -22622,6 +22624,8 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
22622
22624
|
"codexhost/workspace/read",
|
|
22623
22625
|
"codexhost/thread/tree/read",
|
|
22624
22626
|
"codexhost/thread/pins/list",
|
|
22627
|
+
"codexhost/thread/sections/list",
|
|
22628
|
+
"codexhost/thread/sections/move",
|
|
22625
22629
|
"codexhost/thread/pins/set",
|
|
22626
22630
|
"codexhost/harness/plugins/list",
|
|
22627
22631
|
"codexhost/harness/inspect",
|
|
@@ -22660,8 +22664,21 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
22660
22664
|
"codexhost/update/check",
|
|
22661
22665
|
"codexhost/update/start",
|
|
22662
22666
|
"codexhost/update/status",
|
|
22667
|
+
"codexhost/announcement/get",
|
|
22668
|
+
"codexhost/announcement/acknowledge",
|
|
22663
22669
|
"codexhost/sessions/loaded/list"
|
|
22664
22670
|
];
|
|
22671
|
+
var clientThreadSectionsSchema = external_exports.object({
|
|
22672
|
+
sections: external_exports.array(external_exports.object({
|
|
22673
|
+
id: external_exports.string().min(1),
|
|
22674
|
+
name: external_exports.string().min(1),
|
|
22675
|
+
threads: external_exports.array(jsonObjectSchema)
|
|
22676
|
+
}).strict())
|
|
22677
|
+
}).strict();
|
|
22678
|
+
var clientThreadSectionMoveSchema = external_exports.object({
|
|
22679
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
22680
|
+
sectionId: external_exports.string().min(1).max(1024).nullable()
|
|
22681
|
+
}).strict();
|
|
22665
22682
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
22666
22683
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
22667
22684
|
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
@@ -23203,8 +23220,8 @@ var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
|
23203
23220
|
operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
|
|
23204
23221
|
initializeOnly: external_exports.boolean().optional(),
|
|
23205
23222
|
expectedRevision: external_exports.number().int().nonnegative().optional()
|
|
23206
|
-
}).superRefine((
|
|
23207
|
-
for (const operation of
|
|
23223
|
+
}).superRefine((input2, ctx) => {
|
|
23224
|
+
for (const operation of input2.operations) {
|
|
23208
23225
|
if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
|
|
23209
23226
|
ctx.addIssue({
|
|
23210
23227
|
code: "custom",
|
|
@@ -23606,13 +23623,18 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
23606
23623
|
// ../../shared-contracts/dist/harness-installation.js
|
|
23607
23624
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
23608
23625
|
harnessId: harnessIdSchema,
|
|
23609
|
-
action: external_exports.enum(["check", "update", "install"])
|
|
23610
|
-
|
|
23626
|
+
action: external_exports.enum(["check", "update", "install"]),
|
|
23627
|
+
confirmedVersion: external_exports.string().min(1).max(128).optional()
|
|
23628
|
+
}).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
|
|
23611
23629
|
var harnessInstallationStateSchema = external_exports.object({
|
|
23612
23630
|
currentVersion: external_exports.string().min(1).max(128),
|
|
23613
23631
|
latestVersion: external_exports.string().min(1).max(128),
|
|
23614
23632
|
updateAvailable: external_exports.boolean(),
|
|
23615
23633
|
canUpdate: external_exports.boolean(),
|
|
23634
|
+
/** Present when the Adapter has a verified list and the available target is outside it. */
|
|
23635
|
+
latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
|
|
23636
|
+
/** Update preflight stopped before running the installer; latestVersion needs confirmation. */
|
|
23637
|
+
confirmationRequired: external_exports.literal(true).optional(),
|
|
23616
23638
|
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
23617
23639
|
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
23618
23640
|
/** Official download opened by the user; does not imply an automatic installation. */
|
|
@@ -23940,6 +23962,38 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
23940
23962
|
status: updateStatusSchema.nullable()
|
|
23941
23963
|
});
|
|
23942
23964
|
|
|
23965
|
+
// ../../shared-contracts/dist/release-announcement.js
|
|
23966
|
+
var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
|
|
23967
|
+
var releaseAnnouncementThemeSchema = external_exports.strictObject({
|
|
23968
|
+
icon: external_exports.string().min(1).max(16).optional(),
|
|
23969
|
+
title: external_exports.string().min(1).max(120),
|
|
23970
|
+
body: external_exports.string().min(1).max(1200),
|
|
23971
|
+
contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
|
|
23972
|
+
});
|
|
23973
|
+
var releaseAnnouncementContentSchema = external_exports.strictObject({
|
|
23974
|
+
summary: external_exports.string().min(1).max(600).optional(),
|
|
23975
|
+
themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
|
|
23976
|
+
});
|
|
23977
|
+
var releaseAnnouncementSchema = external_exports.strictObject({
|
|
23978
|
+
version: updateSemanticVersionSchema,
|
|
23979
|
+
publishedAt: external_exports.iso.datetime(),
|
|
23980
|
+
url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
|
|
23981
|
+
zh: releaseAnnouncementContentSchema.nullable(),
|
|
23982
|
+
en: releaseAnnouncementContentSchema.nullable()
|
|
23983
|
+
}).refine((value) => value.zh !== null || value.en !== null, {
|
|
23984
|
+
message: "an announcement needs at least one language"
|
|
23985
|
+
});
|
|
23986
|
+
var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
|
|
23987
|
+
manual: external_exports.boolean().optional()
|
|
23988
|
+
});
|
|
23989
|
+
var releaseAnnouncementGetResultSchema = external_exports.strictObject({
|
|
23990
|
+
announcement: releaseAnnouncementSchema.nullable(),
|
|
23991
|
+
unread: external_exports.boolean()
|
|
23992
|
+
});
|
|
23993
|
+
var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
|
|
23994
|
+
version: updateSemanticVersionSchema
|
|
23995
|
+
});
|
|
23996
|
+
|
|
23943
23997
|
// ../../shared-contracts/dist/thread-watch-notice.js
|
|
23944
23998
|
var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
23945
23999
|
"completed",
|
|
@@ -23987,17 +24041,67 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
|
|
|
23987
24041
|
|
|
23988
24042
|
// ../../shared-contracts/dist/remote-sessions.js
|
|
23989
24043
|
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
23990
|
-
var
|
|
24044
|
+
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
24045
|
+
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
23991
24046
|
var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
23992
24047
|
var thread = { ...target, threadId: identity };
|
|
24048
|
+
var text = external_exports.string().min(1).max(8e3);
|
|
24049
|
+
var input = { text, requestId: identity };
|
|
24050
|
+
var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
|
|
24051
|
+
external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
|
|
24052
|
+
external_exports.object({
|
|
24053
|
+
accepted: external_exports.literal(false),
|
|
24054
|
+
code: external_exports.enum([
|
|
24055
|
+
"remote/queue-unavailable",
|
|
24056
|
+
"remote/steer-unavailable",
|
|
24057
|
+
"remote/turn-changed",
|
|
24058
|
+
"remote/send-rejected",
|
|
24059
|
+
"session/queue-item-not-found",
|
|
24060
|
+
"session/queue-item-starting"
|
|
24061
|
+
]),
|
|
24062
|
+
message: external_exports.string()
|
|
24063
|
+
})
|
|
24064
|
+
]);
|
|
24065
|
+
var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
|
|
24066
|
+
external_exports.object({ available: external_exports.literal(false) }),
|
|
24067
|
+
external_exports.object({
|
|
24068
|
+
available: external_exports.literal(true),
|
|
24069
|
+
items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
|
|
24070
|
+
})
|
|
24071
|
+
]);
|
|
23993
24072
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
23994
24073
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
24074
|
+
external_exports.strictObject({
|
|
24075
|
+
kind: external_exports.literal("create"),
|
|
24076
|
+
...target,
|
|
24077
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
24078
|
+
epoch: identity
|
|
24079
|
+
}),
|
|
24080
|
+
external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
|
|
24081
|
+
external_exports.strictObject({
|
|
24082
|
+
kind: external_exports.literal("inspectHarness"),
|
|
24083
|
+
...target,
|
|
24084
|
+
epoch: identity,
|
|
24085
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
24086
|
+
harnessId: identity
|
|
24087
|
+
}),
|
|
24088
|
+
external_exports.strictObject({
|
|
24089
|
+
kind: external_exports.literal("startSelected"),
|
|
24090
|
+
...target,
|
|
24091
|
+
epoch: identity,
|
|
24092
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
24093
|
+
harnessId: identity,
|
|
24094
|
+
model: external_exports.string().min(1).max(4096),
|
|
24095
|
+
serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
|
|
24096
|
+
reasoningEffort: identity.optional()
|
|
24097
|
+
}),
|
|
23995
24098
|
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
23996
24099
|
external_exports.strictObject({
|
|
23997
24100
|
kind: external_exports.literal("list"),
|
|
23998
24101
|
...target,
|
|
23999
24102
|
cursor: external_exports.string().nullable(),
|
|
24000
|
-
archived: external_exports.boolean()
|
|
24103
|
+
archived: external_exports.boolean(),
|
|
24104
|
+
includeLoaded: external_exports.literal(true).optional()
|
|
24001
24105
|
}),
|
|
24002
24106
|
external_exports.strictObject({
|
|
24003
24107
|
kind: external_exports.literal("read"),
|
|
@@ -24027,9 +24131,25 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
24027
24131
|
kind: external_exports.literal("prompt"),
|
|
24028
24132
|
...thread,
|
|
24029
24133
|
epoch: identity,
|
|
24030
|
-
text
|
|
24134
|
+
text,
|
|
24031
24135
|
requestId: identity.optional()
|
|
24032
24136
|
}),
|
|
24137
|
+
external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
|
|
24138
|
+
external_exports.strictObject({
|
|
24139
|
+
kind: external_exports.literal("delivery"),
|
|
24140
|
+
...thread,
|
|
24141
|
+
epoch: identity,
|
|
24142
|
+
action: external_exports.discriminatedUnion("kind", [
|
|
24143
|
+
external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input }),
|
|
24144
|
+
external_exports.strictObject({ kind: external_exports.literal("steer"), ...input, turnId: identity }),
|
|
24145
|
+
external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
|
|
24146
|
+
external_exports.strictObject({
|
|
24147
|
+
kind: external_exports.literal("start"),
|
|
24148
|
+
itemId: identity,
|
|
24149
|
+
onlyIfHead: external_exports.literal(true).optional()
|
|
24150
|
+
})
|
|
24151
|
+
])
|
|
24152
|
+
}),
|
|
24033
24153
|
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
24034
24154
|
external_exports.strictObject({
|
|
24035
24155
|
kind: external_exports.literal("rename"),
|
|
@@ -28580,8 +28700,8 @@ var VERSION_MANAGER_ROOTS = "<version-managers>";
|
|
|
28580
28700
|
function installRootExtensions(platform) {
|
|
28581
28701
|
return platform === "win32" ? [".exe", ".cmd"] : [""];
|
|
28582
28702
|
}
|
|
28583
|
-
function resolveHomeDirectory(
|
|
28584
|
-
return
|
|
28703
|
+
function resolveHomeDirectory(input2) {
|
|
28704
|
+
return input2.homeDirectory ?? environmentValue(input2.environment, "HOME") ?? environmentValue(input2.environment, "USERPROFILE") ?? os.homedir();
|
|
28585
28705
|
}
|
|
28586
28706
|
function templateVariables(environment, platform, home) {
|
|
28587
28707
|
const pathFlavor = targetPath(platform);
|
|
@@ -28614,36 +28734,36 @@ function expandInstallRoot(template, environment, platform, home) {
|
|
|
28614
28734
|
});
|
|
28615
28735
|
return unresolved ? void 0 : joinTemplate(platform, substituted);
|
|
28616
28736
|
}
|
|
28617
|
-
function installRootDirectories(spec,
|
|
28737
|
+
function installRootDirectories(spec, input2, dependencies, platform, home) {
|
|
28618
28738
|
const templates = (platform === "win32" ? spec.installRoots?.windows : spec.installRoots?.posix) ?? [];
|
|
28619
28739
|
const directories = [];
|
|
28620
28740
|
for (const template of templates) {
|
|
28621
28741
|
if (template === VERSION_MANAGER_ROOTS) {
|
|
28622
28742
|
directories.push(...versionManagerBinaryDirectories({
|
|
28623
28743
|
platform,
|
|
28624
|
-
environment:
|
|
28744
|
+
environment: input2.environment,
|
|
28625
28745
|
home,
|
|
28626
28746
|
...dependencies.subdirectories ? { subdirectories: dependencies.subdirectories } : {}
|
|
28627
28747
|
}));
|
|
28628
28748
|
continue;
|
|
28629
28749
|
}
|
|
28630
|
-
const directory = expandInstallRoot(template,
|
|
28750
|
+
const directory = expandInstallRoot(template, input2.environment, platform, home);
|
|
28631
28751
|
if (directory !== void 0)
|
|
28632
28752
|
directories.push(directory);
|
|
28633
28753
|
}
|
|
28634
28754
|
return directories;
|
|
28635
28755
|
}
|
|
28636
|
-
function harnessCandidates(spec,
|
|
28637
|
-
const platform =
|
|
28756
|
+
function harnessCandidates(spec, input2, dependencies = {}) {
|
|
28757
|
+
const platform = input2.platform ?? process.platform;
|
|
28638
28758
|
const pathFlavor = targetPath(platform);
|
|
28639
|
-
const configured =
|
|
28759
|
+
const configured = input2.command ?? (spec.commandEnvironmentVariable ? environmentValue(input2.environment, spec.commandEnvironmentVariable) : void 0);
|
|
28640
28760
|
const command = configured ?? spec.command;
|
|
28641
28761
|
if (pathFlavor.isAbsolute(command) || command.includes("/") || command.includes("\\")) {
|
|
28642
28762
|
return [{ candidate: command, source: "configured" }];
|
|
28643
28763
|
}
|
|
28644
28764
|
const candidates = [];
|
|
28645
|
-
const extensions = executableExtensions(command, platform,
|
|
28646
|
-
for (const directory of pathDirectories(
|
|
28765
|
+
const extensions = executableExtensions(command, platform, input2.environment);
|
|
28766
|
+
for (const directory of pathDirectories(input2.environment, platform)) {
|
|
28647
28767
|
for (const extension of extensions) {
|
|
28648
28768
|
candidates.push({
|
|
28649
28769
|
candidate: pathFlavor.join(directory, command + extension),
|
|
@@ -28653,8 +28773,8 @@ function harnessCandidates(spec, input, dependencies = {}) {
|
|
|
28653
28773
|
}
|
|
28654
28774
|
if (configured !== void 0)
|
|
28655
28775
|
return candidates;
|
|
28656
|
-
const home = resolveHomeDirectory(
|
|
28657
|
-
for (const directory of installRootDirectories(spec,
|
|
28776
|
+
const home = resolveHomeDirectory(input2);
|
|
28777
|
+
for (const directory of installRootDirectories(spec, input2, dependencies, platform, home)) {
|
|
28658
28778
|
for (const extension of installRootExtensions(platform)) {
|
|
28659
28779
|
candidates.push({
|
|
28660
28780
|
candidate: pathFlavor.join(directory, spec.command + extension),
|
|
@@ -28664,12 +28784,12 @@ function harnessCandidates(spec, input, dependencies = {}) {
|
|
|
28664
28784
|
}
|
|
28665
28785
|
return candidates;
|
|
28666
28786
|
}
|
|
28667
|
-
function resolveHarnessExecutable(spec,
|
|
28668
|
-
const platform =
|
|
28787
|
+
function resolveHarnessExecutable(spec, input2, dependencies = {}) {
|
|
28788
|
+
const platform = input2.platform ?? process.platform;
|
|
28669
28789
|
const isExecutable = dependencies.isExecutable ?? ((candidate) => isExecutableFile(candidate, platform));
|
|
28670
28790
|
const runnable = spec.runnableCandidate ?? ((candidate) => candidate);
|
|
28671
28791
|
const context = { platform, isExecutable };
|
|
28672
|
-
for (const { candidate, source } of harnessCandidates(spec,
|
|
28792
|
+
for (const { candidate, source } of harnessCandidates(spec, input2, dependencies)) {
|
|
28673
28793
|
const executable = runnable(candidate, context);
|
|
28674
28794
|
if (executable !== void 0 && isExecutable(executable))
|
|
28675
28795
|
return { executable, source };
|
|
@@ -28748,12 +28868,12 @@ var qwenCodeDiscoverySpec = {
|
|
|
28748
28868
|
return isExecutable(entrypoint) ? entrypoint : void 0;
|
|
28749
28869
|
}
|
|
28750
28870
|
};
|
|
28751
|
-
function resolveQwenCodeExecutable(
|
|
28752
|
-
const platform =
|
|
28871
|
+
function resolveQwenCodeExecutable(input2 = {}, dependencies = {}) {
|
|
28872
|
+
const platform = input2.platform ?? process.platform;
|
|
28753
28873
|
const resolution = resolveHarnessExecutable(qwenCodeDiscoverySpec, {
|
|
28754
|
-
...
|
|
28755
|
-
environment:
|
|
28756
|
-
...
|
|
28874
|
+
...input2.command ? { command: input2.command } : {},
|
|
28875
|
+
environment: input2.environment ?? process.env,
|
|
28876
|
+
...input2.homeDirectory ? { homeDirectory: input2.homeDirectory } : {},
|
|
28757
28877
|
platform
|
|
28758
28878
|
}, dependencies);
|
|
28759
28879
|
if (!resolution)
|
|
@@ -28799,22 +28919,22 @@ function qwenCodeCommand(kind, rawInput) {
|
|
|
28799
28919
|
return void 0;
|
|
28800
28920
|
return stringField(rawInput, "command");
|
|
28801
28921
|
}
|
|
28802
|
-
function startQwenCodeToolItem(
|
|
28803
|
-
const command = qwenCodeCommand(
|
|
28922
|
+
function startQwenCodeToolItem(input2) {
|
|
28923
|
+
const command = qwenCodeCommand(input2.kind ?? void 0, input2.rawInput);
|
|
28804
28924
|
if (command) {
|
|
28805
|
-
const rawCwd = stringField(
|
|
28925
|
+
const rawCwd = stringField(input2.rawInput, "cwd");
|
|
28806
28926
|
return {
|
|
28807
28927
|
type: "commandExecution",
|
|
28808
|
-
itemId:
|
|
28928
|
+
itemId: input2.itemId,
|
|
28809
28929
|
command,
|
|
28810
|
-
cwd: rawCwd ??
|
|
28930
|
+
cwd: rawCwd ?? input2.cwd
|
|
28811
28931
|
};
|
|
28812
28932
|
}
|
|
28813
28933
|
return {
|
|
28814
28934
|
type: "toolExecution",
|
|
28815
|
-
itemId:
|
|
28816
|
-
toolName: qwenCodeToolName(
|
|
28817
|
-
arguments: qwenCodeToolArguments(
|
|
28935
|
+
itemId: input2.itemId,
|
|
28936
|
+
toolName: qwenCodeToolName(input2.name, input2.title),
|
|
28937
|
+
arguments: qwenCodeToolArguments(input2.rawInput)
|
|
28818
28938
|
};
|
|
28819
28939
|
}
|
|
28820
28940
|
function acpContentText(content) {
|
|
@@ -28858,9 +28978,9 @@ function rawOutputProjection(rawOutput) {
|
|
|
28858
28978
|
const exitCode = numberField(rawOutput, "exit_code") ?? numberField(rawOutput, "exitCode");
|
|
28859
28979
|
const output = rawOutput.output;
|
|
28860
28980
|
const outputText = typeof output === "string" ? output : void 0;
|
|
28861
|
-
const
|
|
28862
|
-
if (
|
|
28863
|
-
return { ...
|
|
28981
|
+
const text2 = outputText ?? stringField(rawOutput, "content") ?? stringField(rawOutput, "text") ?? stringField(rawOutput, "tool_result") ?? stringField(rawOutput, "raw_output");
|
|
28982
|
+
if (text2 || exitCode !== void 0) {
|
|
28983
|
+
return { ...text2 ? { text: text2 } : {}, ...exitCode !== void 0 ? { exitCode } : {} };
|
|
28864
28984
|
}
|
|
28865
28985
|
return {};
|
|
28866
28986
|
}
|
|
@@ -28868,33 +28988,33 @@ function projectQwenCodeToolOutput(content, rawOutput, limit = DEFAULT_QWEN_CODE
|
|
|
28868
28988
|
if (!Number.isSafeInteger(limit) || limit <= 0)
|
|
28869
28989
|
return {};
|
|
28870
28990
|
const fromRaw = rawOutputProjection(rawOutput);
|
|
28871
|
-
const
|
|
28991
|
+
const text2 = acpContentText(content) || fromRaw.text || "";
|
|
28872
28992
|
const parts = [];
|
|
28873
|
-
if (
|
|
28874
|
-
const truncated =
|
|
28875
|
-
parts.push({ type: "text", text: truncated ?
|
|
28993
|
+
if (text2.length > 0) {
|
|
28994
|
+
const truncated = text2.length > limit;
|
|
28995
|
+
parts.push({ type: "text", text: truncated ? text2.slice(0, limit) : text2 });
|
|
28876
28996
|
}
|
|
28877
|
-
parts.push(...acpContentImages(content, Math.max(0, limit -
|
|
28997
|
+
parts.push(...acpContentImages(content, Math.max(0, limit - text2.length)));
|
|
28878
28998
|
return {
|
|
28879
28999
|
...parts.length > 0 ? {
|
|
28880
29000
|
output: {
|
|
28881
29001
|
content: parts,
|
|
28882
|
-
...
|
|
29002
|
+
...text2.length > limit ? { truncated: true } : {}
|
|
28883
29003
|
}
|
|
28884
29004
|
} : {},
|
|
28885
29005
|
...fromRaw.exitCode !== void 0 ? { exitCode: fromRaw.exitCode } : {}
|
|
28886
29006
|
};
|
|
28887
29007
|
}
|
|
28888
29008
|
function qwenCodeToolOutputText(output) {
|
|
28889
|
-
return output?.content.filter((entry) => entry.type === "text").map(({ text }) =>
|
|
29009
|
+
return output?.content.filter((entry) => entry.type === "text").map(({ text: text2 }) => text2).join("") ?? "";
|
|
28890
29010
|
}
|
|
28891
29011
|
function applyQwenCodeToolProjection(item, projection) {
|
|
28892
29012
|
if (item.type === "commandExecution") {
|
|
28893
|
-
const
|
|
29013
|
+
const text2 = qwenCodeToolOutputText(projection.output);
|
|
28894
29014
|
return {
|
|
28895
29015
|
...item,
|
|
28896
29016
|
...projection.output ? {
|
|
28897
|
-
output:
|
|
29017
|
+
output: text2,
|
|
28898
29018
|
outputTruncated: projection.output.truncated === true
|
|
28899
29019
|
} : {},
|
|
28900
29020
|
...projection.exitCode !== void 0 ? { exitCode: projection.exitCode } : {}
|
|
@@ -28967,19 +29087,19 @@ function errorText(error51) {
|
|
|
28967
29087
|
function classifyError(error51, stage = "startup") {
|
|
28968
29088
|
if (error51 instanceof QwenCodeTransportError)
|
|
28969
29089
|
return error51;
|
|
28970
|
-
const
|
|
28971
|
-
const lower =
|
|
29090
|
+
const text2 = errorText(error51);
|
|
29091
|
+
const lower = text2.toLowerCase();
|
|
28972
29092
|
const code = error51?.code;
|
|
28973
29093
|
if (stage === "startup" && (code === "ENOENT" || lower.includes("executable file not found"))) {
|
|
28974
29094
|
return new QwenCodeTransportError("notInstalled", "Qwen Code CLI is not installed", {
|
|
28975
29095
|
cause: error51,
|
|
28976
|
-
diagnostic:
|
|
29096
|
+
diagnostic: text2
|
|
28977
29097
|
});
|
|
28978
29098
|
}
|
|
28979
29099
|
if (lower.includes("auth_required") || lower.includes("auth type") || lower.includes("authentication") || lower.includes("not logged in") || lower.includes("sign in")) {
|
|
28980
|
-
return new QwenCodeTransportError("authenticationRequired", "Qwen Code CLI authentication is required", { cause: error51, diagnostic:
|
|
29100
|
+
return new QwenCodeTransportError("authenticationRequired", "Qwen Code CLI authentication is required", { cause: error51, diagnostic: text2 });
|
|
28981
29101
|
}
|
|
28982
|
-
return new QwenCodeTransportError("unavailable",
|
|
29102
|
+
return new QwenCodeTransportError("unavailable", text2, {
|
|
28983
29103
|
cause: error51
|
|
28984
29104
|
});
|
|
28985
29105
|
}
|
|
@@ -28988,8 +29108,8 @@ function rawToolOutput(content) {
|
|
|
28988
29108
|
return content;
|
|
28989
29109
|
if (!Array.isArray(content))
|
|
28990
29110
|
return void 0;
|
|
28991
|
-
const
|
|
28992
|
-
return
|
|
29111
|
+
const text2 = content.flatMap((block) => isRecord3(block) && block.type === "text" && typeof block.text === "string" ? [block.text] : []).join("\n");
|
|
29112
|
+
return text2.length > 0 ? text2 : void 0;
|
|
28993
29113
|
}
|
|
28994
29114
|
var QwenCodeSdkTransport = class {
|
|
28995
29115
|
#options;
|
|
@@ -29017,15 +29137,15 @@ var QwenCodeSdkTransport = class {
|
|
|
29017
29137
|
await this.close();
|
|
29018
29138
|
}
|
|
29019
29139
|
}
|
|
29020
|
-
async open(
|
|
29021
|
-
await this.#start(
|
|
29140
|
+
async open(input2) {
|
|
29141
|
+
await this.#start(input2);
|
|
29022
29142
|
return {
|
|
29023
29143
|
sessionId: this.sessionId,
|
|
29024
29144
|
models: await this.#models(),
|
|
29025
|
-
resumed:
|
|
29145
|
+
resumed: input2.kind === "resume"
|
|
29026
29146
|
};
|
|
29027
29147
|
}
|
|
29028
|
-
async runTurn(
|
|
29148
|
+
async runTurn(text2, onEvent, onPermission) {
|
|
29029
29149
|
if (this.#failure)
|
|
29030
29150
|
throw this.#failure;
|
|
29031
29151
|
if (!this.#input || !this.#sessionId || this.#closed) {
|
|
@@ -29039,7 +29159,7 @@ var QwenCodeSdkTransport = class {
|
|
|
29039
29159
|
this.#input?.push({
|
|
29040
29160
|
type: "user",
|
|
29041
29161
|
session_id: this.#sessionId,
|
|
29042
|
-
message: { role: "user", content:
|
|
29162
|
+
message: { role: "user", content: text2 },
|
|
29043
29163
|
parent_tool_use_id: null
|
|
29044
29164
|
});
|
|
29045
29165
|
} catch (error51) {
|
|
@@ -29081,27 +29201,27 @@ var QwenCodeSdkTransport = class {
|
|
|
29081
29201
|
this.#query = null;
|
|
29082
29202
|
const abortController = this.#abortController;
|
|
29083
29203
|
this.#abortController = null;
|
|
29084
|
-
const
|
|
29204
|
+
const input2 = this.#input;
|
|
29085
29205
|
this.#input = null;
|
|
29086
29206
|
const active2 = this.#active;
|
|
29087
29207
|
this.#active = null;
|
|
29088
29208
|
active2?.resolve({ status: "cancelled" });
|
|
29089
29209
|
await query?.close().catch(() => void 0);
|
|
29090
29210
|
abortController?.abort();
|
|
29091
|
-
|
|
29211
|
+
input2?.fail(new Error("Qwen Code SDK input closed"));
|
|
29092
29212
|
}
|
|
29093
|
-
async #start(
|
|
29213
|
+
async #start(input2) {
|
|
29094
29214
|
if (this.#query || this.#closed)
|
|
29095
29215
|
throw new Error("Qwen Code SDK Transport cannot be opened twice");
|
|
29096
|
-
const resumeSessionId =
|
|
29097
|
-
if (
|
|
29216
|
+
const resumeSessionId = input2.kind === "resume" ? input2.sessionId : void 0;
|
|
29217
|
+
if (input2.kind === "resume" && !resumeSessionId) {
|
|
29098
29218
|
throw new QwenCodeTransportError("protocolError", "Qwen Code resume requires a Session identity");
|
|
29099
29219
|
}
|
|
29100
29220
|
const inputStream = new PushableInput();
|
|
29101
29221
|
const abortController = new AbortController();
|
|
29102
29222
|
const queryFactory = this.#options.queryFactory ?? ma;
|
|
29103
29223
|
const sessionId = resumeSessionId ?? randomUUID();
|
|
29104
|
-
const permissionMode = decodeQwenCodePermissionModeId(
|
|
29224
|
+
const permissionMode = decodeQwenCodePermissionModeId(input2.permissionMode);
|
|
29105
29225
|
const environment = this.#environment();
|
|
29106
29226
|
try {
|
|
29107
29227
|
const executable = resolveQwenCodeExecutable({
|
|
@@ -29112,7 +29232,7 @@ var QwenCodeSdkTransport = class {
|
|
|
29112
29232
|
prompt: inputStream,
|
|
29113
29233
|
options: {
|
|
29114
29234
|
cwd: this.#options.cwd,
|
|
29115
|
-
...
|
|
29235
|
+
...input2.model ? { model: input2.model } : {},
|
|
29116
29236
|
...this.#options.commandTimeoutMs ? { timeout: { controlRequest: this.#options.commandTimeoutMs } } : {},
|
|
29117
29237
|
env: environment,
|
|
29118
29238
|
abortController,
|
|
@@ -29150,15 +29270,15 @@ var QwenCodeSdkTransport = class {
|
|
|
29150
29270
|
const environment = withNodeRuntimeOnPath({ ...process.env, ...this.#options.environment });
|
|
29151
29271
|
return Object.fromEntries(Object.entries(environment).filter((entry) => typeof entry[1] === "string"));
|
|
29152
29272
|
}
|
|
29153
|
-
#canUseTool = async (toolName,
|
|
29273
|
+
#canUseTool = async (toolName, input2) => {
|
|
29154
29274
|
const active2 = this.#active;
|
|
29155
29275
|
if (!active2)
|
|
29156
29276
|
return { behavior: "deny", message: "No active codexhost Turn" };
|
|
29157
|
-
const response = await active2.onPermission({ toolName, input });
|
|
29277
|
+
const response = await active2.onPermission({ toolName, input: input2 });
|
|
29158
29278
|
if (response.behavior === "allow") {
|
|
29159
29279
|
return {
|
|
29160
29280
|
behavior: "allow",
|
|
29161
|
-
updatedInput: response.updatedInput ??
|
|
29281
|
+
updatedInput: response.updatedInput ?? input2
|
|
29162
29282
|
};
|
|
29163
29283
|
}
|
|
29164
29284
|
return { behavior: "deny", message: "Denied by user" };
|
|
@@ -29451,7 +29571,7 @@ function stableItemId(kind, turn, index) {
|
|
|
29451
29571
|
}
|
|
29452
29572
|
function projectHistory(records, harnessId, sessionId, cwd, knownTurnRefs, toolOutputLimit) {
|
|
29453
29573
|
const turns = [];
|
|
29454
|
-
let
|
|
29574
|
+
let input2 = "";
|
|
29455
29575
|
let items = [];
|
|
29456
29576
|
let agent = null;
|
|
29457
29577
|
let reasoning = null;
|
|
@@ -29471,7 +29591,7 @@ function projectHistory(records, harnessId, sessionId, cwd, knownTurnRefs, toolO
|
|
|
29471
29591
|
reasoning = null;
|
|
29472
29592
|
};
|
|
29473
29593
|
const finishTurn = () => {
|
|
29474
|
-
if (
|
|
29594
|
+
if (input2.length === 0)
|
|
29475
29595
|
return;
|
|
29476
29596
|
finishReasoning();
|
|
29477
29597
|
finishAgent();
|
|
@@ -29486,11 +29606,11 @@ function projectHistory(records, harnessId, sessionId, cwd, knownTurnRefs, toolO
|
|
|
29486
29606
|
nativeTurnKey: qwenCodeTurnKey(ordinal),
|
|
29487
29607
|
formatVersion: 1
|
|
29488
29608
|
}),
|
|
29489
|
-
input: [{ type: "text", text:
|
|
29609
|
+
input: [{ type: "text", text: input2 }],
|
|
29490
29610
|
items,
|
|
29491
29611
|
outcome
|
|
29492
29612
|
});
|
|
29493
|
-
|
|
29613
|
+
input2 = "";
|
|
29494
29614
|
items = [];
|
|
29495
29615
|
agent = null;
|
|
29496
29616
|
reasoning = null;
|
|
@@ -29515,7 +29635,7 @@ function projectHistory(records, harnessId, sessionId, cwd, knownTurnRefs, toolO
|
|
|
29515
29635
|
if (subtype === "notification" || subtype === "cron" || subtype === "mid_turn_user_message")
|
|
29516
29636
|
continue;
|
|
29517
29637
|
finishTurn();
|
|
29518
|
-
|
|
29638
|
+
input2 = messageText(record3);
|
|
29519
29639
|
continue;
|
|
29520
29640
|
}
|
|
29521
29641
|
if (record3.type === "tool_result") {
|
|
@@ -29528,7 +29648,7 @@ function projectHistory(records, harnessId, sessionId, cwd, knownTurnRefs, toolO
|
|
|
29528
29648
|
}
|
|
29529
29649
|
continue;
|
|
29530
29650
|
}
|
|
29531
|
-
if (record3.type !== "assistant" ||
|
|
29651
|
+
if (record3.type !== "assistant" || input2.length === 0)
|
|
29532
29652
|
continue;
|
|
29533
29653
|
for (const candidate of messageParts(record3)) {
|
|
29534
29654
|
if (!isRecord5(candidate))
|
|
@@ -29698,8 +29818,8 @@ function normalizeError(error51, fallback) {
|
|
|
29698
29818
|
retryable: fallback === "unavailable" || fallback === "nativeFailure"
|
|
29699
29819
|
};
|
|
29700
29820
|
}
|
|
29701
|
-
function qwenQuestions(
|
|
29702
|
-
const questions =
|
|
29821
|
+
function qwenQuestions(input2) {
|
|
29822
|
+
const questions = input2.questions;
|
|
29703
29823
|
if (!Array.isArray(questions))
|
|
29704
29824
|
return null;
|
|
29705
29825
|
const parsed = questions.flatMap((candidate) => {
|
|
@@ -29852,8 +29972,8 @@ var QwenCodeHarnessSession = class {
|
|
|
29852
29972
|
}
|
|
29853
29973
|
};
|
|
29854
29974
|
}
|
|
29855
|
-
const
|
|
29856
|
-
if (
|
|
29975
|
+
const text2 = command.input.map(({ text: text3 }) => text3).join("\n");
|
|
29976
|
+
if (text2.length === 0) {
|
|
29857
29977
|
return {
|
|
29858
29978
|
ok: false,
|
|
29859
29979
|
error: {
|
|
@@ -29880,7 +30000,7 @@ var QwenCodeHarnessSession = class {
|
|
|
29880
30000
|
};
|
|
29881
30001
|
this.#active = active2;
|
|
29882
30002
|
this.#event({ type: "turn.started", turnId: command.turnId });
|
|
29883
|
-
void this.#transport.runTurn(
|
|
30003
|
+
void this.#transport.runTurn(text2, (event) => this.#handleEvent(active2, event), (request) => this.#requestPermission(active2, request)).then((response) => this.#finish(active2, terminalOutcome(response, active2.cancellationRequested)), (error51) => this.#finish(active2, { status: "failed", error: normalizeError(error51, "nativeFailure") }));
|
|
29884
30004
|
return { ok: true, value: { turnId: command.turnId } };
|
|
29885
30005
|
}
|
|
29886
30006
|
async #selectModel(command) {
|
|
@@ -30082,7 +30202,7 @@ var QwenCodeHarnessSession = class {
|
|
|
30082
30202
|
else if (event.type === "tool.update")
|
|
30083
30203
|
this.#updateTool(active2, event);
|
|
30084
30204
|
}
|
|
30085
|
-
#appendAgent(active2,
|
|
30205
|
+
#appendAgent(active2, text2) {
|
|
30086
30206
|
if (!active2.agent) {
|
|
30087
30207
|
this.#completeReasoning(active2, { status: "succeeded" });
|
|
30088
30208
|
active2.agent = {
|
|
@@ -30092,15 +30212,15 @@ var QwenCodeHarnessSession = class {
|
|
|
30092
30212
|
};
|
|
30093
30213
|
this.#event({ type: "item.started", turnId: active2.command.turnId, item: active2.agent });
|
|
30094
30214
|
}
|
|
30095
|
-
active2.agent = { ...active2.agent, text: active2.agent.text +
|
|
30215
|
+
active2.agent = { ...active2.agent, text: active2.agent.text + text2 };
|
|
30096
30216
|
this.#event({
|
|
30097
30217
|
type: "item.updated",
|
|
30098
30218
|
turnId: active2.command.turnId,
|
|
30099
30219
|
itemId: active2.agent.itemId,
|
|
30100
|
-
update: { type: "text.append", text }
|
|
30220
|
+
update: { type: "text.append", text: text2 }
|
|
30101
30221
|
});
|
|
30102
30222
|
}
|
|
30103
|
-
#appendReasoning(active2,
|
|
30223
|
+
#appendReasoning(active2, text2) {
|
|
30104
30224
|
if (!active2.reasoning) {
|
|
30105
30225
|
active2.reasoning = {
|
|
30106
30226
|
type: "reasoning",
|
|
@@ -30109,12 +30229,12 @@ var QwenCodeHarnessSession = class {
|
|
|
30109
30229
|
};
|
|
30110
30230
|
this.#event({ type: "item.started", turnId: active2.command.turnId, item: active2.reasoning });
|
|
30111
30231
|
}
|
|
30112
|
-
active2.reasoning = { ...active2.reasoning, text: active2.reasoning.text +
|
|
30232
|
+
active2.reasoning = { ...active2.reasoning, text: active2.reasoning.text + text2 };
|
|
30113
30233
|
this.#event({
|
|
30114
30234
|
type: "item.updated",
|
|
30115
30235
|
turnId: active2.command.turnId,
|
|
30116
30236
|
itemId: active2.reasoning.itemId,
|
|
30117
|
-
update: { type: "text.append", text }
|
|
30237
|
+
update: { type: "text.append", text: text2 }
|
|
30118
30238
|
});
|
|
30119
30239
|
}
|
|
30120
30240
|
#startTool(active2, event) {
|
|
@@ -30349,12 +30469,12 @@ var QwenCodeAdapter = class {
|
|
|
30349
30469
|
createTransport: (transportOptions) => new QwenCodeSdkTransport({ ...options, ...transportOptions })
|
|
30350
30470
|
};
|
|
30351
30471
|
}
|
|
30352
|
-
async inspect(
|
|
30472
|
+
async inspect(input2 = {}) {
|
|
30353
30473
|
if (this.#closePromise) {
|
|
30354
30474
|
return { status: "unavailable", error: invalidState("Qwen Code Adapter is closed") };
|
|
30355
30475
|
}
|
|
30356
|
-
const cwd = path5.resolve(
|
|
30357
|
-
if (
|
|
30476
|
+
const cwd = path5.resolve(input2.cwd ?? process.cwd());
|
|
30477
|
+
if (input2.refresh) {
|
|
30358
30478
|
this.#inspectionCache.clear();
|
|
30359
30479
|
this.#inspectionGeneration++;
|
|
30360
30480
|
}
|
|
@@ -30400,11 +30520,11 @@ var QwenCodeAdapter = class {
|
|
|
30400
30520
|
};
|
|
30401
30521
|
}
|
|
30402
30522
|
}
|
|
30403
|
-
async open(
|
|
30523
|
+
async open(input2) {
|
|
30404
30524
|
if (this.#closePromise) {
|
|
30405
30525
|
return { ok: false, error: invalidState("Qwen Code Adapter is closed") };
|
|
30406
30526
|
}
|
|
30407
|
-
if (
|
|
30527
|
+
if (input2.cwd.length === 0) {
|
|
30408
30528
|
return {
|
|
30409
30529
|
ok: false,
|
|
30410
30530
|
error: {
|
|
@@ -30414,7 +30534,7 @@ var QwenCodeAdapter = class {
|
|
|
30414
30534
|
}
|
|
30415
30535
|
};
|
|
30416
30536
|
}
|
|
30417
|
-
if (
|
|
30537
|
+
if (input2.kind === "fork" || input2.kind === "rollbackLastTurn") {
|
|
30418
30538
|
return {
|
|
30419
30539
|
ok: false,
|
|
30420
30540
|
error: {
|
|
@@ -30424,14 +30544,14 @@ var QwenCodeAdapter = class {
|
|
|
30424
30544
|
}
|
|
30425
30545
|
};
|
|
30426
30546
|
}
|
|
30427
|
-
const cwd = path5.resolve(
|
|
30428
|
-
const sessionEnvironment = mergeEnvironment(this.#environment,
|
|
30547
|
+
const cwd = path5.resolve(input2.cwd);
|
|
30548
|
+
const sessionEnvironment = mergeEnvironment(this.#environment, input2.environment);
|
|
30429
30549
|
let initialPermissionModeId = QWEN_CODE_DEFAULT_PERMISSION_MODE_ID;
|
|
30430
|
-
if (
|
|
30431
|
-
const requested =
|
|
30550
|
+
if (input2.kind === "create") {
|
|
30551
|
+
const requested = input2.permissionModeId ?? (input2.executionPolicy === "unattended-full-access" ? qwenCodeUnattendedPermissionModeId : QWEN_CODE_DEFAULT_PERMISSION_MODE_ID);
|
|
30432
30552
|
try {
|
|
30433
30553
|
const permissionMode = decodeQwenCodePermissionModeId(requested);
|
|
30434
|
-
if (
|
|
30554
|
+
if (input2.executionPolicy === "unattended-full-access" && permissionMode !== "yolo") {
|
|
30435
30555
|
return {
|
|
30436
30556
|
ok: false,
|
|
30437
30557
|
error: {
|
|
@@ -30452,9 +30572,9 @@ var QwenCodeAdapter = class {
|
|
|
30452
30572
|
};
|
|
30453
30573
|
}
|
|
30454
30574
|
initialPermissionModeId = requested;
|
|
30455
|
-
} else if (
|
|
30575
|
+
} else if (input2.permissionModeId) {
|
|
30456
30576
|
try {
|
|
30457
|
-
decodeQwenCodePermissionModeId(
|
|
30577
|
+
decodeQwenCodePermissionModeId(input2.permissionModeId);
|
|
30458
30578
|
} catch {
|
|
30459
30579
|
return {
|
|
30460
30580
|
ok: false,
|
|
@@ -30465,11 +30585,11 @@ var QwenCodeAdapter = class {
|
|
|
30465
30585
|
}
|
|
30466
30586
|
};
|
|
30467
30587
|
}
|
|
30468
|
-
initialPermissionModeId =
|
|
30588
|
+
initialPermissionModeId = input2.permissionModeId;
|
|
30469
30589
|
}
|
|
30470
30590
|
let parsedRef = null;
|
|
30471
|
-
if (
|
|
30472
|
-
parsedRef = nativeSessionRefSchema.safeParse(
|
|
30591
|
+
if (input2.kind === "resume") {
|
|
30592
|
+
parsedRef = nativeSessionRefSchema.safeParse(input2.nativeRef);
|
|
30473
30593
|
if (!parsedRef.success || parsedRef.data.harnessId !== this.harnessId) {
|
|
30474
30594
|
return {
|
|
30475
30595
|
ok: false,
|
|
@@ -30495,7 +30615,7 @@ var QwenCodeAdapter = class {
|
|
|
30495
30615
|
});
|
|
30496
30616
|
try {
|
|
30497
30617
|
let opened;
|
|
30498
|
-
if (
|
|
30618
|
+
if (input2.kind === "create") {
|
|
30499
30619
|
opened = await transport.open({ kind: "create", permissionMode: initialPermissionModeId });
|
|
30500
30620
|
} else {
|
|
30501
30621
|
const resumeRef = parsedRef;
|
|
@@ -30512,20 +30632,20 @@ var QwenCodeAdapter = class {
|
|
|
30512
30632
|
if (!modelState) {
|
|
30513
30633
|
throw new QwenCodeTransportError("protocolError", "Qwen Code returned an invalid Model catalog");
|
|
30514
30634
|
}
|
|
30515
|
-
const selectedModel =
|
|
30635
|
+
const selectedModel = input2.kind === "create" ? input2.model ?? modelState.currentModel : modelState.currentModel;
|
|
30516
30636
|
if (!catalogModelForRef(modelState.catalog, selectedModel)) {
|
|
30517
30637
|
throw new QwenCodeTransportError("protocolError", "Requested Qwen Code Model is unavailable");
|
|
30518
30638
|
}
|
|
30519
30639
|
await transport.setModel(selectedModel.id);
|
|
30520
30640
|
modelState.currentModel = selectedModel;
|
|
30521
|
-
const history =
|
|
30641
|
+
const history = input2.kind === "resume" ? (await readQwenCodeHistory(cwd, this.harnessId, opened.sessionId, input2.knownTurnRefs, this.#toolOutputLimit, sessionEnvironment)).turns : [];
|
|
30522
30642
|
const initialUsage = null;
|
|
30523
30643
|
if (pendingTransportFault)
|
|
30524
30644
|
throw pendingTransportFault;
|
|
30525
30645
|
const openedSession = new QwenCodeHarnessSession(cwd, transport, opened, modelState, () => this.#sessions.delete(openedSession), {
|
|
30526
30646
|
closeTimeoutMs: this.#closeTimeoutMs,
|
|
30527
30647
|
history,
|
|
30528
|
-
turnCount:
|
|
30648
|
+
turnCount: input2.kind === "resume" ? Math.max(nextQwenCodeTurnOrdinal(input2.knownTurnRefs ?? []), history.length) : 0,
|
|
30529
30649
|
initialUsage,
|
|
30530
30650
|
initialPermissionModeId,
|
|
30531
30651
|
randomUUID: this.#dependencies.randomUUID,
|