@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
|
@@ -3280,11 +3280,11 @@ var require_main = __commonJS({
|
|
|
3280
3280
|
const candidate = value;
|
|
3281
3281
|
return candidate.write !== void 0 && candidate.addListener !== void 0;
|
|
3282
3282
|
}
|
|
3283
|
-
function createMessageConnection2(
|
|
3283
|
+
function createMessageConnection2(input2, output, logger, options2) {
|
|
3284
3284
|
if (!logger) {
|
|
3285
3285
|
logger = api_1.NullLogger;
|
|
3286
3286
|
}
|
|
3287
|
-
const reader = isReadableStream(
|
|
3287
|
+
const reader = isReadableStream(input2) ? new StreamMessageReader2(input2) : input2;
|
|
3288
3288
|
const writer = isWritableStream(output) ? new StreamMessageWriter2(output) : output;
|
|
3289
3289
|
if (api_1.ConnectionStrategy.is(options2)) {
|
|
3290
3290
|
options2 = { connectionStrategy: options2 };
|
|
@@ -4767,8 +4767,8 @@ function cached(getter) {
|
|
|
4767
4767
|
}
|
|
4768
4768
|
};
|
|
4769
4769
|
}
|
|
4770
|
-
function nullish(
|
|
4771
|
-
return
|
|
4770
|
+
function nullish(input2) {
|
|
4771
|
+
return input2 === null || input2 === void 0;
|
|
4772
4772
|
}
|
|
4773
4773
|
function cleanRegex(source) {
|
|
4774
4774
|
const start = source.startsWith("^") ? 1 : 0;
|
|
@@ -4855,8 +4855,8 @@ function randomString(length = 10) {
|
|
|
4855
4855
|
function esc(str) {
|
|
4856
4856
|
return JSON.stringify(str);
|
|
4857
4857
|
}
|
|
4858
|
-
function slugify(
|
|
4859
|
-
return
|
|
4858
|
+
function slugify(input2) {
|
|
4859
|
+
return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
4860
4860
|
}
|
|
4861
4861
|
var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
|
|
4862
4862
|
};
|
|
@@ -5261,19 +5261,19 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
5261
5261
|
}
|
|
5262
5262
|
return rest;
|
|
5263
5263
|
}
|
|
5264
|
-
function getSizableOrigin(
|
|
5265
|
-
if (
|
|
5264
|
+
function getSizableOrigin(input2) {
|
|
5265
|
+
if (input2 instanceof Set)
|
|
5266
5266
|
return "set";
|
|
5267
|
-
if (
|
|
5267
|
+
if (input2 instanceof Map)
|
|
5268
5268
|
return "map";
|
|
5269
|
-
if (
|
|
5269
|
+
if (input2 instanceof File)
|
|
5270
5270
|
return "file";
|
|
5271
5271
|
return "unknown";
|
|
5272
5272
|
}
|
|
5273
|
-
function getLengthableOrigin(
|
|
5274
|
-
if (Array.isArray(
|
|
5273
|
+
function getLengthableOrigin(input2) {
|
|
5274
|
+
if (Array.isArray(input2))
|
|
5275
5275
|
return "array";
|
|
5276
|
-
if (typeof
|
|
5276
|
+
if (typeof input2 === "string")
|
|
5277
5277
|
return "string";
|
|
5278
5278
|
return "unknown";
|
|
5279
5279
|
}
|
|
@@ -5299,12 +5299,12 @@ function parsedType(data) {
|
|
|
5299
5299
|
return t;
|
|
5300
5300
|
}
|
|
5301
5301
|
function issue(...args) {
|
|
5302
|
-
const [iss,
|
|
5302
|
+
const [iss, input2, inst] = args;
|
|
5303
5303
|
if (typeof iss === "string") {
|
|
5304
5304
|
return {
|
|
5305
5305
|
message: iss,
|
|
5306
5306
|
code: "custom",
|
|
5307
|
-
input,
|
|
5307
|
+
input: input2,
|
|
5308
5308
|
inst
|
|
5309
5309
|
};
|
|
5310
5310
|
}
|
|
@@ -5848,23 +5848,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
5848
5848
|
bag.pattern = integer;
|
|
5849
5849
|
});
|
|
5850
5850
|
inst._zod.check = (payload) => {
|
|
5851
|
-
const
|
|
5851
|
+
const input2 = payload.value;
|
|
5852
5852
|
if (isInt) {
|
|
5853
|
-
if (!Number.isInteger(
|
|
5853
|
+
if (!Number.isInteger(input2)) {
|
|
5854
5854
|
payload.issues.push({
|
|
5855
5855
|
expected: origin,
|
|
5856
5856
|
format: def.format,
|
|
5857
5857
|
code: "invalid_type",
|
|
5858
5858
|
continue: false,
|
|
5859
|
-
input,
|
|
5859
|
+
input: input2,
|
|
5860
5860
|
inst
|
|
5861
5861
|
});
|
|
5862
5862
|
return;
|
|
5863
5863
|
}
|
|
5864
|
-
if (!Number.isSafeInteger(
|
|
5865
|
-
if (
|
|
5864
|
+
if (!Number.isSafeInteger(input2)) {
|
|
5865
|
+
if (input2 > 0) {
|
|
5866
5866
|
payload.issues.push({
|
|
5867
|
-
input,
|
|
5867
|
+
input: input2,
|
|
5868
5868
|
code: "too_big",
|
|
5869
5869
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
5870
5870
|
note: "Integers must be within the safe integer range.",
|
|
@@ -5875,7 +5875,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
5875
5875
|
});
|
|
5876
5876
|
} else {
|
|
5877
5877
|
payload.issues.push({
|
|
5878
|
-
input,
|
|
5878
|
+
input: input2,
|
|
5879
5879
|
code: "too_small",
|
|
5880
5880
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
5881
5881
|
note: "Integers must be within the safe integer range.",
|
|
@@ -5888,10 +5888,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
5888
5888
|
return;
|
|
5889
5889
|
}
|
|
5890
5890
|
}
|
|
5891
|
-
if (
|
|
5891
|
+
if (input2 < minimum) {
|
|
5892
5892
|
payload.issues.push({
|
|
5893
5893
|
origin: "number",
|
|
5894
|
-
input,
|
|
5894
|
+
input: input2,
|
|
5895
5895
|
code: "too_small",
|
|
5896
5896
|
minimum,
|
|
5897
5897
|
inclusive: true,
|
|
@@ -5899,10 +5899,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
|
|
|
5899
5899
|
continue: !def.abort
|
|
5900
5900
|
});
|
|
5901
5901
|
}
|
|
5902
|
-
if (
|
|
5902
|
+
if (input2 > maximum) {
|
|
5903
5903
|
payload.issues.push({
|
|
5904
5904
|
origin: "number",
|
|
5905
|
-
input,
|
|
5905
|
+
input: input2,
|
|
5906
5906
|
code: "too_big",
|
|
5907
5907
|
maximum,
|
|
5908
5908
|
inclusive: true,
|
|
@@ -5922,11 +5922,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
5922
5922
|
bag.maximum = maximum;
|
|
5923
5923
|
});
|
|
5924
5924
|
inst._zod.check = (payload) => {
|
|
5925
|
-
const
|
|
5926
|
-
if (
|
|
5925
|
+
const input2 = payload.value;
|
|
5926
|
+
if (input2 < minimum) {
|
|
5927
5927
|
payload.issues.push({
|
|
5928
5928
|
origin: "bigint",
|
|
5929
|
-
input,
|
|
5929
|
+
input: input2,
|
|
5930
5930
|
code: "too_small",
|
|
5931
5931
|
minimum,
|
|
5932
5932
|
inclusive: true,
|
|
@@ -5934,10 +5934,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
|
|
|
5934
5934
|
continue: !def.abort
|
|
5935
5935
|
});
|
|
5936
5936
|
}
|
|
5937
|
-
if (
|
|
5937
|
+
if (input2 > maximum) {
|
|
5938
5938
|
payload.issues.push({
|
|
5939
5939
|
origin: "bigint",
|
|
5940
|
-
input,
|
|
5940
|
+
input: input2,
|
|
5941
5941
|
code: "too_big",
|
|
5942
5942
|
maximum,
|
|
5943
5943
|
inclusive: true,
|
|
@@ -5960,16 +5960,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
|
|
|
5960
5960
|
inst2._zod.bag.maximum = def.maximum;
|
|
5961
5961
|
});
|
|
5962
5962
|
inst._zod.check = (payload) => {
|
|
5963
|
-
const
|
|
5964
|
-
const size =
|
|
5963
|
+
const input2 = payload.value;
|
|
5964
|
+
const size = input2.size;
|
|
5965
5965
|
if (size <= def.maximum)
|
|
5966
5966
|
return;
|
|
5967
5967
|
payload.issues.push({
|
|
5968
|
-
origin: getSizableOrigin(
|
|
5968
|
+
origin: getSizableOrigin(input2),
|
|
5969
5969
|
code: "too_big",
|
|
5970
5970
|
maximum: def.maximum,
|
|
5971
5971
|
inclusive: true,
|
|
5972
|
-
input,
|
|
5972
|
+
input: input2,
|
|
5973
5973
|
inst,
|
|
5974
5974
|
continue: !def.abort
|
|
5975
5975
|
});
|
|
@@ -5988,16 +5988,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
|
|
|
5988
5988
|
inst2._zod.bag.minimum = def.minimum;
|
|
5989
5989
|
});
|
|
5990
5990
|
inst._zod.check = (payload) => {
|
|
5991
|
-
const
|
|
5992
|
-
const size =
|
|
5991
|
+
const input2 = payload.value;
|
|
5992
|
+
const size = input2.size;
|
|
5993
5993
|
if (size >= def.minimum)
|
|
5994
5994
|
return;
|
|
5995
5995
|
payload.issues.push({
|
|
5996
|
-
origin: getSizableOrigin(
|
|
5996
|
+
origin: getSizableOrigin(input2),
|
|
5997
5997
|
code: "too_small",
|
|
5998
5998
|
minimum: def.minimum,
|
|
5999
5999
|
inclusive: true,
|
|
6000
|
-
input,
|
|
6000
|
+
input: input2,
|
|
6001
6001
|
inst,
|
|
6002
6002
|
continue: !def.abort
|
|
6003
6003
|
});
|
|
@@ -6017,13 +6017,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
|
|
|
6017
6017
|
bag.size = def.size;
|
|
6018
6018
|
});
|
|
6019
6019
|
inst._zod.check = (payload) => {
|
|
6020
|
-
const
|
|
6021
|
-
const size =
|
|
6020
|
+
const input2 = payload.value;
|
|
6021
|
+
const size = input2.size;
|
|
6022
6022
|
if (size === def.size)
|
|
6023
6023
|
return;
|
|
6024
6024
|
const tooBig = size > def.size;
|
|
6025
6025
|
payload.issues.push({
|
|
6026
|
-
origin: getSizableOrigin(
|
|
6026
|
+
origin: getSizableOrigin(input2),
|
|
6027
6027
|
...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
|
|
6028
6028
|
inclusive: true,
|
|
6029
6029
|
exact: true,
|
|
@@ -6046,17 +6046,17 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
|
|
|
6046
6046
|
inst2._zod.bag.maximum = def.maximum;
|
|
6047
6047
|
});
|
|
6048
6048
|
inst._zod.check = (payload) => {
|
|
6049
|
-
const
|
|
6050
|
-
const length =
|
|
6049
|
+
const input2 = payload.value;
|
|
6050
|
+
const length = input2.length;
|
|
6051
6051
|
if (length <= def.maximum)
|
|
6052
6052
|
return;
|
|
6053
|
-
const origin = getLengthableOrigin(
|
|
6053
|
+
const origin = getLengthableOrigin(input2);
|
|
6054
6054
|
payload.issues.push({
|
|
6055
6055
|
origin,
|
|
6056
6056
|
code: "too_big",
|
|
6057
6057
|
maximum: def.maximum,
|
|
6058
6058
|
inclusive: true,
|
|
6059
|
-
input,
|
|
6059
|
+
input: input2,
|
|
6060
6060
|
inst,
|
|
6061
6061
|
continue: !def.abort
|
|
6062
6062
|
});
|
|
@@ -6075,17 +6075,17 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
|
|
|
6075
6075
|
inst2._zod.bag.minimum = def.minimum;
|
|
6076
6076
|
});
|
|
6077
6077
|
inst._zod.check = (payload) => {
|
|
6078
|
-
const
|
|
6079
|
-
const length =
|
|
6078
|
+
const input2 = payload.value;
|
|
6079
|
+
const length = input2.length;
|
|
6080
6080
|
if (length >= def.minimum)
|
|
6081
6081
|
return;
|
|
6082
|
-
const origin = getLengthableOrigin(
|
|
6082
|
+
const origin = getLengthableOrigin(input2);
|
|
6083
6083
|
payload.issues.push({
|
|
6084
6084
|
origin,
|
|
6085
6085
|
code: "too_small",
|
|
6086
6086
|
minimum: def.minimum,
|
|
6087
6087
|
inclusive: true,
|
|
6088
|
-
input,
|
|
6088
|
+
input: input2,
|
|
6089
6089
|
inst,
|
|
6090
6090
|
continue: !def.abort
|
|
6091
6091
|
});
|
|
@@ -6105,11 +6105,11 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
|
|
|
6105
6105
|
bag.length = def.length;
|
|
6106
6106
|
});
|
|
6107
6107
|
inst._zod.check = (payload) => {
|
|
6108
|
-
const
|
|
6109
|
-
const length =
|
|
6108
|
+
const input2 = payload.value;
|
|
6109
|
+
const length = input2.length;
|
|
6110
6110
|
if (length === def.length)
|
|
6111
6111
|
return;
|
|
6112
|
-
const origin = getLengthableOrigin(
|
|
6112
|
+
const origin = getLengthableOrigin(input2);
|
|
6113
6113
|
const tooBig = length > def.length;
|
|
6114
6114
|
payload.issues.push({
|
|
6115
6115
|
origin,
|
|
@@ -6780,15 +6780,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
|
|
|
6780
6780
|
payload.value = Number(payload.value);
|
|
6781
6781
|
} catch (_) {
|
|
6782
6782
|
}
|
|
6783
|
-
const
|
|
6784
|
-
if (typeof
|
|
6783
|
+
const input2 = payload.value;
|
|
6784
|
+
if (typeof input2 === "number" && !Number.isNaN(input2) && Number.isFinite(input2)) {
|
|
6785
6785
|
return payload;
|
|
6786
6786
|
}
|
|
6787
|
-
const received = typeof
|
|
6787
|
+
const received = typeof input2 === "number" ? Number.isNaN(input2) ? "NaN" : !Number.isFinite(input2) ? "Infinity" : void 0 : void 0;
|
|
6788
6788
|
payload.issues.push({
|
|
6789
6789
|
expected: "number",
|
|
6790
6790
|
code: "invalid_type",
|
|
6791
|
-
input,
|
|
6791
|
+
input: input2,
|
|
6792
6792
|
inst,
|
|
6793
6793
|
...received ? { received } : {}
|
|
6794
6794
|
});
|
|
@@ -6808,13 +6808,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
|
|
|
6808
6808
|
payload.value = Boolean(payload.value);
|
|
6809
6809
|
} catch (_) {
|
|
6810
6810
|
}
|
|
6811
|
-
const
|
|
6812
|
-
if (typeof
|
|
6811
|
+
const input2 = payload.value;
|
|
6812
|
+
if (typeof input2 === "boolean")
|
|
6813
6813
|
return payload;
|
|
6814
6814
|
payload.issues.push({
|
|
6815
6815
|
expected: "boolean",
|
|
6816
6816
|
code: "invalid_type",
|
|
6817
|
-
input,
|
|
6817
|
+
input: input2,
|
|
6818
6818
|
inst
|
|
6819
6819
|
});
|
|
6820
6820
|
return payload;
|
|
@@ -6847,13 +6847,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
|
|
|
6847
6847
|
var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
|
|
6848
6848
|
$ZodType.init(inst, def);
|
|
6849
6849
|
inst._zod.parse = (payload, _ctx) => {
|
|
6850
|
-
const
|
|
6851
|
-
if (typeof
|
|
6850
|
+
const input2 = payload.value;
|
|
6851
|
+
if (typeof input2 === "symbol")
|
|
6852
6852
|
return payload;
|
|
6853
6853
|
payload.issues.push({
|
|
6854
6854
|
expected: "symbol",
|
|
6855
6855
|
code: "invalid_type",
|
|
6856
|
-
input,
|
|
6856
|
+
input: input2,
|
|
6857
6857
|
inst
|
|
6858
6858
|
});
|
|
6859
6859
|
return payload;
|
|
@@ -6864,13 +6864,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
|
|
|
6864
6864
|
inst._zod.pattern = _undefined;
|
|
6865
6865
|
inst._zod.values = /* @__PURE__ */ new Set([void 0]);
|
|
6866
6866
|
inst._zod.parse = (payload, _ctx) => {
|
|
6867
|
-
const
|
|
6868
|
-
if (typeof
|
|
6867
|
+
const input2 = payload.value;
|
|
6868
|
+
if (typeof input2 === "undefined")
|
|
6869
6869
|
return payload;
|
|
6870
6870
|
payload.issues.push({
|
|
6871
6871
|
expected: "undefined",
|
|
6872
6872
|
code: "invalid_type",
|
|
6873
|
-
input,
|
|
6873
|
+
input: input2,
|
|
6874
6874
|
inst
|
|
6875
6875
|
});
|
|
6876
6876
|
return payload;
|
|
@@ -6881,13 +6881,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
|
|
|
6881
6881
|
inst._zod.pattern = _null;
|
|
6882
6882
|
inst._zod.values = /* @__PURE__ */ new Set([null]);
|
|
6883
6883
|
inst._zod.parse = (payload, _ctx) => {
|
|
6884
|
-
const
|
|
6885
|
-
if (
|
|
6884
|
+
const input2 = payload.value;
|
|
6885
|
+
if (input2 === null)
|
|
6886
6886
|
return payload;
|
|
6887
6887
|
payload.issues.push({
|
|
6888
6888
|
expected: "null",
|
|
6889
6889
|
code: "invalid_type",
|
|
6890
|
-
input,
|
|
6890
|
+
input: input2,
|
|
6891
6891
|
inst
|
|
6892
6892
|
});
|
|
6893
6893
|
return payload;
|
|
@@ -6916,13 +6916,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
6916
6916
|
var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
|
|
6917
6917
|
$ZodType.init(inst, def);
|
|
6918
6918
|
inst._zod.parse = (payload, _ctx) => {
|
|
6919
|
-
const
|
|
6920
|
-
if (typeof
|
|
6919
|
+
const input2 = payload.value;
|
|
6920
|
+
if (typeof input2 === "undefined")
|
|
6921
6921
|
return payload;
|
|
6922
6922
|
payload.issues.push({
|
|
6923
6923
|
expected: "void",
|
|
6924
6924
|
code: "invalid_type",
|
|
6925
|
-
input,
|
|
6925
|
+
input: input2,
|
|
6926
6926
|
inst
|
|
6927
6927
|
});
|
|
6928
6928
|
return payload;
|
|
@@ -6937,15 +6937,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
|
|
|
6937
6937
|
} catch (_err) {
|
|
6938
6938
|
}
|
|
6939
6939
|
}
|
|
6940
|
-
const
|
|
6941
|
-
const isDate =
|
|
6942
|
-
const isValidDate = isDate && !Number.isNaN(
|
|
6940
|
+
const input2 = payload.value;
|
|
6941
|
+
const isDate = input2 instanceof Date;
|
|
6942
|
+
const isValidDate = isDate && !Number.isNaN(input2.getTime());
|
|
6943
6943
|
if (isValidDate)
|
|
6944
6944
|
return payload;
|
|
6945
6945
|
payload.issues.push({
|
|
6946
6946
|
expected: "date",
|
|
6947
6947
|
code: "invalid_type",
|
|
6948
|
-
input,
|
|
6948
|
+
input: input2,
|
|
6949
6949
|
...isDate ? { received: "Invalid Date" } : {},
|
|
6950
6950
|
inst
|
|
6951
6951
|
});
|
|
@@ -6961,20 +6961,20 @@ function handleArrayResult(result, final, index) {
|
|
|
6961
6961
|
var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
6962
6962
|
$ZodType.init(inst, def);
|
|
6963
6963
|
inst._zod.parse = (payload, ctx) => {
|
|
6964
|
-
const
|
|
6965
|
-
if (!Array.isArray(
|
|
6964
|
+
const input2 = payload.value;
|
|
6965
|
+
if (!Array.isArray(input2)) {
|
|
6966
6966
|
payload.issues.push({
|
|
6967
6967
|
expected: "array",
|
|
6968
6968
|
code: "invalid_type",
|
|
6969
|
-
input,
|
|
6969
|
+
input: input2,
|
|
6970
6970
|
inst
|
|
6971
6971
|
});
|
|
6972
6972
|
return payload;
|
|
6973
6973
|
}
|
|
6974
|
-
payload.value = Array(
|
|
6974
|
+
payload.value = Array(input2.length);
|
|
6975
6975
|
const proms = [];
|
|
6976
|
-
for (let i = 0; i <
|
|
6977
|
-
const item =
|
|
6976
|
+
for (let i = 0; i < input2.length; i++) {
|
|
6977
|
+
const item = input2[i];
|
|
6978
6978
|
const result = def.element._zod.run({
|
|
6979
6979
|
value: item,
|
|
6980
6980
|
issues: []
|
|
@@ -6991,8 +6991,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
6991
6991
|
return payload;
|
|
6992
6992
|
};
|
|
6993
6993
|
});
|
|
6994
|
-
function handlePropertyResult(result, final, key,
|
|
6995
|
-
const isPresent = key in
|
|
6994
|
+
function handlePropertyResult(result, final, key, input2, isOptionalIn, isOptionalOut) {
|
|
6995
|
+
const isPresent = key in input2;
|
|
6996
6996
|
if (result.issues.length) {
|
|
6997
6997
|
if (isOptionalIn && isOptionalOut && !isPresent) {
|
|
6998
6998
|
return;
|
|
@@ -7034,14 +7034,14 @@ function normalizeDef(def) {
|
|
|
7034
7034
|
optionalKeys: new Set(okeys)
|
|
7035
7035
|
};
|
|
7036
7036
|
}
|
|
7037
|
-
function handleCatchall(proms,
|
|
7037
|
+
function handleCatchall(proms, input2, payload, ctx, def, inst) {
|
|
7038
7038
|
const unrecognized = [];
|
|
7039
7039
|
const keySet = def.keySet;
|
|
7040
7040
|
const _catchall = def.catchall._zod;
|
|
7041
7041
|
const t = _catchall.def.type;
|
|
7042
7042
|
const isOptionalIn = _catchall.optin === "optional";
|
|
7043
7043
|
const isOptionalOut = _catchall.optout === "optional";
|
|
7044
|
-
for (const key in
|
|
7044
|
+
for (const key in input2) {
|
|
7045
7045
|
if (key === "__proto__")
|
|
7046
7046
|
continue;
|
|
7047
7047
|
if (keySet.has(key))
|
|
@@ -7050,18 +7050,18 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
|
7050
7050
|
unrecognized.push(key);
|
|
7051
7051
|
continue;
|
|
7052
7052
|
}
|
|
7053
|
-
const r = _catchall.run({ value:
|
|
7053
|
+
const r = _catchall.run({ value: input2[key], issues: [] }, ctx);
|
|
7054
7054
|
if (r instanceof Promise) {
|
|
7055
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
7055
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
|
|
7056
7056
|
} else {
|
|
7057
|
-
handlePropertyResult(r, payload, key,
|
|
7057
|
+
handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
|
|
7058
7058
|
}
|
|
7059
7059
|
}
|
|
7060
7060
|
if (unrecognized.length) {
|
|
7061
7061
|
payload.issues.push({
|
|
7062
7062
|
code: "unrecognized_keys",
|
|
7063
7063
|
keys: unrecognized,
|
|
7064
|
-
input,
|
|
7064
|
+
input: input2,
|
|
7065
7065
|
inst
|
|
7066
7066
|
});
|
|
7067
7067
|
}
|
|
@@ -7105,12 +7105,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
7105
7105
|
let value;
|
|
7106
7106
|
inst._zod.parse = (payload, ctx) => {
|
|
7107
7107
|
value ?? (value = _normalized.value);
|
|
7108
|
-
const
|
|
7109
|
-
if (!isObject2(
|
|
7108
|
+
const input2 = payload.value;
|
|
7109
|
+
if (!isObject2(input2)) {
|
|
7110
7110
|
payload.issues.push({
|
|
7111
7111
|
expected: "object",
|
|
7112
7112
|
code: "invalid_type",
|
|
7113
|
-
input,
|
|
7113
|
+
input: input2,
|
|
7114
7114
|
inst
|
|
7115
7115
|
});
|
|
7116
7116
|
return payload;
|
|
@@ -7122,17 +7122,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
7122
7122
|
const el = shape[key];
|
|
7123
7123
|
const isOptionalIn = el._zod.optin === "optional";
|
|
7124
7124
|
const isOptionalOut = el._zod.optout === "optional";
|
|
7125
|
-
const r = el._zod.run({ value:
|
|
7125
|
+
const r = el._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
7126
7126
|
if (r instanceof Promise) {
|
|
7127
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key,
|
|
7127
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut)));
|
|
7128
7128
|
} else {
|
|
7129
|
-
handlePropertyResult(r, payload, key,
|
|
7129
|
+
handlePropertyResult(r, payload, key, input2, isOptionalIn, isOptionalOut);
|
|
7130
7130
|
}
|
|
7131
7131
|
}
|
|
7132
7132
|
if (!catchall) {
|
|
7133
7133
|
return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
7134
7134
|
}
|
|
7135
|
-
return handleCatchall(proms,
|
|
7135
|
+
return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
|
|
7136
7136
|
};
|
|
7137
7137
|
});
|
|
7138
7138
|
var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -7241,12 +7241,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
7241
7241
|
let value;
|
|
7242
7242
|
inst._zod.parse = (payload, ctx) => {
|
|
7243
7243
|
value ?? (value = _normalized.value);
|
|
7244
|
-
const
|
|
7245
|
-
if (!isObject2(
|
|
7244
|
+
const input2 = payload.value;
|
|
7245
|
+
if (!isObject2(input2)) {
|
|
7246
7246
|
payload.issues.push({
|
|
7247
7247
|
expected: "object",
|
|
7248
7248
|
code: "invalid_type",
|
|
7249
|
-
input,
|
|
7249
|
+
input: input2,
|
|
7250
7250
|
inst
|
|
7251
7251
|
});
|
|
7252
7252
|
return payload;
|
|
@@ -7257,7 +7257,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
7257
7257
|
payload = fastpass(payload, ctx);
|
|
7258
7258
|
if (!catchall)
|
|
7259
7259
|
return payload;
|
|
7260
|
-
return handleCatchall([],
|
|
7260
|
+
return handleCatchall([], input2, payload, ctx, value, inst);
|
|
7261
7261
|
}
|
|
7262
7262
|
return superParse(payload, ctx);
|
|
7263
7263
|
};
|
|
@@ -7417,17 +7417,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
7417
7417
|
return map2;
|
|
7418
7418
|
});
|
|
7419
7419
|
inst._zod.parse = (payload, ctx) => {
|
|
7420
|
-
const
|
|
7421
|
-
if (!isObject(
|
|
7420
|
+
const input2 = payload.value;
|
|
7421
|
+
if (!isObject(input2)) {
|
|
7422
7422
|
payload.issues.push({
|
|
7423
7423
|
code: "invalid_type",
|
|
7424
7424
|
expected: "object",
|
|
7425
|
-
input,
|
|
7425
|
+
input: input2,
|
|
7426
7426
|
inst
|
|
7427
7427
|
});
|
|
7428
7428
|
return payload;
|
|
7429
7429
|
}
|
|
7430
|
-
const opt = disc.value.get(
|
|
7430
|
+
const opt = disc.value.get(input2?.[def.discriminator]);
|
|
7431
7431
|
if (opt) {
|
|
7432
7432
|
return opt._zod.run(payload, ctx);
|
|
7433
7433
|
}
|
|
@@ -7440,7 +7440,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
7440
7440
|
note: "No matching discriminator",
|
|
7441
7441
|
discriminator: def.discriminator,
|
|
7442
7442
|
options: Array.from(disc.value.keys()),
|
|
7443
|
-
input,
|
|
7443
|
+
input: input2,
|
|
7444
7444
|
path: [def.discriminator],
|
|
7445
7445
|
inst
|
|
7446
7446
|
});
|
|
@@ -7450,9 +7450,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
|
|
|
7450
7450
|
var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
|
|
7451
7451
|
$ZodType.init(inst, def);
|
|
7452
7452
|
inst._zod.parse = (payload, ctx) => {
|
|
7453
|
-
const
|
|
7454
|
-
const left = def.left._zod.run({ value:
|
|
7455
|
-
const right = def.right._zod.run({ value:
|
|
7453
|
+
const input2 = payload.value;
|
|
7454
|
+
const left = def.left._zod.run({ value: input2, issues: [] }, ctx);
|
|
7455
|
+
const right = def.right._zod.run({ value: input2, issues: [] }, ctx);
|
|
7456
7456
|
const async = left instanceof Promise || right instanceof Promise;
|
|
7457
7457
|
if (async) {
|
|
7458
7458
|
return Promise.all([left, right]).then(([left2, right2]) => {
|
|
@@ -7549,10 +7549,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
7549
7549
|
$ZodType.init(inst, def);
|
|
7550
7550
|
const items = def.items;
|
|
7551
7551
|
inst._zod.parse = (payload, ctx) => {
|
|
7552
|
-
const
|
|
7553
|
-
if (!Array.isArray(
|
|
7552
|
+
const input2 = payload.value;
|
|
7553
|
+
if (!Array.isArray(input2)) {
|
|
7554
7554
|
payload.issues.push({
|
|
7555
|
-
input,
|
|
7555
|
+
input: input2,
|
|
7556
7556
|
inst,
|
|
7557
7557
|
expected: "tuple",
|
|
7558
7558
|
code: "invalid_type"
|
|
@@ -7564,23 +7564,23 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
7564
7564
|
const optinStart = getTupleOptStart(items, "optin");
|
|
7565
7565
|
const optoutStart = getTupleOptStart(items, "optout");
|
|
7566
7566
|
if (!def.rest) {
|
|
7567
|
-
if (
|
|
7567
|
+
if (input2.length < optinStart) {
|
|
7568
7568
|
payload.issues.push({
|
|
7569
7569
|
code: "too_small",
|
|
7570
7570
|
minimum: optinStart,
|
|
7571
7571
|
inclusive: true,
|
|
7572
|
-
input,
|
|
7572
|
+
input: input2,
|
|
7573
7573
|
inst,
|
|
7574
7574
|
origin: "array"
|
|
7575
7575
|
});
|
|
7576
7576
|
return payload;
|
|
7577
7577
|
}
|
|
7578
|
-
if (
|
|
7578
|
+
if (input2.length > items.length) {
|
|
7579
7579
|
payload.issues.push({
|
|
7580
7580
|
code: "too_big",
|
|
7581
7581
|
maximum: items.length,
|
|
7582
7582
|
inclusive: true,
|
|
7583
|
-
input,
|
|
7583
|
+
input: input2,
|
|
7584
7584
|
inst,
|
|
7585
7585
|
origin: "array"
|
|
7586
7586
|
});
|
|
@@ -7588,7 +7588,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
7588
7588
|
}
|
|
7589
7589
|
const itemResults = new Array(items.length);
|
|
7590
7590
|
for (let i = 0; i < items.length; i++) {
|
|
7591
|
-
const r = items[i]._zod.run({ value:
|
|
7591
|
+
const r = items[i]._zod.run({ value: input2[i], issues: [] }, ctx);
|
|
7592
7592
|
if (r instanceof Promise) {
|
|
7593
7593
|
proms.push(r.then((rr) => {
|
|
7594
7594
|
itemResults[i] = rr;
|
|
@@ -7599,7 +7599,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
7599
7599
|
}
|
|
7600
7600
|
if (def.rest) {
|
|
7601
7601
|
let i = items.length - 1;
|
|
7602
|
-
const rest =
|
|
7602
|
+
const rest = input2.slice(items.length);
|
|
7603
7603
|
for (const el of rest) {
|
|
7604
7604
|
i++;
|
|
7605
7605
|
const result = def.rest._zod.run({ value: el, issues: [] }, ctx);
|
|
@@ -7611,9 +7611,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
|
|
|
7611
7611
|
}
|
|
7612
7612
|
}
|
|
7613
7613
|
if (proms.length) {
|
|
7614
|
-
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items,
|
|
7614
|
+
return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input2, optoutStart));
|
|
7615
7615
|
}
|
|
7616
|
-
return handleTupleResults(itemResults, payload, items,
|
|
7616
|
+
return handleTupleResults(itemResults, payload, items, input2, optoutStart);
|
|
7617
7617
|
};
|
|
7618
7618
|
});
|
|
7619
7619
|
function getTupleOptStart(items, key) {
|
|
@@ -7629,10 +7629,10 @@ function handleTupleResult(result, final, index) {
|
|
|
7629
7629
|
}
|
|
7630
7630
|
final.value[index] = result.value;
|
|
7631
7631
|
}
|
|
7632
|
-
function handleTupleResults(itemResults, final, items,
|
|
7632
|
+
function handleTupleResults(itemResults, final, items, input2, optoutStart) {
|
|
7633
7633
|
for (let i = 0; i < items.length; i++) {
|
|
7634
7634
|
const r = itemResults[i];
|
|
7635
|
-
const isPresent = i <
|
|
7635
|
+
const isPresent = i < input2.length;
|
|
7636
7636
|
if (r.issues.length) {
|
|
7637
7637
|
if (!isPresent && i >= optoutStart) {
|
|
7638
7638
|
final.value.length = i;
|
|
@@ -7642,7 +7642,7 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
7642
7642
|
}
|
|
7643
7643
|
final.value[i] = r.value;
|
|
7644
7644
|
}
|
|
7645
|
-
for (let i = final.value.length - 1; i >=
|
|
7645
|
+
for (let i = final.value.length - 1; i >= input2.length; i--) {
|
|
7646
7646
|
if (items[i]._zod.optout === "optional" && final.value[i] === void 0) {
|
|
7647
7647
|
final.value.length = i;
|
|
7648
7648
|
} else {
|
|
@@ -7654,12 +7654,12 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
|
|
|
7654
7654
|
var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
7655
7655
|
$ZodType.init(inst, def);
|
|
7656
7656
|
inst._zod.parse = (payload, ctx) => {
|
|
7657
|
-
const
|
|
7658
|
-
if (!isPlainObject(
|
|
7657
|
+
const input2 = payload.value;
|
|
7658
|
+
if (!isPlainObject(input2)) {
|
|
7659
7659
|
payload.issues.push({
|
|
7660
7660
|
expected: "record",
|
|
7661
7661
|
code: "invalid_type",
|
|
7662
|
-
input,
|
|
7662
|
+
input: input2,
|
|
7663
7663
|
inst
|
|
7664
7664
|
});
|
|
7665
7665
|
return payload;
|
|
@@ -7688,7 +7688,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
7688
7688
|
continue;
|
|
7689
7689
|
}
|
|
7690
7690
|
const outKey = keyResult.value;
|
|
7691
|
-
const result = def.valueType._zod.run({ value:
|
|
7691
|
+
const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
7692
7692
|
if (result instanceof Promise) {
|
|
7693
7693
|
proms.push(result.then((result2) => {
|
|
7694
7694
|
if (result2.issues.length) {
|
|
@@ -7705,7 +7705,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
7705
7705
|
}
|
|
7706
7706
|
}
|
|
7707
7707
|
let unrecognized;
|
|
7708
|
-
for (const key in
|
|
7708
|
+
for (const key in input2) {
|
|
7709
7709
|
if (!recordKeys.has(key)) {
|
|
7710
7710
|
unrecognized = unrecognized ?? [];
|
|
7711
7711
|
unrecognized.push(key);
|
|
@@ -7714,17 +7714,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
7714
7714
|
if (unrecognized && unrecognized.length > 0) {
|
|
7715
7715
|
payload.issues.push({
|
|
7716
7716
|
code: "unrecognized_keys",
|
|
7717
|
-
input,
|
|
7717
|
+
input: input2,
|
|
7718
7718
|
inst,
|
|
7719
7719
|
keys: unrecognized
|
|
7720
7720
|
});
|
|
7721
7721
|
}
|
|
7722
7722
|
} else {
|
|
7723
7723
|
payload.value = {};
|
|
7724
|
-
for (const key of Reflect.ownKeys(
|
|
7724
|
+
for (const key of Reflect.ownKeys(input2)) {
|
|
7725
7725
|
if (key === "__proto__")
|
|
7726
7726
|
continue;
|
|
7727
|
-
if (!Object.prototype.propertyIsEnumerable.call(
|
|
7727
|
+
if (!Object.prototype.propertyIsEnumerable.call(input2, key))
|
|
7728
7728
|
continue;
|
|
7729
7729
|
let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
7730
7730
|
if (keyResult instanceof Promise) {
|
|
@@ -7742,7 +7742,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
7742
7742
|
}
|
|
7743
7743
|
if (keyResult.issues.length) {
|
|
7744
7744
|
if (def.mode === "loose") {
|
|
7745
|
-
payload.value[key] =
|
|
7745
|
+
payload.value[key] = input2[key];
|
|
7746
7746
|
} else {
|
|
7747
7747
|
payload.issues.push({
|
|
7748
7748
|
code: "invalid_key",
|
|
@@ -7755,7 +7755,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
7755
7755
|
}
|
|
7756
7756
|
continue;
|
|
7757
7757
|
}
|
|
7758
|
-
const result = def.valueType._zod.run({ value:
|
|
7758
|
+
const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
|
|
7759
7759
|
if (result instanceof Promise) {
|
|
7760
7760
|
proms.push(result.then((result2) => {
|
|
7761
7761
|
if (result2.issues.length) {
|
|
@@ -7780,27 +7780,27 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
7780
7780
|
var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
7781
7781
|
$ZodType.init(inst, def);
|
|
7782
7782
|
inst._zod.parse = (payload, ctx) => {
|
|
7783
|
-
const
|
|
7784
|
-
if (!(
|
|
7783
|
+
const input2 = payload.value;
|
|
7784
|
+
if (!(input2 instanceof Map)) {
|
|
7785
7785
|
payload.issues.push({
|
|
7786
7786
|
expected: "map",
|
|
7787
7787
|
code: "invalid_type",
|
|
7788
|
-
input,
|
|
7788
|
+
input: input2,
|
|
7789
7789
|
inst
|
|
7790
7790
|
});
|
|
7791
7791
|
return payload;
|
|
7792
7792
|
}
|
|
7793
7793
|
const proms = [];
|
|
7794
7794
|
payload.value = /* @__PURE__ */ new Map();
|
|
7795
|
-
for (const [key, value] of
|
|
7795
|
+
for (const [key, value] of input2) {
|
|
7796
7796
|
const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
|
|
7797
7797
|
const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
|
|
7798
7798
|
if (keyResult instanceof Promise || valueResult instanceof Promise) {
|
|
7799
7799
|
proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
|
|
7800
|
-
handleMapResult(keyResult2, valueResult2, payload, key,
|
|
7800
|
+
handleMapResult(keyResult2, valueResult2, payload, key, input2, inst, ctx);
|
|
7801
7801
|
}));
|
|
7802
7802
|
} else {
|
|
7803
|
-
handleMapResult(keyResult, valueResult, payload, key,
|
|
7803
|
+
handleMapResult(keyResult, valueResult, payload, key, input2, inst, ctx);
|
|
7804
7804
|
}
|
|
7805
7805
|
}
|
|
7806
7806
|
if (proms.length)
|
|
@@ -7808,7 +7808,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
|
|
|
7808
7808
|
return payload;
|
|
7809
7809
|
};
|
|
7810
7810
|
});
|
|
7811
|
-
function handleMapResult(keyResult, valueResult, final, key,
|
|
7811
|
+
function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
|
|
7812
7812
|
if (keyResult.issues.length) {
|
|
7813
7813
|
if (propertyKeyTypes.has(typeof key)) {
|
|
7814
7814
|
final.issues.push(...prefixIssues(key, keyResult.issues));
|
|
@@ -7816,7 +7816,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
7816
7816
|
final.issues.push({
|
|
7817
7817
|
code: "invalid_key",
|
|
7818
7818
|
origin: "map",
|
|
7819
|
-
input,
|
|
7819
|
+
input: input2,
|
|
7820
7820
|
inst,
|
|
7821
7821
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
7822
7822
|
});
|
|
@@ -7829,7 +7829,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
7829
7829
|
final.issues.push({
|
|
7830
7830
|
origin: "map",
|
|
7831
7831
|
code: "invalid_element",
|
|
7832
|
-
input,
|
|
7832
|
+
input: input2,
|
|
7833
7833
|
inst,
|
|
7834
7834
|
key,
|
|
7835
7835
|
issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
|
|
@@ -7841,10 +7841,10 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
|
|
|
7841
7841
|
var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
7842
7842
|
$ZodType.init(inst, def);
|
|
7843
7843
|
inst._zod.parse = (payload, ctx) => {
|
|
7844
|
-
const
|
|
7845
|
-
if (!(
|
|
7844
|
+
const input2 = payload.value;
|
|
7845
|
+
if (!(input2 instanceof Set)) {
|
|
7846
7846
|
payload.issues.push({
|
|
7847
|
-
input,
|
|
7847
|
+
input: input2,
|
|
7848
7848
|
inst,
|
|
7849
7849
|
expected: "set",
|
|
7850
7850
|
code: "invalid_type"
|
|
@@ -7853,7 +7853,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
|
|
|
7853
7853
|
}
|
|
7854
7854
|
const proms = [];
|
|
7855
7855
|
payload.value = /* @__PURE__ */ new Set();
|
|
7856
|
-
for (const item of
|
|
7856
|
+
for (const item of input2) {
|
|
7857
7857
|
const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
|
|
7858
7858
|
if (result instanceof Promise) {
|
|
7859
7859
|
proms.push(result.then((result2) => handleSetResult(result2, payload)));
|
|
@@ -7878,14 +7878,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
|
|
|
7878
7878
|
inst._zod.values = valuesSet;
|
|
7879
7879
|
inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
|
|
7880
7880
|
inst._zod.parse = (payload, _ctx) => {
|
|
7881
|
-
const
|
|
7882
|
-
if (valuesSet.has(
|
|
7881
|
+
const input2 = payload.value;
|
|
7882
|
+
if (valuesSet.has(input2)) {
|
|
7883
7883
|
return payload;
|
|
7884
7884
|
}
|
|
7885
7885
|
payload.issues.push({
|
|
7886
7886
|
code: "invalid_value",
|
|
7887
7887
|
values,
|
|
7888
|
-
input,
|
|
7888
|
+
input: input2,
|
|
7889
7889
|
inst
|
|
7890
7890
|
});
|
|
7891
7891
|
return payload;
|
|
@@ -7900,14 +7900,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
7900
7900
|
inst._zod.values = values;
|
|
7901
7901
|
inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
|
|
7902
7902
|
inst._zod.parse = (payload, _ctx) => {
|
|
7903
|
-
const
|
|
7904
|
-
if (values.has(
|
|
7903
|
+
const input2 = payload.value;
|
|
7904
|
+
if (values.has(input2)) {
|
|
7905
7905
|
return payload;
|
|
7906
7906
|
}
|
|
7907
7907
|
payload.issues.push({
|
|
7908
7908
|
code: "invalid_value",
|
|
7909
7909
|
values: def.values,
|
|
7910
|
-
input,
|
|
7910
|
+
input: input2,
|
|
7911
7911
|
inst
|
|
7912
7912
|
});
|
|
7913
7913
|
return payload;
|
|
@@ -7916,13 +7916,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
|
|
|
7916
7916
|
var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
|
|
7917
7917
|
$ZodType.init(inst, def);
|
|
7918
7918
|
inst._zod.parse = (payload, _ctx) => {
|
|
7919
|
-
const
|
|
7920
|
-
if (
|
|
7919
|
+
const input2 = payload.value;
|
|
7920
|
+
if (input2 instanceof File)
|
|
7921
7921
|
return payload;
|
|
7922
7922
|
payload.issues.push({
|
|
7923
7923
|
expected: "file",
|
|
7924
7924
|
code: "invalid_type",
|
|
7925
|
-
input,
|
|
7925
|
+
input: input2,
|
|
7926
7926
|
inst
|
|
7927
7927
|
});
|
|
7928
7928
|
return payload;
|
|
@@ -7952,8 +7952,8 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
|
|
|
7952
7952
|
return payload;
|
|
7953
7953
|
};
|
|
7954
7954
|
});
|
|
7955
|
-
function handleOptionalResult(result,
|
|
7956
|
-
if (
|
|
7955
|
+
function handleOptionalResult(result, input2) {
|
|
7956
|
+
if (input2 === void 0 && (result.issues.length || result.fallback)) {
|
|
7957
7957
|
return { issues: [], value: void 0 };
|
|
7958
7958
|
}
|
|
7959
7959
|
return result;
|
|
@@ -7971,11 +7971,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
|
|
|
7971
7971
|
});
|
|
7972
7972
|
inst._zod.parse = (payload, ctx) => {
|
|
7973
7973
|
if (def.innerType._zod.optin === "optional") {
|
|
7974
|
-
const
|
|
7974
|
+
const input2 = payload.value;
|
|
7975
7975
|
const result = def.innerType._zod.run(payload, ctx);
|
|
7976
7976
|
if (result instanceof Promise)
|
|
7977
|
-
return result.then((r) => handleOptionalResult(r,
|
|
7978
|
-
return handleOptionalResult(result,
|
|
7977
|
+
return result.then((r) => handleOptionalResult(r, input2));
|
|
7978
|
+
return handleOptionalResult(result, input2);
|
|
7979
7979
|
}
|
|
7980
7980
|
if (payload.value === void 0) {
|
|
7981
7981
|
return payload;
|
|
@@ -8400,20 +8400,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
|
|
|
8400
8400
|
return payload;
|
|
8401
8401
|
};
|
|
8402
8402
|
inst._zod.check = (payload) => {
|
|
8403
|
-
const
|
|
8404
|
-
const r = def.fn(
|
|
8403
|
+
const input2 = payload.value;
|
|
8404
|
+
const r = def.fn(input2);
|
|
8405
8405
|
if (r instanceof Promise) {
|
|
8406
|
-
return r.then((r2) => handleRefineResult(r2, payload,
|
|
8406
|
+
return r.then((r2) => handleRefineResult(r2, payload, input2, inst));
|
|
8407
8407
|
}
|
|
8408
|
-
handleRefineResult(r, payload,
|
|
8408
|
+
handleRefineResult(r, payload, input2, inst);
|
|
8409
8409
|
return;
|
|
8410
8410
|
};
|
|
8411
8411
|
});
|
|
8412
|
-
function handleRefineResult(result, payload,
|
|
8412
|
+
function handleRefineResult(result, payload, input2, inst) {
|
|
8413
8413
|
if (!result) {
|
|
8414
8414
|
const _iss = {
|
|
8415
8415
|
code: "custom",
|
|
8416
|
-
input,
|
|
8416
|
+
input: input2,
|
|
8417
8417
|
inst,
|
|
8418
8418
|
// incorporates params.error into issue reporting
|
|
8419
8419
|
path: [...inst._zod.def.path ?? []],
|
|
@@ -11700,8 +11700,8 @@ function ko_default() {
|
|
|
11700
11700
|
}
|
|
11701
11701
|
|
|
11702
11702
|
// ../../../node_modules/zod/v4/locales/lt.js
|
|
11703
|
-
var capitalizeFirstCharacter = (
|
|
11704
|
-
return
|
|
11703
|
+
var capitalizeFirstCharacter = (text2) => {
|
|
11704
|
+
return text2.charAt(0).toUpperCase() + text2.slice(1);
|
|
11705
11705
|
};
|
|
11706
11706
|
function getUnitTypeFromNumber(number4) {
|
|
11707
11707
|
const abs = Math.abs(number4);
|
|
@@ -15101,23 +15101,23 @@ function _overwrite(tx) {
|
|
|
15101
15101
|
}
|
|
15102
15102
|
// @__NO_SIDE_EFFECTS__
|
|
15103
15103
|
function _normalize(form) {
|
|
15104
|
-
return /* @__PURE__ */ _overwrite((
|
|
15104
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.normalize(form));
|
|
15105
15105
|
}
|
|
15106
15106
|
// @__NO_SIDE_EFFECTS__
|
|
15107
15107
|
function _trim() {
|
|
15108
|
-
return /* @__PURE__ */ _overwrite((
|
|
15108
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.trim());
|
|
15109
15109
|
}
|
|
15110
15110
|
// @__NO_SIDE_EFFECTS__
|
|
15111
15111
|
function _toLowerCase() {
|
|
15112
|
-
return /* @__PURE__ */ _overwrite((
|
|
15112
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toLowerCase());
|
|
15113
15113
|
}
|
|
15114
15114
|
// @__NO_SIDE_EFFECTS__
|
|
15115
15115
|
function _toUpperCase() {
|
|
15116
|
-
return /* @__PURE__ */ _overwrite((
|
|
15116
|
+
return /* @__PURE__ */ _overwrite((input2) => input2.toUpperCase());
|
|
15117
15117
|
}
|
|
15118
15118
|
// @__NO_SIDE_EFFECTS__
|
|
15119
15119
|
function _slugify() {
|
|
15120
|
-
return /* @__PURE__ */ _overwrite((
|
|
15120
|
+
return /* @__PURE__ */ _overwrite((input2) => slugify(input2));
|
|
15121
15121
|
}
|
|
15122
15122
|
// @__NO_SIDE_EFFECTS__
|
|
15123
15123
|
function _array(Class2, element, params) {
|
|
@@ -15422,8 +15422,8 @@ function _stringbool(Classes, _params) {
|
|
|
15422
15422
|
type: "pipe",
|
|
15423
15423
|
in: stringSchema,
|
|
15424
15424
|
out: booleanSchema,
|
|
15425
|
-
transform: ((
|
|
15426
|
-
let data =
|
|
15425
|
+
transform: ((input2, payload) => {
|
|
15426
|
+
let data = input2;
|
|
15427
15427
|
if (params.case !== "sensitive")
|
|
15428
15428
|
data = data.toLowerCase();
|
|
15429
15429
|
if (truthySet.has(data)) {
|
|
@@ -15442,8 +15442,8 @@ function _stringbool(Classes, _params) {
|
|
|
15442
15442
|
return {};
|
|
15443
15443
|
}
|
|
15444
15444
|
}),
|
|
15445
|
-
reverseTransform: ((
|
|
15446
|
-
if (
|
|
15445
|
+
reverseTransform: ((input2, _payload) => {
|
|
15446
|
+
if (input2 === true) {
|
|
15447
15447
|
return truthyArray[0] || "true";
|
|
15448
15448
|
} else {
|
|
15449
15449
|
return falsyArray[0] || "false";
|
|
@@ -16339,9 +16339,9 @@ var allProcessors = {
|
|
|
16339
16339
|
optional: optionalProcessor,
|
|
16340
16340
|
lazy: lazyProcessor
|
|
16341
16341
|
};
|
|
16342
|
-
function toJSONSchema(
|
|
16343
|
-
if ("_idmap" in
|
|
16344
|
-
const registry2 =
|
|
16342
|
+
function toJSONSchema(input2, params) {
|
|
16343
|
+
if ("_idmap" in input2) {
|
|
16344
|
+
const registry2 = input2;
|
|
16345
16345
|
const ctx2 = initializeContext({ ...params, processors: allProcessors });
|
|
16346
16346
|
const defs = {};
|
|
16347
16347
|
for (const entry of registry2._idmap.entries()) {
|
|
@@ -16369,9 +16369,9 @@ function toJSONSchema(input, params) {
|
|
|
16369
16369
|
return { schemas };
|
|
16370
16370
|
}
|
|
16371
16371
|
const ctx = initializeContext({ ...params, processors: allProcessors });
|
|
16372
|
-
process2(
|
|
16373
|
-
extractDefs(ctx,
|
|
16374
|
-
return finalize(ctx,
|
|
16372
|
+
process2(input2, ctx);
|
|
16373
|
+
extractDefs(ctx, input2);
|
|
16374
|
+
return finalize(ctx, input2);
|
|
16375
16375
|
}
|
|
16376
16376
|
|
|
16377
16377
|
// ../../../node_modules/zod/v4/core/json-schema-generator.js
|
|
@@ -18648,7 +18648,7 @@ var codexhostErrorSchema = external_exports.strictObject({
|
|
|
18648
18648
|
|
|
18649
18649
|
// ../../shared-contracts/dist/harness-presentation.js
|
|
18650
18650
|
var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
|
|
18651
|
-
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((
|
|
18651
|
+
var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
|
|
18652
18652
|
var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
|
|
18653
18653
|
label: displayText(256).optional(),
|
|
18654
18654
|
description: displayText(1024).optional()
|
|
@@ -18737,7 +18737,7 @@ var usageMeasurementsSchema = external_exports.object({
|
|
|
18737
18737
|
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
18738
18738
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
18739
18739
|
}).strict();
|
|
18740
|
-
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((
|
|
18740
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
18741
18741
|
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
18742
18742
|
kind: external_exports.literal("countdown"),
|
|
18743
18743
|
id: external_exports.string().min(1).max(64),
|
|
@@ -19120,6 +19120,8 @@ var externalThreadInspectionSchema = external_exports.object({
|
|
|
19120
19120
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
19121
19121
|
availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
|
|
19122
19122
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
19123
|
+
/** Live Session catalog when it, not the Adapter inspection, contains `effectiveModel`. */
|
|
19124
|
+
catalog: harnessModelCatalogSchema.optional(),
|
|
19123
19125
|
history: harnessHistoryCapabilitiesSchema,
|
|
19124
19126
|
usage: threadUsageSnapshotSchema.optional(),
|
|
19125
19127
|
locked: external_exports.literal(true)
|
|
@@ -19178,9 +19180,9 @@ var threadSteeringInspectParamsSchema = external_exports.object({
|
|
|
19178
19180
|
}).strict();
|
|
19179
19181
|
var threadSteeringContextSchema = external_exports.object({
|
|
19180
19182
|
kind: external_exports.literal("application"),
|
|
19181
|
-
value: external_exports.string().transform((
|
|
19183
|
+
value: external_exports.string().transform((text2, context) => {
|
|
19182
19184
|
try {
|
|
19183
|
-
return JSON.parse(
|
|
19185
|
+
return JSON.parse(text2);
|
|
19184
19186
|
} catch {
|
|
19185
19187
|
context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
|
|
19186
19188
|
return external_exports.NEVER;
|
|
@@ -19315,8 +19317,8 @@ var desktopExtensionHttpUrlSchema = external_exports.string().trim().max(2048).r
|
|
|
19315
19317
|
const { username, password } = new URL(value);
|
|
19316
19318
|
return !username && !password && !/[\\\s]/u.test(value);
|
|
19317
19319
|
}, "URL must not contain credentials, backslashes, or whitespace");
|
|
19318
|
-
function localizedText(
|
|
19319
|
-
return external_exports.strictObject({ en:
|
|
19320
|
+
function localizedText(text2) {
|
|
19321
|
+
return external_exports.strictObject({ en: text2, "zh-CN": text2 });
|
|
19320
19322
|
}
|
|
19321
19323
|
var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
|
|
19322
19324
|
var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
|
|
@@ -19433,8 +19435,8 @@ var desktopExtensionTrustTierSchema = external_exports.enum(["official", "commun
|
|
|
19433
19435
|
function isGitHubDesktopExtensionZipballUrl(url2) {
|
|
19434
19436
|
return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
|
|
19435
19437
|
}
|
|
19436
|
-
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((
|
|
19437
|
-
const url2 = new URL(
|
|
19438
|
+
var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input2) => {
|
|
19439
|
+
const url2 = new URL(input2);
|
|
19438
19440
|
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);
|
|
19439
19441
|
}, "Expected a .zip download URL or a GitHub zipball URL");
|
|
19440
19442
|
var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
|
|
@@ -19785,6 +19787,8 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
19785
19787
|
"codexhost/workspace/read",
|
|
19786
19788
|
"codexhost/thread/tree/read",
|
|
19787
19789
|
"codexhost/thread/pins/list",
|
|
19790
|
+
"codexhost/thread/sections/list",
|
|
19791
|
+
"codexhost/thread/sections/move",
|
|
19788
19792
|
"codexhost/thread/pins/set",
|
|
19789
19793
|
"codexhost/harness/plugins/list",
|
|
19790
19794
|
"codexhost/harness/inspect",
|
|
@@ -19823,8 +19827,21 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
19823
19827
|
"codexhost/update/check",
|
|
19824
19828
|
"codexhost/update/start",
|
|
19825
19829
|
"codexhost/update/status",
|
|
19830
|
+
"codexhost/announcement/get",
|
|
19831
|
+
"codexhost/announcement/acknowledge",
|
|
19826
19832
|
"codexhost/sessions/loaded/list"
|
|
19827
19833
|
];
|
|
19834
|
+
var clientThreadSectionsSchema = external_exports.object({
|
|
19835
|
+
sections: external_exports.array(external_exports.object({
|
|
19836
|
+
id: external_exports.string().min(1),
|
|
19837
|
+
name: external_exports.string().min(1),
|
|
19838
|
+
threads: external_exports.array(jsonObjectSchema)
|
|
19839
|
+
}).strict())
|
|
19840
|
+
}).strict();
|
|
19841
|
+
var clientThreadSectionMoveSchema = external_exports.object({
|
|
19842
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
19843
|
+
sectionId: external_exports.string().min(1).max(1024).nullable()
|
|
19844
|
+
}).strict();
|
|
19828
19845
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
19829
19846
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
19830
19847
|
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
@@ -20366,8 +20383,8 @@ var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
|
20366
20383
|
operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
|
|
20367
20384
|
initializeOnly: external_exports.boolean().optional(),
|
|
20368
20385
|
expectedRevision: external_exports.number().int().nonnegative().optional()
|
|
20369
|
-
}).superRefine((
|
|
20370
|
-
for (const operation of
|
|
20386
|
+
}).superRefine((input2, ctx) => {
|
|
20387
|
+
for (const operation of input2.operations) {
|
|
20371
20388
|
if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
|
|
20372
20389
|
ctx.addIssue({
|
|
20373
20390
|
code: "custom",
|
|
@@ -20769,13 +20786,18 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
20769
20786
|
// ../../shared-contracts/dist/harness-installation.js
|
|
20770
20787
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
20771
20788
|
harnessId: harnessIdSchema,
|
|
20772
|
-
action: external_exports.enum(["check", "update", "install"])
|
|
20773
|
-
|
|
20789
|
+
action: external_exports.enum(["check", "update", "install"]),
|
|
20790
|
+
confirmedVersion: external_exports.string().min(1).max(128).optional()
|
|
20791
|
+
}).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
|
|
20774
20792
|
var harnessInstallationStateSchema = external_exports.object({
|
|
20775
20793
|
currentVersion: external_exports.string().min(1).max(128),
|
|
20776
20794
|
latestVersion: external_exports.string().min(1).max(128),
|
|
20777
20795
|
updateAvailable: external_exports.boolean(),
|
|
20778
20796
|
canUpdate: external_exports.boolean(),
|
|
20797
|
+
/** Present when the Adapter has a verified list and the available target is outside it. */
|
|
20798
|
+
latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
|
|
20799
|
+
/** Update preflight stopped before running the installer; latestVersion needs confirmation. */
|
|
20800
|
+
confirmationRequired: external_exports.literal(true).optional(),
|
|
20779
20801
|
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
20780
20802
|
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
20781
20803
|
/** Official download opened by the user; does not imply an automatic installation. */
|
|
@@ -21105,6 +21127,38 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
21105
21127
|
status: updateStatusSchema.nullable()
|
|
21106
21128
|
});
|
|
21107
21129
|
|
|
21130
|
+
// ../../shared-contracts/dist/release-announcement.js
|
|
21131
|
+
var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
|
|
21132
|
+
var releaseAnnouncementThemeSchema = external_exports.strictObject({
|
|
21133
|
+
icon: external_exports.string().min(1).max(16).optional(),
|
|
21134
|
+
title: external_exports.string().min(1).max(120),
|
|
21135
|
+
body: external_exports.string().min(1).max(1200),
|
|
21136
|
+
contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
|
|
21137
|
+
});
|
|
21138
|
+
var releaseAnnouncementContentSchema = external_exports.strictObject({
|
|
21139
|
+
summary: external_exports.string().min(1).max(600).optional(),
|
|
21140
|
+
themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
|
|
21141
|
+
});
|
|
21142
|
+
var releaseAnnouncementSchema = external_exports.strictObject({
|
|
21143
|
+
version: updateSemanticVersionSchema,
|
|
21144
|
+
publishedAt: external_exports.iso.datetime(),
|
|
21145
|
+
url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
|
|
21146
|
+
zh: releaseAnnouncementContentSchema.nullable(),
|
|
21147
|
+
en: releaseAnnouncementContentSchema.nullable()
|
|
21148
|
+
}).refine((value) => value.zh !== null || value.en !== null, {
|
|
21149
|
+
message: "an announcement needs at least one language"
|
|
21150
|
+
});
|
|
21151
|
+
var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
|
|
21152
|
+
manual: external_exports.boolean().optional()
|
|
21153
|
+
});
|
|
21154
|
+
var releaseAnnouncementGetResultSchema = external_exports.strictObject({
|
|
21155
|
+
announcement: releaseAnnouncementSchema.nullable(),
|
|
21156
|
+
unread: external_exports.boolean()
|
|
21157
|
+
});
|
|
21158
|
+
var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
|
|
21159
|
+
version: updateSemanticVersionSchema
|
|
21160
|
+
});
|
|
21161
|
+
|
|
21108
21162
|
// ../../shared-contracts/dist/thread-watch-notice.js
|
|
21109
21163
|
var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
21110
21164
|
"completed",
|
|
@@ -21152,17 +21206,67 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
|
|
|
21152
21206
|
|
|
21153
21207
|
// ../../shared-contracts/dist/remote-sessions.js
|
|
21154
21208
|
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
21155
|
-
var
|
|
21209
|
+
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
21210
|
+
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
21156
21211
|
var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
21157
21212
|
var thread = { ...target, threadId: identity };
|
|
21213
|
+
var text = external_exports.string().min(1).max(8e3);
|
|
21214
|
+
var input = { text, requestId: identity };
|
|
21215
|
+
var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
|
|
21216
|
+
external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
|
|
21217
|
+
external_exports.object({
|
|
21218
|
+
accepted: external_exports.literal(false),
|
|
21219
|
+
code: external_exports.enum([
|
|
21220
|
+
"remote/queue-unavailable",
|
|
21221
|
+
"remote/steer-unavailable",
|
|
21222
|
+
"remote/turn-changed",
|
|
21223
|
+
"remote/send-rejected",
|
|
21224
|
+
"session/queue-item-not-found",
|
|
21225
|
+
"session/queue-item-starting"
|
|
21226
|
+
]),
|
|
21227
|
+
message: external_exports.string()
|
|
21228
|
+
})
|
|
21229
|
+
]);
|
|
21230
|
+
var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
|
|
21231
|
+
external_exports.object({ available: external_exports.literal(false) }),
|
|
21232
|
+
external_exports.object({
|
|
21233
|
+
available: external_exports.literal(true),
|
|
21234
|
+
items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
|
|
21235
|
+
})
|
|
21236
|
+
]);
|
|
21158
21237
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
21159
21238
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
21239
|
+
external_exports.strictObject({
|
|
21240
|
+
kind: external_exports.literal("create"),
|
|
21241
|
+
...target,
|
|
21242
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
21243
|
+
epoch: identity
|
|
21244
|
+
}),
|
|
21245
|
+
external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
|
|
21246
|
+
external_exports.strictObject({
|
|
21247
|
+
kind: external_exports.literal("inspectHarness"),
|
|
21248
|
+
...target,
|
|
21249
|
+
epoch: identity,
|
|
21250
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
21251
|
+
harnessId: identity
|
|
21252
|
+
}),
|
|
21253
|
+
external_exports.strictObject({
|
|
21254
|
+
kind: external_exports.literal("startSelected"),
|
|
21255
|
+
...target,
|
|
21256
|
+
epoch: identity,
|
|
21257
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
21258
|
+
harnessId: identity,
|
|
21259
|
+
model: external_exports.string().min(1).max(4096),
|
|
21260
|
+
serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
|
|
21261
|
+
reasoningEffort: identity.optional()
|
|
21262
|
+
}),
|
|
21160
21263
|
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
21161
21264
|
external_exports.strictObject({
|
|
21162
21265
|
kind: external_exports.literal("list"),
|
|
21163
21266
|
...target,
|
|
21164
21267
|
cursor: external_exports.string().nullable(),
|
|
21165
|
-
archived: external_exports.boolean()
|
|
21268
|
+
archived: external_exports.boolean(),
|
|
21269
|
+
includeLoaded: external_exports.literal(true).optional()
|
|
21166
21270
|
}),
|
|
21167
21271
|
external_exports.strictObject({
|
|
21168
21272
|
kind: external_exports.literal("read"),
|
|
@@ -21192,9 +21296,25 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
21192
21296
|
kind: external_exports.literal("prompt"),
|
|
21193
21297
|
...thread,
|
|
21194
21298
|
epoch: identity,
|
|
21195
|
-
text
|
|
21299
|
+
text,
|
|
21196
21300
|
requestId: identity.optional()
|
|
21197
21301
|
}),
|
|
21302
|
+
external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
|
|
21303
|
+
external_exports.strictObject({
|
|
21304
|
+
kind: external_exports.literal("delivery"),
|
|
21305
|
+
...thread,
|
|
21306
|
+
epoch: identity,
|
|
21307
|
+
action: external_exports.discriminatedUnion("kind", [
|
|
21308
|
+
external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input }),
|
|
21309
|
+
external_exports.strictObject({ kind: external_exports.literal("steer"), ...input, turnId: identity }),
|
|
21310
|
+
external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
|
|
21311
|
+
external_exports.strictObject({
|
|
21312
|
+
kind: external_exports.literal("start"),
|
|
21313
|
+
itemId: identity,
|
|
21314
|
+
onlyIfHead: external_exports.literal(true).optional()
|
|
21315
|
+
})
|
|
21316
|
+
])
|
|
21317
|
+
}),
|
|
21198
21318
|
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
21199
21319
|
external_exports.strictObject({
|
|
21200
21320
|
kind: external_exports.literal("rename"),
|
|
@@ -27273,19 +27393,19 @@ function deserializeHookInput(raw) {
|
|
|
27273
27393
|
...stop_hook_active === void 0 ? {} : { stopHookActive: stop_hook_active }
|
|
27274
27394
|
};
|
|
27275
27395
|
}
|
|
27276
|
-
function normalizeHookError(hookType,
|
|
27396
|
+
function normalizeHookError(hookType, input2) {
|
|
27277
27397
|
if (hookType !== "errorOccurred" && hookType !== "sessionEnd") {
|
|
27278
|
-
return
|
|
27398
|
+
return input2;
|
|
27279
27399
|
}
|
|
27280
|
-
if (!
|
|
27281
|
-
return
|
|
27400
|
+
if (!input2 || typeof input2 !== "object" || !("error" in input2)) {
|
|
27401
|
+
return input2;
|
|
27282
27402
|
}
|
|
27283
|
-
const { error: error51 } =
|
|
27403
|
+
const { error: error51 } = input2;
|
|
27284
27404
|
if (!error51 || typeof error51 !== "object" || Array.isArray(error51)) {
|
|
27285
|
-
return
|
|
27405
|
+
return input2;
|
|
27286
27406
|
}
|
|
27287
27407
|
const { message } = error51;
|
|
27288
|
-
return { ...
|
|
27408
|
+
return { ...input2, error: typeof message === "string" ? message : JSON.stringify(error51) };
|
|
27289
27409
|
}
|
|
27290
27410
|
function isOpenCanvasInstance(value) {
|
|
27291
27411
|
if (!value || typeof value !== "object") {
|
|
@@ -27363,11 +27483,11 @@ var WorkflowProgressBuffer = class {
|
|
|
27363
27483
|
flushError;
|
|
27364
27484
|
flushFailed = false;
|
|
27365
27485
|
closed = false;
|
|
27366
|
-
enqueue(kind,
|
|
27486
|
+
enqueue(kind, text2) {
|
|
27367
27487
|
if (this.closed) {
|
|
27368
27488
|
throw new Error("Cannot log after the workflow run has settled");
|
|
27369
27489
|
}
|
|
27370
|
-
this.pending.push({ seq: this.nextSeq++, kind, text });
|
|
27490
|
+
this.pending.push({ seq: this.nextSeq++, kind, text: text2 });
|
|
27371
27491
|
this.scheduleFlush();
|
|
27372
27492
|
}
|
|
27373
27493
|
async flush() {
|
|
@@ -29049,12 +29169,12 @@ var CopilotSession = class {
|
|
|
29049
29169
|
* @returns A promise that resolves with the hook output, or undefined
|
|
29050
29170
|
* @internal This method is for internal use by the SDK.
|
|
29051
29171
|
*/
|
|
29052
|
-
async _handleHooksInvoke(hookType,
|
|
29172
|
+
async _handleHooksInvoke(hookType, input2) {
|
|
29053
29173
|
this.assertConnected();
|
|
29054
29174
|
if (!this.hooks) {
|
|
29055
29175
|
return void 0;
|
|
29056
29176
|
}
|
|
29057
|
-
const normalized = normalizeHookError(hookType, deserializeHookInput(
|
|
29177
|
+
const normalized = normalizeHookError(hookType, deserializeHookInput(input2));
|
|
29058
29178
|
const handlerMap = {
|
|
29059
29179
|
preToolUse: this.hooks.onPreToolUse,
|
|
29060
29180
|
preMcpToolCall: this.hooks.onPreMcpToolCall,
|
|
@@ -32907,8 +33027,8 @@ var VERSION_MANAGER_ROOTS = "<version-managers>";
|
|
|
32907
33027
|
function installRootExtensions(platform) {
|
|
32908
33028
|
return platform === "win32" ? [".exe", ".cmd"] : [""];
|
|
32909
33029
|
}
|
|
32910
|
-
function resolveHomeDirectory(
|
|
32911
|
-
return
|
|
33030
|
+
function resolveHomeDirectory(input2) {
|
|
33031
|
+
return input2.homeDirectory ?? environmentValue(input2.environment, "HOME") ?? environmentValue(input2.environment, "USERPROFILE") ?? os.homedir();
|
|
32912
33032
|
}
|
|
32913
33033
|
function templateVariables(environment, platform, home) {
|
|
32914
33034
|
const pathFlavor = targetPath(platform);
|
|
@@ -32941,36 +33061,36 @@ function expandInstallRoot(template, environment, platform, home) {
|
|
|
32941
33061
|
});
|
|
32942
33062
|
return unresolved ? void 0 : joinTemplate(platform, substituted);
|
|
32943
33063
|
}
|
|
32944
|
-
function installRootDirectories(spec,
|
|
33064
|
+
function installRootDirectories(spec, input2, dependencies, platform, home) {
|
|
32945
33065
|
const templates = (platform === "win32" ? spec.installRoots?.windows : spec.installRoots?.posix) ?? [];
|
|
32946
33066
|
const directories = [];
|
|
32947
33067
|
for (const template of templates) {
|
|
32948
33068
|
if (template === VERSION_MANAGER_ROOTS) {
|
|
32949
33069
|
directories.push(...versionManagerBinaryDirectories({
|
|
32950
33070
|
platform,
|
|
32951
|
-
environment:
|
|
33071
|
+
environment: input2.environment,
|
|
32952
33072
|
home,
|
|
32953
33073
|
...dependencies.subdirectories ? { subdirectories: dependencies.subdirectories } : {}
|
|
32954
33074
|
}));
|
|
32955
33075
|
continue;
|
|
32956
33076
|
}
|
|
32957
|
-
const directory = expandInstallRoot(template,
|
|
33077
|
+
const directory = expandInstallRoot(template, input2.environment, platform, home);
|
|
32958
33078
|
if (directory !== void 0)
|
|
32959
33079
|
directories.push(directory);
|
|
32960
33080
|
}
|
|
32961
33081
|
return directories;
|
|
32962
33082
|
}
|
|
32963
|
-
function harnessCandidates(spec,
|
|
32964
|
-
const platform =
|
|
33083
|
+
function harnessCandidates(spec, input2, dependencies = {}) {
|
|
33084
|
+
const platform = input2.platform ?? process.platform;
|
|
32965
33085
|
const pathFlavor = targetPath(platform);
|
|
32966
|
-
const configured =
|
|
33086
|
+
const configured = input2.command ?? (spec.commandEnvironmentVariable ? environmentValue(input2.environment, spec.commandEnvironmentVariable) : void 0);
|
|
32967
33087
|
const command = configured ?? spec.command;
|
|
32968
33088
|
if (pathFlavor.isAbsolute(command) || command.includes("/") || command.includes("\\")) {
|
|
32969
33089
|
return [{ candidate: command, source: "configured" }];
|
|
32970
33090
|
}
|
|
32971
33091
|
const candidates = [];
|
|
32972
|
-
const extensions = executableExtensions(command, platform,
|
|
32973
|
-
for (const directory of pathDirectories(
|
|
33092
|
+
const extensions = executableExtensions(command, platform, input2.environment);
|
|
33093
|
+
for (const directory of pathDirectories(input2.environment, platform)) {
|
|
32974
33094
|
for (const extension of extensions) {
|
|
32975
33095
|
candidates.push({
|
|
32976
33096
|
candidate: pathFlavor.join(directory, command + extension),
|
|
@@ -32980,8 +33100,8 @@ function harnessCandidates(spec, input, dependencies = {}) {
|
|
|
32980
33100
|
}
|
|
32981
33101
|
if (configured !== void 0)
|
|
32982
33102
|
return candidates;
|
|
32983
|
-
const home = resolveHomeDirectory(
|
|
32984
|
-
for (const directory of installRootDirectories(spec,
|
|
33103
|
+
const home = resolveHomeDirectory(input2);
|
|
33104
|
+
for (const directory of installRootDirectories(spec, input2, dependencies, platform, home)) {
|
|
32985
33105
|
for (const extension of installRootExtensions(platform)) {
|
|
32986
33106
|
candidates.push({
|
|
32987
33107
|
candidate: pathFlavor.join(directory, spec.command + extension),
|
|
@@ -32991,12 +33111,12 @@ function harnessCandidates(spec, input, dependencies = {}) {
|
|
|
32991
33111
|
}
|
|
32992
33112
|
return candidates;
|
|
32993
33113
|
}
|
|
32994
|
-
function resolveHarnessExecutable(spec,
|
|
32995
|
-
const platform =
|
|
33114
|
+
function resolveHarnessExecutable(spec, input2, dependencies = {}) {
|
|
33115
|
+
const platform = input2.platform ?? process.platform;
|
|
32996
33116
|
const isExecutable = dependencies.isExecutable ?? ((candidate) => isExecutableFile(candidate, platform));
|
|
32997
33117
|
const runnable = spec.runnableCandidate ?? ((candidate) => candidate);
|
|
32998
33118
|
const context = { platform, isExecutable };
|
|
32999
|
-
for (const { candidate, source } of harnessCandidates(spec,
|
|
33119
|
+
for (const { candidate, source } of harnessCandidates(spec, input2, dependencies)) {
|
|
33000
33120
|
const executable = runnable(candidate, context);
|
|
33001
33121
|
if (executable !== void 0 && isExecutable(executable))
|
|
33002
33122
|
return { executable, source };
|
|
@@ -33007,13 +33127,13 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
|
|
|
33007
33127
|
// ../../harness-discovery/dist/installation.js
|
|
33008
33128
|
import { execFile } from "node:child_process";
|
|
33009
33129
|
import { homedir as homedir2 } from "node:os";
|
|
33010
|
-
function runInstallationCommand(command, args, environment, timeout = 3e4) {
|
|
33130
|
+
function runInstallationCommand(command, args, environment, timeout = 3e4, cwd) {
|
|
33011
33131
|
const env = withNodeRuntimeOnPath(environment);
|
|
33012
33132
|
const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
|
|
33013
33133
|
return new Promise((resolve3, reject) => {
|
|
33014
33134
|
const child = execFile(invocation.command, invocation.arguments, {
|
|
33015
33135
|
env,
|
|
33016
|
-
cwd: env.HOME ?? env.USERPROFILE ?? homedir2(),
|
|
33136
|
+
cwd: cwd ?? env.HOME ?? env.USERPROFILE ?? homedir2(),
|
|
33017
33137
|
encoding: "utf8",
|
|
33018
33138
|
timeout,
|
|
33019
33139
|
killSignal: "SIGKILL",
|
|
@@ -33076,7 +33196,7 @@ function createInstallationManager(options2) {
|
|
|
33076
33196
|
const check2 = () => checking ??= options2.check().finally(() => {
|
|
33077
33197
|
checking = void 0;
|
|
33078
33198
|
});
|
|
33079
|
-
return (action) => {
|
|
33199
|
+
return (action, confirmedVersion) => {
|
|
33080
33200
|
if (updating)
|
|
33081
33201
|
return updating;
|
|
33082
33202
|
if (action === "check")
|
|
@@ -33087,6 +33207,8 @@ function createInstallationManager(options2) {
|
|
|
33087
33207
|
return before;
|
|
33088
33208
|
if (!before.canUpdate)
|
|
33089
33209
|
throw new Error(before.message ?? "This installation cannot be updated automatically");
|
|
33210
|
+
if ((before.latestVerifiedVersion !== void 0 || confirmedVersion !== void 0) && before.latestVersion !== confirmedVersion)
|
|
33211
|
+
return { ...before, confirmationRequired: true };
|
|
33090
33212
|
await options2.update(before);
|
|
33091
33213
|
const after = await check2();
|
|
33092
33214
|
if (after.currentVersion === before.currentVersion)
|
|
@@ -33121,8 +33243,8 @@ function referencesNpmBin(shim, name, bin) {
|
|
|
33121
33243
|
if (bin.includes(".."))
|
|
33122
33244
|
return false;
|
|
33123
33245
|
const target2 = `node_modules/${name}/${bin.replace(/^\.\//, "")}`.toLowerCase();
|
|
33124
|
-
const
|
|
33125
|
-
return
|
|
33246
|
+
const text2 = shim.replaceAll("\\", "/").toLowerCase();
|
|
33247
|
+
return text2.includes(`%dp0%/${target2}"`) || text2.includes(`%~dp0/${target2}"`);
|
|
33126
33248
|
}
|
|
33127
33249
|
async function npmInstallation(command, packages, environment) {
|
|
33128
33250
|
let selected = await realpath(command);
|
|
@@ -33131,7 +33253,7 @@ async function npmInstallation(command, packages, environment) {
|
|
|
33131
33253
|
const root = path4.dirname(selected);
|
|
33132
33254
|
for (const name of packages) {
|
|
33133
33255
|
const directory2 = path4.join(root, "node_modules", ...name.split("/"));
|
|
33134
|
-
const metadata = await readFile(path4.join(directory2, "package.json"), "utf8").then((
|
|
33256
|
+
const metadata = await readFile(path4.join(directory2, "package.json"), "utf8").then((text2) => JSON.parse(text2)).catch(() => null);
|
|
33135
33257
|
const bins = typeof metadata?.bin === "string" ? [metadata.bin] : Object.values(metadata?.bin ?? {});
|
|
33136
33258
|
const bin = bins.find((entry) => referencesNpmBin(shim, name, entry));
|
|
33137
33259
|
if (bin) {
|
|
@@ -33142,7 +33264,7 @@ async function npmInstallation(command, packages, environment) {
|
|
|
33142
33264
|
}
|
|
33143
33265
|
let directory = path4.dirname(selected);
|
|
33144
33266
|
for (let depth = 0; depth < 8; depth++) {
|
|
33145
|
-
const metadata = await readFile(path4.join(directory, "package.json"), "utf8").then((
|
|
33267
|
+
const metadata = await readFile(path4.join(directory, "package.json"), "utf8").then((text2) => JSON.parse(text2)).catch(() => null);
|
|
33146
33268
|
if (metadata?.name && packages.includes(metadata.name)) {
|
|
33147
33269
|
const name = metadata.name;
|
|
33148
33270
|
const currentVersion = installationVersion(metadata.version);
|
|
@@ -33212,12 +33334,12 @@ var CopilotLaunchError = class extends Error {
|
|
|
33212
33334
|
this.code = code;
|
|
33213
33335
|
}
|
|
33214
33336
|
};
|
|
33215
|
-
function resolveCopilotExecutable(
|
|
33216
|
-
const resolution = resolveHarnessExecutable(copilotDiscoverySpec,
|
|
33337
|
+
function resolveCopilotExecutable(input2, dependencies = {}) {
|
|
33338
|
+
const resolution = resolveHarnessExecutable(copilotDiscoverySpec, input2, dependencies);
|
|
33217
33339
|
if (!resolution) {
|
|
33218
33340
|
throw new CopilotLaunchError("notInstalled", "Copilot CLI was not found. Install the official CLI or set CODEXHOST_COPILOT_COMMAND.");
|
|
33219
33341
|
}
|
|
33220
|
-
const platform =
|
|
33342
|
+
const platform = input2.platform ?? process.platform;
|
|
33221
33343
|
const executable = resolution.executable;
|
|
33222
33344
|
if (platform === "win32" && /\.(cmd|bat)$/iu.test(executable)) {
|
|
33223
33345
|
const paths = targetPath(platform);
|
|
@@ -33256,16 +33378,16 @@ function copilotEnvironment(base, override = {}, platform = process.platform) {
|
|
|
33256
33378
|
}
|
|
33257
33379
|
return merged;
|
|
33258
33380
|
}
|
|
33259
|
-
function createCopilotClient(
|
|
33260
|
-
const merged = copilotEnvironment(
|
|
33381
|
+
function createCopilotClient(input2) {
|
|
33382
|
+
const merged = copilotEnvironment(input2.environment, input2.sessionEnvironment);
|
|
33261
33383
|
const environment = Object.fromEntries(Object.entries(withNodeRuntimeOnPath(merged)).filter((entry) => entry[1] !== void 0));
|
|
33262
33384
|
const executable = resolveCopilotExecutable({
|
|
33263
33385
|
environment,
|
|
33264
|
-
...
|
|
33386
|
+
...input2.command === void 0 ? {} : { command: input2.command }
|
|
33265
33387
|
});
|
|
33266
33388
|
return new CopilotClient({
|
|
33267
33389
|
connection: RuntimeConnection.forStdio({ path: executable, env: environment }),
|
|
33268
|
-
workingDirectory:
|
|
33390
|
+
workingDirectory: input2.cwd,
|
|
33269
33391
|
mode: "copilot-cli",
|
|
33270
33392
|
useLoggedInUser: true,
|
|
33271
33393
|
logLevel: "none"
|
|
@@ -34134,7 +34256,7 @@ function nativeFileChanges(data) {
|
|
|
34134
34256
|
|
|
34135
34257
|
// dist/projection.js
|
|
34136
34258
|
var OUTPUT_LIMIT = 256 * 1024;
|
|
34137
|
-
var clip = (
|
|
34259
|
+
var clip = (text2) => text2.slice(0, OUTPUT_LIMIT);
|
|
34138
34260
|
var itemId = (id2) => hostItemIdSchema.parse(id2);
|
|
34139
34261
|
var nativeFailure = {
|
|
34140
34262
|
code: "nativeFailure",
|
|
@@ -34192,7 +34314,7 @@ var CopilotItems = class {
|
|
|
34192
34314
|
for (const id2 of this.active.keys())
|
|
34193
34315
|
this.finish(id2, outcome);
|
|
34194
34316
|
}
|
|
34195
|
-
text(id2,
|
|
34317
|
+
text(id2, text2, type, full, phase) {
|
|
34196
34318
|
if (this.snapshots.has(id2))
|
|
34197
34319
|
return;
|
|
34198
34320
|
this.start({ type, itemId: itemId(id2), text: "" });
|
|
@@ -34201,11 +34323,11 @@ var CopilotItems = class {
|
|
|
34201
34323
|
return;
|
|
34202
34324
|
if (item.type === "agentMessage" && (phase === "commentary" || phase === "final_answer"))
|
|
34203
34325
|
item.phase = phase;
|
|
34204
|
-
if (full && !
|
|
34326
|
+
if (full && !text2.startsWith(item.text))
|
|
34205
34327
|
throw new Error("Copilot text delta mismatch");
|
|
34206
|
-
if ((full ?
|
|
34328
|
+
if ((full ? text2.length : item.text.length + text2.length) > OUTPUT_LIMIT)
|
|
34207
34329
|
throw new Error("Copilot message exceeds the output limit");
|
|
34208
|
-
const append = clip(full ?
|
|
34330
|
+
const append = clip(full ? text2.slice(item.text.length) : text2).slice(0, OUTPUT_LIMIT - item.text.length);
|
|
34209
34331
|
item.text += append;
|
|
34210
34332
|
if (append)
|
|
34211
34333
|
this.emit({
|
|
@@ -34444,7 +34566,7 @@ function projectHistory(sessionId, events) {
|
|
|
34444
34566
|
// dist/usage.js
|
|
34445
34567
|
function usageFromMetrics(metrics, context, live = {}) {
|
|
34446
34568
|
const details = metrics.tokenDetails;
|
|
34447
|
-
const
|
|
34569
|
+
const input2 = details?.input?.tokenCount;
|
|
34448
34570
|
const read = details?.cache_read?.tokenCount;
|
|
34449
34571
|
const write = details?.cache_write?.tokenCount;
|
|
34450
34572
|
const output = details?.output?.tokenCount;
|
|
@@ -34458,7 +34580,7 @@ function usageFromMetrics(metrics, context, live = {}) {
|
|
|
34458
34580
|
...read === void 0 ? {} : { cachedInputTokens: read },
|
|
34459
34581
|
...write === void 0 ? {} : { cacheWriteInputTokens: write },
|
|
34460
34582
|
...output === void 0 ? {} : { outputTokens: output },
|
|
34461
|
-
...
|
|
34583
|
+
...input2 === void 0 || read === void 0 || write === void 0 ? {} : { inputTokens: input2 + read + write }
|
|
34462
34584
|
};
|
|
34463
34585
|
if (usage.inputTokens !== void 0 && read !== void 0 && read <= usage.inputTokens)
|
|
34464
34586
|
usage.sessionCacheUsage = { inputTokens: usage.inputTokens, cachedInputTokens: read };
|
|
@@ -34640,15 +34762,15 @@ var CopilotHarnessSession = class {
|
|
|
34640
34762
|
configurationRevision = 0;
|
|
34641
34763
|
retiredItems = /* @__PURE__ */ new Set();
|
|
34642
34764
|
retiredMessages = /* @__PURE__ */ new Set();
|
|
34643
|
-
constructor(
|
|
34765
|
+
constructor(input2, environment, onClosed = () => {
|
|
34644
34766
|
}) {
|
|
34645
|
-
this.input =
|
|
34767
|
+
this.input = input2;
|
|
34646
34768
|
this.environment = environment;
|
|
34647
34769
|
this.onClosed = onClosed;
|
|
34648
|
-
this.nativeId =
|
|
34649
|
-
this.unattended =
|
|
34770
|
+
this.nativeId = input2.kind === "resume" ? sessionIdFromRef(input2.nativeRef) : randomUUID3();
|
|
34771
|
+
this.unattended = input2.kind === "create" ? input2.executionPolicy === "unattended-full-access" : sessionIsUnattended(input2.nativeRef);
|
|
34650
34772
|
this.nativeWriterRef = sessionRef(this.nativeId, this.unattended);
|
|
34651
|
-
this.durable =
|
|
34773
|
+
this.durable = input2.kind === "resume";
|
|
34652
34774
|
this.state = this.durable ? { nativeRef: this.nativeWriterRef } : {};
|
|
34653
34775
|
this.initialState = this.state;
|
|
34654
34776
|
}
|
|
@@ -35528,15 +35650,15 @@ var CopilotAdapter = class {
|
|
|
35528
35650
|
async refreshCredits() {
|
|
35529
35651
|
return (await this.account.refresh())?.credits ?? null;
|
|
35530
35652
|
}
|
|
35531
|
-
async inspect(
|
|
35653
|
+
async inspect(input2 = {}) {
|
|
35532
35654
|
if (this.closed)
|
|
35533
35655
|
return {
|
|
35534
35656
|
status: "unavailable",
|
|
35535
35657
|
error: { code: "invalidState", message: "Copilot Adapter is closed.", retryable: false }
|
|
35536
35658
|
};
|
|
35537
|
-
const cwd = path6.resolve(
|
|
35659
|
+
const cwd = path6.resolve(input2.cwd ?? this.environment.HOME ?? process.cwd());
|
|
35538
35660
|
const pending = this.inspectionsInFlight.get(cwd);
|
|
35539
|
-
if (
|
|
35661
|
+
if (input2.refresh) {
|
|
35540
35662
|
this.inspections.clear();
|
|
35541
35663
|
this.inspectionsInFlight.clear();
|
|
35542
35664
|
if (pending)
|
|
@@ -35624,31 +35746,31 @@ var CopilotAdapter = class {
|
|
|
35624
35746
|
};
|
|
35625
35747
|
return result;
|
|
35626
35748
|
}
|
|
35627
|
-
async open(
|
|
35749
|
+
async open(input2) {
|
|
35628
35750
|
if (this.closed)
|
|
35629
35751
|
return failure("invalidState", "Copilot Adapter is closed.");
|
|
35630
|
-
if (
|
|
35752
|
+
if (input2.kind === "create" && input2.executionPolicy === "unattended-full-access" && input2.permissionModeId && input2.permissionModeId !== "allow-all")
|
|
35631
35753
|
return failure("invalidRequest", "Copilot permission conflicts with unattended execution.");
|
|
35632
35754
|
try {
|
|
35633
|
-
if (!path6.isAbsolute(
|
|
35755
|
+
if (!path6.isAbsolute(input2.cwd))
|
|
35634
35756
|
return failure("invalidRequest", "Copilot cwd must be absolute.");
|
|
35635
|
-
if (!(await stat(
|
|
35757
|
+
if (!(await stat(input2.cwd)).isDirectory())
|
|
35636
35758
|
return failure("invalidRequest", "Copilot cwd must be a directory.");
|
|
35637
35759
|
resolveCopilotExecutable({
|
|
35638
|
-
environment: copilotEnvironment(this.environment,
|
|
35760
|
+
environment: copilotEnvironment(this.environment, input2.environment)
|
|
35639
35761
|
});
|
|
35640
|
-
if (
|
|
35641
|
-
return await this.derive(
|
|
35642
|
-
if (
|
|
35762
|
+
if (input2.kind === "fork" || input2.kind === "rollbackLastTurn")
|
|
35763
|
+
return await this.derive(input2);
|
|
35764
|
+
if (input2.kind === "resume" && this.sessions.has(sessionIdFromRef(input2.nativeRef)))
|
|
35643
35765
|
return failure("sessionBusy", "Copilot session already has a writer.");
|
|
35644
|
-
const session = new CopilotHarnessSession(
|
|
35766
|
+
const session = new CopilotHarnessSession(input2, this.environment, () => this.sessions.delete(session.nativeId));
|
|
35645
35767
|
this.sessions.set(session.nativeId, session);
|
|
35646
35768
|
try {
|
|
35647
|
-
if (
|
|
35769
|
+
if (input2.kind === "resume" || input2.executionPolicy === "unattended-full-access")
|
|
35648
35770
|
await session.initialize();
|
|
35649
35771
|
return { ok: true, value: session };
|
|
35650
35772
|
} catch (error51) {
|
|
35651
|
-
const problem = nativeError(error51, `session.${
|
|
35773
|
+
const problem = nativeError(error51, `session.${input2.kind}`);
|
|
35652
35774
|
try {
|
|
35653
35775
|
await session.close();
|
|
35654
35776
|
} catch {
|
|
@@ -35660,19 +35782,19 @@ var CopilotAdapter = class {
|
|
|
35660
35782
|
return { ok: false, error: problem };
|
|
35661
35783
|
}
|
|
35662
35784
|
} catch (error51) {
|
|
35663
|
-
return { ok: false, error: nativeError(error51, `session.${
|
|
35785
|
+
return { ok: false, error: nativeError(error51, `session.${input2.kind}`) };
|
|
35664
35786
|
}
|
|
35665
35787
|
}
|
|
35666
|
-
async derive(
|
|
35667
|
-
const sourceId = sessionIdFromRef(
|
|
35788
|
+
async derive(input2) {
|
|
35789
|
+
const sourceId = sessionIdFromRef(input2.sourceRef);
|
|
35668
35790
|
const source = this.sessions.get(sourceId);
|
|
35669
|
-
return source ? source.withIdleSource(() => this.deriveIdle(
|
|
35791
|
+
return source ? source.withIdleSource(() => this.deriveIdle(input2, sourceId, source)) : this.deriveIdle(input2, sourceId);
|
|
35670
35792
|
}
|
|
35671
|
-
async deriveIdle(
|
|
35793
|
+
async deriveIdle(input2, sourceId, source) {
|
|
35672
35794
|
const client = createCopilotClient({
|
|
35673
|
-
cwd:
|
|
35795
|
+
cwd: input2.cwd,
|
|
35674
35796
|
environment: this.environment,
|
|
35675
|
-
...
|
|
35797
|
+
...input2.environment ? { sessionEnvironment: input2.environment } : {}
|
|
35676
35798
|
});
|
|
35677
35799
|
this.clients.add(client);
|
|
35678
35800
|
let created;
|
|
@@ -35690,14 +35812,14 @@ var CopilotAdapter = class {
|
|
|
35690
35812
|
const events = await bounded(readPersistedEvents(client, sourceId));
|
|
35691
35813
|
const start = events.find((event) => event.type === "session.start");
|
|
35692
35814
|
const sourceCwd = start?.data.context?.cwd;
|
|
35693
|
-
if (!sourceCwd || await realpath2(sourceCwd) !== await realpath2(
|
|
35815
|
+
if (!sourceCwd || await realpath2(sourceCwd) !== await realpath2(input2.cwd))
|
|
35694
35816
|
return reject("unsupported", "Copilot Fork must retain the source working directory.");
|
|
35695
35817
|
let toEventId;
|
|
35696
|
-
if (
|
|
35697
|
-
if (
|
|
35818
|
+
if (input2.kind === "fork") {
|
|
35819
|
+
if (input2.checkpoint.harnessId !== copilotId || input2.checkpoint.nativeSessionId !== sourceId || input2.checkpoint.formatVersion !== 1)
|
|
35698
35820
|
return reject("checkpointNotFound", "Copilot checkpoint does not belong to this source.");
|
|
35699
35821
|
try {
|
|
35700
|
-
toEventId = forkBoundary(events,
|
|
35822
|
+
toEventId = forkBoundary(events, input2.checkpoint.checkpointId);
|
|
35701
35823
|
} catch {
|
|
35702
35824
|
return reject("checkpointNotFound", "Copilot checkpoint was not found.");
|
|
35703
35825
|
}
|
|
@@ -35715,8 +35837,8 @@ var CopilotAdapter = class {
|
|
|
35715
35837
|
const ids = (values) => rootMessages(values).map((event) => event.data.messageId);
|
|
35716
35838
|
if (JSON.stringify(ids(actual)) !== JSON.stringify(ids(expected)))
|
|
35717
35839
|
throw new Error("Copilot Fork returned the wrong history prefix");
|
|
35718
|
-
const content = (id2, values) => projectHistory(id2, values).turns.map(({ input:
|
|
35719
|
-
input:
|
|
35840
|
+
const content = (id2, values) => projectHistory(id2, values).turns.map(({ input: input3, items, outcome }) => ({
|
|
35841
|
+
input: input3,
|
|
35720
35842
|
items,
|
|
35721
35843
|
outcome
|
|
35722
35844
|
}));
|
|
@@ -35724,18 +35846,18 @@ var CopilotAdapter = class {
|
|
|
35724
35846
|
throw new Error("Copilot Fork changed the visible history prefix");
|
|
35725
35847
|
const result = await this.open({
|
|
35726
35848
|
kind: "resume",
|
|
35727
|
-
nativeRef: sessionRef(created, sessionIsUnattended(
|
|
35728
|
-
cwd:
|
|
35729
|
-
...
|
|
35849
|
+
nativeRef: sessionRef(created, sessionIsUnattended(input2.sourceRef)),
|
|
35850
|
+
cwd: input2.cwd,
|
|
35851
|
+
...input2.environment ? { environment: input2.environment } : {}
|
|
35730
35852
|
});
|
|
35731
35853
|
if (!result.ok) {
|
|
35732
35854
|
primary = result.error;
|
|
35733
35855
|
return result;
|
|
35734
35856
|
}
|
|
35735
|
-
const state =
|
|
35736
|
-
effectiveModel:
|
|
35737
|
-
effectiveThinkingOptionId:
|
|
35738
|
-
effectivePermissionModeId:
|
|
35857
|
+
const state = input2.kind === "rollbackLastTurn" ? {
|
|
35858
|
+
effectiveModel: input2.model,
|
|
35859
|
+
effectiveThinkingOptionId: input2.thinkingOptionId,
|
|
35860
|
+
effectivePermissionModeId: input2.permissionModeId
|
|
35739
35861
|
} : source?.currentState();
|
|
35740
35862
|
try {
|
|
35741
35863
|
const derived = this.sessions.get(created);
|
|
@@ -35766,7 +35888,7 @@ var CopilotAdapter = class {
|
|
|
35766
35888
|
throw new CopilotOperationError(selected.error.code, selected.error.message, selected.error.diagnostic, selected.error.retryable, selected.error.stage);
|
|
35767
35889
|
}
|
|
35768
35890
|
} catch (error51) {
|
|
35769
|
-
primary = nativeError(error51, `session.${
|
|
35891
|
+
primary = nativeError(error51, `session.${input2.kind}`);
|
|
35770
35892
|
try {
|
|
35771
35893
|
await result.value.close();
|
|
35772
35894
|
} catch {
|
|
@@ -35778,7 +35900,7 @@ var CopilotAdapter = class {
|
|
|
35778
35900
|
completed = result.value;
|
|
35779
35901
|
return result;
|
|
35780
35902
|
} catch (error51) {
|
|
35781
|
-
primary = nativeError(error51, `session.${
|
|
35903
|
+
primary = nativeError(error51, `session.${input2.kind}`);
|
|
35782
35904
|
return { ok: false, error: primary };
|
|
35783
35905
|
} finally {
|
|
35784
35906
|
let cleanupFailed = !copyClosed;
|